# This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # star-1.6/ # star-1.6/star # star-1.6/star/Makefile # star-1.6/star/Makefile.dfl # star-1.6/star/Makefile.doc # star-1.6/star/Makefile.man # star-1.6/star/README # star-1.6/star/README.ACL # star-1.6/star/README.crash # star-1.6/star/README.dgux # star-1.6/star/README.largefiles # star-1.6/star/README.mtio # star-1.6/star/README.otherbugs # star-1.6/star/README.pattern # star-1.6/star/README.pax # star-1.6/star/README.posix-2001 # star-1.6/star/Racl.mk # star-1.6/star/Rcrash.mk # star-1.6/star/Rlargefiles.mk # star-1.6/star/Rmtio.mk # star-1.6/star/Rotherbugs.mk # star-1.6/star/Rpattern.mk # star-1.6/star/Rposix.mk # star-1.6/star/STARvsGNUTAR # star-1.6/star/acl_unix.c # star-1.6/star/acltext.c # star-1.6/star/all.mk # star-1.6/star/append.c # star-1.6/star/bitstring.h # star-1.6/star/buffer.c # star-1.6/star/chdir.c # star-1.6/star/checkerr.c # star-1.6/star/checkerr.h # star-1.6/star/cpio.c # star-1.6/star/cpio.mk # star-1.6/star/cpiohdr.c # star-1.6/star/create.c # star-1.6/star/create.dgux.patch # star-1.6/star/defaults.c # star-1.6/star/device.c # star-1.6/star/diff.c # star-1.6/star/diff.h # star-1.6/star/dirtime.c # star-1.6/star/dirtime.h # star-1.6/star/dumpdate.c # star-1.6/star/dumpdate.h # star-1.6/star/extract.c # star-1.6/star/findinfo.c # star-1.6/star/gnutar.mk # star-1.6/star/fflags.c # star-1.6/star/fifo.c # star-1.6/star/fifo.h # star-1.6/star/header.c # star-1.6/star/list.c # star-1.6/star/pax.mk # star-1.6/star/restore.c # star-1.6/star/star.c # star-1.6/star/star.mk # star-1.6/star/star_fat.c # star-1.6/star/gnutar.1 # star-1.6/star/gnutar.c # star-1.6/star/star_fat.mk # star-1.6/star/gnutarman.mk # star-1.6/star/starsubs.h # star-1.6/star/hole.c # star-1.6/star/lhash.c # star-1.6/star/suntar.mk # star-1.6/star/longnames.c # star-1.6/star/match.c # star-1.6/star/movearch.c # star-1.6/star/movearch.h # star-1.6/star/star.1 # star-1.6/star/pax.c # star-1.6/star/xheader.c # star-1.6/star/props.c # star-1.6/star/props.h # star-1.6/star/readme.mk # star-1.6/star/remove.c # star-1.6/star/restore.h # star-1.6/star/scpio.1 # star-1.6/star/scpioman.mk # star-1.6/star/spax.1 # star-1.6/star/spaxman.mk # star-1.6/star/ustar.1 # star-1.6/star/star.4 # star-1.6/star/star.dfl # star-1.6/star/star.h # star-1.6/star/star_unix.c # star-1.6/star/starformatman.mk # star-1.6/star/starvsgnutar.mk # star-1.6/star/subst.c # star-1.6/star/suntar.1 # star-1.6/star/suntar.c # star-1.6/star/suntarman.mk # star-1.6/star/table.c # star-1.6/star/table.h # star-1.6/star/testscripts.mk # star-1.6/star/unicode.c # star-1.6/star/volhdr.c # star-1.6/star/xattr.c # star-1.6/star/xtab.h # star-1.6/star/xutimes.h # star-1.6/star/ustarman.mk # star-1.6/star/pathname.c # star-1.6/star/pathname.h # star-1.6/star/paxopts.c # star-1.6/star/lpath_unix.c # star-1.6/star/version.c # star-1.6/libs # star-1.6/Makefile # star-1.6/lib # star-1.6/RULES # star-1.6/RULES/cc-sgi64.rul # star-1.6/RULES/powerpc-os400-cc.rul # star-1.6/RULES/powerpc-os400-gcc.rul # star-1.6/RULES/os-os400.id # star-1.6/RULES/x86_64-linux-pcc.rul # star-1.6/RULES/i586-linux-gcc.rul # star-1.6/RULES/i386-netbsd-clang.rul # star-1.6/RULES/os-mingw32_nt-6.0.id # star-1.6/RULES/os-sunos5.def # star-1.6/RULES/os-unix_sv.id # star-1.6/RULES/os-unixware.def # star-1.6/RULES/os-unixware.id # star-1.6/RULES/pci-qnx-cc.rul # star-1.6/RULES/rules.ins # star-1.6/RULES/rules.aux # star-1.6/RULES/i686-mingw32_nt-gcc.rul # star-1.6/RULES/powerpc-beos-gcc.rul # star-1.6/RULES/r-gmake.tag # star-1.6/RULES/rules.csw # star-1.6/RULES/rules1.dir # star-1.6/RULES/profiled.lnk # star-1.6/RULES/rules.inc # star-1.6/RULES/README # star-1.6/RULES/power-macintosh-darwin-cc.rul # star-1.6/RULES/power-macintosh-darwin-gcc.rul # star-1.6/RULES/rules.dep # star-1.6/RULES/sub.htm # star-1.6/RULES/aviion-dgux3-cc.rul # star-1.6/RULES/alpha-osf1-gcc.rul # star-1.6/RULES/hppa-nextstep-gcc.rul # star-1.6/RULES/bemac-beos-mwcc.rul # star-1.6/RULES/bepc-beos-cc.rul # star-1.6/RULES/i386-at386-gnu-cc.rul # star-1.6/RULES/rules.dir # star-1.6/RULES/rules.drv # star-1.6/RULES/i386-freebsd-gcc.rul # star-1.6/RULES/cc-hp.rul # star-1.6/RULES/cc-ibm.rul # star-1.6/RULES/cc-hp64.rul # star-1.6/RULES/os-beos.def # star-1.6/RULES/i386-openbsd-gcc.rul # star-1.6/RULES/ldummy.cnf # star-1.6/RULES/os-os400.def # star-1.6/RULES/rules.top # star-1.6/RULES/os-amigaos.id # star-1.6/RULES/i386-unixware-gcc.rul # star-1.6/RULES/os-gnu-kfreebsd.def # star-1.6/RULES/i486-cygwin32_nt-cc.rul # star-1.6/RULES/i486-cygwin32_nt-gcc.rul # star-1.6/RULES/os-gnu-kfreebsd.id # star-1.6/RULES/i586-pyro-cc.rul # star-1.6/RULES/i586-pyro-gcc.rul # star-1.6/RULES/cc-clang.rul # star-1.6/RULES/i386-darwin-clang.rul # star-1.6/RULES/os-beos.id # star-1.6/RULES/os-cygwin_98-4.10.id # star-1.6/RULES/ip22-irix-cc.rul # star-1.6/RULES/ip22-irix-gcc.rul # star-1.6/RULES/m68k-amigaos-gcc.rul # star-1.6/RULES/sun4-sunos5-gcc.rul # star-1.6/RULES/i386-freebsd-clang.rul # star-1.6/RULES/i386-freebsd-cc.rul # star-1.6/RULES/os-bsd-os.def # star-1.6/RULES/os-bsd-os.id # star-1.6/RULES/os-bsd-os3.def # star-1.6/RULES/os-cygwin32_nt.def # star-1.6/RULES/os-cygwin32_nt.id # star-1.6/RULES/os-cygwin_95-4.0.id # star-1.6/RULES/cc-apollo.rul # star-1.6/RULES/os-freebsd.def # star-1.6/RULES/os-freebsd.id # star-1.6/RULES/os-gnu.id # star-1.6/RULES/os-haiku.id # star-1.6/RULES/os-hp-ux.def # star-1.6/RULES/os-hp-ux.id # star-1.6/RULES/os-irix.def # star-1.6/RULES/os-irix.id # star-1.6/RULES/os-linux.def # star-1.6/RULES/os-mingw32_nt-5.2.id # star-1.6/RULES/os-mingw32_nt.def # star-1.6/RULES/os-mingw32_nt.id # star-1.6/RULES/os-rhapsody.def # star-1.6/RULES/os-rhapsody.id # star-1.6/RULES/os-sco_sv.id # star-1.6/RULES/os-sunos.id # star-1.6/RULES/os-sunos4.def # star-1.6/RULES/sun4-sunos5-cc.rul # star-1.6/RULES/version # star-1.6/RULES/x86-interix-cc.rul # star-1.6/RULES/x86-interix-cl.rul # star-1.6/RULES/rules.env # star-1.6/RULES/rules.lnt # star-1.6/RULES/rules.nul # star-1.6/RULES/power-macintosh-rhapsody-cc.rul # star-1.6/RULES/r-smake.obj # star-1.6/RULES/power-macintosh-rhapsody-gcc.rul # star-1.6/RULES/man-bsd.def # star-1.6/RULES/r-make.obj # star-1.6/RULES/r-make.tag # star-1.6/RULES/rules.clr # star-1.6/RULES/r-smake.tag # star-1.6/RULES/rs6000-aix-cc.rul # star-1.6/RULES/rs6000-aix-gcc.rul # star-1.6/RULES/rules.shl # star-1.6/RULES/rules.cst # star-1.6/RULES/rules.rdi # star-1.6/RULES/os-qnx.id # star-1.6/RULES/rules.mkd # star-1.6/RULES/rules.mks # star-1.6/RULES/rules.mod # star-1.6/RULES/rules.obj # star-1.6/RULES/i386-mingw32_nt-gcc.rul # star-1.6/RULES/i386-netbsd-cc.rul # star-1.6/RULES/rules.scr # star-1.6/RULES/rules.htm # star-1.6/RULES/rules.tag # star-1.6/RULES/os-qnx.def # star-1.6/RULES/cc-msc64.rul # star-1.6/RULES/9000-725-hp-ux-cc.rul # star-1.6/RULES/os-pyro.def # star-1.6/RULES/os-pyro.id # star-1.6/RULES/sun3-sunos4-cc.rul # star-1.6/RULES/sun4-sunos4-cc.rul # star-1.6/RULES/sun3-sunos4-gcc.rul # star-1.6/RULES/sun4-sunos4-gcc.rul # star-1.6/RULES/i386-netbsd-gcc.rul # star-1.6/RULES/i386-openbsd-cc.rul # star-1.6/RULES/i386-bsd-os3-gcc.rul # star-1.6/RULES/local.cnf # star-1.6/RULES/powerpc-beos-mwcc.rul # star-1.6/RULES/os-mingw32_nt-6.2.id # star-1.6/RULES/os-mingw32_nt-6.3.id # star-1.6/RULES/os-mingw32_nt-6.4.id # star-1.6/RULES/r-sunpro.dep # star-1.6/RULES/cc-gcc.rul # star-1.6/RULES/i386-openserver-gcc.rul # star-1.6/RULES/i386-bsd-os-gcc.rul # star-1.6/RULES/i386-bsd-os3-cc.rul # star-1.6/RULES/os-cygwin_nt-6.3-wow64.id # star-1.6/RULES/os-cygwin_nt-6.3.id # star-1.6/RULES/mk-sunpro.id # star-1.6/RULES/i486-cygwin32_nt-cl.rul # star-1.6/RULES/man-sysv.def # star-1.6/RULES/news4000-newsos6-cc.rul # star-1.6/RULES/os-aix.def # star-1.6/RULES/os-aix.id # star-1.6/RULES/os-amigaos.def # star-1.6/RULES/os-interix.def # star-1.6/RULES/os-interix.id # star-1.6/RULES/x86-interix-gcc.rul # star-1.6/RULES/x86pc-qnx-gcc.rul # star-1.6/RULES/rules.oes # star-1.6/RULES/rules.oev # star-1.6/RULES/i586-linux-cc.rul # star-1.6/RULES/alpha-openvms-cc.rul # star-1.6/RULES/alpha-osf1-cc.rul # star-1.6/RULES/os-interix-nt-6.1.id # star-1.6/RULES/os-cygwin_nt-6.2-wow64.id # star-1.6/RULES/os-cygwin_nt-6.2.id # star-1.6/RULES/os-mingw32_nt-6.1.id # star-1.6/RULES/rules.lib # star-1.6/RULES/dynamic.lnk # star-1.6/RULES/static.lnk # star-1.6/RULES/rules.dyn # star-1.6/RULES/rules.cpl # star-1.6/RULES/os-cygwin_nt-5.2.id # star-1.6/RULES/os-interix-nt-4.0.id # star-1.6/RULES/os-interix-nt-5.0.id # star-1.6/RULES/os-interix-nt-5.1.id # star-1.6/RULES/os-interix-nt-5.2.id # star-1.6/RULES/i586-linux-suncc.rul # star-1.6/RULES/i86pc-sunos5-pcc.rul # star-1.6/RULES/i486-mingw32_nt-gcc.rul # star-1.6/RULES/rules.pkg # star-1.6/RULES/rules.tpk # star-1.6/RULES/os-osf1.def # star-1.6/RULES/i386-at386-gnu-gcc.rul # star-1.6/RULES/os-osf1.id # star-1.6/RULES/i586-mingw32_nt-gcc.rul # star-1.6/RULES/cc-openvms.rul # star-1.6/RULES/cc-pcc.rul # star-1.6/RULES/atarist-freemint-gcc.rul # star-1.6/RULES/i586-syllable-cc.rul # star-1.6/RULES/i586-syllable-gcc.rul # star-1.6/RULES/os-syllable.def # star-1.6/RULES/os-syllable.id # star-1.6/RULES/os-linux.id # star-1.6/RULES/bepc-haiku-cc.rul # star-1.6/RULES/bepc-haiku-gcc.rul # star-1.6/RULES/os-haiku.def # star-1.6/RULES/rules1.top # star-1.6/RULES/rules.prg # star-1.6/RULES/os-interix-nt-6.0.id # star-1.6/RULES/os-cygwin_nt-6.0.id # star-1.6/RULES/os-cygwin_nt-6.1-wow64.id # star-1.6/RULES/os-cygwin_nt-6.1.id # star-1.6/RULES/os-dgux4.def # star-1.6/RULES/os-domainos.def # star-1.6/RULES/os-cygwin32_wow64.def # star-1.6/RULES/os-cygwin32_wow64.id # star-1.6/RULES/os-cygwin_nt-5.2-wow64.id # star-1.6/RULES/i686-cygwin32_wow64-cl64.rul # star-1.6/RULES/rules.cnf # star-1.6/RULES/i386-minix-clang.rul # star-1.6/RULES/os-os-2.id # star-1.6/RULES/os-os2.def # star-1.6/RULES/cc-msc.rul # star-1.6/RULES/cc-sun.rul # star-1.6/RULES/os-minix.id # star-1.6/RULES/os-openvms.id # star-1.6/RULES/MKLINKS # star-1.6/RULES/hppa-nextstep-cc.rul # star-1.6/RULES/i386-openserver-cc.rul # star-1.6/RULES/rules.cmd # star-1.6/RULES/rules.sps # star-1.6/RULES/os-minix.def # star-1.6/RULES/os-news-os.id # star-1.6/RULES/os-newsos6.def # star-1.6/RULES/os-nextstep.def # star-1.6/RULES/os-nextstep.id # star-1.6/RULES/os-openbsd.def # star-1.6/RULES/os-openbsd.id # star-1.6/RULES/os-openserver.def # star-1.6/RULES/os-openvms.def # star-1.6/RULES/r-smake.dep # star-1.6/RULES/cc-msposix.rul # star-1.6/RULES/rules.ars # star-1.6/RULES/cc-sony.rul # star-1.6/RULES/cc-sunpro.rul # star-1.6/RULES/rules.rel # star-1.6/RULES/cc-sco_uw.rul # star-1.6/RULES/cc-sgi.rul # star-1.6/RULES/os-netbsd.id # star-1.6/RULES/r-make.dep # star-1.6/RULES/cc-sco_os.rul # star-1.6/RULES/os-cygwin_nt-6.3-wow.id # star-1.6/RULES/cc-dg.rul # star-1.6/RULES/cc-dumb.rul # star-1.6/RULES/os-cygwin_nt-6.2-wow.id # star-1.6/RULES/os-darwin.def # star-1.6/RULES/os-darwin.id # star-1.6/RULES/os-dgux.id # star-1.6/RULES/os-dgux3.def # star-1.6/RULES/cc-dec.rul # star-1.6/RULES/cc-bemwcc.rul # star-1.6/RULES/os-cygwin_nt-6.1-wow.id # star-1.6/RULES/mk-.id # star-1.6/RULES/mk-gmake.id # star-1.6/RULES/mk-smake.id # star-1.6/RULES/os-cygwin_nt-6.0-wow.id # star-1.6/RULES/os-cygwin_nt-6.0-wow64.id # star-1.6/RULES/os-domainos.id # star-1.6/RULES/bemac-beos-cc.rul # star-1.6/RULES/i386-bsd-os-cc.rul # star-1.6/RULES/i86pc-sunos5-cc.rul # star-1.6/RULES/i86pc-sunos5-gcc.rul # star-1.6/RULES/rules.loc # star-1.6/RULES/i586-linux-clang.rul # star-1.6/RULES/i86pc-sunos5-clang.rul # star-1.6/RULES/sun4-sunos5-clang.rul # star-1.6/RULES/r-gmake.dep # star-1.6/RULES/i786-mingw32_nt-gcc.rul # star-1.6/RULES/os-mac-os.id # star-1.6/RULES/os-mac-os10.def # star-1.6/RULES/os-mingw32_95-4.0.id # star-1.6/RULES/os-mingw32_98-4.0.id # star-1.6/RULES/os-mingw32_98-4.10.id # star-1.6/RULES/os-mingw32_me-4.90.id # star-1.6/RULES/os-mingw32_nt-4.0.id # star-1.6/RULES/os-mingw32_nt-5.0.id # star-1.6/RULES/os-mingw32_nt-5.1.id # star-1.6/RULES/os-ms-dos.def # star-1.6/RULES/os-ms-dos.id # star-1.6/RULES/os-netbsd.def # star-1.6/RULES/gmake.wrn # star-1.6/RULES/rules.man # star-1.6/RULES/os-cygwin_nt-5.2-wow.id # star-1.6/RULES/os-dragonfly.def # star-1.6/RULES/os-dragonfly.id # star-1.6/RULES/os-freemint.def # star-1.6/RULES/os-cygwin32_wow.def # star-1.6/RULES/os-cygwin32_wow.id # star-1.6/RULES/os-cygwin_nt-6.4-wow.id # star-1.6/RULES/os-cygwin_nt-6.4-wow64.id # star-1.6/RULES/os-cygwin_nt-6.4.id # star-1.6/RULES/os-cygwin_nt-10.0-wow.id # star-1.6/RULES/os-cygwin_nt-10.0-wow64.id # star-1.6/RULES/os-cygwin_nt-10.0.id # star-1.6/RULES/os-cygwin_nt-5.1.id # star-1.6/RULES/os-freemint.id # star-1.6/RULES/os-gnu.def # star-1.6/RULES/amd64-bitrig-clang.rul # star-1.6/RULES/os-bitrig.def # star-1.6/RULES/os-bitrig.id # star-1.6/RULES/os-cygwin_me-4.90.id # star-1.6/RULES/os-cygwin_nt-4.0.id # star-1.6/RULES/os-cygwin_nt-5.0.id # star-1.6/RULES/rules.tst # star-1.6/RULES/rules.hlp # star-1.6/RULES/9000-725-hp-ux-gcc.rul # star-1.6/RULES/aviion-dgux3-gcc.rul # star-1.6/RULES/aviion-dgux4-cc.rul # star-1.6/RULES/aviion-dgux4-gcc.rul # star-1.6/RULES/bepc-beos-gcc.rul # star-1.6/RULES/dn5500-domainos-cc.rul # star-1.6/RULES/dummy.dep # star-1.6/RULES/i386-ms-dos-gcc.rul # star-1.6/RULES/i386-os2-gcc.rul # star-1.6/RULES/i386-unixware-cc.rul # star-1.6/DEFAULTS # star-1.6/DEFAULTS/Defaults # star-1.6/DEFAULTS/Defaults.aix # star-1.6/DEFAULTS/Defaults.dgux # star-1.6/DEFAULTS/Defaults.dgux3 # star-1.6/DEFAULTS/Defaults.dgux4 # star-1.6/DEFAULTS/Defaults.freebsd # star-1.6/DEFAULTS/Defaults.hp-ux # star-1.6/DEFAULTS/Defaults.irix # star-1.6/DEFAULTS/Defaults.linux # star-1.6/DEFAULTS/Defaults.sunos4 # star-1.6/DEFAULTS/Defaults.sunos5 # star-1.6/DEFAULTS/Defaults.netbsd # star-1.6/DEFAULTS/Defaults.openbsd # star-1.6/DEFAULTS/Defaults.cygwin32_nt # star-1.6/DEFAULTS/MKLINKS # star-1.6/DEFAULTS/Defaults.bsd-os # star-1.6/DEFAULTS/Defaults.osf1 # star-1.6/DEFAULTS/Defaults.nextstep # star-1.6/DEFAULTS/Defaults.rhapsody # star-1.6/DEFAULTS/vc7-setup # star-1.6/DEFAULTS/Defaults.newsos6 # star-1.6/DEFAULTS/Defaults.beos # star-1.6/DEFAULTS/Defaults.os2 # star-1.6/DEFAULTS/Defaults.qnx # star-1.6/DEFAULTS/Defaults.openserver # star-1.6/DEFAULTS/Defaults.unixware # star-1.6/DEFAULTS/Defaults.mac-os10 # star-1.6/DEFAULTS/Defaults.darwin # star-1.6/DEFAULTS/Defaults.domainos # star-1.6/DEFAULTS/Defaults.amigaos # star-1.6/DEFAULTS/Defaults.gnu # star-1.6/DEFAULTS/Defaults.bsd-os3 # star-1.6/DEFAULTS/Defaults.ms-dos # star-1.6/DEFAULTS/Defaults.mingw32_nt # star-1.6/DEFAULTS/Defaults.interix # star-1.6/DEFAULTS/dummy-setup # star-1.6/DEFAULTS/vc6-setup # star-1.6/DEFAULTS/vc6-cygwin-setup # star-1.6/DEFAULTS/vc6-interix-setup # star-1.6/DEFAULTS/vc9-setup # star-1.6/DEFAULTS/vc7-cygwin-setup # star-1.6/DEFAULTS/vc7-interix-setup # star-1.6/DEFAULTS/Defaults.dragonfly # star-1.6/DEFAULTS/Defaults.freemint # star-1.6/DEFAULTS/Defaults.syllable # star-1.6/DEFAULTS/Defaults.haiku # star-1.6/DEFAULTS/vc7_64-cygwin-setup # star-1.6/DEFAULTS/vc7_64-setup # star-1.6/DEFAULTS/Defaults.cygwin32_wow64 # star-1.6/DEFAULTS/vc9-cygwin-setup # star-1.6/DEFAULTS/Defaults.openvms # star-1.6/DEFAULTS/Defaults.gnu-kfreebsd # star-1.6/DEFAULTS/Defaults.pyro # star-1.6/DEFAULTS/Defaults.cygwin32_wow # star-1.6/DEFAULTS/Defaults.bitrig # star-1.6/DEFAULTS/Defaults.minix # star-1.6/DEFAULTS/Defaults.os400 # star-1.6/DEFAULTS_ENG # star-1.6/DEFAULTS_ENG/Defaults # star-1.6/DEFAULTS_ENG/Defaults.aix # star-1.6/DEFAULTS_ENG/Defaults.dgux # star-1.6/DEFAULTS_ENG/Defaults.dgux3 # star-1.6/DEFAULTS_ENG/Defaults.dgux4 # star-1.6/DEFAULTS_ENG/Defaults.freebsd # star-1.6/DEFAULTS_ENG/Defaults.hp-ux # star-1.6/DEFAULTS_ENG/Defaults.irix # star-1.6/DEFAULTS_ENG/Defaults.linux # star-1.6/DEFAULTS_ENG/Defaults.sunos4 # star-1.6/DEFAULTS_ENG/Defaults.sunos5 # star-1.6/DEFAULTS_ENG/README # star-1.6/DEFAULTS_ENG/Defaults.netbsd # star-1.6/DEFAULTS_ENG/Defaults.openbsd # star-1.6/DEFAULTS_ENG/Defaults.bsd-os # star-1.6/DEFAULTS_ENG/Defaults.cygwin32_nt # star-1.6/DEFAULTS_ENG/MKLINKS # star-1.6/DEFAULTS_ENG/Defaults.osf1 # star-1.6/DEFAULTS_ENG/Defaults.nextstep # star-1.6/DEFAULTS_ENG/Defaults.rhapsody # star-1.6/DEFAULTS_ENG/Defaults.newsos6 # star-1.6/DEFAULTS_ENG/Defaults.beos # star-1.6/DEFAULTS_ENG/Defaults.os2 # star-1.6/DEFAULTS_ENG/Defaults.qnx # star-1.6/DEFAULTS_ENG/Defaults.openserver # star-1.6/DEFAULTS_ENG/Defaults.unixware # star-1.6/DEFAULTS_ENG/Defaults.mac-os10 # star-1.6/DEFAULTS_ENG/Defaults.darwin # star-1.6/DEFAULTS_ENG/Defaults.domainos # star-1.6/DEFAULTS_ENG/Defaults.amigaos # star-1.6/DEFAULTS_ENG/Defaults.gnu # star-1.6/DEFAULTS_ENG/Defaults.bsd-os3 # star-1.6/DEFAULTS_ENG/Defaults.ms-dos # star-1.6/DEFAULTS_ENG/Defaults.mingw32_nt # star-1.6/DEFAULTS_ENG/Defaults.interix # star-1.6/DEFAULTS_ENG/vc7-setup # star-1.6/DEFAULTS_ENG/dummy-setup # star-1.6/DEFAULTS_ENG/vc6-setup # star-1.6/DEFAULTS_ENG/vc6-cygwin-setup # star-1.6/DEFAULTS_ENG/vc6-interix-setup # star-1.6/DEFAULTS_ENG/vc7-cygwin-setup # star-1.6/DEFAULTS_ENG/vc7-interix-setup # star-1.6/DEFAULTS_ENG/Defaults.dragonfly # star-1.6/DEFAULTS_ENG/Defaults.freemint # star-1.6/DEFAULTS_ENG/Defaults.syllable # star-1.6/DEFAULTS_ENG/Defaults.haiku # star-1.6/DEFAULTS_ENG/vc7_64-cygwin-setup # star-1.6/DEFAULTS_ENG/vc7_64-setup # star-1.6/DEFAULTS_ENG/Defaults.cygwin32_wow64 # star-1.6/DEFAULTS_ENG/Defaults.openvms # star-1.6/DEFAULTS_ENG/vc9-cygwin-setup # star-1.6/DEFAULTS_ENG/vc9-setup # star-1.6/DEFAULTS_ENG/Defaults.gnu-kfreebsd # star-1.6/DEFAULTS_ENG/Defaults.pyro # star-1.6/DEFAULTS_ENG/Defaults.cygwin32_wow # star-1.6/DEFAULTS_ENG/Defaults.bitrig # star-1.6/DEFAULTS_ENG/Defaults.minix # star-1.6/DEFAULTS_ENG/Defaults.os400 # star-1.6/include # star-1.6/include/Makefile # star-1.6/include/schily # star-1.6/include/schily/fnmatch.h # star-1.6/include/schily/dirent.h # star-1.6/include/schily/btorder.h # star-1.6/include/schily/ccomdefs.h # star-1.6/include/schily/deflts.h # star-1.6/include/schily/device.h # star-1.6/include/schily/fcntl.h # star-1.6/include/schily/mman.h # star-1.6/include/schily/getargs.h # star-1.6/include/schily/getcwd.h # star-1.6/include/schily/intcvt.h # star-1.6/include/schily/jmpdefs.h # star-1.6/include/schily/libport.h # star-1.6/include/schily/librmt.h # star-1.6/include/schily/maxpath.h # star-1.6/include/schily/mconfig.h # star-1.6/include/schily/mtio.h # star-1.6/include/schily/signal.h # star-1.6/include/schily/patmatch.h # star-1.6/include/schily/prototyp.h # star-1.6/include/schily/rmtio.h # star-1.6/include/schily/schily.h # star-1.6/include/schily/sigblk.h # star-1.6/include/schily/stat.h # star-1.6/include/schily/time.h # star-1.6/include/schily/standard.h # star-1.6/include/schily/stdlib.h # star-1.6/include/schily/string.h # star-1.6/include/schily/stkframe.h # star-1.6/include/schily/termios.h # star-1.6/include/schily/termcap.h # star-1.6/include/schily/unistd.h # star-1.6/include/schily/utime.h # star-1.6/include/schily/varargs.h # star-1.6/include/schily/wait.h # star-1.6/include/schily/utypes.h # star-1.6/include/schily/alloca.h # star-1.6/include/schily/nlsdefs.h # star-1.6/include/schily/align.h # star-1.6/include/schily/avoffset.h # star-1.6/include/schily/xmconfig.h # star-1.6/include/schily/errno.h # star-1.6/include/schily/archdefs.h # star-1.6/include/schily/xconfig.h # star-1.6/include/schily/Makefile # star-1.6/include/schily/align.mk # star-1.6/include/schily/alloca.mk # star-1.6/include/schily/archdefs.mk # star-1.6/include/schily/avoffset.mk # star-1.6/include/schily/btorder.mk # star-1.6/include/schily/ccomdefs.mk # star-1.6/include/schily/deflts.mk # star-1.6/include/schily/device.mk # star-1.6/include/schily/dirent.mk # star-1.6/include/schily/errno.mk # star-1.6/include/schily/fcntl.mk # star-1.6/include/schily/fnmatch.mk # star-1.6/include/schily/getargs.mk # star-1.6/include/schily/getcwd.mk # star-1.6/include/schily/intcvt.mk # star-1.6/include/schily/jmpdefs.mk # star-1.6/include/schily/types.mk # star-1.6/include/schily/libport.mk # star-1.6/include/schily/librmt.mk # star-1.6/include/schily/maxpath.mk # star-1.6/include/schily/mconfig.mk # star-1.6/include/schily/mman.mk # star-1.6/include/schily/mtio.mk # star-1.6/include/schily/nlsdefs.mk # star-1.6/include/schily/patmatch.mk # star-1.6/include/schily/prototyp.mk # star-1.6/include/schily/rmtio.mk # star-1.6/include/schily/schily.mk # star-1.6/include/schily/sigblk.mk # star-1.6/include/schily/signal.mk # star-1.6/include/schily/standard.mk # star-1.6/include/schily/stat.mk # star-1.6/include/schily/stdlib.mk # star-1.6/include/schily/stkframe.mk # star-1.6/include/schily/string.mk # star-1.6/include/schily/termcap.mk # star-1.6/include/schily/termios.mk # star-1.6/include/schily/time.mk # star-1.6/include/schily/unistd.mk # star-1.6/include/schily/iconv.h # star-1.6/include/schily/utime.mk # star-1.6/include/schily/utypes.mk # star-1.6/include/schily/varargs.mk # star-1.6/include/schily/wait.mk # star-1.6/include/schily/xconfig.mk # star-1.6/include/schily/xmconfig.mk # star-1.6/include/schily/types.h # star-1.6/include/schily/param.mk # star-1.6/include/schily/param.h # star-1.6/include/schily/wchar.mk # star-1.6/include/schily/wchar.h # star-1.6/include/schily/schilyp.mk # star-1.6/include/schily/schilyp.h # star-1.6/include/schily/iconv.mk # star-1.6/include/schily/ioctl.h # star-1.6/include/schily/siconv.mk # star-1.6/include/schily/siconv.h # star-1.6/include/schily/ioctl.mk # star-1.6/include/schily/checkerr.h # star-1.6/include/schily/checkerr.mk # star-1.6/include/schily/fstream.h # star-1.6/include/schily/find.mk # star-1.6/include/schily/find.h # star-1.6/include/schily/walk.mk # star-1.6/include/schily/walk.h # star-1.6/include/schily/stdio.h # star-1.6/include/schily/fetchdir.h # star-1.6/include/schily/fetchdir.mk # star-1.6/include/schily/idcache.h # star-1.6/include/schily/idcache.mk # star-1.6/include/schily/hostname.h # star-1.6/include/schily/hostname.mk # star-1.6/include/schily/fstream.mk # star-1.6/include/schily/stdio.mk # star-1.6/include/schily/sysexits.h # star-1.6/include/schily/sysexits.mk # star-1.6/include/schily/wctype.h # star-1.6/include/schily/wctype.mk # star-1.6/include/schily/dlfcn.h # star-1.6/include/schily/dlfcn.mk # star-1.6/include/schily/shcall.h # star-1.6/include/schily/shcall.mk # star-1.6/include/schily/limits.h # star-1.6/include/schily/limits.mk # star-1.6/include/schily/locale.h # star-1.6/include/schily/md4.h # star-1.6/include/schily/locale.mk # star-1.6/include/schily/md4.mk # star-1.6/include/schily/md5.h # star-1.6/include/schily/md5.mk # star-1.6/include/schily/sigset.h # star-1.6/include/schily/sigset.mk # star-1.6/include/schily/pwd.h # star-1.6/include/schily/pwd.mk # star-1.6/include/schily/grp.h # star-1.6/include/schily/grp.mk # star-1.6/include/schily/ctype.h # star-1.6/include/schily/ctype.mk # star-1.6/include/schily/Targets # star-1.6/include/schily/sha1.h # star-1.6/include/schily/in.h # star-1.6/include/schily/in.mk # star-1.6/include/schily/inet.h # star-1.6/include/schily/inet.mk # star-1.6/include/schily/io.h # star-1.6/include/schily/io.mk # star-1.6/include/schily/netdb.h # star-1.6/include/schily/netdb.mk # star-1.6/include/schily/setjmp.h # star-1.6/include/schily/setjmp.mk # star-1.6/include/schily/shadow.h # star-1.6/include/schily/shadow.mk # star-1.6/include/schily/socket.h # star-1.6/include/schily/socket.mk # star-1.6/include/schily/times.h # star-1.6/include/schily/times.mk # star-1.6/include/schily/utsname.h # star-1.6/include/schily/utsname.mk # star-1.6/include/schily/vfork.h # star-1.6/include/schily/vfork.mk # star-1.6/include/schily/systeminfo.h # star-1.6/include/schily/systeminfo.mk # star-1.6/include/schily/sha1.mk # star-1.6/include/schily/resource.h # star-1.6/include/schily/resource.mk # star-1.6/include/schily/select.h # star-1.6/include/schily/select.mk # star-1.6/include/schily/priv.h # star-1.6/include/schily/priv.mk # star-1.6/include/schily/assert.h # star-1.6/include/schily/assert.mk # star-1.6/include/schily/syslog.h # star-1.6/include/schily/syslog.mk # star-1.6/include/schily/procfs.h # star-1.6/include/schily/procfs.mk # star-1.6/include/schily/float.h # star-1.6/include/schily/float.mk # star-1.6/include/schily/ipc.h # star-1.6/include/schily/ipc.mk # star-1.6/include/schily/sem.h # star-1.6/include/schily/sem.mk # star-1.6/include/schily/shm.h # star-1.6/include/schily/shm.mk # star-1.6/include/schily/rmd160.h # star-1.6/include/schily/rmd160.mk # star-1.6/include/schily/sha2.h # star-1.6/include/schily/sha2.mk # star-1.6/include/schily/math.h # star-1.6/include/schily/math.mk # star-1.6/include/schily/dbgmalloc.h # star-1.6/include/schily/dbgmalloc.mk # star-1.6/include/schily/libgen.h # star-1.6/include/schily/libgen.mk # star-1.6/include/schily/_regex.h # star-1.6/include/schily/_regex.mk # star-1.6/include/schily/regex.h # star-1.6/include/schily/regex.mk # star-1.6/include/schily/windows.h # star-1.6/include/schily/windows.mk # star-1.6/include/schily/stdint.h # star-1.6/include/schily/stdint.mk # star-1.6/include/schily/inttypes.h # star-1.6/include/schily/inttypes.mk # star-1.6/include/schily/err_arch.h # star-1.6/include/schily/err_arch.mk # star-1.6/include/schily/err_bit.h # star-1.6/include/schily/err_bit.mk # star-1.6/include/schily/timeb.h # star-1.6/include/schily/poll.h # star-1.6/include/schily/err_char.h # star-1.6/include/schily/err_char.mk # star-1.6/include/schily/timeb.mk # star-1.6/include/schily/stdarg.h # star-1.6/include/schily/stdarg.mk # star-1.6/include/schily/poll.mk # star-1.6/include/schily/sunos4_proto.h # star-1.6/include/schily/sunos4_proto.mk # star-1.6/include/schily/shedit.h # star-1.6/include/schily/err_type.h # star-1.6/include/schily/err_type.mk # star-1.6/include/schily/shedit.mk # star-1.6/include/schily/sha3.h # star-1.6/include/schily/sha3.mk # star-1.6/include/schily/strar.h # star-1.6/include/schily/strar.mk # star-1.6/include/schily/getopt.h # star-1.6/include/schily/getopt.mk # star-1.6/include/schily/values.mk # star-1.6/include/schily/values.h # star-1.6/include/schily/type_val.h # star-1.6/include/schily/type_val.mk # star-1.6/README # star-1.6/man # star-1.6/man/man1 # star-1.6/man/man1/match.1 # star-1.6/man/man1/Makefile # star-1.6/man/man4 # star-1.6/man/man4/makefiles.4 # star-1.6/man/man4/makerules.4 # star-1.6/man/man4/Makefile # star-1.6/man/man4/makefiles.mk # star-1.6/man/man4/makerules.mk # star-1.6/man/Makefile # star-1.6/READMEs # star-1.6/READMEs/README.aix # star-1.6/READMEs/README.gmake # star-1.6/READMEs/README.hpux # star-1.6/READMEs/README.linux # star-1.6/READMEs/README.macosX # star-1.6/READMEs/README.macosX-old-versions # star-1.6/READMEs/README.mingw32 # star-1.6/READMEs/README.msdos # star-1.6/READMEs/README.ppc # star-1.6/READMEs/README.solaris # star-1.6/READMEs/README.win32 # star-1.6/READMEs/README.sunos # star-1.6/READMEs/README.install # star-1.6/TODO # star-1.6/Gmake # star-1.6/Gmake.linux # star-1.6/COPYING # star-1.6/README.compile # star-1.6/Changelog # star-1.6/.clean # star-1.6/AN-1.5 # star-1.6/STATUS.alpha # star-1.6/AN-1.2 # star-1.6/COMPILE # star-1.6/PORTING # star-1.6/BUILD # star-1.6/INSTALL # star-1.6/conf # star-1.6/conf/Makefile # star-1.6/conf/makeinc # star-1.6/conf/install-sh # star-1.6/conf/src-get # star-1.6/conf/oarch.sh # star-1.6/conf/mkdir-sh # star-1.6/conf/cc-config.sh # star-1.6/conf/mkdep-hpux.sh # star-1.6/conf/mkdep-sco.sh # star-1.6/conf/mkdep-aix.sh # star-1.6/conf/wget.sh # star-1.6/conf/srcroot.sh # star-1.6/conf/setup.sh # star-1.6/conf/mkdir.sh # star-1.6/conf/mkdep-msc.sh # star-1.6/conf/xconfig.mk # star-1.6/conf/post.html # star-1.6/conf/pre.html # star-1.6/conf/mkdep-msc-interix.sh # star-1.6/conf/runrmt_android # star-1.6/conf/runrmt_rsh # star-1.6/conf/runrmt_ssh # star-1.6/incs # star-1.6/inc # star-1.6/inc/Makefile # star-1.6/inc/align_test.c # star-1.6/inc/align_test.mk # star-1.6/inc/avoffset.c # star-1.6/inc/avoffset.mk # star-1.6/inc/getfp.c # star-1.6/inc/README # star-1.6/inc/MKLINKS # star-1.6/inc/fpoff.c # star-1.6/rmt # star-1.6/rmt/Makefile # star-1.6/rmt/rmt.c # star-1.6/rmt/rmt.1 # star-1.6/rmt/Makefile.man # star-1.6/rmt/rmt.dfl # star-1.6/rmt/Makefile.dfl # star-1.6/rmt/Makefile.doc # star-1.6/rmt/default-rmt.sample # star-1.6/configure # star-1.6/TEMPLATES # star-1.6/TEMPLATES/Defaults.gcc # star-1.6/TEMPLATES/Defaults.xcc # star-1.6/TEMPLATES/temp-gcc.rul # star-1.6/TEMPLATES/temp-xcc.rul # star-1.6/TEMPLATES/Makefile.aux # star-1.6/TEMPLATES/Makefile.cmd # star-1.6/TEMPLATES/Makefile.dir # star-1.6/TEMPLATES/Makefile.drv # star-1.6/TEMPLATES/Makefile.lib # star-1.6/TEMPLATES/Makefile.loc # star-1.6/TEMPLATES/Makefile.man # star-1.6/TEMPLATES/Makefile.mks # star-1.6/TEMPLATES/Makefile.root # star-1.6/TEMPLATES/Makefile.scr # star-1.6/TEMPLATES/Makefile.shl # star-1.6/TEMPLATES/Makefile_de.man # star-1.6/TEMPLATES/MKLINKS # star-1.6/TEMPLATES/Defaults.clang # star-1.6/TEMPLATES/Makefile.mod # star-1.6/TEMPLATES/Makefile.inc # star-1.6/TEMPLATES/Makefile.wrap # star-1.6/TEMPLATES/noshlxxx.mk # star-1.6/TEMPLATES/temp-clang.rul # star-1.6/mt # star-1.6/mt/Makefile # star-1.6/mt/mt.c # star-1.6/mt/Makefile.man # star-1.6/mt/smt.1 # star-1.6/mt/mt.mk1 # star-1.6/mt/mt.1 # star-1.6/libdeflt # star-1.6/libdeflt/default.c # star-1.6/libdeflt/Makefile # star-1.6/libdeflt/libdeflt.mk # star-1.6/libdeflt/Targets # star-1.6/libdeflt/libdeflt_p.mk # star-1.6/libdeflt/noshldeflt.mk # star-1.6/libdeflt/shldeflt.mk # star-1.6/libdeflt/libdeflt-mapvers # star-1.6/AN-1.3 # star-1.6/AN-1.3.1 # star-1.6/AN-1.4 # star-1.6/README.SSPM # star-1.6/tartest # star-1.6/tartest/tartest.c # star-1.6/tartest/Makefile # star-1.6/tartest/tartest.1 # star-1.6/tartest/tartestman.mk # star-1.6/autoconf # star-1.6/autoconf/acgeneral.m4 # star-1.6/autoconf/aclocal.m4 # star-1.6/autoconf/acoldnames.m4 # star-1.6/autoconf/acspecific.m4 # star-1.6/autoconf/autoconf # star-1.6/autoconf/autoconf.m4 # star-1.6/autoconf/autoheader.m4 # star-1.6/autoconf/config.guess # star-1.6/autoconf/config.sub # star-1.6/autoconf/configure.in # star-1.6/autoconf/install-sh # star-1.6/autoconf/rules.cnf.in # star-1.6/autoconf/xconfig.h.in # star-1.6/autoconf/configure # star-1.6/librmt # star-1.6/librmt/Makefile # star-1.6/librmt/remote.c # star-1.6/librmt/librmt.mk # star-1.6/librmt/Targets # star-1.6/librmt/librmt.3 # star-1.6/librmt/mtg2rmtg.3 # star-1.6/librmt/rmtclose.3 # star-1.6/librmt/rmtdebug.3 # star-1.6/librmt/librmt_p.mk # star-1.6/librmt/shlrmt.mk # star-1.6/librmt/rmtfilename.3 # star-1.6/librmt/rmtg2mtg.3 # star-1.6/librmt/rmtgetconn.3 # star-1.6/librmt/rmthostname.3 # star-1.6/librmt/rmtinit.3 # star-1.6/librmt/rmtioctl.3 # star-1.6/librmt/rmtopen.3 # star-1.6/librmt/rmtread.3 # star-1.6/librmt/rmtseek.3 # star-1.6/librmt/rmtstatus.3 # star-1.6/librmt/rmtwrite.3 # star-1.6/librmt/rmtxstatus.3 # star-1.6/librmt/mtg2rmtg.mk3 # star-1.6/librmt/rmtclose.mk3 # star-1.6/librmt/rmtdebug.mk3 # star-1.6/librmt/rmtfilename.mk3 # star-1.6/librmt/rmtg2mtg.mk3 # star-1.6/librmt/rmtgetconn.mk3 # star-1.6/librmt/rmthostname.mk3 # star-1.6/librmt/rmtinit.mk3 # star-1.6/librmt/rmtioctl.mk3 # star-1.6/librmt/rmtopen.mk3 # star-1.6/librmt/rmtread.mk3 # star-1.6/librmt/rmtseek.mk3 # star-1.6/librmt/rmtstatus.mk3 # star-1.6/librmt/rmtwrite.mk3 # star-1.6/librmt/rmtxstatus.mk3 # star-1.6/librmt/noshlrmt.mk # star-1.6/librmt/librmt-mapvers # star-1.6/librmt/Makefile.man # star-1.6/librmt/rmtrsh.3 # star-1.6/librmt/rmtrmt.3 # star-1.6/librmt/rmtrsh.mk3 # star-1.6/librmt/rmtrmt.mk3 # star-1.6/TARGETS # star-1.6/TARGETS/15conf # star-1.6/TARGETS/25inc # star-1.6/TARGETS/45librmt # star-1.6/TARGETS/25include # star-1.6/TARGETS/45lib # star-1.6/TARGETS/55rmt # star-1.6/TARGETS/55star # star-1.6/TARGETS/45libfind # star-1.6/TARGETS/55tartest # star-1.6/TARGETS/55star_sym # star-1.6/TARGETS/55mt # star-1.6/TARGETS/55cmd # star-1.6/TARGETS/85man # star-1.6/TARGETS/README # star-1.6/TARGETS/Targetdirs # star-1.6/TARGETS/__slot # star-1.6/TARGETS/44libdeflt # star-1.6/TARGETS/43libschily # star-1.6/libfind # star-1.6/libfind/Makefile # star-1.6/libfind/Targets # star-1.6/libfind/fetchdir.c # star-1.6/libfind/find.c # star-1.6/libfind/find_list.c # star-1.6/libfind/find_list.h # star-1.6/libfind/find_misc.c # star-1.6/libfind/find_misc.h # star-1.6/libfind/find_main.c # star-1.6/libfind/libfind-mapvers # star-1.6/libfind/libfind.mk # star-1.6/libfind/libfind_p.mk # star-1.6/libfind/idcache.c # star-1.6/libfind/walk.c # star-1.6/libfind/noshlfind.mk # star-1.6/libfind/shlfind.mk # star-1.6/libfind/cmpdir.c # star-1.6/libfind/find_tok.h # star-1.6/libfind/README # star-1.6/libfind/ptime.c # star-1.6/libfind/version.h # star-1.6/star_sym # star-1.6/star_sym/star_sym.c # star-1.6/star_sym/Makefile # star-1.6/star_sym/MKLINKS # star-1.6/star_sym/star_sym.1 # star-1.6/star_sym/star_sym.mk1 # star-1.6/CDDL.Schily.txt # star-1.6/CDDL.Sun.txt # star-1.6/LGPL-2.1.txt # star-1.6/GPL-2.0.txt # star-1.6/CONTRIBUTING # star-1.6/Makefile.old # star-1.6/pkgdefs # star-1.6/pkgdefs/CSW # star-1.6/pkgdefs/CSW/CSWstar # star-1.6/pkgdefs/CSW/CSWstar/Makefile # star-1.6/pkgdefs/CSW/CSWstar/copyright # star-1.6/pkgdefs/CSW/CSWstar/depend # star-1.6/pkgdefs/CSW/CSWstar/pkginfo # star-1.6/pkgdefs/CSW/CSWstar/prototype # star-1.6/Mcsw # star-1.6/proto # star-1.6/packages # star-1.6/AN-1.5.1 # star-1.6/.links # star-1.6/AN-1.5.2 # star-1.6/AN-1.5.3 # star-1.6/AN-1.6 # star-1.6/libschily # star-1.6/libschily/Makefile # star-1.6/libschily/stdio # star-1.6/libschily/stdio/fgetline.c # star-1.6/libschily/stdio/filewrite.c # star-1.6/libschily/stdio/flag.c # star-1.6/libschily/stdio/flush.c # star-1.6/libschily/stdio/fileopen.c # star-1.6/libschily/stdio/fileread.c # star-1.6/libschily/stdio/cvmod.c # star-1.6/libschily/stdio/fcons.c # star-1.6/libschily/stdio/niread.c # star-1.6/libschily/stdio/dat.c # star-1.6/libschily/stdio/fcons64.c # star-1.6/libschily/stdio/fileopen64.c # star-1.6/libschily/stdio/filesize.c # star-1.6/libschily/stdio/filesize64.c # star-1.6/libschily/stdio/niwrite.c # star-1.6/libschily/stdio/nixread.c # star-1.6/libschily/stdio/nixwrite.c # star-1.6/libschily/stdio/openfd.c # star-1.6/libschily/stdio/openfd64.c # star-1.6/libschily/stdio/fpipe.c # star-1.6/libschily/stdio/fdown.c # star-1.6/libschily/stdio/fileseek.c # star-1.6/libschily/stdio/fileseek64.c # star-1.6/libschily/stdio/file_raise.c # star-1.6/libschily/stdio/schilyio.h # star-1.6/libschily/stdio/ffileread.c # star-1.6/libschily/stdio/ffilewrite.c # star-1.6/libschily/stdio/fdup.c # star-1.6/libschily/stdio/fdup64.c # star-1.6/libschily/stdio/fgetstr.c # star-1.6/libschily/stdio/fileclose.c # star-1.6/libschily/stdio/fileluopen.c # star-1.6/libschily/stdio/fileluopen64.c # star-1.6/libschily/stdio/filepos.c # star-1.6/libschily/stdio/filepos64.c # star-1.6/libschily/stdio/filereopen.c # star-1.6/libschily/stdio/filereopen64.c # star-1.6/libschily/stdio/filestat.c # star-1.6/libschily/stdio/filestat64.c # star-1.6/libschily/stdio/peekc.c # star-1.6/libschily/stdio/filemopen.c # star-1.6/libschily/stdio/filemopen64.c # star-1.6/libschily/stdio/file_getraise.c # star-1.6/libschily/stdio/fgetaline.c # star-1.6/libschily/stdio/getdelim.c # star-1.6/libschily/getdomainname.c # star-1.6/libschily/astoi.c # star-1.6/libschily/comerr.c # star-1.6/libschily/error.c # star-1.6/libschily/movebytes.c # star-1.6/libschily/format.c # star-1.6/libschily/getfp.c # star-1.6/libschily/geterrno.c # star-1.6/libschily/fconv.c # star-1.6/libschily/fillbytes.c # star-1.6/libschily/printf.c # star-1.6/libschily/saveargs.c # star-1.6/libschily/streql.c # star-1.6/libschily/getargs.c # star-1.6/libschily/raisecond.c # star-1.6/libschily/Targets # star-1.6/libschily/swabbytes.c # star-1.6/libschily/libschily.mk # star-1.6/libschily/libschily_p.mk # star-1.6/libschily/shlschily.mk # star-1.6/libschily/gethostid.c # star-1.6/libschily/getav0.c # star-1.6/libschily/cvt.c # star-1.6/libschily/sprintf.c # star-1.6/libschily/usleep.c # star-1.6/libschily/jssnprintf.c # star-1.6/libschily/gethostname.c # star-1.6/libschily/jsprintf.c # star-1.6/libschily/jssprintf.c # star-1.6/libschily/cmpbytes.c # star-1.6/libschily/serrmsg.c # star-1.6/libschily/match.c # star-1.6/libschily/astoll.c # star-1.6/libschily/seterrno.c # star-1.6/libschily/strtod.c # star-1.6/libschily/fexec.c # star-1.6/libschily/strcatl.c # star-1.6/libschily/breakline.c # star-1.6/libschily/findbytes.c # star-1.6/libschily/findline.c # star-1.6/libschily/spawn.c # star-1.6/libschily/snprintf.c # star-1.6/libschily/setfp.c # star-1.6/libschily/matchl.c # star-1.6/libschily/handlecond.c # star-1.6/libschily/getpagesize.c # star-1.6/libschily/cmpnullbytes.c # star-1.6/libschily/rename.c # star-1.6/libschily/strdup.c # star-1.6/libschily/libschily.com # star-1.6/libschily/libschily-mapvers # star-1.6/libschily/astoull.c # star-1.6/libschily/strlcpy.c # star-1.6/libschily/strncpy.c # star-1.6/libschily/fnmatch.c # star-1.6/libschily/noshlschily.mk # star-1.6/libschily/mem.c # star-1.6/libschily/getnum.c # star-1.6/libschily/gettnum.c # star-1.6/libschily/getxnum.c # star-1.6/libschily/getxtnum.c # star-1.6/libschily/jmem.c # star-1.6/libschily/fjmem.c # star-1.6/libschily/fcomerr.c # star-1.6/libschily/checkerr.c # star-1.6/libschily/getperm.c # star-1.6/libschily/fstream.c # star-1.6/libschily/sleep.c # star-1.6/libschily/gettimeofday.c # star-1.6/libschily/eaccess.c # star-1.6/libschily/findinpath.c # star-1.6/libschily/matchw.c # star-1.6/libschily/matchwl.c # star-1.6/libschily/wcscatl.c # star-1.6/libschily/wcschr.c # star-1.6/libschily/wcscmp.c # star-1.6/libschily/wcscpy.c # star-1.6/libschily/wcseql.c # star-1.6/libschily/wcslcpy.c # star-1.6/libschily/wcslen.c # star-1.6/libschily/wcsncat.c # star-1.6/libschily/wcsncpy.c # star-1.6/libschily/wcsrchr.c # star-1.6/libschily/wcscat.c # star-1.6/libschily/wcsncmp.c # star-1.6/libschily/wcsdup.c # star-1.6/libschily/strcat.c # star-1.6/libschily/strchr.c # star-1.6/libschily/strcmp.c # star-1.6/libschily/strcpy.c # star-1.6/libschily/strncmp.c # star-1.6/libschily/strlen.c # star-1.6/libschily/strncat.c # star-1.6/libschily/strrchr.c # star-1.6/libschily/strlcat.c # star-1.6/libschily/wcslcat.c # star-1.6/libschily/strnlen.c # star-1.6/libschily/wcsnlen.c # star-1.6/libschily/basename.c # star-1.6/libschily/dirname.c # star-1.6/libschily/strndup.c # star-1.6/libschily/wcsndup.c # star-1.6/libschily/searchinpath.c # star-1.6/libschily/getexecpath.c # star-1.6/libschily/mkgmtime.c # star-1.6/libschily/timegm.c # star-1.6/libschily/permtostr.c # star-1.6/libschily/getgrent.c # star-1.6/libschily/uid.c # star-1.6/libschily/gid.c # star-1.6/libschily/getpwent.c # star-1.6/libschily/zerobytes.c # star-1.6/libschily/cmpmbytes.c # star-1.6/libschily/uname.c # star-1.6/libschily/dirent.c # star-1.6/libschily/kill.c # star-1.6/libschily/chown.c # star-1.6/libschily/getdtablesize.c # star-1.6/libschily/getlogin.c # star-1.6/libschily/mkstemp.c # star-1.6/libschily/strstr.c # star-1.6/libschily/wcsstr.c # star-1.6/libschily/abspath.c # star-1.6/libschily/at-defs.h # star-1.6/libschily/fchdir.c # star-1.6/libschily/wdabort.c # star-1.6/libschily/savewd.c # star-1.6/libschily/openat.c # star-1.6/libschily/lxchdir.c # star-1.6/libschily/procnameat.c # star-1.6/libschily/resolvepath.c # star-1.6/libschily/mkdirs.c # star-1.6/libschily/strcasecmp.c # star-1.6/libschily/strcasemap.c # star-1.6/libschily/strncasecmp.c # star-1.6/libschily/diropen.c # star-1.6/libschily/getnstimeofday.c # star-1.6/libschily/setnstimeofday.c # star-1.6/libschily/fchownat.c # star-1.6/libschily/fstatat.c # star-1.6/libschily/futimesat.c # star-1.6/libschily/linkat.c # star-1.6/libschily/mkdirat.c # star-1.6/libschily/mkfifoat.c # star-1.6/libschily/mknodat.c # star-1.6/libschily/readlinkat.c # star-1.6/libschily/renameat.c # star-1.6/libschily/symlinkat.c # star-1.6/libschily/unlinkat.c # star-1.6/libschily/utimensat.c # star-1.6/libschily/at-base.c # star-1.6/libschily/at-base2.c # star-1.6/libschily/fdopendir.c # star-1.6/libschily/utimens.c # star-1.6/libschily/mkfifo.c # star-1.6/libschily/futimens.c # star-1.6/libschily/lutimens.c # star-1.6/libschily/fprformat.c # star-1.6/libschily/strspn.c # star-1.6/libschily/wcsspn.c # star-1.6/libschily/strcspn.c # star-1.6/libschily/wcscspn.c # star-1.6/libschily/fchmodat.c # star-1.6/libschily/faccessat.c # star-1.6/libschily/dlfcn.c # star-1.6/libschily/lchmod.c # star-1.6/libschily/strlcatl.c # star-1.6/libschily/wcslcatl.c # star-1.6/libschily/Makefile.man # star-1.6/libschily/absfpath.3 # star-1.6/libschily/absnpath.3 # star-1.6/libschily/abspath.3 # star-1.6/libschily/astoi.3 # star-1.6/libschily/astol.3 # star-1.6/libschily/breakline.3 # star-1.6/libschily/comerr.3 # star-1.6/libschily/comerrno.3 # star-1.6/libschily/errmsg.3 # star-1.6/libschily/errmsgno.3 # star-1.6/libschily/error.3 # star-1.6/libschily/fdown.3 # star-1.6/libschily/fdup.3 # star-1.6/libschily/fexecl.3 # star-1.6/libschily/fexecle.3 # star-1.6/libschily/fexecv.3 # star-1.6/libschily/fexecve.3 # star-1.6/libschily/fgetline.3 # star-1.6/libschily/file_raise.3 # star-1.6/libschily/fileclose.3 # star-1.6/libschily/fileluopen.3 # star-1.6/libschily/fileopen.3 # star-1.6/libschily/filepos.3 # star-1.6/libschily/fileread.3 # star-1.6/libschily/filereopen.3 # star-1.6/libschily/fileseek.3 # star-1.6/libschily/filesize.3 # star-1.6/libschily/filestat.3 # star-1.6/libschily/filewrite.3 # star-1.6/libschily/findline.3 # star-1.6/libschily/flush.3 # star-1.6/libschily/fnmatch.3 # star-1.6/libschily/format.3 # star-1.6/libschily/fpipe.3 # star-1.6/libschily/fprintf.3 # star-1.6/libschily/getallargs.3 # star-1.6/libschily/getargs.3 # star-1.6/libschily/geterrno.3 # star-1.6/libschily/getfiles.3 # star-1.6/libschily/getline.3 # star-1.6/libschily/handlecond.3 # star-1.6/libschily/movebytes.3 # star-1.6/libschily/ofindline.3 # star-1.6/libschily/patcompile.3 # star-1.6/libschily/patmatch.3 # star-1.6/libschily/peekc.3 # star-1.6/libschily/printf.3 # star-1.6/libschily/raisecond.3 # star-1.6/libschily/resolvefpath.3 # star-1.6/libschily/resolvenpath.3 # star-1.6/libschily/resolvepath.3 # star-1.6/libschily/spawnl.3 # star-1.6/libschily/spawnv.3 # star-1.6/libschily/sprintf.3 # star-1.6/libschily/strcatl.3 # star-1.6/libschily/streql.3 # star-1.6/libschily/strlen.3 # star-1.6/libschily/absfpath.mk3 # star-1.6/libschily/absnpath.mk3 # star-1.6/libschily/abspath.mk3 # star-1.6/libschily/astoi.mk3 # star-1.6/libschily/astol.mk3 # star-1.6/libschily/breakline.mk3 # star-1.6/libschily/comerr.mk3 # star-1.6/libschily/comerrno.mk3 # star-1.6/libschily/errmsg.mk3 # star-1.6/libschily/errmsgno.mk3 # star-1.6/libschily/error.mk3 # star-1.6/libschily/fdown.mk3 # star-1.6/libschily/fdup.mk3 # star-1.6/libschily/fexecl.mk3 # star-1.6/libschily/fexecle.mk3 # star-1.6/libschily/fexecv.mk3 # star-1.6/libschily/fexecve.mk3 # star-1.6/libschily/fgetline.mk3 # star-1.6/libschily/file_raise.mk3 # star-1.6/libschily/fileclose.mk3 # star-1.6/libschily/filepos.mk3 # star-1.6/libschily/fileluopen.mk3 # star-1.6/libschily/fileopen.mk3 # star-1.6/libschily/fileread.mk3 # star-1.6/libschily/filereopen.mk3 # star-1.6/libschily/fileseek.mk3 # star-1.6/libschily/filesize.mk3 # star-1.6/libschily/filestat.mk3 # star-1.6/libschily/filewrite.mk3 # star-1.6/libschily/findline.mk3 # star-1.6/libschily/flush.mk3 # star-1.6/libschily/fnmatch.mk3 # star-1.6/libschily/format.mk3 # star-1.6/libschily/fpipe.mk3 # star-1.6/libschily/fprintf.mk3 # star-1.6/libschily/getallargs.mk3 # star-1.6/libschily/getargs.mk3 # star-1.6/libschily/geterrno.mk3 # star-1.6/libschily/getfiles.mk3 # star-1.6/libschily/getline.mk3 # star-1.6/libschily/handlecond.mk3 # star-1.6/libschily/movebytes.mk3 # star-1.6/libschily/ofindline.mk3 # star-1.6/libschily/patcompile.mk3 # star-1.6/libschily/patmatch.mk3 # star-1.6/libschily/peekc.mk3 # star-1.6/libschily/printf.mk3 # star-1.6/libschily/raisecond.mk3 # star-1.6/libschily/resolvefpath.mk3 # star-1.6/libschily/resolvenpath.mk3 # star-1.6/libschily/resolvepath.mk3 # star-1.6/libschily/spawnl.mk3 # star-1.6/libschily/spawnv.mk3 # star-1.6/libschily/sprintf.mk3 # star-1.6/libschily/strcatl.mk3 # star-1.6/libschily/streql.mk3 # star-1.6/libschily/strlen.mk3 # star-1.6/libschily/Targets.man # star-1.6/libschily/astoul.c # star-1.6/libschily/jsdprintf.c # star-1.6/libschily/movecbytes.c # star-1.6/libschily/cmpbytes.3 # star-1.6/libschily/cmpbytes.mk3 # star-1.6/libschily/matchmb.c # star-1.6/libschily/matchmbl.c # star-1.6/libschily/wctype.c # star-1.6/libschily/putenv.c # star-1.6/libschily/unsetenv.c # star-1.6/libschily/fpoff.c # star-1.6/libschily/waitid.c # star-1.6/libschily/fgtcomerr.c # star-1.6/libschily/gtprintf.c # star-1.6/libschily/gtcomerr.c # star-1.6/libschily/gterror.c # star-1.6/libschily/openat64.c # star-1.6/libschily/fstatat64.c # star-1.6/libschily/format.h # star-1.6/libschily/ovstrcpy.c # star-1.6/tests # star-1.6/tests/bin # star-1.6/tests/bin/base # star-1.6/tests/bin/docommand # star-1.6/tests/bin/echo_nonl # star-1.6/tests/bin/misc # star-1.6/tests/bin/xtest # star-1.6/tests/bin/seq # star-1.6/tests/testutils # star-1.6/tests/testutils/realpwd # star-1.6/tests/testutils/user # star-1.6/tests/testutils/decompress_stdin.sh # star-1.6/tests/testutils/yes # star-1.6/tests/testutils/README # star-1.6/tests/testutils/yammer # star-1.6/tests/testutils/uu_decode # star-1.6/tests/testutils/ekko # echo c - star-1.6/ mkdir -p star-1.6/ > /dev/null 2>&1 echo c - star-1.6/star mkdir -p star-1.6/star > /dev/null 2>&1 echo x - star-1.6/star/Makefile sed 's/^X//' >star-1.6/star/Makefile << 'END-of-star-1.6/star/Makefile' X#ident @(#)Makefile 1.37 18/07/30 X########################################################################### X#include $(MAKE_M_ARCH).def XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X X# X# This is star_fat.mk, it creates one "fat" binary for all functionality. X# X# If you like to create non "fat" binaries, remove Makefile X# and copy all.mk to Makefile. X# XINSDIR= bin XTARGET= star X#SYMLINKS= ustar tar XSYMLINKS= ustar tar gnutar suntar scpio spax XCPPOPTS += -D__STAR__ XCPPOPTS += -DSET_CTIME # Include timestorm code to set ctime XCPPOPTS += -DFIFO # Include FIFO code XCPPOPTS += -DUSE_SSH # Use "ssh" by default instead of "rsh" XCPPOPTS += -DUSE_MMAP # Use mmap() for the FIFO XCPPOPTS += -DUSE_REMOTE # Add support for the rmt protocol XCPPOPTS += -DUSE_RCMD_RSH # Add fast support for rcmd() XCPPOPTS += -DUSE_LARGEFILES # Support files > 2 GB XCPPOPTS += -DUSE_FIND # Include support for libfind XCPPOPTS += -DUSE_ACL # Support file ACLs XCPPOPTS += -DUSE_XATTR # Support (currently Linux) xattr XCPPOPTS += -DUSE_SELINUX # Support SELinux XCPPOPTS += -DUSE_FFLAGS # Support BSD style file flags XCPPOPTS += -DCOPY_LINKS_DELAYED # Delayed copy of hard/symlinks XCPPOPTS += -DSTAR_FAT # One binary for all CLI's XCPPOPTS += -DUSE_ICONV # Use iconv() for pax filenames XCPPOPTS += -DUSE_NLS # Include locale support XCPPOPTS += -DINS_BASE=\"${INS_BASE}\" XCPPOPTS += -DINS_RBASE=\"${INS_RBASE}\" XCPPOPTS += -DTEXT_DOMAIN=\"SCHILY_utils\" XCPPOPTS += -DSCHILY_PRINT XCFILES= star_fat.c header.c cpiohdr.c xheader.c xattr.c \ X list.c extract.c create.c append.c diff.c restore.c \ X remove.c star_unix.c lpath_unix.c \ X acl_unix.c acltext.c fflags.c \ X buffer.c dirtime.c lhash.c \ X hole.c longnames.c \ X movearch.c table.c props.c \ X unicode.c \ X subst.c volhdr.c \ X chdir.c match.c defaults.c dumpdate.c \ X fifo.c device.c checkerr.c paxopts.c \ X \ X findinfo.c pathname.c version.c X XHFILES= star.h starsubs.h dirtime.h xtab.h xutimes.h \ X movearch.h table.h props.h fifo.h diff.h restore.h \ X checkerr.h dumpdate.h bitstring.h pathname.h X X#LIBS= -lunos X#LIBS= -lschily -lc /usr/local/lib/gcc-gnulib X# X# LIB_CAP is needed for Linux capability support in librmt. X# LIB_SELINUX is needed for SELinux capability support. X# XLIBS= -ldeflt -lrmt -lfind -lschily $(LIB_ACL) $(LIB_ATTR) $(LIB_SOCKET) $(LIB_ICONV) $(LIB_INTL) $(LIB_CAP) $(LIB_SELINUX) X# X# Wenn -lfind, dann auch $(LIB_INTL) X# XXMK_FILE= Makefile.man ustarman.mk starformatman.mk scpioman.mk gnutarman.mk \ X spaxman.mk suntarman.mk Makefile.dfl Makefile.doc X Xstar_fat.c: star.c X $(RM) $(RM_FORCE) $@; cp star.c $@ X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.cmd Xinclude $(SRCROOT)/$(RULESDIR)/rules.tst X########################################################################### Xcount: $(CFILES) $(HFILES) X count $r1 X END-of-star-1.6/star/Makefile echo x - star-1.6/star/Makefile.dfl sed 's/^X//' >star-1.6/star/Makefile.dfl << 'END-of-star-1.6/star/Makefile.dfl' X#ident @(#)Makefile.dfl 1.4 10/05/14 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSMODE= 0644 XINSDIR= etc/default XINSBASE= $(INS_RBASE:%/=%) XTARGET= star XAUXSRCEXT= .dfl X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### END-of-star-1.6/star/Makefile.dfl echo x - star-1.6/star/Makefile.doc sed 's/^X//' >star-1.6/star/Makefile.doc << 'END-of-star-1.6/star/Makefile.doc' X#ident "%W% %E% %Q%" X########################################################################### X# Sample makefile for sub-makes in one directory X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMK_FILES= readme.mk Racl.mk Rcrash.mk Rlargefiles.mk Rmtio.mk \ X Rotherbugs.mk Rpattern.mk Rposix.mk starvsgnutar.mk \ X testscripts.mk X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.mks X########################################################################### END-of-star-1.6/star/Makefile.doc echo x - star-1.6/star/Makefile.man sed 's/^X//' >star-1.6/star/Makefile.man << 'END-of-star-1.6/star/Makefile.man' X#ident %W% %E% %Q% X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= star XMANSECT= $(MANSECT_CMD) XMANSUFFIX= $(MANSUFF_CMD) XMANFILE= star.1 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/star/Makefile.man echo x - star-1.6/star/README sed 's/^X//' >star-1.6/star/README << 'END-of-star-1.6/star/README' X# @(#)README 1.4 18/09/17 Copyr 1997-2018 J. Schilling X XStar is a tar like archiver - TAR stands for Tape ARchiver. X X XStar saves many files together into a single tape or disk archive, Xand can restore individual files from the archive. It includes a FIFO Xfor speed, a pattern matcher, multivolume support, the ability to correctly Xarchive sparse files, automatic archive format detection, automatic byte order Xrecognition, automatic archive compression/decompression, remote archives Xand special features that allow star to be used for full backups. it includes Xa built in find(1) command that allows to execute find(1) expressions. XIt also includes `rmt', a truly portable version of the remote tape server Xthat supports remote operation between different OS and machine architectures X(hides even Linux oddities) and a portable `mt' tape drive control program Xthat is able to use the remote tape interface. X XThe RMT program if 100% compatible with Sun's extensions for inter-platform Xoperability support (MT status codes) and with GNU extensions for inter-platform Xopen() interoperability. In addition, it includes my enhancements that Xhide Linux MT-ioctl non compliances with other UNIX platforms. X XStar is the fastest known implementation of a tar archiver. XStar is even at least 30% faster than ufsdump. X XStar development started 1982, the first complete implementation has Xbeen done in 1985. I never did my backups with other tools than star. X XIts main advantages over other tar implementations are: X X built-in find - star is built on top of libfind and thus X allows you to execute "find" like expressions X in create, extract and list mode. This allows X to do a lot of interesting things that could X not be done if star and find would be called X separatedly X X fifo - keeps the tape streaming. X This gives you at least 30% faster backups X than you can achieve with ufsdump or any X other known backup method. X X remote tape support - a fast RMT implementation that has no X probems to saturate a 100 Mb/s network and X faster networks are usable depending on X the quality of the network implementation X and the speed of the filesystem. X X accurate sparse files - star is able to reproduce holes in sparse X files accurately if the OS includes X the needed support functions. This is X currently true for Solaris-2.3 to X Solaris-2.5.1 and for Solaris-10 or newer X X pattern matcher - for a convenient user interface X (see manual page for more details). X To archive/extract a subset of files. X X sophisticated diff - user tailorable interface for comparing X tar archives against file trees X This is one of the most interesting parts X of the star implementation. X X no namelen limitation - Pathnames up 8 GBytes may be archived. X (The same limitation applies to linknames) X This previous limit was 1024 Bytes (up to X June 2018). X X deals with all 3 times - stores/restores all 3 times of a file X (even creation time) X With POSIX.1-2001 the times are in nanosecond X granularity. X Star may reset access time after doing X backup. On Solaris this can be done without X changing the ctime. X X deals with nanoseconds - Timestamps are supported with nanosecond X granularity (depending on the archive type). X X does not clobber files - more recent copies on disk will not be X clobbered from tape X This may be the main advantage over other X tar implementations. This allows X automatically repairing of corruptions X after a crash & fsck (Check for differences X after doing this with the diff option). X X automatic byte swap - star automatically detects swapped archives X and transparently reads them the right way X X automatic format detect - star automatically detects several common X archive formats and adopts to them. X Supported archive types are: X Old tar, gnu tar, ansi tar, star, X POSIX.1-2001 PAX, Sun's Solaris tar, cpio. X X X automatic compression detect - star automatically detects whether the X archive is compressed. If it has been X compressed with a compression program that X is compatible to decompression with "gzip" X "bzip2", "lzop" or "p7zip", star automatically X activates decompression. X X fully ansi compatible - Star is fully ANSI/Posix 1003.1 compatible. X See README.otherbugs for a complete X description of bugs found in other tar X implementations. Star is the first tar X implementation that supports POSIX.1-2001. X X support for ACLs and file flags - star supports Access Control Lists X and extended file flags (as found on FreeBSD X and Linux). Support to archive and restore X other file properties may be easily added. X X support for all inode metadata - star supports to put all inode X metadata on the archive. This allows future X versions of star to perform true X incremental dumps. X X sophisticated error control - allows to tell star which error types X should be ignored for wich file name pattern. X This allows to write backup scripts that give X no error messages for all problems that are X tolerable (e.g. growing log files). X X 'ed' like pattern substitutuions - star supports automated pattern rule X based file name substitution as documented X for 'pax'. X X fast built in -copy mode - allows to make fast and accurate copies and X directory tree comparisons. X X True incremental dump/restore features - tar is the first TAR based X backup system that has been verified to X handle typical file system changes X correctly. X X Star uses the same method as X ufsdump/ufsrestore but acts OS and FS X indeependent. X XHave a look at the manual page, it is included in the distribution. X X XAuthor: X XJoerg Schilling XSeestr. 110 XD-13353 Berlin XGermany X XEmail: joerg.schilling@fokus.fraunhofer.de, joerg@schily.net X XPlease mail bugs and suggestions to me. END-of-star-1.6/star/README echo x - star-1.6/star/README.ACL sed 's/^X//' >star-1.6/star/README.ACL << 'END-of-star-1.6/star/README.ACL' XFirst support for POSIX ACLs with help from Andreas Gruenbacher XFirst support for Solaris ACLs (converted into POSIX strings). X XACL status for several OS: X XSunOS-4.x No ACL support in the kernel X XSunOS-5.x ACL Support was officially added with Solaris-2.5 X Solaris ACL's are smilar enough to POSIX ACL's so I convert X them to POSIX ACLs before archiving them. X X Read the man pages: getfacl, setfacl, acl X X Due to a bug in libsec in function aclfromtext(), X restoring ACLs correctly only works if the full passwd access X for all users is present during star -x X So due to this bug, it is impossible to do ACL backup/restores X on passwd-less file servers. X X **** Solaris BUG *** X X As the function aclfromtext() on Solaris is unable to X recognise a numerical (all digit) user id, it is not possible X to do ACL backup/restore on a Solaris fileserver that has no X access to the same passwd data as it's NFS clients. X X Even worse, aclfromtext() changes the UID for each unknown X user to NOBODY and the function aclfromtext() returns as if X there was no error. This is a serious security problem as X because if this behavior the file becomes (in addition to the X other users in the ACL) accessible by "nobody" which X definitely is intended. X X This is Sun bug 4426407 ;-) X X If Sun would make libsec true Open Source, it would be easy X to fix this bug in less than 10 minutes. X X **** Solaris BUG *** X XLinux ACL support available as Patch for Linux-2.4 and X Linux-2.2.20. X X You need to install the Linux ACL patch _before_ X compiling star. X X By default Linux does not yet support ACLs. To X install ACL support get the patch from: X X http://acl.bestbits.at/ X X This page also lists the man pages for the ACL support X commands for Linux. X XFreeBSD FreeBSD-5.0 supports ACLs, but they need to be activated. X You need to know that you need to activate ACLs in the X kernel _and_ in each filesystem that should carry ACLs. X XTrue64 If you are on True64, you first need to activate extended X security features in order to use ACLs. X The administratice command names to list or set ACLs are X 'getacl' and 'setacl'. X X **** First tests on True64 show that the POSIX.1e function X **** acl_from_text() does not work as expected. I have no X **** idea how to work around this problem. X **** It may be that True64 does not support the ACL 'masks' X **** *entry. This would force us to create syntetic 'mask' X **** entries when in star create mode and to compute the X **** effective mode when in extract mode. On True64 also the X **** function acl_get_file() does not work properly if a file X **** does not have ACLs. Note that the standard requests that X **** in this case acl_get_file() should return a 3 entry ACL, X **** but on True64 it returns NULL with 'errno' unchanged. X **** Archiving and restoring ACLs from/to True64 will most X **** likely work. If you like to transfer TAR archives from/to X **** other platforms you will not be able to restore any ACL. X **** X **** As a TAR archive with ACLs made on True64 is not usable on X **** any other system, ACL support on True64 could be called X **** broken. X X XHP-UX HP-UX ACLs are so different from POSIX.1e that it would take a X significant amount of time to code a translation module for X star. For this reason, HP-UX is currently not yet not supported. X XAIX AIX ACLs are so different from POSIX.1e that it would take a X significant amount of time to code a translation module for X star. For this reason, HP-UX is not supported at the moment. X XIRIX Unknown state, please report X XSCO/Caldera UnixWare/OpenUnix seem to be very similar to Solaris in low X level but there is no high level (ACL string) support, so X we cannot support SCO unless Sun makes the source of the X libsec open. X X X/*--------------------------------------------------------------------------*/ XIf you list a TAR archive that contains ACLs for certain files, Xthose files are marked with a '+' sign past the UNIX permissions Xif you request a long listing: X X 0 -rw-r--r-- gruenbacher/assis Nov 4 04:43 2001 default/file X 0 drwxrwxr-x+ gruenbacher/assis Nov 4 04:43 2001 default/dir2/ X 0 drwxr-xr-x+ gruenbacher/assis Nov 4 04:44 2001 default/dir3/ X 0 drwxrwxr-x+ gruenbacher/assis Nov 4 04:44 2001 default/ X XIf you like ACL test tar archives, have a look at: X X http://acl.bestbits.at/pre/ X Xand fetch the files acl*.tar X XNote: The ACL support code in star is alpha! Do not expect it to be Xstable in any part. I cannot even grant that the archive format Xwill not change. However, if it turns out to be the right solution, I Xwill mail the star ACL format to the POSIX.1e standard committee. XAll changes have been made in a way that does not affec the behaviour Xof star in case no ACLs are present. X XThe format for ACLs in the extended headers used by star looks like: X XSCHILY.acl.access = user::rwx,user:lisa:r-x:502,group::r-x, \ X group:toolies:rwx:102,mask::rwx,other::r-x X XSCHILY.acl.default = user::rwx,user:lisa:r-x:502,group::r-x, \ X mask::r-x,other::r-x X XThe text above has been broken into shorter lines for readability X XThis is a legal 'vendor unique' POSIX.1-2001 extension for extended Xtar headers. X XIf the format gets accepted by the POSIX.1 and POSIX1e committee, it Xwould look like: X Xsecurity.acl...=user::rwx,group::rwx,mask::rwx,other::rwx,.... X XAs the text format specified by POSIX.1e is not sufficient for TAR, we Xadded a numerical field for all names user and group fields. X XPOSIX.1e named user entry: 'user:joe:rwx,' XSTAR named user entry: 'user:joe:rwx:1431,' X XWhen star extracts the ACL string, it first checks if user 'joe' is Xknown if 'joe' is known, the numerical value is stripped off and a Xstandard POSIX.1e ACL entry is created. If 'joe' is not known, the Xtext 'joe' is replaced by the numerical value '1431' and a new XPOSIX.1e entry that looks like 'user:1431:rwx,' is created. X X/*--------------------------------------------------------------------------*/ XHow to use ACLs with star: X XTo archive ACLs (star in create mode, you need to specify a TAR format Xthat supports extended POSIX.1-2001 headers _and_ uses them by default. XThis may currently be achieved by calling "star -Hexustar ...". XIn addition, you need to specify the -acl option. XSo you need to call "star -Hexustar -acl ...". X XTo extract ACLs you need to call "star -acl ..." X XThis option -acl has been introduced because it turns out that it is Ximpossible to handle the extract case (when the filesystem does Xnot support ACLs) in a decent way. Without -acl star would either Xbe forced to suppress eror messages for ACL handling or people Xwould see hundreds of ACL warnings. X XThe intention for the -acl option was to make ACL handling easy Xto understand. X XHere is a description how -acl works: X X- if -acl is not present in create mode, star does not X archive ACLs X X- if -acl is present in create mode and the header type X is 'exustar' (selected by H=exustar), star will X add ACL information to the archive. X X- if -acl is not present in extract mode, star does not X handle ACL information (i.e. if the FS does not handle X ACLs, no error messages will occur, if the FS handles X ACLs and there are default ACLs set up for the directory X where star puts the extracted files the extracted files X will have the inherited ACLs from the Default ACL od the X directory regardless of the ACL information in the archive). X X- if -acl is present in extract mode, star handles ACLs. X If the tar archive does not include ACL information at all X or if the archiv does not include ACL information for a X specific file, star will clear the ACL for this file. X If the tar archive includes ACL information for the file, X star will set up the ACL to be the same as the ACL information X in the archive (i.e. if -acl is present in extract mode, X no ACL information will be inherited from the ACL information X that was present in the filesystem tree before the exrtact X operation took place). X X If -acl is present in extract mode and the filesystem where X the files are extracted to does not support ACLs, star will X display an error message fo each file that is extracted. END-of-star-1.6/star/README.ACL echo x - star-1.6/star/README.crash sed 's/^X//' >star-1.6/star/README.crash << 'END-of-star-1.6/star/README.crash' XStar is the best program for automatically recovering Xfrom system crashes. X XConsider the case where you have a corrupted filesystem and Xno actual backup. It can be repaired with only few manual Xactions by using star. Simply follow the following steps: X X X1) Do a fsck -y to repair the filesystem. X Many files will be lost but you may have luck X and some/all recent files remain intact. X X2) Run star -xp from the most recent backup you have. X This will only extract all files that have been X deleted on the fsck -y run. X X3) Rewind the tape and run: X star -diff -c diffopts=!times X to check for file corruptions that have not been X detected by the fsck -y run. X X4) Do a full backup of the new system to prevent further X data loss. X X X END-of-star-1.6/star/README.crash echo x - star-1.6/star/README.dgux sed 's/^X//' >star-1.6/star/README.dgux << 'END-of-star-1.6/star/README.dgux' XIf you are running DG/UX, you may want to do some experiments Xwith unbuffered filereads. XThis will in general only work in single user mode because Xfiles that are already open may not be opened unbuffered, Xbut may give up to 50% more throughput. X XThe diffs are in the file: X Xstar/create.dgux.patch X Xand should be applied to the file star/create.c END-of-star-1.6/star/README.dgux echo x - star-1.6/star/README.largefiles sed 's/^X//' >star-1.6/star/README.largefiles << 'END-of-star-1.6/star/README.largefiles' XBig file strategy for star: XAccording to Posix 1003.1-1988, a 12 byte numeric field contains X11 octal digits and a space or a null. X X 1) Use unsigned 33 bit values conforming to Posix X to allow 8 GB Filesize. X X 2) Set the top bit of theleftmost byte in the field X and use base '256' digits to allow 95 bit values inside X 12 byte fields and 63 bit values inside 8 byte fields. X X 3) Use POSIX.1-2001 extended headers to have values X without any limit. X X Files in type 2) and 3) will not be extractable with X other tar implementations. Any files 'behind' such a file X cannot be accessed. X X Files of type 1) may be extractable with other implementations. END-of-star-1.6/star/README.largefiles echo x - star-1.6/star/README.mtio sed 's/^X//' >star-1.6/star/README.mtio << 'END-of-star-1.6/star/README.mtio' XMagnetic Tape ioctl's are just (again) a compatibility problem with Linux. X X XThe /etc/rmt protocol allows to send ioctls to the remote system and relies on Xthe fact that MTIO opcodes 0..7 of all UNIX systems are mapped to the same function. XLinux unfortunately does not follow these rules. X X/*--------------------------------------------------------------------------*/ XAll other UNIX X/*--------------------------------------------------------------------------*/ X/* X * values for mt_op X */ X#define MTWEOF 0 /* write an end-of-file record */ X#define MTFSF 1 /* forward space over file mark */ X#define MTBSF 2 /* backward space over file mark (1/2" only ) */ X#define MTFSR 3 /* forward space to inter-record gap */ X#define MTBSR 4 /* backward space to inter-record gap */ X#define MTREW 5 /* rewind */ X#define MTOFFL 6 /* rewind and put the drive offline */ X#define MTNOP 7 /* no operation, sets status only */ X X/*--------------------------------------------------------------------------*/ XLinux X/*--------------------------------------------------------------------------*/ X/* Magnetic Tape operations [Not all operations supported by all drivers]: */ X#define MTRESET 0 /* +reset drive in case of problems */ X#define MTFSF 1 /* forward space over FileMark, X * position at first record of next file X */ X#define MTBSF 2 /* backward space FileMark (position before FM) */ X#define MTFSR 3 /* forward space record */ X#define MTBSR 4 /* backward space record */ X#define MTWEOF 5 /* write an end-of-file record (mark) */ X#define MTREW 6 /* rewind */ X#define MTOFFL 7 /* rewind and put the drive offline (eject?) */ X#define MTNOP 8 /* no op, set status only (read with MTIOCGET) */ X XOperation Description UNIX -> Linux X==================================================================== X0 weof writes EOF (file mark) resets drive!!! X1 fsf forward skip file mark OK X2 bsf backwd skip file mark OK X3 fsr forward skip record OK X4 bsr backwd skip record OK X5 rew rewind writes file mark!!! X6 offl unload media partially OK X7 nop set status in driver unloads media X8 NOP is mapped to the vendor dependant X range. On Sun this is a retension X which takes a long time... X X XThe rmt server and client code used in the star distribution voids Xthese problems with Linux. X END-of-star-1.6/star/README.mtio echo x - star-1.6/star/README.otherbugs sed 's/^X//' >star-1.6/star/README.otherbugs << 'END-of-star-1.6/star/README.otherbugs' XI have compared several tar implementations with the standard. X X (IEEE/Posix1003/IEC-9945-1 Standard Data Interchange format) X XAlthough the POSIX.1-1988 standard now also defines cpio as an exchange format, XI cannot recommend the cpio archive format for data exchange. There are at Xleast 6 totally incompatible archive formats - all covered by the name "cpio". XIt is most likely, that you are using an archive format that other cpio Ximplementations will not understand at all. X XNote that POSIX.1-2001 will drop the cpio format from the standard as it Xis not extendible (e.g. for large files > 8 GB and UID's > 2097151). X XTar in general will at least extract most of the files if you are using a Xdifferent implementation to extract the archive. X XI've had a look at the following implementations: X X Index: Program description: Source of program: X ===== ==================== ================== X 1) bsd 4.3 tar (Regents of UCB) X 2) pax / ustar on SunOS 4.1 (USENIX) X 3) tar on Solaris 2.3/2.4/2.5 (Sun/AT&T ??) X 4) gnutar 1.11.8 (gnu) X 5) gnucpio 2.3 (gnu) X X XSummary: X 1) bsd 4.3 tar X Pre Posix 1003.1 X X - Miscomputes the checksum. Therefore it is not able to extract X standard conforming tar archives if they contain 8bit chars X in the filename. This is a common bug found in many other X implementations too. X X No additional problems on portability except with gnutar X archives. But this is not a problem of BSD tar. X X X 2) pax / ustar (found on SunOS-4.x) X X - Dumps core on every even/odd use. X - Computes checksums only on the first 500 bytes of the X tar header: not conforming to Posix 1003.1 standard. X X Note: This claims to be a reference implementation for X the Posix 1003.1 standard! X X X 3) tar distributed with Solaris 2.3/2.4/2.5 X X - Transfers more than 12 Bit from stat.st_mode (violating Posix) X - Complains about "impossible file type" when reading X tar archives which do not contain these illegal upper bits. X This problem is still present in Solaris 7 & Solaris 8 X X - Does not handle non null terminated filenames correctly. X The standard allows filenames that are exactly 100 chars X and therefore are not null terminated. (Fixed in Solaris 2.5) X X For the above reasons, Sun's tar is not conforming to X Posix 1003.1. X X - Loops infinitely when trying to dump /dev/fd. X Caused by incorrect handling of nested directories (assumes X all directories seekable). X This makes it impossible to use Solaris tar on the root file X system. X X X 4) gnutar X Claims not to be conforming to Posix 1003.1. (gnu is not tar) X X - Many bugs in implementation and design. X (e.g. when handling/creating multi volume archives) X X - The second logical EOF block in GNU-tar archives is missing X with a 50% chance. X This will cause correctly working tar implementations to X complain about an illegal/missing EOF in the tar archive. X This bug seems to be fixed with newer 1.13 releases X X - Deeply nested directory trees will not be dumped: X Error message is: Too many open files X (This is a similar implementation bug as found in Solaris tar X with the /dev/fd loop) caused by the fact that GNU-tar X assumes infinite resources in file descriptors. X X - Hard links with long names to files with long names do not X work. This bug seems to be fixed with newer 1.13 releases. X X - GNU-tar cannot read Posix compliant tar archives with X long file names if the filename prefix it at least X 138 characters. GNU-tar will think that it found an extended X sparse GNU tar archive and gets out of sync for the rest of X the archive. X See --sparse design bug description below. X This bug seems to be partially fixed with newer 1.13 releases X Even GNU-tar-1.13.19 does not seem to evaluate USTAR magic X and version to distinguish between a POSIX tar archive and a X non-standard GNU-tar archive. X X - GNU-tar even has a not yet identified bug which causes GNUtar X not to be able to partially read star archives if these X archives are not created with star -Hustar X May be this is caused by aspects of the topic above. X X - Option --sparse produces archives which cannot be read by any X other tar implementation known to me (except star), because X they will get "out of sync". X Posix 1003.1 conforming tar archives let gnutar get X "out of sync" even if the --portability option is used (see X above). This is a severe design bug in GNU-tar. X X Description: X The size field in a tar archive cannot reflect the X real size of a sparse file to have compatibility to X other implementations (this is also true for "star" X archives but star archives use a value in the size X field that is understood by other tar implementations). X X If the "sparse" file contains more than 4 holes, X the "size" field in the GNU-tar control block does not X reflect the total size of the (shrunk) sparse file in X the archive because it does not count the 'sparse' X extension headers. Posix compliant archives that use X the name prefix field with more than 137 characters X will have a value != 0 on a field that that makes X gnutar believe that such an extension header is X present - GNU-tar will get out of sync. X X Note: The general rule for any tar is that it should X be able to read any "tar" compliant data stream with X the exception that enhancements to the standard X only will fail on the files that contain the extension. X Those files should be extracted as if they were X regular files. X X - When GNU-tar writes archives it is not able to write long X filenames correctly according to POSIX.1-1988 or to X POSIX.1-2001. As GNU-tar uses a non-standard extension to X handle filenames > 100 chars, GNU-tar is a frequent problem X of the portability of archives. Is is not uncommon that the X length of filenames exceeds 100 chars, while > 99% of the X long filenames do not exceed ~ 230 chars. So most of the X long filenames may be handled by the POSIX.1-1988 method X which has been first documented in the 1987 draft of the X POSIX.1 standard. I strongly recommend not to use GNU-tar X to create archives for source exchange for this reason. X X It is bad to see that now (in 2001), 11 years after the X POSIX.1-1988 standard has become accepted, GNU-tar still does X not conform to this POSIX standard. Even worse: the first X draft of the POSIX.1-1988 standard that did not deviate from X the final in important things, appeared in autumn 1987. This X is about the first time when PD-tar which was the base for X GNU-tar appeared. PD-tar (in 1987) _did_ follow the POSIX.1 X standard with one single exception: it did not implement long X filenames (filenames > 100 chars) at all. The non-standard GNU X method of handling long filenames has been introduced in 1989 X by people from FSF. At this time, GNU-tar did not yet use the X POSIX.1 filename prefix for other non-POSIX purposes, so there X is no excuse for the non-standard way that FSF went. Don't X believe the false GNU-tar history from FSF. I send a correct X GNU-tar history to FSF in 1994, FSF still has to correct their X false claims about GNU-tar history. X X See also http://www.geocrawler.com/archives/3/92/1997/2/0/2217471/ X as a proof that a previous GNU tar maintainer did admit the X wrong design done by FSF members in the past. X X Summary: The main problem with GNU-tar, when it is reading TAR X archives, is that assumes all tar archives to be non-standard X GNU-tar archives. It does not implement a TAR format detection X based on the actual header format (as found in star) in total. X Instead, it seems to have peep-hole based decisions on how to X interpret parts of the TAR haeder. This can never work X correctly. X X Note: I do not recommend GNU tar as an exchange format. X Use star -Hustar for maximum portability instead. X If you like to write archives compliant to POSIX-1.2001 X use star -Hexustar to create archives with extended POSIX X headers. X X 5) gnucpio X X - Splits long filenames at the leftmost '/' instead of the X rightmost position of '/' required by my copy of the X Posix standard. X X - The docs claim compatibility with gnutar. X But extraction of gnutar archives containing 'atime' gives X funny filenames! (try this ...) X X - Octal numbers are left padded with ' ' instead of '0'. X The mode field contains more than the lower 12 bits from X stat.st_mode. X END-of-star-1.6/star/README.otherbugs echo x - star-1.6/star/README.pattern sed 's/^X//' >star-1.6/star/README.pattern << 'END-of-star-1.6/star/README.pattern' XStar includes a pattern matcher based on the algorithm Xpresented by Martin Richards in: X X"A Compact Function for Regular Expression Pattern Matching", XSoftware-Practice and Experience, Vol. 9, 527-534 (1979) X XSeveral changes have been made to the original source which has been Xwritten in BCPL: X X'/' is replaced by '!' (to allow UNIX filenames) X'(',')' are replaced by '{', '}' X'\'' is replaced by '\\' (UNIX compatible quote) X XCharacter classes have been added to allow "[]" Xto be used. XStart of line '^' and end of line '$' have been added. X XA description is available in the man page for the match program. XIt may be found in man/man1/match.1 END-of-star-1.6/star/README.pattern echo x - star-1.6/star/README.pax sed 's/^X//' >star-1.6/star/README.pax << 'END-of-star-1.6/star/README.pax' XThe new command 'spax' implements a POSIX.1 pax style command line interface Xon top of star. The command is basically SUSv2/UNIX-98 X XThe following extensions from SVSv3 / POSIX.1-2001 are implemented: X X- The options -H and -L X X- Support for the PSOX.1-2001 extended TAR header format X called 'pax'. This makes 'spax' the first pax like command that X supports this infinitely extensible and highly portable archive X format. X XThe following limitations currently apply: X X- No support for the -l option (create hard links if possible X in copy mode). X X- The privileges option -pa is ignored X X- The privileges option -pm will not only not set the mtime X but also not set the atime in extract and copy mode. X X- without -po SUID/SGID permission bits are not masked off. X X- Pattern matching for command line type args is not yet POSIX/PAX X compliant. It should emulate the shell's way of matching file names X where '/' is not part of the pattern and each path name component X needs to match separately, but it treats a filename like an unstructured X piece of text. X XAlthough there are several limitations, spax should be POSIX compliant enough Xfor the everyday work. X XRationale: spax only implements a limited set of options to grant best POSIX Xcompliance. Anything you can do with spax may also be done with star. To be able Xto do this, a new set of options has been added to star for this reason. X X/*--------------------------------------------------------------------------*/ X XThe following non POSIX related CPIO limitations currently apply: X X- The checksum with the -Hcrc format is not evaluated in extract mode. X X- Reading the binary cpio format is not yet fully supported. X This format suffers from design related byte order problems. X Star thus is unable to auto-detect the byte order status in X all cases. Auto-detection should work if the string lenght X if the first filename is odd. X X- Append & Update (star -r & star -u) does not yet work for X CPIO archives. X X XThese CPIO limitations would be of interest if we would create a 'cpio' Xcommand line program from the star sources. END-of-star-1.6/star/README.pax echo x - star-1.6/star/README.posix-2001 sed 's/^X//' >star-1.6/star/README.posix-2001 << 'END-of-star-1.6/star/README.posix-2001' XHints for using extended POSIX.1-2001 headers: X X Star will understand extended headers if the archive format X is from 'star', 'ustar', 'pax', 'xustar', 'exustar'. X In addition, star will understand the POSIX-look-alike X extended headers from Sun's tar (Solaris) if 'suntar' is selected X or autodetected. X X Star will create extended POSIX headers when the archive format X is 'pax', 'xustar' or 'exustar'. When the archive format is X 'exustar', every file will get an extended header which holds X at least atime/ctime/mtime in sub-second resolution. X If the archive format is 'pax' or 'xustar', star will create X the extended header only if there is a need for the extended header X because one or more of the fields do not fit into the standard ustar X header. X X Star supports the following fields in the extended header: X X times: "atime" "ctime" "mtime" (create/extract) X X id's (numeric): "uid", "gid" (create/extract) X X id's (names): "uname", "gname" (extract only) X X pathnames: "path" "linkpath" (create/extract) X X filesize: "size" (create/extract) X X Additional: "charset", "comment" (extract only - ignored) X X Vendor unique: X "SCHILY.devmajor" "SCHILY.devminor" (create/extract) X X In -dump mode (a preparation for incremental dumps) star archives: X X "SCHILY.dev" The field stat.st_dev - the filesys indicator X "SCHILY.ino" The field stat.st_ino - the file ID # X "SCHILY.nlink" The field stat.st_nlink - the hard link count X "SCHILY.filetype" The real file type - this allows e.g. X socket/door X X These fields will in future allow star to archive and extract all X information that is needed for incremental dumps. X X Star now includes ALL file metadata that is available. This allows a X complete restauration of all file properties and a diff mode that X checks for diffs in all file properties. X X Sun compatibility: X "SUN.devmajor" "SUN.devminor" (extract only) X X With -Hsuntar: X "SUN.devmajor" "SUN.devminor" (create/extract) X X TODO List for extended headers: X X - Add better UNICODE support X X - Add some way of handling UID/GID Overflow in the X traditional 7 char fields which limit to 2097151. X X - Add support for sparse files and continuation Files X into the extended header stuff (as Vendor UNIQUE extensions X with 'SCHILY.*' name). X X How to use extended POSIX.1-2001 headers: X X - To emmit xhdr's only if really needed, use 'star -Hpax' X or 'star -Hxustar'. In this case extended headers will be X created if the path/linkname will not fit into the 'ustar' X header or if the filesize is > 8 GB or uid/gid will not fit X 07777777. X X - To emmit xhdr's always, use 'star -Hexustar' and even when X no other extended attribute is needed atime/mtime/ctime are X written in sub-second resolution. X X - To write extended headers similar to POSIX.1-2001 as used by X the Solaris tar, use 'star -Hsuntar' and every file will at X least get a sub-second resolution mtime. Note that Sun's main X intention was to handle very long filenames and big uid/gid's. END-of-star-1.6/star/README.posix-2001 echo x - star-1.6/star/Racl.mk sed 's/^X//' >star-1.6/star/Racl.mk << 'END-of-star-1.6/star/Racl.mk' X#ident @(#)Racl.mk 1.1 07/06/15 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= share/doc/star XTARGET= README.ACL X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### END-of-star-1.6/star/Racl.mk echo x - star-1.6/star/Rcrash.mk sed 's/^X//' >star-1.6/star/Rcrash.mk << 'END-of-star-1.6/star/Rcrash.mk' X#ident @(#)Rcrash.mk 1.1 07/06/15 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= share/doc/star XTARGET= README.crash X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### END-of-star-1.6/star/Rcrash.mk echo x - star-1.6/star/Rlargefiles.mk sed 's/^X//' >star-1.6/star/Rlargefiles.mk << 'END-of-star-1.6/star/Rlargefiles.mk' X#ident @(#)Rlargefiles.mk 1.1 07/06/15 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= share/doc/star XTARGET= README.largefiles X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### END-of-star-1.6/star/Rlargefiles.mk echo x - star-1.6/star/Rmtio.mk sed 's/^X//' >star-1.6/star/Rmtio.mk << 'END-of-star-1.6/star/Rmtio.mk' X#ident @(#)Rmtio.mk 1.1 07/06/15 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= share/doc/star XTARGET= README.mtio X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### END-of-star-1.6/star/Rmtio.mk echo x - star-1.6/star/Rotherbugs.mk sed 's/^X//' >star-1.6/star/Rotherbugs.mk << 'END-of-star-1.6/star/Rotherbugs.mk' X#ident @(#)Rotherbugs.mk 1.1 07/06/15 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= share/doc/star XTARGET= README.otherbugs X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### END-of-star-1.6/star/Rotherbugs.mk echo x - star-1.6/star/Rpattern.mk sed 's/^X//' >star-1.6/star/Rpattern.mk << 'END-of-star-1.6/star/Rpattern.mk' X#ident @(#)Rpattern.mk 1.1 07/06/15 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= share/doc/star XTARGET= README.pattern X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### END-of-star-1.6/star/Rpattern.mk echo x - star-1.6/star/Rposix.mk sed 's/^X//' >star-1.6/star/Rposix.mk << 'END-of-star-1.6/star/Rposix.mk' X#ident @(#)Rposix.mk 1.1 07/06/15 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= share/doc/star XTARGET= README.posix-2001 X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### END-of-star-1.6/star/Rposix.mk echo x - star-1.6/star/STARvsGNUTAR sed 's/^X//' >star-1.6/star/STARvsGNUTAR << 'END-of-star-1.6/star/STARvsGNUTAR' XPeople often tell me that star is hard to use, because it is so different from XGnu tar. In order to allow an unbiased discussion, I prepared this comparison. XIt contains some hints for people (currently using Gnu tar) who like to like to Xswitch to 'star'. In addition, there is a list of features missing in Gnu tar Xand a smaller list of features missing in star. A list of incompatible options Xfound in Gnu tar helps to find out which options from Gnu tar should be avoided. XAs I am not sure whether I will have the time to keep it in sync with future Xchanges, it is valid for May 2007. X XFirst some background notes. Star is several years older than Gnu tar and most Xof the options that have different meanings in gnu tar have been in use with Xstar since 1985. This is about two years before the first versions of Gnu tar X(called PD tar or SUG tar in 1987) have been published. Do not expect that the Xmeaning of those options will be changed in star in the future. X XStar tries to be as compatible as possible with the BSD tar implementation Xfrom 1982 and with the POSIX standard. Of course, it implements a lot of Xenhancements. Gnu tar in former times (in 1987 when being called XPD tar / SUG tar) has been compatible to the BSD tar implementation but this Xchanged in 1989 when FSF adopted the program as Gnu tar. Gnu tar is not Xvery POSIX compliant. The command line options from Gnu tar do not follow Xthe SUSv2 (UNIX-98) and the archive format does not follow POSIX.1-1988. XAlthough these problems have been reported to the GNU tar maintainers Xin 1993 and 1994, nothing did happen for years. Since a few months, GNU tar Xis able to create and read POSIX.1-1988 compliant tar archives if called Xwith a special option. By default, it still does not create POSIX compliant Xarchives by default. X XIf you know the standard and thus know where Gnu tar is not standard compliant, Xit is easy to switch between Gnu tar and star. If you only use the basic Xfunctionality, everything should be exactly the same. If you don't know the Xstandard and only know Gnu tar you may get into some problems but this is Xreally a Gnu tar problem. X XNow let us compare functionality and options. Star has a lot of functions Xthat are usually invisible to the user but make the daily use much easier: X X- A built in find(1) allows star to execute "find" like expressions X in create, extract and list mode. This allows to do a lot of X interesting things that could not be done if star and find would X be called separatedly X X- A FIFO allows to keeps the tape streaming. This gives you aster backups X than you can achieve with other tar implementations. Star is even X at least 30% faster than ufsdump. X X- Fast remote tape support is built into star. X X- A powerful pattern matcher for a convenient user interface (see manual X page for more details) to archive/extract a subset of files. X X- A sophisticated diff with a user tailorable interface for comparing X tar archives against file trees. This is one of the most interesting parts X of the star implementation. X X- No namelength limitation is built into star. Pathnames up to PATH_MAX X may be archived. (The same limitation applies to linknames). This limit X may be expanded in future without changing the method to record X long names. X X- deals with all 3 times, it stores/restores all 3 times of a file X (even creation time) X On Solaris, it may reset access time after doing the backup without X clobbering the ctime. X X- Star does not clobber files by default. More recent copies on disk will X not be clobbered from tape. This may be the main advantage over other X tar implementations; it allows automatically repairing of corruptions X after a crash & fsck (Check for differences after doing this with the X diff option). X X- Star does automatic byte swapping if needed. Star automatically detects X swapped archives and transparently reads them the right way. X X- Star has automatic compression detection. In the recent case when star X is used to unpack compressed files containing tar archives, star will X transparently detect and call the right decompression program. X X- Star has automatic archive format detection. Star automatically detects X several common archive formats and adopts to them. Supported archive X types are: X X v7tar Old UNIX V7 tar format X tar Old BSD tar format X star Old star format from 1985 X gnutar GNU tar format 1989 (violates POSIX) X ustar Standard POSIX.1-1988 tar format X xstar Extended standard tar (star 1994) X xustar 'xstar' format without tar signature X exustar 'xustar' format - always x-header X pax Extended POSIX.1-2001 standard tar X suntar Sun's extended pre-POSIX.1-2001 X bin cpio UNIX V7 binary format X cpio cpio POSIX.1-1988 format X odc cpio POSIX.1-1988 with SYSv compat X asc SYSvr4 cpio ascii expanded device # X crc 'asc' format + CRC X X X- Star is fully ANSI/Posix 1003.1 compatible. See README.otherbugs for a X complete description of bugs found in other tar implementations. X X- Support for the new POSIX.1-2001 extended tar format. This new tar X format allows to archive many new things in a standard compliant way. X These things are currently are implemented in Gnu tar in a proprietary X way and have in former times been implemented in a proprietary way in X star. To give an example, the most interesting features that are now X handled in a standard compliant way are filenames without name len X limitation and file size without the old 8 GB tar limitation. X An interesting aspect of the new extended header format is that the X extended header format itself is extensible without limitation. Star X uses this extension format to archive Access Control Lists and file X flags from BSD-4.4 and Linux. X X- Star includes highly efficiend and 100% correct support for sparse X files on Solaris-2.3...Solaris-2.5.1 and for Solaris 10 and newer. X Star asks the OS for the locations of holes in files, this may be up X to 1000 times faster than with trying to find zeroed blocks. X X- Star supports to put all inode metadata on the archive. This allows X star to perform true incremental dumps. X X- Star includes support for multi level true incremental dump and X restore. GNU tar claims to support incrementals but first tests with X the scenarios created for star did show that GNU tar does not handle X renamed directories correctly. Also note that incremental dumps X made with GNU tar need a lot more tape space than those made with X star. X X The archive format used with incremental backups in star is more X compact and more effective than the archive format used by Gnu tar. X While Gnu tar needs to archive the complete directory tree, if X directory has been renamed, star will only archive empty renamed X directories. X X- Sophisticated error control allows to tell star which error types X should be ignored for wich file name pattern. This allows to write X backup scripts that give no error messages for all problems that are X tolerable (e.g. growing log files). X X- Star implements 'ed' like pattern substitutuions. Star supports X automated pattern rule based file name substitution as documented X for 'pax'. X X- Fast built in -copy mode allows to make fast and accurate copies and X directory tree comparisons. X X XComparing command line options from star and gnutar is a more complex task: X X- Star has 157 base Options X X- Gnu tar has 70 base Options X X- Star has 94 Options that are missing in Gnu tar X X- Gnu tar has 13 Options that are missing in star X X - 6 of the Gnu tar options are not needed or do not make sense to implement X - 2 of the Gnu tar options are considered to be of low importance X - 3 of the Gnu tar options are nice to have X - 2 of the missing options are needed and important X XOnly one of the Gnu tar options may be knock off criteria: the X"ignore failed reads") but it may not work correctly in Gnu tar. X X/*--------------------------------------------------------------------------*/ XAs a hint for readers to the star manual page, star uses getargs() to parse Xthe command line. Getargs() is much more flexible than getopt() and is even Xolder than getopt(). Getargs() implements the following features: X X- All single char boolean options and all single char increment type X options may be combined into a single string starting with a single X dash (-). X X- getargs() has a compatibility mode for GNU programs and allows to X preceede long options with a double dash (--) instead of the usual X single dash (-). X X- All options that take an argument are listed in the man page for X better readability of the manual as: X X option=arg X X but the following variants may appear in the actual command line: X X option=arg X option= arg X -option=arg X -option= arg X -optionarg X -option arg X X- A separate double dash (--) may preceede any argument that looks like X an option and specifies that the immediately following argument is X a file type argument. X X/*--------------------------------------------------------------------------*/ X XSTAR Option Description Gnu tar equiv. Remarks X=========== =========== ============= =================== X XCmds: X X-c/-u/-r create/update/replace named files to tape -c/-u/-r identical X-x/-t extract/list named files from tape -x/-t identical X-n trace named files from tape --missing-- X-copy copy named files to destination directory --missing-- X-diff diff archive against file system (see -xhelp) --diff Gnu --diff is not as useful X as star's -diff X XOptions: X X-help print this help --help close to identical X-xhelp print extended help see above X-version --version close to identical X-debug --missing-- X-silent no not print informational messages --missing-- Xblocks=#,b=# set blocking factor to #x512 Bytes (default 20) -b close to identical Xfile=nm,f=nm use 'nm' as tape instead of stdin/stdout -f close to identical X-T use $TAPE as tape instead of stdin/stdout --missing-- X-[0-7] Select an alternative tape drive -[0-7][lmh] close to identical X-fifo/-no-fifo use/don't use a fifo to optimize data flow from/to tape --missing-- X-shm use SysV shared memory for fifo --missing-- X-v be verbose -v identical X-block-number print the block numbers where the TAR headers start --block-number Not working in Gnu tar! X-tpath use with -t to list path names only --missing-- XH=header generate 'header' type archive (see H=help) --missing-- Xartype=header generate 'header' type archive (see H=help) " X-print-artype check and print archive and compression type on one line and exit. --missing-- XC=dir perform a chdir to 'dir' before storing next file -C identical X-bsdchdir do BSD style C= (only related to the next file type arg) --missing-- X-find Option separator: Use find command line to the right. --missing-- X-Z pipe input/output through compress, does not work on tapes X-z pipe input/output through gzip, does not work on tapes -z identical X-bz,-j pipe input/output through bzip2, does not work on tapes -j identical X-lzo pipe input/output through lzop, does not work on tapes --missing-- X-7z pipe input/output through p7zip, does not work on tapes --missing-- Xcompress-program=name pipe input/output through program 'name', does not work on tapes --use-compress-program=PROG X-B perform multiple reads (needed on pipes) -B identical X-i ignore checksum errors -i similar X-d do not store/create directories --missing-- X-m do not restore access and modification time -m identical X-o,-nochown do not restore owner and group --no-same-owner similar X-pax-p string use PAX like privileges set up --missing-- X-a,-atime reset access time after storing file --atime-preserve partial!!! X-p restore filemodes of directories -p similar ? X-no-p do not restore file permissions --missing-- X-l do not print a message if not all links are dumped --missing-- X-link-dirs look for hard linked directories in create mode --missing-- X-dump experimental option for incremental dumps (more ino metadata) --missing-- X-meta experimental option to use inode metadata only --missing-- X-h,-L follow symbolic links as if they were files -h identical X-pax-L follow symbolic links as if they were files (PAX style) --missing-- X-pax-H follow cmdline symbolic links as if they were files (PAX style) --missing-- X-D do not descend directories --no-recursion identical X-M do not descend mounting points -l GNU -l violates POSIX X-w do interactive creation/extraction/renaming -w partial X-pax-i do interactive creation/extraction/renaming (PAX style) --missing-- X-O be compatible to old tar (except for checksum bug) -o GNU -o violates POSIX X-P last record may be partial (useful on cartridge tapes) --missing-- X-S do not store/create special files --missing-- X-F,-FF,-FFF,... do not store/create SCCS/RCS, core and object files --missing-- X-U restore files unconditionally --missing-- Xdiffopts=optlst comma separated list of diffopts (see diffopts=help) --missing-- Xxdebug=#,xd=# set extended debug level --missing-- X-pax-ls print a PAX type file listing --missing-- X-lowmem try to use less memory for operation --missing-- X-not,-V use those files which do not match pattern --missing-- X-pax-match use PAX like pattern matching --missing-- X-pax-n only one match per pattern allowed --missing-- X-notarg,-pax-c use those files which do not match file type pattern --missing-- XVOLHDR=name use name to generate a volume header -V name similar X-xdir extract dir even if the current is never --missing-- X-xdot extract first '.' or './' dir even if the current is never --missing-- X-dirmode write directories after the files they contain --missing-- X-restore restore incremental dumps --missing-- X-force-restore force to restore partial incremental dumps --missing-- X-no-xheader do not read or write extended headers regardless of format --missing-- X-dupmeta use inode metadata in dump mode if only ctime is newer --missing-- X-keep-old-files,-k keep existing files -k similar X-refresh-old-files refresh existing files, don't create new files --overwrite ???? X-refresh --overwrite ???? X-/ don't strip leading '/'s from file names -P similar X-.. don't skip filenames that contain '..' in non-interactive extract --missing-- X-secure-links don't extract links that start with '/' or contain '..' --missing-- X-no-dirslash don't append a slash to directory names --missing-- Xlist=name read filenames from named file -I --files-from=NAME similar Xpkglist=name read filenames from named file (unstable interface for sps) --missing-- X-read0 read null terminated filenames with list= -null X-data-change-warn treat data/size changes in create more as warning only --missing-- X-e abort on all error conditions undefined by errctl= --missing-- Xerrctl=name read error contrl definitions from named file --missing-- X-dodesc do descend directories found in a list= file --missing-- Xpattern=p,pat=p set matching pattern PATTERN not as mighty as star X-match-tree do not scan the content of non matching dirs in create mode --missing-- Xs=replstr Apply ed like pattern substitution -s /old/new/gp on filenames --missing-- Xlevel=dumplevel set current incremental dump level --missing-- X-cumulative make a cumulative incremental dump (relative to same level) --missing-- Xtardumps=name set file name for tar dump dates, default is /etc/tardumps --missing-- X-wtardumps update file for tar dump dates if in dump mode --missing-- Xdumpdate=name use timestamp from name instead of current time for /etc/tardumps --missing-- Xfs-name=name use name instead of mount point for /etc/tardumps --missing-- Xmaxsize=# do not store file if it is bigger than # kBytes --missing-- Xnewer=name store only files which are newer than 'name' --never=DATE no find compat with GNUtar! X-multivol read/write/list a multi volume archive --multi-volume Xnew-volume-script=script call 'scipt' at end of each volume --new-volume-script=script identical X-ctime use ctime for newer= option --newer-mtime invers idea to star X-nodump do not dump files that have the nodump flag set --missing-- X-acl handle access control list --missing-- X-xattr handle extended file attributes --missing-- X-xattr-linux handle extended file attributes (Linux variant) --missing-- X-xfflags handle extended file flags --missing-- X-prinodes if archive contains inode number, print them in list mode --missing-- Xbs=# set (output) block size to # -b de-facto missing Xfs=# set fifo size to # --missing-- Xtsize=# set tape volume size to # 512 byte blocks -L x 1024 bytes X-qic24 set tape volume size to 61440 kBytes --missing-- X-qic120 set tape volume size to 128000 kBytes --missing-- X-qic150 set tape volume size to 153600 kBytes --missing-- X-qic250 set tape volume size to 256000 kBytes --missing-- X-qic525 set tape volume size to 512500 kBytes --missing-- X-no-fsync do not call fsync() for each extracted file (may be dangerous) --missing-- X-nowarn do not print warning messages --missing-- X-time print timing info --totals only partially X-no-statistics do not print statistics --missing-- always X-fifostats print fifo statistics --missing-- X-numeric don't use user/group name from tape --numeric-owner identical X-newest find newest file on tape --missing-- X-newest-file find newest regular file on tape --missing-- X-hpdev use HP's non POSIX compliant method to store dev numbers --missing-- X-modebits include all 16 bits from stat.st_mode (violates POSIX-1003.1) --missing-- X-copylinks Copy hard and symlinks rather than linking --missing-- X-copyhardlinks Copy hardlink source files rather than linking --missing-- X-copysymlinks Copy symlink source files rather than linking --missing-- X-copydlinks Copy the content of linked dirs --missing-- X-hardlinks Extract symlinks as hardlinks --missing-- X-symlinks Extract hardlinks as symlinks --missing-- X-signed-checksum use signed chars to calculate checksum --missing-- X-sparse handle file with holes effectively on store/create -S --sparse similar X-force-hole try to extract all files with holes --missing-- X-to-stdout extract files to stdout -O --to-stdout X-wready wait for tape drive to become ready --missing-- X-force-remove force to remove non writable files on extraction --missing-- X-ask-remove ask to remove non writable files on extraction --missing-- X-remove-first remove files before extraction --unlink-first X-remove-recursive remove files recursive --recursive-unlink Xdir-owner=user Intermediate created directories will be owned by 'user'. --missing-- Xdir-group=user Intermediate created directories will be owned by 'group'. --missing-- Xumask=mask Set star's umask to 'mask'. --missing-- X-onull,-nullout simulate creating an achive to compute the size -f/dev/null in GNUtar worse than star (cannot do performance tests) X X/*--------------------------------------------------------------------------*/ XGnu tar options that (in the single char variant) are incompatible: X XBsS -F, --info-script=FILE run script at end of each tape (implies -M) Xs -L, --tape-length=NUM change tape after writing NUM x 1024 bytes Xs -M, --multi-volume create/list/extract multi-volume archive Xs -O, --to-stdout extract files to standard output XsS (+) -P, --absolute-names don't strip leading `/'s from file names Xs -S, --sparse handle sparse files efficiently Xs -T, -I, --files-from=NAME get names to extract or create from file NAME Xs -U, --unlink-first remove each file prior to extracting over it Xs -V, --label=NAME create archive with volume name NAME Xs -d, --diff, --compare find differences between archive and file system XsP -l, --one-file-system stay in local file system when creating archive XsP -o, --old-archive, --portability write a V7 format archive X XB Incompatible with BSD tar Xs Incompatible with star XS Incompatible with Sun's/SVr4 tar XP Incompatible with POSIX X X+) This option is the only option where star deviates from other tar X implementations, but as there is no other nice way to have an option to X specify that the last record should be partial and the star option -/ X is easy to remember as well as -P for Partial record is I see no need X to change star. X X/*--------------------------------------------------------------------------*/ XOptions only found in GNUtar: X XGNUtar option GNUtar description Star remarks X==================== ================================================== ======================================= XMain operation mode: X -A, --catenate append tar files to an archive low importance X --delete delete from the archive (not on mag tapes!) low importance X XOperation modifiers: X -W, --verify attempt to verify the archive after writing it not needed (may be implemented via rewind X and -diff in star) X X --remove-files remove files after adding them to the archive not needed X X --ignore-failed-read do not exit with nonzero on unreadable files --needed-- and important X XHandling of file attributes: X --owner=NAME force NAME as owner for added files use star -find -chown name X --group=NAME force NAME as group for added files use star -find -chgrp name X --mode=CHANGES force (symbolic) mode CHANGES for added files use star -find -chmod mode X --no-same-owner extract files as yourself not needed X -s, --same-order sort names to extract to match archive ???? X X XDevice selection and switching: X --volno-file=FILE use/update the volume number in FILE --needed-- and important X XLocal file selection: X -X, --exclude-from=FILE exclude globbing patterns listed in FILE --nice to have-- X -K, --starting-file=NAME begin at file NAME in the archive --nice to have-- X --backup[=CONTROL] backup before removal, choose version control not needed X --suffix=SUFFIX backup before removal, override usual suffix not needed X XInformative output: X --checkpoint print directory names while reading the archive --nice to have-- X END-of-star-1.6/star/STARvsGNUTAR echo x - star-1.6/star/acl_unix.c sed 's/^X//' >star-1.6/star/acl_unix.c << 'END-of-star-1.6/star/acl_unix.c' X/* @(#)acl_unix.c 1.57 19/01/19 Copyright 2001-2019 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)acl_unix.c 1.57 19/01/19 Copyright 2001-2019 J. Schilling"; X#endif X/* X * ACL get and set routines for unix like operating systems. X * X * Copyright (c) 2001-2019 J. Schilling X * X * There are currently two basic flavors of ACLs: X * X * Flavor 1: UFS/POSIX.1e draft (withrawn in 1997) X * X * The Solaric UFS ACLs that have been developed between 1990 and 1994. X * These ACLs have been made available as extensions to NFSv2 and NFSv3. X * A related POSIX.1e draft has been devloped between 1995 and 1997 X * and withdrawn in October 1997. X * X * This implementation currently supports Solaris UFS ACLs and the X * withdrawn POSIX.1e draft that is available on Free BSD, Linux and some X * other platforms since aprox. year 2000, using a common text format. X * Thanks to Andreas Gruenbacher for the first X * implementation that supports the withdrawn POSIX draft ACLs. X * X * As True64 does not like ACL "mask" entries and this version of the X * ACL code does not generate "mask" entries on True64, ACL support for X * True64 is currently broken. You cannot read back archives created X * on True64. X * X * Flavor 2: NFSv4 X * X * The NTFS ACLs that have been standardized as NFSv4 ACLs with X * NFSv4 in year 2000. NFSv4 ACLs are the native ACLs on ZFS, X * NTFS, NFSv4 and CIFS. X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X X#include X#ifdef USE_ACL X X/* X * We may support UFS ACLs on UnixWare if we have the source for X * libsec from Solaris present. X */ X#ifdef OWN_ACLTEXT X#if defined(UNIXWARE) && defined(HAVE_ACL) X#define HAVE_SUN_ACL X#define HAVE_ANY_ACL X#endif X#endif X/* X * HAVE_ANY_ACL currently includes HAVE_POSIX_ACL and HAVE_SUN_ACL. X * This definition must be in sync with the definition in star_unix.c X * As USE_ACL is used in star.h, we are not allowed to change the X * value of USE_ACL before we did include star.h or we may not include X * star.h at all. X * HAVE_HP_ACL is currently not included in HAVE_ANY_ACL. X */ X#ifndef HAVE_ANY_ACL X#undef USE_ACL /* Do not try to get or set ACLs */ X#endif X#endif X X#include X#include X#include "star.h" X#include "props.h" X#include "table.h" X#include X#include /* Needed for Solaris ACL code (malloc/free) */ X#include X#include X#include X#include X#define GT_COMERR /* #define comerr gtcomerr */ X#define GT_ERROR /* #define error gterror */ X#include X#include X#include "starsubs.h" X#include "checkerr.h" X#include "pathname.h" X X#ifdef USE_ACL X X#ifdef HAVE_SYS_ACL_H X#include X#endif X#ifdef HAVE_NFSV4_ACL X#ifdef HAVE_ACLUTILS_H X#include X#else Xextern char *acl_strerror __PR((int)); Xextern int acl_type __PR((acl_t *)); X#endif X#endif X X/* X * Define some things that either are missing or defined in a different way X * on SCO UnixWare X */ X#if defined(UNIXWARE) Xtypedef struct acl aclent_t; X#endif X#ifndef GETACL X#define GETACL ACL_GET X#endif X#ifndef SETACL X#define SETACL ACL_SET X#endif X#ifndef GETACLCNT X#define GETACLCNT ACL_CNT X#endif X#ifndef MIN_ACL_ENTRIES X#define MIN_ACL_ENTRIES NACLBASE X#endif X X#define ROOT_UID 0 X Xextern BOOL nochown; Xextern BOOL numeric; X X/* X * XXX acl_access_text/acl_default_text are a bad idea. (see xheader.c) X * XXX Note that in 'dirmode' dir ACLs get hosed because getinfo() is X * XXX called for the directory before the directrory content is written X * XXX and the directory itself is archived after the dir content. X * X * Solaris allows a maximum of 1024 ACL entries (for both POSIX and NFSv4) X * Win-DOS allows a maximum of ~1820 ACL entries based on internal ACL size 65k X * X * A POSIX draft ACL text entry is max: "group::r--:#," (12+name+id) X * which is 12 + 32 + 12 == 56 Bytes. X * A NFSv4 ACL text entry is max: "group::r-------------:f------:allow:#," X * (38+name+id) which is 38 + 32 + 12 == 82 Bytes. X * X * We thus need to be prepared to have 56 kB of POSIX draft ACL text and X * to have up to 82..146 kB of NFSv4 ACL text. X */ XLOCAL pathstore_t acl_access_text; XLOCAL pathstore_t acl_default_text; X#ifdef HAVE_NFSV4_ACL XLOCAL pathstore_t acl_ace_text; X#endif X X/* X * The following three functions are implemented for any ACL support X * but with different content. X */ XEXPORT void opt_acl __PR((void)); XEXPORT BOOL get_acls __PR((FINFO *info)); XEXPORT void set_acls __PR((FINFO *info)); X X/* X * Functions specific to the withdrawn POSIX.1e draft X */ X#ifdef HAVE_POSIX_ACL XLOCAL BOOL acl_to_info __PR((char *name, int type, pathstore_t *acltext)); XLOCAL BOOL acl_add_ids __PR((char *name, pathstore_t *infopath, char *acltext)); X#endif X X/* X * Functions specific to the UFS ACL implementation X */ X#ifdef HAVE_SUN_ACL X#ifndef HAVE_NFSV4_ACL XLOCAL BOOL get_ufs_acl __PR((FINFO *info, aclent_t **aclpp, int *aclcountp)); X#endif XLOCAL char *acl_add_ids __PR((char *dst, char *from, char *end, int *sizep)); X#endif X X/* X * The following functions exist in one single implementation that operates X * on the data archived by star for UFS ACLs and the withdrawn POSIX.1e draft. X */ XLOCAL char *base_acl __PR((mode_t mode)); XLOCAL void acl_check_ids __PR((char *acltext, char *infotext, BOOL is_nfsv4)); X X#ifdef HAVE_NFSV4_ACL XLOCAL void nfsv4_shrink __PR((char *acltext)); X#endif X X#ifdef HAVE_POSIX_ACL /* The withdrawn POSIX.1e draft */ X X#define DID_OPT_ACL XEXPORT void Xopt_acl() X{ X printf(" acl-POSIX.1e-draft"); X#ifdef HAVE_NFSV4_ACL X printf(" acl-NFSv4"); X#endif X} X X/* X * Get the access control list for a file and convert it into the format X * used by star. X * This is the implementation specific variant to the withdrawn POSIX.1e draft. X */ XEXPORT BOOL Xget_acls(info) X register FINFO *info; X{ X info->f_acl_access = NULL; X info->f_acl_default = NULL; X info->f_acl_ace = NULL; X X /* X * Symlinks don't have ACLs X */ X if (is_symlink(info)) X return (TRUE); X X#ifdef HAVE_FREEBSD_NFSV4_ACL X if (acl_to_info(info->f_sname, ACL_TYPE_NFS4, &acl_ace_text)) { X if (*acl_ace_text.ps_path != '\0') { X info->f_xflags |= XF_ACL_ACE; X info->f_acl_ace = acl_ace_text.ps_path; X } X return (TRUE); X } X#endif X if (!acl_to_info(info->f_sname, ACL_TYPE_ACCESS, &acl_access_text)) X return (FALSE); X if (*acl_access_text.ps_path != '\0') { X info->f_xflags |= XF_ACL_ACCESS; X info->f_acl_access = acl_access_text.ps_path; X } X if (!is_dir(info)) X return (TRUE); X if (!acl_to_info(info->f_sname, ACL_TYPE_DEFAULT, &acl_default_text)) X return (FALSE); X if (*acl_default_text.ps_path != '\0') { X info->f_xflags |= XF_ACL_DEFAULT; X info->f_acl_default = acl_default_text.ps_path; X } X return (TRUE); X} X X/* X * This is specific to the withdrawn POSIX.1e draft. X */ XLOCAL BOOL Xacl_to_info(name, type, acltext) X char *name; X int type; X pathstore_t *acltext; X{ X acl_t acl; X char *text, *c; X int entries = 1; X X if (acltext->ps_size == 0) X init_pspace(PS_EXIT, acltext); X acltext->ps_path[0] = '\0'; X if ((acl = acl_get_file(name, type)) == NULL) { X register int err = geterrno(); X#ifdef ENOTSUP X /* X * This FS does not support ACLs. X */ X if (err == ENOTSUP) X return (TRUE); X#endif X#ifdef ENOSYS X if (err == ENOSYS) X return (TRUE); X#endif X#ifdef HAVE_FREEBSD_NFSV4_ACL X /* X * If ACL type is not NFS4 we continue with POSIX.1e ACLs X */ X if (type == ACL_TYPE_NFS4 && err == EINVAL) X return (FALSE); X#endif X if (!errhidden(E_GETACL, name)) { X if (!errwarnonly(E_GETACL, name)) X xstats.s_getaclerrs++; X errmsg("Cannot get %sACL for '%s'.\n", X type == ACL_TYPE_DEFAULT ? "default ":"", name); X (void) errabort(E_GETACL, name, TRUE); X } X return (FALSE); X } X seterrno(0); X#ifdef HAVE_FREEBSD_NFSV4_ACL X if (type == ACL_TYPE_NFS4) X text = acl_to_text_np(acl, NULL, ACL_TEXT_APPEND_ID); X else X#endif X text = acl_to_text(acl, NULL); X acl_free(acl); X if (text == NULL) { X if (geterrno() == 0) X seterrno(EX_BAD); X if (!errhidden(E_BADACL, name)) { X if (!errwarnonly(E_BADACL, name)) X xstats.s_badacl++; X errmsg( X "Cannot convert %sACL entries to text for '%s'.\n", X type == ACL_TYPE_DEFAULT ? "default ":"", name); X (void) errabort(E_BADACL, name, TRUE); X } X return (FALSE); X } X X /* remove trailing newlines */ X c = strrchr(text, '\0'); X while (c > text && *(c-1) == '\n') X *(--c) = '\0'; X X /* remove comment fields */ X c = text; X while ((c = strchr(c, '#')) != NULL) { X char *d = c, *e; X X while (c > text && strchr(" \t\r", *(c-1))) X c--; X if (c == d) { X /* No whitespace before '#': assume it's no comment. */ X c++; X continue; X } X while (*d && *d != '\n') X d++; X e = c; X while ((*e++ = *d++) != '\0') X ; X } X X#ifdef HAVE_FREEBSD_NFSV4_ACL X /* remove space fields */ X if (type == ACL_TYPE_NFS4) { X c = text; X while ((c = strchr(c, ' ')) != NULL) { X char *d = c, *e; X X while (*d && *d == ' ') X d++; X e = c; X while ((*e++ = *d++) != '\0') X ; X } X } X#endif X X /* count fields */ X for (c = text; *c != '\0'; c++) { X if (*c == '\n') { X *c = ','; X entries++; X } X } X#ifdef HAVE_FREEBSD_NFSV4_ACL X if (type == ACL_TYPE_NFS4) { X if (strcpy_pspace(PS_EXIT, acltext, text) < 0) { X acl_free((acl_t)text); X return (FALSE); X } X } else X#endif X if ((entries > 3) || /* > 4 on Solaris? */ X (type == ACL_TYPE_DEFAULT && entries >= 3)) { X if ((entries * 56) > acltext->ps_size) X grow_pspace(PS_EXIT, acltext, entries * 56 + 2); X if (acltext->ps_size < 2) X return (FALSE); X if (!acl_add_ids(name, acltext, text)) { X acl_free((acl_t)text); X return (FALSE); X } X } X /* X * XXX True64 prints a compile time warning when we use X * XXX acl_free(text) but it is standard... X * XXX we need to check whether we really have to call X * XXX free() instead of acl_free() if we are on True64. X * XXX Cast the string to acl_t to supress the warning. X */ X acl_free((acl_t)text); X return (TRUE); X} X X/* X * This is specific to the withdrawn POSIX.1e draft. X */ XLOCAL BOOL Xacl_add_ids(name, infopath, acltext) X char *name; X pathstore_t *infopath; X char *acltext; X{ X int size = infopath->ps_size - 2; X char *infotext = infopath->ps_path; X ssize_t len; X char *token; X uid_t uid; X gid_t gid; X X /* X * Add final nul to guarantee that the string is nul terminated. X * infopath->ps_size is granted to be at least 2 when we come here. X */ X infotext[size] = '\0'; X X token = strtok(acltext, ",\n\r"); X while (token) { X strlcpy(infotext, token, size); X len = strlen(token); X infotext += len; X size -= len; X if (size < 0) X break; X X if (strncmp(token, "user:", 5) == 0 && X strchr(":,\n\r", token[5]) == NULL) { X char *username = &token[5], *c = username+1; X X while (strchr(":,\n\r", *c) == NULL) X c++; X *c = '\0'; X /* check for all-numeric user name */ X while (c > username && isdigit(*(c-1))) X c--; X if (c > username && X ic_uidname(username, c-username, &uid)) { X len = js_snprintf(infotext, size, X ":%lld", (Llong)uid); X infotext += len; X size -= len; X } X } else if (strncmp(token, "group:", 6) == 0 && X strchr(":,\n\r", token[6]) == NULL) { X char *groupname = &token[6], *c = groupname+1; X X while (strchr(":,\n\r", *c) == NULL) X c++; X *c = '\0'; X /* check for all-numeric group name */ X while (c > groupname && isdigit(*(c-1))) X c--; X if (c > groupname && X ic_gidname(groupname, c-groupname, &gid)) { X len = js_snprintf(infotext, size, X ":%lld", (Llong)gid); X infotext += len; X size -= len; X } X } X if (size > 0) { X *infotext++ = ','; X *infotext = '\0'; /* Always null terminate */ X size--; X } X X token = strtok(NULL, ",\n\r"); X } X if (size >= 0) { X *(--infotext) = '\0'; /* Remove tailing ',' */ X } else { X if (!errhidden(E_BADACL, name)) { X if (!errwarnonly(E_BADACL, name)) X xstats.s_badacl++; X errmsgno(EX_BAD, X "Cannot convert ACL entries (string too long) for '%s'.\n", X name); X (void) errabort(E_BADACL, name, TRUE); X } X return (FALSE); X } X return (TRUE); X} X X/* X * Use ACL info from archive to set access control list for the file if needed. X * This is the implementation specific variant to the withdrawn POSIX.1e draft. X */ XEXPORT void Xset_acls(info) X register FINFO *info; X{ X char acltext[PATH_MAX+1]; /* auto space only if small */ X pathstore_t aclps; X acl_t acl; X X aclps.ps_path = acltext; X aclps.ps_size = PATH_MAX; X X#ifdef HAVE_FREEBSD_NFSV4_ACL X if (info->f_xflags & XF_ACL_ACE) { X ssize_t len = strlen(info->f_acl_ace) + 2; X X if (len > aclps.ps_size) { X aclps.ps_path = NULL; X aclps.ps_size = 0; X grow_pspace(PS_EXIT, &aclps, len); X if (aclps.ps_size <= len) { X free_pspace(&aclps); X return; X } X } X acl_check_ids(aclps.ps_path, info->f_acl_ace, TRUE); X X if ((acl = acl_from_text(aclps.ps_path)) == NULL) { X if (!errhidden(E_BADACL, info->f_name)) { X if (!errwarnonly(E_BADACL, info->f_name)) X xstats.s_badacl++; X errmsg("Cannot convert NFSv4 ACL '%s' to internal format for ' %s'.\n", X aclps.ps_path, info->f_name); X (void) errabort(E_BADACL, info->f_name, TRUE); X } X } else { X if (acl_set_file(info->f_name, ACL_TYPE_NFS4, X acl) < 0) { X /* X * XXX What should we do if errno is X * ENOTSUP/ENOSYS? X */ X if (!errhidden(E_SETACL, info->f_name)) { X if (!errwarnonly(E_SETACL, X info->f_name)) X xstats.s_setacl++; X errmsg("Cannot set NFSv4 ACL '%s' for '%s'.\n", X aclps.ps_path, info->f_name); X (void) errabort(E_SETACL, info->f_name, X TRUE); X } X } X acl_free(acl); X } X if (aclps.ps_path != acltext) X free_pspace(&aclps); X return; X } X#endif /* HAVE_FREEBSD_NFSV4_ACL */ X X if (info->f_xflags & XF_ACL_ACCESS) { X ssize_t len = strlen(info->f_acl_access) + 2; X X if (len > aclps.ps_size) { X aclps.ps_path = NULL; X aclps.ps_size = 0; X grow_pspace(PS_EXIT, &aclps, len); X if (aclps.ps_size <= len) { X free_pspace(&aclps); X return; X } X } X acl_check_ids(aclps.ps_path, info->f_acl_access, FALSE); X } else { X /* X * We may need to delete an inherited ACL. X */ X strcpy(aclps.ps_path, base_acl(info->f_mode)); X } X if ((acl = acl_from_text(aclps.ps_path)) == NULL) { X if (!errhidden(E_BADACL, info->f_name)) { X if (!errwarnonly(E_BADACL, info->f_name)) X xstats.s_badacl++; X errmsg("Cannot convert ACL '%s' to internal format for '%s'.\n", X aclps.ps_path, info->f_name); X (void) errabort(E_BADACL, info->f_name, TRUE); X } X } else { X if (acl_set_file(info->f_name, ACL_TYPE_ACCESS, acl) < 0) { X /* X * XXX What should we do if errno is ENOTSUP/ENOSYS? X */ X if (!errhidden(E_SETACL, info->f_name)) { X if (!errwarnonly(E_SETACL, info->f_name)) X xstats.s_setacl++; X errmsg("Cannot set ACL '%s' for '%s'.\n", X aclps.ps_path, info->f_name); X (void) errabort(E_SETACL, info->f_name, TRUE); X } X X#ifdef __needed__ X /* Fall back to chmod */ X /* XXX chmod has already been done! */ X chmod(info->f_name, info->f_mode); X#endif X } X acl_free(acl); X } X X /* X * Only directories can have Default ACLs X */ X if (!is_dir(info)) { X if (aclps.ps_path != acltext) X free_pspace(&aclps); X return; X } X X if (info->f_xflags & XF_ACL_DEFAULT) { X ssize_t len = strlen(info->f_acl_default) + 2; X X if (len > aclps.ps_size) { X if (aclps.ps_path == acltext) { X aclps.ps_path = NULL; X aclps.ps_size = 0; X } X grow_pspace(PS_EXIT, &aclps, len); X if (aclps.ps_size <= len) { X free_pspace(&aclps); X return; X } X } X acl_check_ids(aclps.ps_path, info->f_acl_default, FALSE); X } else { X aclps.ps_path[0] = '\0'; X#ifdef HAVE_ACL_DELETE_DEF_FILE X /* X * FreeBSD does not like acl_from_text("") X */ X if (acl_delete_def_file(info->f_name) < 0) { X /* X * XXX What should we do if errno is ENOTSUP/ENOSYS? X */ X if (!errhidden(E_SETACL, info->f_name)) { X if (!errwarnonly(E_SETACL, info->f_name)) X xstats.s_setacl++; X errmsg("Cannot remove default ACL from '%s'.\n", X info->f_name); X (void) errabort(E_SETACL, info->f_name, TRUE); X } X } X if (aclps.ps_path != acltext) X free_pspace(&aclps); X return; X#endif X } X if ((acl = acl_from_text(aclps.ps_path)) == NULL) { X if (!errhidden(E_BADACL, info->f_name)) { X if (!errwarnonly(E_BADACL, info->f_name)) X xstats.s_badacl++; X errmsg("Cannot convert default ACL '%s' to internal format for '%s'.\n", X aclps.ps_path, info->f_name); X (void) errabort(E_BADACL, info->f_name, TRUE); X } X } else { X if (acl_set_file(info->f_name, ACL_TYPE_DEFAULT, acl) < 0) { X /* X * XXX What should we do if errno is ENOTSUP/ENOSYS? X */ X if (!errhidden(E_SETACL, info->f_name)) { X if (!errwarnonly(E_SETACL, info->f_name)) X xstats.s_setacl++; X errmsg("Cannot set default ACL '%s' for '%s'.\n", X aclps.ps_path, info->f_name); X (void) errabort(E_SETACL, info->f_name, TRUE); X } X } X acl_free(acl); X } X if (aclps.ps_path != acltext) X free_pspace(&aclps); X} X X#endif /* HAVE_POSIX_ACL The withdrawn POSIX.1e draft */ X X#ifdef HAVE_SUN_ACL /* The UFS ACL implementation */ X X#ifndef ACL_IS_DIR /* We did not include sys/acl_impl.h */ X#define ACE_T 1 X#endif X#ifndef ACL_SID_FMT /* Solaris 10 has no support for this */ X#define ACL_SID_FMT 0 X#endif X X#define DID_OPT_ACL XEXPORT void Xopt_acl() X{ X printf(" acl-POSIX.1e-draft"); X#ifdef HAVE_NFSV4_ACL X printf(" acl-NFSv4"); X#endif X} X X/* X * Get the access control list for a file and convert it into the format X * used by star. X * This is the implementation specific variant to Solaris UFS ACLs X * and Solaris NFSV4 ACLs. X */ XEXPORT BOOL Xget_acls(info) X register FINFO *info; X{ X#ifdef HAVE_NFSV4_ACL X int acltype; X acl_t *aclp; X#else X int aclcount; X aclent_t *aclp; X#endif X register char *acltext; X register char *ap; X register char *dp; X register char *cp; X register char *ep; X int asize; X int dsize; X X info->f_acl_access = NULL; X info->f_acl_default = NULL; X info->f_acl_ace = NULL; X X /* X * Symlinks don't have ACLs X */ X if (is_symlink(info)) X return (TRUE); X X#ifdef HAVE_NFSV4_ACL X if (acl_get(info->f_name, ACL_NO_TRIVIAL, &aclp) < 0) { X if (!errhidden(E_GETACL, info->f_name)) { X if (!errwarnonly(E_GETACL, info->f_name)) X xstats.s_getaclerrs++; X errmsg("Cannot get ACL entries for '%s'.\n", X info->f_name); X (void) errabort(E_GETACL, info->f_name, TRUE); X } X return (FALSE); X } X if (aclp == NULL) /* Only trivial ACL entries */ X return (TRUE); X X acltype = acl_type(aclp); X seterrno(0); X acltext = acl_totext(aclp, acltype == ACE_T? X ACL_COMPACT_FMT | ACL_APPEND_ID | ACL_SID_FMT : 0); X acl_free(aclp); /* acl_t * needs acl_free() */ X#else X if (!get_ufs_acl(info, &aclp, &aclcount)) X return (FALSE); X if (aclp == NULL) /* Only trivial ACL entries */ X return (TRUE); X X seterrno(0); X acltext = acltotext(aclp, aclcount); X free(aclp); /* aclent_t * needs free() */ X#endif X X if (acltext == NULL) { X if (geterrno() == 0) X seterrno(EX_BAD); X if (!errhidden(E_BADACL, info->f_name)) { X if (!errwarnonly(E_BADACL, info->f_name)) X xstats.s_badacl++; X errmsg("Cannot convert ACL entries to text for '%s'.\n", X info->f_name); X (void) errabort(E_BADACL, info->f_name, TRUE); X } X return (FALSE); X } X#ifdef ACL_DEBUG X error("acltext '%s'\n", acltext); X#endif X X#ifdef HAVE_NFSV4_ACL X if (acltype == ACE_T) { X if (strcpy_pspace(PS_EXIT, &acl_ace_text, acltext) < 0) { X free(acltext); X return (FALSE); X } X free(acltext); X nfsv4_shrink(acl_ace_text.ps_path); X X info->f_xflags |= XF_ACL_ACE; X info->f_acl_ace = acl_ace_text.ps_path; X return (TRUE); X } X#endif X X /* X * Estimate the ACl text size after adding IDs. X * The minimal UFS ACL entry length is 10 bytes. X * If we add the numerical ID string, this would become 22 bytes. X */ X asize = strlen(acltext); X asize = (asize+9)/10 * 22 + 2; X X grow_pspace(PS_EXIT, &acl_access_text, asize); X grow_pspace(PS_EXIT, &acl_default_text, asize); X ap = acl_access_text.ps_path; X dp = acl_default_text.ps_path; X asize = acl_access_text.ps_size; X dsize = acl_default_text.ps_size; X X for (cp = acltext; *cp; cp = ep) { X if (*cp == ',') X cp++; X ep = strchr(cp, ','); X if (ep == NULL) X ep = strchr(cp, '\0'); X X if (*cp == 'd' && strncmp(cp, "default", 7) == 0) { X cp += 7; X dp = acl_add_ids(dp, cp, ep, &dsize); X if (dp == NULL) X break; X } else { X ap = acl_add_ids(ap, cp, ep, &asize); X if (ap == NULL) X break; X } X } X free(acltext); X X if (ap == NULL || dp == NULL) { X acl_access_text.ps_path[0] = '\0'; X acl_default_text.ps_path[0] = '\0'; X if (!errhidden(E_BADACL, info->f_name)) { X if (!errwarnonly(E_BADACL, info->f_name)) X xstats.s_badacl++; X errmsgno(EX_BAD, "Cannot convert ACL entries (string too long) for '%s'.\n", X info->f_name); X (void) errabort(E_BADACL, info->f_name, TRUE); X } X return (FALSE); X } X X if (ap > acl_access_text.ps_path && ap[-1] == ',') X --ap; X *ap = '\0'; X if (dp > acl_default_text.ps_path && dp[-1] == ',') X --dp; X *dp = '\0'; X X if (*acl_access_text.ps_path != '\0') { X info->f_xflags |= XF_ACL_ACCESS; X info->f_acl_access = acl_access_text.ps_path; X } X if (*acl_default_text.ps_path != '\0') { X info->f_xflags |= XF_ACL_DEFAULT; X info->f_acl_default = acl_default_text.ps_path; X } X X#ifdef ACL_DEBUG Xerror("access: '%s'\n", acl_access_text.ps_path); Xerror("default: '%s'\n", acl_default_text.ps_path); X#endif X X return (TRUE); X} X X#ifndef HAVE_NFSV4_ACL XLOCAL BOOL Xget_ufs_acl(info, aclpp, aclcountp) X register FINFO *info; X aclent_t **aclpp; X int *aclcountp; X{ X int aclcount; X aclent_t *aclp; X X *aclpp = NULL; X#ifdef HAVE_ST_ACLCNT X aclcount = info->f_aclcnt; /* UnixWare */ X#else X if ((aclcount = acl(info->f_sname, GETACLCNT, 0, NULL)) < 0) { X#ifdef ENOSYS X if (geterrno() == ENOSYS) X return (TRUE); X#endif X if (!errhidden(E_GETACL, info->f_name)) { X if (!errwarnonly(E_GETACL, info->f_name)) X xstats.s_getaclerrs++; X errmsg("Cannot get ACL count for '%s'.\n", X info->f_name); X (void) errabort(E_GETACL, info->f_name, TRUE); X } X return (FALSE); X } X#endif X#ifdef ACL_DEBUG X error("'%s' acl count %d\n", info->f_name, aclcount); X#endif X if (aclcount <= MIN_ACL_ENTRIES) { X /* X * This file has only the traditional UNIX access list. X * This case includes a filesystem that does not support ACLs X * like the tmpfs. X */ X return (TRUE); X } X if ((aclp = (aclent_t *)malloc(sizeof (aclent_t) * aclcount)) == NULL) { X if (!errhidden(E_GETACL, info->f_name)) { X if (!errwarnonly(E_GETACL, info->f_name)) X xstats.s_getaclerrs++; X errmsg("Cannot malloc ACL buffer for '%s'.\n", X info->f_name); X (void) errabort(E_GETACL, info->f_name, TRUE); X } X return (FALSE); X } X if (acl(info->f_sname, GETACL, aclcount, aclp) < 0) { X if (!errhidden(E_GETACL, info->f_name)) { X if (!errwarnonly(E_GETACL, info->f_name)) X xstats.s_getaclerrs++; X errmsg("Cannot get ACL entries for '%s'.\n", X info->f_name); X (void) errabort(E_GETACL, info->f_name, TRUE); X } X return (FALSE); X } X *aclpp = aclp; X *aclcountp = aclcount; X return (TRUE); X} X#endif /* HAVE_NFSV4_ACL */ X X/* X * Convert Solaris UFS ACL text into POSIX draft ACL text and add numerical X * user/group ids. X * This is specific to Solaris UFS ACLs. X * X * Solaris uses only one colon in the ACL text format for "other" and "mask". X * Solaris ACL text is: "user::rwx,group::rwx,mask:rwx,other:rwx" X * while POSIX text is: "user::rwx,group::rwx,mask::rwx,other::rwx" X */ XLOCAL char * Xacl_add_ids(dst, from, end, sizep) X char *dst; X char *from; X char *end; X int *sizep; X{ X register char *cp = from; X register char *ep = end; X register char *np = dst; X register int size = *sizep; X register int amt; X uid_t uid; X gid_t gid; X X if (cp[0] == 'u' && X strncmp(cp, "user:", 5) == 0) { X if (size <= (ep - cp +1)) { X *sizep = 0; X return (NULL); X } X size -= ep - cp +1; X strncpy(np, cp, ep - cp +1); X np += ep - cp + 1; X X cp += 5; X ep = strchr(cp, ':'); X if (ep) X *ep = '\0'; X if (*cp) { X if (ic_uidname(cp, 1000, &uid)) { X if (np[-1] == ',') { X --np; X size++; X } X amt = js_snprintf(np, size, X ":%lld,", (Llong)uid); X np += amt; X size -= amt; X } X } X if (ep) X *ep = ':'; X X } else if (cp[0] == 'g' && X strncmp(cp, "group:", 6) == 0) { X if (size <= (ep - cp +1)) { X *sizep = 0; X return (NULL); X } X size -= ep - cp +1; X strncpy(np, cp, ep - cp + 1); X np += ep - cp + 1; X X cp += 6; X ep = strchr(cp, ':'); X if (ep) X *ep = '\0'; X if (*cp) { X if (ic_gidname(cp, 1000, &gid)) { X if (np[-1] == ',') { X --np; X size++; X } X amt = js_snprintf(np, size, X ":%lld,", (Llong)gid); X np += amt; X size -= amt; X } X } X if (ep) X *ep = ':'; X X } else if (cp[0] == 'm' && X strncmp(cp, "mask:", 5) == 0) { X cp += 4; X if (size < 5) { X *sizep = 0; X return (NULL); X } X /* X * Add one additional ':' to the string for POSIX compliance. X */ X strcpy(np, "mask:"); X np += 5; X if (size <= (ep - cp +1)) { X *sizep = 0; X return (NULL); X } X strncpy(np, cp, ep - cp + 1); X np += ep - cp + 1; X X } else if (cp[0] == 'o' && X strncmp(cp, "other:", 6) == 0) { X cp += 5; X if (size < 6) { X *sizep = 0; X return (NULL); X } X /* X * Add one additional ':' to the string for POSIX compliance. X */ X strcpy(np, "other:"); X np += 6; X if (size <= (ep - cp +1)) { X *sizep = 0; X return (NULL); X } X strncpy(np, cp, ep - cp + 1); X np += ep - cp + 1; X } X if (size <= 0) { X size = 0; X np = NULL; X } X *sizep = size; X return (np); X} X X/* X * Convert ACL info from archive into Sun's format and set access control list X * for the file if needed. X * This is the implementation specific variant to Solaris UFS ACLs X * and Solaris NFSV4 ACLs. X */ XEXPORT void Xset_acls(info) X register FINFO *info; X{ X#ifdef HAVE_NFSV4_ACL X int err; X acl_t *aclp; X#else X int aclcount; X aclent_t *aclp; X#endif X char aclbuf[8192]; X pathstore_t aclps; X BOOL no_acl = FALSE; X X aclps.ps_path = aclbuf; X aclps.ps_size = sizeof (aclbuf) -2; X X aclbuf[0] = '\0'; X if (info->f_xflags & XF_ACL_ACCESS) { X ssize_t len = strlen(info->f_acl_access) + 2; X X if (len > aclps.ps_size) { X aclps.ps_path = NULL; X aclps.ps_size = 0; X grow_pspace(PS_EXIT, &aclps, len); X if (aclps.ps_size <= len) { X free_pspace(&aclps); X return; X } X aclps.ps_path[0] = '\0'; X } X acl_check_ids(aclps.ps_path, info->f_acl_access, FALSE); X } X if (info->f_xflags & XF_ACL_DEFAULT) { X char acltext[PATH_MAX+1]; /* only if small */ X pathstore_t acldps; X register char *cp; X register char *dp; X register char *ep; X ssize_t dlen; X X /* count fields */ X for (dlen = 1, cp = info->f_acl_default; *cp != '\0'; cp++) { X if (*cp == ',') X dlen++; X } X dlen = dlen * 7; /* strlen("default") */ X dlen += cp - info->f_acl_default; /* +strlen(acldeflt) */ X dlen += 2; /* Nul */ X acldps.ps_path = acltext; X acldps.ps_size = sizeof (acltext); X if (dlen > acldps.ps_size) { X acldps.ps_path = NULL; X acldps.ps_size = 0; X grow_pspace(PS_EXIT, &acldps, dlen); X if (acldps.ps_size <= dlen) { X free_pspace(&acldps); X return; X } X } X acl_check_ids(acldps.ps_path, info->f_acl_default, FALSE); X X aclps.ps_tail = strlen(aclps.ps_path); X if ((aclps.ps_tail + dlen) > aclps.ps_size) { X char *op = aclps.ps_path; X X if (aclps.ps_path == acltext) { X aclps.ps_path = NULL; X aclps.ps_size = 0; X } X grow_pspace(PS_EXIT, &aclps, aclps.ps_tail + dlen); X if (aclps.ps_size <= dlen) { X free_pspace(&aclps); X return; X } X if (op == aclbuf) X strcpy(aclps.ps_path, aclbuf); X } X dp = aclps.ps_path + aclps.ps_tail; X if (dp > aclps.ps_path) X *dp++ = ','; X for (cp = acldps.ps_path; *cp; cp = ep) { X /* X * XXX Eigentlich muesste man hier bei den Eintraegen X * XXX "mask" und "other" jeweils ein ':' beseitigten X * XXX aber es sieht so aus, als ob es bei Solaris 9 X * XXX auch funktionert wenn man das nicht tut. X * XXX Nach Solaris 7 "libsec" Source kann es nicht X * XXX mehr funktionieren wenn man das ':' beseitigt. X * XXX Moeglicherweise ist das der Grund warum X * XXX Solaris immer Probleme mit den ACLs hatte. X */ X if (*cp == ',') X cp++; X ep = strchr(cp, ','); X if (ep == NULL) X ep = strchr(cp, '\0'); X strcpy(dp, "default"); X dp += 7; X strncpy(dp, cp, ep - cp + 1); X dp += ep - cp + 1; X } X } X if (info->f_xflags & XF_ACL_ACE) { X ssize_t len = strlen(info->f_acl_ace) + 2; X X if (aclps.ps_path[0] != '\0' && !errhidden(E_BADACL, info->f_name)) { X if (!errwarnonly(E_BADACL, info->f_name)) X xstats.s_badacl++; X errmsgno(EX_BAD, X "Both POSIX draft ACL '%s' and NFSv4 ACL %s present for '%s'.\n", X aclps.ps_path, X info->f_acl_access, X info->f_name); X (void) errabort(E_BADACL, info->f_name, TRUE); X } X if (aclps.ps_path != aclbuf) X free_pspace(&aclps); X#ifdef HAVE_NFSV4_ACL X aclps.ps_path = aclbuf; X aclps.ps_size = sizeof (aclbuf) -2; X if (len > aclps.ps_size) { X aclps.ps_path = NULL; X aclps.ps_size = 0; X grow_pspace(PS_EXIT, &aclps, len); X if (aclps.ps_size <= len) { X free_pspace(&aclps); X return; X } X } X acl_check_ids(aclps.ps_path, info->f_acl_ace, TRUE); X#else X if (!errhidden(E_BADACL, info->f_name)) { X if (!errwarnonly(E_BADACL, info->f_name)) X xstats.s_badacl++; X errmsgno(EX_BAD, X "Cannot set NFSv4 ACLs for '%s' on this platform.\n", X info->f_name); X (void) errabort(E_BADACL, info->f_name, TRUE); X } X return; X#endif X } X#ifdef ACL_DEBUG X error("aclbuf: '%s'\n", aclps.ps_path); X#endif X X if (aclps.ps_path[0] == '\0') { X /* X * We may need to delete an inherited ACL. X */ X strcpy(aclps.ps_path, base_acl(info->f_mode)); X no_acl = TRUE; X } else if (streql(aclps.ps_path, base_acl(info->f_mode))) { X no_acl = TRUE; X } X X#ifdef HAVE_NFSV4_ACL X if ((err = acl_fromtext(aclps.ps_path, &aclp)) != 0) { X if (!errhidden(E_BADACL, info->f_name)) { X if (!errwarnonly(E_BADACL, info->f_name)) X xstats.s_badacl++; X errmsgno(EX_BAD, X "%s. Cannot convert ACL '%s' to internal format for '%s'.\n", X acl_strerror(err), X aclps.ps_path, info->f_name); X (void) errabort(E_BADACL, info->f_name, TRUE); X } X } else { X if (acl_set(info->f_name, aclp) < 0) { X BOOL no_error = FALSE; X X if (no_acl) { X acl_t *xaclp; X X /* X * This should catch the ENOSYS case which X * happens e.g. if the target is a socket. X */ X if (acl_get(info->f_name, X ACL_NO_TRIVIAL, &xaclp) >= 0) { X if (xaclp == NULL) X no_error = TRUE; X else X acl_free(xaclp); X } X } X if (!no_error && !errhidden(E_SETACL, info->f_name)) { X if (!errwarnonly(E_SETACL, info->f_name)) X errmsg("Cannot set ACL '%s' for '%s'.\n", X aclps.ps_path, info->f_name); X xstats.s_setacl++; X (void) errabort(E_SETACL, info->f_name, TRUE); X } X } X acl_free(aclp); /* acl_t * needs acl_free() */ X } X#else X seterrno(0); X if ((aclp = aclfromtext(aclps.ps_path, &aclcount)) == NULL) { X if (geterrno() == 0) X seterrno(EX_BAD); X if (!errhidden(E_BADACL, info->f_name)) { X if (!errwarnonly(E_BADACL, info->f_name)) X xstats.s_badacl++; X errmsg("Cannot convert ACL '%s' to internal format for '%s'.\n", X aclps.ps_path, info->f_name); X (void) errabort(E_BADACL, info->f_name, TRUE); X } X } else { X if (acl(info->f_name, SETACL, aclcount, aclp) < 0) { X BOOL no_error = FALSE; X /* X * XXX What should we do if errno is ENOSYS? X */ X if (no_acl) { X int aclcnt; X X /* X * This should catch the ENOSYS case which X * happens e.g. if the target is a socket. X */ X aclcnt = acl(info->f_name, GETACLCNT, 0, NULL); X if (aclcnt <= MIN_ACL_ENTRIES) X no_error = TRUE; X } X if (!no_error && !errhidden(E_SETACL, info->f_name)) { X if (!errwarnonly(E_SETACL, info->f_name)) X errmsg("Cannot set ACL '%s' for '%s'.\n", X aclps.ps_path, info->f_name); X xstats.s_setacl++; X (void) errabort(E_SETACL, info->f_name, TRUE); X } X } X free(aclp); /* aclent_t * needs free() */ X } X#endif X X if (aclps.ps_path != aclbuf) X free_pspace(&aclps); X} X X#endif /* HAVE_SUN_ACL The UFS ACL implementation */ X X/* X * Convert UNIX standard mode bits into base ACL X */ XLOCAL char * X#ifdef PROTOTYPES Xbase_acl(mode_t mode) X#else Xbase_acl(mode) X mode_t mode; X#endif X{ X static char _acltxt[] = "user::***,group::***,other::***"; X X _acltxt[ 6] = (mode & 0400) ? 'r' : '-'; X _acltxt[ 7] = (mode & 0200) ? 'w' : '-'; X _acltxt[ 8] = (mode & 0100) ? 'x' : '-'; X _acltxt[17] = (mode & 0040) ? 'r' : '-'; X _acltxt[18] = (mode & 0020) ? 'w' : '-'; X _acltxt[19] = (mode & 0010) ? 'x' : '-'; X _acltxt[28] = (mode & 0004) ? 'r' : '-'; X _acltxt[29] = (mode & 0002) ? 'w' : '-'; X _acltxt[30] = (mode & 0001) ? 'x' : '-'; X X return (_acltxt); X} X X/* X * If we are in -numeric mode, we replace the user and group names by the X * user and group numbers from our internal format. X * X * If we are in non numeric mode, we check whether a user name or group name X * is present on our current system. It the user/group name is known, then we X * remove the numeric value from out internal format. If the user/group name X * is not known, then we replace the name by the numeric value. X */ XLOCAL void Xacl_check_ids(acltext, infotext, is_nfsv4) X char *acltext; X char *infotext; X BOOL is_nfsv4; X{ X char entry_buffer[PATH_MAX]; /* A single entry */ X char *token = strtok(infotext, ","); X X if (!token) X return; X X while (token) { X char *x = strchr(token, '#'); X if (x != NULL) { X /* X * Cut off any "[ \t]#" at the end of the token. X */ X while (x > token+1 && strchr(" \t", *(x-1)) != NULL) X x--; X *x = '\0'; X } X if (strncmp(token, "user:", 5) == 0 && X strchr(":,", token[5]) == NULL) { X char *username = &token[5], *c = username; X char *perms, *auid; X char *flags, *type; X uid_t udummy; X /* uidname does not check for NULL! */ X X /* check for damaged user names with spaces */ X if (strchr(username, ':') == NULL) { X /* X * Looks like a damaged user name that had X * spaces in it, like "Joe,User". Repair. X */ X char *unexpected_sep = strchr(username, '\0'); X X if (strtok(NULL, ",")) { X *unexpected_sep = ' '; X continue; X } X } X X /* user name */ X if (*username != ':') { X c++; X while (strchr(":,", *c) == NULL) X c++; X } X if (*c) X *c++ = '\0'; X X /* permissions */ X perms = c; X while (strchr(":,", *c) == NULL) X c++; X if (*c) X *c++ = '\0'; X X if (is_nfsv4) { X /* inheritance flags */ X flags = c; X while (strchr(":,", *c) == NULL) X c++; X if (*c) X *c++ = '\0'; X X /* access type */ X type = c; X while (strchr(":,", *c) == NULL) X c++; X if (*c) X *c++ = '\0'; X } X X /* identifier */ X auid = c; X while (strchr(":,", *c) == NULL) X c++; X if (*c) X *c++ = '\0'; X X /* X * XXX We use strlen(username)+1 to tell uidname not X * XXX to stop comparing before the end of the X * XXX username has been reached. Otherwise "joe" and X * XXX "joeuser" would be recognized as identical. X */ X if (*auid && (numeric || X !ic_uidname(username, strlen(username)+1, &udummy))) X username = auid; X if (is_nfsv4) { X js_snprintf(entry_buffer, PATH_MAX, X "user:%s:%s:%s:%s", X username, perms, flags, type); X } else { X js_snprintf(entry_buffer, PATH_MAX, X "user:%s:%s", X username, perms); X } X token = entry_buffer; X X } else if (strncmp(token, "group:", 6) == 0 && X strchr(",", token[6]) == NULL) { X char *groupname = &token[6], *c = groupname; X char *perms, *agid; X char *flags, *type; X gid_t gdummy; X /* gidname does not check for NULL! */ X X /* check for damaged group names with spaces */ X if (strchr(groupname, ':') == NULL) { X /* X * Looks like a damaged group name that had X * spaces in it, like "Domain,Users". Repair. X */ X char *unexpected_sep = strchr(groupname, '\0'); X X if (strtok(NULL, ",")) { X *unexpected_sep = ' '; X continue; X } X } X X /* group name */ X if (*groupname != ':') { X c++; X while (strchr(":,", *c) == NULL) X c++; X } X if (*c) X *c++ = '\0'; X X /* permissions */ X perms = c; X while (strchr(":,", *c) == NULL) X c++; X if (*c) X *c++ = '\0'; X X if (is_nfsv4) { X /* inheritance flags */ X flags = c; X while (strchr(":,", *c) == NULL) X c++; X if (*c) X *c++ = '\0'; X X /* access type */ X type = c; X while (strchr(":,", *c) == NULL) X c++; X if (*c) X *c++ = '\0'; X } X X /* identifier */ X agid = c; X while (strchr(":,", *c) == NULL) X c++; X if (*c) X *c++ = '\0'; X X /* X * XXX We use strlen(groupname)+1 to tell gidname not X * XXX to stop comparing before the end of the X * XXX groupname has been reached. Otherwise "joe" and X * XXX "joeuser" would be compared as identical. X */ X if (*agid && (numeric || X !ic_gidname(groupname, strlen(groupname)+1, &gdummy))) X groupname = agid; X if (is_nfsv4) { X js_snprintf(entry_buffer, PATH_MAX, X "group:%s:%s:%s:%s", X groupname, perms, flags, type); X } else { X js_snprintf(entry_buffer, PATH_MAX, X "group:%s:%s", X groupname, perms); X } X token = entry_buffer; X } X if (*token != '\0') { X strcpy(acltext, token); X acltext += strlen(token); X *acltext++ = ','; X } X X token = strtok(NULL, ","); X } X *(--acltext) = '\0'; X} X X#ifdef HAVE_NFSV4_ACL XLOCAL void Xnfsv4_shrink(acltext) X register char *acltext; X{ X register char *ap; X register char *cp; X register char *ep; X int asize = strlen(acltext) - 24; X X for (ap = cp = acltext; *cp; *ap++ = *cp++) { X if (*cp == ':') { X /* X * Check whether the rest of the string is long X * enough for a complete ACE and whether this X * colon is the beginning of a X * ":rwxpdDaARWcCos:fdinSFI:" block. X */ X if ((cp - acltext) > asize) X continue; X if (cp[15] != ':') X continue; X if (cp[23] != ':') X continue; X /* X * Remove '-'s from the ACE block to make it X * higly compact in order to let more ACEs X * fit into a 512 Byte exteded header block. X */ X for (ep = &cp[23]; cp <= ep; ) { X if (*cp == '-') { X cp++; X continue; X } X *ap++ = *cp++; X } X } X } X *ap = '\0'; /* Add null byte to the new end */ X} X#endif /* HAVE_NFSV4_ACL */ X X#endif /* USE_ACL */ X X#ifndef DID_OPT_ACL XEXPORT void Xopt_acl() X{ X} X#endif END-of-star-1.6/star/acl_unix.c echo x - star-1.6/star/acltext.c sed 's/^X//' >star-1.6/star/acltext.c << 'END-of-star-1.6/star/acltext.c' X/* @(#)acltext.c 1.16 16/02/08 2005-2016 J. Schilling from SMI */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)acltext.c 1.16 16/02/08 2005-2016 J. Schilling from SMI"; X#endif X/* X * Copyright 2005 Sun Microsystems, Inc. All rights reserved. X * X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only. X * See the file CDDL.Sun.txt in this distribution or X * http://www.opensolaris.org/license/ for details. X */ X X#include X#if defined(HAVE_SUN_ACL) && !defined(IS_CYGWIN) X X#pragma ident "@(#)acltext.c 1.11 02/10/02 SMI" X/*LINTLIBRARY*/ X X#include X#include X#include X#include X#include X#include X#include X#include X#include X#include X#include X X/* X * acltotext() converts each ACL entry to look like this: X * X * entry_type:uid^gid^name:perms X * X * The maximum length of entry_type is 14 ("defaultgroup::" and X * "defaultother::") hence ENTRYTYPELEN is set to 14. X * X * The max length of a uid^gid^name entry (in theory) is 8, hence we use X * LOGNAME_MAX. X * X * The length of a perms entry is 4 to allow for the comma appended to each X * to each acl entry. Hence PERMS is set to 4. X */ X/* X * Warning: LOGNAME_MAX is 8 but sizeof (struct utmpx.ut_user) is 32 X * 8 is also not sufficient to hold a int32_t uid_t and we may even need X * it to be able to hold a int64_t uid_t which needs 20 chars. X */ X#if LOGNAME_MAX < 32 X#define _LOGNAME_MAX_ 32 X#else X#define _LOGNAME_MAX_ LOGNAME_MAX X#endif X X#define ENTRYTYPELEN 14 X#define PERMS 4 X#define ACL_ENTRY_SIZE (ENTRYTYPELEN + _LOGNAME_MAX_ + PERMS) X Xstruct dynaclstr { X size_t bufsize; /* current size of aclexport */ X char *aclexport; X}; X Xstatic char *strappend(char *, char *); Xstatic char *convert_perm(char *, o_mode_t); Xstatic int increase_length(struct dynaclstr *, size_t); Xstatic int isnumeric(char *); X X#define FREE free(aclp);\ X free(allocp) X X/* X * Convert internal acl representation to external representation. X * X * The length of a non-owning user name or non-owning group name ie entries X * of type DEF_USER, USER, DEF_GROUP or GROUP, can exceed LOGNAME_MAX. We X * thus check the length of these entries, and if greater than LOGNAME_MAX, X * we realloc() via increase_length(). X * X * The LOGNAME_MAX, ENTRYTYPELEN and PERMS limits are otherwise always X * adhered to. X */ Xchar * Xacltotext(aclent_t *aclp, int aclcnt) X{ X char *aclexport; X char *where; X struct group *groupp; X struct passwd *passwdp; X struct dynaclstr *dstr; X int i, rtn; X size_t excess = 0; X X if (aclp == NULL) X return (NULL); X if ((dstr = malloc(sizeof (struct dynaclstr))) == NULL) X return (NULL); X dstr->bufsize = aclcnt * ACL_ENTRY_SIZE; X if ((dstr->aclexport = malloc(dstr->bufsize)) == NULL) { X free(dstr); X return (NULL); X } X *dstr->aclexport = '\0'; X where = dstr->aclexport; X X for (i = 0; i < aclcnt; i++, aclp++) { X switch (aclp->a_type) { X case DEF_USER_OBJ: X case USER_OBJ: X if (aclp->a_type == USER_OBJ) X where = strappend(where, "user::"); X else X where = strappend(where, "defaultuser::"); X where = convert_perm(where, aclp->a_perm); X break; X case DEF_USER: X case USER: X if (aclp->a_type == USER) X where = strappend(where, "user:"); X else X where = strappend(where, "defaultuser:"); X passwdp = getpwuid(aclp->a_id); X if (passwdp == (struct passwd *)NULL) { X /* put in uid instead */ X /* XXX better use %j and intmax_t */ X (void) sprintf(where, "%lld", X (long long)aclp->a_id); X } else { X excess = strlen(passwdp->pw_name) - X _LOGNAME_MAX_; X if (excess > 0) { X rtn = increase_length(dstr, excess); X if (rtn == 1) X /* reset where */ X where = dstr->aclexport + X strlen(dstr->aclexport); X else X return (NULL); X } X where = strappend(where, passwdp->pw_name); X } X where = strappend(where, ":"); X where = convert_perm(where, aclp->a_perm); X break; X case DEF_GROUP_OBJ: X case GROUP_OBJ: X if (aclp->a_type == GROUP_OBJ) X where = strappend(where, "group::"); X else X where = strappend(where, "defaultgroup::"); X where = convert_perm(where, aclp->a_perm); X break; X case DEF_GROUP: X case GROUP: X if (aclp->a_type == GROUP) X where = strappend(where, "group:"); X else X where = strappend(where, "defaultgroup:"); X groupp = getgrgid(aclp->a_id); X if (groupp == (struct group *)NULL) { X /* put in gid instead */ X /* XXX better use %j and intmax_t */ X (void) sprintf(where, "%lld", X (long long)aclp->a_id); X } else { X excess = strlen(groupp->gr_name) - X _LOGNAME_MAX_; X if (excess > 0) { X rtn = increase_length(dstr, excess); X if (rtn == 1) X /* reset where */ X where = dstr->aclexport + X strlen(dstr->aclexport); X else X return (NULL); X } X where = strappend(where, groupp->gr_name); X } X where = strappend(where, ":"); X where = convert_perm(where, aclp->a_perm); X break; X case DEF_CLASS_OBJ: X case CLASS_OBJ: X if (aclp->a_type == CLASS_OBJ) X where = strappend(where, "mask:"); X else X where = strappend(where, "defaultmask:"); X where = convert_perm(where, aclp->a_perm); X break; X case DEF_OTHER_OBJ: X case OTHER_OBJ: X if (aclp->a_type == OTHER_OBJ) X where = strappend(where, "other:"); X else X where = strappend(where, "defaultother:"); X where = convert_perm(where, aclp->a_perm); X break; X default: X free(dstr->aclexport); X free(dstr); X return (NULL); X X } X if (i < aclcnt - 1) X where = strappend(where, ","); X } X aclexport = dstr->aclexport; X free(dstr); X return (aclexport); X} X X/* X * Convert external acl representation to internal representation. X * The accepted syntax is: [,]*[,] X * The comma at the end is not prescribed by the man pages. X * But it is needed not to break the old programs. X */ Xaclent_t * Xaclfromtext(char *aclstr, int *aclcnt) X{ X char *fieldp; X char *tp; X char *nextp; X char *allocp; X char *aclimport; X int entry_type; X int id; X int len; X o_mode_t perm; X aclent_t *tmpaclp; X aclent_t *aclp; X struct group *groupp; X struct passwd *passwdp; X X *aclcnt = 0; X aclp = NULL; X X if (! aclstr) X return (NULL); X X len = strlen(aclstr); X X if ((aclimport = allocp = strdup(aclstr)) == NULL) { X (void) fprintf(stderr, "malloc() failed\n"); X return (NULL); X } X X if (aclimport[len - 1] == ',') X aclimport[len - 1] = '\0'; X X for (; aclimport; ) { X /* make sure id is always set up */ X id = -1; X X /* look for an ACL entry */ X tp = strchr(aclimport, ','); X if (tp == NULL) { X nextp = NULL; X } else { X *tp = '\0'; X nextp = tp + 1; X } X X *aclcnt += 1; X X /* X * get additional memory: X * can be more efficient by allocating a bigger block X * each time. X */ X if (*aclcnt > 1) X tmpaclp = (aclent_t *)realloc(aclp, X sizeof (aclent_t) * (*aclcnt)); X else X tmpaclp = (aclent_t *)malloc(sizeof (aclent_t)); X if (tmpaclp == NULL) { X free(allocp); X if (aclp) X free(aclp); X return (NULL); X } X aclp = tmpaclp; X tmpaclp = aclp + (*aclcnt - 1); X X /* look for entry type field */ X tp = strchr(aclimport, ':'); X if (tp == NULL) { X FREE; X return (NULL); X } else X *tp = '\0'; X if (strcmp(aclimport, "user") == 0) { X if (*(tp+1) == ':') X entry_type = USER_OBJ; X else X entry_type = USER; X } else if (strcmp(aclimport, "group") == 0) { X if (*(tp+1) == ':') X entry_type = GROUP_OBJ; X else X entry_type = GROUP; X } else if (strcmp(aclimport, "other") == 0) X entry_type = OTHER_OBJ; X else if (strcmp(aclimport, "mask") == 0) X entry_type = CLASS_OBJ; X else if (strcmp(aclimport, "defaultuser") == 0) { X if (*(tp+1) == ':') X entry_type = DEF_USER_OBJ; X else X entry_type = DEF_USER; X } else if (strcmp(aclimport, "defaultgroup") == 0) { X if (*(tp+1) == ':') X entry_type = DEF_GROUP_OBJ; X else X entry_type = DEF_GROUP; X } else if (strcmp(aclimport, "defaultmask") == 0) X entry_type = DEF_CLASS_OBJ; X else if (strcmp(aclimport, "defaultother") == 0) X entry_type = DEF_OTHER_OBJ; X else { X FREE; X return (NULL); X } X X /* look for user/group name */ X if (entry_type != CLASS_OBJ && entry_type != OTHER_OBJ && X entry_type != DEF_CLASS_OBJ && X entry_type != DEF_OTHER_OBJ) { X fieldp = tp + 1; X tp = strchr(fieldp, ':'); X if (tp == NULL) { X FREE; X return (NULL); X } else X *tp = '\0'; X if (fieldp != tp) { X /* X * The second field could be empty. We only care X * when the field has user/group name. X */ X if (entry_type == USER || X entry_type == DEF_USER) { X struct passwd pw; X X /* X * The reentrant interface getpwnam_r() X * is uncommitted and subject to X * change. Use the friendlier interface X * getpwnam(). X */ X if (isnumeric(fieldp)) { X uid_t uid; X X X errno = 0; X uid = (uid_t)strtol(fieldp, X NULL, 10); X if (errno == 0) { X passwdp = &pw; X passwdp->pw_uid = uid; X } else { X passwdp = NULL; X } X } else { X passwdp = getpwnam(fieldp); X } X if (passwdp == NULL) { X (void) fprintf(stderr, X "user %s not found\n", fieldp); X id = UID_NOBODY; /* nobody */ X } else { X id = passwdp->pw_uid; X } X } else if (entry_type == GROUP || X entry_type == DEF_GROUP) { X struct group gr; X X if (isnumeric(fieldp)) { X gid_t gid; X X errno = 0; X gid = (gid_t)strtol(fieldp, X NULL, 10); X if (errno == 0) { X groupp = &gr; X groupp->gr_gid = gid; X } else { X groupp = NULL; X } X } else { X groupp = getgrnam(fieldp); X } X if (groupp == NULL) { X (void) fprintf(stderr, X "group %s not found\n", X fieldp); X /* no group? */ X id = GID_NOBODY; X } else { X id = groupp->gr_gid; X } X } else { X (void) fprintf(stderr, X "acl import errors\n"); X FREE; X return (NULL); X } X } else { X /* X * The second field is empty. X * Treat it as undefined (-1) X */ X id = -1; X } X } else { X /* X * Let's not break the old applications X * that use mask::rwx, other::rwx format, X * though they violate the man pages. X */ X if (*(tp + 1) == ':') X *++tp = 0; X } X X /* next field: permission */ X fieldp = tp + 1; X if (strlen(fieldp) != 3) { X /* not "rwx" format */ X FREE; X return (NULL); X } else { X char s[] = "rwx"; X int mask = 0x04; X int i; X perm = 0; X X for (i = 0; i < 3; i++, mask /= 2) { X if (fieldp[i] == s[i]) X perm |= mask; X else if (fieldp[i] != '-') { X FREE; X return (NULL); X } X } X } X X tmpaclp->a_type = entry_type; X tmpaclp->a_id = id; X tmpaclp->a_perm = perm; X aclimport = nextp; X } X free(allocp); X return (aclp); X} X Xstatic char * Xstrappend(char *where, char *newstr) X{ X (void) strcat(where, newstr); X return (where + strlen(newstr)); X} X Xstatic char * Xconvert_perm(char *where, o_mode_t perm) X{ X if (perm & 04) X where = strappend(where, "r"); X else X where = strappend(where, "-"); X if (perm & 02) X where = strappend(where, "w"); X else X where = strappend(where, "-"); X if (perm & 01) X where = strappend(where, "x"); X else X where = strappend(where, "-"); X /* perm is the last field */ X return (where); X} X X/* X * Callers should check the return code as this routine may change the string X * pointer in dynaclstr. X */ Xstatic int Xincrease_length(struct dynaclstr *dacl, size_t increase) X{ X char *tptr; X size_t newsize; X X newsize = dacl->bufsize + increase; X tptr = realloc(dacl->aclexport, newsize); X if (tptr != NULL) { X dacl->aclexport = tptr; X dacl->bufsize = newsize; X return (1); X } else X return (0); X} X Xstatic int Xisnumeric(char *p) X{ X int c; X X while ((c = *p++) != '\0') { X if (!isdigit(c)) X return (0); X } X return (1); X} X X#endif /* defined(HAVE_SUN_ACL) && !defined(IS_CYGWIN) */ END-of-star-1.6/star/acltext.c echo x - star-1.6/star/all.mk sed 's/^X//' >star-1.6/star/all.mk << 'END-of-star-1.6/star/all.mk' X#ident @(#)all.mk 1.1 05/02/16 X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X X# X# This is all.mk, it creates sevral binaries, one for each function. X# X# If you like to create one single "fat" binary, remove Makefile X# and copy star_fat.mk to Makefile. X# X XMK_FILES= star.mk pax.mk suntar.mk gnutar.mk cpio.mk X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.mks X########################################################################### END-of-star-1.6/star/all.mk echo x - star-1.6/star/append.c sed 's/^X//' >star-1.6/star/append.c << 'END-of-star-1.6/star/append.c' X/* @(#)append.c 1.33 18/06/21 Copyright 1992, 2001-2018 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)append.c 1.33 18/06/21 Copyright 1992, 2001-2018 J. Schilling"; X#endif X/* X * Routines used to append files to an existing X * tape archive X * X * Copyright (c) 1992, 2001-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include "star.h" X#define GT_COMERR /* #define comerr gtcomerr */ X#define GT_ERROR /* #define error gterror */ X#include X#include "starsubs.h" X Xextern FILE *vpr; X Xextern BOOL debug; Xextern BOOL cflag; Xextern BOOL uflag; Xextern BOOL rflag; X X/* X * XXX We should try to share the hash code with lhash.c X */ Xstatic struct h_elem { X struct h_elem *h_next; X time_t h_time; X long h_nsec; X short h_len; X char h_flags; X char h_data[1]; /* Variable size. */ X} **h_tab; X X#define HF_NSEC 0x01 /* have nsecs */ X Xstatic unsigned h_size; XLOCAL int cachesize; X XEXPORT void skipall __PR((void)); XLOCAL void hash_new __PR((size_t size)); XLOCAL struct h_elem *uhash_lookup __PR((FINFO *info)); XLOCAL void hash_add __PR((FINFO *info)); XEXPORT BOOL update_newer __PR((FINFO *info)); XLOCAL int hashval __PR((Uchar *str, Uint maxsize)); X XEXPORT void Xskipall() X{ X FINFO finfo; X TCB tb; X register TCB *ptb = &tb; X X if (uflag) X hash_new(100); X X fillbytes((char *)&finfo, sizeof (finfo), '\0'); X X if (init_pspace(PS_STDERR, &finfo.f_pname) < 0) X return; X if (init_pspace(PS_STDERR, &finfo.f_plname) < 0) X return; X X finfo.f_tcb = ptb; X for (;;) { X if (get_tcb(ptb) == EOF) X break; X X finfo.f_name = finfo.f_pname.ps_path; X finfo.f_lname = finfo.f_plname.ps_path; X if (tcb_to_info(ptb, &finfo) == EOF) X break; X X if (debug) X fprintf(vpr, "R %s\n", finfo.f_name); X if (uflag) X hash_add(&finfo); X X void_file(&finfo); X } X if (debug) X error("used %d bytes for update cache.\n", cachesize); X} X X#include X XLOCAL void Xhash_new(size) X size_t size; X{ X register int i; X X h_size = size; X h_tab = (struct h_elem **)___malloc(size * sizeof (struct h_elem *), "new hash"); X for (i = 0; i < size; i++) h_tab[i] = 0; X X cachesize += size * sizeof (struct h_elem *); X} X XLOCAL struct h_elem * Xuhash_lookup(info) X FINFO *info; X{ X register char *name = info->f_name; X register struct h_elem *hp; X register int hv; X BOOL slash = FALSE; X X if (info->f_namelen == 0) X info->f_namelen = strlen(info->f_name); X X if (is_dir(info) && info->f_name[info->f_namelen-1] == '/') { X info->f_name[--info->f_namelen] = '\0'; X slash = TRUE; X } X X hv = hashval((unsigned char *)name, h_size); X for (hp = h_tab[hv]; hp; hp = hp->h_next) { X if (info->f_namelen == hp->h_len && *name == *hp->h_data) { X if (streql(name, hp->h_data)) { X if (slash) X info->f_name[info->f_namelen++] = '/'; X return (hp); X } X } X } X if (slash) X info->f_name[info->f_namelen++] = '/'; X return (0); X} X XLOCAL void Xhash_add(info) X FINFO *info; X{ X register int len; X register struct h_elem *hp; X register int hv; X BOOL slash = FALSE; X X if (info->f_namelen == 0) X info->f_namelen = strlen(info->f_name); X X if (is_dir(info) && info->f_name[info->f_namelen-1] == '/') { X info->f_name[--info->f_namelen] = '\0'; X slash = TRUE; X } X if ((hp = uhash_lookup(info)) != 0) { X if (hp->h_time < info->f_mtime) { X hp->h_time = info->f_mtime; X hp->h_nsec = info->f_mnsec; X } else if (hp->h_time == info->f_mtime) { X /* X * If the current archive entry holds extended X * time imformation, honor it. X * Since this function is only called with data from X * the archive, it is sufficient to check the XF_MTIME X * flag. X */ X if (info->f_xflags & XF_MTIME) X hp->h_flags |= HF_NSEC; X else X hp->h_flags &= ~HF_NSEC; X X if ((hp->h_flags & HF_NSEC) && X (hp->h_nsec < info->f_mnsec)) X hp->h_nsec = info->f_mnsec; X } X if (slash) X info->f_name[info->f_namelen++] = '/'; X return; X } X X len = info->f_namelen; X hp = ___malloc((size_t)len + sizeof (struct h_elem), "add hash"); X cachesize += len + sizeof (struct h_elem); X strcpy(hp->h_data, info->f_name); X hp->h_time = info->f_mtime; X hp->h_nsec = info->f_mnsec; X hp->h_len = len; X hp->h_flags = 0; X if (info->f_xflags & XF_MTIME) X hp->h_flags |= HF_NSEC; X hv = hashval((unsigned char *)info->f_name, h_size); X hp->h_next = h_tab[hv]; X h_tab[hv] = hp; X if (slash) X info->f_name[info->f_namelen++] = '/'; X} X XEXPORT BOOL Xupdate_newer(info) X FINFO *info; X{ X register struct h_elem *hp; X X /* X * Since this function is only called with FINFO data from the X * filesystem, it is sufficient to check F_NSECS. X */ X if ((hp = uhash_lookup(info)) != 0) { X if (info->f_mtime > hp->h_time) X return (TRUE); X if ((hp->h_flags & HF_NSEC) && (info->f_flags & F_NSECS) && X info->f_mtime == hp->h_time && info->f_mnsec > hp->h_nsec) X return (TRUE); X return (FALSE); X } X return (TRUE); X} X XLOCAL int Xhashval(str, maxsize) X register Uchar *str; X Uint maxsize; X{ X register int sum = 0; X register int i; X register int c; X X for (i = 0; (c = *str++) != '\0'; i++) X sum ^= (c << (i&7)); X return (sum % maxsize); X} END-of-star-1.6/star/append.c echo x - star-1.6/star/bitstring.h sed 's/^X//' >star-1.6/star/bitstring.h << 'END-of-star-1.6/star/bitstring.h' X/* @(#)bitstring.h 1.7 10/08/24 J. Schilling */ X/* X * Copyright (c) 2003, 2007, 2010 J. Schilling X * X * Copyright (c) 1989, 1993 X * The Regents of the University of California. All rights reserved. X * X * This code is derived from software contributed to Berkeley by X * Paul Vixie. X * X * Redistribution and use in source and binary forms, with or without X * modification, are permitted provided that the following conditions X * are met: X * 1. Redistributions of source code must retain the above copyright X * notice, this list of conditions and the following disclaimer. X * 2. Redistributions in binary form must reproduce the above copyright X * notice, this list of conditions and the following disclaimer in the X * documentation and/or other materials provided with the distribution. X * 3. Neither the name of the University nor the names of its contributors X * may be used to endorse or promote products derived from this software X * without specific prior written permission. X * X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE X * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF X * SUCH DAMAGE. X * X * $FreeBSD: src/sys/sys/bitstring.h,v 1.3 2003/06/13 19:40:13 phk Exp $ X */ X X#ifndef _BITSTRING_H X#define _BITSTRING_H X X#ifdef __cplusplus Xextern "C" { X#endif X Xtypedef unsigned char bitstr_t; X X/* internal macros */ X /* byte of the bitstring bit is in */ X#define _bit_byte(bit) \ X ((bit) >> 3) X X /* mask for the bit within its byte */ X#define _bit_mask(bit) \ X (1 << ((bit)&0x7)) X X/* external macros */ X /* bytes in a bitstring of nbits bits */ X#define bitstr_size(nbits) \ X (((nbits) + 7) >> 3) X X /* allocate a bitstring */ X#define bit_alloc(nbits) \ X (bitstr_t *)calloc((size_t)bitstr_size(nbits), sizeof (bitstr_t)) X X /* allocate a bitstring on the stack */ X#define bit_decl(name, nbits) \ X ((name)[bitstr_size(nbits)]) X X#ifdef _SCHILY_SCHILY_H /* initialize a bitstring */ X#define bit_init(name, nbits) \ X fillbytes(name, bitstr_size(nbits), '\0') X#else X#define bit_init(name, nbits) \ X memset(name, '\0', bitstr_size(nbits)) X#endif X X#ifdef _SCHILY_SCHILY_H /* fill a bitstring */ X#define bit_fill(name, nbits) \ X fillbytes(name, bitstr_size(nbits), '\377') X#else X#define bit_fill(name, nbits) \ X memset(name, '\377', bitstr_size(nbits)) X#endif X X /* is bit N of bitstring name set? */ X#define bit_test(name, bit) \ X ((name)[_bit_byte(bit)] & _bit_mask(bit)) X X /* set bit N of bitstring name */ X#define bit_set(name, bit) \ X ((name)[_bit_byte(bit)] |= _bit_mask(bit)) X X /* clear bit N of bitstring name */ X#define bit_clear(name, bit) \ X ((name)[_bit_byte(bit)] &= ~_bit_mask(bit)) X X /* clear bits start ... stop in bitstring */ X#define bit_nclear(name, start, stop) do { \ X register bitstr_t *_name = (name); \ X register int _start = (start), _stop = (stop); \ X register int _startbyte = _bit_byte(_start); \ X register int _stopbyte = _bit_byte(_stop); \ X if (_startbyte == _stopbyte) { \ X _name[_startbyte] &= ((0xff >> (8 - (_start&0x7))) | \ X (0xff << ((_stop&0x7) + 1))); \ X } else { \ X _name[_startbyte] &= 0xff >> (8 - (_start&0x7)); \ X while (++_startbyte < _stopbyte) \ X _name[_startbyte] = 0; \ X _name[_stopbyte] &= 0xff << ((_stop&0x7) + 1); \ X } \ X} while (0) X X /* set bits start ... stop in bitstring */ X#define bit_nset(name, start, stop) do { \ X register bitstr_t *_name = (name); \ X register int _start = (start), _stop = (stop); \ X register int _startbyte = _bit_byte(_start); \ X register int _stopbyte = _bit_byte(_stop); \ X if (_startbyte == _stopbyte) { \ X _name[_startbyte] |= ((0xff << (_start&0x7)) & \ X (0xff >> (7 - (_stop&0x7)))); \ X } else { \ X _name[_startbyte] |= 0xff << ((_start)&0x7); \ X while (++_startbyte < _stopbyte) \ X _name[_startbyte] = 0xff; \ X _name[_stopbyte] |= 0xff >> (7 - (_stop&0x7)); \ X } \ X} while (0) X X /* find first bit clear in name */ X#define bit_ffc(name, nbits, value) do { \ X register bitstr_t *_name = (name); \ X register int _byte, _nbits = (nbits); \ X register int _stopbyte = _bit_byte(_nbits - 1), _value = -1; \ X if (_nbits > 0) \ X for (_byte = 0; _byte <= _stopbyte; ++_byte) \ X if (_name[_byte] != 0xff) { \ X bitstr_t _lb; \ X _value = _byte << 3; \ X for (_lb = _name[_byte]; (_lb&0x1); \ X ++_value, _lb >>= 1); \ X break; \ X } \ X if (_value >= nbits) \ X _value = -1; \ X *(value) = _value; \ X} while (0) X X /* find first bit set in name */ X#define bit_ffs(name, nbits, value) do { \ X register bitstr_t *_name = (name); \ X register int _byte, _nbits = (nbits); \ X register int _stopbyte = _bit_byte(_nbits - 1), _value = -1; \ X if (_nbits > 0) \ X for (_byte = 0; _byte <= _stopbyte; ++_byte) \ X if (_name[_byte]) { \ X bitstr_t _lb; \ X _value = _byte << 3; \ X for (_lb = _name[_byte]; !(_lb&0x1); \ X ++_value, _lb >>= 1); \ X break; \ X } \ X if (_value >= nbits) \ X _value = -1; \ X *(value) = _value; \ X} while (0) X X /* find first bit clear in name */ X#define bit_ffcs(name, start, stop, value) do { \ X register bitstr_t *_name = (name); \ X register int _start = (start), _stop = (stop); \ X register int _byte = _bit_byte(_start); \ X register int _stopbyte = _bit_byte(_stop), _value = -1; \ X if (_stop >= _start) { \ X if ((_start&0x7) && \ X (_name[_byte] & (0xff >> (8 - (_start&0x7)))) != \ X (0xff >> (8 - (_start&0x7)))) { \ X bitstr_t _lb; \ X _value = _start; \ X _lb = _name[_byte]; \ X for (_lb >>= (8 - (_start&0x7)); (_lb&0x1); \ X ++_value, _lb >>= 1); \ X } else for (; _byte <= _stopbyte; ++_byte) \ X if (_name[_byte] != 0xff) { \ X bitstr_t _lb; \ X _value = _byte << 3; \ X for (_lb = _name[_byte]; (_lb&0x1); \ X ++_value, _lb >>= 1); \ X break; \ X } \ X } \ X if (_value > _stop) \ X _value = -1; \ X *(value) = _value; \ X} while (0) X X /* find first bit set in name */ X#define bit_ffss(name, start, stop, value) do { \ X register bitstr_t *_name = (name); \ X register int _start = (start), _stop = (stop); \ X register int _byte = _bit_byte(_start); \ X register int _stopbyte = _bit_byte(_stop), _value = -1; \ X if (_stop >= _start) { \ X if ((_start&0x7) && \ X (_name[_byte] & (0xff >> (8 - (_start&0x7))))) { \ X bitstr_t _lb; \ X _value = _start; \ X _lb = _name[_byte]; \ X for (_lb >>= (8 - (_start&0x7)); !(_lb&0x1); \ X ++_value, _lb >>= 1); \ X } else for (; _byte <= _stopbyte; ++_byte) \ X if (_name[_byte]) { \ X bitstr_t _lb; \ X _value = _byte << 3; \ X for (_lb = _name[_byte]; !(_lb&0x1); \ X ++_value, _lb >>= 1); \ X break; \ X } \ X } \ X if (_value > _stop) \ X _value = -1; \ X *(value) = _value; \ X} while (0) X X#ifdef __cplusplus X} X#endif X X#endif /* !_BITSTRING_H */ END-of-star-1.6/star/bitstring.h echo x - star-1.6/star/buffer.c sed 's/^X//' >star-1.6/star/buffer.c << 'END-of-star-1.6/star/buffer.c' X/* @(#)buffer.c 1.196 19/03/26 Copyright 1985, 1995, 2001-2019 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)buffer.c 1.196 19/03/26 Copyright 1985, 1995, 2001-2019 J. Schilling"; X#endif X/* X * Buffer handling routines X * X * Copyright (c) 1985, 1995, 2001-2019 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X X/* X * XXX Until we find a better way, the next definitions must be in sync X * XXX with the definitions in librmt/remote.c X */ X#if !defined(HAVE_FORK) || !defined(HAVE_SOCKETPAIR) || !defined(HAVE_DUP2) X#undef USE_RCMD_RSH X#endif X#if !defined(HAVE_GETSERVBYNAME) X#undef USE_REMOTE /* Cannot get rcmd() port # */ X#endif X#if (!defined(HAVE_NETDB_H) || !defined(HAVE_RCMD)) && !defined(USE_RCMD_RSH) X#undef USE_REMOTE /* There is no rcmd() */ X#endif X X#include X#include X#include X#include X#include X#include X#include "star.h" X#include "props.h" X#include X#include X#include "fifo.h" X#include X#include X#include X#include X#define GT_COMERR /* #define comerr gtcomerr */ X#define GT_ERROR /* #define error gterror */ X#include X#include "starsubs.h" X X#include /* for setmode() prototype */ X#include /* getpagesize() */ X X#include X X/* X * Warning: we need the siginfo_t feature that has been introduced in 1989 X * with SVr4 and in 1995 with SUSv1. You need a platform that is maintained X * since 1995. X * X * defined(HAVE_SIGPROCMASK) && defined(SA_RESTART) identifies a system that X * supports sigaction(). X * X * defined(HAVE_SIGINFO_T) && defined(HAVE_WAITID) is needed in order to get X * useful values in siginfo_t. Note that Mac OS X before approx. 2018 e.g. X * neither fills in sip->si_pid nor sip->si_code, making siginfo_t useless. X */ X#if defined(HAVE_SIGPROCMASK) && defined(SA_RESTART) && \ X defined(SA_SIGINFO) && \ X defined(HAVE_SIGINFO_T) && defined(HAVE_WAITID) X#define USE_SIGCLD X#endif X Xlong bigcnt = 0; Xint bigsize = 0; /* Tape block size (may shrink < bigbsize) */ Xint bigbsize = 0; /* Big buffer size */ Xint bufsize = 0; /* Available buffer size */ Xchar *bigbase = NULL; Xchar *bigbuf = NULL; Xchar *bigptr = NULL; Xchar *eofptr = NULL; XLlong curblockno; X Xm_stats bstat; Xm_stats *stats = &bstat; Xint pid; X X#ifdef timerclear XLOCAL struct timespec starttime; XLOCAL struct timespec stoptime; X#endif X XLOCAL BOOL isremote = FALSE; XLOCAL int remfd = -1; XLOCAL char *remfn; X X#ifdef __DJGPP__ XLOCAL FILE *compress_tarf_save; /* Old value of tarf */ XLOCAL FILE *compress_tmpf = NULL; /* FILE * from tmpfile() */ X#endif X Xextern FILE *tarf; Xextern FILE *tty; Xextern FILE *vpr; Xextern char *tarfiles[]; Xextern int ntarfiles; Xextern int tarfindex; Xextern BOOL force_noremote; Xextern char *rsh; Xextern char *rmt; XLOCAL int lastremote = -1; Xextern BOOL multivol; Xextern char *newvol_script; Xextern BOOL use_fifo; Xextern int swapflg; Xextern int cmptype; Xextern BOOL debug; Xextern BOOL print_artype; Xextern BOOL silent; Xextern BOOL showtime; Xextern BOOL no_stats; Xextern BOOL cpio_stats; Xextern BOOL do_fifostats; Xextern BOOL cflag; Xextern BOOL uflag; Xextern BOOL rflag; Xextern BOOL copyflag; Xextern BOOL Zflag; Xextern BOOL zflag; Xextern BOOL bzflag; Xextern BOOL lzoflag; Xextern BOOL p7zflag; Xextern BOOL xzflag; Xextern BOOL lzipflag; Xextern BOOL zstdflag; Xextern BOOL lzmaflag; Xextern BOOL freezeflag; Xextern char *compress_prg; Xextern BOOL multblk; Xextern BOOL partial; Xextern BOOL wready; Xextern BOOL nullout; Xextern Ullong tsize; Xextern BOOL nowarn; X Xextern int intr; X Xextern GINFO *gip; X X XEXPORT void opt_remote __PR((void)); XEXPORT BOOL openremote __PR((void)); XEXPORT void opentape __PR((void)); XEXPORT void closetape __PR((void)); XEXPORT void changetape __PR((BOOL donext)); XEXPORT void nextitape __PR((void)); XEXPORT void nextotape __PR((void)); XEXPORT int startvol __PR((char *buf, int amount)); XEXPORT void newvolhdr __PR((char *buf, int amount, BOOL do_fifo)); X#ifdef FIFO XLOCAL void fbit_ffss __PR((bitstr_t *name, int startb, int stopb, int *value)); XLOCAL BOOL fifo_hpos __PR((char *buf, off_t *posp)); X#endif XEXPORT void initbuf __PR((int nblocks)); XEXPORT void markeof __PR((void)); XEXPORT void syncbuf __PR((void)); XEXPORT int peekblock __PR((char *buf, int amount)); XEXPORT int readblock __PR((char *buf, int amount)); XLOCAL int readtblock __PR((char *buf, int amount)); XLOCAL void readbuf __PR((void)); XEXPORT int readtape __PR((char *buf, int amount)); XEXPORT void filltcb __PR((TCB *ptb)); XEXPORT void movetcb __PR((TCB *from_ptb, TCB *to_ptb)); XEXPORT void *get_block __PR((int amount)); XEXPORT void put_block __PR((int amount)); XEXPORT char *writeblock __PR((char *buf)); XEXPORT int writetape __PR((char *buf, int amount)); XLOCAL void writebuf __PR((int amount)); XLOCAL void flushbuf __PR((void)); XEXPORT void writeempty __PR((void)); XEXPORT void weof __PR((void)); XEXPORT void buf_sync __PR((int size)); XEXPORT void buf_drain __PR((void)); XEXPORT int buf_wait __PR((int amount)); XEXPORT void buf_wake __PR((int amount)); XEXPORT int buf_rwait __PR((int amount)); XEXPORT void buf_rwake __PR((int amount)); XEXPORT void buf_resume __PR((void)); XEXPORT void backtape __PR((void)); XEXPORT int mtioctl __PR((int cmd, int count)); XEXPORT off_t mtseek __PR((off_t offset, int whence)); XEXPORT void marktcb __PR((char *addr)); XEXPORT Llong tblocks __PR((void)); XEXPORT void prstats __PR((void)); XEXPORT BOOL checkerrs __PR((void)); XEXPORT void exprstats __PR((int ret)); XEXPORT void excomerrno __PR((int err, char *fmt, ...)) __printflike__(2, 3); XEXPORT void excomerr __PR((char *fmt, ...)) __printflike__(1, 2); XEXPORT void die __PR((int err)); X#ifdef USE_SIGCLD XLOCAL void cldhandler __PR((int sig, siginfo_t *sip, void *context)); XLOCAL void handlecld __PR((void)); X#endif XLOCAL void compressopen __PR((void)); XLOCAL void compressclose __PR((void)); X XEXPORT void Xopt_remote() X{ X#ifdef USE_REMOTE X printf(" remote"); X#endif X} X X/* X * Check whether the current tarfiles[tarfindex] refers to a remote archive X * location and open a remote connection if needed. X * Called from star.c main() and from changetape(). X */ XEXPORT BOOL Xopenremote() X{ X char host[128]; X char lasthost[128]; X X if ((!nullout || (uflag || rflag)) && !force_noremote && X (remfn = rmtfilename(tarfiles[tarfindex])) != NULL) { X X#ifdef USE_REMOTE X isremote = TRUE; X rmtdebug(debug); X if (rsh) X rmtrsh(rsh); X#ifdef USE_SSH X else X rmtrsh("ssh"); X#endif X if (rmt) X rmtrmt(rmt); X rmthostname(host, sizeof (host), tarfiles[tarfindex]); X if (debug) X errmsgno(EX_BAD, "Remote: %s Host: %s file: %s\n", X tarfiles[tarfindex], host, remfn); X X if (lastremote >= 0) { X rmthostname(lasthost, sizeof (lasthost), X tarfiles[lastremote]); X if (!streql(host, lasthost)) { X close(remfd); X remfd = -1; X lastremote = -1; X } X } X if (remfd < 0 && (remfd = rmtgetconn(host, bigsize, 0)) < 0) X comerrno(EX_BAD, "Cannot get connection to '%s'.\n", X /* errno not valid !! */ host); X lastremote = tarfindex; X#else X comerrno(EX_BAD, "Remote tape support not present.\n"); X#endif X } else { X isremote = FALSE; X } X return (isremote); X} X X/* X * Open the current tarfiles[tarfindex] (a remote connection must be open) X * Called from star.c main() and from changetape(). X */ XEXPORT void Xopentape() X{ X int n = 0; X extern dev_t tape_dev; X extern ino_t tape_ino; X extern BOOL tape_isreg; X X if (copyflag || (nullout && !(uflag || rflag))) { X tarfiles[tarfindex] = "null"; X tarf = (FILE *)NULL; X } else if (streql(tarfiles[tarfindex], "-")) { X if (cflag) { X tarf = stdout; X } else { X tarf = stdin; X multblk = TRUE; X } X setbuf(tarf, (char *)NULL); X setmode(fileno(tarf), O_BINARY); X } else if (isremote) { X#ifdef USE_REMOTE X /* X * isremote will always be FALSE if USE_REMOTE is not defined. X * NOTE any open flag bejond O_RDWR is not portable across X * different platforms. The remote tape library will check X * whether the current /etc/rmt server supports symbolic X * open flags. If there is no symbolic support in the X * remote server, our rmt client code will mask off all X * non portable bits. The remote rmt server defaults to X * O_BINARY as the client (we) may not know about O_BINARY. X * XXX Should we add an option that allows to specify O_TRUNC? X */ X while (rmtopen(remfd, remfn, (cflag ? O_RDWR|O_CREAT:O_RDONLY)|O_BINARY) < 0) { X if (!wready || n++ > 12 || X (geterrno() != EIO && geterrno() != EBUSY)) { X comerr("Cannot open remote '%s'.\n", X tarfiles[tarfindex]); X } else { X sleep(10); X } X } X#endif X } else { X FINFO finfo; X extern BOOL follow; X extern BOOL fcompat; X extern int ptype; X X if (fcompat && (cflag && !(uflag || rflag))) { X /* X * The old syntax has a high risk of corrupting X * files if the user disorders the args. X * For this reason, we do not allow to overwrite X * a plain file in compat mode. X * XXX What if we implement 'r' & 'u' ??? X */ X follow++; X n = _getinfo(tarfiles[tarfindex], &finfo); X follow--; X if (n >= 0 && is_file(&finfo) && finfo.f_size > (off_t)0) { X if (ptype != P_SUNTAR) { X comerrno(EX_BAD, X "Will not overwrite non empty plain files in compat mode.\n"); X } else { X errmsgno(EX_BAD, X "WARNING: Overwriting archive file '%s'.\n", X tarfiles[tarfindex]); X } X } X } X X n = 0; X /* X * XXX Should we add an option that allows to specify O_TRUNC? X */ X while ((tarf = lfilemopen(tarfiles[tarfindex], X cflag?"rwcub":"rub", X S_IRWALL)) == X (FILE *)NULL) { X if (!wready || n++ > 12 || X (geterrno() != EIO && geterrno() != EBUSY)) { X comerr("Cannot open '%s'.\n", X tarfiles[tarfindex]); X } else { X sleep(10); X } X } X } X if (tarf != (FILE *)NULL && isatty(fdown(tarf))) X comerrno(EX_BAD, "Archive cannot be a tty.\n"); X if (!isremote && (!nullout || (uflag || rflag)) && X tarf != (FILE *)NULL) { X file_raise(tarf, FALSE); X checkarch(tarf); X } X vpr = tarf == stdout ? stderr : stdout; /* f=stdout redirect listing */ X if (samefile(tarf, vpr)) { /* Catch -f /dev/stdout case */ X if (tarf != stdin) /* Don't redirect for -tv < */ X vpr = stderr; X } X X /* X * If the archive is a plain file and thus seekable X * do automatic compression detection. X */ X if (stats->volno == 1 && X tape_isreg && !cflag && (!Zflag && !zflag && !bzflag && !lzoflag && X !p7zflag && !xzflag && !lzipflag && !zstdflag && !lzmaflag && X !freezeflag && X !compress_prg)) { X long htype; X TCB *ptb; X X readtblock(bigbuf, TBLOCK); X ptb = (TCB *)bigbuf; X htype = get_hdrtype(ptb, FALSE); X X if (htype == H_UNDEF) { X switch (cmptype = get_compression(ptb)) { X X case C_NONE: X break; X case C_PACK: X case C_GZIP: X case C_LZW: X case C_FREEZE: X case C_LZH: X case C_PKZIP: X if (!silent && !print_artype) errmsgno(EX_BAD, X "WARNING: Archive is '%s' compressed, trying to use the -z option.\n", X get_cmpname(cmptype)); X zflag = TRUE; X break; X case C_BZIP2: X if (!silent && !print_artype) errmsgno(EX_BAD, X "WARNING: Archive is 'bzip2' compressed, trying to use the -bz option.\n"); X bzflag = TRUE; X break; X case C_LZO: X if (!silent && !print_artype) errmsgno(EX_BAD, X "WARNING: Archive is 'lzop' compressed, trying to use the -lzo option.\n"); X lzoflag = TRUE; X break; X case C_7Z: X if (!silent && !print_artype) errmsgno(EX_BAD, X "WARNING: Archive is '7z' compressed, trying to use the -7z option.\n"); X p7zflag = TRUE; X break; X case C_XZ: X if (!silent && !print_artype) errmsgno(EX_BAD, X "WARNING: Archive is 'xz' compressed, trying to use the -xz option.\n"); X xzflag = TRUE; X break; X case C_LZIP: X if (!silent && !print_artype) errmsgno(EX_BAD, X "WARNING: Archive is 'lzip' compressed, trying to use the -lzip option.\n"); X lzipflag = TRUE; X break; X case C_ZSTD: X if (!silent && !print_artype) errmsgno(EX_BAD, X "WARNING: Archive is 'zstd' compressed, trying to use the -zstd option.\n"); X zstdflag = TRUE; X break; X case C_LZMA: X if (!silent && !print_artype) errmsgno(EX_BAD, X "WARNING: Archive is 'lzma' compressed, trying to use the -lzma option.\n"); X lzmaflag = TRUE; X break; X case C_FREEZE2: X if (!silent && !print_artype) errmsgno(EX_BAD, X "WARNING: Archive is 'freeze2' compressed, trying to use the -freeze option.\n"); X freezeflag = TRUE; X break; X default: X if (!silent) errmsgno(EX_BAD, X "WARNING: Unknown compression type %d.\n", cmptype); X break; X } X } X mtseek((off_t)0, SEEK_SET); X } X if (Zflag || zflag || bzflag || lzoflag || X p7zflag || xzflag || lzipflag || zstdflag || lzmaflag || freezeflag || X compress_prg) { X if (isremote) X comerrno(EX_BAD, "Cannot compress remote archives (yet).\n"); X /* X * If both values are zero, this is a device and thus may be a tape. X */ X if (tape_dev || tape_ino) X compressopen(); X else X comerrno(EX_BAD, "Can only compress files.\n"); X } X X#ifdef timerclear X if (showtime && starttime.tv_sec == 0 && starttime.tv_nsec == 0 && X getnstimeofday(&starttime) < 0) X comerr("Cannot get starttime\n"); X#endif X} X X/* X * Close the current open tarf/remfd (a remote connection must be open) X * Called from star.c main() and from changetape(). X */ XEXPORT void Xclosetape() X{ X if (isremote) { X#ifdef USE_REMOTE X /* X * isremote will always be FALSE if USE_REMOTE is not defined. X */ X if (rmtclose(remfd) < 0) X errmsg("Remote close failed.\n"); X#endif X } else { X compressclose(); X if (tarf) X fclose(tarf); X } X} X X/* X * Low level medium change routine. X * Called from nextitape()/nextotape() and fifo_owait(). X */ XEXPORT void Xchangetape(donext) X BOOL donext; X{ X char ans[3]; X int nextindex; X X if (donext) { X pid_t opid = pid; X X if (pid == 0) X pid = 1; /* Make sure the statistics are printed */ X prstats(); X pid = opid; X if (!cflag && X (gip->tapesize > 0) && X (stats->blocks*stats->nblocks + stats->parts/TBLOCK) != X gip->tapesize) { X errmsgno(EX_BAD, X "WARNING: Archive size error.\n"); X errmsgno(EX_BAD, X "Expected size %llu blocks, actual size %lld blocks.\n", X gip->tapesize, X stats->blocks*stats->nblocks + stats->parts/TBLOCK); X } X stats->Tblocks += stats->blocks; X stats->Tparts += stats->parts; X } X stats->blocks = 0L; X stats->parts = 0L; X closetape(); X /* X * XXX Was passiert, wenn wir das 2. Mal bei einem Band vorbeikommen? X * XXX Zur Zeit wird gnadenlos ueberschrieben. X */ X if (donext) { X stats->volno++; X gip->volno = stats->volno; X nextindex = tarfindex + 1; X if (nextindex >= ntarfiles) X nextindex = 0; X } else { X nextindex = tarfindex; X } X /* X * XXX We need to add something like the -l & -o option from X * XXX ufsdump. X */ X if (newvol_script) { X char scrbuf[PATH_MAX]; X X fflush(vpr); X if (!donext) { X errmsgno(EX_BAD, X "Mounted volume on '%s' did not match archive", X tarfiles[nextindex]); X comerrno(EX_BAD, "Aborting.\n"); X } X /* X * The script is called with the next volume # and volume name X * as argument. X */ X js_snprintf(scrbuf, sizeof (scrbuf), "%s '%d' '%s'", X newvol_script, X stats->volno, tarfiles[nextindex]); X system(scrbuf); X } else { X int len; X X errmsgno(EX_BAD, "Mount volume #%d on '%s' and hit ", X stats->volno, tarfiles[nextindex]); X ans[0] = '\n'; X len = fgetstr(tty, ans, sizeof (ans)); X if (len > 0 && ans[len-1] != '\n') { X while (getc(tty) != '\n') { X if (feof(tty) || ferror(tty)) X break; X } X } X X if (ttyerr(tty)) X exit(1); X } X tarfindex = nextindex; X openremote(); X opentape(); X} X X/* X * High level input medium change routine. X * Currently called from buf_rwait(). X * Volume verification in the fifo case is done in the fifo process. X * For this reason, we only verify the new volume in the non fifo case. X */ XEXPORT void Xnextitape() X{ X#ifdef FIFO X if (use_fifo) { X fifo_chitape(); X } else X#endif X { X int skip; X X changetape(TRUE); X readbuf(); X while (bigcnt > 0 && !verifyvol(bigptr, bigcnt, stats->volno, &skip)) { X changetape(FALSE); X readbuf(); X } X if (skip > 0) X buf_rwake(skip*TBLOCK); X } X if (intr) X exit(2); X} X X/* X * High level output medium change routine. X * Currently called from write_tcb() and only used if X * -multivol has not been specified. So this is always called X * from the tar process and never from the fifo background process. X */ XEXPORT void Xnextotape() X{ X weof(); X#ifdef FIFO X if (use_fifo) { X fifo_chotape(); X } else X#endif X changetape(TRUE); X if (intr) X exit(2); X} X X/* X * Called from writetape() X */ XEXPORT int Xstartvol(buf, amount) X char *buf; /* The original buffer address */ X int amount; /* The related requested transfer count */ X{ X char *obuf = bigbuf; X char *optr = bigptr; X long ocnt = bigcnt; X long xcnt = 0; X BOOL ofifo = use_fifo; Xstatic BOOL active = FALSE; /* If TRUE: We are already in a media change */ Xextern m_head *mp; X X if (amount <= 0) X return (amount); X if (active) X comerrno(EX_BAD, "Panic: recursive media change requested!\n"); X if (amount > bigsize) { X comerrno(EX_BAD, X "Panic: trying to write more than bs (%d > %d)!\n", X amount, bigsize); X } X#ifdef FIFO X if (use_fifo) { X mp->chreel = TRUE; X X /* X * Make sure the put side of the FIFO is waiting either on X * mp->iblocked (because the FIFO is full) or on mp->reelwait X * before temporary disabling the FIFO during media change. X */ X while ((mp->eflags & FIFO_EXIT) == 0 && X mp->iblocked == FALSE && mp->reelwait == FALSE) { X usleep(100000); X } X } X#endif X active = TRUE; X X /* X * Save the current write data in "bigbase". X */ X movebytes(buf, bigbase, amount); X X use_fifo = FALSE; X bigbuf = &bigbase[bigsize]; X bigptr = bigbuf; X bigcnt = 0; X X newvolhdr(buf, amount, ofifo); X X if (bigcnt > 0) { /* We did create a volhdr */ X xcnt = bigsize - bigcnt; X if (amount < xcnt) X xcnt = amount; X if (xcnt > 0) { X /* X * Move data from original buffer past the volhdr to X * fill up a complete block size. X */ X movebytes(bigbase, bigptr, xcnt); X bigcnt += xcnt; X } X writetape(bigbuf, bigcnt); X } X X movebytes(bigbase, buf, amount); X bigbuf = obuf; X bigptr = optr; X bigcnt = ocnt; X use_fifo = ofifo; X active = FALSE; X#ifdef FIFO X if (use_fifo) { X mp->chreel = FALSE; X fifo_reelwake(); X } X#endif X return (xcnt); /* Return the amount taken from orig. buffer */ X} X XEXPORT void Xnewvolhdr(buf, amount, do_fifo) X char *buf; /* The original buffer address */ X int amount; /* The related requested transfer count */ X BOOL do_fifo; X{ Xextern m_head *mp; X off_t scur_size; X off_t scur_off; X off_t sold_size; X off_t sold_off; X#ifdef FIFO X off_t new_size = 0; X BOOL nsize_valid = FALSE; X#endif X X fifo_lock_critical(); X scur_size = stats->cur_size; X scur_off = stats->cur_off; X sold_size = stats->old_size; X sold_off = stats->old_off; X#ifdef FIFO X /* X * If needed, find next header position in FIFO bitmap. X */ X if (do_fifo && buf != NULL) /* buf == NULL -> called from put_tcb */ X nsize_valid = fifo_hpos(buf, &new_size); X#endif X fifo_unlock_critical(); X X xbbackup(); /* Save current xheader data */ X X gip->blockoff = stats->Tblocks * stats->nblocks + X stats->Tparts / TBLOCK; X X put_release(); /* Pax 'g' vendor unique */ X put_archtype(); /* Pax 'g' vendor unique */ X X#ifdef FIFO X if (do_fifo && buf != NULL) { /* buf == NULL -> called from put_tcb */ X off_t new_off = 0; X X if (!nsize_valid) { X new_size = scur_size; X new_off = scur_off - FIFO_AMOUNT(mp); X } X /* X * Write a 'g'-header and either a 'V'-header X * or a 'M'-header. X */ X put_volhdr(gip->label, new_size <= 0); X if (new_size > 0) X put_multhdr(new_size, new_off); X } else X#endif X /* X * Write a 'g'-header and either a 'V'-header X * or a 'M'-header. X */ X if (!do_fifo && (sold_off < sold_size)) { X put_volhdr(gip->label, FALSE); X put_multhdr(sold_size, sold_off); X } else { X put_volhdr(gip->label, TRUE); X } X X xbrestore(); /* Restore current xheader data */ X stats->cur_size = scur_size; X stats->cur_off = scur_off; X stats->old_size = sold_size; X stats->old_off = sold_off; X} X X#ifdef FIFO X/* X * Make the macro a function... X */ XLOCAL void Xfbit_ffss(name, startb, stopb, value) X register bitstr_t *name; X register int startb; X register int stopb; X register int *value; X{ X bit_ffss(name, startb, stopb, value); X} X X/* X * Find next header position in FIFO bitmap. X */ XLOCAL BOOL Xfifo_hpos(buf, posp) X char *buf; X off_t *posp; X{ X int startb; X int stopb; X int endb; X int bitpos = -1; X extern m_head *mp; X X startb = (buf - mp->base) / TBLOCK; X stopb = -1 + (mp->putptr - mp->base) / TBLOCK; X endb = -1 + (mp->size) / TBLOCK; X X if (buf < mp->base) { X stopb = mp->bmlast; X startb = stopb + 1 - (mp->base - buf) / TBLOCK; X X fbit_ffss(mp->bmap, startb, stopb, &bitpos); X if (bitpos >= 0) { X *posp = (bitpos - startb) * TBLOCK; X return (TRUE); X } X startb = 0; X stopb = -1 + (mp->putptr - mp->base) / TBLOCK; X } X if (stopb < startb) X fbit_ffss(mp->bmap, startb, endb, &bitpos); X else X fbit_ffss(mp->bmap, startb, stopb, &bitpos); X if (bitpos >= 0) { X *posp = (bitpos - startb) * TBLOCK; X return (TRUE); X } X if (stopb < startb) { X fbit_ffss(mp->bmap, 0, stopb, &bitpos); X if (bitpos >= 0) { X /* X * endb+1 - startb == # of bits in rear part X */ X *posp = (bitpos + endb+1 - startb) * TBLOCK; X return (TRUE); X } X } X return (FALSE); X} X#endif X X/* X * Init buffer or fifo. X * called from star.c main(). X */ XEXPORT void Xinitbuf(nblocks) X int nblocks; X{ X BOOL cvolhdr = cflag && (multivol || tsize > 0); X X pid = getpid(); X bufsize = bigsize = nblocks * TBLOCK; X#ifdef FIFO X if (use_fifo) { X initfifo(); X } X#endif X /* X * As bigbuf is allocated here only in case that we have no FIFO or we X * are in create mode, there are no aliasing problems with bigbuf and X * the shared memory in the FIFO while trying to detect the archive X * format and byte swapping in read/extract modes. X * Note that -r and -u currently disable the FIFO. X * In case that we enable the FIFO for -r and -u, we need to add X * another exception here in order to have space to remember the last X * block of significant data that needs to be modified to append. X */ X if (!use_fifo || cvolhdr || rflag || uflag) { X int pagesize = getpagesize(); X X /* X * llitos() overshoots by one space (' ') in cpio mode, X * add 10 bytes. X * If we create multi volume archives that need volume X * headers, we need additional space to prepare the X * first write to a new medium after a medium change. X * "bufsize" may be modified by initfifo() in the FIFO case, X * so we use "bigsize" for the extra multivol buffer to X * avoid allocating an unneeded huge amount of data here. X * In "replace" or "update" mode, we also may need to X * save/restore * the buffer for the tape record when doing X * EOF detection. As this space is needed at a different X * time, it may be shared with the extra multivol buffer. X */ X if (cvolhdr || rflag || uflag) X bigsize *= 2; X X /* X * roundup(x, y), x needs to be unsigned or x+y non-genative. X */ X#undef roundup X#define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) X X bigptr = bigbuf = ___malloc((size_t)bigsize+10+pagesize, X "buffer"); X bigptr = bigbuf = (char *)roundup((UIntptr_t)bigptr, pagesize); X fillbytes(bigbuf, bigsize, '\0'); X fillbytes(&bigbuf[bigsize], 10, 'U'); X X if (cvolhdr || rflag || uflag) { X bigsize /= 2; X bigbase = bigbuf; X bigbuf = bigptr = &bigbase[bigsize]; X } X } X stats->nblocks = nblocks; X stats->blocksize = bigbsize = bigsize; X stats->volno = 1; X stats->swapflg = -1; X} X X/* X * Mark the EOF position (the position of the first logical TAR EOF block) X * We need this position for later repositioning when appending to an archive. X */ XEXPORT void Xmarkeof() X{ X#ifdef FIFO X if (use_fifo) { X /* X * Remember current FIFO status. X */ X /* EMPTY */ X } X#endif X eofptr = bigptr - TBLOCK; X X if (debug) { X error("Blocks: %lld\n", tblocks()); X error( X "bigptr - bigbuff: %lld bigbuf: %p bigptr: %p eofptr: %p lastsize: %ld\n", X (Llong)(bigptr - bigbuf), X (void *)bigbuf, (void *)bigptr, (void *)eofptr, X stats->lastsize); X } X} X XEXPORT void Xmarktcb(addr) X char *addr; X{ X#ifdef FIFO X extern m_head *mp; X register int bit; X#endif X if (!multivol || !use_fifo) X return; X /* X * As long as we don't start supporting -multivol with CPIO archives, X * we will never come here when writing unblocked archives. X */ X#ifdef FIFO X bit = addr - mp->base; X if (bit % TBLOCK) /* Remove this paranoia test in future. */ X errmsgno(EX_BAD, "TCB offset not mudulo 512.\n"); X bit /= TBLOCK; X if (bit_test(mp->bmap, bit)) /* Remove this paranoia test in future. */ X errmsgno(EX_BAD, "Bit %d is already set.\n", bit); X bit_set(mp->bmap, bit); X#endif X} X X/* X * Prepare the buffer/fifo for reversing the direction from reading to writing. X * Called from star.c main() after skipall() is ready. X */ XEXPORT void Xsyncbuf() X{ X#ifdef FIFO X if (use_fifo) { X /* X * Switch FIFO direction. X */ X excomerr("Cannot update tape with FIFO.\n"); X } X#endif X if (eofptr) { X /* X * Only back up to "eofptr" if markeof() has been called, X * this is not the case when we did ancounter a hard EOF X * at the beginning of the archive (empty file), X */ X bigptr = eofptr; X bigcnt = eofptr - bigbuf; X } X} X X/* X * Peek into buffer for amount bytes. X * Return at most TBLOCK (512) bytes. X * X * Called from get_tcb() for checking the archive format of the first X * tape block. X */ XEXPORT int Xpeekblock(buf, amount) X register char *buf; X register int amount; X{ X register int n; X X if ((n = buf_rwait(amount)) == 0) X return (EOF); X if (n > amount) X n = amount; X if (n >= TBLOCK) { X n = TBLOCK; X movetcb((TCB *)bigptr, (TCB *)buf); X } else { X movebytes(bigptr, buf, n); X } X return (n); X} X X/* X * Read amount bytes. X * Return at most TBLOCK (512) bytes. X * Do CPIO buffer wrap handling here. X * X * Called from get_tcb() and from the sparse handling functions in hole.c X */ XEXPORT int Xreadblock(buf, amount) X register char *buf; X register int amount; X{ X register int n; X X if ((n = peekblock(buf, amount)) != EOF) { X buf_rwake(n); X if (n < amount) { X if ((amount = readblock(&buf[n], amount-n)) == EOF) X return (n); X return (n + amount); X } X } X return (n); X} X X/* X * Low level routine to read a TAPE Block (usually 10k) X * Called from opentape() to check the compression and from readtape(). X */ XLOCAL int Xreadtblock(buf, amount) X char *buf; X int amount; X{ X int cnt; X X stats->reading = TRUE; X if (isremote) { X#ifdef USE_REMOTE X /* X * isremote will always be FALSE if USE_REMOTE is not defined. X */ X if ((cnt = rmtread(remfd, buf, amount)) < 0) X excomerr("Error reading '%s'.\n", tarfiles[tarfindex]); X#endif X } else { X if ((cnt = _niread(fileno(tarf), buf, amount)) < 0) X excomerr("Error reading '%s'.\n", tarfiles[tarfindex]); X } X return (cnt); X} X X/* X * Refill the buffer if no fifo. X * Called from buf_rwait() X */ XLOCAL void Xreadbuf() X{ X bigcnt = readtape(bigbuf, bigsize); X bigptr = bigbuf; X} X X/* X * Mid level function to read a tape block (usually 10k) X * Called from the fifo fill code and from readbuf(). X */ XEXPORT int Xreadtape(buf, amount) X char *buf; X int amount; X{ X int amt; X int cnt; X char *bp; X int size; Xstatic BOOL teof = FALSE; X X if (teof) X return (0); X X amt = 0; X bp = buf; X size = amount; X X do { X cnt = readtblock(bp, size); X X amt += cnt; X bp += cnt; X size -= cnt; X } while (amt < amount && cnt > 0 && multblk); X X if (amt == 0) X return (amt); X if (amt < TBLOCK) { X errmsgno(EX_BAD, "Error reading '%s' size (%d) too small.\n", X tarfiles[tarfindex], amt); X /* X * Do not continue after we did read less than 512 bytes. X */ X teof = TRUE; X } X /* X * First block X */ X if (stats->swapflg < 0) { X if ((amt % TBLOCK) != 0) X comerrno(EX_BAD, "Invalid blocksize %d bytes.\n", amt); X if (amt < amount) { X stats->blocksize = bigsize = amt; X stats->nblocks = bigsize/TBLOCK; X#ifdef FIFO X if (use_fifo) X fifo_ibs_shrink(amt); X#endif X errmsgno(EX_BAD, "Blocksize = %ld records.\n", X stats->blocksize/TBLOCK); X } X } X if (stats->swapflg > 0) X swabbytes(buf, amt); X X if (amt == stats->blocksize) X stats->blocks++; X else X stats->parts += amt; X stats->lastsize = amt; X#ifdef DEBUG X error("readbuf: cnt: %d.\n", amt); X#endif X return (amt); X} X X#define DO8(a) a; a; a; a; a; a; a; a; X X#ifdef MY_SWABBYTES X Xvoid Xswabbytes(bp, cnt) X register char *bp; X register int cnt; X{ X register char c; X X cnt /= 2; /* even count only */ X while ((cnt -= 8) >= 0) { X DO8(c = *bp++; bp[-1] = *bp; *bp++ = c); X } X cnt += 8; X X while (--cnt >= 0) { X c = *bp++; bp[-1] = *bp; *bp++ = c; X } X} X#endif X X#define DO16(a) DO8(a) DO8(a) X XEXPORT void Xfilltcb(ptb) X register TCB *ptb; X{ X register int i; X register long *lp = ptb->ldummy; X X for (i = 512/sizeof (long)/16; --i >= 0; ) { X DO16(*lp++ = 0L) X } X} X XEXPORT void Xmovetcb(from_ptb, to_ptb) X register TCB *from_ptb; X register TCB *to_ptb; X{ X register int i; X register long *from = from_ptb->ldummy; X register long *to = to_ptb->ldummy; X X for (i = 512/sizeof (long)/16; --i >= 0; ) { X DO16(*to++ = *from++) X } X} X X/* X * Try to allocate 'amount' bytes from the buffer or from the fifo. X * If it is not possible to get 'amount' bytes in a single chunk, return NULL. X */ XEXPORT void * Xget_block(amount) X int amount; X{ X if (buf_wait(amount) < amount) X return ((void *)NULL); X return ((void *)bigptr); X} X X/* X * Tell the buffer or the fifo that 'amount' bytes in the buffer/fifo space X * are ready to be written. X */ XEXPORT void Xput_block(amount) X int amount; X{ X buf_wake(amount); X} X X/* X * Write TBLOCK bytes into the buffer/fifo space and tell the buffer/fifo X * that TBLOCK bytes are ready to be written. X */ XEXPORT char * Xwriteblock(buf) X char *buf; X{ X char *obp; X X buf_wait(TBLOCK); X obp = bigptr; X movetcb((TCB *)buf, (TCB *)bigptr); X buf_wake(TBLOCK); X X return (obp); X} X X/* X * Mid level function to write a tape block (usually 10k) X * Called from the fifo fill output code and from writebuf(). X */ XEXPORT int Xwritetape(buf, amount) X char *buf; X int amount; X{ X int cnt; X int err = 0; X /* hartes oder weiches EOF ??? */ X /* d.h. < 0 oder <= 0 */ X stats->reading = FALSE; X if (multivol && tsize) { X Ullong cursize; X X cursize = stats->blocks * stats->nblocks + stats->parts / TBLOCK; X X if (cursize >= tsize) { /* tsize= induced change */ X changetape(TRUE); X cnt = startvol(buf, amount); X if (cnt > 0) X return (cnt); X } X } X seterrno(0); X if (nullout) { X cnt = amount; X#ifdef USE_REMOTE X } else if (isremote) { X cnt = rmtwrite(remfd, buf, amount); /* Handles EINTR */ X#endif X } else { X cnt = _niwrite(fileno(tarf), buf, amount); /* Handles EINTR */ X } X if (cnt == 0) { X err = EFBIG; X } else if (cnt < 0) { X err = geterrno(); X } X X if (multivol && (err == EFBIG || err == ENOSPC)) { X /* X * QIC tapes (unblocked) may do partial writes at EOT. X * We do the tape change not at the point when we write less X * than a tape block (this may happen on pipes too) but after X * we got a true EOF condition. X */ X return (-2); X } X if (multivol && (err == ENXIO)) { X /* X * EOF condition on disk devices X */ X return (-2); X } X X if (cnt == stats->blocksize) X stats->blocks++; X else if (cnt >= 0) X stats->parts += cnt; X X if (cnt <= 0) X excomerrno(err, "Error writing '%s'.\n", tarfiles[tarfindex]); X return (cnt); X} X X/* X * Write output the buffer if no fifo. X * Called from buf_wait() X */ XLOCAL void Xwritebuf(amount) X int amount; X{ X long cnt; X X Xnextwrite: X cnt = writetape(bigbuf, amount); X X if (cnt < amount) { X if (cnt == -2) { /* EOT induced change */ X changetape(TRUE); X if ((cnt = startvol(bigbuf, amount)) <= 0) X goto nextwrite; X } X /* X * QIC tapes (unblocked) may do partial writes at EOT X * X * Even if we hit a "planned" tape change, the fact X * that we need to write a vol header looks from higher X * levels as if there was a partial write. X */ X bigptr = &bigbuf[cnt]; X bigcnt -= cnt; X movebytes(bigptr, bigbuf, bigcnt); X bigptr = &bigbuf[bigcnt]; X } else { X bigptr = bigbuf; X bigcnt = 0; X } X stats->old_size = stats->cur_size; X stats->old_off = stats->cur_off; X} X X/* X * Called only from weof() X */ XLOCAL void Xflushbuf() X{ X#ifdef FIFO X if (!use_fifo) X#endif X { X /* X * Loop because a tape change and writing a vol header X * may look like an incomplete write and need a second X * write to really flush the buffer. X */ X while (bigcnt > 0) X writebuf(bigcnt); X } X} X X/* X * Write an empty TBLOCK X * Called from weof() and cr_file() X */ XEXPORT void Xwriteempty() X{ X TCB tb; X X filltcb(&tb); X writeblock((char *)&tb); X} X X/* X * Write a logical TAR EOF (2 empty TBLOCK sized blocks) X * or a CPIO EOF marker. X */ XEXPORT void Xweof() X{ X if ((props.pr_flags & PR_CPIO) != 0) { X cpio_weof(); X buf_sync(TBLOCK); X } else { X writeempty(); X writeempty(); X } X if (!partial) X buf_sync(0); X flushbuf(); X} X X/* X * If size == 0, fill the buffer up to a TAPE record (usually 10k), X * if size != 0, fill the buffer up to size. X */ XEXPORT void Xbuf_sync(size) X int size; X{ X#ifdef FIFO X if (use_fifo) { X fifo_sync(size); X } else X#endif X if (size) { X int amt = 0; X X if ((bigcnt % size) != 0) X amt = size - bigcnt%size; X X fillbytes(bigptr, amt, '\0'); X bigcnt += amt; X bigptr += amt; X } else { X fillbytes(bigptr, bigsize - bigcnt, '\0'); X bigcnt = bigsize; X } X} X X/* X * Drain the fifo if in fifo mode. X */ XEXPORT void Xbuf_drain() X{ X#ifdef FIFO X if (use_fifo) { X fifo_oflush(); /* Set FIFO_MEOF flag and wake other side */ X fifo_oclose(); /* Close sync pipe to finally wake other side */ X wait(0); X } X#endif X} X X/* X * Wait until we may put amount bytes into the buffer/fifo. X * The returned count may be lower. Callers need to be prepared about this. X */ XEXPORT int Xbuf_wait(amount) X int amount; X{ X#ifdef FIFO X if (use_fifo) { X return (fifo_iwait(amount)); X } else X#endif X { X if (bigcnt >= bigsize) X writebuf(bigsize); X return (bigsize - bigcnt); X } X} X X/* X * Tell the buffer/fifo management that amount bytes are ready to be written. X * The space may now be written to the media and the space may be made X * avbailable for being filled up again. X */ XEXPORT void Xbuf_wake(amount) X int amount; X{ X#ifdef FIFO X if (use_fifo) { X fifo_owake(amount); X } else X#endif X { X bigptr += amount; X bigcnt += amount; X } X if (copyflag) { X /* X * In copy mode, there is no blocked read/write from the fifo X * Tape process. For this reason, we increment the byte count X * at this place. X */ X stats->parts += amount; X } X} X X/* X * Wait until we may read amount bytes from the buffer/fifo. X * The returned count may be lower. Callers need to be prepared about this. X */ XEXPORT int Xbuf_rwait(amount) X int amount; X{ X int cnt; X Xagain: X#ifdef FIFO X if (use_fifo) { X cnt = fifo_owait(amount); X } else X#endif X { X if (bigcnt <= 0) X readbuf(); X cnt = bigcnt; X } X if (cnt == 0 && multivol) { X nextitape(); X goto again; X } X return (cnt); X} X X/* X * Tell the buffer/fifo management that amount bytes are no longer needed for X * read access. The space may now be filled up with new data from the medium. X */ XEXPORT void Xbuf_rwake(amount) X int amount; X{ X#ifdef FIFO X if (use_fifo) { X fifo_iwake(amount); X } else X#endif X { X bigptr += amount; X bigcnt -= amount; X } X} X X/* X * Resume the fifo if the fifo has been blocked after the first read X * TAPE block (usually 10 k). X * If the fifo is active, fifo_resume() triggers a shadow call to X * setprops() in the fifo background process. X */ XEXPORT void Xbuf_resume() X{ Xextern long hdrtype; X stats->swapflg = swapflg; /* copy over for fifo process */ X stats->hdrtype = hdrtype; /* copy over for fifo process */ X bigsize = stats->blocksize; /* copy over for tar process */ X#ifdef FIFO X if (use_fifo) X fifo_resume(); X#endif X} X X/* X * Backspace tape or medium to prepare it for appending to an archive. X * Note that this currently only handles TAR archives and that even then it X * will not work if the TAPE record size is < 2*TBLOCK (1024 bytes). X */ XEXPORT void Xbacktape() X{ X Llong ret; X BOOL istape = FALSE; X X if (debug) { X error("Blocks: %lld\n", tblocks()); X error("filepos: %lld seeking to: %lld bigsize: %d\n", X (Llong)mtseek((off_t)0, SEEK_CUR), X (Llong)mtseek((off_t)0, SEEK_CUR) - (Llong)stats->lastsize, bigsize); X } X X if (mtioctl(MTNOP, 0) >= 0) { X istape = TRUE; X if (debug) X error("Is a tape: BSR 1...\n"); X ret = mtioctl(MTBSR, 1); X } else { X if (debug) X error("Is a file: lseek()\n"); X ret = mtseek(-stats->lastsize, SEEK_CUR); X } X if (ret == (Llong)-1) X excomerr("Cannot backspace %s.\n", istape ? "tape":"medium"); X X if (stats->lastsize == stats->blocksize) X stats->blocks--; X else X stats->parts -= stats->lastsize; X} X X/* X * Send an MTIOCTOP call to the file descriptor that is use for the medium. X */ XEXPORT int Xmtioctl(cmd, count) X int cmd; X int count; X{ X int ret; X X if (nullout && !(uflag || rflag)) { X return (0); X#ifdef USE_REMOTE X } else if (isremote) { X ret = rmtioctl(remfd, cmd, count); X#endif X } else { X#if defined(MTIOCTOP) && defined(HAVE_IOCTL) X struct mtop mtop; X X mtop.mt_op = cmd; X mtop.mt_count = count; X X ret = ioctl(fdown(tarf), MTIOCTOP, &mtop); X#else X#ifdef ENOSYS X seterrno(ENOSYS); X#else X seterrno(EINVAL); X#endif X return (-1); X#endif X } X if (ret < 0 && debug) { X errmsg("Error sending mtioctl(%d, %d) to '%s'.\n", X cmd, count, tarfiles[tarfindex]); X } X return (ret); X} X X/* X * Make an lseek() call to the file descriptor that is use for the medium. X */ XEXPORT off_t Xmtseek(offset, whence) X off_t offset; X int whence; X{ X if (nullout && !(uflag || rflag)) { X return (0L); X#ifdef USE_REMOTE X } else if (isremote) { X return (rmtseek(remfd, offset, whence)); X#endif X } else { X return (lseek(fileno(tarf), offset, whence)); X } X} X X/* X * Return the current archive block number based on 512 byte (TBLOCK) units. X */ XEXPORT Llong Xtblocks() X{ X long fifo_cnt = 0; X Llong ret; X X#ifdef FIFO X if (use_fifo) X fifo_cnt = fifo_amount()/TBLOCK; X#endif X if (stats->reading) X ret = (-fifo_cnt + stats->blocks * stats->nblocks + X (stats->parts - (bigcnt+TBLOCK))/TBLOCK); X else X ret = (fifo_cnt + stats->blocks * stats->nblocks + X (stats->parts + bigcnt)/TBLOCK); X if (debug) { X error("tblocks: %lld blocks: %lld blocksize: %ld parts: %lld bigcnt: %ld fifo_cnt: %ld\n", X ret, stats->blocks, stats->blocksize, stats->parts, bigcnt, fifo_cnt); X } X curblockno = ret; X return (ret); X} X XEXPORT void Xprstats() X{ X Llong bytes; X Llong kbytes; X int per; X#ifdef timerclear X int sec; X int nsec; X int tmsec; X#endif X char *p; X X#ifdef FIFO X if (use_fifo) { X extern m_head *mp; X p = mp->end; X } else X#endif X p = &bigbuf[bigbsize]; X X if ((*p != 'U' && *p != ' ') || p[1] != 'U') X errmsgno(EX_BAD, "The buffer has been overwritten, please contact the author.\n"); X X if (no_stats) X return; X if (pid == 0) /* child */ X return; X X#ifdef timerclear X if (showtime && getnstimeofday(&stoptime) < 0) X comerr("Cannot get stoptime\n"); X#endif X#ifdef FIFO X if (use_fifo && do_fifostats) X fifo_stats(); X#endif X X bytes = stats->blocks * (Llong)stats->blocksize + stats->parts; X kbytes = bytes >> 10; X per = ((bytes&1023)<<10)/10485; X X if (cpio_stats) { X bytes = stats->Tblocks * (Llong)stats->blocksize + stats->Tparts; X X error("%lld blocks\n", stats->eofblock + 1 + bytes/512); X return; X } X X errmsgno(EX_BAD, X "%lld blocks + %lld bytes (total of %lld bytes = %lld.%02dk).\n", X stats->blocks, stats->parts, bytes, kbytes, per); X X if (stats->Tblocks + stats->Tparts) { X bytes = (stats->blocks + stats->Tblocks) * X (Llong)stats->blocksize + X (stats->parts + stats->Tparts); X kbytes = bytes >> 10; X per = ((bytes&1023)<<10)/10485; X X errmsgno(EX_BAD, X "Total %lld blocks + %lld bytes (total of %lld bytes = %lld.%02dk).\n", X stats->blocks + stats->Tblocks, X stats->parts + stats->Tparts, X bytes, kbytes, per); X } X#ifdef timerclear X if (showtime) { X Llong kbs; X X sec = stoptime.tv_sec - starttime.tv_sec; X nsec = stoptime.tv_nsec - starttime.tv_nsec; X tmsec = sec*1000 + nsec/1000000; X if (nsec < 0) { X sec--; X nsec += 1000000000; X } X if (tmsec == 0) X tmsec++; X X kbs = kbytes*(Llong)1000/tmsec; X X errmsgno(EX_BAD, "Total time %d.%03dsec (%lld kBytes/sec)\n", X sec, nsec/1000000, kbs); X } X#endif X#ifdef DBG_MALLOC X aprintlist(stdout, 1); X#endif X} X XEXPORT BOOL Xcheckerrs() X{ X if (xstats.s_staterrs || X#ifdef USE_ACL X xstats.s_getaclerrs || X#endif X xstats.s_openerrs || X xstats.s_rwerrs || X xstats.s_misslinks || X xstats.s_toolong || X xstats.s_toobig || X xstats.s_isspecial || X xstats.s_sizeerrs || X xstats.s_chdir || X xstats.s_iconv || X xstats.s_id || X xstats.s_time || X X xstats.s_settime || X xstats.s_security || X xstats.s_lsecurity || X xstats.s_samefile || X#ifdef USE_ACL X xstats.s_badacl || X xstats.s_setacl || X#endif X#ifdef USE_XATTR X xstats.s_getxattr || X xstats.s_setxattr || X#endif X xstats.s_setmodes || X xstats.s_restore || X xstats.s_compress || X xstats.s_hardeof || X xstats.s_substerrs || X xstats.s_selinuxerrs) { X if (nowarn || no_stats || (pid == 0) /* child */) X return (TRUE); X X errmsgno(EX_BAD, "The following problems occurred during archive processing:\n"); X errmsgno(EX_BAD, "Cannot: stat %d, open %d, read/write %d, chdir %d, iconv %d.\n", X xstats.s_staterrs, X xstats.s_openerrs, X xstats.s_rwerrs, X xstats.s_chdir, X xstats.s_iconv); X if (xstats.s_id || xstats.s_time) X errmsgno(EX_BAD, "Range errors: uid/gid %d, time: %d.\n", X xstats.s_id, xstats.s_time); X errmsgno(EX_BAD, "Size changed %d.\n", X xstats.s_sizeerrs); X errmsgno(EX_BAD, "Missing links %d, Name too long %d, File too big %d, Not dumped %d.\n", X xstats.s_misslinks, X xstats.s_toolong, X xstats.s_toobig, X xstats.s_isspecial); X if (xstats.s_settime || xstats.s_setmodes) X errmsgno(EX_BAD, "Cannot set: time %d, modes %d.\n", X xstats.s_settime, X xstats.s_setmodes); X if (xstats.s_security || xstats.s_lsecurity) X errmsgno(EX_BAD, "Skipped for security reason: path name %d, link name %d.\n", X xstats.s_security, xstats.s_lsecurity); X if (xstats.s_samefile) X errmsgno(EX_BAD, "Skipped same file %d.\n", X xstats.s_samefile); X#ifdef USE_ACL X if (xstats.s_getaclerrs || xstats.s_badacl || xstats.s_setacl) X errmsgno(EX_BAD, "Cannot get ACL: %d set ACL: %d. Bad ACL %d.\n", X xstats.s_getaclerrs, X xstats.s_setacl, X xstats.s_badacl); X#endif X#ifdef USE_XATTR X if (xstats.s_getxattr || xstats.s_setxattr) X errmsgno(EX_BAD, "Cannot get xattr: %d set xattr: %d.\n", X xstats.s_getxattr, X xstats.s_setxattr); X#endif X#ifdef USE_SELINUX X if (xstats.s_selinuxerrs) X errmsgno(EX_BAD, "Cannot set SELinux security context: %d.\n", X xstats.s_selinuxerrs); X#endif X if (xstats.s_restore) X errmsgno(EX_BAD, "Problems with restore database.\n"); X if (xstats.s_compress) X errmsgno(EX_BAD, "Problems with compress program.\n"); X if (xstats.s_substerrs) X errmsgno(EX_BAD, X "%d Problem(s) with path substitution.\n", X xstats.s_substerrs); X if (xstats.s_hardeof) X errmsgno(EX_BAD, "Hard EOF on input.\n"); X X if (xstats.s_security) X errmsgno(EX_BAD, "See option -.. on why some files have been skipped.\n"); X if (xstats.s_lsecurity) X errmsgno(EX_BAD, "See option -secure-links on why some links have been skipped.\n"); X return (TRUE); X } X return (FALSE); X} X XEXPORT void Xexprstats(ret) X int ret; X{ X prstats(); X checkerrs(); X if (use_fifo) X fifo_exit(ret); X exit(ret); X} X X/* VARARGS2 */ X#ifdef PROTOTYPES XEXPORT void Xexcomerrno(int err, char *fmt, ...) X#else XEXPORT void Xexcomerrno(err, fmt, va_alist) X int err; X char *fmt; X va_dcl X#endif X{ X va_list args; X X#ifdef PROTOTYPES X va_start(args, fmt); X#else X va_start(args); X#endif X errmsgno(err, "%r", _(fmt), args); X va_end(args); X#ifdef FIFO X fifo_exit(err); X#endif X exprstats(err); X /* NOTREACHED */ X} X X/* VARARGS1 */ X#ifdef PROTOTYPES XEXPORT void Xexcomerr(char *fmt, ...) X#else XEXPORT void Xexcomerr(fmt, va_alist) X char *fmt; X va_dcl X#endif X{ X va_list args; X int err = geterrno(); X X#ifdef PROTOTYPES X va_start(args, fmt); X#else X va_start(args); X#endif X errmsgno(err, "%r", _(fmt), args); X va_end(args); X#ifdef FIFO X fifo_exit(err); X#endif X exprstats(err); X /* NOTREACHED */ X} X XEXPORT void Xdie(err) X int err; X{ X excomerrno(err, "Cannot recover from error - exiting.\n"); X} X X/* X * Quick hack to implement a -z flag. May be changed soon. X */ X#include X#if defined(SIGDEFER) || defined(SVR4) X#define signal sigset X#endif X XLOCAL pid_t compresspid; X X#ifdef USE_SIGCLD XLOCAL void Xcldhandler(sig, sip, context) X int sig; X siginfo_t *sip; X void *context; X{ X if (sip->si_pid != compresspid) X return; X X if (sip->si_status != 0 || sip->si_code != CLD_EXITED) X xstats.s_compress++; X X if (sip->si_status != 0 && sip->si_code == CLD_EXITED) X errmsgno(EX_BAD, X "Compress program exited with status %d.\n", X sip->si_status); X else if (sip->si_status != 0) X errmsgno(EX_BAD, X "Compress program died with signal %d.\n", X sip->si_status); X} X XLOCAL void Xhandlecld() X{ X struct sigaction sa; X X sa.sa_sigaction = cldhandler; X sigemptyset(&sa.sa_mask); X sa.sa_flags = SA_RESTART|SA_SIGINFO; X X sigaction(SIGCHLD, &sa, NULL); X} X#endif /* USE_SIGCLD */ X XLOCAL void Xcompressopen() X{ X#ifdef HAVE_FORK X FILE *pp[2]; X int mypid; X char *zip_prog = "gzip"; X X if (compress_prg) X zip_prog = compress_prg; X else if (bzflag) X zip_prog = "bzip2"; X else if (Zflag) X zip_prog = "compress"; X else if (lzoflag) X zip_prog = "lzop"; X else if (p7zflag) X zip_prog = "p7zip"; X else if (xzflag) X zip_prog = "xz"; X else if (lzipflag) X zip_prog = "lzip"; X else if (zstdflag) X zip_prog = "zstd"; X else if (lzmaflag) X zip_prog = "lzma"; X else if (freezeflag) X zip_prog = "freeze"; X X multblk = TRUE; X X if (cflag && (uflag || rflag)) X comerrno(EX_BAD, "Cannot update compressed archives.\n"); X X#ifdef __DJGPP__ X if (cflag) { X /* X * We try to emulate a command line like: X * X * "star -c dir | %s > dir.tar.%s\n", X * zip_prog, X * Zflag?"Z":bzflag?"bz2":compress_prg?compress_prg:"gz"); X * X * If we would use popen() instead, DJGPP will run the program X * from popen() first, so there would X * be no data from the "tarf" File pointer. X * We use the temporary file instead. X */ X if ((compress_tmpf = tmpfile()) == NULL) X comerr("Compress pipe failed\n"); X compress_tarf_save = tarf; X tarf = compress_tmpf; X X } else { X int stdin_save; X char zip_cmd[256]; X X /* X * We try to emulate a command line like: X * X * "%s -d < archive.tar.%s | star -x\n", X * zip_prog, X * Zflag?"Z":bzflag?"bz2":compress_prg?compress_prg:"gz"); X */ X js_snprintf(zip_cmd, sizeof (zip_cmd), "%s.exe -d", zip_prog); X X stdin_save = dup(STDIN_FILENO); X dup2(fileno(tarf), STDIN_FILENO); X compress_tarf_save = tarf; X if ((tarf = popen(zip_cmd, "rb")) == NULL) X comerr("Compress pipe failed\n"); X dup2(stdin_save, STDIN_FILENO); X fclose(compress_tarf_save); X } X#else X if (fpipe(pp) == 0) X comerr("Compress pipe failed\n"); X#ifdef USE_SIGCLD X handlecld(); X#endif X mypid = fork(); X if (mypid < 0) X comerr("Compress fork failed\n"); X if (mypid == 0) { X FILE *null; X char *flg = getenv("STAR_COMPRESS_FLAG"); /* Temporary ? */ X X signal(SIGQUIT, SIG_IGN); X if (cflag) X fclose(pp[1]); X else X fclose(pp[0]); X X#ifdef NEED_O_BINARY X if (cflag) X setmode(fileno(pp[0]), O_BINARY); X else X setmode(fileno(pp[1]), O_BINARY); X#endif X X /* We don't want to see errors */ X null = lfilemopen("/dev/null", "rw", S_IRWALL); X if (null == NULL) { X errmsg("Cannot open '%s'.\n", "/dev/null"); X goto err; X } X X if (cflag) X fexecl(zip_prog, pp[0], tarf, null, zip_prog, flg, (char *)NULL); X else X fexecl(zip_prog, tarf, pp[1], null, zip_prog, "-d", (char *)NULL); Xerr: X errmsg("Compress: exec of '%s' failed\n", zip_prog); X _exit(-1); X } else { X compresspid = mypid; X } X fclose(tarf); X if (cflag) { X tarf = pp[1]; X fclose(pp[0]); X } else { X tarf = pp[0]; X fclose(pp[1]); X } X setmode(fileno(tarf), O_BINARY); X#endif /* !__DJGPP__ */ X#else /* !HAVE_FORK */ X comerrno(EX_BAD, "Inline compression not available.\n"); X#endif X} X XLOCAL void Xcompressclose() X{ X#ifdef HAVE_FORK X#ifdef __DJGPP__ X if (cflag) { X if (compress_tmpf) { X char zip_cmd[256]; X FILE *zipf; X int cnt = -1; X char buf[8192]; X char *zip_prog = "gzip"; X X if (compress_prg) X zip_prog = compress_prg; X else if (bzflag) X zip_prog = "bzip2"; X else if (Zflag) X zip_prog = "compress"; X else if (lzoflag) X zip_prog = "lzop"; X else if (p7zflag) X zip_prog = "p7zip"; X else if (xzflag) X zip_prog = "xz"; X else if (lzipflag) X zip_prog = "lzip"; X else if (zstdflag) X zip_prog = "zstd"; X else if (lzmaflag) X zip_prog = "lzma"; X else if (freezeflag) X zip_prog = "freeze"; X X js_snprintf(zip_cmd, sizeof (zip_cmd), "%s.exe", zip_prog); X X dup2(fileno(compress_tarf_save), STDOUT_FILENO); X X if ((zipf = popen(zip_cmd, "wb")) == NULL) X comerr("Compress pipe failed\n"); X X fseek(compress_tmpf, 0l, SEEK_SET); X X while ((cnt = ffileread(compress_tmpf, buf, sizeof (buf))) > 0) X ffilewrite(zipf, buf, cnt); X X pclose(zipf); X fclose(compress_tmpf); X compress_tmpf = (FILE *)NULL; X } X X } else { X pclose(tarf); X } X#endif X#endif X} END-of-star-1.6/star/buffer.c echo x - star-1.6/star/chdir.c sed 's/^X//' >star-1.6/star/chdir.c << 'END-of-star-1.6/star/chdir.c' X/* @(#)chdir.c 1.10 18/10/24 Copyright 1997-2018 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)chdir.c 1.10 18/10/24 Copyright 1997-2018 J. Schilling"; X#endif X/* X * Copyright (c) 1997-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#define GT_COMERR /* #define comerr gtcomerr */ X#define GT_ERROR /* #define error gterror */ X#include X#include "star.h" X#include "starsubs.h" X#include "checkerr.h" X X#include X#include X#include X XEXPORT char *dogetwdir __PR((BOOL doexit)); XEXPORT BOOL dochdir __PR((const char *dir, BOOL doexit)); X Xextern BOOL debug; /* -debug has been specified */ X XEXPORT char * Xdogetwdir(doexit) X BOOL doexit; X{ X char *dir; X char *ndir; X X if ((dir = lgetcwd()) == NULL) { X int err = geterrno(); X X errmsg("Cannot get working directory\n"); X if (doexit) X comexit(err); X return (dir); X } X ndir = ___malloc(strlen(dir)+1, "working dir"); X strcpy(ndir, dir); X free(dir); X return (ndir); X} X XEXPORT BOOL Xdochdir(dir, doexit) X const char *dir; X BOOL doexit; X{ X char *d; X X if (debug) /* temporary */ X error("dochdir(%s) = ", dir); X X d = strdup(dir); X if (d == NULL || lchdir(d) < 0) { X int ex = geterrno(); X X if (debug) /* temporary */ X error("%d\n", ex); X X if (!errhidden(E_CHDIR, dir)) { X if (!errwarnonly(E_CHDIR, dir)) X xstats.s_chdir++; X errmsg("Cannot change directory to '%s'.\n", dir); X (void) errabort(E_CHDIR, dir, TRUE); X } X if (doexit) X exit(ex); X if (d) X free(d); X return (FALSE); X } X if (debug) /* temporary */ X error("%d\n", 0); X X if (d) X free(d); X return (TRUE); X} END-of-star-1.6/star/chdir.c echo x - star-1.6/star/checkerr.c sed 's/^X//' >star-1.6/star/checkerr.c << 'END-of-star-1.6/star/checkerr.c' X/* @(#)checkerr.c 1.28 19/02/28 Copyright 2003-2019 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)checkerr.c 1.28 19/02/28 Copyright 2003-2019 J. Schilling"; X#endif X/* X * Error control for star. X * X * Copyright (c) 2003-2019 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#define GT_COMERR /* #define comerr gtcomerr */ X#define GT_ERROR /* #define error gterror */ X#include X X#include "starsubs.h" X#include "checkerr.h" X Xtypedef struct errconf { X struct errconf *ec_next; /* Next in list */ X const Uchar *ec_pat; /* File name pattern */ X int *ec_aux; /* Aux array from pattern compiler */ X int ec_alt; /* Alt return from pattern compiler */ X int ec_plen; /* String length of pattern */ X UInt32_t ec_flags[E_NFL]; /* Error condition flags */ X} ec_t; X XLOCAL int *ec_state; /* State array for pattern compiler */ XLOCAL ec_t *ec_root; /* Root node of error config list */ XLOCAL ec_t **ec_last = &ec_root; /* Last pointer in root node list */ XLOCAL int maxplen; X XEXPORT int errconfig __PR((char *name)); XLOCAL char *_endword __PR((char *p)); XLOCAL void parse_errctl __PR((char *line)); XLOCAL UInt32_t errflags __PR((char *eflag, BOOL doexit, UInt32_t fla[E_NFL])); XLOCAL ec_t *_errptr __PR((int etype, const char *fname)); XEXPORT BOOL errhidden __PR((int etype, const char *fname)); XEXPORT BOOL errwarnonly __PR((int etype, const char *fname)); XEXPORT BOOL errabort __PR((int etype, const char *fname, BOOL doexit)); X X/* X * Read and parse error configuration file X */ XEXPORT int Xerrconfig(name) X char *name; X{ X char line[8192]; X FILE *f; X int omaxplen = maxplen; X X if ((f = fileopen(name, "r")) == NULL) { X if (errflags(name, FALSE, NULL) != 0) X parse_errctl(name); X else X comerr("Cannot open '%s'.\n", name); X } else { X while (fgetline(f, line, sizeof (line)) >= 0) { X parse_errctl(line); X } X fclose(f); X } X if (maxplen > omaxplen) { X ec_state = ___realloc(ec_state, (maxplen+1)*sizeof (int), X "pattern state"); X } X return (1); X} X XLOCAL char * X_endword(p) X char *p; X{ X /* X * Find end of word. X */ X for (; *p != '\0' && X *p != '\t' && X *p != ' '; X p++) { X ; X /* LINTED */ X } X return (p); X} X XLOCAL void Xparse_errctl(line) X char *line; X{ X int plen; X char *pattern; X ec_t *ep; X X /* X * Find end of word. X */ X pattern = _endword(line); X X if (pattern == line || *pattern == '\0') { X comerrno(EX_BAD, X "Bad error configuration line '%s'.\n", line); X } X /* X * Find end of white space after word. X */ X for (pattern++; *pattern != '\0' && X (*pattern == '\t' || *pattern == ' '); X pattern++) { X ; X /* LINTED */ X } X ep = ___malloc(sizeof (ec_t), "errcheck node"); X errflags(line, TRUE, ep->ec_flags); X ep->ec_plen = plen = strlen(pattern); X if (ep->ec_plen > maxplen) X maxplen = ep->ec_plen; X ep->ec_pat = (const Uchar *)___savestr(pattern); X ep->ec_aux = ___malloc(plen*sizeof (int), "compiled pattern"); X if ((ep->ec_alt = patcompile((const Uchar *)pattern, X plen, ep->ec_aux)) == 0) X comerrno(EX_BAD, "Bad errctl pattern: '%s'.\n", pattern); X X ep->ec_next = NULL; X *ec_last = ep; X ec_last = &ep->ec_next; X} X XLOCAL struct eflags { X char *fname; X UInt32_t fval; X} eflags[] = { X { "STAT", E_STAT }, X { "GETACL", E_GETACL }, X { "OPEN", E_OPEN }, X { "READ", E_READ }, X { "WRITE", E_WRITE }, X { "GROW", E_GROW }, X { "SHRINK", E_SHRINK }, X { "MISSLINK", E_MISSLINK }, X { "NAMETOOLONG", E_NAMETOOLONG }, X { "FILETOOBIG", E_FILETOOBIG }, X { "SPECIALFILE", E_SPECIALFILE }, X { "READLINK", E_READLINK }, X { "GETXATTR", E_GETXATTR }, X { "CHDIR", E_CHDIR }, X { "ICONV", E_ICONV }, X { "ID", E_ID }, X { "TIME", E_TIME }, X X { "SETTIME", E_SETTIME }, X { "SETMODE", E_SETMODE }, X { "SECURITY", E_SECURITY }, X { "LSECURITY", E_LSECURITY }, X { "SAMEFILE", E_SAMEFILE }, X { "BADACL", E_BADACL }, X { "SETACL", E_SETACL }, X { "SETXATTR", E_SETXATTR }, X X { "ALL", E_ALL }, X X { "DIFF", E_DIFF }, X { "WARN", E_WARN }, X { "ABORT", E_ABORT }, X X { NULL, 0 } X}; X X/* X * Convert error condition string into flag word X */ XLOCAL UInt32_t Xerrflags(eflag, doexit, fla) X char *eflag; X BOOL doexit; X UInt32_t fla[E_NFL]; X{ X register char *p = eflag; X char *ef = _endword(eflag); X register struct eflags *ep; X register int slen; X register UInt32_t nflags = 0; X X do { X for (ep = eflags; ep->fname; ep++) { X slen = strlen(ep->fname); X if ((strncmp(ep->fname, p, slen) == 0) && X (p[slen] == '|' || p[slen] == ' ' || X p[slen] == '\0')) { X UInt32_t nfl = ep->fval; X X nflags |= nfl; X if (fla) { X int idx = (nfl & E_EMASK) >> E_SHIFT; X X fla[idx] |= nfl; X } X break; X } X } X if (ep->fname == NULL) { X if (doexit) X comerrno(EX_BAD, "Bad flag '%s'\n", p); X return (0); X } X p = strchr(p, '|'); X } while (p < ef && p && *p++ == '|'); X X if ((nflags & ~(UInt32_t)(E_ABORT|E_WARN)) == 0) { X if (doexit) X comerrno(EX_BAD, "Bad error condition '%s'.\n", eflag); X return (0); X } X return (nflags); X} X XLOCAL ec_t * X_errptr(etype, fname) X int etype; X const char *fname; X{ X ec_t *ep = ec_root; X char *ret; X const Uchar *name = (const Uchar *)fname; X int nlen; X int idx = (etype & E_EMASK) >> E_SHIFT; X X if (fname == NULL) { X errmsgno(EX_BAD, X "Implementation botch for errhidden(0x%X, NULL)\n", X etype); X errmsgno(EX_BAD, "Please report this bug!\n"); X errmsgno(EX_BAD, "Error cannot be ignored.\n"); X return ((ec_t *)NULL); X } X nlen = strlen(fname); X etype &= ~E_EMASK; X while (ep) { X if ((ep->ec_flags[idx] & etype) != 0) { X ret = (char *)patmatch(ep->ec_pat, ep->ec_aux, X name, 0, X nlen, ep->ec_alt, ec_state); X if (ret != NULL && *ret == '\0') X return (ep); X } X ep = ep->ec_next; X } X return ((ec_t *)NULL); X} X X/* X * Check whether error condition should be ignored for file name. X */ XEXPORT BOOL Xerrhidden(etype, fname) X int etype; X const char *fname; X{ X ec_t *ep; X X if ((ep = _errptr(etype, fname)) != NULL) { X if ((ep->ec_flags[0] & (E_ABORT|E_WARN)) != 0) X return (FALSE); X return (TRUE); X } X return (FALSE); X} X X/* X * Check whether error condition should not affect exit code for file name. X */ XEXPORT BOOL Xerrwarnonly(etype, fname) X int etype; X const char *fname; X{ X ec_t *ep; X X if ((ep = _errptr(etype, fname)) != NULL) { X if ((ep->ec_flags[0] & E_WARN) != 0) X return (TRUE); X return (FALSE); X } X return (FALSE); X} X X/* X * Check whether error condition should be fatal for file name. X */ XEXPORT BOOL Xerrabort(etype, fname, doexit) X int etype; X const char *fname; X BOOL doexit; X{ X ec_t *ep; Xextern BOOL cflag; Xextern BOOL errflag; Xextern int intr; X X if ((ep = _errptr(etype, fname)) == NULL) { X if (!errflag) X return (FALSE); X } else if ((ep->ec_flags[0] & E_ABORT) == 0) X return (FALSE); X X if (doexit) { X errmsgno(EX_BAD, "Error is considered fatal, aborting.\n"); X if (cflag) { X intr++; X } else { X prstats(); X comexit(-3); X } X } X return (TRUE); X} END-of-star-1.6/star/checkerr.c echo x - star-1.6/star/checkerr.h sed 's/^X//' >star-1.6/star/checkerr.h << 'END-of-star-1.6/star/checkerr.h' X/* @(#)checkerr.h 1.15 19/02/28 Copyright 2003-2019 J. Schilling */ X/* X * Error control for star. X * X * Copyright (c) 2003-2019 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _CHECKERR_H X#define _CHECKERR_H X X#ifdef __cplusplus Xextern "C" { X#endif X X/* X * Error conditions handled by error control. X */ X#define E_STAT 0x0001 /* Could not stat(2) file */ X#define E_GETACL 0x0002 /* Could not retrieve ACL info */ X#define E_OPEN 0x0004 /* Could not open file */ X#define E_READ 0x0008 /* Could not read file */ X#define E_WRITE 0x0010 /* Could not write file */ X#define E_GROW 0x0020 /* File did grow during backup */ X#define E_SHRINK 0x0040 /* File did shrink during backup */ X#define E_MISSLINK 0x0080 /* Missing hard link(s) for file */ X#define E_NAMETOOLONG 0x0100 /* File name too long for archive */ X#define E_FILETOOBIG 0x0200 /* File too big for archive */ X#define E_SPECIALFILE 0x0400 /* Improper file type for archive */ X#define E_READLINK 0x0800 /* Could not read symbolic link */ X#define E_GETXATTR 0x1000 /* Could not get xattr */ X#define E_CHDIR 0x2000 /* Could not chdir() */ X#define E_ICONV 0x4000 /* Could not convert via iconv() */ X#define E_ID 0x8000 /* Could not write numeric uid/gid */ X#define E_TIME (0x0001|E_FL1) /* Could not convert time_t */ X X/* X * Currently unused: none X */ X X#define E_SETTIME 0x10000 /* Could not set file times */ X#define E_SETMODE 0x20000 /* Could not set access modes */ X#define E_SECURITY 0x40000 /* Skipped for security reasons */ X#define E_LSECURITY 0x80000 /* Link skipped for security */ X#define E_SAMEFILE 0x100000 /* Skipped from/to identical */ X#define E_BADACL 0x200000 /* ACL string conversion error */ X#define E_SETACL 0x400000 /* Could not set ACL for file */ X#define E_SETXATTR 0x800000 /* Could not set xattr */ X X/* X * Unused for flag array index: 0x1000000 .. 0x8000000 X */ X#define E_FL1 0x1000000 /* 1st enhancement bit */ X#define E_FL2 0x2000000 /* 2nd enhancement bit */ X#define E_FL3 0x3000000 /* 3rd enhancement index */ X#define E_FL4 0x4000000 /* 3rd enhancement bit */ X#define E_FL5 0x5000000 /* 5th enhancement index */ X#define E_FL6 0x6000000 /* 6th enhancement index */ X#define E_FL7 0x7000000 /* 7th enhancement index */ X#define E_FL8 0x8000000 /* 4th enhancement bit */ X#define E_FL9 0x9000000 /* 9th enhancement index */ X#define E_FL10 0xA000000 /* 10th enhancement index */ X#define E_FL11 0xB000000 /* 11th enhancement index */ X#define E_FL12 0xC000000 /* 12th enhancement index */ X#define E_FL13 0xD000000 /* 13th enhancement index */ X#define E_FL14 0xE000000 /* 14th enhancement index */ X#define E_FL15 0xF000000 /* 15th enhancement index */ X#define E_EMASK 0xF000000 /* Enhancement mask */ X#define E_NFL 16 /* Number of flag array elements */ X#define E_SHIFT 24 /* Sift to get index */ X X#define E_DIFF 0x10000000 /* Diffs encountered */ X#define E_WARN 0x20000000 /* Print this error but do exit(0) */ X#define E_ABORT 0x40000000 /* Abort on this error */ X#define E_EXT 0x80000000 /* Extended (TBD later) */ X X#define E_ALL (~(UInt32_t)(E_DIFF|E_ABORT)) X Xextern int errconfig __PR((char *name)); Xextern BOOL errhidden __PR((int etype, const char *fname)); Xextern BOOL errwarnonly __PR((int etype, const char *fname)); Xextern BOOL errabort __PR((int etype, const char *fname, X BOOL doexit)); X X#ifdef __cplusplus X} X#endif X X#endif /* _CHECKERR_H */ END-of-star-1.6/star/checkerr.h echo x - star-1.6/star/cpio.c sed 's/^X//' >star-1.6/star/cpio.c << 'END-of-star-1.6/star/cpio.c' X/* @(#)cpio.c 1.34 19/03/27 Copyright 1989, 2005-2019 J. Schilling */ X#include X#ifndef lint Xstatic const char _c_sccsid[] = X "@(#)cpio.c 1.34 19/03/27 Copyright 1989, 2005-2019 J. Schilling"; X#endif X/* X * CPIO specific routines for star main program. X * X * Copyright (c) 1989, 2005-2019 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifdef STAR_MAIN X/* X * We have been included from star.c X */ X#define opts cpio_opts X#define _opts _cpio_opts X#define gargs cpio_gargs X#define susage cpio_susage X#define usage cpio_usage X#define xusage cpio_xusage X#else X#define NO_STAR_MAIN X#define CPIO_MAIN X#define PTYPE_DEFAULT P_CPIO X X#include "star.c" X#endif X XLOCAL void gargs __PR((int ac, char *const *av)); XLOCAL void susage __PR((int ret)); XLOCAL void usage __PR((int ret)); XLOCAL void xusage __PR((int ret)); X#ifdef STAR_MAIN XLOCAL void cpio_setopts __PR((char *o)); X#endif X X/* X * cpio -o[aBcv] X * X * cpio -i[Bcdmrtuvf] [pattern ...] X * X * cpio -p[adlmuv] directory X * X * -o Write tar c X * -i Read tar x X * -i Read -i -t tar t X * -p Pass tar -copy X * X * -a Reset access times of input files after they have been copied X * -B Block input/output to 5120 bytes records X * -c Write/read header information in character form for portability X * -d Create directories as needed X * -f Copy in all files except those in patterns X * -l Whenever possible, link files rather than copying them X * -m Retain previous file modification time X * -r Interactively rename files X * -t Write a table of contents of the input X * -u Copy unconditionally X * -v Verbose: print the names of the affected files X * With the t option, provides a detailed listing X * X * SVr4: X * -A Append X * -b swap bytes and halfwords X * -C Bufsize X * -E Solaris wie star list= X * -H header type X * -I file X * -k Skip corrupt X * -L Follow symlinks X * -M msg Message when switching media X * -O file X * -P Preserve ACLs X * -R id Reassign ids X * -s Swaps bytes within each half word X * -S Swaps halfwords within each word X * -V Special verbose X * -6 ignored X * -@ Extended File Attributes X */ X X/* X * CPIO related options X * X * The official POSIX options start after the -bz/-lzop/-7z/-xz/-lzip/zstd option. X */ X/* BEGIN CSTYLED */ Xchar _opts[] = "help,xhelp,version,debug,xdebug#,xd#,time,no-statistics,fifostats,numeric,no-fifo,no-fsync,do-fsync%0,bs&,fs&,/,..,secure-links,no-secure-links%0,acl,xfflags,z,bz,lzo,7z,xz,lzip,zstd,i,o,p,a,A,b,B,c,C&,d,E*,f,H&,artype&,I&,O&,k,l,L,m,M*,P,r,R,s,S,t,u,6,@,V,v"; X/* END CSTYLED */ Xchar *opts = _opts; X#ifdef NO_STAR_MAIN Xstruct ga_props gaprops; X#endif X XLOCAL void cpio_info __PR((void)); X XLOCAL void Xgargs(ac, av) X int ac; X char *const *av; X{ X int files = 0; X BOOL help = FALSE; X BOOL xhelp = FALSE; X BOOL prvers = FALSE; X BOOL no_fifo = FALSE; X BOOL cpioiflag = FALSE; X BOOL cpiooflag = FALSE; X BOOL cpiobflag = FALSE; X BOOL cpioBflag = FALSE; X BOOL cpiocflag = FALSE; X BOOL cpiolflag = FALSE; X BOOL cpiomflag = FALSE; X char *cpioM = NULL; X char *cpioR = NULL; X BOOL cpiosflag = FALSE; X BOOL cpioSflag = FALSE; X BOOL cpio6flag = FALSE; X BOOL sunxattr = FALSE; X BOOL cpioVflag = FALSE; X Llong llbs = 0; X X X /* X * It does not really make sense to follow the SVr4 rules and by X * default create a UNIX-V7 binary CPIO archive. UNIX-V7 binary X * CPIO archives are not byte order independent and other (non scpio X * based) cpio implementations are unable to deal with byte order X * problems without manual interventions. X * X * The POSIX 1003.1-1988 default archive format is H_CPIO_CHR. We by X * default limit the file name length to 256 bytes with H_CPIO_ODC. X * X * POSIX 1003.1-1988 does not specifiy what archive format to use with X * the -c option. X */ X#ifdef __notdef__ X hdrtype = H_CPIO_BIN; /* The SYSv cpio default format */ X#endif X hdrtype = H_CPIO_ODC; /* POSIX 1003.1-1988 with SYSv compat */ X#ifdef STAR_MAIN X cpio_setopts(opts); /* set up opts for getfiles */ X#endif X getarginit(&gaprops, GAF_DEFAULT); /* Set default behavior */ X X iftype = I_CPIO; /* command line interface */ X ptype = P_CPIO; /* program interface type */ X#ifdef __never__ X paxls = TRUE; /* If ever, implement cpiols */ X#endif X cpio_stats = TRUE; X paxmatch = TRUE; X pflag = TRUE; /* cpio always restores permissions */ X xdir = TRUE; /* cpio restores dirs unconditionally */ X do_install = TRUE; /* cpio always uses install(1) mode */ X force_remove = TRUE; /* cpio always removes old files */ X remove_recursive = TRUE; /* cpio always removes recursively */ X nblocks = 1; /* cpio standard blocksize is 512 */ X no_fsync = TRUE; /* cpio by default does -no-fsync */ X /* X * NOTE: star by default writes into existing files if possible. X * If we like to emulate the Sun cpio behavior, we need to call X * star -x -install -force-remove -remove-recursive X * The only remaining difference to Sun cpio is that Sun cpio does X * rename the old files before extracting the new files and star X * extracts the new file into a temporary name and renames the X * result to the original name. This is better for updating a life X * system without the risk of problems with old binaries. X */ X X if (pname) { /* cli=xxx seen as argv[1] */ X --ac, av++; X } X --ac, ++av; X files = getfilecount(ac, av, opts); X if (getlallargs(&ac, &av, &gaprops, opts, X &help, &xhelp, &prvers, &debug, X &xdebug, &xdebug, X#ifndef __old__lint X &showtime, &no_stats, &do_fifostats, X &numeric, &no_fifo, &no_fsync, &no_fsync, X getenum, &bs, X getenum, &fs, X &abs_path, &allow_dotdot, X &secure_links, &secure_links, X &doacl, &dofflags, X &zflag, &bzflag, &lzoflag, X &p7zflag, &xzflag, &lzipflag, &zstdflag, X X &cpioiflag, /* -i */ X &cpiooflag, /* -o */ X ©flag, /* -p */ X &acctime, /* -a */ X &rflag, /* -A */ X &cpiobflag, /* -b */ X &cpioBflag, /* -B */ X &cpiocflag, /* -c */ X getllnum, &llbs, /* -C */ X &noxdir, /* -d */ X &listfile, /* -E */ X ¬arg, /* -f */ X gethdr, &chdrtype, /* -H */ X gethdr, &chdrtype, /* artype= */ X addtarfile, NULL, /* -I */ X addtarfile, NULL, /* -O */ X &ignoreerr, /* -k */ X &cpiolflag, /* -l */ X &paxfollow, /* -L */ X &cpiomflag, /* -m */ X &cpioM, /* -M */ X &doacl, /* -P */ X &paxinteract, /* -r */ X &cpioR, /* -R */ X &cpiosflag, /* -s */ X &cpioSflag, /* -S */ X &tflag, /* -t */ X &uncond, /* -u */ X &cpio6flag, /* -6 */ X &sunxattr, /* -@ */ X &cpioVflag, /* -V */ X#endif /* __old__lint */ X &verbose) < 0) { X errmsgno(EX_BAD, "Bad Option: %s.\n", av[0]); X susage(EX_BAD); X } X star_helpvers("scpio", help, xhelp, prvers); X X if ((cpioiflag + cpiooflag + copyflag) > 1) { X errmsgno(EX_BAD, X "Too many commands, only one of -i -o or -p is allowed.\n"); X susage(EX_BAD); X } X if (!(cpioiflag | cpiooflag | copyflag)) { X errmsgno(EX_BAD, X "Missing command, one of -i, -o or -p must be specified.\n"); X susage(EX_BAD); X } X if (cpioiflag && !tflag) { X xflag = TRUE; X } else if (cpioiflag) { X tflag = TRUE; X acctime = FALSE; X } else if (cpiooflag) { X cflag = TRUE; X } X if ((cflag || copyflag) && listfile == NULL) X listfile = "-"; /* This is always true for cpio. */ X X X if (uflag || rflag) { X cflag = TRUE; X no_fifo = TRUE; /* Until we are able to reverse the FIFO */ X } X X if (cpiobflag) { X /* swap all */ X errmsgno(EX_BAD, "Unsupported option -b.\n"); X susage(EX_BAD); X } X if (cpioBflag) { X if (llbs != 0 || bs != 0) { X errmsgno(EX_BAD, "Only one of -B -C bs=.\n"); X susage(EX_BAD); X } X nblocks = 10; X bs = nblocks * TBLOCK; X } X if (llbs > 0) { X if (bs != 0) { X errmsgno(EX_BAD, "Only one of -B -C bs=.\n"); X susage(EX_BAD); X } X nblocks = llbs / TBLOCK; X bs = (long)llbs; X if (bs != llbs) { X errmsgno(EX_BAD, "Blocksize used with -C too large.\n"); X susage(EX_BAD); X } X bs = 0; X } X if (copyflag) { X if (nblocks == 1) X nblocks = 20; X } X if (cpiocflag) { X if (chdrtype != H_UNDEF) { X errmsgno(EX_BAD, "Only one of -c -H.\n"); X susage(EX_BAD); X } X chdrtype = H_CPIO_ASC; X } X if (cpiolflag) { X /* link bei -copy */ X errmsgno(EX_BAD, "Unsupported option -l.\n"); X susage(EX_BAD); X } X if (cpioM) { X /* Message to use when switching media */ X errmsgno(EX_BAD, "Unsupported option -M.\n"); X susage(EX_BAD); X } X if (cpioR) { X /* Reassign ownership and group */ X errmsgno(EX_BAD, "Unsupported option -R.\n"); X susage(EX_BAD); X } X if (cpiosflag) { X /* Swap bytes */ X errmsgno(EX_BAD, "Unsupported option -s.\n"); X susage(EX_BAD); X } X if (cpioSflag) { X /* Swap halfwaords */ X errmsgno(EX_BAD, "Unsupported option -S.\n"); X susage(EX_BAD); X } X if (cpio6flag) { X /* UNIX V6 compat */ X errmsgno(EX_BAD, "Unsupported option -6.\n"); X susage(EX_BAD); X } X if (sunxattr) { X /* Extended File Attributes */ X errmsgno(EX_BAD, "Unsupported option -@.\n"); X susage(EX_BAD); X } X if (cpioVflag) { X /* Special Verbose */ X errmsgno(EX_BAD, "Unsupported option -V.\n"); X susage(EX_BAD); X } X if (paxinteract) X interactive = TRUE; X X nomtime = !cpiomflag; X X star_checkopts(/* oldtar */ FALSE, /* dodesc */ FALSE, X /* usetape */ FALSE, X /* archive */ -1, no_fifo, X /* paxopts */ NULL, X llbs); X X nolinkerr = FALSE; X} X XLOCAL void Xcpio_info() X{ X const char *n = pname ? pname : get_progname(); X X error("\nFor a more complete user interface use the tar type command interface.\n"); X error("See 'man star'. The %s command is more or less limited to the\n", n); X error("SUSv2 standard cpio command line interface.\n"); X} X X/* X * Short usage X */ XLOCAL void Xsusage(ret) X int ret; X{ X const char *n = pname ? pname : get_progname(); X X error("Usage:\t%s cmd [options] file1 ... filen\n", n); X error("\nUse\t%s -help\n", n); X error("and\t%s -xhelp\n", n); X error("to get a list of valid cmds and options.\n"); X error("\nUse\t%s -H help\n", n); X error("to get a list of valid archive header formats.\n"); X cpio_info(); X exit(ret); X /* NOTREACHED */ X} X XLOCAL void Xusage(ret) X int ret; X{ X const char *n = pname ? pname : get_progname(); X X error("Usage:\t%s cmd [options] file1 ... filen\n", n); X error("Cmd:\n"); X error("\t-o\t\tCopy out (write files to an archive)\n"); X error("\t-i\t\tCopy in (extract files from archive)\n"); X error("\t-it\t\tList (files from archive)\n"); X error("\t-p\t\tPass (copy files to different location)\n"); X error("Options:\n"); X error("\t-help\t\t(*) print this help\n"); X error("\t-xhelp\t\t(*) print extended help\n"); X error("\t-version\t(*) print version information and exit\n"); X error("\t-a\t\treset access time after storing file\n"); X error("\t-A\t\t(+) append to an existing archive\n"); X error("\t-b\t\t(+) swap bytes and halfwords\n"); X error("\t-B\t\tblock input/output to 5120 bytes records\n"); X error("\t-c\t\twrite/read header information in character form\n"); X error("\t-C #\t\t(+) set (input/output) block size to #\n"); X error("\t-d\t\tcreate directories as needed\n"); X error("\t-E name\t\t(+) read filenames from named file\n"); X error("\t-f\t\tinvert matching rules\n"); X error("\t-H header\t(+) generate 'header' type archive (see -H help)\n"); X error("\tartype=header\t(*) generate 'header' type archive (see artype=help)\n"); X error("\t-I nm\t\t(+) use 'nm' as tape instead of stdin/stdout\n"); X error("\t-k\t\t(+) inore errors - skip corrupt data\n"); X error("\t-l\t\tlink files rather than copying them\n"); X error("\t-L\t\t(+) follow symbolic links as if they were files\n"); X error("\t-m\t\trestore access and modification time\n"); X error("\t-M message\t(+) message to use when switching media\n"); X error("\t-O nm\t\t(+) use 'nm' as tape instead of stdin/stdout\n"); X error("\t-P\t\t(+) handle access control lists\n"); X error("\t-r\t\tdo interactive creation/extraction/renaming\n"); X error("\t-R nm\t\t(+) reassign ownership and group information\n"); X error("\t-s\t\t(+) swap bytes\n"); X error("\t-S\t\t(+) swap halfwords\n"); X error("\t-t\t\twrite a table of contents\n"); X error("\t-u\t\trestore files unconditionally\n"); X error("\t-v\t\tincrement verbose level\n"); X error("\t-V\t\t(+) special verbose\n"); X error("\t-6\t\t(+) UNIX V6 binary cpio compatibility\n"); X error("\t-@\t\t(+) manage extended file attributes\n"); X error("\t-z\t\t(*) pipe input/output through gzip, does not work on tapes\n"); X error("\t-bz\t\t(*) pipe input/output through bzip2, does not work on tapes\n"); X error("\t-lzo\t\t(*) pipe input/output through lzop, does not work on tapes\n"); X error("\t-7z\t\t(*) pipe input/output through p7zip, does not work on tapes\n"); X error("\t-xz\t\t(*) pipe input/output through xp, does not work on tapes\n"); X error("\t-lzip\t\t(*) pipe input/output through lzip, does not work on tapes\n"); X error("\t-zstd\t\t(*) pipe input/output through zstd, does not work on tapes\n"); X#ifdef FIFO X error("\t-no-fifo\t(*) don't use a fifo to optimize data flow from/to tape\n"); X#endif X error("\nAll options marked with (*) are neither defined by SUSv2 nor by SVr4.\n"); X error("All options marked with (+) are SVr4 extensions.\n"); X error("\nThe -c option is compatible to SVr4 cpio and thus is equivalent to -Hasc.\n"); X error("If you like the archive type from SUSv2 cpio -c, use -Hcpio instead.\n"); X cpio_info(); X exit(ret); X /* NOTREACHED */ X} X XLOCAL void Xxusage(ret) X int ret; X{ X const char *n = pname ? pname : get_progname(); X X error("Usage:\t%s cmd [options] file1 ... filen\n", n); X error("Extended options:\n"); X error("\t-debug\t\tprint additional debug messages\n"); X error("\txdebug=#,xd=#\tset extended debug level\n"); X error("\t-/\t\tdon't strip leading '/'s from file names\n"); X error("\t-..\t\tdon't skip filenames that contain '..' in non-interactive extract\n"); X error("\t-secure-links\tdon't extract links that start with '/' or contain '..' (default)\n"); X error("\t-no-secure-links\textract links that start with '/' or contain '..'\n"); X error("\t-acl\t\thandle access control lists\n"); X error("\t-xfflags\thandle extended file flags\n"); X error("\tbs=#\t\tset (output) block size to #\n"); X#ifdef FIFO X error("\tfs=#\t\tset fifo size to #\n"); X#endif X error("\t-no-fsync\tdo not call fsync() for each extracted file (may be dangerous)\n"); X error("\t-do-fsync\tcall fsync() for each extracted file\n"); X error("\t-time\t\tprint timing info\n"); X error("\t-no-statistics\tdo not print statistics\n"); X#ifdef FIFO X error("\t-fifostats\tprint fifo statistics\n"); X#endif X error("\t-numeric\tdon't use user/group name from tape\n"); X error("\nAll options above are not defined by SUSv2 nor by SVr4.\n"); X exit(ret); X /* NOTREACHED */ X} X X#ifdef STAR_MAIN X#undef opts X#undef _opts X#undef gargs X#undef susage X#undef usage X#undef xusage X XLOCAL void Xcpio_setopts(o) X char *o; X{ Xextern char *opts; X opts = o; X} X#endif END-of-star-1.6/star/cpio.c echo x - star-1.6/star/cpio.mk sed 's/^X//' >star-1.6/star/cpio.mk << 'END-of-star-1.6/star/cpio.mk' X#ident @(#)cpio.mk 1.19 13/11/07 X########################################################################### X#include $(MAKE_M_ARCH).def XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= bin XTARGET= scpio X#SYMLINKS= ustar tar XCPPOPTS += -D__STAR__ XCPPOPTS += -DSET_CTIME -DFIFO -DUSE_MMAP -DUSE_REMOTE -DUSE_RCMD_RSH X#CPPOPTS += -DSET_CTIME -DFIFO -DUSE_MMAP X#CPPOPTS += -DSET_CTIME -DUSE_MMAP X#CPPOPTS += -DFIFO -DUSE_MMAP XCPPOPTS += -DUSE_LARGEFILES XCPPOPTS += -DUSE_FIND XCPPOPTS += -DUSE_ACL XCPPOPTS += -DUSE_XATTR XCPPOPTS += -DUSE_FFLAGS XCPPOPTS += -DSCHILY_PRINT XCFILES= cpio.c header.c cpiohdr.c xheader.c xattr.c \ X list.c extract.c create.c append.c diff.c restore.c \ X remove.c star_unix.c acl_unix.c acltext.c fflags.c \ X buffer.c dirtime.c lhash.c \ X hole.c longnames.c \ X movearch.c table.c props.c \ X unicode.c \ X subst.c volhdr.c \ X chdir.c match.c defaults.c dumpdate.c \ X fifo.c device.c checkerr.c \ X findinfo.c pathname.c XHFILES= star.h starsubs.h dirtime.h xtab.h xutimes.h \ X movearch.h table.h props.h fifo.h diff.h \ X checkerr.h dumpdate.h bitstring.h pathname.h XLIBS= -ldeflt -lrmt -lfind -lschily $(LIB_ACL) $(LIB_ATTR) $(LIB_SOCKET) $(LIB_INTL) $(LIB_CAP) XXMK_FILE= scpioman.mk X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.cmd X########################################################################### Xcount: $(CFILES) $(HFILES) X count $r1 X END-of-star-1.6/star/cpio.mk echo x - star-1.6/star/cpiohdr.c sed 's/^X//' >star-1.6/star/cpiohdr.c << 'END-of-star-1.6/star/cpiohdr.c' X/* @(#)cpiohdr.c 1.34 18/07/15 Copyright 1994-2018 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)cpiohdr.c 1.34 18/07/15 Copyright 1994-2018 J. Schilling"; X#endif X/* X * Handling routines to read/write, parse/create X * cpio archive headers X * X * Copyright (c) 1994-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include "star.h" X#include "props.h" X#include "table.h" X#include X#include X#include X#define __XDEV__ /* Needed to activate _dev_major()/_dev_minor() */ X#include X#define GT_COMERR /* #define comerr gtcomerr */ X#define GT_ERROR /* #define error gterror */ X#include X#include X#include "starsubs.h" X#include "movearch.h" X#include "fifo.h" X Xextern long hdrtype; Xextern BOOL ignoreerr; Xextern BOOL link_dirs; X XEXPORT void put_cpioh __PR((TCB *ptb, FINFO *info)); XEXPORT void cpio_weof __PR((void)); XEXPORT void cpioinfo_to_tcb __PR((FINFO *info, TCB *ptb)); XEXPORT int cpiotcb_to_info __PR((TCB *ptb, FINFO *info)); XEXPORT void cpio_resync __PR((void)); XEXPORT int cpio_checkswab __PR((TCB *ptb)); XLOCAL Int32_t cpio_cksum __PR((char *name)); XLOCAL void astoo_cpio __PR((char *s, Ulong *l, int cnt)); XLOCAL void astoh_cpio __PR((char *s, Ulong *l, int cnt)); XLOCAL void litoh_cpio __PR((char *s, Ulong l, int fieldw)); X XEXPORT void Xput_cpioh(ptb, info) X TCB *ptb; X register FINFO *info; X{ X move_t move; X FINFO ninfo; X X if (is_file(info) && H_TYPE(hdrtype) == H_CPIO_ACRC) { X info->f_flags |= F_CRC; X cpioinfo_to_tcb(info, ptb); X } X if ((info->f_flags & F_TCB_BUF) != 0) { /* TCB is on buffer */ X put_block(props.pr_hdrsize); X } else { X int i; X extern char *bigptr; X X /* X * This is a writeblock() implementation that X * deals with buffer wrap around problems. X */ X i = buf_wait(props.pr_hdrsize); X if (i < props.pr_hdrsize) { X int rest; X X movebytes(ptb, bigptr, i); X buf_wake(i); X rest = props.pr_hdrsize - i; X buf_wait(rest); X movebytes(((char *)ptb)+i, bigptr, rest); X buf_wake(rest); X } else { X movebytes(ptb, bigptr, props.pr_hdrsize); X buf_wake(props.pr_hdrsize); X } X } X X /* X * If we decide to be able to auto-add a slash at the end of a X * directory we need to change name_to_tcb() in longname.c X */ X fillbytes(&ninfo, sizeof (ninfo), '\0'); X move.m_data = info->f_name; X move.m_flags = 0; /* No MF_ADDSLASH */ X move.m_size = info->f_namelen + 1; X ninfo.f_rsize = info->f_namelen + 1; X ninfo.f_flags |= F_LONGNAME; X ninfo.f_name = "file name"; X cr_file(&ninfo, vp_move_to_arch, &move, 0, "moving file name"); X X if (is_symlink(info)) { X move.m_data = info->f_lname; X move.m_size = info->f_lnamelen; X ninfo.f_rsize = info->f_lnamelen; X ninfo.f_flags = 0; X cr_file(&ninfo, vp_move_to_arch, &move, 0, "moving link name"); X } X} X XEXPORT void Xcpio_weof() X{ X TCB tb; X register TCB *ptb; X FINFO ninfo; X X fillbytes(&ninfo, sizeof (ninfo), '\0'); X X if ((ptb = (TCB *)get_block(props.pr_hdrsize)) == NULL) X ptb = &tb; X else X ninfo.f_flags |= F_TCB_BUF; X X ninfo.f_name = "TRAILER!!!"; X ninfo.f_namelen = 10; X ninfo.f_nlink = 1; X cpioinfo_to_tcb(&ninfo, ptb); X put_cpioh(ptb, &ninfo); X} X XEXPORT void Xcpioinfo_to_tcb(info, ptb) X register FINFO *info; X register TCB *ptb; X{ X register char *p = (char *)ptb; X nlink_t nlink = info->f_nlink; X Ulong crc = 0L; X Int16_t s; X UInt16_t us; X Int32_t l; X X X /* X * The header is rewritten later in read_link() X * with a new unique st_dev/st_ino. X */ X if (!link_dirs && is_dir(info)) X nlink = 1; X X switch (H_TYPE(hdrtype)) { X X case H_CPIO_BIN: X /* X * We always create binary archives in network byte order. X */ X *p++ = '\161'; *p++ = '\307'; X s = info->f_dev; X i_to_2_byte(p, s); p += 2; X us = info->f_ino; X i_to_2_byte(p, us); p += 2; X us = info->f_type|info->f_mode; X i_to_2_byte(p, us); p += 2; X us = info->f_uid; X i_to_2_byte(p, us); p += 2; X us = info->f_gid; X i_to_2_byte(p, us); p += 2; X s = info->f_nlink; X i_to_2_byte(p, s); p += 2; X s = info->f_rdev; X i_to_2_byte(p, s); p += 2; X l = info->f_mtime; X i_to_4_byte(p, l); p += 4; X s = info->f_namelen+1; X i_to_2_byte(p, s); p += 2; X if (is_symlink(info)) X l = info->f_lnamelen; X else X l = info->f_rsize; X i_to_4_byte(p, l); p += 4; X break; X X case H_CPIO_CHR: X case H_CPIO_ODC: X *p++ = '0'; *p++ = '7'; X *p++ = '0'; *p++ = '7'; X *p++ = '0'; *p++ = '7'; X llitos(&((char *)ptb)[6], (Ullong)info->f_dev, 6); X llitos(&((char *)ptb)[12], (Ullong)info->f_ino, 6); X llitos(&((char *)ptb)[18], (Ullong)(info->f_type|info->f_mode), 6); X llitos(&((char *)ptb)[24], (Ullong)info->f_uid, 6); X llitos(&((char *)ptb)[30], (Ullong)info->f_gid, 6); X llitos(&((char *)ptb)[36], (Ullong)nlink, 6); X llitos(&((char *)ptb)[42], (Ullong)info->f_rdev, 6); X llitos(&((char *)ptb)[48], (Ullong)info->f_mtime, 11); X llitos(&((char *)ptb)[59], (Ullong)info->f_namelen+1, 6); X if (is_symlink(info)) X llitos(&((char *)ptb)[65], (Ullong)info->f_lnamelen, 11); X else X llitos(&((char *)ptb)[65], (Ullong)info->f_rsize, 11); X break; X X case H_CPIO_ASC: X case H_CPIO_ACRC: X *p++ = '0'; *p++ = '7'; X *p++ = '0'; *p++ = '7'; X if (H_TYPE(hdrtype) == H_CPIO_ASC) { X *p++ = '0'; *p++ = '1'; X } else { X *p++ = '0'; *p++ = '2'; X } X litoh_cpio(&((char *)ptb)[6], (Ulong)info->f_ino, 8); X litoh_cpio(&((char *)ptb)[14], (Ulong)(info->f_type|info->f_mode), 8); X litoh_cpio(&((char *)ptb)[22], (Ulong)info->f_uid, 8); X litoh_cpio(&((char *)ptb)[30], (Ulong)info->f_gid, 8); X litoh_cpio(&((char *)ptb)[38], (Ulong)nlink, 8); X litoh_cpio(&((char *)ptb)[46], (Ulong)info->f_mtime, 8); X if (is_symlink(info)) X litoh_cpio(&((char *)ptb)[54], (Ulong)info->f_lnamelen, 8); X else X litoh_cpio(&((char *)ptb)[54], (Ulong)info->f_rsize, 8); X litoh_cpio(&((char *)ptb)[62], (Ulong)major(info->f_dev), 8); X litoh_cpio(&((char *)ptb)[70], (Ulong)minor(info->f_dev), 8); X litoh_cpio(&((char *)ptb)[78], (Ulong)info->f_rdevmaj, 8); X litoh_cpio(&((char *)ptb)[86], (Ulong)info->f_rdevmin, 8); X litoh_cpio(&((char *)ptb)[94], (Ulong)info->f_namelen+1, 8); X if (is_file(info) && info->f_flags & F_CRC) X crc = cpio_cksum(info->f_name); X litoh_cpio(&((char *)ptb)[102], crc, 8); X break; X X default: X errmsgno(EX_BAD, "Found CPIO type %ld/%d ", hdrtype, H_TYPE(hdrtype)); X print_hdrtype(stderr, hdrtype); X comerrno(EX_BAD, "Can't handle this cpio archive type (yet).\n"); X } X} X X/* X * CPIO header offsets: X * X * -Hodc (POSIX) X * c_magic[6] 0 X * c_dev[6] 6 X * c_ino[6] 12 X * c_mode[6] 18 X * c_uid[6] 24 X * c_gid[6] 30 X * c_nlink[6] 36 X * c_rdev[6] 42 X * c_mtime[11] 48 X * c_namesize[6] 59 X * c_filesize[11] 65 X * c_name[] 76 X * X * -Hcrc X * E_magic[6] 0 X * E_ino[8] 6 X * E_mode[8] 14 X * E_uid[8] 22 X * E_gid[8] 30 X * E_nlink[8] 38 X * E_mtime[8] 46 X * E_filesize[8] 54 X * E_maj[8] 62 X * E_min[8] 70 X * E_rmaj[8] 78 X * E_rmin[8] 86 X * E_namesize[8] 94 X * E_chksum[8] 102 X * E_name[] 110 X * X * Binary V7 default X * h_magic[2] 0 X * h_dev[2] 2 X * h_ino[2] 4 X * h_mode[2] 6 X * h_uid[2] 8 X * h_gid[2] 10 X * h_nlink[2] 12 X * h_rdev[2] 14 X * h_mtime[4] 16 X * h_namesize[2] 20 X * h_filesize[4] 22 X * X */ X XEXPORT int Xcpiotcb_to_info(ptb, info) X register TCB *ptb; X register FINFO *info; X{ X Ulong ul; X move_t move; X long l1; X long l2; X BOOL swapped = FALSE; X char binhdr[CPIOBIN_HDRSZ]; X X X switch (H_TYPE(hdrtype)) { X X case H_CPIO_BIN: X l1 = (((char *)ptb)[20] & 0xFF) * 256 + (((char *)ptb)[21] & 0xFF); X l2 = (((char *)ptb)[21] & 0xFF) * 256 + (((char *)ptb)[20] & 0xFF); X if (l1 <= 257 || l2 <= 257) { X if (l2 <= 257) X swapped = TRUE; X } X if (swapped) { X movebytes(ptb, binhdr, CPIOBIN_HDRSZ); X ptb = (TCB *)binhdr; X swabbytes((char *)ptb, props.pr_hdrsize); X } X X l1 = ((char *)ptb)[2] * 256 + (((char *)ptb)[3] & 0xFF); X info->f_dev = l1; X ul = (((char *)ptb)[4] & 0xFF) * 256 + (((char *)ptb)[5] & 0xFF); X info->f_ino = ul; X ul = (((char *)ptb)[6] & 0xFF) * 256 + (((char *)ptb)[7] & 0xFF); X info->f_mode = ul; X info->f_type = info->f_mode & S_IFMT; X info->f_mode = info->f_mode & 07777; X info->f_rxftype = info->f_xftype = IFTOXT(info->f_type); X info->f_filetype = XTTOST(info->f_xftype); X info->f_typeflag = XTTOUS(info->f_xftype); X ul = (((char *)ptb)[8] & 0xFF) * 256 + (((char *)ptb)[9] & 0xFF); X info->f_uid = ul; X ul = (((char *)ptb)[10] & 0xFF) * 256 + (((char *)ptb)[11] & 0xFF); X info->f_gid = ul & 0xFFFF; X l1 = ((char *)ptb)[12] * 256 + (((char *)ptb)[13] & 0xFF); X if (is_dir(info) && !link_dirs) X l1 = 1; X info->f_nlink = l1; X l1 = ((char *)ptb)[14] * 256 + (((char *)ptb)[15] & 0xFF); X info->f_rdev = l1; X info->f_rdevmaj = _dev_major(8, info->f_rdev); X info->f_rdevmin = _dev_minor(8, info->f_rdev); X info->f_rdev = makedev(info->f_rdevmaj, info->f_rdevmin); X X l1 = ((char *)ptb)[16] * 256 + (((char *)ptb)[17] & 0xFF); X l2 = (((char *)ptb)[18] & 0xFF) * 256 + (((char *)ptb)[19] & 0xFF); X l1 *= 0x10000; X l1 += l2; X info->f_atime = info->f_mtime = info->f_ctime = (time_t)l1; X X l1 = ((char *)ptb)[20] * 256 + (((char *)ptb)[21] & 0xFF); X info->f_namelen = l1; X X l1 = ((char *)ptb)[22] * 256 + (((char *)ptb)[23] & 0xFF); X l2 = (((char *)ptb)[24] & 0xFF) * 256 + (((char *)ptb)[25] & 0xFF); X l1 *= 0x10000; X l1 += l2; X info->f_size = l1; X break; X X case H_CPIO_CHR: X case H_CPIO_ODC: X X astoo_cpio(&((char *)ptb)[6], &ul, 6); X info->f_dev = ul; X astoo_cpio(&((char *)ptb)[12], &ul, 6); X info->f_ino = ul; X astoo_cpio(&((char *)ptb)[18], &ul, 6); X info->f_mode = ul; X info->f_type = info->f_mode & S_IFMT; X info->f_mode = info->f_mode & 07777; X info->f_rxftype = info->f_xftype = IFTOXT(info->f_type); X info->f_filetype = XTTOST(info->f_xftype); X info->f_typeflag = XTTOUS(info->f_xftype); X astoo_cpio(&((char *)ptb)[24], &ul, 6); X info->f_uid = ul; X astoo_cpio(&((char *)ptb)[30], &ul, 6); X info->f_gid = ul; X astoo_cpio(&((char *)ptb)[36], &ul, 6); X if (is_dir(info) && !link_dirs) X ul = 1; X info->f_nlink = ul; X astoo_cpio(&((char *)ptb)[42], &ul, 6); X info->f_rdev = ul; X /* X * This is undefined by POSIX. X * Let us hope that all implementations will assume 8 bits X * in the minor number. X */ X info->f_rdevmaj = _dev_major(8, info->f_rdev); X info->f_rdevmin = _dev_minor(8, info->f_rdev); X info->f_rdev = makedev(info->f_rdevmaj, info->f_rdevmin); X X astoo_cpio(&((char *)ptb)[48], &ul, 11); X info->f_atime = info->f_mtime = info->f_ctime = (time_t)ul; X X astoo_cpio(&((char *)ptb)[59], &ul, 6); X info->f_namelen = ul; X X astoo_cpio(&((char *)ptb)[65], &ul, 11); X info->f_size = ul; X break; X X case H_CPIO_ASC: X case H_CPIO_ACRC: X X astoh_cpio(&((char *)ptb)[6], &ul, 8); X info->f_ino = ul; X astoh_cpio(&((char *)ptb)[14], &ul, 8); X info->f_mode = ul; X info->f_type = info->f_mode & S_IFMT; X info->f_mode = info->f_mode & 07777; X info->f_rxftype = info->f_xftype = IFTOXT(info->f_type); X info->f_filetype = XTTOST(info->f_xftype); X info->f_typeflag = XTTOUS(info->f_xftype); X astoh_cpio(&((char *)ptb)[22], &ul, 8); X info->f_uid = ul; X astoh_cpio(&((char *)ptb)[30], &ul, 8); X info->f_gid = ul; X astoh_cpio(&((char *)ptb)[38], &ul, 8); X if (is_dir(info) && !link_dirs) X ul = 1; X info->f_nlink = ul; X X astoh_cpio(&((char *)ptb)[46], &ul, 8); X info->f_atime = info->f_mtime = info->f_ctime = (time_t)ul; X X astoh_cpio(&((char *)ptb)[54], &ul, 8); X info->f_size = ul; X X astoh_cpio(&((char *)ptb)[62], &ul, 8); X info->f_rdevmaj = ul; X astoh_cpio(&((char *)ptb)[70], &ul, 8); X info->f_rdevmin = ul; X info->f_dev = makedev(info->f_rdevmaj, info->f_rdevmin); X X astoh_cpio(&((char *)ptb)[78], &ul, 8); X info->f_rdevmaj = ul; X astoh_cpio(&((char *)ptb)[86], &ul, 8); X info->f_rdevmin = ul; X info->f_rdev = makedev(info->f_rdevmaj, info->f_rdevmin); X X astoh_cpio(&((char *)ptb)[94], &ul, 8); X info->f_namelen = ul; X break; X X default: X errmsgno(EX_BAD, "Found CPIO type %ld/%d ", hdrtype, H_TYPE(hdrtype)); X print_hdrtype(stderr, hdrtype); X comerrno(EX_BAD, "Can't handle this cpio archive type (yet).\n"); X } X X move.m_data = info->f_name; X move.m_flags = 0; X if (info->f_namelen <= 1) { X errmsgno(EX_BAD, "Name size <= 0.\n"); X die(EX_BAD); /* Need to change to permit -i resync */ X } X#ifdef ENFORCE_CPIO_NAMELEN X if (info->f_namelen > props.pr_maxnamelen) { X errmsgno(EX_BAD, "Name length (%lu) larger than maximum (%d).\n", X info->f_namelen, props.pr_maxnamelen); X die(EX_BAD); /* Need to change to permit -i resync */ X } X#endif X if (info->f_namelen > PATH_MAX) { X errmsgno(EX_BAD, "Name length (%lu) larger than PATH_MAX.\n", X info->f_namelen); X die(EX_BAD); /* Need to change to permit -i resync */ X } X info->f_rsize = info->f_llsize = info->f_namelen; X info->f_flags |= F_LONGNAME; X if (xt_file(info, vp_move_from_arch, &move, 0, "moving file name") < 0) X die(EX_BAD); X info->f_flags &= ~F_LONGNAME; X info->f_flags &= ~F_DATA_SKIPPED; X info->f_rsize = info->f_llsize = info->f_size; X info->f_namelen -= 1; /* Null byte */ X X info->f_lname[0] = '\0'; X if (is_symlink(info)) { X move.m_data = info->f_lname; X move.m_flags = 0; X if (info->f_size <= 0) { X errmsgno(EX_BAD, "Symlink size <= 0.\n"); X die(EX_BAD); /* Need to change to permit -i resync */ X } X if (info->f_size > PATH_MAX) { X errmsgno(EX_BAD, "Linkname length (%lld) larger than PATH_MAX.\n", X (Llong)info->f_size); X die(EX_BAD); /* Need to change to permit -i resync */ X } X if (xt_file(info, vp_move_from_arch, &move, 0, "moving link name") < 0) X die(EX_BAD); X info->f_flags &= ~F_DATA_SKIPPED; X info->f_lname[info->f_size] = '\0'; X info->f_rsize = info->f_llsize = 0; X } X X if (!is_file(info)) X info->f_rsize = info->f_llsize = 0; X X if (info->f_namelen == 10 && X info->f_name[0] == 'T' && X strncmp(info->f_name, "TRAILER!!!", 10) == 0) { X extern m_stats *stats; X X stats->eofblock = tblocks(); X X if (ignoreerr) X errmsgno(EX_BAD, "EOF Block at: %lld ignored.\n", X tblocks()); X return (EOF); X } X if (info->f_nlink > 1) { X TCB tb; X ul = info->f_rsize; X info->f_flags |= F_EXTRACT; X if (read_link(info->f_name, info->f_namelen, info, &tb)) { X info->f_typeflag = LNKTYPE; X info->f_rsize = ul; X return (0); X } X info->f_flags &= ~F_EXTRACT; X info->f_rsize = ul; X } X return (0); X} X XEXPORT void Xcpio_resync() X{ X comerrno(EX_BAD, "Cpio resync not yet implemented.\n"); X} X X/* X * Check whether the archive is completely byte swapped. X * Unfortunately, this only works if the strlen(f->f_name) is odd. X */ XEXPORT int Xcpio_checkswab(ptb) X register TCB *ptb; X{ X long l1; X long l2; X X X l1 = (((char *)ptb)[20] & 0xFF) * 256 + (((char *)ptb)[21] & 0xFF); X l2 = (((char *)ptb)[21] & 0xFF) * 256 + (((char *)ptb)[20] & 0xFF); X if (l1 <= 257 || l2 <= 257) { X if (l2 <= 257) X l1 = l2; X } X /* X * The maximum filename length in binary cpio is 256 bytes. X * In theory, more would be possible, but a long filename length X * may be caused by a rotten archive. As we may safely assume that X * the whole size of a PTB (TBLOCK) is accessible, we run the check X * for the null byte at the end of the filename as long as the X * filename length is less or equal to TBLOCK - CPIOBIN_HDRSZ. X */ X if ((l1 + CPIOBIN_HDRSZ) > TBLOCK) X return (H_CPIO_BIN); X X if (((char *)ptb)[CPIOBIN_HDRSZ+l1-2] == '\0' && X ((char *)ptb)[CPIOBIN_HDRSZ+l1-1] != '\0') X return (H_SWAPPED(H_CPIO_BIN)); X return (H_CPIO_BIN); X} X X/* X * This simple sum is used for the SYSvr4 file content checksum. X * It is a simple 32 bit sum even though the related CPIO format is called CRC. X * Use Int32_t to implement the same behavior as the AT&T cpio command. X */ XLOCAL Int32_t Xcpio_cksum(name) X char *name; X{ X char buf[8192]; X int f = _lfileopen(name, "rb"); X register int amt; X register char *p; X register char *ep; X register Int32_t sum = 0; X X if (f >= 0) { X while ((amt = _fileread(&f, buf, sizeof (buf))) > 0) { X p = buf; X ep = &p[amt]; X while (p < ep) { X sum += (long)*p++; X } X } X if (amt < 0) X sum = -1; X close(f); X } else { X sum = -1; X } X return (sum); X} X X/* X * Convert octal string -> long int X */ XLOCAL void Xastoo_cpio(s, l, cnt) X register char *s; X Ulong *l; X register int cnt; X{ X register Ulong ret = 0L; X register char c; X register int t; X X for (; cnt > 0; cnt--) { X c = *s++; X if (isoctal(c)) X t = c - '0'; X else X break; X ret *= 8; X ret += t; X } X *l = ret; X} X X/* X * Convert hex string -> long int X */ XLOCAL void Xastoh_cpio(s, l, cnt) X register char *s; X Ulong *l; X register int cnt; X{ X register Ulong ret = 0L; X register char c; X register int t; X X for (; cnt > 0; cnt--) { X c = *s++; X if (isdigit(c)) X t = c - '0'; X else if (c >= 'a' && c <= 'f') X t = c - 'a' + 10; X else if (c >= 'A' && c <= 'F') X t = c - 'A' + 10; X else X break; X ret *= 16; X ret += t; X } X *l = ret; X} X X/* X * Convert long int -> hex string. X */ XLOCAL void Xlitoh_cpio(s, l, fieldw) X char *s; X register Ulong l; X register int fieldw; X{ X register char *p = &s[fieldw]; X register char fill = props.pr_fillc; X X do { X *--p = "0123456789abcdef"[l%16]; /* Compiler optimiert */ X X } while (--fieldw > 0 && (l /= 16) > 0); X X switch (fieldw) { X X default: X break; X case 11: *--p = fill; /* FALLTHROUGH */ X case 10: *--p = fill; /* FALLTHROUGH */ X case 9: *--p = fill; /* FALLTHROUGH */ X case 8: *--p = fill; /* FALLTHROUGH */ X case 7: *--p = fill; /* FALLTHROUGH */ X case 6: *--p = fill; /* FALLTHROUGH */ X case 5: *--p = fill; /* FALLTHROUGH */ X case 4: *--p = fill; /* FALLTHROUGH */ X case 3: *--p = fill; /* FALLTHROUGH */ X case 2: *--p = fill; /* FALLTHROUGH */ X case 1: *--p = fill; /* FALLTHROUGH */ X case 0: break; X } X} END-of-star-1.6/star/cpiohdr.c echo x - star-1.6/star/create.c sed 's/^X//' >star-1.6/star/create.c << 'END-of-star-1.6/star/create.c' X/* @(#)create.c 1.156 19/03/11 Copyright 1985, 1995, 2001-2019 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)create.c 1.156 19/03/11 Copyright 1985, 1995, 2001-2019 J. Schilling"; X#endif X/* X * Copyright (c) 1985, 1995, 2001-2019 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include "star.h" X#include "props.h" X#include "table.h" X#include /* XXX seterrno() is better JS */ X#include X#include X#include X#include X#include X#include /* For __fjmalloc() */ X#define GT_COMERR /* #define comerr gtcomerr */ X#define GT_ERROR /* #define error gterror */ X#include X#include X#include "restore.h" X#ifdef USE_FIND X#include /* For AT_FDCWD */ X#include /* Fuer stat_to_info() in starsubs.h */ X#include X#include X#endif X#include "starsubs.h" X#include "checkerr.h" X#include "fifo.h" X#include X X#ifdef USE_ACL X X#ifdef OWN_ACLTEXT X#if defined(UNIXWARE) && defined(HAVE_ACL) X#define HAVE_SUN_ACL X#define HAVE_ANY_ACL X#endif X#endif X/* X * HAVE_ANY_ACL currently includes HAVE_POSIX_ACL and HAVE_SUN_ACL. X * This definition must be in sync with the definition in acl_unix.c X * As USE_ACL is used in star.h, we are not allowed to change the X * value of USE_ACL before we did include star.h or we may not include X * star.h at all. X * HAVE_HP_ACL is currently not included in HAVE_ANY_ACL. X */ X#ifndef HAVE_ANY_ACL X#undef USE_ACL /* Do not try to get or set ACLs */ X#endif X#endif X Xstruct pdirs { X struct pdirs *p_last; X dev_t p_dev; X ino_t p_ino; X}; X Xtypedef struct lname { X struct lname *l_lnext; /* Next in list */ X char l_lname[1]; /* actually longer */ X} LNAME; X Xtypedef struct links { X struct links *l_next; /* Next in list */ X struct lname *l_lnames; /* Link names for SVr4 cpio */ X ino_t l_ino; /* Inode number (st_ino) */ X dev_t l_dev; /* Filesys number (st_dev) */ X Ulong l_linkno; /* Link serial number in compl. list */ X long l_nlink; /* Link count for file */ X short l_namlen; /* strlen(l_name) */ X Uchar l_flags; /* Flags (see below) */ X char l_name[1]; /* actually longer */ X} LINKS; X X#define L_ISDIR 1 /* This entry refers to a directory */ X#define L_ISLDIR 2 /* A dir, hard linked to another dir */ X#define L_DATA 4 /* SVr4 cpio file data encountered */ X X#define L_HSIZE 256 /* must be a power of two */ X X#define l_hash(info) (((info)->f_ino + (info)->f_dev) & (L_HSIZE-1)) X XLOCAL LINKS *links[L_HSIZE]; X Xextern FILE *vpr; Xextern FILE *listf; X Xextern BOOL pkglist; Xextern BOOL multivol; Xextern long hdrtype; Xextern BOOL tape_isreg; Xextern dev_t tape_dev; Xextern ino_t tape_ino; X#define is_tape(info) ((info)->f_dev == tape_dev && (info)->f_ino == tape_ino) X Xextern int bufsize; Xextern char *bigptr; X Xextern BOOL havepat; Xextern dev_t curfs; Xextern Ullong maxsize; Xextern struct timespec Newer; Xextern Ullong tsize; Xextern BOOL prblockno; Xextern BOOL debug; Xextern int dumplevel; Xextern int verbose; Xextern BOOL silent; Xextern BOOL readnull; Xextern BOOL cflag; Xextern BOOL uflag; Xextern BOOL nodir; Xextern BOOL acctime; Xextern BOOL dirmode; Xextern BOOL paxfollow; Xextern BOOL doacl; Xextern BOOL nodesc; Xextern BOOL nomount; Xextern BOOL interactive; Xextern BOOL nospec; Xextern int Fflag; Xextern BOOL abs_path; Xextern BOOL nowarn; Xextern BOOL match_tree; Xextern BOOL force_hole; Xextern BOOL sparse; Xextern BOOL Ctime; Xextern BOOL nodump; Xextern BOOL nullout; Xextern BOOL linkdata; Xextern BOOL link_dirs; Xextern BOOL dodump; Xextern BOOL dometa; Xextern BOOL dumpmeta; Xextern BOOL lowmem; Xextern BOOL do_subst; X Xextern int intr; X X/* X * Variables that control overwriting the stat() struct members X * controlled by the pkglist= option. X */ XLOCAL BOOL statmod = FALSE; XLOCAL uid_t statuid = _BAD_UID; XLOCAL gid_t statgid = _BAD_GID; XLOCAL mode_t statmode = _BAD_MODE; X XEXPORT void checklinks __PR((void)); XLOCAL int take_file __PR((char *name, FINFO *info)); XEXPORT int _fileread __PR((int *fp, void *buf, int len)); XEXPORT void create __PR((char *name, BOOL Hflag, BOOL forceadd)); XLOCAL void createi __PR((char *sname, char *name, int namlen, X FINFO *info, pathstore_t *pathp, X struct pdirs *last)); XEXPORT void createlist __PR((void)); XLOCAL BOOL get_metainfo __PR((char *line)); XEXPORT BOOL read_symlink __PR((char *sname, char *name, FINFO *info, TCB *ptb)); XLOCAL LINKS *find_link __PR((FINFO *info)); XEXPORT BOOL last_cpio_link __PR((FINFO *info)); XEXPORT BOOL xcpio_link __PR((FINFO *info)); XLOCAL BOOL acpio_link __PR((FINFO *info)); XEXPORT void flushlinks __PR((void)); XLOCAL void flush_link __PR((LINKS *lp)); XEXPORT BOOL read_link __PR((char *name, int namlen, FINFO *info, X TCB *ptb)); XLOCAL int nullread __PR((void *vp, char *cp, int amt)); XEXPORT void put_file __PR((int *fp, FINFO *info)); XEXPORT void cr_file __PR((FINFO *info, X int (*)(void *, char *, int), X void *arg, int amt, char *text)); XLOCAL void put_dir __PR((char *sname, char *dname, int namlen, X FINFO *info, TCB *ptb, X pathstore_t *pathp, struct pdirs *last)); XLOCAL void toolong __PR((char *dname, char *name, size_t len)); XLOCAL BOOL checkdirexclude __PR((char *sname, char *name, int namlen, FINFO *info)); XLOCAL BOOL checkexclude __PR((char *sname, char *name, int namlen, FINFO *info)); X X#ifdef USE_FIND XEXPORT int walkfunc __PR((char *nm, struct stat *fs, int type, struct WALK *state)); X#endif X XEXPORT void Xchecklinks() X{ X register LINKS *lp; X register int i; X register int used = 0; X register int curlen; X register int maxlen = 0; X register int nlinks = 0; X register int ndirs = 0; X register int nldirs = 0; X X for (i = 0; i < L_HSIZE; i++) { X if (links[i] == (LINKS *)NULL) X continue; X X curlen = 0; X used++; X X for (lp = links[i]; lp != (LINKS *)NULL; lp = lp->l_next) { X curlen++; X nlinks++; X if ((lp->l_flags & L_ISDIR) != 0) { X ndirs++; X if ((lp->l_flags & L_ISLDIR) != 0) X nldirs++; X } else if (lp->l_nlink != 0) { X /* X * The fact that UNIX uses '.' and '..' as hard X * links to directories on all known file X * systems is a design bug. It makes it hard to X * find hard links to directories. Note that X * POSIX neither requires '.' and '..' to be X * implemented as hard links nor that these X * directories are physical present in the X * directory content. X * As it is hard to find all links (we would X * need to stat all directories as well as all X * '.' and '..' entries, we only warn for non X * directories. X */ X if (cflag && X !errhidden(E_MISSLINK, lp->l_name)) { X if (!errwarnonly(E_MISSLINK, lp->l_name)) X xstats.s_misslinks++; X errmsgno(EX_BAD, X "Missing links to '%s'.\n", X lp->l_name); X (void) errabort(E_MISSLINK, lp->l_name, X TRUE); X } X } X } X if (maxlen < curlen) X maxlen = curlen; X } X if (debug) { X if (link_dirs) { X errmsgno(EX_BAD, "entries: %d hashents: %d/%d maxlen: %d\n", X nlinks, used, L_HSIZE, maxlen); X errmsgno(EX_BAD, "hardlinks total: %d linked dirs: %d/%d linked files: %d \n", X nlinks+nldirs-ndirs, nldirs, ndirs, nlinks-ndirs); X } else { X errmsgno(EX_BAD, "hardlinks: %d hashents: %d/%d maxlen: %d\n", X nlinks, used, L_HSIZE, maxlen); X } X } X} X X/* X * Returns: X * TRUE take file X * FALSE do not take file X * -1 pattern did not match X */ XLOCAL int Xtake_file(name, info) X register char *name; X register FINFO *info; X{ X if ((info->f_flags & F_FORCE_ADD) != 0) X return (TRUE); X if (nodump && (info->f_flags & F_NODUMP) != 0) X return (FALSE); X X if (havepat && !match(name)) { X return (-1); X /* Bei Directories ist f_size == 0 */ X } else if (maxsize && info->f_size > maxsize) { X return (FALSE); X } else if (dumplevel > 0) { X /* X * For now, we cannot reliably deal with sub-second granularity X * on all platforms. For this reason, we let some files be on X * two incrementals to make sure not to miss them completely. X */ X if (info->f_mtime >= Newer.tv_sec) { X /* EMPTY */ X ; X } else if (info->f_ctime >= Newer.tv_sec) { X if (dumpmeta) X info->f_xftype = XT_META; X } else { X return (FALSE); X } X X } else if (Newer.tv_sec && (Ctime ? info->f_ctime:info->f_mtime) <= X Newer.tv_sec) { X /* X * First the easy case: Don't take file if seconds are X * less than in the reference file. X */ X if ((Ctime ? info->f_ctime:info->f_mtime) < Newer.tv_sec) X return (FALSE); X /* X * If we do not have nanoseconds, we are done. X */ X if ((info->f_flags & F_NSECS) == 0) X return (FALSE); X /* X * Here we know that we have nanoseconds and that seconds X * are equal, so finally check nanoseconds. X */ X if ((Ctime ? info->f_cnsec:info->f_mnsec) <= Newer.tv_nsec) X return (FALSE); X } else if (uflag && !update_newer(info)) { X return (FALSE); X } else if (!multivol && X tsize > 0 && tsize < (tarblocks(info->f_size)+1+2)) { X if (!errhidden(E_FILETOOBIG, name)) { X if (!errwarnonly(E_FILETOOBIG, name)) X xstats.s_toobig++; X errmsgno(EX_BAD, X "'%s' does not fit on tape. Not dumped.\n", X name); X (void) errabort(E_FILETOOBIG, name, TRUE); X } X return (FALSE); X } else if (props.pr_maxsize > 0 && info->f_size > props.pr_maxsize) { X if (!errhidden(E_FILETOOBIG, name)) { X if (!errwarnonly(E_FILETOOBIG, name)) X xstats.s_toobig++; X errmsgno(EX_BAD, X "'%s' file too big for current mode. Not dumped.\n", X name); X (void) errabort(E_FILETOOBIG, name, TRUE); X } X return (FALSE); X } else if (pr_unsuptype(info)) { X if (!errhidden(E_SPECIALFILE, name)) { X if (!errwarnonly(E_SPECIALFILE, name)) X xstats.s_isspecial++; X errmsgno(EX_BAD, X "'%s' unsupported file type '%s'. Not dumped.\n", X name, XTTONAME(info->f_xftype)); X (void) errabort(E_SPECIALFILE, name, TRUE); X } X return (FALSE); X } else if (is_special(info) && nospec) { X if (!errhidden(E_SPECIALFILE, name)) { X if (!errwarnonly(E_SPECIALFILE, name)) X xstats.s_isspecial++; X errmsgno(EX_BAD, X "'%s' is not a file. Not dumped.\n", name); X (void) errabort(E_SPECIALFILE, name, TRUE); X } X return (FALSE); X } else if (tape_isreg && is_tape(info)) { X errmsgno(EX_BAD, "'%s' is the archive. Not dumped.\n", name); X return (FALSE); X } X if (is_file(info) && dometa) { X /* X * This is the right place for this code although it does not X * look correct. Later in star-1.5 we decide here, based on X * mtime and ctime of the file, whether we archive a file at X * all and whether we only add the file's metadata. X */ X info->f_xftype = XT_META; X if (pr_unsuptype(info)) { X if (!errhidden(E_SPECIALFILE, name)) { X if (!errwarnonly(E_SPECIALFILE, name)) X xstats.s_isspecial++; X errmsgno(EX_BAD, X "'%s' unsupported file type '%s'. Not dumped.\n", X name, XTTONAME(info->f_xftype)); X (void) errabort(E_SPECIALFILE, name, TRUE); X } X return (FALSE); X } X } X#ifdef USE_ACL X /* X * If we return (FALSE) here, the file would not be archived at all. X * This is not what we want, so ignore return code from get_acls(). X */ X if (doacl) X (void) get_acls(info); X#endif /* USE_ACL */ X return (TRUE); X} X Xint X_fileread(fp, buf, len) X register int *fp; X void *buf; X int len; X{ X register int fd = *fp; X register int ret; X int errcnt = 0; X Xretry: X while ((ret = read(fd, buf, len)) < 0 && geterrno() == EINTR) X /* LINTED */ X ; X if (ret < 0 && geterrno() == EINVAL && ++errcnt < 100) { X off_t oo; X off_t si; X X /* X * Work around the problem that we cannot read() X * if the buffer crosses 2 GB in non large file mode. X */ X oo = lseek(fd, (off_t)0, SEEK_CUR); X if (oo == (off_t)-1) X return (ret); X si = lseek(fd, (off_t)0, SEEK_END); X if (si == (off_t)-1) X return (ret); X if (lseek(fd, oo, SEEK_SET) == (off_t)-1) X return (ret); X if (oo >= si) { /* EOF */ X ret = 0; X } else if ((si - oo) <= len) { X len = si - oo; X goto retry; X } X } X return (ret); X} X XEXPORT void Xcreate(name, Hflag, forceadd) X register char *name; X BOOL Hflag; X BOOL forceadd; X{ X FINFO finfo; X register FINFO *info = &finfo; X BOOL opaxfollow = paxfollow; /* paxfollow supersedes follow */ X X if (name[0] == '.' && name[1] == '/') { X for (name++; name[0] == '/'; name++) X /* LINTED */ X ; X } X if (name[0] == '\0') X name = "."; X if (Hflag) X paxfollow = Hflag; X if (!getinfo(name, info)) { X paxfollow = opaxfollow; X if (!errhidden(E_STAT, name)) { X if (!errwarnonly(E_STAT, name)) X xstats.s_staterrs++; X errmsg("Cannot stat '%s'.\n", name); X (void) errabort(E_STAT, name, TRUE); X } X return; X } X if (forceadd) X info->f_flags |= F_FORCE_ADD; X paxfollow = opaxfollow; X createi(name, name, strlen(name), info, X (pathstore_t *)0, (struct pdirs *)0); X} X XLOCAL void Xcreatei(sname, name, namlen, info, pathp, last) X char *sname; X register char *name; X int namlen; X register FINFO *info; X pathstore_t *pathp; X struct pdirs *last; X{ X char lname[PATH_MAX+1]; /* This limit cannot be overruled */ X TCB tb; X register TCB *ptb = &tb; X int fd = -1; X BOOL was_link = FALSE; X BOOL do_sparse = FALSE; X X if (hash_xlookup(name)) X return; X X info->f_sname = sname; X info->f_name = name; /* XXX Das ist auch in getinfo !!!?!!! */ X info->f_namelen = namlen; X if (Fflag > 0 && !checkexclude(sname, name, namlen, info)) X return; X X#ifdef nonono_NICHT_BEI_CREATE /* XXX */ X if (!abs_path && /* XXX VVV siehe skip_slash() */ X (info->f_name[0] == '/' /* || info->f_lname[0] == '/' */)) { X skip_slash(info); X info->f_namelen -= info->f_name - name; X if (info->f_namelen == 0) { X info->f_name = "./"; X info->f_namelen = 2; X } X /* XXX das gleiche mit f_lname !!!!! */ X } X#endif /* nonono_NICHT_BEI_CREATE XXX */ X info->f_lname = lname; /* XXX nur Übergangsweise!!!!! */ X info->f_lnamelen = 0; X X if (prblockno) X (void) tblocks(); /* set curblockno */ X X if (do_subst && subst(info)) { X if (info->f_name[0] == '\0') { X if (verbose) X fgtprintf(vpr, X "'%s' substitutes to null string, skipping ...\n", X name); X return; X } X } X X if (statmod) { X if (statmode != _BAD_MODE) X info->f_mode = statmode; X if (statuid != _BAD_UID) X info->f_uid = statuid; X if (statgid != _BAD_GID) X info->f_gid = statgid; X } X X if (verbose <= 1 && X !(dirmode && is_dir(info)) && X (info->f_namelen <= props.pr_maxsname)) { X /* X * Allocate TCB from the buffer to avoid copying TCB X * in the most frequent case. X * If we are writing directories after the files they X * contain, we cannot allocate the space for tcb X * from the buffer. X * With very long names we will have to write out X * other data before we can write the TCB, so we cannot X * alloc tcb from buffer too. X * If we are creating a long listing while archiving, the X * TCB will be overwritten by info_to_xhdr() and this would X * overwrite username/groupname that is later needed for X * vprint(), so we cannot allocate TCB from the buffer here. X */ X if ((ptb = (TCB *)get_block(props.pr_hdrsize)) == NULL) X ptb = &tb; X else X info->f_flags |= F_TCB_BUF; X } X info->f_tcb = ptb; X if ((props.pr_flags & PR_CPIO) == 0) X filltcb(ptb); X if (!name_to_tcb(info, ptb)) /* Name too long */ X return; X X#ifndef __PRE_CPIO__ X if (is_symlink(info) && !read_symlink(sname, name, info, ptb)) { X return; X } X#endif X info_to_tcb(info, ptb); X if (is_dir(info)) { X /* X * If we have been requested to check for hard linked X * directories, first look for possible hard links. X */ X if (link_dirs && /* info->f_nlink > 1 && */ read_link(name, namlen, info, ptb)) X was_link = TRUE; X X if (was_link && !is_link(info)) /* link name too long */ X return; X X if (was_link && take_file(name, info) > 0) { X put_tcb(ptb, info); X vprint(info); X } else { X put_dir(sname, name, namlen, info, ptb, pathp, last); X } X } else if (take_file(name, info) <= 0) { /* < TRUE */ X return; X } else if (interactive && !ia_change(ptb, info)) { X fgtprintf(vpr, "Skipping ...\n"); X#ifdef __PRE_CPIO__ X } else if (is_symlink(info) && !read_symlink(sname, name, info, ptb)) { X /* EMPTY */ X ; X#endif X } else if (is_meta(info)) { X /* X * XXX Currently only TAR supports meta files. X * XXX If we ever change this, we may need to remove the X * XXX ptb->dbuf references here. X */ X if (info->f_nlink > 1 && read_link(name, namlen, info, ptb)) X was_link = TRUE; X X if (was_link && !is_link(info)) /* link name too long */ X return; X X if (!was_link) { X /* X * XXX We definitely do not want that other tar X * XXX implementations are able to read tar archives X * XXX that contain meta files. X * XXX If a tar implementation that does not understand X * XXX meta files extracts archives with meta files, X * XXX it will most likely destroy old files on disk. X */ X ptb->dbuf.t_linkflag = LF_META; X info->f_flags &= ~F_SPLIT_NAME; X if (ptb->dbuf.t_prefix[0] != '\0') X fillbytes(ptb->dbuf.t_prefix, props.pr_maxprefix, '\0'); X if (props.pr_flags & PR_XHDR) X info->f_xflags |= XF_PATH; X else X info->f_flags |= F_LONGNAME; X ptb->dbuf.t_name[0] = 0; /* Hide P-1988 name */ X info_to_tcb(info, ptb); X } X put_tcb(ptb, info); X vprint(info); X return; X X } else if (is_file(info) && info->f_size != 0 && !nullout && X (fd = _lfileopen(sname, "rb")) < 0) { X if (!errhidden(E_OPEN, name)) { X if (!errwarnonly(E_OPEN, name)) X xstats.s_openerrs++; X errmsg("Cannot open '%s'.\n", name); X (void) errabort(E_OPEN, name, TRUE); X } X } else { X if (info->f_nlink > 1 && read_link(name, namlen, info, ptb) && X !linkdata) { X was_link = TRUE; X } X if (was_link && !is_link(info)) { /* link name too long */ X if (fd >= 0) X close(fd); X return; X } X /* X * Special treatment for the idiosyncratic way of dealing with X * hard links in the SVr4 CRC cpio archive format. X * The link count is handled by calling read_link() in X * cpiotcb_to_info() before. X */ X if ((props.pr_flags & PR_SV_CPIO_LINKS) != 0 && X info->f_nlink > 1) { X if (!last_cpio_link(info)) { /* Ign. all but last */ X if (fd >= 0) X close(fd); X return; X } X if (acpio_link(info)) { /* Now extract all */ X put_file(&fd, info); X goto out; X } X /* X * If the link count is increasing, do it the same way X * as SVr4 cpio and archive the rest as plain files. X */ X if (is_file(info)) X info->f_rsize = info->f_size; X info->f_xftype = info->f_rxftype; X } X X if (!is_file(info) || was_link || info->f_rsize == 0) { X /* X * Don't dump the content of hardlinks and empty files. X * Hardlinks currently have f_rsize == 0 ! X */ X put_tcb(ptb, info); X vprint(info); X if (fd >= 0) X close(fd); X return; X } X X /* X * In case we like to do sparse file handling via SEEK_HOLE we need X * an open fd in order to check for a sparse file. X */ X do_sparse = sparse && (props.pr_flags & PR_SPARSE); X if (do_sparse && nullout && X (fd = _lfileopen(sname, "rb")) < 0) { X if (!errhidden(E_OPEN, name)) { X if (!errwarnonly(E_OPEN, name)) X xstats.s_openerrs++; X errmsg("Cannot open '%s'.\n", name); X (void) errabort(E_OPEN, name, TRUE); X } X return; X } X X if (do_sparse && sparse_file(&fd, info)) { X if (!silent) X error("'%s' is sparse\n", info->f_name); X put_sparse(&fd, info); X } else if (do_sparse && force_hole) { X /* X * Treat all files as sparse when -force-hole X * option is given. Files that do not contain X * any zeroed region will however still be X * archived as plain files by put_sparse(). X */ X put_sparse(&fd, info); X } else { X put_tcb(ptb, info); X vprint(info); X put_file(&fd, info); X } X /* X * Reset access time of file. X * This is important when using star for dumps. X * N.B. this has been done after fclose() X * before _FIOSATIME has been used. X * X * If f == NULL, the file has not been accessed for read X * and access time need not be reset. X */ Xout: X if (acctime && fd >= 0) X rs_acctime(fd, info); X if (fd >= 0) X close(fd); X } X} X XEXPORT void Xcreatelist() X{ X register int nlen; X char *name; X size_t nsize = PATH_MAX; X X /* X * We need at least PATH_MAX+1 and add 512 to get better messages below X */ X name = ___malloc(nsize, "name buffer"); X X for (nlen = 1; nlen >= 0; ) { X if ((nlen = getdelim(&name, &nsize, X readnull ? '\0' : '\n', listf)) < 0) X break; X X if (nlen == 0) X continue; X if (!readnull) { X if (name[nlen-1] == '\n') X name[--nlen] = '\0'; X if (nlen == 0) X continue; X } X if (pkglist) { X if (!get_metainfo(name)) X continue; X nlen = strlen(name); X } X if (intr) X break; X curfs = NODEV; X create(name, FALSE, FALSE); /* XXX Liste doch wie Kommandozeile? */ X } X free(name); X} X XLOCAL BOOL Xget_metainfo(line) X char *line; X{ X char *p; X char *p2; X uid_t uid; X gid_t gid; X long lid; X X p = strchr(line, ' '); X if (p == NULL) { X statmod = FALSE; X return (TRUE); X } X X *p++ = '\0'; X statmod = TRUE; X statmode = _BAD_MODE; X statuid = _BAD_UID; X statgid = _BAD_GID; X if (*p == '?') { X p2 = ++p; X } else { X p2 = astolb(p, &lid, 8); X if (*p2 == ' ') X statmode = lid; X } X if (*p2 == ' ') { X p = ++p2; X } else { X errmsgno(EX_BAD, "%s: illegal mode\n", line); X return (FALSE); X } X p2 = strchr(p, ' '); X if (p2 != NULL) { X *p2++ = '\0'; X } else { X errmsgno(EX_BAD, "%s: illegal uid\n", line); X return (FALSE); X } X if (!streql(p, "?") && ic_uidname(p, strlen(p), &uid)) X statuid = uid; X p = p2; X if (!streql(p, "?") && ic_gidname(p, strlen(p), &gid)) X statgid = gid; X X return (TRUE); X} X XEXPORT BOOL Xread_symlink(sname, name, info, ptb) X char *sname; X char *name; X register FINFO *info; X TCB *ptb; X{ X int len; X X info->f_lname[0] = '\0'; X X#ifdef HAVE_READLINK X if ((len = lreadlink(sname, info->f_lname, PATH_MAX)) < 0) { X if (!errhidden(E_READLINK, name)) { X if (!errwarnonly(E_READLINK, name)) X xstats.s_rwerrs++; X errmsg("Cannot read link '%s'.\n", name); X (void) errabort(E_READLINK, name, TRUE); X } X return (FALSE); X } X info->f_lnamelen = len; X /* X * string from readlink is not null terminated X */ X info->f_lname[len] = '\0'; X X if (len > props.pr_maxlnamelen) { X if (!errhidden(E_NAMETOOLONG, name)) { X if (!errwarnonly(E_NAMETOOLONG, name)) X xstats.s_toolong++; X errmsgno(EX_BAD, X "%s: Symbolic link too long.\n", name); X (void) errabort(E_NAMETOOLONG, name, TRUE); X } X return (FALSE); X } X if ((props.pr_flags & PR_CPIO) != 0) X return (TRUE); X X if (len > props.pr_maxslname) { X if (props.pr_flags & PR_XHDR) X info->f_xflags |= XF_LINKPATH; X else X info->f_flags |= F_LONGLINK; X } X /* X * if linkname is not longer than props.pr_maxslname X * that's all to do with linkname X */ X strncpy(ptb->dbuf.t_linkname, info->f_lname, props.pr_maxslname); X return (TRUE); X#else X if (!errhidden(E_SPECIALFILE, name)) { X if (!errwarnonly(E_SPECIALFILE, name)) X xstats.s_isspecial++; X errmsgno(EX_BAD, X "'%s' unsupported file type '%s'. Not dumped.\n", X name, XTTONAME(info->f_xftype)); X (void) errabort(E_SPECIALFILE, name, TRUE); X } X return (FALSE); X#endif X} X XLOCAL LINKS * Xfind_link(info) X register FINFO *info; X{ X register LINKS *lp; X X lp = links[l_hash(info)]; X X for (; lp != (LINKS *)NULL; lp = lp->l_next) { X if (lp->l_ino == info->f_ino && lp->l_dev == info->f_dev) X return (lp); X } X return ((LINKS *)NULL); X} X X/* X * Return TRUE in case we found the last entry (the one that may have data) X * for a specific file. X */ XEXPORT BOOL Xlast_cpio_link(info) X register FINFO *info; X{ X register LINKS *lp; X X if ((lp = find_link(info)) != NULL) { X if ((!cflag && info->f_size > 0) || X lp->l_nlink <= 0 || X (lp->l_flags & L_DATA) != 0) X return (TRUE); X return (FALSE); X } X return (TRUE); X} X X/* X * Extract all cpio CRC links. X * XXX This should be in extract.c X */ XEXPORT BOOL Xxcpio_link(info) X register FINFO *info; X{ X register LINKS *lp; X char *name = info->f_name; X char *lname = info->f_lname; X off_t rsize = info->f_rsize; X int xftype = info->f_xftype; X X if ((lp = find_link(info)) != NULL) { X /* X * We come here if the link count increases and we need to X * archive more "files" as expected. X */ X if ((lp->l_flags & L_DATA) != 0) X return (FALSE); X } X info->f_xftype = info->f_rxftype; X extracti(info, NULL); /* Extract as real node */ X info->f_xftype = xftype; X info->f_rsize = 0; X X if (lp != NULL) { X register LNAME *ln; X X lp->l_flags |= L_DATA; X info->f_lname = name; X info->f_name = lp->l_name; X extracti(info, NULL); /* Extract link info->f_lname */ X X for (ln = lp->l_lnames; ln; ln = ln->l_lnext) { X if (streql(name, ln->l_lname)) X continue; X info->f_name = ln->l_lname; X extracti(info, NULL); /* Extract all other links */ X } X } X info->f_name = name; X info->f_lname = lname; X info->f_rsize = rsize; X return (TRUE); X} X X/* X * Archive all cpio CRC links. X * X * We are called if our caller believes that the last link for a specific file X * has been encountered. X */ XLOCAL BOOL Xacpio_link(info) X register FINFO *info; X{ X TCB tb; X register TCB *ptb = info->f_tcb; X register LINKS *lp; X int namelen = info->f_namelen; X char *name = info->f_name; X char *lname = info->f_lname; X off_t size = info->f_size; /* real size of file */ X#ifdef __what_people_would_expect__ X off_t rsize = info->f_rsize; /* size as archived on tape */ X#endif X X if ((lp = find_link(info)) != NULL) { X /* X * We come here if the link count increases and we need to X * archive more "files" than expected. X */ X if ((lp->l_flags & L_DATA) != 0) X return (FALSE); X } X X info->f_size = 0; X info->f_rsize = 0; X X if (lp != NULL) { X register LNAME *ln; X X lp->l_flags |= L_DATA; X info->f_lname = name; X info->f_namelen = strlen(lp->l_name); X info->f_name = lp->l_name; X info_to_tcb(info, ptb); X put_tcb(ptb, info); X vprint(info); X X for (ln = lp->l_lnames; ln; ln = ln->l_lnext) { X if (streql(name, ln->l_lname)) X continue; X info->f_namelen = strlen(ln->l_lname); X info->f_name = ln->l_lname; X info->f_flags &= ~F_TCB_BUF; X if ((ptb = (TCB *)get_block(props.pr_hdrsize)) == NULL) X ptb = &tb; X else X info->f_flags |= F_TCB_BUF; X info->f_tcb = ptb; X info_to_tcb(info, ptb); X put_tcb(ptb, info); X vprint(info); X } X } X info->f_namelen = namelen; X info->f_name = name; X info->f_lname = lname; X info->f_size = size; X#ifdef __what_people_would_expect__ X info->f_rsize = rsize; X#else X info->f_rsize = size; /* Achieve that the last link archives data */ X#endif X info->f_xftype = info->f_rxftype; X X info->f_flags &= ~F_TCB_BUF; X if ((ptb = (TCB *)get_block(props.pr_hdrsize)) == NULL) X ptb = &tb; X else X info->f_flags |= F_TCB_BUF; X info->f_tcb = ptb; X info_to_tcb(info, ptb); X put_tcb(ptb, info); X vprint(info); X return (TRUE); X} X X/* X * Flush all SVr4 cpio -Hcrc links that have not yet been archived. X */ XEXPORT void Xflushlinks() X{ X register LINKS *lp; X register int i; X X if ((props.pr_flags & PR_SV_CPIO_LINKS) == 0) X return; X X for (i = 0; i < L_HSIZE; i++) { X if (links[i] == (LINKS *)NULL) X continue; X X for (lp = links[i]; lp != (LINKS *)NULL; lp = lp->l_next) { X if ((lp->l_flags & (L_ISDIR|L_DATA)) == 0 && X (lp->l_nlink > 0)) X flush_link(lp); X } X } X} X X/* X * Flush a single cpio -Hcrc link. X */ XLOCAL void Xflush_link(lp) X register LINKS *lp; X{ X TCB tb; X TCB *ptb; X FINFO finfo; X register LNAME *ln; X int fd = 1; X BOOL did_stat; X char *name; X X finfo.f_flags = 0; X finfo.f_flags &= ~F_TCB_BUF; X if ((ptb = (TCB *)get_block(props.pr_hdrsize)) == NULL) X ptb = &tb; X else X finfo.f_flags |= F_TCB_BUF; X did_stat = getinfo(lp->l_name, &finfo); X name = lp->l_name; X for (ln = lp->l_lnames; ln; ln = ln->l_lnext) { X if (!did_stat) { X did_stat = getinfo(ln->l_lname, &finfo); X if (did_stat) X name = ln->l_lname; X } X fd++; X } X if (!did_stat) { X if (!errhidden(E_STAT, lp->l_name)) { X if (!errwarnonly(E_STAT, lp->l_name)) X xstats.s_staterrs++; X errmsg("Cannot stat '%s'.\n", lp->l_name); X (void) errabort(E_STAT, lp->l_name, TRUE); X } X return; X } X finfo.f_name = lp->l_name; X finfo.f_namelen = strlen(lp->l_name); X finfo.f_lname = ""; /* XXX nur Übergangsweise!!!!! */ X finfo.f_lnamelen = 0; X X finfo.f_nlink = fd; X finfo.f_xftype = XT_LINK; X finfo.f_tcb = ptb; X fd = -1; X if (is_file(&finfo) && finfo.f_size != 0 && !nullout && X (fd = _lfileopen(name, "rb")) < 0) { X if (!errhidden(E_OPEN, name)) { X if (!errwarnonly(E_OPEN, name)) X xstats.s_openerrs++; X errmsg("Cannot open '%s'.\n", name); X (void) errabort(E_OPEN, name, TRUE); X } X return; X } X if (acpio_link(&finfo)) X put_file(&fd, &finfo); X X if (acctime && fd >= 0) X rs_acctime(fd, &finfo); X if (fd >= 0) X close(fd); X} X X/* X * Cheating with st_dev & st_ino for CPIO: X * Do not use inode number 0 and start st_dev from an X * obscure value... X */ X#define dev_from_linkno(n) (0x5555 + ((n) / 0xFFFF)) X#define ino_from_linkno(n) (1 + ((n) % 0xFFFF)) X XEXPORT BOOL Xread_link(name, namlen, info, ptb) X char *name; X int namlen; X register FINFO *info; X TCB *ptb; X{ X register LINKS *lp; X static Ulong linkno = 0; X X if ((lp = find_link(info)) != NULL) { X if (lp->l_namlen > props.pr_maxlnamelen) { X if (!errhidden(E_NAMETOOLONG, lp->l_name)) { X if (!errwarnonly(E_NAMETOOLONG, lp->l_name)) X xstats.s_toolong++; X errmsgno(EX_BAD, X "%s: Link name too long.\n", X lp->l_name); X (void) errabort(E_NAMETOOLONG, lp->l_name, X TRUE); X } X return (TRUE); X } X if (lp->l_namlen > props.pr_maxslname) { X if (props.pr_flags & PR_XHDR) X info->f_xflags |= XF_LINKPATH; X else X info->f_flags |= F_LONGLINK; X } X if (--lp->l_nlink < 0) { X if (!nowarn && (info->f_flags & F_EXTRACT) == 0) X errmsgno(EX_BAD, X "%s: Linkcount below zero (%ld)\n", X lp->l_name, lp->l_nlink); X } X /* X * We found a hard link to a directory that is already X * known in the link cache. Mark it for later X * statistical analysis. X */ X if (lp->l_flags & L_ISDIR) X lp->l_flags |= L_ISLDIR; X /* X * if linkname is not longer than props.pr_maxslname X * that's all to do with linkname X */ X if ((props.pr_flags & PR_CPIO) == 0) { X strncpy(ptb->dbuf.t_linkname, lp->l_name, X props.pr_maxslname); X } X info->f_lname = lp->l_name; X info->f_lnamelen = lp->l_namlen; X info->f_xftype = XT_LINK; X X /* X * With POSIX-1988, f_rsize is 0 for hardlinks X * X * XXX Should we add a property for old tar X * XXX compatibility to keep the size field as before? X */ X if (!linkdata) X info->f_rsize = (off_t)0; X /* X * XXX This is the wrong place but the TCB has already X * XXX been set up (including size field) before. X * XXX We only call info_to_tcb() to change size to 0. X * XXX There should be a better way to deal with TCB. X */ X if ((info->f_flags & F_EXTRACT) == 0) { X /* X * XXX Nicht bei extrakt X */ X info->f_dev = dev_from_linkno(lp->l_linkno); X info->f_ino = ino_from_linkno(lp->l_linkno); X info_to_tcb(info, ptb); X info->f_dev = lp->l_dev; X info->f_ino = lp->l_ino; X } X /* X * XXX Dies ist eine ungewollte Referenz auf den X * XXX TAR Control Block, aber hier ist der TCB X * XXX schon fertig und wir wollen nur den Typ X * XXX Modifizieren. X */ X if ((props.pr_flags & PR_CPIO) == 0) X ptb->dbuf.t_linkflag = LNKTYPE; X if ((props.pr_flags & PR_SV_CPIO_LINKS) != 0) { X register LNAME *ln; X X ln = (LNAME *)malloc(sizeof (*ln)+namlen); X if (ln == NULL) { X errmsg( X "Cannot alloc new link name for '%s'.\n", X name); X } else { X strlcpy(ln->l_lname, name, namlen+1); X ln->l_lnext = lp->l_lnames; X lp->l_lnames = ln; X } X } X return (TRUE); X } X if ((lp = (LINKS *)malloc(sizeof (*lp)+namlen)) == (LINKS *)NULL) { X errmsg("Cannot alloc new link for '%s'.\n", name); X } else { X register LINKS **lpp = &links[l_hash(info)]; X X lp->l_next = *lpp; X *lpp = lp; X lp->l_lnames = NULL; X lp->l_linkno = linkno++; X lp->l_ino = info->f_ino; X lp->l_dev = info->f_dev; X lp->l_nlink = info->f_nlink - 1; X lp->l_namlen = namlen; X if (is_dir(info)) X lp->l_flags = L_ISDIR; X else X lp->l_flags = 0; X strlcpy(lp->l_name, name, namlen+1); X X if ((info->f_flags & F_EXTRACT) == 0) { X /* X * XXX Nicht bei extrakt X */ X info->f_dev = dev_from_linkno(lp->l_linkno); X info->f_ino = ino_from_linkno(lp->l_linkno); X info_to_tcb(info, ptb); X info->f_dev = lp->l_dev; X info->f_ino = lp->l_ino; X } X } X return (FALSE); X} X X/* ARGSUSED */ XLOCAL int Xnullread(vp, cp, amt) X void *vp; X char *cp; X int amt; X{ X return (amt); X} X XEXPORT void Xput_file(fp, info) X register int *fp; X register FINFO *info; X{ X if (nullout) { X cr_file(info, (int(*)__PR((void *, char *, int)))nullread, X fp, 0, "reading"); X } else { X cr_file(info, (int(*)__PR((void *, char *, int)))_fileread, X fp, 0, "reading"); X } X} X XEXPORT void Xcr_file(info, func, arg, amt, text) X FINFO *info; X int (*func) __PR((void *, char *, int)); X register void *arg; X int amt; X char *text; X{ X register int amount; X register off_t blocks; X register off_t size; X register int i = 0; X register off_t n; Xextern m_stats *stats; X X size = info->f_rsize; X X fifo_enter_critical(); X stats->cur_size = size; X stats->cur_off = 0; X fifo_leave_critical(); X X if ((blocks = tarblocks(info->f_rsize)) == 0) X return; X if (amt == 0) X amt = bufsize; X do { X amount = buf_wait(TBLOCK); X amount = min(amount, amt); X X if ((props.pr_flags & PR_CPIO) == 0) { X if ((i = (*func)(arg, bigptr, max(amount, TBLOCK))) <= 0) X break; X } else { X if ((i = (*func)(arg, bigptr, amount)) <= 0) X break; X } X X size -= i; X fifo_enter_critical(); X stats->cur_off += i; X fifo_leave_critical(); X X if (size < 0) { /* File increased in size */ X n = tarblocks(size+i); /* use expected size only */ X } else { X n = tarblocks(i); X } X if ((props.pr_flags & PR_CPIO) == 0) { X X if (i % TBLOCK) { /* Clear (better compression) */ X fillbytes(bigptr+i, TBLOCK - (i%TBLOCK), '\0'); X } X buf_wake(n*TBLOCK); X } else { X if (size < 0) /* File increased in size */ X buf_wake(size+i); /* use expected size only */ X else X buf_wake(i); X n = blocks; X } X } while ((blocks -= n) >= 0 && i > 0 && size >= 0); X if (i < 0) { X if (!errhidden(E_READ, info->f_name)) { X if (!errwarnonly(E_READ, info->f_name)) X xstats.s_rwerrs++; X errmsg("Error %s '%s'.\n", text, info->f_name); X (void) errabort(E_READ, info->f_name, TRUE); X } X } else if ((blocks != 0 || size != 0) && func != nullread) { X if (!errhidden(size < 0 ? E_GROW:E_SHRINK, info->f_name)) { X if (!errwarnonly(size < 0 ? E_GROW:E_SHRINK, info->f_name)) X xstats.s_sizeerrs++; X errmsgno(EX_BAD, X "'%s': file changed size (%s).\n", X info->f_name, size < 0 ? "increased":"shrunk"); X (void) errabort(size < 0 ? E_GROW:E_SHRINK, X info->f_name, TRUE); X } X } X /* X * If the file did shrink, fill up to expected size... X */ X if ((props.pr_flags & PR_CPIO) == 0) { X while (--blocks >= 0) X writeempty(); X } else { X while (size > 0) { X amount = buf_wait(1); X amount = min(amount, size); X fillbytes(bigptr, amount, '\0'); X buf_wake(amount); X size -= amount; X } X } X /* X * Honour CPIO padding X */ X if ((amount = props.pr_pad) != 0) { X size = info->f_rsize; X if (info->f_flags & F_LONGNAME) X size += props.pr_hdrsize; X amount = (amount + 1 - (size & amount)) & amount; X while (amount-- > 0) { X buf_wait(1); X *bigptr = '\0'; X buf_wake(1); X } X } X} X X#define newfs(i) ((i)->f_dev != curfs) X XLOCAL void Xput_dir(sname, dname, namlen, info, ptb, pathp, last) X char *sname; X register char *dname; X register int namlen; X FINFO *info; X TCB *ptb; X pathstore_t *pathp; X struct pdirs *last; X{ X static int depth = -10; X static int dinit = 0; X FINFO nfinfo; X register FINFO *ninfo = &nfinfo; X DIR *d = NULL; X struct dirent *dir; X#ifdef HAVE_SEEKDIR X long offset = 0L; X#endif X pathstore_t path; X register char *name; X int xlen; X BOOL putdir = FALSE; X BOOL direrr = FALSE; X int dlen; X char *dp = NULL; X struct pdirs thisd; X struct pdirs *pd = last; X BOOL didslash = FALSE; X X if (!dinit) { X#ifdef _SC_OPEN_MAX X depth += sysconf(_SC_OPEN_MAX); X#else X depth += getdtablesize(); X#endif X dinit = 1; X } X X if (nodump && (info->f_flags & F_NODUMP) != 0) X return; X X info->f_dir = NULL; X info->f_dirinos = NULL; X info->f_dirlen = 0; X info->f_dirents = 0; X X switch (take_file(dname, info)) { X X case -1: X if (match_tree) X return; X break; X X case TRUE: X putdir = TRUE; X } X X if ((!nodesc || dodump > 0) && (!nomount || !newfs(info))) { X /* X * If this is a mounted directory and we have been called X * with -M, it makes no sense to include the directorie's file X * name list with -dump. X * By not including this list, we also avoid error messages X * like: X * star: Permission denied. Cannot open 'opt/SUNWddk'. X * X * which is a result of an automounted directory. X * X * Conclusion: try to use a filesystem snapshot whenever X * possible. X */ X if (!lowmem) { X ino_t *ino = NULL; X int nents; X X d = lopendir(sname); X if (d) { X dp = dfetchdir(d, sname, X &nents, &dlen, dodump?&ino:NULL); X#if defined(HAVE_FSTATAT) && defined(HAVE_DIRFD) X if (depth <= 0) { X closedir(d); X d = NULL; X } X#else X closedir(d); X d = NULL; X#endif X } else { X dp = NULL; X } X if (dp == NULL) { X if (!errhidden(E_OPEN, dname)) { X if (!errwarnonly(E_OPEN, dname)) X xstats.s_openerrs++; X errmsg("Cannot open '%s'.\n", dname); X (void) errabort(E_OPEN, dname, TRUE); X } X direrr = TRUE; X } else { X info->f_dir = dp; X info->f_dirinos = ino; X info->f_dirlen = dlen; X info->f_dirents = nents; X /* X * Don't count list terminator null Byte X */ X dlen--; X } X } else if (!(d = lopendir(sname))) { X if (!errhidden(E_OPEN, dname)) { X if (!errwarnonly(E_OPEN, dname)) X xstats.s_openerrs++; X errmsg("Cannot open '%s'.\n", dname); X (void) errabort(E_OPEN, dname, TRUE); X } X direrr = TRUE; X } X } X depth--; X if (!nodir) { X if (interactive && !ia_change(ptb, info)) { X fgtprintf(vpr, "Skipping ...\n"); X if (d) X closedir(d); X if (dp) X free(info->f_dir); X if (info->f_dirinos) X free(info->f_dirinos); X depth++; X return; X } X if (putdir) { X if (!dirmode) X put_tcb(ptb, info); X vprint(info); X } X } X if (direrr) { X depth++; X return; X } X X /* X * Search parent dir structure for possible loops. X */ X thisd.p_last = last; X thisd.p_dev = info->f_dev; X thisd.p_ino = info->f_ino; X X while (pd) { X if (pd->p_dev == info->f_dev && X pd->p_ino == info->f_ino) { X goto out; X } X pd = pd->p_last; X } X X if (!nodesc && (!nomount || !newfs(info))) { X if (sname != dname) X comerrno(EX_BAD, "Panic: put_dir(): sname != dname\n"); X X name = dname; X if (pathp == NULL) { X if (name[0] == '.' && name[1] == '/') { X for (name++; name[0] == '/'; name++) X /* LINTED */ X ; X namlen -= name - dname; X } X if (name[0] == '.' && name[1] == '\0') { X name++; X namlen--; X } X pathp = &path; X if (init_pspace(PS_STDERR, pathp) < 0 || X strlcpy_pspace(PS_STDERR, pathp, name, namlen) < 0) { X toolong("", name, namlen); X goto out; X } X } X if (namlen && pathp->ps_path[pathp->ps_tail - 1] != '/') { X char *p; X X if ((pathp->ps_tail+2) > pathp->ps_size) { X if (incr_pspace(PS_STDERR, pathp, 2) < 0) { X toolong("", name, namlen); X goto out; X } X } X p = &pathp->ps_path[pathp->ps_tail++]; X *p++ = '/'; X *p++ = '\0'; X namlen++; X didslash = TRUE; X } X X while (!intr) { X char *snm; X X if (lowmem) { X if ((dir = readdir(d)) == NULL) X break; X if (streql(dir->d_name, ".") || X streql(dir->d_name, "..")) X continue; X snm = dir->d_name; X xlen = strlen(snm); X } else { X if (dlen <= 0) X break; X X snm = &dp[1]; X xlen = strlen(snm); X dp += xlen + 2; X dlen -= xlen + 2; X } X X if ((namlen+xlen+1) >= pathp->ps_size) { X if (grow_pspace(PS_STDERR, pathp, namlen+xlen+1) < 0) { X toolong(pathp->ps_path, snm, namlen+xlen); X goto out; X } X } X strcpy(&pathp->ps_path[pathp->ps_tail], snm); X name = pathp->ps_path; X X#if defined(HAVE_FSTATAT) && defined(HAVE_DIRFD) X /* X * We get the performance win only with the native X * fstatat() and not from the emulation. X */ X if (d ? !getinfoat(dirfd(d), snm, ninfo) : X !getinfo(name, ninfo)) { X#else X if (!getinfo(name, ninfo)) { X#endif X if (!errhidden(E_STAT, name)) { X if (!errwarnonly(E_STAT, name)) X xstats.s_staterrs++; X errmsg("Cannot stat '%s'.\n", name); X (void) errabort(E_STAT, name, TRUE); X } X continue; X } X#ifdef HAVE_SEEKDIR X if (d && is_dir(ninfo) && depth <= 0) { X seterrno(0); X offset = telldir(d); X if (geterrno()) { X char *p; X X if (pathp->ps_tail == 0) { X dname = "."; X p = NULL; X } else { X /* X * pathstore_t relocates ps_path X */ X dname = pathp->ps_path; X p = &pathp->ps_path[pathp->ps_tail-1]; X *p = '\0'; X } X if (!errhidden(E_OPEN, dname)) { X if (!errwarnonly(E_OPEN, dname)) X xstats.s_openerrs++; X errmsg( X "WARNING: telldir does not work on '%s'.\n", X dname); X (void) errabort(E_OPEN, dname, X TRUE); X } X if (p) X *p = '/'; X /* X * XXX xstats.s_openerrs is wrong here. X * Avoid an endless loop on unseekable X * directories. X */ X /* closedir() is past end of loop */ X break; X } X closedir(d); X } X#endif X pathp->ps_tail += xlen; X createi(name, name, xlen+namlen, ninfo, pathp, &thisd); X pathp->ps_tail -= xlen; X pathp->ps_path[pathp->ps_tail] = '\0'; X#ifdef HAVE_SEEKDIR X if (d && is_dir(ninfo) && depth <= 0) { X char *p; X X if (pathp->ps_tail == 0) { X sname = dname = "."; X p = NULL; X } else { X /* X * pathstore_t relocates ps_path X */ X sname = dname = pathp->ps_path; X p = &pathp->ps_path[pathp->ps_tail-1]; X *p = '\0'; X } X if (!(d = lopendir(sname))) { X if (!errhidden(E_OPEN, dname)) { X if (!errwarnonly(E_OPEN, dname)) X xstats.s_openerrs++; X errmsg("Cannot open '%s'.\n", X dname); X (void) errabort(E_OPEN, dname, X TRUE); X } X if (p) X *p = '/'; X break; X } X seterrno(0); X seekdir(d, offset); X if (geterrno()) { X if (!errhidden(E_OPEN, dname)) { X if (!errwarnonly(E_OPEN, dname)) X xstats.s_openerrs++; X errmsg( X "WARNING: seekdir does not work on '%s'.\n", X dname); X (void) errabort(E_OPEN, dname, X TRUE); X } X /* X * XXX xstats.s_openerrs is wrong here. X * Avoid an endless loop on unseekable X * directories. X */ X if (p) X *p = '/'; X break; X } X if (p) X *p = '/'; X } X#endif X } X } Xout: X if (didslash) X pathp->ps_path[--pathp->ps_tail] = '\0'; X if (d) X closedir(d); X if (dp) X free(info->f_dir); X if (info->f_dirinos) X free(info->f_dirinos); X if (pathp == &path) X free_pspace(pathp); X depth++; X if (!nodir && dirmode && putdir) X put_tcb(ptb, info); X} X X/* X * This is currently only called in case we did run out of memory. X */ XLOCAL void Xtoolong(dname, name, len) X char *dname; X char *name; X size_t len; X{ X if (!errhidden(E_NAMETOOLONG, name)) { X if (!errwarnonly(E_NAMETOOLONG, name)) X xstats.s_toolong++; X errmsgno(EX_BAD, "%s%s: Name too long (%lu), out of memory.\n", X dname, name, X (unsigned long)len); X (void) errabort(E_NAMETOOLONG, name, TRUE); X } X} X XLOCAL BOOL Xcheckdirexclude(sname, name, namlen, info) X char *sname; X char *name; X int namlen; X FINFO *info; X{ X FINFO finfo; X char pname[PATH_MAX+1]; X char *pnamep = pname; X size_t pnamelen = sizeof (pname); X size_t pnlen; X int OFflag = Fflag; X char *p; X BOOL ret = TRUE; X X Fflag = 0; X pnlen = namlen; X pnlen += 2 + 8; /* Null Byte + '/' + strlen(".exclude") */ X if (pnlen > pnamelen) { X pnamep = __fjmalloc(stderr, pnlen, "name buffer", JM_RETURN); X if (pnamep == NULL) { X errmsg("Cannot check '%s' for exclude\n", name); X goto notfound; X } X } X strcpy(pnamep, name); X p = &pnamep[namlen]; X if (p[-1] != '/') { X *p++ = '/'; X } X strcpy(p, ".mirror"); X if (!_getinfo(pnamep, &finfo)) { X strcpy(p, ".exclude"); X if (!_getinfo(pnamep, &finfo)) X goto notfound; X } X if (is_file(&finfo)) { X if (OFflag == 3) { X nodesc++; X if (!dirmode) { X createi(sname, name, namlen, info, X (pathstore_t *)0, X (struct pdirs *)0); X } X create(pnamep, FALSE, FALSE); /* Needed to strip off "./" */ X if (dirmode) { X createi(sname, name, namlen, info, X (pathstore_t *)0, X (struct pdirs *)0); X } X nodesc--; X } X ret = FALSE; X } Xnotfound: X if (pnamep != pname) X free(pnamep); X Fflag = OFflag; X return (ret); X} X XLOCAL BOOL Xcheckexclude(sname, name, namlen, info) X char *sname; X char *name; X int namlen; X FINFO *info; X{ X int len; X const char *fn; X X if (Fflag <= 0) X return (TRUE); X X fn = filename(name); X X if (is_dir(info)) { X /* X * Exclude with -F -FF -FFFFF 1, 2, 5+ X */ X if (Fflag < 3 || Fflag > 4) { X if (streql(fn, "SCCS") || /* SCCS directory */ X streql(fn, "RCS")) /* RCS directory */ X return (FALSE); X } X if (Fflag > 1 && streql(fn, "OBJ")) /* OBJ directory */ X return (FALSE); X if (Fflag > 2 && !checkdirexclude(sname, name, namlen, info)) X return (FALSE); X return (TRUE); X } X if ((len = strlen(fn)) < 3) /* Will never match later */ X return (TRUE); X X if (Fflag > 1 && fn[len-2] == '.' && fn[len-1] == 'o') /* obj files */ X return (FALSE); X X if (Fflag > 1 && is_file(info)) { X if (streql(fn, "core") || X streql(fn, "errs") || X streql(fn, "a.out")) X return (FALSE); X } X X return (TRUE); X} X X#ifdef USE_FIND X/* X * The callback function for treewalk() X * X * XXX errhidden() support not yet implemented. X */ XEXPORT int Xwalkfunc(nm, fs, type, state) X char *nm; X struct stat *fs; X int type; X struct WALK *state; X{ X if (intr) { X state->flags |= WALK_WF_QUIT; X return (0); X } X if (type == WALK_NS) { X errmsg("Cannot stat '%s'.\n", nm); X state->err = 1; X return (0); X } else if (type == WALK_SLN && (state->walkflags & WALK_PHYS) == 0) { X errmsg("Cannot follow symlink '%s'.\n", nm); X state->err = 1; X return (0); X } else if (type == WALK_DNR) { X if (state->flags & WALK_WF_NOCHDIR) X errmsg("Cannot chdir to '%s'.\n", nm); X else X errmsg("Cannot read '%s'.\n", nm); X state->err = 1; X return (0); X } X if (state->maxdepth >= 0 && state->level >= state->maxdepth) X state->flags |= WALK_WF_PRUNE; X if (state->mindepth >= 0 && state->level < state->mindepth) X return (0); X X if (state->tree == NULL || X find_expr(nm, nm + state->base, fs, state, state->tree)) { X FINFO finfo; X X finfo.f_sname = nm + state->base; X finfo.f_name = nm; X stat_to_info(AT_FDCWD, fs, &finfo); X createi(nm + state->base, nm, strlen(nm), &finfo, X (pathstore_t *)0, (struct pdirs *)0); X } X return (0); X} X#endif END-of-star-1.6/star/create.c echo x - star-1.6/star/create.dgux.patch sed 's/^X//' >star-1.6/star/create.dgux.patch << 'END-of-star-1.6/star/create.dgux.patch' X*** create.c.orig Sat Jun 14 15:53:45 1997 X--- create.c Sun Jun 15 18:38:08 1997 X*************** X*** 35,40 **** X--- 35,101 ---- X #include X #include "starsubs.h" X X+ #if defined(DGUX) && !defined(NO_DG_FILEREAD) X+ X+ #include X+ #include X+ X+ LOCAL FILE *dg_fileopen __PR((FINFO *info)); X+ LOCAL int dg_fileclose __PR((FILE *fp)); X+ LOCAL int dg_fileread __PR((FILE *f, char *bp, int cnd)); X+ X+ FILE *dg_fileopen(info) X+ FINFO *info; X+ { X+ static FILE __f; X+ int f; X+ X+ if ((f = open(info->f_name, O_DG_UNBUFFERED)) < 0) X+ return ((FILE *)0); X+ X+ __f._file = f; X+ __f._cnt = 0; X+ __f._ptr = info->f_rsize; X+ return (&__f); X+ } X+ X+ int dg_fileclose(fp) X+ FILE *fp; X+ { X+ return (close(fp->_file)); X+ } X+ X+ int dg_fileread(fp, bp, cnt) X+ FILE *fp; X+ char *bp; X+ int cnt; X+ { X+ int n; X+ X+ again: X+ n = dg_unbuffered_read(fp->_file, bp, fp->_cnt, cnt/512); X+ if (n < 0) { X+ if (geterrno() == EINTR) X+ goto again; X+ return (-1); X+ } X+ if (n == 0) X+ return (0); X+ X+ fp->_cnt += n; X+ if (fp->_cnt == tarblocks((int)fp->_ptr)) { X+ if ((((int)fp->_ptr) % 512) == 0) X+ return (n * 512); X+ X+ n -= 1; X+ n *= 512; X+ n += ((int)fp->_ptr) % 512; X+ return (n); X+ } X+ return (n * 512); X+ } X+ #endif X+ X typedef struct links { X struct links *l_next; X long l_ino; X*************** X*** 227,232 **** X--- 288,296 ---- X else if (is_symlink(info) && !read_symlink(name, info, ptb)) X ; X else if (is_file(info) && info->f_size != 0 && !nullout && X+ #if defined(DGUX) && !defined(NO_DG_FILEREAD) X+ (f = dg_fileopen(info)) == (FILE *)NULL) { X+ #else X #ifdef OLD_OPEN X (f = fileopen(name,"ru")) == (FILE *)NULL) { X #else X*************** X*** 236,241 **** X--- 300,306 ---- X */ X (f = fileopen(name,"r")) == (FILE *)NULL) { X #endif X+ #endif X errmsg("Cannot open '%s'.\n", name); X } else { X if (info->f_nlink > 1 && read_link(name, namlen, info, ptb)) X*************** X*** 280,286 **** X--- 345,355 ---- X if (acctime && f != NULL) X rs_acctime(f, info); X if (f) X+ #if defined(DGUX) && !defined(NO_DG_FILEREAD) X+ dg_fileclose(f); X+ #else X fclose(f); X+ #endif X } X } X X*************** X*** 421,428 **** X--- 490,502 ---- X cr_file(info, (int(*)__PR((void *, char *, int)))nullread, X f, 0, "reading"); X } else { X+ #if defined(DGUX) && !defined(NO_DG_FILEREAD) X+ cr_file(info, (int(*)__PR((void *, char *, int)))dg_fileread, X+ f, 0, "reading"); X+ #else X cr_file(info, (int(*)__PR((void *, char *, int)))ffileread, X f, 0, "reading"); X+ #endif X } X } X END-of-star-1.6/star/create.dgux.patch echo x - star-1.6/star/defaults.c sed 's/^X//' >star-1.6/star/defaults.c << 'END-of-star-1.6/star/defaults.c' X/* @(#)defaults.c 1.17 18/07/10 Copyright 1998-2018 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)defaults.c 1.17 18/07/10 Copyright 1998-2018 J. Schilling"; X#endif X/* X * Copyright (c) 1998-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X#include X#define GT_COMERR /* #define comerr gtcomerr */ X#define GT_ERROR /* #define error gterror */ X#include X#include "star.h" X#include "starsubs.h" X Xextern const char *tarfiles[]; Xextern long bs; Xextern int nblocks; Xextern BOOL not_tape; Xextern Ullong tsize; Xextern BOOL silent; Xextern BOOL print_artype; Xextern BOOL xflag; Xextern BOOL nflag; X XEXPORT char *get_stardefaults __PR((char *name)); XLOCAL int open_stardefaults __PR((char *dfltname)); XEXPORT void star_defaults __PR((long *fsp, BOOL *no_fsyncp, X char *dfltname)); XEXPORT BOOL star_darchive __PR((char *arname, char *dfltname)); X XEXPORT char * Xget_stardefaults(name) X char *name; X{ X char *ret; X X if (name) X return (name); X /* X * WARNING you are only allowed to change this filename if you also X * change the documentation and add a statement that makes clear X * where the official location of the file is why you did choose a X * nonstandard location and that the nonstandard location only refers X * to inofficial star versions. X * X * I was forced to add this because some people change star without X * rational reason and then publish the result. As those people X * don't contribute work and don't give support, they are causing extra X * work for me and this way slow down the star development. X */ X#if defined(PROTOTYPES) && defined(INS_RBASE) X ret = INS_RBASE "/etc/default/star"; X while (ret[0] == '/' && ret[1] == '/') X ret++; X#else X ret = "/etc/default/star"; X#endif X return (ret); X} X XLOCAL int Xopen_stardefaults(dfltname) X char *dfltname; X{ X /* X * We may later set options here.... X */ X return (defltopen(dfltname)); X} X XEXPORT void Xstar_defaults(fsp, no_fsyncp, dfltname) X long *fsp; X BOOL *no_fsyncp; X char *dfltname; X{ X BOOL is_open = FALSE; X BOOL nofsync = FALSE; X long fs_cur = 0L; X long fs_max = -1L; X X dfltname = get_stardefaults(dfltname); X X if (fsp != NULL) X fs_cur = *fsp; X X if (fs_cur <= 0L) { X char *p = NULL; X X if (open_stardefaults(dfltname) == 0) { X is_open = TRUE; X p = defltread("STAR_FIFOSIZE="); X } X if (p) { X if (getnum(p, &fs_cur) != 1) X comerrno(EX_BAD, "Bad fifo size default.\n"); X } X } X if (fs_cur > 0L) { X char *p = NULL; X X if (is_open) { X defltfirst(); X } else if (open_stardefaults(dfltname) == 0) { X is_open = TRUE; X } X if (is_open) X p = defltread("STAR_FIFOSIZE_MAX="); X if (p) { X if (getnum(p, &fs_max) != 1) { X comerrno(EX_BAD, X "Bad max fifo size default.\n"); X } X } X if (fs_cur > fs_max) X fs_cur = fs_max; X } X X if (fs_cur > 0L && fsp != NULL) X *fsp = fs_cur; X X if (no_fsyncp) X nofsync = *no_fsyncp; X if (nofsync < 0) { X char *p = NULL; X BOOL was_env = FALSE; X X p = getenv("STAR_FSYNC"); X if (p == NULL) { X if (is_open) { X defltfirst(); X } else if (open_stardefaults(dfltname) == 0) { X is_open = TRUE; X } X if (is_open) X p = defltread("STAR_FSYNC="); X } else { X was_env = TRUE; X } X if (p) { X while (*p == ' ' || *p == '\t') X p++; X if (*p == 'n' || *p == 'N') { X nofsync = TRUE; X if (!silent && !print_artype && xflag && !nflag) X errmsgno(EX_BAD, X "WARNING: fsync() disabled from '%s'.\n", X was_env ? "environment" : X dfltname); X } else { X nofsync = FALSE; X } X } X } X if (no_fsyncp && nofsync >= 0) X *no_fsyncp = nofsync; X X defltclose(); X} X X/* X * Check 'dfltname' for an 'arname' pattern. X * X * A correct entry has 3..4 space separated entries: X * 1) The device (archive0=/dev/tape) X * 2) The bloking factor in 512 byte units (20) X * 3) The max media size in 1024 byte units X * 0 means unlimited (no multi volume handling) X * 4) Whether this is a tape or not X * Examples: X * archive0=/dev/tape 512 0 y X * archive1=/dev/fd0 1 1440 n X */ XEXPORT BOOL Xstar_darchive(arname, dfltname) X char *arname; X char *dfltname; X{ X char *p; X Llong llbs = 0; X X dfltname = get_stardefaults(dfltname); X if (dfltname == NULL) X return (FALSE); X if (open_stardefaults(dfltname) != 0) X return (FALSE); X X /* X * XXX Sun tar arbeitet mit Ignore Case X */ X if ((p = defltread(arname)) == NULL) { X errmsgno(EX_BAD, X "Missing or invalid '%s' entry in %s.\n", X arname, dfltname); X return (FALSE); X } X if ((p = strtok(p, " \t")) == NULL) { X errmsgno(EX_BAD, X "'%s' entry in %s is empty!\n", arname, dfltname); X return (FALSE); X } else { X tarfiles[0] = ___savestr(p); X } X if ((p = strtok(NULL, " \t")) == NULL) { X errmsgno(EX_BAD, X "Block component missing in '%s' entry in %s.\n", X arname, dfltname); X return (FALSE); X } X if (getbnum(p, &llbs) != 1) { X comerrno(EX_BAD, "Bad blocksize entry for '%s' in %s.\n", X arname, dfltname); X } else { X int iblocks = llbs; X X if ((llbs <= 0) || (iblocks != llbs)) { X comerrno(EX_BAD, X "Invalid blocksize '%s'.\n", p); X } X bs = llbs; X nblocks = bs / TBLOCK; X } X if ((p = strtok(NULL, " \t")) == NULL) { X errmsgno(EX_BAD, X "Size component missing in '%s' entry in %s.\n", X arname, dfltname); X return (FALSE); X } X if (getknum(p, &llbs) != 1) { /* tsize is Ullong */ X comerrno(EX_BAD, "Bad size entry for '%s' in %s.\n", X arname, dfltname); X } X tsize = llbs / TBLOCK; X /* XXX Sun Tar hat check auf min size von 250 kB */ X X /* X * XXX Sun Tar setzt not_tape auch wenn kein Tape Feld vorhanden ist X * XXX und tsize != 0 ist. X */ X if ((p = strtok(NULL, " \t")) != NULL) /* May be omited */ X not_tape = (*p == 'n' || *p == 'N'); X defltclose(); X#ifdef DEBUG X error("star_darchive: archive='%s'; tarfile='%s'\n", arname, tarfiles[0]); X error("star_darchive: nblock='%d'; tsize='%llu'\n", X nblocks, tsize); X error("star_darchive: not tape = %d\n", not_tape); X#endif X return (TRUE); X} END-of-star-1.6/star/defaults.c echo x - star-1.6/star/device.c sed 's/^X//' >star-1.6/star/device.c << 'END-of-star-1.6/star/device.c' X/* @(#)device.c 1.17 18/06/16 Copyright 1996-2018 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)device.c 1.17 18/06/16 Copyright 1996-2018 J. Schilling"; X#endif X/* X * Handle local and remote device major/minor mappings X * X * Copyright (c) 1996-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#define GT_COMERR /* #define comerr gtcomerr */ X#define GT_ERROR /* #define error gterror */ X#include X#define __XDEV__ /* Needed to activate XDEV_T definitions */ X#include X X#ifdef DEV_DEFAULTS XEXPORT int minorbits = 8; XEXPORT XDEV_T minormask = 0xFFLU; X#else XEXPORT int minorbits; XEXPORT XDEV_T minormask; X#endif X X#ifdef __STDC__ XEXPORT XDEV_T _dev_mask[] = { X 0x00000000LU, X 0x00000001LU, X 0x00000003LU, X 0x00000007LU, X 0x0000000FLU, X 0x0000001FLU, X 0x0000003FLU, X 0x0000007FLU, X 0x000000FFLU, X 0x000001FFLU, X 0x000003FFLU, X 0x000007FFLU, X 0x00000FFFLU, X 0x00001FFFLU, X 0x00003FFFLU, X 0x00007FFFLU, X 0x0000FFFFLU, X 0x0001FFFFLU, X 0x0003FFFFLU, X 0x0007FFFFLU, X 0x000FFFFFLU, X 0x001FFFFFLU, X 0x003FFFFFLU, X 0x007FFFFFLU, X 0x00FFFFFFLU, X 0x01FFFFFFLU, X 0x03FFFFFFLU, X 0x07FFFFFFLU, X 0x0FFFFFFFLU, X 0x1FFFFFFFLU, X 0x3FFFFFFFLU, X 0x7FFFFFFFLU, X 0xFFFFFFFFLU, X#if SIZEOF_ULLONG > 4 X 0x00000001FFFFFFFFLLU, X 0x00000003FFFFFFFFLLU, X 0x00000007FFFFFFFFLLU, X 0x0000000FFFFFFFFFLLU, X 0x0000001FFFFFFFFFLLU, X 0x0000003FFFFFFFFFLLU, X 0x0000007FFFFFFFFFLLU, X 0x000000FFFFFFFFFFLLU, X 0x000001FFFFFFFFFFLLU, X 0x000003FFFFFFFFFFLLU, X 0x000007FFFFFFFFFFLLU, X 0x00000FFFFFFFFFFFLLU, X 0x00001FFFFFFFFFFFLLU, X 0x00003FFFFFFFFFFFLLU, X 0x00007FFFFFFFFFFFLLU, X 0x0000FFFFFFFFFFFFLLU, X 0x0001FFFFFFFFFFFFLLU, X 0x0003FFFFFFFFFFFFLLU, X 0x0007FFFFFFFFFFFFLLU, X 0x000FFFFFFFFFFFFFLLU, X 0x001FFFFFFFFFFFFFLLU, X 0x003FFFFFFFFFFFFFLLU, X 0x007FFFFFFFFFFFFFLLU, X 0x00FFFFFFFFFFFFFFLLU, X 0x01FFFFFFFFFFFFFFLLU, X 0x03FFFFFFFFFFFFFFLLU, X 0x07FFFFFFFFFFFFFFLLU, X 0x0FFFFFFFFFFFFFFFLLU, X 0x1FFFFFFFFFFFFFFFLLU, X 0x3FFFFFFFFFFFFFFFLLU, X 0x7FFFFFFFFFFFFFFFLLU, X 0xFFFFFFFFFFFFFFFFLLU, X#endif X}; X#else XEXPORT XDEV_T _dev_mask[] = { X 0x00000000L, X 0x00000001L, X 0x00000003L, X 0x00000007L, X 0x0000000FL, X 0x0000001FL, X 0x0000003FL, X 0x0000007FL, X 0x000000FFL, X 0x000001FFL, X 0x000003FFL, X 0x000007FFL, X 0x00000FFFL, X 0x00001FFFL, X 0x00003FFFL, X 0x00007FFFL, X 0x0000FFFFL, X 0x0001FFFFL, X 0x0003FFFFL, X 0x0007FFFFL, X 0x000FFFFFL, X 0x001FFFFFL, X 0x003FFFFFL, X 0x007FFFFFL, X 0x00FFFFFFL, X 0x01FFFFFFL, X 0x03FFFFFFL, X 0x07FFFFFFL, X 0x0FFFFFFFL, X 0x1FFFFFFFL, X 0x3FFFFFFFL, X 0x7FFFFFFFL, X 0xFFFFFFFFL, X#if SIZEOF_ULLONG > 4 X 0x00000001FFFFFFFFLL, X 0x00000003FFFFFFFFLL, X 0x00000007FFFFFFFFLL, X 0x0000000FFFFFFFFFLL, X 0x0000001FFFFFFFFFLL, X 0x0000003FFFFFFFFFLL, X 0x0000007FFFFFFFFFLL, X 0x000000FFFFFFFFFFLL, X 0x000001FFFFFFFFFFLL, X 0x000003FFFFFFFFFFLL, X 0x000007FFFFFFFFFFLL, X 0x00000FFFFFFFFFFFLL, X 0x00001FFFFFFFFFFFLL, X 0x00003FFFFFFFFFFFLL, X 0x00007FFFFFFFFFFFLL, X 0x0000FFFFFFFFFFFFLL, X 0x0001FFFFFFFFFFFFLL, X 0x0003FFFFFFFFFFFFLL, X 0x0007FFFFFFFFFFFFLL, X 0x000FFFFFFFFFFFFFLL, X 0x001FFFFFFFFFFFFFLL, X 0x003FFFFFFFFFFFFFLL, X 0x007FFFFFFFFFFFFFLL, X 0x00FFFFFFFFFFFFFFLL, X 0x01FFFFFFFFFFFFFFLL, X 0x03FFFFFFFFFFFFFFLL, X 0x07FFFFFFFFFFFFFFLL, X 0x0FFFFFFFFFFFFFFFLL, X 0x1FFFFFFFFFFFFFFFLL, X 0x3FFFFFFFFFFFFFFFLL, X 0x7FFFFFFFFFFFFFFFLL, X 0xFFFFFFFFFFFFFFFFLL, X#endif X}; X#endif X XEXPORT void Xdev_init(debug) X BOOL debug; X{ X int i; X dev_t x; X X for (i = 0, x = 1; minor(x) == x; i++, x <<= 1) X /* LINTED */ X ; X X minorbits = i; X minormask = _dev_mask[i]; X X if (debug) X error("dev_minorbits: %d\n", minorbits); X} X X#ifdef IS_LIBRARY X X#undef dev_major XEXPORT XDEV_T Xdev_major(dev) X XDEV_T dev; X{ X return (dev >> minorbits); X} X X#undef _dev_major XEXPORT XDEV_T X_dev_major(mbits, dev) X int mbits; X XDEV_T dev; X{ X return (dev >> mbits); X} X X#undef dev_minor XEXPORT XDEV_T Xdev_minor(dev) X XDEV_T dev; X{ X return (dev & minormask); X} X X#undef _dev_minor XEXPORT XDEV_T X_dev_minor(mbits, dev) X int mbits; X XDEV_T dev; X{ X return (dev & _dev_mask[mbits]); X} X X#undef dev_make XEXPORT XDEV_T Xdev_make(majo, mino) X XDEV_T majo; X XDEV_T mino; X{ X return ((majo << minorbits) | mino); X} X X#undef _dev_make XEXPORT XDEV_T X_dev_make(mbits, majo, mino) X int mbits; X XDEV_T majo; X XDEV_T mino; X{ X return ((majo << mbits) | mino); X} X#endif /* IS_LIBRARY */ END-of-star-1.6/star/device.c echo x - star-1.6/star/diff.c sed 's/^X//' >star-1.6/star/diff.c << 'END-of-star-1.6/star/diff.c' X/* @(#)diff.c 1.100 19/01/16 Copyright 1993-2019 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)diff.c 1.100 19/01/16 Copyright 1993-2019 J. Schilling"; X#endif X/* X * List differences between a (tape) archive and X * the filesystem X * X * Copyright (c) 1993-2019 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X#include X#include "star.h" X#include "props.h" X#include "table.h" X#include "diff.h" X#define GT_COMERR /* #define comerr gtcomerr */ X#define GT_ERROR /* #define error gterror */ X#include X#include /* XXX Wegen S_IFLNK */ X#include "starsubs.h" X#include "checkerr.h" X#include X#ifdef USE_FIND X#include X#endif X X#include X Xtypedef struct { X FILE *cmp_file; X char *cmp_buf; X int cmp_diffs; X} cmp_t; X Xextern FILE *tarf; Xextern char *listfile; Xextern int version; X Xextern long bigcnt; Xextern int bigsize; Xextern char *bigptr; X Xextern BOOL havepat; Xextern long hdrtype; Xextern BOOL debug; Xextern BOOL no_stats; Xextern BOOL abs_path; Xextern int verbose; Xextern BOOL tpath; Xextern BOOL interactive; X X#ifdef USE_ACL Xextern BOOL doacl; X#else X#define doacl FALSE X#endif X#ifdef USE_XATTR Xextern BOOL doxattr; X#else X#define doxattr FALSE X#endif X#ifdef USE_FFLAGS Xextern BOOL dofflags; X#endif X X#ifdef USE_FIND Xextern BOOL dofind; X#endif X XEXPORT void diff __PR((void)); XLOCAL void diff_tcb __PR((FINFO *info)); XLOCAL BOOL linkeql __PR((char *n1, char *n2)); XLOCAL BOOL patheql __PR((char *n1, char *n2)); XLOCAL BOOL dirdiffs __PR((FILE *f, FINFO *info)); XLOCAL int cmp_func __PR((cmp_t *cmp, char *p, int amount)); XLOCAL BOOL cmp_file __PR((FINFO *info)); XEXPORT void prdiffopts __PR((FILE *f, char *label, int flags)); XLOCAL void prdopt __PR((FILE *f, char *name, int printed)); X XEXPORT void Xdiff() X{ X#ifdef USE_FIND Xextern struct WALK walkstate; X#endif X FINFO finfo; X TCB tb; X register TCB *ptb = &tb; X X fillbytes((char *)&finfo, sizeof (finfo), '\0'); X X if (init_pspace(PS_STDERR, &finfo.f_pname) < 0) X return; X if (init_pspace(PS_STDERR, &finfo.f_plname) < 0) X return; X X finfo.f_tcb = ptb; X X /* X * We first have to read a control block to know what type of X * tar archive we are reading from. X */ X if (get_tcb(ptb) == EOF) X return; X X diffopts &= ~props.pr_diffmask; X if (!no_stats) X prdiffopts(stderr, "diffopts=", diffopts); X X#ifdef USE_FIND X if (dofind) { X walkopen(&walkstate); X walkgethome(&walkstate); /* Needed in case we chdir */ X } X#endif X for (;;) { X finfo.f_name = finfo.f_pname.ps_path; X finfo.f_lname = finfo.f_plname.ps_path; X if (tcb_to_info(ptb, &finfo) == EOF) X break; X#ifdef USE_FIND X if (dofind && !findinfo(&finfo)) { X void_file(&finfo); X goto cont; X } X#endif X X if (listfile && !hash_lookup(finfo.f_name)) { X void_file(&finfo); X goto cont; X } X if (hash_xlookup(finfo.f_name)) { X void_file(&finfo); X goto cont; X } X if (havepat && !match(finfo.f_name)) { X void_file(&finfo); X goto cont; X } X diff_tcb(&finfo); X cont: X if (get_tcb(ptb) == EOF) X break; X } X#ifdef USE_FIND X if (dofind) { X walkhome(&walkstate); X walkclose(&walkstate); X free(walkstate.twprivate); X } X#endif X} X XLOCAL void Xdiff_tcb(info) X register FINFO *info; X{ X char lname[PATH_MAX+1]; /* This limit cannot be overruled */ X TCB tb; X FINFO finfo; X FINFO linfo; X FILE *f; X int diffs = 0; X BOOL do_void = FALSE; /* Make GCC happy */ X X f = tarf == stdout ? stderr : stdout; /* XXX FILE *vpr is the same */ X X fillbytes((char *)&finfo, sizeof (finfo), '\0'); X X finfo.f_lname = lname; X finfo.f_lnamelen = 0; X X if (!abs_path && /* XXX VVV siehe skip_slash() */ X (info->f_name[0] == '/' /* || info->f_lname[0] == '/' */)) X skip_slash(info); X X if (is_volhdr(info)) { X void_file(info); X return; X } X /* X * Use getinfo() if we like to compare ACLs/xattr too. X */ X if (((doacl || doxattr)? !getinfo(info->f_name, &finfo): X !_getinfo(info->f_name, &finfo))) { X if (!errhidden(E_STAT, info->f_name)) { X if (!errwarnonly(E_STAT, info->f_name)) X xstats.s_staterrs++; X errmsg("Cannot stat '%s'.\n", info->f_name); X (void) errabort(E_STAT, info->f_name, TRUE); X } X void_file(info); X return; X } X /* X * We cannot compare the link count if this is a CPIO archive X * and the link count is < 2. Even if the link count is >= 2, it X * may not be exact. X */ X if ((props.pr_flags & PR_CPIO) && info->f_nlink < 2) X info->f_nlink = 0; X if (info->f_nlink == 0) /* If archive has no link counts */ X finfo.f_nlink = 0; /* always suppress nlink in listing. */ X X fillbytes(&tb, sizeof (TCB), '\0'); X X info_to_tcb(&finfo, &tb); /* XXX ist das noch nötig ??? */ X /* z.Zt. wegen linkflag/uname/gname */ X X if ((diffopts & D_PERM) && X (info->f_mode & 07777) != (finfo.f_mode & 07777)) { X if ((diffopts & D_SYMPERM) != 0 || !is_symlink(&finfo)) X diffs |= D_PERM; X /* X * XXX Diff ACLs not yet implemented. X */ X X } X X if ((diffopts & D_NLINK) && info->f_nlink > 0 && X info->f_nlink != finfo.f_nlink) { X diffs |= D_NLINK; X } X X if ((diffopts & D_UID) && info->f_uid != finfo.f_uid) { X diffs |= D_UID; X } X if ((diffopts & D_GID) && info->f_gid != finfo.f_gid) { X diffs |= D_GID; X } X X /* X * Note that uname/gname in the old star header are not always X * null terminated. X */ X if ((diffopts & D_UNAME) && info->f_uname && finfo.f_uname) { X if (strncmp(info->f_uname, finfo.f_uname, info->f_umaxlen)) X diffs |= D_UNAME; X } X if ((diffopts & D_GNAME) && info->f_gname && finfo.f_gname) { X if (strncmp(info->f_gname, finfo.f_gname, info->f_gmaxlen)) X diffs |= D_GNAME; X } X X /* X * XXX hier kann es bei ustar/cpio inkompatibel werden! X * X * Z.Zt. hat nur das STAR Format auch bei Hardlinks den Filetype. X * Soll man die teilweise bei fehlerhaften USTAR X * Implementierungen vorhandenen Filetype Bits verwenden? X * X * XXX CPIO EXUSTAR, ... haben auch den Filetyp. X */ X if ((diffopts & D_TYPE) && X (info->f_filetype != finfo.f_filetype || X (is_special(info) && info->f_type != finfo.f_type)) && X (!fis_link(info) || H_TYPE(hdrtype) == H_STAR)) { X X if (fis_meta(info) && is_file(&finfo)) { X /* EMPTY */ X ; X } else { X if (debug) { X fgtprintf(f, X "%s: different filetype %llo != %llo\n", X info->f_name, X (Ullong)info->f_type, (Ullong)finfo.f_type); X } X diffs |= D_TYPE; X } X } X X /* X * nsec beachten wenn im Archiv! X */ X if ((diffopts & D_ATIME) != 0) { X if (info->f_atime != finfo.f_atime) { X diffs |= D_ATIME; X } else if ((diffopts & D_ANTIME) != 0) { X if ((info->f_xflags & XF_ATIME) && X (finfo.f_flags & F_NSECS) && X info->f_ansec != finfo.f_ansec) { X diffs |= D_ANTIME; X if ((info->f_ansec % 1000 == 0 || X finfo.f_ansec % 1000 == 0) && X (info->f_ansec / 1000 == X finfo.f_ansec / 1000)) X diffs &= ~D_ANTIME; X } X } X } X if ((diffopts & D_MTIME) != 0) { X if ((diffopts & D_LMTIME) != 0 || !is_symlink(&finfo)) { X if (info->f_mtime != finfo.f_mtime) { X diffs |= D_MTIME; X } else if ((diffopts & D_MNTIME) != 0) { X if ((info->f_xflags & XF_MTIME) && X (finfo.f_flags & F_NSECS) && X info->f_mnsec != finfo.f_mnsec) { X diffs |= D_MNTIME; X if ((info->f_mnsec % 1000 == 0 || X finfo.f_mnsec % 1000 == 0) && X (info->f_mnsec / 1000 == X finfo.f_mnsec / 1000)) X diffs &= ~D_MNTIME; X } X } X } X } X if ((diffopts & D_CTIME) != 0) { X if (info->f_ctime != finfo.f_ctime) { X diffs |= D_CTIME; X } else if ((diffopts & D_CNTIME) != 0) { X if ((info->f_xflags & XF_CTIME) && X (finfo.f_flags & F_NSECS) && X info->f_cnsec != finfo.f_cnsec) { X diffs |= D_CNTIME; X if ((info->f_cnsec % 1000 == 0 || X finfo.f_cnsec % 1000 == 0) && X (info->f_cnsec / 1000 == X finfo.f_cnsec / 1000)) X diffs &= ~D_CNTIME; X } X } X } X X if ((diffopts & D_DIR) && is_dir(info) && info->f_dir && X is_dir(&finfo)) { X if (dirdiffs(f, info)) X diffs |= D_DIR; X } X X if ((diffopts & D_HLINK) && is_link(info)) { X if (!_getinfo(info->f_lname, &linfo)) { X if (!errhidden(E_STAT, info->f_lname)) { X if (!errwarnonly(E_STAT, info->f_lname)) X xstats.s_staterrs++; X errmsg("Cannot stat '%s'.\n", info->f_lname); X (void) errabort(E_STAT, info->f_lname, TRUE); X } X linfo.f_ino = (ino_t)0; X } X if ((finfo.f_ino != linfo.f_ino) || X (finfo.f_dev != linfo.f_dev)) { X if (debug || verbose) X fgtprintf(f, "%s: not linked to %s\n", X info->f_name, info->f_lname); X X diffs |= D_HLINK; X } X } X#ifdef S_IFLNK X /* X * In case of a hardlinked symlink, we currently do not have the symlink X * target path and thus cannot check the synlink target. X */ X if (!is_link(info)) X if (((diffopts & (D_SLINK|D_SLPATH)) || verbose) && is_symlink(&finfo)) { X /* X * XXX finfo.f_lname is static as the maximum symlink len X * XXX is PATH_MAX. X */ X if (read_symlink(info->f_name, info->f_name, &finfo, &tb)) { X if ((diffopts & D_SLINK) && is_symlink(info) && X !linkeql(info->f_lname, finfo.f_lname)) { X diffs |= D_SLINK; X } X if ((diffopts & D_SLPATH) && is_symlink(info) && X !streql(info->f_lname, finfo.f_lname)) { X diffs |= D_SLPATH; X } X } X } X#endif X X /* X * Only plain files may have holes, so only open plain files. X * We cannot compare the "sparseness" of hardlinks that do not X * include data in the archive. X */ X if (diffopts & D_SPARS && is_a_file(&finfo) && X !(is_link(info) && info->f_size == 0)) { X /* X * This is not the right place to check for SEEK_HOLE bit it is X * the only way to avoid opening the file in case it does not X * make sense. X */ X#if defined(SEEK_HOLE) && defined(SEEK_DATA) X int fd; X X#ifndef O_NDELAY X#define O_NDELAY 0 X#define NDELAY X#endif X if ((fd = open(finfo.f_name, O_RDONLY|O_NDELAY)) >= 0) { X if (sparse_file(&fd, &finfo)) X finfo.f_flags |= F_SPARSE; X else X finfo.f_flags &= ~F_SPARSE; X close(fd); X } X#ifdef NDELAY X#undef O_NDELAY X#endif X#endif X if (is_sparse(info) != ((finfo.f_flags & F_SPARSE) != 0)) { X if (debug || verbose) { X fgtprintf(f, "%s: %s not sparse\n", X info->f_name, X is_sparse(info) ? "target":"source"); X } X diffs |= D_SPARS; X } X } X X if ((diffopts & D_SIZE) && !is_link(info) && X is_file(info) && is_file(&finfo) && X info->f_size != finfo.f_size) { X X diffs |= D_SIZE; X } X /* X * Rdev makes only sense with char & blk devices. X * Rdev is usually 0 for other special file types but at least X * the SunOS/Solaris 'tmpfs' has random values in rdev. X */ X if ((diffopts & D_RDEV) && is_dev(info) && is_dev(&finfo) && X info->f_rdev != finfo.f_rdev) { X diffs |= D_RDEV; X } X X /* X * XXX Wann geht das evt. mit Hardlinks CPIO, neues Tar.... X */ X if ((diffopts & D_DATA) && !is_meta(info) && X (info->f_rsize > (off_t)0 || !is_link(info)) && X is_file(info) && is_file(&finfo)) { X X /* avoid permission denied error */ X if (info->f_size > (off_t)0 && X info->f_size == finfo.f_size) { X if (!cmp_file(info)) { X diffs |= D_DATA; X } X do_void = FALSE; X } else if (info->f_size != finfo.f_size) { X diffs |= D_DATA; X do_void = TRUE; X } X } else { X do_void = TRUE; X } X X#ifdef USE_ACL X if (doacl && (diffopts & D_ACL)) { X if ((info->f_xflags & XF_ACL_ACCESS) != X (finfo.f_xflags & XF_ACL_ACCESS)) { X diffs |= D_ACL; X } else if ((info->f_xflags & XF_ACL_ACCESS) != 0) { X if (strcmp(info->f_acl_access, finfo.f_acl_access)) X diffs |= D_ACL; X } X if ((info->f_xflags & XF_ACL_DEFAULT) != X (finfo.f_xflags & XF_ACL_DEFAULT)) { X diffs |= D_ACL; X } else if ((info->f_xflags & XF_ACL_DEFAULT) != 0) { X if (strcmp(info->f_acl_default, finfo.f_acl_default)) X diffs |= D_ACL; X } X if ((info->f_xflags & XF_ACL_ACE) != X (finfo.f_xflags & XF_ACL_ACE)) { X diffs |= D_ACL; X } else if ((info->f_xflags & XF_ACL_ACE) != 0) { X if (strcmp(info->f_acl_ace, finfo.f_acl_ace)) X diffs |= D_ACL; X } X } X#endif X X#ifdef USE_XATTR X if (doxattr && (diffopts & D_XATTR)) { X if ((info->f_xflags & XF_XATTR) != X (finfo.f_xflags & XF_XATTR)) { X diffs |= D_XATTR; X } else if ((info->f_xflags & XF_XATTR) != 0) { X register star_xattr_t *x1 = info->f_xattr; X register star_xattr_t *x2 = finfo.f_xattr; X X for (; x1->name && x2->name; x1++, x2++) { X if (strcmp(x1->name, x2->name)) X break; X if (x1->value_len != x2->value_len) X break; X if (memcmp(x1->value, x2->value, x2->value_len)) X break; X } X if (x1->name || x2->name) X diffs |= D_XATTR; X } X } X#endif X X#ifdef USE_FFLAGS X if (dofflags && (diffopts & D_FFLAGS)) { X if (info->f_fflags != finfo.f_fflags) X diffs |= D_FFLAGS; X } X#endif X X if (diffs) { X if (errhidden(E_DIFF, info->f_name)) X goto out; X X if (tpath) { X fprintf(f, "%s\n", info->f_name); X } else { X fprintf(f, "%s: ", info->f_name); X prdiffopts(f, "different ", diffs); X } X } X X if (verbose && diffs) { X list_file(info); X list_file(&finfo); X } X if (diffs) X errabort(E_DIFF, info->f_name, TRUE); Xout: X if (do_void) X void_file(info); X} X XLOCAL BOOL Xlinkeql(n1, n2) X register char *n1; X register char *n2; X{ X FINFO l1info; X FINFO l2info; Xextern BOOL follow; X BOOL ofollow = follow; X X /* X * If the names are identical, return TRUE X */ X if (streql(n1, n2)) X return (TRUE); X /* X * Not equal if only one of both names is an abs. path name. X */ X if (*n1 != *n2 && (*n1 == '/' || *n2 == '/')) X return (FALSE); X /* X * If the names point to the same inode, return TRUE X */ X follow = TRUE; X if (_getinfo(n1, &l1info) && _getinfo(n2, &l2info)) { X follow = ofollow; X if (l1info.f_dev == l2info.f_dev && X l1info.f_ino == l2info.f_ino) { X return (TRUE); X } else { X return (FALSE); X } X } X follow = ofollow; X X return (patheql(n1, n2)); X} X XLOCAL BOOL Xpatheql(n1, n2) X register char *n1; X register char *n2; X{ X while (n1[0] == '.' && n1[1] == '/') { X n1 += 2; X while (n1[0] == '/') X n1++; X } X while (n2[0] == '.' && n2[1] == '/') { X n2 += 2; X while (n2[0] == '/') X n2++; X } X for (; n1[0] != '\0' && n2[0] != '\0'; n1++, n2++) { X if (n1[0] == '/') { X while (n1[1] == '.' && n1[2] == '/') { X n1 += 2; X while (n1[1] == '/') X n1++; X } X } X if (n2[0] == '/') { X while (n2[1] == '.' && n2[2] == '/') { X n2 += 2; X while (n2[1] == '/') X n2++; X } X } X if (n1[0] != n2[0]) X break; X } X return (n1[0] == n2[0]); X} X XLOCAL BOOL Xdirdiffs(f, info) X FILE *f; X FINFO *info; X{ X register char **ep1; /* Directory entry pointer array (arch) */ X register char **ep2 = 0; /* Directory entry pointer array (disk) */ X register char *dp2; /* Directory names string from disk */ X register char **oa = 0; /* Only in arch pointer array */ X register char **od = 0; /* Only on disk pointer array */ X register int i; X int ents1 = -1; X int ents2; X int dlen = 0; X int alen = 0; X BOOL diffs = FALSE; X DIR *dirp; X int err; X X /* X * Old archives had only one nul at the end X * xheader.c already increments info->f_dirlen in this case X * but a newline may appear to be the last char. X * Note that we receicve the space from the xheader X * extract buffer. X */ X i = info->f_dirlen; X if (info->f_dir[i-1] != '\0') X info->f_dir[i-1] = '\0'; /* Kill '\n' */ X X ep1 = sortdir(info->f_dir, &ents1); /* from archive */ X dirp = lopendir(info->f_name); X if (dirp == NULL) { X dp2 = NULL; X err = geterrno(); X } else { X dp2 = dfetchdir(dirp, info->f_name, &ents2, 0, NULL); X err = geterrno(); X closedir(dirp); X } X if (dp2 == NULL) { X diffs = TRUE; X errmsgno(err, "Cannot read dir '%s'.\n", info->f_name); X goto no_dircmp; X } X ep2 = sortdir(dp2, &ents2); /* from disk */ X X if (ents1 != ents2) { X if (debug || verbose > 2) { X fgtprintf(f, "Archive ents: %d Disk ents: %d '%s'\n", X ents1, ents2, info->f_name); X } X diffs = TRUE; X } X X if (cmpdir(ents1, ents2, ep1, ep2, NULL, NULL, &alen, &dlen) > 0) X diffs = TRUE; X X oa = ___malloc(alen * sizeof (char *), "dir diff array"); X od = ___malloc(dlen * sizeof (char *), "dir diff array"); X cmpdir(ents1, ents2, ep1, ep2, oa, od, &alen, &dlen); X X if (debug || verbose > 1) { X for (i = 0; i < dlen; i++) { X fgtprintf(f, "Only on disk '%s': '%s'\n", X info->f_name, od[i] + 1); X } X for (i = 0; i < alen; i++) { X fgtprintf(f, "Only in archive '%s': '%s'\n", X info->f_name, oa[i] + 1); X } X } X Xno_dircmp: X if (dp2) X free(dp2); X if (ep1) X free(ep1); X if (ep2) X free(ep2); X if (od) X free(od); X if (oa) X free(oa); X X return (diffs); X} X X#define vp_cmp_func ((int(*)__PR((void *, char *, int)))cmp_func) X XLOCAL int Xcmp_func(cmp, p, amount) X register cmp_t *cmp; X register char *p; X int amount; X{ X register int cnt; X X /* X * If we already found diffs we save time and only pass tape ... X */ X if (cmp->cmp_diffs) X return (amount); X X cnt = ffileread(cmp->cmp_file, cmp->cmp_buf, amount); X if (cnt != amount) X cmp->cmp_diffs++; X X if (cmpbytes(cmp->cmp_buf, p, cnt) < cnt) X cmp->cmp_diffs++; X return (cnt); X} X Xstatic char *diffbuf; X XLOCAL BOOL Xcmp_file(info) X FINFO *info; X{ X FILE *f; X cmp_t cmp; X X if (!diffbuf) { X /* X * If we have no diffbuf, we cannot diff - abort. X */ X diffbuf = ___malloc((size_t)bigsize, "diff buffer"); X#ifdef __notneeded X if (diffbuf == (char *)0) { X void_file(info); X return (FALSE); X } X#endif X } X X if ((f = lfilemopen(info->f_name, "rub", S_IRWALL)) == (FILE *)NULL) { X if (!errhidden(E_OPEN, info->f_name)) { X if (!errwarnonly(E_OPEN, info->f_name)) X xstats.s_openerrs++; X errmsg("Cannot open '%s'.\n", info->f_name); X (void) errabort(E_OPEN, info->f_name, TRUE); X } X void_file(info); X return (FALSE); X } else X file_raise(f, FALSE); X X if (is_sparse(info)) X return (cmp_sparse(f, info)); X X cmp.cmp_file = f; X cmp.cmp_buf = diffbuf; X cmp.cmp_diffs = 0; X if (xt_file(info, vp_cmp_func, &cmp, bigsize, "reading") < 0) X die(EX_BAD); X fclose(f); X return (cmp.cmp_diffs == 0); X} X XEXPORT void Xprdiffopts(f, label, flags) X FILE *f; X char *label; X int flags; X{ X int printed = 0; X X fprintf(f, "%s", label); X if (flags & D_PERM) X prdopt(f, "perm", printed++); X if (flags & D_SYMPERM) X prdopt(f, "symperm", printed++); X /* X * XXX Diff ACLs not yet implemented. X */ X if (flags & D_TYPE) X prdopt(f, "type", printed++); X if (flags & D_NLINK) X prdopt(f, "nlink", printed++); X if (flags & D_UID) X prdopt(f, "uid", printed++); X if (flags & D_GID) X prdopt(f, "gid", printed++); X if (flags & D_UNAME) X prdopt(f, "uname", printed++); X if (flags & D_GNAME) X prdopt(f, "gname", printed++); X if (flags & D_SIZE) X prdopt(f, "size", printed++); X if (flags & D_DATA) X prdopt(f, "data", printed++); X if (flags & D_RDEV) X prdopt(f, "rdev", printed++); X if (flags & D_HLINK) X prdopt(f, "hardlink", printed++); X if (flags & D_SLINK) X prdopt(f, "symlink", printed++); X if (flags & D_SLPATH) X prdopt(f, "sympath", printed++); X if (flags & D_SPARS) X prdopt(f, "sparse", printed++); X if (flags & D_ATIME) X prdopt(f, "atime", printed++); X if (flags & D_MTIME) X prdopt(f, "mtime", printed++); X if (flags & D_CTIME) X prdopt(f, "ctime", printed++); X if (flags & D_LMTIME) X prdopt(f, "lmtime", printed++); X if (flags & D_ANTIME) X prdopt(f, "ansecs", printed++); X if (flags & D_MNTIME) X prdopt(f, "mnsecs", printed++); X if (flags & D_CNTIME) X prdopt(f, "cnsecs", printed++); X if (flags & D_DIR) X prdopt(f, "dir", printed++); X#ifdef USE_ACL X if (flags & D_ACL) X prdopt(f, "acl", printed++); X#endif X#ifdef USE_XATTR X if (flags & D_XATTR) X prdopt(f, "xattr", printed++); X#endif X#ifdef USE_FFLAGS X if (flags & D_FFLAGS) X prdopt(f, "fflags", printed++); X#endif X fprintf(f, "\n"); X} X XLOCAL void Xprdopt(f, name, printed) X FILE *f; X char *name; X int printed; X{ X if (printed) X fprintf(f, ","); X fprintf(f, "%s", name); X} END-of-star-1.6/star/diff.c echo x - star-1.6/star/diff.h sed 's/^X//' >star-1.6/star/diff.h << 'END-of-star-1.6/star/diff.h' X/* @(#)diff.h 1.16 18/04/24 Copyright 1993-2018 J. Schilling */ X/* X * Definitions for the taylorable diff command X * X * Copyright (c) 1993-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _DIFF_H X#define _DIFF_H X X#ifdef __cplusplus Xextern "C" { X#endif X X#define D_PERM 0x000001 X#define D_TYPE 0x000002 X#define D_NLINK 0x000004 X#define D_SYMPERM 0x000008 X#define D_UID 0x000010 X#define D_GID 0x000020 X#define D_UNAME 0x000040 X#define D_GNAME 0x000080 X#define D_ID (D_UID|D_GID|D_UNAME|D_GNAME) X#define D_SIZE 0x000100 X#define D_DATA 0x000200 X#define D_RDEV 0x000400 X X#define D_UNUSED1 0x000800 X X#define D_HLINK 0x001000 X#define D_SLINK 0x002000 X#define D_SLPATH 0x004000 X#define D_SPARS 0x008000 X#define D_ATIME 0x010000 X#define D_MTIME 0x020000 X#define D_CTIME 0x040000 X#define D_TIMES (D_ATIME|D_MTIME|D_CTIME) X#define D_LMTIME 0x080000 X#define D_XTIMES (D_ATIME|D_MTIME|D_CTIME|D_LMTIME) X#define D_DIR 0x100000 X#define D_ACL 0x200000 X#define D_XATTR 0x400000 X#define D_FFLAGS 0x800000 X#define D_ANTIME 0x1000000 X#define D_MNTIME 0x2000000 X#define D_CNTIME 0x4000000 X#define D_MAX 0x80000000 X X/* X * Atime frequently changes, it makes no sense to check it by default. X * Mtime on symlinks cannot be copies, so do not check it too. X */ X#define D_DEFLT (~(D_SYMPERM|D_ATIME|D_LMTIME)) X#define D_ALL (~0L); X Xextern long diffopts; X X#ifdef __cplusplus X} X#endif X X#endif /* _DIFF_H */ END-of-star-1.6/star/diff.h echo x - star-1.6/star/dirtime.c sed 's/^X//' >star-1.6/star/dirtime.c << 'END-of-star-1.6/star/dirtime.c' X/* @(#)dirtime.c 1.34 18/08/31 Copyright 1988-2018 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)dirtime.c 1.34 18/08/31 Copyright 1988-2018 J. Schilling"; X#endif X/* X * Copyright (c) 1988-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X/* X * Save directories and its times on a stack and set the times, if the new name X * will not increase the depth of the directory stack. X * The final flush of the stack is caused by a zero length filename. X * X * A string will be sufficient for the names of the directory stack because X * all directories in a tree have a common prefix. A counter for each X * occurence of a slash '/' is the index into the array of times for the X * directory stack. Directories with unknown times have atime.tv_nsec == -1. X * X * If the order of the files on tape is not in an order that find(1) will X * produce, this algorithm is not guaranteed to work. This is the case with X * tapes that have been created with the -r option or with the list= option. X * X * The only alternative would be saving all directory times and setting them X * at the end of an extract. X * X * NOTE: I am not shure if degenerate filenames will fool this algorithm. X */ X#include /* includes needed for mode_t */ X#include X#include X#include X#define GT_COMERR /* #define comerr gtcomerr */ X#define GT_ERROR /* #define error gterror */ X#include X#include "star.h" X#include "xutimes.h" X#include "checkerr.h" X#include "dirtime.h" X#include "starsubs.h" X#include "pathname.h" X X#ifdef DEBUG Xextern BOOL debug; X#define EDBG(a) if (debug) error a X#else X#define EDBG(a) X#endif X X/* X * Maximum depth of directory nesting depends on availabe memory. X */ XLOCAL pathstore_t dirstack; X X#ifdef SET_CTIME X#define NT 3 XLOCAL struct timespec dottimes[NT] = { {-1, -1}, {-1, -1}, {-1, -1}}; X#else X#define NT 2 XLOCAL struct timespec dottimes[NT] = { -1, -1, -1, -1}; X#endif XLOCAL struct timespec badtime = { -1, -1}; X Xtypedef struct timespec timev[NT]; X XLOCAL pathstore_t dtps; XLOCAL int ndtimes; XLOCAL timev *dtimes; X XLOCAL mode_t dotmodes = _BAD_MODE; X XLOCAL pathstore_t dmps; XLOCAL int ndmodes; XLOCAL mode_t *dmodes; X X XLOCAL BOOL init_dirtimes __PR((void)); XLOCAL BOOL grow_dtimes __PR((int n)); XLOCAL BOOL grow_dmodes __PR((int n)); XEXPORT void sdirtimes __PR((char *name, FINFO *info, X BOOL do_times, BOOL do_mode)); XEXPORT void sdirmode __PR((char *name, mode_t mode)); XLOCAL void dirtimes __PR((char *name, struct timespec *tp, X mode_t mode)); XEXPORT void flushdirtimes __PR((void)); XLOCAL void flushdirstack __PR((char *, char *, int)); XLOCAL void setdirtime __PR((char *, struct timespec *)); X XLOCAL BOOL Xinit_dirtimes() X{ X /* X * First the path string X */ X if (init_pspace(PS_STDERR, &dirstack) < 0) X return (FALSE); X /* X * Now the time array X */ X if (!grow_dtimes(1)) X return (FALSE); X X /* X * Now the mode array X */ X if (!grow_dmodes(1)) X return (FALSE); X X return (TRUE); X} X XLOCAL BOOL Xgrow_dtimes(n) X int n; X{ X if ((n * sizeof (timev)) < ndtimes) X return (TRUE); X X /* X * Add 1 since "ndtimes" is the size of the array while "n" is the X * next array index to use. X */ X if (grow_pspace(PS_STDERR, &dtps, (n+1) * sizeof (timev)) < 0) { X return (FALSE); X } X X dtimes = (timev *)dtps.ps_path; X ndtimes = dtps.ps_size / sizeof (timev); X X return (TRUE); X} X XLOCAL BOOL Xgrow_dmodes(n) X int n; X{ X if ((n * sizeof (mode_t)) < ndmodes) X return (TRUE); X X /* X * Add 1 since "ndmodes" is the size of the array while "n" is the X * next array index to use. X */ X if (grow_pspace(PS_STDERR, &dmps, (n+1) * sizeof (mode_t)) < 0) { X return (FALSE); X } X X dmodes = (mode_t *)dmps.ps_path; X ndmodes = dmps.ps_size / sizeof (mode_t); X X return (TRUE); X} X X/* X * This is the standard method to enter time and mode values X * into the directory stack. X */ XEXPORT void Xsdirtimes(name, info, do_times, do_mode) X char *name; X FINFO *info; X BOOL do_times; X BOOL do_mode; X{ X struct timespec tp[NT]; X mode_t mode = _BAD_MODE; X X if (do_times) { X tp[0].tv_sec = info->f_atime; X tp[0].tv_nsec = info->f_ansec; X X tp[1].tv_sec = info->f_mtime; X tp[1].tv_nsec = info->f_mnsec; X#ifdef SET_CTIME X tp[2].tv_sec = info->f_ctime; X tp[2].tv_nsec = info->f_cnsec; X#endif X } else { X tp[0] = badtime; X tp[1] = badtime; X#ifdef SET_CTIME X tp[2] = badtime; X#endif X } X if (do_mode) { X mode = info->f_mode; X } X dirtimes(name, tp, mode); X} X X/* X * This is the method to enter mode values into the directory stack. X * It is only used to puch the umask value from _create_dirs(). X */ XEXPORT void X#ifdef PROTOTYPES Xsdirmode(char *name, mode_t mode) X#else Xsdirmode(name, mode) X char *name; X mode_t mode; X#endif X{ X struct timespec tp[NT]; X X tp[0] = badtime; X tp[1] = badtime; X#ifdef SET_CTIME X tp[2] = badtime; X#endif X dirtimes(name, tp, mode); X} X XLOCAL void X#ifdef PROTOTYPES Xdirtimes(char *name, struct timespec tp[NT], mode_t mode) X#else Xdirtimes(name, tp, mode) X char *name; X struct timespec tp[NT]; X mode_t mode; X#endif X{ X register char *dp = dirstack.ps_path; X register char *np = name; X register int idx = -1; X X if (dp == NULL) { X if (!init_dirtimes()) X return; X dp = dirstack.ps_path; X } X EDBG(("dirtimes('%s', %s", name, tp ? ctime(&tp[1].tv_sec):"NULL\n")); X X if (np[0] == '\0') { /* final flush */ X if (dotmodes != _BAD_MODE) { X EDBG(("setmode: '.' to 0%o\n", dotmodes)); X setdirmodes(".", dotmodes); X } X if (dottimes[0].tv_nsec != badtime.tv_nsec) X setdirtime(".", dottimes); X flushdirstack(dp, dp, -1); X return; X } X X if ((np[0] == '.' && np[1] == '/' && np[2] == '\0') || X (np[0] == '.' && np[1] == '\0')) { X dottimes[0] = tp[0]; X dottimes[1] = tp[1]; X#ifdef SET_CTIME X dottimes[2] = tp[2]; X#endif X dotmodes = mode; X } else { X size_t nlen; X X nlen = strlen(np); X if (nlen >= dirstack.ps_size) { X if (set_pspace(PS_STDERR, &dirstack, nlen+1) < 0) { X return; X } X dp = dirstack.ps_path; X } X X /* X * Find end of common part X */ X while (*dp == *np) { X if (*dp == '\0') X break; X if (*dp++ == '/') X ++idx; X np++; X } X /* X * Make sure that the ending '/' always stays in dirstack. X */ X if (*dp == '/' && *np == '\0') { X dp++; X ++idx; X } X EDBG(("DIR: '%.*s' DP: '%s' NP: '%s' idx: %d\n", X /* XXX Should not be > int */ X (int)(dp - dirstack.ps_path), X dirstack.ps_path, dp, np, idx)); X X if (*dp) { X /* X * New directory does not increase the depth of the X * directory stack. Flush all dirs below idx. X */ X flushdirstack(dirstack.ps_path, dp, idx); X } X X /* X * Put the new dir on the directory stack. X * First append the name component, then X * store times of "this" dir. X */ X while ((*dp = *np++) != '\0') { X if (*dp++ == '/') { X /* X * Disable times of unknown dirs. X */ X if (!grow_dtimes(++idx)) X return; X if (!grow_dmodes(idx)) X return; X EDBG(("zapping idx: %d\n", idx)); X dtimes[idx][0] = badtime; X dmodes[idx] = _BAD_MODE; X } else if (*np == '\0') { X /* X * Make sure the dirname always ends with '/'. X */ X *dp++ = '/'; X *dp = '\0'; X idx++; X } X } X if (tp) { X if (!grow_dtimes(idx)) X return; X if (!grow_dmodes(idx)) X return; X EDBG(("set idx %d '%s'\n", idx, name)); X dtimes[idx][0] = tp[0]; /* overwrite last atime */ X dtimes[idx][1] = tp[1]; /* overwrite last mtime */ X#ifdef SET_CTIME X dtimes[idx][2] = tp[2]; /* overwrite last ctime */ X#endif X dmodes[idx] = mode; X } X } X} X X/* X * Needed for on_comerr() as we cannot pass the needed parameters to dirtimes(). X */ XEXPORT void Xflushdirtimes() X{ X dirtimes("", (struct timespec *)0, (mode_t)0); X} X XLOCAL void Xflushdirstack(dirbase, dp, depth) X char *dirbase; X register char *dp; X register int depth; X{ X if (depth == -1 && dp == dirbase && dp[0] == '/') { X /* X * Flush the root dir, avoid flushing "". X */ X while (*dp == '/') X dp++; X if (dmodes[++depth] != _BAD_MODE) { X EDBG(("depth: %d setmode: '/' to 0%o\n", X depth, dmodes[depth])); X setdirmodes("/", dmodes[depth]); X } X if (dtimes[depth][0].tv_nsec != badtime.tv_nsec) { X EDBG(("depth: %d ", depth)); X setdirtime("/", dtimes[depth]); X } X } X /* X * The dirname always ends with a '/' (see above). X */ X while (*dp) { X if (*dp++ == '/') { X *--dp = '\0'; /* temporarily delete '/' */ X if (dmodes[++depth] != _BAD_MODE) { X EDBG(("depth: %d setmode: '%s' to 0%o\n", X depth, dirbase, dmodes[depth])); X setdirmodes(dirbase, dmodes[depth]); X } X if (dtimes[depth][0].tv_nsec != badtime.tv_nsec) { X EDBG(("depth: %d ", depth)); X setdirtime(dirbase, dtimes[depth]); X } X *dp++ = '/'; /* restore '/' */ X } X } X} X XLOCAL void Xsetdirtime(name, tp) X char *name; X struct timespec tp[NT]; X{ X EDBG(("settime: '%s' to %s", name, ctime(&tp[1].tv_sec))); X if (xutimes(name, tp, FALSE) < 0) { X if (!errhidden(E_SETTIME, name)) { X if (!errwarnonly(E_SETTIME, name)) X xstats.s_settime++; X errmsg("Can't set time on '%s'.\n", name); X (void) errabort(E_SETTIME, name, TRUE); X } X } X} END-of-star-1.6/star/dirtime.c echo x - star-1.6/star/dirtime.h sed 's/^X//' >star-1.6/star/dirtime.h << 'END-of-star-1.6/star/dirtime.h' X/* @(#)dirtime.h 1.8 18/06/20 Copyright 1996-2018 J. Schilling */ X/* X * Prototypes for dirtime users X * X * Copyright (c) 1996-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _DIRTIME_H X#define _DIRTIME_H X X#ifndef _STAR_H X#include "star.h" X#endif X X#ifdef __cplusplus Xextern "C" { X#endif X X/* X * dirtime.c X */ Xextern void sdirtimes __PR((char *name, FINFO *info, X BOOL do_times, BOOL do_mode)); Xextern void sdirmode __PR((char *name, mode_t mode)); Xextern void flushdirtimes __PR((void)); X X#ifdef __cplusplus X} X#endif X X#endif /* _DIRTIME_H */ END-of-star-1.6/star/dirtime.h echo x - star-1.6/star/dumpdate.c sed 's/^X//' >star-1.6/star/dumpdate.c << 'END-of-star-1.6/star/dumpdate.c' X/* @(#)dumpdate.c 1.32 19/01/19 Copyright 2003-2019 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)dumpdate.c 1.32 19/01/19 Copyright 2003-2019 J. Schilling"; X#endif X/* X * Copyright (c) 2003-2019 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X#include X#include X#define GT_COMERR /* #define comerr gtcomerr */ X#define GT_ERROR /* #define error gterror */ X#include X X#include "star.h" X#include "dumpdate.h" X#include "starsubs.h" X X#ifdef HAVE_LARGEFILES X/* X * XXX Hack until fseeko()/ftello() are available everywhere or until X * XXX we know a secure way to let autoconf ckeck for fseeko()/ftello() X * XXX without defining FILE_OFFSETBITS to 64 in confdefs.h X */ X#define fseek fseeko X#define ftell ftello X#endif X X#if defined(HAVE_FLOCK) || defined(HAVE_LOCKF) || defined(HAVE_FCNTL_LOCKF) X#define HAVE_LOCKING X#endif X X#ifndef HAVE_FLOCK X#ifdef HAVE_FCNTL_LOCKF XLOCAL struct flock __fl; X#define flock(fd, flag) (__fl.l_type = (flag), fcntl(fd, F_SETLKW, &__fl)) X/* X * #undef before as AIX has left over junk from a no longer existing flock() X */ X#undef LOCK_EX X#define LOCK_EX F_WRLCK X#undef LOCK_SH X#define LOCK_SH F_RDLCK X#undef LOCK_UN X#define LOCK_UN F_UNLCK X#else X#define flock(fd, flag) lockf(fd, flag, (off_t)0) X#define LOCK_EX F_LOCK X#define LOCK_SH F_LOCK X#define LOCK_UN F_ULOCK X#endif X#endif /* HAVE_FLOCK */ X X#ifndef HAVE_LOCKING X#undef flock X#define flock(fd, flag) (0) X#endif X XLOCAL dumpd_t *dumpdates; XLOCAL dumpd_t **dumptail = &dumpdates; X XEXPORT void initdumpdates __PR((char *fname, BOOL doupdate)); XLOCAL void readdumpdates __PR((FILE *f, char *fname)); XEXPORT void writedumpdates __PR((char *fname, const char *filesys, X int level, int dflags, X struct timespec *date)); XLOCAL void outentry __PR((FILE *f, char *name, int level, int dflags, X struct timespec *date)); XEXPORT char *dumpdate __PR((struct timespec *date)); XLOCAL char *skipwht __PR((char *p)); XLOCAL BOOL getentry __PR((char *line, char *fname)); XEXPORT BOOL getdumptime __PR((char *p, struct timespec *tvp)); XEXPORT dumpd_t *checkdumpdates __PR((const char *name, int level, int dflags)); XLOCAL dumpd_t *_checkdumpdates __PR((const char *name, int level, int dflags)); XEXPORT void adddumpdates __PR((const char *name, int level, int dflags, X struct timespec *date, X BOOL useold)); XLOCAL dumpd_t *newdumpdates __PR((const char *name, int level, int dflags, X struct timespec *date)); XLOCAL dumpd_t *freedumpdates __PR((dumpd_t *dp)); X XEXPORT void Xinitdumpdates(fname, doupdate) X char *fname; X BOOL doupdate; X{ X FILE *f; X X f = lfilemopen(fname, "r", S_IRWALL); X if (f == NULL) { X if (geterrno() == ENOENT) { X errmsg("Warning no %s.\n", fname); X return; X } X comerr("Cannot open %s.\n", fname); X /* NOTREACHED */ X } X if (doupdate && laccess(fname, W_OK) < 0) X comerr("Cannot access '%s' for update\n", fname); X X (void) flock(fdown(f), LOCK_SH); X readdumpdates(f, fname); X (void) flock(fdown(f), LOCK_UN); X fclose(f); X} X XLOCAL void Xreaddumpdates(f, fname) X FILE *f; X char *fname; X{ X char buf[4096]; X int line = 0; X X while (fgetline(f, buf, sizeof (buf)) >= 0) { X line++; X X if (!getentry(buf, fname)) { X if (*skipwht(buf) != '\0') { X errmsgno(EX_BAD, X "Unknown format in '%s' line %d\n", X fname, line); X } X continue; X } X } X} X XEXPORT void Xwritedumpdates(fname, filesys, level, dflags, date) X char *fname; X const char *filesys; X int level; X int dflags; X struct timespec *date; X{ X FILE *f; X dumpd_t *dp; X off_t fsize; X off_t fpos; X X f = lfilemopen(fname, "rwc", S_IRWALL); X if (f == NULL) { X errmsg("Cannot open '%s'.\n", fname); X return; X } X (void) flock(fdown(f), LOCK_EX); X X for (dp = dumpdates; dp; dp = freedumpdates(dp)) X ; X dumpdates = NULL; X dumptail = &dumpdates; X X readdumpdates(f, fname); X adddumpdates(filesys, level, dflags, date, TRUE); /* Upd. curr. entry */ X fseek(f, 0L, SEEK_SET); X X fsize = filesize(f); X for (dp = dumpdates; dp; dp = dp->dd_next) { X outentry(f, dp->dd_name, dp->dd_level, X dp->dd_flags, &dp->dd_date); X } X fflush(f); X fpos = filepos(f); X#ifdef HAVE_FTRUNCATE X if (fpos < fsize) X ftruncate(fdown(f), fpos); X#else X while (fpos++ < fsize) X putc(' ', f); X#endif X X (void) flock(fdown(f), LOCK_UN); X fclose(f); X error("Dump record level %d%s dump: %s written\n", X level, (dflags & DD_PARTIAL) ? "P":" ", X dumpdate(date)); X} X XLOCAL void Xoutentry(f, name, level, dflags, date) X FILE *f; X char *name; X int level; X int dflags; X struct timespec *date; X{ X int len; X time_t t = date->tv_sec; /* FreeBSD/MacOS X -> broken tv_sec/time_t */ X X len = strlen(name); X if ((len % 8) == 0) X len += 8; X len += 7; X len &= ~7; X len = 41 -len; X if (len < 1) X len = 1; X X fprintf(f, "%s\t%*s%2d%s %10lld.%9.9lld %s", X name, X len, X "", X level, X (dflags & DD_PARTIAL) ? "P":"", X (Llong)date->tv_sec, X (Llong)date->tv_nsec, X ctime(&t)); X} X XEXPORT char * Xdumpdate(date) X struct timespec *date; X{ X char *p; X time_t t = date->tv_sec; /* FreeBSD/MacOS X -> broken tv_sec/time_t */ X X if (date->tv_sec == 0) X return ("the epoch"); X p = ctime(&t); X p[24] = '\0'; X return (p); X} X XLOCAL char * Xskipwht(p) X char *p; X{ X while (*p && (*p == ' ' || *p == '\t')) X p++; X X return (p); X} X XLOCAL BOOL Xgetentry(line, fname) X char *line; X char *fname; X{ X char *p; X int level; X int dflags = 0; X struct timespec tdate; X X p = line; X do { X p = strchr(++p, '\t'); X } while (p && p[0] != '\0' && p[1] != ' '); X X if (p == NULL || p[0] == '\0') { X errmsgno(EX_BAD, "Error parsing mount point in '%s'\n", fname); X return (FALSE); X } X *p++ = '\0'; X X p = skipwht(p); X p = astoi(p, &level); X if (*p == 'P') { X dflags |= DD_PARTIAL; X p++; X } X if (*p != ' ') { X errmsgno(EX_BAD, "Error parsing dump level in '%s'\n", fname); X return (FALSE); X } X p = skipwht(p); X if (!getdumptime(p, &tdate)) X return (FALSE); X adddumpdates(line, level, dflags, &tdate, FALSE); X X return (TRUE); X} X XEXPORT BOOL Xgetdumptime(p, tvp) X char *p; X struct timespec *tvp; X{ X Llong date; X Llong dfrac = 0; X X p = astollb(p, &date, 10); X if (*p == '.') { X int l; X char *s = ++p; X X p = astollb(s, &dfrac, 10); X l = p - s; X if (l > 9) { /* Number too big, limit to nsec */ X char *p2 = p; X X l = s[9]; X s[9] = '\0'; X p = astollb(s, &dfrac, 10); X s[9] = l; X l = p - s; X p = p2; X } X while (l < 9) { /* Convert to nsecs */ X dfrac *= 10; X l++; X } X while (l > 9) { /* Convert to nsecs */ X dfrac /= 10; X l--; X } X } X if (*p != ' ' && *p != '\0') { X errmsgno(EX_BAD, "Error parsing dump date\n"); X return (FALSE); X } X tvp->tv_sec = date; X tvp->tv_nsec = dfrac; X return (TRUE); X} X XEXPORT dumpd_t * Xcheckdumpdates(name, level, dflags) X const char *name; X int level; X int dflags; X{ X dumpd_t *rp = NULL; X dumpd_t *rp2 = NULL; X X rp = _checkdumpdates(name, level, dflags & ~DD_CUMULATIVE); X rp2 = _checkdumpdates(name, level, dflags); X X if (rp && rp2 && (rp2->dd_date.tv_sec > rp->dd_date.tv_sec)) X return (rp2); X return (rp); X} X XLOCAL dumpd_t * X_checkdumpdates(name, level, dflags) X const char *name; X int level; X int dflags; X{ X dumpd_t *dp = dumpdates; X dumpd_t *rp = NULL; X X for (; dp; dp = dp->dd_next) { X if (!streql(name, dp->dd_name)) X continue; X if ((dp->dd_flags & DD_PARTIAL) != (dflags & DD_PARTIAL)) X continue; X if ((dflags & DD_CUMULATIVE) && level == dp->dd_level) { X rp = dp; X break; X } X /* X * We are not interested in tardump entries for X * this level or higher, so skip them. X */ X if (level <= dp->dd_level) X continue; X X /* X * If we did already find a more recent entry in tardumps X * we consider this one outdated. X */ X if (rp && rp->dd_date.tv_sec > dp->dd_date.tv_sec) X continue; X rp = dp; X } X#ifdef DEBUG X if (rp) X outentry(stderr, rp->dd_name, rp->dd_level, rp->dd_flags, &rp->dd_date); X#endif X return (rp); X} X XEXPORT void Xadddumpdates(name, level, dflags, date, useold) X const char *name; X int level; X int dflags; X struct timespec *date; X BOOL useold; X{ X dumpd_t *dp = dumpdates; X X for (; dp; dp = dp->dd_next) { X if (streql(name, dp->dd_name) && level == dp->dd_level && X (dp->dd_flags & DD_PARTIAL) == (dflags & DD_PARTIAL)) { X if (useold) { X dp->dd_date = *date; X return; X } X errmsgno(EX_BAD, X "Duplicate tardumps entry '%s %d%s %lld'.\n", X dp->dd_name, dp->dd_level, X (dflags & DD_PARTIAL) ? "P":"", X (Llong)dp->dd_date.tv_sec); X X if (date->tv_sec == dp->dd_date.tv_sec) X return; X comerrno(EX_BAD, "Timestamps differs - aborting.\n"); X } X } X dp = newdumpdates(name, level, dflags, date); X *dumptail = dp; X dumptail = &dp->dd_next; X} X XLOCAL dumpd_t * Xnewdumpdates(name, level, dflags, date) X const char *name; X int level; X int dflags; X struct timespec *date; X{ X dumpd_t *dp; X X dp = ___malloc(sizeof (*dp), "tardumps entry"); X dp->dd_next = NULL; X dp->dd_name = ___savestr(name); X dp->dd_level = level; X dp->dd_flags = dflags; X dp->dd_date = *date; X X return (dp); X} X XLOCAL dumpd_t * Xfreedumpdates(dp) X dumpd_t *dp; X{ X dumpd_t *next = dp->dd_next; X X free(dp->dd_name); X free(dp); X X return (next); X} END-of-star-1.6/star/dumpdate.c echo x - star-1.6/star/dumpdate.h sed 's/^X//' >star-1.6/star/dumpdate.h << 'END-of-star-1.6/star/dumpdate.h' X/* @(#)dumpdate.h 1.15 18/10/21 Copyright 2003-2018 J. Schilling */ X/* X * Copyright (c) 2003-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef DUMPDATE_H X#define DUMPDATE_H X X#ifndef _SCHILY_TIME_H X#include X#endif X#ifndef _SCHILY_UTYPES_H X#include X#endif X Xtypedef struct dumpdates dumpd_t; X Xstruct dumpdates { X dumpd_t *dd_next; X char *dd_name; X int dd_level; X struct timespec dd_date; X Uchar dd_flags; X}; X X/* X * Definitions for the dumpdates 'flags'. X */ X#define DD_PARTIAL 0x01 /* Dump is partial */ X#define DD_CUMULATIVE 0x02 /* Dump is cumulative to same level */ X X Xextern void initdumpdates __PR((char *fname, BOOL doupdate)); Xextern void writedumpdates __PR((char *fname, const char *name, X int level, int dflags, X struct timespec *date)); Xextern char *dumpdate __PR((struct timespec *date)); Xextern BOOL getdumptime __PR((char *p, struct timespec *tvp)); Xextern dumpd_t *checkdumpdates __PR((const char *name, int level, int dflags)); Xextern void adddumpdates __PR((const char *name, int level, int dflags, X struct timespec *date, X BOOL useold)); X X#endif END-of-star-1.6/star/dumpdate.h echo x - star-1.6/star/extract.c sed 's/^X//' >star-1.6/star/extract.c << 'END-of-star-1.6/star/extract.c' X/* @(#)extract.c 1.165 19/01/16 Copyright 1985-2019 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)extract.c 1.165 19/01/16 Copyright 1985-2019 J. Schilling"; X#endif X/* X * extract files from archive X * X * Copyright (c) 1985-2019 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include "star.h" X#include "props.h" X#include "table.h" X#include /* XXX Wegen S_IFLNK */ X#include X#include X#include X#include /* For __fjmalloc() */ X#define GT_COMERR /* #define comerr gtcomerr */ X#define GT_ERROR /* #define error gterror */ X#include X#include X#include X#ifdef USE_FIND X#include X#endif X X#ifdef JOS X#define mkdir makedir X#endif X#include "dirtime.h" X#include "restore.h" X#include "starsubs.h" X#include "checkerr.h" X#include X X#define ROOT_UID 0 X X#if defined(ENOTEMPTY) && ENOTEMPTY != EEXIST X#define is_eexist(err) ((err) == EEXIST || (err) == ENOTEMPTY) X#else X#define is_eexist(err) ((err) == EEXIST) X#endif X#if defined(EMISSDIR) X#define is_enoent(err) ((err) == ENOENT || (err) == EMISSDIR) X#else X#define is_enoent(err) ((err) == ENOENT) X#endif X#if defined(ELOOP) X#define is_eloop(err) ((err) == ELOOP) X#else X#define is_eloop(err) (FALSE) X#endif X X/* X * Used for _make_copy()/make_copies()/copy_file() X */ X#define HIDE_ENOENT 0x01 X X/* X * Used by the what paramater of same_file() X */ X#define IS_COPY 0 X#define IS_LINK 1 X Xextern FILE *vpr; X Xextern char *listfile; X Xextern int bufsize; Xextern char *bigptr; X Xextern uid_t dir_uid; Xextern gid_t dir_gid; Xextern uid_t my_uid; Xextern BOOL no_fsync; Xextern BOOL havepat; Xextern dev_t curfs; Xextern int xdebug; Xextern int verbose; Xextern BOOL prblockno; Xextern BOOL nflag; Xextern BOOL interactive; Xextern BOOL noxdir; Xextern BOOL follow; Xextern BOOL paxfollow; Xextern BOOL nospec; Xextern BOOL xdir; Xextern BOOL xdot; Xextern BOOL uncond; Xextern BOOL uncond_rename; Xextern BOOL keep_old; Xextern BOOL refresh_old; Xextern BOOL abs_path; Xextern BOOL allow_dotdot; Xextern BOOL secure_links; Xextern BOOL nowarn; Xextern BOOL force_hole; Xextern BOOL to_stdout; Xextern BOOL force_remove; Xextern BOOL remove_first; Xextern BOOL remove_recursive; Xextern BOOL do_install; Xextern BOOL copyhardlinks; Xextern BOOL copysymlinks; Xextern BOOL copydlinks; Xextern BOOL hardlinks; Xextern BOOL symlinks; Xextern BOOL dorestore; Xextern BOOL dometa; Xextern BOOL xmeta; Xextern BOOL lowmem; Xextern BOOL do_subst; X#ifdef USE_SELINUX Xextern BOOL selinux_enabled; X#endif X X#ifdef USE_FIND Xextern BOOL dofind; X#endif X XLOCAL void init_umask __PR((void)); XEXPORT void extract __PR((char *vhname)); XEXPORT BOOL extracti __PR((FINFO *info, imap_t *imp)); XEXPORT BOOL newer __PR((FINFO *info, FINFO *cinfo)); XEXPORT BOOL same_symlink __PR((FINFO *info)); XLOCAL BOOL _create_dirs __PR((char *name)); XLOCAL void _dir_setownwer __PR((char *name)); XEXPORT BOOL create_dirs __PR((char *name)); XEXPORT BOOL make_adir __PR((FINFO *info)); XLOCAL BOOL make_dir __PR((FINFO *info)); XLOCAL BOOL make_link __PR((FINFO *info)); XLOCAL BOOL make_symlink __PR((FINFO *info)); XLOCAL BOOL emul_symlink __PR((FINFO *info)); XLOCAL BOOL emul_link __PR((FINFO *info)); XLOCAL BOOL same_file __PR((FINFO *info, int what, BOOL do_follow)); XLOCAL BOOL make_copy __PR((FINFO *info, BOOL do_symlink, int eflags)); X#ifdef COPY_LINKS_DELAYED XLOCAL void add_copy __PR((FINFO *info, BOOL do_symlink)); XLOCAL void make_copies __PR((void)); XLOCAL BOOL _make_dcopy __PR((FINFO *info, BOOL do_symlink, int *retp, int eflags)); X#endif XLOCAL BOOL _make_copy __PR((FINFO *info, BOOL do_symlink, int eflags)); XLOCAL int copy_file __PR((char *from, char *to, BOOL do_symlink, int eflags)); XLOCAL BOOL make_fifo __PR((FINFO *info)); XLOCAL BOOL make_special __PR((FINFO *info)); XLOCAL BOOL file_tmpname __PR((FINFO *info, pathstore_t *path)); XLOCAL FILE *file_open __PR((FINFO *info, char *name)); XLOCAL BOOL get_file __PR((FINFO *info)); XLOCAL BOOL install_rename __PR((FINFO *info, char *xname)); XLOCAL BOOL name_exists __PR((char *name)); XLOCAL void remove_tmpname __PR((char *name)); XLOCAL BOOL get_ofile __PR((FILE *f, FINFO *info)); XLOCAL int void_func __PR((void *vp, char *p, int amount)); XEXPORT BOOL void_file __PR((FINFO * info)); XLOCAL BOOL void_bad __PR((FINFO * info)); XEXPORT int xt_file __PR((FINFO * info, X int (*)(void *, char *, int), X void *arg, int amt, char *text)); XEXPORT void skip_slash __PR((FINFO * info)); XLOCAL BOOL has_dotdot __PR((char *name)); XLOCAL BOOL inside_tree __PR((FINFO * info)); X X#ifdef COPY_LINKS_DELAYED Xtypedef struct _mcq { X struct _mcq *next; X FINFO info; X BOOL do_symlink; X} MCQ; X XLOCAL MCQ *mcq_1st = NULL; XLOCAL MCQ *mcq_last = NULL; X X#endif X X/* X * This is used to allow extracting archives as non root when they X * contain read only directories. It tries to stay as close as possible X * to the user's umask when creating intermediate directories. X * We do not modify the umask in a way that would even grant unepected X * permissions to others for a short time. X */ XLOCAL mode_t old_umask; XLOCAL mode_t mode_mask; X X#define PERM_BITS (S_IRWXU|S_IRWXG|S_IRWXO) /* u/g/o basic perm */ X XLOCAL void Xinit_umask() X{ X old_umask = umask((mode_t)0); X mode_mask = PERM_BITS & ~old_umask; X if (my_uid != ROOT_UID) X umask(old_umask & ~S_IRWXU); X else X umask(old_umask); X} X XEXPORT void Xextract(vhname) X char *vhname; X{ X#ifdef USE_FIND Xextern struct WALK walkstate; X#endif X FINFO finfo; X TCB tb; X register TCB *ptb = &tb; X BOOL restore_init = FALSE; X imap_t *imp = NULL; X X init_umask(); /* Needed to extract read only directories */ X X if (dorestore) /* With incremental restore, we need to open */ X sym_open(NULL); /* the 'star-symtable' first. */ X X fillbytes((char *)&finfo, sizeof (finfo), '\0'); X X if (init_pspace(PS_STDERR, &finfo.f_pname) < 0) X return; X if (init_pspace(PS_STDERR, &finfo.f_plname) < 0) X return; X X#ifdef USE_FIND X if (dofind) { X walkopen(&walkstate); X walkgethome(&walkstate); /* Needed in case we chdir */ X } X#endif X finfo.f_tcb = ptb; X for (;;) { X if (get_tcb(ptb) == EOF) X break; X finfo.f_name = finfo.f_pname.ps_path; X finfo.f_lname = finfo.f_plname.ps_path; X if (tcb_to_info(ptb, &finfo) == EOF) X break; X if (xdebug > 0) X dump_info(&finfo); X if (prblockno) X (void) tblocks(); /* set curblockno */ X X if (is_volhdr(&finfo)) { X if (!get_volhdr(&finfo, vhname)) { X excomerrno(EX_BAD, X "Volume Header '%s' does not match '%s'.\n", X finfo.f_name, vhname); X } X void_file(&finfo); X continue; X } X#ifdef USE_FIND X if (dofind && !findinfo(&finfo)) { X void_file(&finfo); X continue; X } X#endif X if (finfo.f_flags & F_BAD_META) { X if (!void_bad(&finfo)) X break; X continue; X } X X if (!abs_path && /* XXX VVV siehe skip_slash() */ X (finfo.f_name[0] == '/' /* || finfo.f_lname[0] == '/'*/)) X skip_slash(&finfo); X X if (dorestore) { X extern GINFO *grip; /* Global read info pointer */ X X if (!restore_init) { X curfs = finfo.f_dev; X sym_init(grip); X restore_init = TRUE; X } X X imp = sym_addrec(&finfo); X if (is_dir(&finfo) && grip->dumplevel > 0) X imp = sym_dirprepare(&finfo, imp); X } X X#ifdef USE_SELINUX X if (!to_stdout && selinux_enabled) { X /* X * Set up security context for next file. X */ X if (!setselinux(&finfo)) X xstats.s_selinuxerrs++; X } X#endif X /* X * Special treatment for the idiosyncratic way of dealing with X * hard links in the SVr4 CRC cpio archive format. X * The link count is handled by calling read_link() in X * cpiotcb_to_info() before. X */ X if ((props.pr_flags & PR_SV_CPIO_LINKS) != 0 && X !is_dir(&finfo) && X (is_link(&finfo) || finfo.f_nlink > 1)) { X if (!last_cpio_link(&finfo)) /* Ign. all but last */ X continue; X if (xcpio_link(&finfo)) /* Now extract all */ X continue; X } X extracti(&finfo, imp); X } X#ifdef USE_FIND X if (dofind) { X walkhome(&walkstate); X walkclose(&walkstate); X free(walkstate.twprivate); X } X#endif X X#ifdef COPY_LINKS_DELAYED X if (copyhardlinks || copysymlinks) X make_copies(); X#endif X flushdirtimes(); /* Flush directory stack */ X if (dorestore) X sym_close(); X} X X/* X * Extract one file from archive X */ XEXPORT BOOL Xextracti(info, imp) X FINFO *info; X imap_t *imp; X{ X FINFO cinfo; X TCB tb; X register TCB *ptb = &tb; X char *name = info->f_name; X X if (listfile && !hash_lookup(info->f_name)) { X void_file(info); X return (FALSE); X } X if (hash_xlookup(info->f_name)) { X void_file(info); X return (FALSE); X } X if (havepat && !match(info->f_name)) { X void_file(info); X return (FALSE); X } X if (!is_file(info) && to_stdout) { X void_file(info); X return (FALSE); X } X if (is_special(info) && nospec) { X if (!errhidden(E_SPECIALFILE, info->f_name)) { X if (!errwarnonly(E_SPECIALFILE, info->f_name)) X xstats.s_isspecial++; X errmsgno(EX_BAD, X "'%s' is not a file. Not created.\n", X info->f_name); X (void) errabort(E_SPECIALFILE, info->f_name, TRUE); X } X void_file(info); X return (FALSE); X } X /* X * If uncond is set and neither keep_old nor refresh_old is set, X * then newer() doesn't call getinfo(&cinfo). X * As newer() calls getinfo(&cinfo), it also checks for refresh_old. X */ X if (!uncond_rename) { X /* X * -uncond-rename was not specified, so check whether newer. X */ X if (newer(info, &cinfo) && !(xdir && is_dir(info))) { X void_file(info); X return (FALSE); X } X if (is_symlink(info) && same_symlink(info)) { X void_file(info); X return (FALSE); X } X } X /* X * Name substitution and interactive name changing need to happen before X * we check whether the file is newer than an existing file of the same X * name in the filesystem. X */ X if (do_subst && subst(info)) { X if (info->f_name[0] == '\0') { X /* X * Changed to empty name: skip... X */ X if (verbose) X fgtprintf(vpr, X "'%s' substitutes to null string, skipping ...\n", X name); X void_file(info); X return (FALSE); X } X /* X * Changed name to a probably existing file, X * check whether file in archive is newer. X */ X if (newer(info, &cinfo) && !(xdir && is_dir(info))) { X void_file(info); X return (FALSE); X } X if (is_symlink(info) && same_symlink(info)) { X void_file(info); X return (FALSE); X } X } X if (interactive && !ia_change(ptb, info)) { X if (!nflag) X fgtprintf(vpr, "Skipping ...\n"); X void_file(info); X return (FALSE); X } X /* X * If uncond is set and neither keep_old nor refresh_old is set, X * then newer() doesn't call getinfo(&cinfo). X * As newer() calls getinfo(&cinfo), it also checks for refresh_old. X */ X if (uncond_rename) { X /* X * -uncond-rename was specified X * If the file was not renamed we now need to check whether X * the file in the archive is newer than the file with the X * new name on disk. X */ X if (newer(info, &cinfo) && !(xdir && is_dir(info))) { X void_file(info); X return (FALSE); X } X if (is_symlink(info) && same_symlink(info)) { X void_file(info); X return (FALSE); X } X } X if (!(interactive || allow_dotdot) && has_dotdot(info->f_name)) { X if (!errhidden(E_SECURITY, info->f_name)) { X if (!errwarnonly(E_SECURITY, info->f_name)) X xstats.s_security++; X errmsgno(EX_BAD, X "'%s' contains '..', skipping ...\n", info->f_name); X (void) errabort(E_SECURITY, info->f_name, TRUE); X } X void_file(info); X return (FALSE); X } X if (secure_links && (is_link(info) || is_symlink(info)) && X (info->f_lname[0] == '/' || has_dotdot(info->f_lname))) { X if (info->f_lname[0] != '/') { X /* X * Absolute paths are always a problem, but symlinks X * should be allowed as long as they do not point X * outside the current tree. X */ X if (inside_tree(info)) X goto link_ok; X } X if (!errhidden(E_LSECURITY, info->f_lname)) { X if (!errwarnonly(E_LSECURITY, info->f_lname)) X xstats.s_lsecurity++; X errmsgno(EX_BAD, X "'%s' potentially insecure link, skipping ...\n", info->f_name); X (void) errabort(E_LSECURITY, info->f_lname, TRUE); X } X void_file(info); X return (FALSE); X } Xlink_ok: X vprint(info); X if (dorestore) { X /* X * Check whether the target file exists and has a X * different type or is a dev node with different X * major/minor numbers. In this case, we need to X * remove the file. This happend when the original X * file has been removed and a new (different) file X * with the same name did get the same inode number. X */ X imp = sym_typecheck(info, &cinfo, imp); X X } else if (remove_first && !dometa) { X /* X * With keep_old we do not come here. X * X * Even if the archive and the current node are both X * directories call remove_file() because the new dir X * may get our ownership this way if we are not root. X * X * In order to avoid annoying messages, call remove_file() X * only if the file exists. X */ X if (name_exists(info->f_name)) X (void) remove_file(info->f_name, TRUE); X } X if (is_dir(info)) { X#ifdef MKD_DEBUG X { extern char *mkdwhy; mkdwhy = "extract"; } X#endif X if (!make_adir(info)) { X void_file(info); X return (FALSE); X } X void_file(info); X } else if (is_link(info)) { X if (!make_link(info)) { X void_file(info); X return (FALSE); X } X void_file(info); X } else if (is_symlink(info)) { X if (dorestore && imp) { X /* X * Do not create a new link if the old one is the same. X */ X if (cinfo.f_rxftype != XT_NONE && (cinfo.f_flags & F_SAME)) X goto set_modes; X } X if (!make_symlink(info)) { X void_file(info); X return (FALSE); X } X void_file(info); X } else if (is_special(info)) { X if (dorestore && imp) { X /* X * Do not create a new node if the old one is the same. X */ X if (cinfo.f_rxftype != XT_NONE && (cinfo.f_flags & F_SAME)) X goto set_modes; X } X if (is_door(info)) { X if (!nowarn) { X errmsgno(EX_BAD, X "WARNING: Extracting door '%s' as plain file.\n", X info->f_name); X } X if (!get_file(info)) X return (FALSE); X } else if (is_fifo(info)) { X if (!make_fifo(info)) { X void_file(info); X return (FALSE); X } X void_file(info); X } else { X if (!make_special(info)) { X void_file(info); X return (FALSE); X } X void_file(info); X } X } else if (is_meta(info)) { X FINFO finfo; X X /* X * Make sure not to overwrite existing files. X */ X if (xmeta && !_getinfo(info->f_name, &finfo)) { X if (!get_file(info)) X return (FALSE); X } else { X void_file(info); X } X } else if (!get_file(info)) { X return (FALSE); X } X X#ifdef COPY_LINKS_DELAYED X if ((copyhardlinks && is_link(info)) || X (copysymlinks && is_symlink(info))) X return (TRUE); X#endif Xset_modes: X if (!to_stdout) X setmodes(info); X#ifdef TEST_DEBUG Xif (info->f_mode == 0700) Xerror("-->setmode(%s, %llo)\n", info->f_name, (Ullong)info->f_mode); X#endif X if (dorestore) X sym_addstat(info, imp); X return (TRUE); X} X X/* X * Return TRUE if the file on disk is newer than the file on the archive. X */ XEXPORT BOOL Xnewer(info, cinfo) X FINFO *info; /* The FINFO for the file in the archive */ X FINFO *cinfo; /* The FINFO for the file in the file system */ X{ X BOOL havenano; X X if (uncond && !keep_old && !refresh_old) X return (FALSE); X if (!_getinfo(info->f_name, cinfo)) { X if (refresh_old) { X errmsgno(EX_BAD, "file '%s' does not exists.\n", info->f_name); X return (TRUE); X } X return (FALSE); X } X if (keep_old) { X if (!nowarn) X errmsgno(EX_BAD, "file '%s' exists.\n", info->f_name); X return (TRUE); X } X if (uncond) X return (FALSE); X X if (xdot) { X if (info->f_name[0] == '.' && X (info->f_name[1] == '\0' || X (info->f_name[1] == '/' && X info->f_name[2] == '\0'))) { X X return (FALSE); X } X } X X /* X * nsec beachten wenn im Archiv! X */ X havenano = (info->f_xflags & XF_MTIME) && (cinfo->f_flags & F_NSECS); X if ((cinfo->f_mtime > info->f_mtime) || X (!havenano && cinfo->f_mtime == info->f_mtime)) { X X isnewer: X if (xdir && is_dir(info)) /* Be silent, we handle it later */ X return (TRUE); X if (!nowarn) X errmsgno(EX_BAD, "current '%s' newer.\n", info->f_name); X return (TRUE); X } else if ((cinfo->f_mtime == info->f_mtime) && havenano) { X /* X * If we have nanoseconds != 0, this cannot be a DOS file and X * for this reason, the f_mtime resolution is one second. X * An archive with nanosecond resolution and a filesystem with X * microsecond resolution could result in a file in the archive X * that is always newer than the file in the filesystem because X * the timestamp in the filesystem was rounded down. If the X * nanoseconds in the local file are greater than in the X * archive, this is the easy case. X */ X if (cinfo->f_mnsec >= info->f_mnsec) X goto isnewer; X /* X * If the local filesystem resolution is only microseconds and X * the resolution in the archive is nanoseconds, we need to X * check based on microseconds to prevent extracting the X * file from the archive again and again. X */ X if ((cinfo->f_mnsec % 1000 == 0) && X ((cinfo->f_mnsec / 1000) >= (info->f_mnsec / 1000))) X goto isnewer; X } else if ((cinfo->f_mtime % 2) == 0 && (cinfo->f_mtime + 1) == info->f_mtime) { X /* X * The DOS FAT filestem does only support a time granularity X * of 2 seconds. So we need to be a bit more generous. X * XXX We should be able to test the filesytem type. X */ X goto isnewer; X } X return (FALSE); X} X XEXPORT BOOL Xsame_symlink(info) X FINFO *info; X{ X FINFO finfo; X char lname[PATH_MAX+1]; /* This limit cannot be overruled */ X TCB tb; X X finfo.f_lname = lname; X finfo.f_lnamelen = 0; X X if (uncond || !_getinfo(info->f_name, &finfo)) X return (FALSE); X X /* X * Bei symlinks gehen nicht: lchmod lchtime & teilweise lchown X */ X#ifdef S_IFLNK X if (!is_symlink(&finfo)) /* File on disk */ X return (FALSE); X X fillbytes(&tb, sizeof (TCB), '\0'); X info_to_tcb(&finfo, &tb); /* XXX ist das noch nötig ??? */ X /* z.Zt. wegen linkflag/uname/gname */ X X if (read_symlink(info->f_name, info->f_name, &finfo, &tb)) { X if (streql(info->f_lname, finfo.f_lname)) { X if (!nowarn) X errmsgno(EX_BAD, "current '%s' is same symlink.\n", X info->f_name); X return (TRUE); X } X } X#ifdef XXX X /* X * XXX nsec beachten wenn im Archiv! X */ X if (finfo.f_mtime >= info->f_mtime) { X if (!nowarn) X errmsgno(EX_BAD, "current '%s' newer.\n", info->f_name); X return (TRUE); X } X#endif /* XXX */ X X#endif X return (FALSE); X} X XEXPORT BOOL Xsame_special(info) X FINFO *info; X{ X FINFO finfo; X X if (uncond || !_getinfo(info->f_name, &finfo)) X return (FALSE); X X if (info->f_xftype != finfo.f_xftype) X return (FALSE); X X if (is_bdev(info) || is_cdev(info)) { X if (info->f_rdevmaj != finfo.f_rdevmaj) X return (FALSE); X if (info->f_rdevmin != finfo.f_rdevmin) X return (FALSE); X } X return (TRUE); X} X X/* X * Create intermediate directories. X * If the user is not root and the umask is degenerated or read-only, X * we add 0700 to the granted permissions. For this reason, we may need X * to correct the permissins of intermediate directories later from the X * directory stack. X */ XLOCAL BOOL X_create_dirs(name) X register char *name; X{ X mode_t mode; X X mode = mode_mask; /* used to be 0777 */ X if (my_uid != ROOT_UID) X mode |= S_IRWXU; /* Make sure we will be able write */ X X if (lmkdir(name, mode) < 0) { X if (create_dirs(name) && X lmkdir(name, mode) >= 0) { X _dir_setownwer(name); X if (mode != mode_mask) X sdirmode(name, mode_mask); /* Push umask */ X return (TRUE); X } X return (FALSE); X } X _dir_setownwer(name); X if (mode != mode_mask) X sdirmode(name, mode_mask); /* Push umask on dirstack */ X return (TRUE); X} X X/* X * Set the owner/group of intermedia directories. X * Be very careful not to overwrite sgid directory semantics. X */ XLOCAL void X_dir_setownwer(name) X char *name; X{ X FINFO dinfo; X X if (my_uid != ROOT_UID) X return; X X if (dir_uid == _BAD_UID && dir_gid == _BAD_GID) X return; X X if (!_getinfo(name, &dinfo) || !is_dir(&dinfo)) X return; X X if (dir_uid != _BAD_UID) X dinfo.f_uid = dir_uid; X if (dir_gid != _BAD_GID) X dinfo.f_gid = dir_gid; X X lchownat(name, dinfo.f_uid, dinfo.f_gid, 0); X} X XEXPORT BOOL Xcreate_dirs(name) X register char *name; X{ X register char *np; X register char *dp; X int err; X int olderr = 0; X X if (noxdir) { X errmsgno(EX_BAD, "Directories not created.\n"); X return (FALSE); X } X np = dp = name; X do { X if (*np == '/') X dp = np; X } while (*np++); X if (dp == name) { X /* X * Do not create the very last directory X */ X return (TRUE); X } X *dp = '\0'; X if (laccess(name, F_OK) < 0) { X if (_create_dirs(name)) { X *dp = '/'; X return (TRUE); X } X err = geterrno(); X if ((err == EACCES || is_eexist(err) || is_eloop(err))) { X olderr = err; X goto exists; X } X *dp = '/'; X return (FALSE); X } else { X FINFO dinfo; X X exists: X if (_getinfo(name, &dinfo)) { X if (is_dir(&dinfo)) { X *dp = '/'; X return (TRUE); X } X X if (remove_file(name, FALSE)) { X if (_create_dirs(name)) { X *dp = '/'; X return (TRUE); X } X *dp = '/'; X return (FALSE); X } else { X *dp = '/'; X return (FALSE); X } X } X *dp = '/'; X if (olderr == EACCES) X seterrno(olderr); X return (FALSE); X } X} X X#ifdef MKD_DEBUG XEXPORT char *mkdwhy; X#endif X XEXPORT BOOL Xmake_adir(info) X FINFO *info; X{ X if (is_link(info)) X return (make_link(info)); X else X return (make_dir(info)); X} X X/* X * This function is used only to create directories found on the archive. X * Intermediate directories are created using create_dirs(). X */ XLOCAL BOOL Xmake_dir(info) X FINFO *info; X{ X FINFO dinfo; X mode_t mode; X int err; X X if (dometa) X return (TRUE); X X mode = osmode(info->f_mode); /* Convert TAR modes to OS modes */ X mode &= mode_mask; /* Apply current umask */ X if (my_uid != ROOT_UID) X mode |= S_IRWXU; /* Make sure we will be able write */ X X if (_getinfo(info->f_name, &dinfo) && is_dir(&dinfo)) X return (TRUE); X X if (create_dirs(info->f_name)) { X if (_getinfo(info->f_name, &dinfo) && is_dir(&dinfo)) X return (TRUE); X if (lmkdir(info->f_name, mode) >= 0) X return (TRUE); X err = geterrno(); X if ((err == EACCES || is_eexist(err) || is_eloop(err)) && X remove_file(info->f_name, FALSE)) { X if (lmkdir(info->f_name, mode) >= 0) X return (TRUE); X } X } X#ifdef MKD_DEBUG X errmsgno(EX_BAD, "make_dir(%s) called from '%s'\n", info->f_name, mkdwhy); X#endif X if (!errhidden(E_OPEN, info->f_name)) { X if (!errwarnonly(E_OPEN, info->f_name)) X xstats.s_openerrs++; X errmsg("Cannot make dir '%s'.\n", info->f_name); X (void) errabort(E_OPEN, info->f_name, TRUE); X } X return (FALSE); X} X XLOCAL BOOL Xmake_link(info) X FINFO *info; X{ X int err; X#ifdef USE_FFLAGS X FINFO linfo; X Ulong oldflags = 0L; X#endif X pathstore_t path; X char xname[PATH_MAX+1]; X char *name = info->f_name; X BOOL ret = TRUE; X X /* X * void_file() is needed for CPIO and done by our callers. X */ X X if (dometa) X return (TRUE); X X path.ps_path = xname; X X#ifdef HAVE_LINK_NOFOLLOW X /* X * This OS allows hard links to symlinks and does not follow symlinks X * when making hard links to symlinks. We may not follow symlinks while X * we check if source & sestination are the same. X */ X if (same_file(info, IS_LINK, FALSE)) { X#else X /* X * This OS either does not allow hard links to symlinks or follows X * symlinks if possible before making a hard link to a symlink. X * We need not follow symlinks while we check if source & sestination X * are the same. X */ X if (same_file(info, IS_LINK, TRUE)) { X#endif X /* X * As it seems that from/to for the hard link are already X * identical files, return TRUE to indicate success with X * creating the hard link. X */ X return (TRUE); X } X X if (copyhardlinks) X return (make_copy(info, FALSE, 0)); X else if (hardlinks) X return (emul_link(info)); X X#ifdef HAVE_LINK X xname[0] = '\0'; X if (do_install && name_exists(name)) { X if (!file_tmpname(info, &path)) { X ret = FALSE; X goto out; X } X name = path.ps_path; X } X if (llink(info->f_lname, name) >= 0) X goto ok; X err = geterrno(); X if (info->f_rsize > 0 && is_enoent(err)) { X ret = get_file(info); X goto out; X } X#ifdef USE_FFLAGS X /* X * SF_IMMUTABLE might be set on the source-file. Clear the flags X * and try again. X */ X if (_getinfo(info->f_lname, &linfo) && (linfo.f_xflags & XF_FFLAGS)) { X oldflags = linfo.f_fflags; X linfo.f_fflags = 0L; X set_fflags(&linfo); X if (llink(info->f_lname, name) >= 0) X goto restore_flags; X err = geterrno(); X } X#endif X if (create_dirs(info->f_name)) { X if (llink(info->f_lname, name) >= 0) X goto restore_flags; X err = geterrno(); X } X if ((err == EACCES || is_eexist(err) || is_eloop(err)) && X remove_file(name, FALSE)) { X if (llink(info->f_lname, name) >= 0) X goto restore_flags; X } X if (!errhidden(E_OPEN, info->f_name)) { X if (!errwarnonly(E_OPEN, info->f_name)) X xstats.s_openerrs++; X errmsg("Cannot link '%s' to '%s'.\n", X info->f_name, info->f_lname); X (void) errabort(E_OPEN, info->f_name, TRUE); X } X if (do_install) X remove_tmpname(path.ps_path); X ret = FALSE; X goto out; X Xrestore_flags: X#ifdef USE_FFLAGS X if (oldflags != 0L) { X linfo.f_fflags = oldflags; X set_fflags(&linfo); X } X#endif Xok: X if (do_install) X ret = install_rename(info, path.ps_path); Xout: X if (path.ps_path != xname) X free_pspace(&path); X return (ret); X X#else /* HAVE_LINK */ X if (!errhidden(E_SPECIALFILE, info->f_name)) { X if (!errwarnonly(E_SPECIALFILE, info->f_name)) X xstats.s_isspecial++; X errmsgno(EX_BAD, X "Not supported. Cannot link '%s' to '%s'.\n", X info->f_name, info->f_lname); X (void) errabort(E_SPECIALFILE, info->f_name, TRUE); X } X return (FALSE); X#endif /* HAVE_LINK */ X} X XLOCAL BOOL Xmake_symlink(info) X FINFO *info; X{ X int err; X pathstore_t path; X char xname[PATH_MAX+1]; X char *name = info->f_name; X BOOL ret = TRUE; X X if (dometa) X return (TRUE); X X path.ps_path = xname; X X if (copysymlinks) X return (make_copy(info, TRUE, 0)); X else if (symlinks) X return (emul_symlink(info)); X X#ifdef S_IFLNK X xname[0] = '\0'; X if (do_install && name_exists(name)) { X if (!file_tmpname(info, &path)) { X ret = FALSE; X goto out; X } X name = path.ps_path; X } X if (sxsymlink(name, info) >= 0) X goto ok; X err = geterrno(); X if (create_dirs(info->f_name)) { X if (sxsymlink(name, info) >= 0) X goto ok; X err = geterrno(); X } X /* X * XXX at least with same symlinks we should return success X */ X if ((err == EACCES || is_eexist(err) || is_eloop(err)) && X remove_file(name, FALSE)) { X if (sxsymlink(name, info) >= 0) X goto ok; X } X if (!errhidden(E_OPEN, info->f_name)) { X if (!errwarnonly(E_OPEN, info->f_name)) X xstats.s_openerrs++; X errmsg("Cannot create symbolic link '%s' to '%s'.\n", X info->f_name, info->f_lname); X (void) errabort(E_OPEN, info->f_name, TRUE); X } X if (do_install) X remove_tmpname(path.ps_path); X ret = FALSE; X goto out; Xok: X if (do_install) X ret = install_rename(info, path.ps_path); Xout: X if (path.ps_path != xname) X free_pspace(&path); X return (ret); X#else /* S_IFLNK */ X if (!errhidden(E_SPECIALFILE, info->f_name)) { X if (!errwarnonly(E_SPECIALFILE, info->f_name)) X xstats.s_isspecial++; X errmsgno(EX_BAD, X "Not supported. Cannot create symbolic link '%s' to '%s'.\n", X info->f_name, info->f_lname); X (void) errabort(E_SPECIALFILE, info->f_name, TRUE); X } X return (FALSE); X#endif /* S_IFLNK */ X} X XLOCAL BOOL Xemul_symlink(info) X FINFO *info; X{ X errmsgno(EX_BAD, "Option -symlinks not yet implemented.\n"); X errmsgno(EX_BAD, "Cannot create symbolic link '%s' to '%s'.\n", X info->f_name, info->f_lname); X return (FALSE); X} X XLOCAL BOOL Xemul_link(info) X FINFO *info; X{ X errmsgno(EX_BAD, "Option -hardlinks not yet implemented.\n"); X errmsgno(EX_BAD, "Cannot link '%s' to '%s'.\n", info->f_name, info->f_lname); X#ifdef HAVE_LINK X return (FALSE); X#else X return (FALSE); X#endif /* S_IFLNK */ X} X XLOCAL BOOL Xsame_file(info, what, do_follow) X FINFO *info; X int what; X BOOL do_follow; X{ X FINFO finfo; X FINFO linfo; X BOOL ofollow = follow; X BOOL ret = FALSE; X X follow = do_follow; X if (_getinfo(info->f_name, &finfo) && _getinfo(info->f_lname, &linfo)) { X if (finfo.f_dev == linfo.f_dev && finfo.f_ino == linfo.f_ino) { X if (what == IS_COPY) { X if (!errhidden(E_SAMEFILE, info->f_lname)) { X if (!errwarnonly(E_SAMEFILE, info->f_lname)) X xstats.s_samefile++; X errmsgno(EX_BAD, X "copy_file: '%s' from/to identical, skipping ...\n", X info->f_name); X (void) errabort(E_SAMEFILE, X info->f_lname, TRUE); X } X } else { X /* X * If in restore mode, we do not like to see X * this informational message. The hard link X * is already present and this is all we need. X * If -force-remove has been specified (default X * for "tar") we do not like to see this message X * either. X */ X if (!nowarn && !dorestore && !force_remove) { X errmsgno(EX_BAD, X "Notice: link_file: '%s' from/to identical, skipping ...\n", X info->f_name); X } X } X ret = TRUE; X } X } X follow = ofollow; X return (ret); X} X XLOCAL BOOL Xmake_copy(info, do_symlink, eflags) X FINFO *info; X BOOL do_symlink; X int eflags; X{ X#ifdef COPY_LINKS_DELAYED X if (!lowmem) { X add_copy(info, do_symlink); X return (TRUE); X } else { X return (_make_copy(info, do_symlink, eflags)); X } X#else X return (_make_copy(info, do_symlink, eflags)); X#endif X} X XLOCAL BOOL X_make_copy(info, do_symlink, eflags) X FINFO *info; X BOOL do_symlink; X int eflags; X{ X int ret; X int err; X X#ifdef COPY_LINKS_DELAYED X if (!lowmem && copydlinks) { X if (_make_dcopy(info, do_symlink, &ret, eflags)) X return (ret); X } X#endif X /* X * As we can only copy plain files, we need to follow symlinks when X * we check if source & destination are the same file. X */ X if (same_file(info, IS_COPY, TRUE)) { X return (FALSE); X } X X if ((ret = copy_file(info->f_lname, info->f_name, do_symlink, eflags)) >= 0) X return (TRUE); X err = geterrno(); X if (ret != -2 && create_dirs(info->f_name)) { X if (copy_file(info->f_lname, info->f_name, do_symlink, eflags) >= 0) X return (TRUE); X err = geterrno(); X } X if ((err == EACCES || is_eexist(err) || err == EISDIR || is_eloop(err)) && X remove_file(info->f_name, FALSE)) { X if (copy_file(info->f_lname, info->f_name, do_symlink, eflags) >= 0) X return (TRUE); X } X if (!errhidden(E_OPEN, info->f_name) && X ((eflags & HIDE_ENOENT) == 0 || geterrno() != ENOENT)) { X if (!errwarnonly(E_OPEN, info->f_name)) X xstats.s_openerrs++; X errmsg("Cannot create link copy '%s' from '%s'.\n", X info->f_name, info->f_lname); X (void) errabort(E_OPEN, info->f_name, TRUE); X } X return (FALSE); X} X X#ifdef COPY_LINKS_DELAYED XLOCAL void Xadd_copy(info, do_symlink) X FINFO *info; X BOOL do_symlink; X{ X MCQ *mcqp = ___malloc(sizeof (MCQ), "make_copy()"); X char *f_namep = ___savestr(info->f_name); X char *f_lnamep = ___savestr(info->f_lname); X X mcqp->next = NULL; X mcqp->do_symlink = do_symlink; X mcqp->info = *info; X mcqp->info.f_name = f_namep; X mcqp->info.f_lname = f_lnamep; X X if (mcq_last) { X mcq_last->next = mcqp; X mcq_last = mcqp; X } else { X mcq_1st = mcqp; X mcq_last = mcqp; X } X} X XLOCAL void Xmake_copies() X{ X int eflags = HIDE_ENOENT; X X do { X MCQ *mcqp = mcq_1st; X MCQ *mcqp_prev = NULL; X int mcq_removed = 0; X X while (mcqp) { X MCQ *mcqp_save = mcqp; X BOOL ret = _make_copy(&mcqp->info, X mcqp->do_symlink, X eflags); X X if (ret) { X if (!to_stdout) X setmodes(&mcqp->info); X if (dorestore) X sym_addstat(&mcqp->info, NULL); X } X mcqp = mcqp->next; X X if (ret || (eflags & HIDE_ENOENT) == 0 || geterrno() != ENOENT) { X X if (mcqp_prev) X mcqp_prev->next = mcqp; X if (mcq_1st == mcqp_save) X mcq_1st = mcqp; X if (mcq_last == mcqp_save) X mcq_last = mcqp; X X free(mcqp_save->info.f_name); X free(mcqp_save->info.f_lname); X free(mcqp_save); X X mcq_removed++; X X } else { X mcqp_prev = mcqp_save; X } X } X if (!mcq_removed) X eflags = 0; /* queue has not decreased - last attempt */ X X } while (mcq_1st); X} X XLOCAL BOOL X_make_dcopy(info, do_symlink, retp, eflags) X FINFO *info; X BOOL do_symlink; X int *retp; X int eflags; X{ X char nbuf[PATH_MAX+1]; X char *nbufp = nbuf; X char *dir = info->f_lname; X DIR *dirp; X char *dp; X int nents; X int ret = TRUE; X FINFO ninfo; X X if (do_symlink && info->f_lname[0] != '/') { X X char *p = strrchr(info->f_name, '/'); X int len; X X if (p) { X int llen; X X len = p - info->f_name + 1; X if ((len + (llen = strlen(info->f_lname))) > PATH_MAX) { X nbufp = __fjmalloc(stderr, len+llen, X "link dir name", JM_RETURN); X } X if (nbufp == NULL) { X if (!errhidden(E_NAMETOOLONG, info->f_lname)) { X if (!errwarnonly(E_NAMETOOLONG, info->f_lname)) X xstats.s_toolong++; X errmsgno(EX_BAD, X "Name too long. Cannot copy from '%s'.\n", X info->f_lname); X (void) errabort(E_NAMETOOLONG, X info->f_lname, TRUE); X } X if (retp) X *retp = FALSE; X return (TRUE); X } X strncpy(nbufp, info->f_name, len); X strcpy(&nbufp[len], info->f_lname); X dir = nbufp; X } X } X X dirp = lopendir(dir); X if (dirp == NULL) X return (FALSE); X if ((dp = dfetchdir(dirp, dir, &nents, NULL, NULL)) == NULL) { X closedir(dirp); X return (FALSE); X } X closedir(dirp); X X if (!_getinfo(info->f_name, &ninfo)) { X _getinfo(dir, &ninfo); X ninfo.f_name = info->f_name; X make_dir(&ninfo); X } X if (nbufp != nbuf) X free(nbufp); X X while (nents > 0) { X char *name; X int nlen; X X name = &dp[1]; X nlen = strlen(name); X X ninfo.f_name = ___malloc(strlen(info->f_name) + X 1 + nlen + 1, "make_copy()"); X X strcpy(ninfo.f_name, info->f_name); X if (ninfo.f_name[strlen(ninfo.f_name)-1] != '/') X strcat(ninfo.f_name, "/"); X strcat(ninfo.f_name, name); X X ninfo.f_lname = ___malloc(3 + X strlen(info->f_lname) + 1 + X nlen + 1, "make_copy()"); X X ninfo.f_lname[0] = '\0'; X if (do_symlink) X strcpy(ninfo.f_lname, "../"); X strcat(ninfo.f_lname, info->f_lname); X if (ninfo.f_lname[strlen(ninfo.f_lname)-1] != '/') X strcat(ninfo.f_lname, "/"); X strcat(ninfo.f_lname, name); X X if (!_make_copy(&ninfo, do_symlink, eflags)) X ret = FALSE; X X free(ninfo.f_lname); X free(ninfo.f_name); X X nents--; X dp += nlen +2; X } X if (retp) X *retp = ret; X return (TRUE); X} X#endif /* COPY_LINKS_DELAYED */ X XLOCAL int Xcopy_file(from, to, do_symlink, eflags) X char *from; X char *to; X BOOL do_symlink; X int eflags; X{ X FINFO finfo; X FILE *fin; X FILE *fout; X int cnt = -1; X char buf[8192]; X char nbuf[PATH_MAX+1]; X char *nbufp = nbuf; X X /* X * When tar archives hard links, both names (from/to) are relative to X * the current directory. With symlinks this does not work. Symlinks X * are always evaluated relative to the directory they reside in. X * For this reason, we cannot simply open the from/to files if we X * like to emulate a symbolic link. To emulate the behavior of a X * symbolic link, we concat the the directory part of the 'to' name X * (which is the path that becomes the sombolic link) to the complete X * 'from' name (which is the path the symbolic linkc pints to) in case X * the 'from' name is a relative path name. X */ X if (do_symlink && from[0] != '/') { X char *p = strrchr(to, '/'); X int len; X X if (p) { X int llen; X X len = p - to + 1; X X if ((len + (llen = strlen(from))) > PATH_MAX) { X nbufp = __fjmalloc(stderr, len+llen, X "link name", JM_RETURN); X } X if (nbufp == NULL) { X if (!errhidden(E_NAMETOOLONG, from)) { X if (!errwarnonly(E_NAMETOOLONG, from)) X xstats.s_toolong++; X errmsgno(EX_BAD, X "Name too long. Cannot copy from '%s'.\n", X from); X (void) errabort(E_NAMETOOLONG, from, X TRUE); X } X cnt = -2; X goto out; X } X strncpy(nbuf, to, len); X strcpy(&nbuf[len], from); X from = nbuf; X } X } X if (!_getinfo(from, &finfo)) { X X if (!errhidden(E_STAT, from) && X ((eflags & HIDE_ENOENT) == 0 || geterrno() != ENOENT)) { X if (!errwarnonly(E_STAT, from)) X xstats.s_staterrs++; X errmsg("Cannot stat '%s'.\n", from); X (void) errabort(E_STAT, from, TRUE); X } X cnt = -2; X goto out; X } X if (!is_file(&finfo)) { X errmsgno(EX_BAD, "Not a file. Cannot copy from '%s'.\n", from); X seterrno(EINVAL); X cnt = -2; X goto out; X } X Xrretry: X if ((fin = lfilemopen(from, "rub", S_IREAD|S_IWRITE)) == 0) { X if (geterrno() == EINTR) X goto rretry; X errmsg("Cannot open '%s'.\n", from); X } else { Xwretry: X if ((fout = lfilemopen(to, "wtcub", S_IREAD|S_IWRITE)) == 0) { X if (geterrno() == EINTR) X goto wretry; X#ifdef __really__ X errmsg("Cannot create '%s'.\n", to); X#endif X cnt = -1; X goto out; X } else { X while ((cnt = ffileread(fin, buf, sizeof (buf))) > 0) X ffilewrite(fout, buf, cnt); X fclose(fout); X } X fclose(fin); X } Xout: X if (nbufp != nbuf) X free(nbufp); X return (cnt); X} X XLOCAL BOOL Xmake_fifo(info) X FINFO *info; X{ X mode_t mode; X int err; X pathstore_t path; X char xname[PATH_MAX+1]; X char *name = info->f_name; X BOOL ret = TRUE; X X if (dometa) X return (TRUE); X X path.ps_path = xname; X X#ifdef HAVE_MKFIFO X xname[0] = '\0'; X if (do_install && name_exists(name)) { X if (!file_tmpname(info, &path)) { X ret = FALSE; X goto out; X } X name = path.ps_path; X } X mode = osmode(info->f_mode); X mode &= mode_mask; X if (lmkfifo(name, mode) >= 0) X goto ok; X err = geterrno(); X if (create_dirs(info->f_name)) { X if (lmkfifo(name, mode) >= 0) X goto ok; X err = geterrno(); X } X if ((err == EACCES || is_eexist(err) || is_eloop(err)) && X remove_file(name, FALSE)) { X if (lmkfifo(name, mode) >= 0) X goto ok; X } X if (!errhidden(E_OPEN, info->f_name)) { X if (!errwarnonly(E_OPEN, info->f_name)) X xstats.s_openerrs++; X errmsg("Cannot make fifo '%s'.\n", info->f_name); X (void) errabort(E_OPEN, info->f_name, TRUE); X } X if (do_install) X remove_tmpname(path.ps_path); X ret = FALSE; X goto out; Xok: X if (do_install) X ret = install_rename(info, path.ps_path); Xout: X if (path.ps_path != xname) X free_pspace(&path); X return (ret); X#else X#ifdef HAVE_MKNOD X return (make_special(info)); X#endif X if (!errhidden(E_SPECIALFILE, info->f_name)) { X if (!errwarnonly(E_SPECIALFILE, info->f_name)) X xstats.s_isspecial++; X errmsgno(EX_BAD, X "Not supported. Cannot make fifo '%s'.\n", X info->f_name); X (void) errabort(E_SPECIALFILE, info->f_name, TRUE); X } X return (FALSE); X#endif X} X XLOCAL BOOL Xmake_special(info) X FINFO *info; X{ X mode_t mode; X dev_t dev; X int err; X pathstore_t path; X char xname[PATH_MAX+1]; X char *name = info->f_name; X BOOL ret = TRUE; X X if (dometa) X return (TRUE); X X path.ps_path = xname; X X#ifdef HAVE_MKNOD X xname[0] = '\0'; X if (do_install && name_exists(name)) { X if (!file_tmpname(info, &path)) { X ret = FALSE; X goto out; X } X name = path.ps_path; X } X mode = osmode(info->f_mode); X mode &= mode_mask; X mode |= info->f_type; /* Add file type bits */ X dev = info->f_rdev; X if (lmknod(name, mode, dev) >= 0) X goto ok; X err = geterrno(); X if (create_dirs(info->f_name)) { X if (lmknod(name, mode, dev) >= 0) X goto ok; X err = geterrno(); X } X if ((err == EACCES || is_eexist(err) || is_eloop(err)) && X remove_file(name, FALSE)) { X if (lmknod(name, mode, dev) >= 0) X goto ok; X } X if (!errhidden(E_OPEN, info->f_name)) { X if (!errwarnonly(E_OPEN, info->f_name)) X xstats.s_openerrs++; X errmsg("Cannot make %s '%s'.\n", X is_fifo(info)?"fifo":"special", X info->f_name); X (void) errabort(E_OPEN, info->f_name, TRUE); X } X if (do_install) X remove_tmpname(path.ps_path); X ret = FALSE; X goto out; Xok: X if (do_install) X ret = install_rename(info, path.ps_path); Xout: X if (path.ps_path != xname) X free_pspace(&path); X return (ret); X#else X if (!errhidden(E_SPECIALFILE, info->f_name)) { X if (!errwarnonly(E_SPECIALFILE, info->f_name)) X xstats.s_isspecial++; X errmsgno(EX_BAD, "Not supported. Cannot make %s '%s'.\n", X is_fifo(info)?"fifo":"special", X info->f_name); X (void) errabort(E_SPECIALFILE, info->f_name, TRUE); X } X return (FALSE); X#endif X} X X/* X * Create a temporary path name for the extraction in -install mode. X */ XLOCAL BOOL Xfile_tmpname(info, path) X FINFO *info; X pathstore_t *path; X{ X register char *xp; X register char *np; X register char *dp; X size_t nlen; X X np = info->f_name; X nlen = info->f_namelen; X if (nlen == 0) /* 0 in case name is in TCB */ X nlen = NAMSIZ + 1 + PFXSIZ; /* 256 chars fit into TCB */ X if (nlen >= (PATH_MAX-6)) { X path->ps_path = NULL; /* initialize so we don't */ X path->ps_size = 0; /* need to call init_pspace() */ X path->ps_tail = 0; X if (set_pspace(PS_STDERR, path, nlen+6) < 0) X return (FALSE); X } X xp = path->ps_path; X dp = xp; X do { X if ((*xp++ = *np) == '/') X dp = xp; X } while (*np++); X X strcpy(dp, "XXXXXX"); X seterrno(0); X lmktemp(path->ps_path); X if (path->ps_path[0] == '\0') { X errmsg("Cannot make temporary name for '%s'.\n", X info->f_name); X return (FALSE); X } X return (TRUE); X} X XLOCAL FILE * Xfile_open(info, name) X FINFO *info; X char *name; X{ X FILE *f; X X while ((f = lfilemopen(name, "wctub", X osmode(info->f_mode) & mode_mask)) == NULL && X geterrno() == EINTR) X ; X return (f); X} X X/* X * Rename the temporary path to the official path name when in -install mode. X */ XLOCAL BOOL Xinstall_rename(info, xname) X FINFO *info; X char *xname; X{ X int err; X BOOL oforce_remove = force_remove; X X /* X * If xname is empty, then we do not need to rename the file as X * there was no temporary name. X */ X if (xname[0] == '\0') X return (TRUE); X X if (lrename(xname, info->f_name) >= 0) X return (TRUE); X err = geterrno(); X /* X * EISDIR is the error code if we try to rename a non-directory to the X * name of an existing directory. In this case we silently remove this X * directory if it is empty. X */ X if (err == EISDIR) X force_remove = TRUE; X if ((err == EACCES || is_eexist(err) || err == EISDIR || is_eloop(err)) && X remove_file(info->f_name, FALSE)) { X if (lrename(xname, info->f_name) >= 0) { X force_remove = oforce_remove; X return (TRUE); X } X } X force_remove = oforce_remove; X /* X * Rename to the official name did not work, remove the temporary name X */ X remove_tmpname(xname); X return (FALSE); X} X XLOCAL BOOL Xname_exists(name) X char *name; X{ X FINFO finfo; X X if (!_lgetinfo(name, &finfo)) X return (FALSE); X X return (TRUE); X} X X/* X * remove_tmpname() is used to remove the temporary file used with -install X * in case that the extraction did fail. For this reason make the remove X * silent and unconditionally. X */ XLOCAL void Xremove_tmpname(name) X char *name; X{ X BOOL oforce_remove = force_remove; X BOOL oremove_recursive = remove_recursive; X X /* X * Rename to the official name did not work, remove the temporary name X * in case that the temporary file still exists. X */ X if (name[0] == '\0') X return; X if (!name_exists(name)) X return; X /* X * In order to avoid annoying messages, call remove_file() X * only if the file exists. X */ X force_remove = TRUE; X remove_recursive = TRUE; X remove_file(name, FALSE); X remove_recursive = oremove_recursive; X force_remove = oforce_remove; X} X XLOCAL BOOL Xget_file(info) X FINFO *info; X{ X FILE *f; X int err; X pathstore_t path; X char xname[PATH_MAX+1]; X char *name = info->f_name; X BOOL ret = TRUE; X X if (dometa) { X void_file(info); X return (TRUE); X } X X path.ps_path = xname; X xname[0] = '\0'; X X if (to_stdout) { X f = stdout; X goto ofile; X } X if (do_install && name_exists(name)) { X if (!file_tmpname(info, &path)) { X ret = FALSE; X goto out; X } X name = path.ps_path; X } X if ((f = file_open(info, name)) == (FILE *)NULL) { X err = geterrno(); X if (err == EMISSDIR && create_dirs(info->f_name)) { X if ((f = file_open(info, name)) != (FILE *)NULL) { X goto ofile; X } X err = geterrno(); X } X if ((err == EACCES || is_eexist(err) || err == EISDIR || X is_eloop(err)) && X remove_file(name, FALSE)) { X if ((f = file_open(info, name)) != (FILE *)NULL) { X goto ofile; X } X } X X if (!errhidden(E_OPEN, info->f_name)) { X if (!errwarnonly(E_OPEN, info->f_name)) X xstats.s_openerrs++; X errmsg("Cannot create '%s'.\n", info->f_name); X (void) errabort(E_OPEN, info->f_name, TRUE); X } X void_file(info); X ret = FALSE; X goto out; X } Xofile: X if (!get_ofile(f, info)) { X if (!to_stdout && do_install) X remove_tmpname(path.ps_path); X ret = FALSE; X goto out; X } X if (!to_stdout && do_install) X ret = install_rename(info, path.ps_path); Xout: X if (path.ps_path != xname) X free_pspace(&path); X return (ret); X} X XLOCAL BOOL Xget_ofile(f, info) X FILE *f; X FINFO *info; X{ X int err; X int ret; X X file_raise(f, FALSE); X X#if defined(F_GETFL) && defined(O_DSYNC) X /* X * Try to write file data as soon as possible to avoid X * longer wait when fsync() is called later. X */ X if (!no_fsync) { X int fl; X X fl = fcntl(fdown(f), F_GETFL, 0); X fl |= O_DSYNC; X fcntl(fdown(f), F_SETFL, fl); X } X#endif X X if (is_sparse(info)) { X ret = get_sparse(f, info); X } else if (force_hole) { X if (xmeta) X ret = get_as_hole(f, info); X else X ret = get_forced_hole(f, info); X } else { X ret = xt_file(info, (int(*)__PR((void *, char *, int)))ffilewrite, X f, 0, "writing"); X } X if (ret < 0) { X if (!to_stdout) X snulltimes(info->f_name, info); X die(EX_BAD); X } X if (!to_stdout) { X#ifdef HAVE_FSYNC X int cnt; X#endif X if (ret == FALSE) X xstats.s_rwerrs--; /* Compensate overshoot below */ X X if (fflush(f) != 0) X ret = FALSE; X#ifdef HAVE_FSYNC X err = 0; X cnt = 0; X do { X if (!no_fsync && fsync(fdown(f)) != 0) X err = geterrno(); X X if (err == EINVAL) X err = 0; X } while (err == EINTR && ++cnt < 10); X if (err != 0) X ret = FALSE; X#endif X if (fclose(f) != 0) X ret = FALSE; X if (ret == FALSE) { X xstats.s_rwerrs++; X if (!to_stdout) X snulltimes(info->f_name, info); X } X } X return (ret); X} X X/* ARGSUSED */ XLOCAL int Xvoid_func(vp, p, amount) X void *vp; X char *p; X int amount; X{ X return (amount); X} X XEXPORT BOOL Xvoid_file(info) X FINFO *info; X{ X int ret = TRUE; X Ullong llsize = info->f_llsize; X off_t size = info->f_rsize; X X /* X * handle botch in gnu sparse file definitions X */ X if (props.pr_flags & PR_GNU_SPARSE_BUG) X if (gnu_skip_extended(info) < 0) X die(EX_BAD); X X if (info->f_flags & F_DATA_SKIPPED) X return (ret); X X /* X * Try to do our best to skip even files with a size that X * is more then off_t may handle on the local machine. X */ X do { X if (info->f_flags & F_BAD_SIZE) { X if (llsize > 1024*1024*1024) X info->f_rsize = 1024*1024*1024; X else X info->f_rsize = llsize; X } X X ret = xt_file(info, void_func, 0, 0, "void"); X if (ret < 0) X die(EX_BAD); X X llsize -= info->f_rsize; X X } while ((info->f_flags & F_BAD_SIZE) && llsize > 0); X X info->f_rsize = size; X info->f_flags |= F_DATA_SKIPPED; X X return (ret); X} X XLOCAL BOOL Xvoid_bad(info) X FINFO *info; X{ X int ret; X X if (!nowarn) X errmsgno(EX_BAD, X "WARNING: bad metadata for '%s', skipping...\n", X info->f_name); X ret = void_file(info); X return (ret); X} X X/* X * Extract file using callback function "func" X * Returns: X * TRUE Extract OK X * FALSE Extract not OK, may continue X * -1 An error occured, max not continue X */ XEXPORT int Xxt_file(info, func, arg, amt, text) X FINFO *info; X int (*func) __PR((void *, char *, int)); X void *arg; X int amt; X char *text; X{ X register int amount; /* XXX ??? */ X register off_t size; X register int tasize; X BOOL ret = TRUE; X X size = info->f_rsize; X if (amt == 0) X amt = bufsize; X while (size > 0) { X X if ((props.pr_flags & PR_CPIO) == 0) { X amount = buf_rwait(TBLOCK); X if (amount < TBLOCK) { X goto waseof; X } X amount = (amount / TBLOCK) * TBLOCK; X amount = min(size, amount); X amount = min(amount, amt); X tasize = tarsize(amount); X } else { X amount = buf_rwait(1); /* Request what is available */ X if (amount <= 0) { X goto waseof; X } X amount = min(size, amount); X amount = min(amount, amt); X tasize = amount; X } X X if ((*func)(arg, bigptr, amount) != amount) { X ret = FALSE; X if (!errhidden(E_WRITE, info->f_name)) { X if (!errwarnonly(E_WRITE, info->f_name)) X xstats.s_rwerrs++; X errmsg("Error %s '%s'.\n", text, info->f_name); X (void) errabort(E_WRITE, info->f_name, TRUE); X } X /* X * func -> void_func() to skip the rest of the file. X */ X func = void_func; X } X X size -= amount; X buf_rwake(tasize); X } X info->f_flags |= F_DATA_SKIPPED; X /* X * Honour CPIO padding X */ X if ((amount = props.pr_pad) != 0) { X size = info->f_rsize; X if (info->f_flags & F_LONGNAME) X size += props.pr_hdrsize; X amount = (amount + 1 - (size & amount)) & amount; X if (amount > 0) { X buf_rwait(amount); X buf_rwake(amount); X } X } X return (ret); Xwaseof: X errmsgno(EX_BAD, "Tar file too small (amount: %d bytes).\n", amount); X errmsgno(EX_BAD, "Unexpected EOF on input.\n"); X return (-1); X} X XEXPORT void Xskip_slash(info) X FINFO *info; X{ X static BOOL warned = FALSE; X X if (!warned && !nowarn) { X errmsgno(EX_BAD, "WARNING: skipping leading '/' on filenames.\n"); X warned = TRUE; X } X /* X * XXX X * XXX ACHTUNG: ia_change kann es nötig machen, den String umzukopieren X * XXX denn sonst ist die Länge des Speicherplatzes unbestimmt! X * X * XXX ACHTUNG: mir ist noch unklar, ob es richtig ist, auch in jedem X * XXX Fall Führende slashes vom Linknamen zu entfernen. X * XXX Bei Hard-Link ist das sicher richtig und ergibt sich auch X * XXX automatisch, wenn man nur vor dem Aufruf von skip_slash() X * XXX auf f_name[0] == '/' abfragt. X */ X while (info->f_name[0] == '/') X info->f_name++; X X /* X * Don't strip leading '/' from targets of symlinks. X */ X if (is_symlink(info)) X return; X X while (info->f_lname[0] == '/') X info->f_lname++; X} X X#if PATH_DELIM == '\\' || defined(IS_CYGWIN) X#define NEED_BACKSLASH X#endif X XLOCAL BOOL Xhas_dotdot(name) X char *name; X{ X register char *p = name; X X while (*p) { X if ((p[0] == '.' && p[1] == '.') && X (p[2] == '/' || X#ifdef NEED_BACKSLASH X p[2] == '\\' || X#endif X p[2] == '\0')) { X return (TRUE); X } X do { X if (*p++ == '\0') X return (FALSE); X#ifdef NEED_BACKSLASH X } while (*p != '/' && *p != '\\'); X#else X } while (*p != '/'); X#endif X p++; X#ifdef NEED_BACKSLASH X while (*p == '/' || *p == '\\') X p++; X#else X while (*p == '/') /* Skip multiple slashes */ X p++; X#endif X } X return (FALSE); X} X XLOCAL BOOL Xinside_tree(info) X FINFO *info; X{ X char _rpath[PATH_MAX+1]; X char _npath[PATH_MAX+1]; X char *rpath = _rpath; X char *npath = _npath; X char *p; X size_t len; X ssize_t nlen; X BOOL ret = FALSE; Xextern const char *wdir; X X /* X * If we are in the root directory, any unusual pathname is critical. X */ X if (wdir != NULL && wdir[0] == '/' && wdir[1] == '\0') X return (FALSE); X X if (info->f_namelen > 0) X len = info->f_namelen; X else X len = strlen(info->f_name); X X if (info->f_lnamelen > 0) X len += info->f_lnamelen; X else X len += strlen(info->f_lname); X X if (++len > sizeof (_rpath)) { X rpath = __jmalloc(len, "name buffer", JM_RETURN); X if (rpath == NULL) X return (FALSE); X } X if (len > sizeof (_npath)) { X npath = __jmalloc(len, "name buffer", JM_RETURN); X if (npath == NULL) X goto out; X } X X /* X * Create combined path name. X */ X if (info->f_lname[0] != '/') { X strcpy(rpath, info->f_name); X p = strrchr(rpath, '/'); X if (p == NULL) X rpath[0] = '\0'; X else X *++p = '\0'; X } else { X rpath[0] = '\0'; X } X strcat(rpath, info->f_lname); X X /* X * Normalize combined path name. X */ X nlen = resolvenpath(rpath, npath, len); X if (nlen < 0) X goto out; X npath[nlen] = '\0'; X X /* X * Check if it points outside our working directory. X */ X if (npath[0] != '/' && !has_dotdot(npath)) X ret = TRUE; X Xout: X if (rpath != _rpath) X free(rpath); X if (npath != _npath) X free(npath); X X return (ret); X} END-of-star-1.6/star/extract.c echo x - star-1.6/star/findinfo.c sed 's/^X//' >star-1.6/star/findinfo.c << 'END-of-star-1.6/star/findinfo.c' X/* @(#)findinfo.c 1.13 13/11/05 Copyright 2005-2013 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)findinfo.c 1.13 13/11/05 Copyright 2005-2013 J. Schilling"; X#endif X/* X * Convert FINFO -> struct stat for find_expr() X * X * Copyright (c) 2005-2013 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include "star.h" X#include X#include X#include X#include "starsubs.h" X#include X#include X#include X X#ifdef USE_FIND X Xextern findn_t *find_node; X XEXPORT BOOL findinfo __PR((FINFO *info)); X X/* X * Called from extract.c, diff.c and list.c X */ XEXPORT BOOL Xfindinfo(info) X FINFO *info; X{ X struct stat sb; X BOOL ret; Xextern struct WALK walkstate; X X if (find_node == NULL) X return (TRUE); X X sb.st_dev = info->f_dev; X sb.st_ino = info->f_ino; X sb.st_mode = info->f_mode|info->f_type; X sb.st_nlink = info->f_nlink; X sb.st_uid = info->f_uid; X sb.st_gid = info->f_gid; X sb.st_rdev = info->f_rdev; X sb.st_size = info->f_rsize; X sb.st_atime = info->f_atime; X sb.st_mtime = info->f_mtime; X sb.st_ctime = info->f_ctime; X#ifdef HAVE_ST_BLKSIZE X sb.st_blksize = 0; X#endif X#ifdef HAVE_ST_BLOCKS X sb.st_blocks = (info->f_size+1023) / DEV_BSIZE; X#endif X walkstate.lname = info->f_lname; X walkstate.pflags = PF_ACL|PF_XATTR; X if (info->f_xflags & (XF_ACL_ACCESS|XF_ACL_DEFAULT|XF_ACL_ACE)) X walkstate.pflags |= PF_HAS_ACL; X if (info->f_xflags & XF_XATTR) X walkstate.pflags |= PF_HAS_XATTR; X ret = find_expr(info->f_name, (char *)filename(info->f_name), X &sb, &walkstate, find_node); X if (!ret) X return (ret); X info->f_mode = sb.st_mode & 07777; X if (info->f_uid != sb.st_uid) { X static char nuid[32+1]; X X info->f_uid = sb.st_uid; X if (ic_nameuid(nuid, sizeof (nuid), info->f_uid)) { X info->f_uname = nuid; X info->f_umaxlen = sizeof (nuid)-1; X } else { X snprintf(nuid, sizeof (nuid), "%llu", (Llong)info->f_uid); X info->f_uname = nuid; X info->f_umaxlen = sizeof (nuid)-1; X } X } X if (info->f_gid != sb.st_gid) { X static char ngid[32+1]; X X info->f_gid = sb.st_gid; X if (ic_namegid(ngid, sizeof (ngid), info->f_gid)) { X info->f_gname = ngid; X info->f_gmaxlen = sizeof (ngid)-1; X } else { X snprintf(ngid, sizeof (ngid), "%llu", (Llong)info->f_gid); X info->f_gname = ngid; X info->f_gmaxlen = sizeof (ngid)-1; X } X } X return (ret); X} X X#endif /* USE_FIND */ END-of-star-1.6/star/findinfo.c echo x - star-1.6/star/gnutar.mk sed 's/^X//' >star-1.6/star/gnutar.mk << 'END-of-star-1.6/star/gnutar.mk' X#ident @(#)gnutar.mk 1.17 13/11/07 X########################################################################### X#include $(MAKE_M_ARCH).def XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= bin XTARGET= gnutar X#SYMLINKS= ustar tar XCPPOPTS += -D__STAR__ XCPPOPTS += -DSET_CTIME -DFIFO -DUSE_MMAP -DUSE_REMOTE -DUSE_RCMD_RSH X#CPPOPTS += -DSET_CTIME -DFIFO -DUSE_MMAP X#CPPOPTS += -DSET_CTIME -DUSE_MMAP X#CPPOPTS += -DFIFO -DUSE_MMAP XCPPOPTS += -DUSE_LARGEFILES XCPPOPTS += -DUSE_FIND XCPPOPTS += -DUSE_ACL XCPPOPTS += -DUSE_XATTR XCPPOPTS += -DUSE_FFLAGS XCPPOPTS += -DSCHILY_PRINT XCFILES= gnutar.c header.c cpiohdr.c xheader.c xattr.c \ X list.c extract.c create.c append.c diff.c restore.c \ X remove.c star_unix.c acl_unix.c acltext.c fflags.c \ X buffer.c dirtime.c lhash.c \ X hole.c longnames.c \ X movearch.c table.c props.c \ X unicode.c \ X subst.c volhdr.c \ X chdir.c match.c defaults.c dumpdate.c \ X fifo.c device.c checkerr.c \ X findinfo.c pathname.c XHFILES= star.h starsubs.h dirtime.h xtab.h xutimes.h \ X movearch.h table.h props.h fifo.h diff.h \ X checkerr.h dumpdate.h bitstring.h pathname.h XLIBS= -ldeflt -lrmt -lfind -lschily $(LIB_ACL) $(LIB_ATTR) $(LIB_SOCKET) $(LIB_INTL) $(LIB_CAP) XXMK_FILE= gnutarman.mk X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.cmd X########################################################################### Xcount: $(CFILES) $(HFILES) X count $r1 X END-of-star-1.6/star/gnutar.mk echo x - star-1.6/star/fflags.c sed 's/^X//' >star-1.6/star/fflags.c << 'END-of-star-1.6/star/fflags.c' X/* @(#)fflags.c 1.27 19/03/19 Copyright 2001-2019 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)fflags.c 1.27 19/03/19 Copyright 2001-2019 J. Schilling"; X#endif X/* X * Routines to handle extended file flags X * X * Copyright (c) 2001-2019 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifdef USE_FFLAGS X#include X#include X#include "star.h" X#include "props.h" X#include "table.h" X#include X#include X#include X#include X#include X#define GT_COMERR /* #define comerr gtcomerr */ X#define GT_ERROR /* #define error gterror */ X#include X#include "starsubs.h" X#ifdef __linux__ X#include X#ifdef HAVE_LINUX_FS_H X#include X#endif X#ifdef HAVE_EXT2FS_EXT2_FS_H X/* X * The Linux Kernel appears to be unplanned and full of moving targets :-( X */ X#include X X#else /* !HAVE_EXT2FS_EXT2_FS_H */ X#if defined(HAVE_USABLE_EXT2_FS_H) || defined(TRY_EXT2_FS) X/* X * Be very careful in case that the Linux Kernel maintainers X * unexpectedly fix the bugs in the Linux Lernel include files. X * Only introduce the attempt for a workaround in case the include X * files are broken anyway. X * X * If HAVE_USABLE_LINUX_EXT2_FS_H is defined, a simple X * #include will work. X * X * If TRY_EXT2_FS is defined, we will asume that X */ X#ifdef TRY_EXT2_FS X#define __KERNEL__ X#ifdef HAVE_LINUX_TYPES_H X#include X#endif X#define KBUILD_BASENAME "foo" X#define CONFIG_X86_L1_CACHE_SHIFT 7 X#ifdef HAVE_LINUX_GFP_H X#include X#endif X#ifdef HAVE_ASM_TYPES_H X#include X#endif X#undef __KERNEL__ X#endif /* TRY_EXT2_FS */ X#include X#endif /* defined(HAVE_USABLE_EXT2_FS_H) || defined(TRY_EXT2_FS) */ X#endif /* HAVE_EXT2FS_EXT2_FS_H */ X#include X X#if !defined(FS_IOC_GETFLAGS) && defined(EXT2_IOC_GETFLAGS) X#define FS_IOC_GETFLAGS EXT2_IOC_GETFLAGS X#endif X#if !defined(FS_IOC_SETFLAGS) && defined(EXT2_IOC_SETFLAGS) X#define FS_IOC_SETFLAGS EXT2_IOC_SETFLAGS X#endif X X#if !defined(FS_APPEND_FL) && defined(EXT2_APPEND_FL) X#define FS_APPEND_FL EXT2_APPEND_FL X#endif X#if !defined(FS_COMPR_FL) && defined(EXT2_COMPR_FL) X#define FS_COMPR_FL EXT2_COMPR_FL X#endif X#if !defined(FS_IMMUTABLE_FL) && defined(EXT2_IMMUTABLE_FL) X#define FS_IMMUTABLE_FL EXT2_IMMUTABLE_FL X#endif X#if !defined(FS_NOATIME_FL) && defined(EXT2_NOATIME_FL) X#define FS_NOATIME_FL EXT2_NOATIME_FL X#endif X#if !defined(FS_NODUMP_FL) && defined(EXT2_NODUMP_FL) X#define FS_NODUMP_FL EXT2_NODUMP_FL X#endif X#if !defined(FS_SECRM_FL) && defined(EXT2_SECRM_FL) X#define FS_SECRM_FL EXT2_SECRM_FL X#endif X#if !defined(FS_SYNC_FL) && defined(EXT2_SYNC_FL) X#define FS_SYNC_FL EXT2_SYNC_FL X#endif X#if !defined(FS_UNRM_FL) && defined(EXT2_UNRM_FL) X#define FS_UNRM_FL EXT2_UNRM_FL X#endif X X#if !defined(FS_DIRSYNC_FL) && defined(EXT2_DIRSYNC_FL) X#define FS_DIRSYNC_FL EXT2_DIRSYNC_FL X#endif X#if !defined(FS_JOURNAL_DATA_FL) && defined(EXT3_JOURNAL_DATA_FL) X#define FS_JOURNAL_DATA_FL EXT3_JOURNAL_DATA_FL X#endif X#if !defined(FS_NOCOW_FL) && defined(EXT2_NOCOW_FL) X#define FS_NOCOW_FL EXT2_NOCOW_FL X#endif X#if !defined(FS_NOCOW_FL) && defined(EXT2_NOCOW_FL) X#define FS_NOCOW_FL EXT2_NOCOW_FL X#endif X#if !defined(FS_NOTAIL_FL) && defined(EXT2_NOTAIL_FL) X#define FS_NOTAIL_FL EXT2_NOTAIL_FL X#endif X#if !defined(FS_PROJINHERIT_FL) && defined(EXT2_PROJINHERIT_FL) X#define FS_PROJINHERIT_FL EXT22_PROJINHERIT_FL X#endif X#if !defined(FS_TOPDIR_FL) && defined(EXT2_TOPDIR_FL) X#define FS_TOPDIR_FL EXT2_TOPDIR_FL X#endif X X#endif /* __linux__ */ X XEXPORT void opt_fflags __PR((void)); XEXPORT void get_fflags __PR((FINFO *info)); XEXPORT void set_fflags __PR((FINFO *info)); XEXPORT char *textfromflags __PR((FINFO *info, char *buf)); XEXPORT int texttoflags __PR((FINFO *info, char *buf)); X XEXPORT void Xopt_fflags() X{ X /* Linux *BSD */ X#if (defined(__linux__) && defined(FS_IOC_GETFLAGS)) || defined(HAVE_ST_FLAGS) X printf(" fflags"); X#endif X} X XEXPORT void Xget_fflags(info) X register FINFO *info; X{ X#if defined(__linux__) && defined(FS_IOC_GETFLAGS) X int f; X long l = 0L; X X if ((f = open(info->f_name, O_RDONLY|O_NDELAY)) >= 0) { X if (ioctl(f, FS_IOC_GETFLAGS, &l) >= 0) { X info->f_fflags = l; X if ((l & FS_NODUMP_FL) != 0) X info->f_flags |= F_NODUMP; X if (info->f_fflags != 0) X info->f_xflags |= XF_FFLAGS; X } else { X info->f_fflags = 0L; X } X close(f); X } X#else /* !__linux__ */ X info->f_fflags = 0L; X#endif X} X XEXPORT void Xset_fflags(info) X register FINFO *info; X{ X/* X * Be careful: True64 includes a chflags() stub but no #defines for st_flags X */ X#if defined(HAVE_CHFLAGS) && defined(UF_SETTABLE) X char buf[512]; X BOOL err = TRUE; X X /* X * As for 14.2.2002 the man page of chflags() is wrong, the following X * code is a result of kernel source study. X * If we are not allowed to set the flags, try to only set the user X * settable flags. X */ X if (chflags(info->f_name, info->f_fflags) >= 0) X err = FALSE; X else if (geterrno() == EPERM && X chflags(info->f_name, info->f_fflags & UF_SETTABLE) >= 0) X err = FALSE; X X if (err) X errmsg("Cannot set file flags '%s' for '%s'.\n", X textfromflags(info, buf), info->f_name); X#else X#if defined(__linux__) && defined(FS_IOC_GETFLAGS) X char buf[512]; X int f; X Ulong flags; X Ulong oldflags; X BOOL err = TRUE; X /* X * Linux bites again! There is no define for the flags that are only X * settable by the root user. X */ X#ifdef FS_JOURNAL_DATA_FL /* 'j' */ X#define SF_MASK (FS_IMMUTABLE_FL|FS_APPEND_FL|FS_JOURNAL_DATA_FL) X#else X#define SF_MASK (FS_IMMUTABLE_FL|FS_APPEND_FL) X#endif X X if ((f = open(info->f_name, O_RDONLY|O_NONBLOCK)) >= 0) { X if (ioctl(f, FS_IOC_SETFLAGS, &info->f_fflags) >= 0) { X err = FALSE; X X } else if (geterrno() == EPERM) { X if (ioctl(f, FS_IOC_GETFLAGS, &oldflags) >= 0) { X X flags = info->f_fflags & ~SF_MASK; X oldflags &= SF_MASK; X flags |= oldflags; X if (ioctl(f, FS_IOC_SETFLAGS, &flags) >= 0) X err = FALSE; X } X } X close(f); X } X if (err) X errmsg("Cannot set file flags '%s' for '%s'.\n", X textfromflags(info, buf), info->f_name); X#endif X X#endif X} X X X/* X * The first entry for a specific flag is used as output for the TAR archive. X * Other entries with the same flag are recognized as aliases. X * X * UF_* flags are flags settable by any user, defied by *BSD X * SF_* flags are *BSD flags settable obly be the super user X * FS_* flags are Linux specific. X */ XLOCAL struct { X char *name; X Ulong flag; X} flagnames[] = { X /* shorter names per flag first, all prefixed by "no" */ X /* Super user settable flags first */ X#ifdef SF_APPEND X { "sappnd", SF_APPEND }, X { "sappend", SF_APPEND }, X#endif X X#ifdef FS_APPEND_FL /* 'a' */ X { "sappnd", FS_APPEND_FL }, X { "sappend", FS_APPEND_FL }, X#endif X X#ifdef SF_ARCHIVED X { "arch", SF_ARCHIVED }, X { "archived", SF_ARCHIVED }, X#endif X X#ifdef SF_IMMUTABLE X { "schg", SF_IMMUTABLE }, X { "schange", SF_IMMUTABLE }, X { "simmutable", SF_IMMUTABLE }, X#endif X#ifdef FS_IMMUTABLE_FL /* 'i' */ X { "schg", FS_IMMUTABLE_FL }, X { "schange", FS_IMMUTABLE_FL }, X { "simmutable", FS_IMMUTABLE_FL }, X#endif X X#ifdef SF_NOUNLINK X { "sunlnk", SF_NOUNLINK }, X { "sunlink", SF_NOUNLINK }, X#endif X X#ifdef FS_JOURNAL_DATA_FL /* 'j' */ X { "journal-data", FS_JOURNAL_DATA_FL }, X { "journal", FS_JOURNAL_DATA_FL }, /* undoc libarchive al. */ X#endif X X/* ------------------------------------------------------------------------- */ X X /* The following flags may be set without being super user. */ X#ifdef UF_APPEND X { "uappnd", UF_APPEND }, X { "uappend", UF_APPEND }, X#endif X X#ifdef UF_IMMUTABLE X { "uchg", UF_IMMUTABLE }, X { "uchange", UF_IMMUTABLE }, X { "uimmutable", UF_IMMUTABLE }, X#endif X X#ifdef FS_COMPR_FL /* 'c' */ X { "compress", FS_COMPR_FL }, X#endif X X#ifdef FS_NOATIME_FL /* 'A' */ X { "noatime", FS_NOATIME_FL }, X#endif X X#ifdef UF_NODUMP X { "nodump", UF_NODUMP }, X#endif X#ifdef FS_NODUMP_FL /* 'd' */ X { "nodump", FS_NODUMP_FL }, X#endif X X#ifdef UF_OPAQUE X { "opaque", UF_OPAQUE }, X#endif X X#ifdef FS_SECRM_FL /* 's' Purge before unlink */ X { "secdel", FS_SECRM_FL }, X { "securedeletion", FS_SECRM_FL }, /* undoc'd libarchive alias */ X#endif X X#ifdef FS_SYNC_FL /* 'S' */ X { "sync", FS_SYNC_FL }, X#endif X X#ifdef FS_UNRM_FL /* 'u' Allow to 'unrm' file the */ X { "undel", FS_UNRM_FL }, X#endif X X#ifdef UF_NOUNLINK X { "uunlnk", UF_NOUNLINK }, X { "uunlink", UF_NOUNLINK }, X#endif X X#ifdef UF_COMPRESSED X { "compressed", UF_COMPRESSED }, X { "ucompressed", UF_COMPRESSED }, X#endif X#ifdef UF_HIDDEN X { "hidden", UF_HIDDEN }, X { "uhidden", UF_HIDDEN }, X#endif X#ifdef UF_OFFLINE X { "offline", UF_OFFLINE }, X { "uoffline", UF_OFFLINE }, X#endif X#ifdef UF_READONLY X { "rdonly", UF_READONLY }, X { "urdonly", UF_READONLY }, X { "readonly", UF_READONLY }, X#endif X#ifdef UF_REPARSE X { "reparse", UF_REPARSE }, X { "ureparse", UF_REPARSE }, X#endif X#ifdef UF_SPARSE X { "sparse", UF_SPARSE }, X { "usparse", UF_SPARSE }, X#endif X#ifdef UF_SYSTEM X { "system", UF_SYSTEM }, X { "usystem", UF_SYSTEM }, X#endif X X#ifdef FS_DIRSYNC_FL /* 'D' */ X { "dirsync", FS_DIRSYNC_FL }, X#endif X#ifdef FS_NOCOW_FL /* 'C' */ X { "nocow", FS_NOCOW_FL }, X#endif X#ifdef FS_NOTAIL_FL /* 't' */ X { "notail", FS_NOTAIL_FL }, X#endif X#ifdef FS_PROJINHERIT_FL /* 'P' */ X { "projinherit", FS_PROJINHERIT_FL }, X#endif X#ifdef FS_TOPDIR_FL /* 'T' */ X { "topdir", FS_TOPDIR_FL }, X#endif X X { NULL, 0 } X}; X#define nflagnames ((sizeof (flagnames) / sizeof (flagnames[0])) -1) X X/* X * With 32 bits for flags and 512 bytes for the text buffer any name X * for a single flag may be <= 16 bytes. X */ XEXPORT char * Xtextfromflags(info, buf) X register FINFO *info; X register char *buf; X{ X register Ulong flags = info->f_fflags; X register char *n; X register char *p; X register int i; X X buf[0] = '\0'; X p = buf; X X for (i = 0; i < nflagnames; i++) { X if (flags & flagnames[i].flag) { X flags &= ~flagnames[i].flag; X if (p != buf) X *p++ = ','; X for (n = flagnames[i].name; *n; *p++ = *n++) X ; X } X } X *p = '\0'; X return (buf); X} X XEXPORT int Xtexttoflags(info, buf) X register FINFO *info; X register char *buf; X{ X register char *p; X register char *sep; X register int i; X register Ulong flags = 0; X X p = buf; X X while (*p) { X if ((sep = strchr(p, ',')) != NULL) X *sep = '\0'; X X for (i = 0; i < nflagnames; i++) { X if (streql(flagnames[i].name, p)) { X flags |= flagnames[i].flag; X break; X } X } X#ifdef nonono X if (i == nflagnames) { X not found! X } X#endif X if (sep != NULL) { X *sep++ = ','; X p = sep; X } else { X break; X } X } X info->f_fflags = flags; X return (0); X} X X#endif /* USE_FFLAGS */ END-of-star-1.6/star/fflags.c echo x - star-1.6/star/fifo.c sed 's/^X//' >star-1.6/star/fifo.c << 'END-of-star-1.6/star/fifo.c' X/* @(#)fifo.c 1.100 19/03/02 Copyright 1989, 1994-2019 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)fifo.c 1.100 19/03/02 Copyright 1989, 1994-2019 J. Schilling"; X#endif X/* X * A "fifo" that uses shared memory between two processes X * X * s*wakeup() 2nd parameter character: X * X * t fifo_iwait() wake up put side to start read Tape change X * d fifo_owake() wake up get side if mp->oblocked == TRUE X * e fifo_oflush() wake up get side if EOF X * T fifo_owait() wake up put side after write Tape change X * s fifo_iwake() wake up put side if mp->iblocked == TRUE X * S fifo_resume() wake up put side after reading first blk X * n fifo_chitape() wake up put side to start wrt Tape chng X * N fifo_chotape() wake up get side if mp->oblocked == TRUE X * R fifo_reelwake() wake up put side if mp->reelwait == TRUE X * X * If you ever see a hang in the fifo code, you need to report a stack X * trace for both processes (including the line number of the hanging call X * to swait()) and the relevant state of struct m_head. X * X * This can be done by sending SIGRTMAX to both star processes via: X * kill -RTMAX X * kill -RTMAX X * and then to report the output (from stderr). X * X * Copyright (c) 1989, 1994-2019 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include /* includes */ X#include X#include X#include X#include X X#ifdef FIFO X X#if !defined(USE_MMAP) && !defined(USE_USGSHM) X#ifdef HAVE_SMMAP X#define USE_MMAP X#endif X#endif X#if defined(HAVE_SMMAP) && defined(USE_MMAP) X#include X#endif X#include "star.h" X#include "starsubs.h" X#include "fifo.h" /* #undef FIFO may happen here */ X#define GT_COMERR /* #define comerr gtcomerr */ X#define GT_ERROR /* #define error gterror */ X#include X#include /* getpagesize() */ X X#ifndef HAVE_SMMAP X#undef USE_MMAP X#ifdef FIFO X#define USE_USGSHM /* SYSV shared memory is the default */ X#endif X#endif X X#ifdef HAVE_DOSALLOCSHAREDMEM /* This is for OS/2 */ X#undef USE_MMAP X#undef USE_USGSHM X#ifdef FIFO X#define USE_OS2SHM X#endif X#endif X X#ifdef HAVE_BEOS_AREAS /* This is for BeOS/Zeta */ X#undef USE_MMAP X#undef USE_USGSHM X#undef USE_OS2SHM X#ifdef FIFO X#define USE_BEOS_AREAS X#endif X#endif X X#define HANG_DEBUG X#ifdef DEBUG X#ifndef HANG_DEBUG X#define HANG_DEBUG X#endif X#define EDEBUG(a) if (debug) error a X#else X#define EDEBUG(a) X#endif X X /* X * roundup(x, y), x needs to be unsigned or x+y non-negative. X */ X#undef roundup X#define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) X Xchar *buf; Xm_head *mp; Xint buflen; X Xextern BOOL multivol; Xextern BOOL debug; Xextern BOOL shmflag; Xextern BOOL no_stats; Xextern BOOL lowmem; Xextern long fs; Xextern long bs; Xextern long ibs; Xextern long obs; Xextern int hiw; Xextern int low; Xextern BOOL copyflag; Xextern long chdrtype; X Xextern m_stats *stats; Xextern int pid; X Xextern GINFO *gip; X Xlong ibs; Xlong obs; Xint hiw; Xint low; X XLOCAL int waitchan; X XEXPORT void initfifo __PR((void)); XLOCAL void fifo_setparams __PR((void)); XEXPORT void fifo_ibs_shrink __PR((int newsize)); XEXPORT void runfifo __PR((int ac, char *const *av)); XEXPORT void fifo_prmp __PR((int sig)); XEXPORT void fifo_stats __PR((void)); XLOCAL int swait __PR((int f, int chan)); XLOCAL int swakeup __PR((int f, int c)); XEXPORT int fifo_amount __PR((void)); XEXPORT int fifo_iwait __PR((int amount)); XEXPORT void fifo_owake __PR((int amount)); XEXPORT void fifo_oflush __PR((void)); XEXPORT void fifo_oclose __PR((void)); XEXPORT int fifo_owait __PR((int amount)); XEXPORT void fifo_iwake __PR((int amt)); XEXPORT void fifo_reelwake __PR((void)); XEXPORT void fifo_resume __PR((void)); XEXPORT void fifo_sync __PR((int size)); XEXPORT void fifo_chitape __PR((void)); XEXPORT void fifo_chotape __PR((void)); XLOCAL void do_in __PR((void)); XLOCAL void do_out __PR((void)); XLOCAL void fbit_nclear __PR((bitstr_t *name, int startb, int stopb)); X#ifdef USE_MMAP XLOCAL char *mkshare __PR((int size)); X#endif X#ifdef USE_USGSHM XLOCAL char *mkshm __PR((int size)); X#endif X#ifdef USE_OS2SHM XLOCAL char *mkos2shm __PR((int size)); X#endif X#ifdef USE_BEOS_AREAS XLOCAL char *mkbeosshm __PR((int size)); XLOCAL void beosshm_child __PR((void)); X#endif X X/* X * Initialize the FIFO. X * X * This is called from the buffer administration at start up time. X * It just allocates the FIFO buffer and initializes the data structures. X */ XEXPORT void Xinitfifo() X{ Xextern BOOL cflag; X int pagesize; X int addsize; X X if (obs == 0) X obs = bs; X if (fs == 0) { X#if defined(sun) && defined(mc68000) X fs = 1*1024*1024; X#else X#if defined(__linux) && !defined(USE_MMAP) X fs = 4*1024*1024; X#else X fs = 8*1024*1024; X#endif X#endif X if (lowmem) X fs = 1*1024*1024; X } X if (fs < bs + obs) X fs = bs + obs; X /* X * We need at least 2x obs for the visible part of the FIFO to allow X * the inout and the output act independently. X */ X if (fs < 2*obs) X fs = 2*obs; X fs = roundup(fs, obs); X pagesize = getpagesize(); X if (pagesize <= 0) X pagesize = TBLOCK; X X /* X * 'addsize' covers the invisible part of the FIFO. X * The start of the real shared memory carries m_head, followed by X * the space needed for moving residual bytes "down" before the X * official start of the vivible part of the FIFO. X * This is needed to grant that the FIFO output may always be done X * in "obs" chunks to grant a unique tape output block size. X * If we ony need to support CPIO to be fed into a tar inout, it X * would be sufficient to add TBLOCK size. If we like to support X * auto split multi volume archives, we need to count on QIC drives X * that are unblocked and write less than a TAR "tape block" on EOT. X * In this case we may need to move anything < obs "down" before the X * official start of the FIFO. X * We reserve at least 300 bytes for the GINFO string table. X */ X#ifdef CPIO_ONLY X addsize = sizeof (m_head) + 300 + TBLOCK; X#else X addsize = sizeof (m_head) + 300 + obs; X#endif X if (multivol && cflag) X addsize += bitstr_size(fs/TBLOCK); X addsize = roundup(addsize, pagesize); X X buflen = roundup(fs, pagesize) + addsize; X /* CSTYLED */ X EDEBUG(("bs: %ld obs: %ld fs: %ld buflen: %d addsize: %d bitstr size: %ld\n", bs, obs, fs, buflen, addsize, bitstr_size(fs/TBLOCK))); X /* X * llitos() overshoots by one space (' ') in cpio mode, add pagesize. X * See also fifo_setparams(). X */ X buflen += pagesize; X X#if defined(USE_MMAP) && defined(USE_USGSHM) X if (shmflag) X buf = mkshm(buflen); X else X buf = mkshare(buflen); X#else X#if defined(USE_MMAP) X buf = mkshare(buflen); X#endif X#if defined(USE_USGSHM) X buf = mkshm(buflen); X#endif X#if defined(USE_OS2SHM) X buf = mkos2shm(buflen); X#endif X#if defined(USE_BEOS_AREAS) X buf = mkbeosshm(buflen); X#endif X#endif X if (buf == NULL) { X comerrno(EX_BAD, X "Cannot get shared memory, fifo missconfigured?\n"); X } X mp = (m_head *)buf; X fillbytes(buf, addsize, '\0'); /* We init the complete add. space */ X stats = &mp->stats; X stats->hdrtype = chdrtype; X mp->base = &buf[addsize]; X mp->iblocked = FALSE; X mp->oblocked = FALSE; X /* X * Note that R'est'size is used to store shareable strings from the X * 'g'lobal P-1.2001 headers. X */ X#ifdef CPIO_ONLY X mp->rsize = addsize - sizeof (m_head) - TBLOCK; X#else X mp->rsize = addsize - sizeof (m_head) - obs; X#endif X if (multivol && cflag) { X /* X * Subtract bitmap size from restsize and set up bitmap pointer X */ X mp->bmlast = (fs/TBLOCK) - 1; X mp->rsize -= bitstr_size(fs/TBLOCK); X mp->bmap = (bitstr_t *) X (((char *)(&(&mp->ginfo)[1])) + mp->rsize); X } X gip = &mp->ginfo; X X fifo_setparams(); X X if (pipe(mp->gp) < 0) X comerr("Cannot create get pipe\n"); X if (pipe(mp->pp) < 0) X comerr("Cannot create put pipe\n"); X X#ifdef F_SETFD X /* X * Set close on exec() flag so the compress program X * or other programs will not inherit our pipes. X */ X fcntl(mp->gp[0], F_SETFD, FD_CLOEXEC); X fcntl(mp->gp[1], F_SETFD, FD_CLOEXEC); X fcntl(mp->pp[0], F_SETFD, FD_CLOEXEC); X fcntl(mp->pp[1], F_SETFD, FD_CLOEXEC); X#endif X X mp->putptr = mp->getptr = mp->base; X fifo_prmp(0); X { X /* Temporary until all modules know about mp->xxx */ X extern int bufsize; X extern char *bigbuf; X extern char *bigptr; X X bufsize = mp->size; X bigptr = bigbuf = mp->base; X } X#ifdef HANG_DEBUG X#ifdef SIGRTMAX X if (signal(SIGRTMAX, SIG_IGN) != SIG_IGN) X set_signal(SIGRTMAX, fifo_prmp); X#endif X#endif X} X XLOCAL void Xfifo_setparams() X{ X if (mp == NULL) { X comerrno(EX_BAD, "Panic: NULL fifo parameter structure.\n"); X /* NOTREACHED */ X return; X } X mp->end = &mp->base[fs]; X fillbytes(mp->end, 10, 'U'); /* Mark llitos() overshoot reserve. */ X mp->size = fs; X mp->ibs = ibs; X mp->obs = obs; X if (mp->bmap) X mp->bmlast = (fs/TBLOCK) - 1; X X if (hiw) X mp->hiw = hiw; X else X mp->hiw = mp->size / 3 * 2; X if (low) X mp->low = low; X else X mp->low = mp->size / 3; X if (mp->low < mp->obs) X mp->low = mp->obs; X if (mp->low > mp->hiw) X mp->low = mp->hiw; X X if (ibs == 0 || mp->ibs > mp->size) X mp->ibs = mp->size; X} X XEXPORT void Xfifo_ibs_shrink(newsize) X int newsize; X{ X ibs = newsize; X fs = (fs/newsize)*newsize; X fifo_setparams(); X} X X/* X * fork() and run FIFO background process in forked child. X * X * Der eigentliche star Prozess ist immer im Vordergrund. X * Der Band Prozess ist immer im Hintergrund. X * X * Band -> fifo -> star X * star -> fifo -> star -copy flag X * star -> fifo -> Band -c flag X * X * Beim Lesen ist der star Prozess der get Prozess. X * Beim Schreiben ist der star Prozess der put Prozess. X */ XEXPORT void Xrunfifo(ac, av) X int ac; X char *const *av; X{ X extern BOOL cflag; X X signal(SIGPIPE, SIG_IGN); X X if ((pid = fork()) < 0) X comerr("Cannot fork.\n"); X X#ifdef USE_OS2SHM X if (pid == 0) X DosGetSharedMem(buf, 3); /* PAG_READ|PAG_WRITE */ X#endif X#ifdef USE_BEOS_AREAS X if (pid == 0) X beosshm_child(); X#endif X X if ((pid != 0) ^ cflag) { X EDEBUG(("Get prozess: cflag: %d pid: %d\n", cflag, pid)); X /* Get Prozess */ X (void) close(mp->gpout); X (void) close(mp->ppin); X } else { X EDEBUG(("Put prozess: cflag: %d pid: %d\n", cflag, pid)); X /* Put Prozess */ X (void) close(mp->gpin); X (void) close(mp->ppout); X } X X if (pid == 0) { X /* X * The background process X */ X if (copyflag) { X mp->ibs = mp->size; X mp->obs = mp->size; X X copy_create(ac, av); X } else if (cflag) { /* In create mode .... */ X /* X * FIFO -> Tape (Get side) X */ X mp->ibs = mp->size; X mp->obs = bs; X do_out(); /* Write archive in background */ X } else { X /* X * Tape -> FIFO (Put side) X */ X mp->flags |= FIFO_IWAIT; X mp->ibs = bs; X mp->obs = mp->size; X do_in(); /* Extract mode: read archive in bg. */ X } X#ifdef USE_OS2SHM X DosFreeMem(buf); X#ifdef __needed__ X sleep(30000); /* XXX If calling _exit() here the parent */ X /* XXX process seems to be blocked. */ X /* XXX This should be fixed soon. */ X#endif X#endif X exit(0); X /* NOTREACHED */ X } else { X extern FILE *tarf; X X if (tarf) X fclose(tarf); X /* X * Here we return from the FIFO set up to the foreground X * TAR process. X */ X } X} X XEXPORT void Xfifo_prmp(sig) X int sig; X{ X#ifdef HANG_DEBUG Xextern BOOL cflag; X X if (sig == 0 && !debug) X return; X X error("pid: %ld (%ld) copy %d cflag %d\n", X (long)getpid(), (long)pid, X copyflag, cflag); X error("waitchan: %d\n", waitchan); X error("putptr: %p\n", mp->putptr); X error("getptr: %p\n", mp->getptr); X error("base: %p\n", mp->base); X error("end: %p\n", mp->end); X error("size: %d\n", mp->size); X error("ibs: %d\n", mp->ibs); X error("obs: %d\n", mp->obs); X error("amt: %ld\n", FIFO_AMOUNT(mp)); X error("icnt: %ld\n", mp->icnt); X error("ocnt: %ld\n", mp->ocnt); X error("iblocked: %d\n", mp->iblocked); X error("oblocked: %d\n", mp->oblocked); X error("m1: %d\n", mp->m1); X error("m2: %d\n", mp->m2); X error("chreel: %d\n", mp->chreel); X error("reelwait: %d\n", mp->reelwait); X error("eflags: %2.2X\n", mp->eflags); X error("pflags: %2.2X\n", mp->pflags); X error("flags: %2.2X\n", mp->flags); X error("hiw: %d\n", mp->hiw); X error("low: %d\n", mp->low); X error("puts: %d\n", mp->puts); X error("gets: %d\n", mp->gets); X error("empty: %d\n", mp->empty); X error("full: %d\n", mp->full); X error("maxfill: %d\n", mp->maxfill); X error("moves: %d\n", mp->moves); X error("mbytes: %lld\n", mp->mbytes); X#ifdef TEST X error("wpin: %d\n", mp->wpin); X error("wpout: %d\n", mp->wpout); X error("rpin: %d\n", mp->rpin); X error("rpout: %d\n", mp->rpout); X#endif X#endif /* HANG_DEBUG */ X} X XEXPORT void Xfifo_stats() X{ X if (no_stats) X return; X X errmsgno(EX_BAD, "fifo had %d puts %d gets.\n", mp->puts, mp->gets); X errmsgno(EX_BAD, "fifo was %d times empty and %d times full.\n", X mp->empty, mp->full); X errmsgno(EX_BAD, "fifo held %d bytes max, size was %d bytes\n", X mp->maxfill, mp->size); X if (mp->moves) { X errmsgno(EX_BAD, X "fifo had %d moves, total of %lld moved bytes\n", X mp->moves, mp->mbytes); X } X if (((mp->pflags & FIFO_MEOF) == 0 && X (mp->eflags & FIFO_EXIT) == 0) || X FIFO_AMOUNT(mp) > 0) { X errmsgno(EX_BAD, "fifo is %lld%% full (%luk), size %dk.\n", X (Llong)FIFO_AMOUNT(mp) * (Llong)100 / mp->size, X FIFO_AMOUNT(mp)/1024, mp->size/1024); X } X} X X X/* X * Semaphore wait X */ XLOCAL int Xswait(f, chan) X int f; X int chan; X{ X int ret; X int err = 0; X unsigned char c = 0; X X waitchan = chan; X seterrno(0); X do { X ret = read(f, &c, 1); X } while (ret < 0 && geterrno() == EINTR); X waitchan = 0; X if (ret < 0) X err = geterrno(); X X if ((mp->pflags & FIFO_MEOF) && (ret == 0)) { X /* X * We come here in case that the other process that should send X * a wakeup died without sending the wakeup because a context X * switch on the waiting process (us) prevented us to set the X * wait flag in time. This is not a problem since we wake up X * from the EOF condition on the sync pipe. We behave as if we X * received a normal wakeup byte. X */ X#ifdef FIFO_EOF_DEBUG Xextern BOOL cflag; X errmsg("Emulate received EOF wakeup on %s side.\n", X ((pid != 0) ^ cflag)? "get": "put"); X#endif X return ((int)c); X } X if (ret <= 0) { X /* X * If pid != 0, this is the foreground process X */ X if (ret < 0 || (mp->eflags & FIFO_EXIT) == 0) { X errmsg( X "Sync pipe read error pid %d ret %d\n", X pid, ret); X errmsg("Ib %d Ob %d e %X p %X g %X chan %d.\n", X mp->iblocked, mp->oblocked, X mp->eflags, mp->pflags, mp->flags, X chan); X } X if ((mp->eflags & FIFO_EXERRNO) != 0) { X /* X * A previous error was seen, keep it. X */ X ret = mp->ferrno; X } else { X /* X * Recent sync pipe read error. X * Signal error to forground process. X */ X mp->eflags |= FIFO_EXERRNO; X if (ret == 0) { X errmsgno(err, X "Sync pipe EOF error pid %d ret %d\n", X pid, ret); X } X if (err) X ret = err; X else X ret = EX_BAD; X mp->ferrno = ret; X } X exprstats(ret); X /* NOTREACHED */ X } X return ((int)c); X} X X/* X * Semaphore wakeup X */ XLOCAL int Xswakeup(f, c) X int f; X char c; X{ X return (write(f, &c, 1)); X} X X#define sgetwait(m, w) swait((m)->gpin, w) X#define sgetwakeup(m, c) swakeup((m)->gpout, (c)) X X#define sputwait(m, w) swait((m)->ppin, w) X#define sputwakeup(m, c) swakeup((m)->ppout, (c)) X X/* X * Return the amount of data from the FIFO available to the reader process. X */ XEXPORT int Xfifo_amount() X{ X return (FIFO_AMOUNT(mp)); X} X X X/* X * Data -> FIFO (Put side) X * X * wait until at least amount bytes may be put into the fifo. X * X * If we are in "-c reate" mode, it is used by the tar process that reads files X * If we are in "-x tract" mode, it is used by the process that reads the tape X */ XEXPORT int Xfifo_iwait(amount) X int amount; X{ X register int cnt; X register m_head *rmp = mp; X X if (rmp->chreel) { /* Block FIFO to allow to change reel */ X EDEBUG(("C")); X rmp->reelwait = TRUE; X sputwait(rmp, 1); X } X if (rmp->pflags & FIFO_MEOF) { X EDEBUG(("E")); X cnt = sputwait(rmp, 2); X /* X * 'n' is from fifo_chitape(), '\0' is the final FIFO shutdown. X */ X if (cnt != 'n' && X !((rmp->eflags & FIFO_EXIT) && cnt == '\0')) { X errmsgno(EX_BAD, X "Implementation botch: with FIFO_MEOF\n"); X comerrno(EX_BAD, X "Did not wake up from fifo_chitape() - got '%c'.\n", X cnt); X } X if (rmp->flags & FIFO_I_CHREEL) { X changetape(TRUE); X rmp->flags &= ~FIFO_I_CHREEL; X rmp->pflags &= ~FIFO_MEOF; X EDEBUG(("t")); X sgetwakeup(rmp, 't'); X } else { X return (-1); X } X } X while ((cnt = rmp->size - FIFO_AMOUNT(rmp)) < amount) { X if (rmp->flags & FIFO_MERROR) { X fifo_stats(); X exit(1); X } X rmp->full++; X rmp->iblocked = TRUE; X EDEBUG(("i")); X sputwait(rmp, 3); X } X if (cnt > rmp->ibs) X cnt = rmp->ibs; X if ((rmp->end - rmp->putptr) < cnt) { X EDEBUG(("at end: cnt: %d max: %d\n", X cnt, rmp->end - rmp->putptr)); X cnt = rmp->end - rmp->putptr; X } X { X /* Temporary until all modules know about mp->xxx */ X extern char *bigptr; X X bigptr = rmp->putptr; X } X return (cnt); X} X X X/* X * Data -> FIFO (Put side) X * X * add amount bytes to putcount and wake up get side if necessary X */ XEXPORT void Xfifo_owake(amount) X int amount; X{ X register m_head *rmp = mp; X X if (amount <= 0) X return; X rmp->puts++; X rmp->putptr += amount; X rmp->icnt += amount; X if (rmp->putptr >= rmp->end) X rmp->putptr = rmp->base; X X if (rmp->oblocked && X ((rmp->flags & FIFO_IWAIT) || X (FIFO_AMOUNT(rmp) >= rmp->low))) { X /* X * Reset oblocked to make sure we send just one single X * weakup event X */ X rmp->oblocked = FALSE; X EDEBUG(("d")); X sgetwakeup(rmp, 'd'); X } X if ((rmp->flags & FIFO_IWAIT)) { X EDEBUG(("I")); X sputwait(rmp, 4); X /* X * Set up shadow properties for this proc. X */ X setprops(stats->hdrtype); X } X} X X X/* X * Data -> FIFO (Put side) X * X * send EOF condition to get side X */ XEXPORT void Xfifo_oflush() X{ X mp->pflags |= FIFO_MEOF; X if (mp->oblocked) { X /* X * Reset oblocked to make sure we send just one single X * weakup event X */ X mp->oblocked = FALSE; X EDEBUG(("e")); X sgetwakeup(mp, 'e'); X } X} X X X/* X * Data -> FIFO (Put side) X * X * final close of sync pipe X */ XEXPORT void Xfifo_oclose() X{ X /* X * Close the pipe that is used to wakeup the Get side that might be X * waiting but we did not notice that mp->oblocked was set because X * it happened too late for us. X * Closing the pipe is an alternate way to wake up the Get side. X */ X fifo_exit(0); X} X X X/* X * FIFO -> Data (Get side) X * X * wait until at least obs bytes may be taken out of fifo X * X * If we are in "-c reate" mode, it is used by the process that writes the tape X * If we are in "-x tract" mode, it is used by the tar process that writes files X */ XEXPORT int Xfifo_owait(amount) X int amount; X{ X int c; X register int cnt; X register m_head *rmp = mp; X Xagain: X /* X * We need to check rmp->pflags & FIFO_MEOF first, because FIFO_AMOUNT() X * gets updated before FIFO_MEOF. X * If we did first check FIFO_AMOUNT(), we could get 0 and a context X * switch after that and after being continued we could get FIFO_MEOF, X * failing to notice that there was a content update meanwhile. X */ X if (rmp->pflags & FIFO_MEOF) { X cnt = FIFO_AMOUNT(rmp); X if (cnt == 0) { X return (cnt); X } X } X X /* X * We need to check rmp->pflags & FIFO_MEOF first, because FIFO_AMOUNT() X * gets updated before FIFO_MEOF. X */ X if ((rmp->pflags & (FIFO_MEOF|FIFO_O_CHREEL)) == 0) { X cnt = FIFO_AMOUNT(rmp); X if (cnt < amount) { X /* X * If a context switch happens here, we may get a EOF X * condition while reading from the sync pipe because X * the other process did already fill up the last chunk X * into the FIFO and called exit(). There may be no way X * to detect that we expect a wakeup as rmp->oblocked X * may be set after the Put process exited. X */ X rmp->empty++; X rmp->oblocked = TRUE; X EDEBUG(("o")); X c = sgetwait(rmp, 5); X } X } X X if (rmp->pflags & FIFO_O_CHREEL) { X cnt = FIFO_AMOUNT(rmp); X if (cnt == 0) { X changetape(TRUE); X rmp->pflags &= ~FIFO_O_CHREEL; X EDEBUG(("T")); X sputwakeup(mp, 'T'); X goto again; X } X } X cnt = FIFO_AMOUNT(rmp); X X if (rmp->maxfill < cnt) X rmp->maxfill = cnt; X X if (cnt > rmp->obs) X cnt = rmp->obs; X X c = rmp->end - rmp->getptr; /* Compute max. contig. content */ X#ifdef CPIO_ONLY X if (c < TBLOCK && c < cnt) { /* XXX Check for c < amount too? */ X#else X if (c < obs && c < cnt) { /* Check for initial obs val */ X#endif X /* X * A left over residual at the end of the FIFO is smaller X * than 512 bytes (CPIO_ONLY) or 'obs' (auto-detect multivol X * split) and there is additional data at the beginning X * of the FIFO. X * Move the residual before the beginning of the FIFO to make X * the content continuous. X */ X char *p; X X p = rmp->base - c; X movebytes(rmp->getptr, p, c); X rmp->moves++; X rmp->mbytes += c; X rmp->getptr = p; X c = rmp->end - rmp->getptr; X } X /* X * If there is more data in the FIFO than from the get ptr to the end X * of the FIFO and this is still more than the requested data, reduce X * "cnt" to what can be read in a single transfer. X */ X if (cnt > c && c >= amount) X cnt = c; X X if (rmp->getptr + cnt > rmp->end) { X errmsgno(EX_BAD, "getptr >: %p %p %d end: %p\n", X (void *)rmp->getptr, (void *)&rmp->getptr[cnt], X cnt, (void *)rmp->end); X } X { X /* Temporary until all modules know about mp->xxx */ X extern char *bigptr; X X bigptr = rmp->getptr; X } X return (cnt); X} X X X/* X * FIFO -> Data (Get side) X * X * add amount bytes to getcount and wake up put side if necessary X */ XEXPORT void Xfifo_iwake(amt) X int amt; X{ X register m_head *rmp = mp; X X if (amt <= 0) { X rmp->flags |= FIFO_MERROR; X exit(1); X } X X rmp->gets++; X rmp->getptr += amt; X rmp->ocnt += amt; X X if (rmp->getptr >= rmp->end) X rmp->getptr = rmp->base; X X if (rmp->iblocked && (FIFO_AMOUNT(rmp) <= rmp->hiw)) { X /* X * Reset iblocked to make sure we send just one single X * weakup event X */ X rmp->iblocked = FALSE; X EDEBUG(("s")); X sputwakeup(rmp, 's'); X } X} X X/* X * FIFO -> Data (Get side) X * X * Wake up the put side in case it is wating on rmp->reelwait X */ XEXPORT void Xfifo_reelwake() X{ X register m_head *rmp = mp; X X if (rmp->reelwait) { X /* X * Reset reelwait to make sure we send just one single X * weakup event X */ X rmp->reelwait = FALSE; X EDEBUG(("R")); X sputwakeup(rmp, 'R'); X } X} X X/* X * FIFO -> Data (Get side) X * X * Resume FIFO, this is needed as we now know that we may need to do swap data. X */ XEXPORT void Xfifo_resume() X{ X register m_head *rmp = mp; X X if ((rmp->flags & FIFO_IWAIT) != 0) { X rmp->flags &= ~FIFO_IWAIT; X EDEBUG(("S")); X sputwakeup(rmp, 'S'); X } X} X X/* X * Data -> FIFO (Put side) X */ XEXPORT void Xfifo_sync(size) X int size; X{ X register m_head *rmp = mp; X int rest = 0; X int smax = rmp->end - rmp->putptr; X int amt = FIFO_AMOUNT(rmp); X X if (size) { X if ((amt % size) != 0) X rest = size - amt%size; X } else { X if ((amt % rmp->obs) != 0) X rest = rmp->obs - amt%rmp->obs; X } X X /* X * Be careful with the size, as we might have changed mp->obs. X */ X if (rest > smax) X rest = smax; X fifo_iwait(rest); X fillbytes(rmp->putptr, rest, '\0'); X fifo_owake(rest); X} X XEXPORT int Xfifo_errno() X{ X /* X * Note that we may be called with fifo not active. X */ X if (mp == NULL) X return (0); X X if ((mp->eflags & FIFO_EXERRNO) != 0) X return (mp->ferrno); X return (0); X} X X/* ARGSUSED */ XEXPORT void Xfifo_onexit(err, ignore) X int err; X void *ignore; X{ X fifo_exit(err); X} X X/* X * Both sides of the FIFO may call this X */ XEXPORT void Xfifo_exit(err) X int err; X{ X extern BOOL cflag; X X /* X * Note that we may be called with fifo not active. X */ X if (mp == NULL) X return; X X /* X * Tell other side of FIFO to exit(). X */ X mp->eflags |= FIFO_EXIT; X if (err != 0) { X mp->eflags |= FIFO_EXERRNO; X mp->ferrno = err; X } X X /* X * Wake up other side by closing the sync pipes. X */ X if ((pid != 0) ^ cflag) { X EDEBUG(("Fifo_exit() from get prozess: cflag: %d pid: %d\n", cflag, pid)); X /* Get Prozess */ X (void) close(mp->gpin); X (void) close(mp->ppout); X } else { X EDEBUG(("Fifo_exit() from put prozess: cflag: %d pid: %d\n", cflag, pid)); X /* Put Prozess */ X (void) close(mp->gpout); X (void) close(mp->ppin); X } X} X X/* X * FIFO -> Data (Get side) X * X * The tar -x/-t process tells the tape process to mount a new volume. X */ XEXPORT void Xfifo_chitape() X{ X char c; X X mp->flags |= FIFO_I_CHREEL; X if (mp->pflags & FIFO_MEOF) { X EDEBUG(("n")); X sputwakeup(mp, 'n'); X } else { X comerrno(EX_BAD, X "Implementation botch: FIFO_MEOF not set in fifo_chitape()\n"); X } X EDEBUG(("w")); X c = sgetwait(mp, 6); X if (c != 't') { X errmsgno(EX_BAD, "Implementation botch: with FIFO_I_CHREEL\n"); X comerrno(EX_BAD, X "Did not wake up from fifo_iwait() - got '%c'.\n", c); X } X} X X/* X * Data -> FIFO (Put side) X * X * The tar -c process tells the tape process to mount a new volume. X */ XEXPORT void Xfifo_chotape() X{ X char c; X X mp->pflags |= FIFO_O_CHREEL; X if (mp->oblocked) { X /* X * Reset oblocked to make sure we send just one single X * weakup event X */ X mp->oblocked = FALSE; X EDEBUG(("N")); X sgetwakeup(mp, 'N'); X } X EDEBUG(("W")); X c = sputwait(mp, 7); X if (c != 'T') { X errmsgno(EX_BAD, "Implementation botch: with FIFO_O_CHREEL\n"); X comerrno(EX_BAD, X "Did not wake up from fifo_owait() - got '%c'.\n", c); X } X} X X/* X * Tape -> FIFO (Put/Input side) X * X * Tape input process for the FIFO. X * This process runs in background and fills the FIFO with data from the TAPE. X * Also wait in fifo_owake() if FIFO_IWAIT and we ware reading the first block. X */ XLOCAL void Xdo_in() X{ X int amt; X int cnt; X X /* X * First start reading to reduce total startup time. X */ X cnt = fifo_iwait(mp->ibs); X amt = readtape(mp->putptr, cnt); X /* X * Wait until the foregound Get/Output process did start to read. X * usleep(1000) will usually not wait at all but may yield X * to a context switch. X */ X for (cnt = 0; cnt < 5000 && mp->oblocked == FALSE; cnt++) X usleep(1000); X goto owake; X Xnextread: X do { X cnt = fifo_iwait(mp->ibs); X amt = readtape(mp->putptr, cnt); Xowake: X fifo_owake(amt); X } while (amt > 0); X X fifo_oflush(); X if (multivol) { X /* X * In theory, we don't need to test 'multivol' here. X * We would die later from EOF in the sync pipe. X */ X cnt = fifo_iwait(mp->ibs); /* Media is changed here */ X if (cnt > 0) { X int skip; X X amt = readtape(mp->putptr, cnt); X while (amt > 0 && X !verifyvol(mp->putptr, amt, X stats->volno, &skip)) { X changetape(FALSE); X amt = readtape(mp->putptr, cnt); X } X if (skip > 0) X fifo_iwake(skip*TBLOCK); X if (amt > 0) { X fifo_owake(amt); X goto nextread; X } X } X } X closetape(); X} X X/* X * FIFO -> Tape (Get/Output side) X * X * Tape output process for the FIFO. X * This process runs in background and writes to the TAPE using X * data from the FIFO. X */ XLOCAL void Xdo_out() X{ X int cnt; X int amt; X X for (;;) { X cnt = fifo_owait(mp->obs); X if (cnt == 0) X break; Xnextwrite: X amt = writetape(mp->getptr, cnt); X if (amt == -2) { X changetape(TRUE); X if ((amt = startvol(mp->getptr, cnt)) <= 0) X goto nextwrite; X } X if (multivol) { X int startb = (mp->getptr - mp->base) / TBLOCK; X int stopb = startb - 1 + amt / TBLOCK; X X if (mp->getptr < mp->base) { X stopb = mp->bmlast; X startb = stopb + 1 - (mp->base - mp->getptr) / TBLOCK; X if ((mp->getptr + amt) < mp->base) X stopb = startb - 1 + amt / TBLOCK; X fbit_nclear(mp->bmap, startb, stopb); X if ((mp->getptr + amt) < mp->base) { X startb = stopb = -1; X } else { X startb = 0; X stopb = -1 + (amt - (mp->base - mp->getptr)) / TBLOCK; X } X } X if (startb >= 0) X fbit_nclear(mp->bmap, startb, stopb); X } X fifo_iwake(amt); X } X closetape(); X} X X/* X * Make the macro a function... X */ XLOCAL void Xfbit_nclear(name, startb, stopb) X register bitstr_t *name; X register int startb; X register int stopb; X{ X bit_nclear(name, startb, stopb); X} X X/* -------------------------------------------------------------------------- */ X/* X * Allocate shared memory for the FIFO. X */ X X#ifdef USE_MMAP XLOCAL char * Xmkshare(size) X int size; X{ X int f; X char *addr; X X#ifdef MAP_ANONYMOUS /* HP/UX */ X f = -1; X addr = mmap(0, mmap_sizeparm(size), PROT_READ|PROT_WRITE, X MAP_SHARED|MAP_ANONYMOUS, f, 0); X#else X if ((f = open("/dev/zero", O_RDWR)) < 0) X comerr("Cannot open '/dev/zero'.\n"); X addr = mmap(0, mmap_sizeparm(size), PROT_READ|PROT_WRITE, X MAP_SHARED, f, 0); X#endif X if (addr == (char *)-1) X comerr("Cannot get mmap for %d Bytes on /dev/zero.\n", size); X if (f >= 0) X close(f); X X if (debug) { X errmsgno(EX_BAD, X "shared memory segment attached at: %p size %d\n", X (void *)addr, size); X } X X#ifdef HAVE_MLOCK X if (getuid() == 0 && mlock(addr, size) < 0) X errmsg("Cannot lock fifo memory.\n"); X#endif X X return (addr); X} X#endif X X#ifdef USE_USGSHM X#include X#include XLOCAL char * Xmkshm(size) X int size; X{ X int id; X char *addr; X /* X * Unfortunately, a declaration of shmat() is missing in old X * implementations such as AT&T SVr0 and SunOS. X * We cannot add this definition here because the return-type X * changed on newer systems. X * X * We will get a warning like this: X * X * warning: assignment of pointer from integer lacks a cast X * or X * warning: illegal combination of pointer and integer, op = X */ X#ifdef __never__ X extern char *shmat(); X#endif X X if ((id = shmget(IPC_PRIVATE, size, IPC_CREAT|0600)) == -1) X comerr("shmget failed\n"); X X if (debug) { X errmsgno(EX_BAD, X "shared memory segment allocated: %d\n", id); X } X X if ((addr = shmat(id, (char *)0, 0600)) == (char *)-1) X comerr("shmat failed\n"); X X if (debug) { X errmsgno(EX_BAD, X "shared memory segment attached at: %p size %d\n", X (void *)addr, size); X } X X if (shmctl(id, IPC_RMID, 0) < 0) X comerr("shmctl failed\n"); X X#ifdef SHM_LOCK X /* X * Although SHM_LOCK is standard, it seems that all versions of AIX X * ommit this definition. X */ X if (getuid() == 0 && shmctl(id, SHM_LOCK, 0) < 0) X errmsg("shmctl failed to lock shared memory segment\n"); X#endif X X return (addr); X} X#endif X X#ifdef USE_OS2SHM XLOCAL char * Xmkos2shm(size) X int size; X{ X char *addr; X X /* X * The OS/2 implementation of shm (using shm.dll) limits the size of X * one shared memory segment to 0x3fa000 (aprox. 4MBytes). Using OS/2 X * native API we have no such restriction so I decided to use it X * allowing fifos of arbitrary size. X */ X if (DosAllocSharedMem(&addr, NULL, size, 0X100L | 0x1L | 0x2L | 0x10L)) X comerr("DosAllocSharedMem() failed\n"); X X if (debug) { X errmsgno(EX_BAD, X "shared memory allocated attached at: %p size %d\n", X (void *)addr, size); X } X X return (addr); X} X#endif X X#ifdef USE_BEOS_AREAS XLOCAL area_id fifo_aid; XLOCAL void *fifo_addr; XLOCAL char fifo_name[32]; X XLOCAL char * Xmkbeosshm(size) X int size; X{ X snprintf(fifo_name, sizeof (fifo_name), "star FIFO %lld", X (Llong)getpid()); X X fifo_aid = create_area(fifo_name, &fifo_addr, X B_ANY_ADDRESS, X size, X B_NO_LOCK, B_READ_AREA|B_WRITE_AREA); X if (fifo_addr == NULL) { X comerrno(fifo_aid, X "Cannot get create_area for %d Bytes FIFO.\n", size); X } X if (debug) { X errmsgno(EX_BAD, X "shared memory allocated attached at: %p size %d\n", X (void *)fifo_addr, size); X } X X return (fifo_addr); X} X XLOCAL void Xbeosshm_child() X{ X /* X * Delete the area created by fork that is copy-on-write. X */ X delete_area(area_for(fifo_addr)); X /* X * Clone (share) the original one. X * The original implementaion used B_ANY_ADDRESS, but newer Haiku X * versions implement address randomization that prevents us from X * using the pointer in the child. So we noe use B_EXACT_ADDRESS. X */ X fifo_aid = clone_area(fifo_name, &fifo_addr, X B_EXACT_ADDRESS, B_READ_AREA|B_WRITE_AREA, X fifo_aid); X if (buf != fifo_addr) { X comerrno(EX_BAD, "Panic FIFO addr.\n"); X /* NOTREACHED */ X } X} X#endif X X#endif /* FIFO */ END-of-star-1.6/star/fifo.c echo x - star-1.6/star/fifo.h sed 's/^X//' >star-1.6/star/fifo.h << 'END-of-star-1.6/star/fifo.h' X/* @(#)fifo.h 1.36 18/10/22 Copyright 1989-2018 J. Schilling */ X/* X * Definitions for a "fifo" that uses X * shared memory between two processes X * X * Copyright (c) 1989-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _FIFO_H X#define _FIFO_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X#ifndef _SCHILY_STANDARD_H X#include X#endif X#ifndef _BITSTRING_H X#include "bitstring.h" X#endif X X#if defined(HAVE_OS_H) && \ X defined(HAVE_CLONE_AREA) && defined(HAVE_CREATE_AREA) && \ X defined(HAVE_DELETE_AREA) X#include X#define HAVE_BEOS_AREAS /* BeOS/Zeta */ X#endif X#if !defined(HAVE_SMMAP) && !defined(HAVE_USGSHM) && \ X !defined(HAVE_DOSALLOCSHAREDMEM) && !defined(HAVE_BEOS_AREAS) X#undef FIFO /* We cannot have a FIFO on this platform */ X#endif X#if !defined(HAVE_FORK) X#undef FIFO /* We cannot have a FIFO on this platform */ X#endif X X/* X * Statistics data that needs to be in shared memory X */ Xtypedef struct { X BOOL reading; /* true if currently reading from tape */ X int swapflg; /* -1: init, 0: FALSE, 1: TRUE */ X int hdrtype; /* Hdrtype used for read/write */ X int volno; /* Volume # */ X int nblocks; /* Blocksize for each transfer in TBLOCK */ X long blocksize; /* Blocksize for each transfer in bytes */ X long lastsize; /* Size of last transfer (for backtape) */ X Llong eofblock; /* EOF block # on Volume */ X Llong blocks; /* Full blocks transfered on Volume */ X Llong parts; /* Bytes fom partial transferes on Volume */ X Llong Tblocks; /* Total blocks transfered */ X Llong Tparts; /* Total Bytes fom partial transferes */ X off_t cur_size; /* The size of the current file (multivol) */ X off_t cur_off; /* The off for the current file (multivol) */ X off_t old_size; /* The size for the last block write */ X off_t old_off; /* The off for the last block wrte */ X} m_stats; X X/* X * Shared data used to control the FIFO. X * X * This structure is at the start of the shared memory segment. X * X * If the first character in the comment is a P, this is modified by the put X * side. X * X * If the first character in the comment is a G, this is modified by the get X * side. X * X * In order to avoid the need for semaphores to control the change of values X * in this structure, members marked with "P", are only modified by the X * put side of the FIFO and members marked with "G" are only marked by the X * get side of the FIFO. X * X * Members marked with "P-" are set by the put side and reset by the get side. X * Members marked with "G-" are set by the get side and reset by the put side. X * Since this reset happens while the "set" side did already decide to wait X * and the reset happens just before the other side decided to wake up the X * the first side, this is not a problem. X */ X#define V volatile Xtypedef struct { X char * V putptr; /* P put pointer within shared memory */ X char * V getptr; /* G get pointer within shared memory */ X char *base; /* fifobase within shared memory segment */ X char *end; /* end of real shared memory segment */ X int size; /* fifosize within shared memory segment */ X int ibs; /* input transfer size */ X int obs; /* output transfer size */ X int rsize; /* restsize between head struct and .base */ X V unsigned long icnt; /* P input count (incremented on each put) */ X V unsigned long ocnt; /* G output count (incremented on each get) */ X V char iblocked; /* P- input (put side) is blocked */ X V char oblocked; /* G- output (get side) is blocked */ X V char m1; /* Semaphore claimed by newvolhdr() */ X V char m2; /* Semaphore claimed by cr_file() */ X V char chreel; /* Semaphore claimed by startvol() */ X V char reelwait; /* P- input (put side) is blocked on "chreel" */ X V char eflags; /* fifo exit flags */ X V char pflags; /* fifo put flags */ X V int flags; /* fifo flags */ X V int ferrno; /* errno from fifo background process */ X int hiw; /* highwater mark */ X int low; /* lowwater mark */ X int gp[2]; /* sync pipe for get process */ X int pp[2]; /* sync pipe for put process */ X V int puts; /* fifo put count statistic */ X V int gets; /* fifo get get statistic */ X V int empty; /* fifo was empty count statistic */ X V int full; /* fifo was full count statistic */ X V int maxfill; /* max # of bytes in fifo */ X V int moves; /* # of moves of residual bytes */ X V Llong mbytes; /* # of residual bytes moved */ X m_stats stats; /* statistics */ X bitstr_t *bmap; /* Bitmap used to store TCB positions */ X int bmlast; /* Last bits # in use in above Bitmap */ X GINFO ginfo; /* To share GINFO for P.1-2001 'g' headers */ X} m_head; X#undef V X X#define gpin gp[0] /* get pipe in */ X#define gpout gp[1] /* get pipe out */ X#define ppin pp[0] /* put pipe in */ X#define ppout pp[1] /* put pipe out */ X X#define FIFO_AMOUNT(p) ((p)->icnt - (p)->ocnt) X X/* X * The FIFO flags are used only inside fifo.c X * X * FIFO_MERROR set by the get side X * FIFO_IWAIT set by the put side before startup, reset by the get side X * FIFO_I_CHREEL set by the get side, reset by the put side with get waiting X * X * pflags: X * FIFO_MEOF set and reset by the put side X * FIFO_O_CHREEL set by the put side, reset by the get side with put waiting X * X * eflags: X * FIFO_EXIT set by the side that decided to abort the program X * FIFO_EXERRNO set by the side that decided to abort the program X */ X#define FIFO_MERROR 0x001 /* G error on input (get side) */ X X#define FIFO_IWAIT 0x010 /* G input (put side) wait after first record */ X#define FIFO_I_CHREEL 0x020 /* G change in tape reel if fifo gets empty */ X X#define FIFO_MEOF 0x001 /* P EOF on input (put side) */ X#define FIFO_O_CHREEL 0x002 /* P change out tape reel if fifo gets empty */ X X#define FIFO_EXIT 0x001 /* E exit() on non tape side */ X#define FIFO_EXERRNO 0x002 /* E errno from non tape side */ X X#ifdef FIFO X/* X * Critical section handling for multi volume support. X * X * This code is used to protect access to stat->cur_size & stat->cur_off X * when preparing the multi volume header. Calling blocking code from X * within a critical section is not permitted. For this reason, and because X * this only may block when a media change is done, the delay time is not X * important or critical. X */ Xextern BOOL use_fifo; X X#define fifo_enter_critical() if (use_fifo) { \ X extern m_head *mp; \ X \ X while (mp->m1) \ X usleep(100000); \ X mp->m2 = TRUE; \ X } X X#define fifo_leave_critical() if (use_fifo) { \ X extern m_head *mp; \ X \ X mp->m2 = FALSE; \ X } X X#define fifo_lock_critical() if (use_fifo) { \ X extern m_head *mp; \ X \ X mp->m1 = TRUE; \ X while (mp->m2) \ X usleep(100000); \ X } X X#define fifo_unlock_critical() if (use_fifo) { \ X extern m_head *mp; \ X \ X mp->m1 = FALSE; \ X } X#else X#define fifo_enter_critical() X#define fifo_leave_critical() X#define fifo_lock_critical() X#define fifo_unlock_critical() X#endif X X#endif /* _FIFO_H */ END-of-star-1.6/star/fifo.h echo x - star-1.6/star/header.c sed 's/^X//' >star-1.6/star/header.c << 'END-of-star-1.6/star/header.c' X/* @(#)header.c 1.198 19/03/26 Copyright 1985, 1994-2019 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)header.c 1.198 19/03/26 Copyright 1985, 1994-2019 J. Schilling"; X#endif X/* X * Handling routines to read/write, parse/create X * archive headers X * X * Copyright (c) 1985, 1994-2019 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include "star.h" X#include "props.h" X#include "table.h" X#include X#include X#include X#define __XDEV__ /* Needed to activate _dev_major()/_dev_minor() */ X#include X#define GT_COMERR /* #define comerr gtcomerr */ X#define GT_ERROR /* #define error gterror */ X#include X#include X#include "starsubs.h" X#include "checkerr.h" X#include "fifo.h" X X /* ustar */ XLOCAL char magic[TMAGLEN] = TMAGIC; X /* star */ XLOCAL char stmagic[STMAGLEN] = STMAGIC; X /* gnu tar */ XLOCAL char gmagic[GMAGLEN] = GMAGIC; X Xtypedef struct { X char *h_name; X char *h_text; X Int8_t h_type; X UInt8_t h_flags; X} htab_t; X X#define HF_RO 0x01 /* Read only entry - may not be set via cmd line */ X XLOCAL htab_t htab[] = { X/* BEGIN CSTYLED */ X/* 0 */ { "UNDEFINED", "Undefined archive", H_UNDEF, HF_RO }, X/* 1 */ { "unknown tar", "Unknown tar format", H_TAR, HF_RO }, X/* 2 */ { "v7tar", "Old UNIX V7 tar format", H_V7TAR, 0 }, X/* 3 */ { "tar", "Old BSD tar format", H_OTAR, 0 }, X/* 4 */ { "star", "Old star format from 1985", H_STAR, 0 }, X/* 5 */ { "gnutar", "GNU tar format 1989 (violates POSIX)", H_GNUTAR, 0 }, X/* 6 */ { "ustar", "Standard POSIX.1-1988 tar format", H_USTAR, 0 }, X/* 7 */ { "xstar", "Extended standard tar (star 1994)", H_XSTAR, 0 }, X/* 8 */ { "xustar", "'xstar' format without tar signature", H_XUSTAR, 0 }, X/* 9 */ { "exustar", "'xustar' format - always x-header", H_EXUSTAR, 0 }, X/*10 */ { "pax", "Extended POSIX.1-2001 standard tar", H_PAX, 0 }, X/*11 */ { "epax", "Extended POSIX.1-2001 standard tar + x-header", H_EPAX, 0 }, X/*12 */ { "suntar", "Sun's extended pre-POSIX.1-2001", H_SUNTAR, 0 }, X X/*15 */ { "bar", "SunOS 4.x bar format", H_BAR, HF_RO }, X X/*16 */ { "bin", "cpio UNIX V7 binary format", H_CPIO_BIN, 0 }, X/*17 */ { "cpio", "cpio POSIX.1-1988 format", H_CPIO_CHR, 0 }, X/*18 */ { "odc", "cpio POSIX.1-1988 with SYSv compat", H_CPIO_ODC, 0 }, X/*19 */ { "nbin", "CPIO NBIN", H_CPIO_NBIN, HF_RO }, X/*20 */ { "crcbin", "CPIO CRCBIN", H_CPIO_CRC, HF_RO }, X/*21 */ { "asc", "SYSvr4 cpio ascii expanded device #", H_CPIO_ASC, 0 }, X/*22 */ { "crc", "'asc' format + CRC", H_CPIO_ACRC, 0 }, X X { NULL, NULL, 0, 0 }, X}; X/* END CSTYLED */ X X/* X * Compression names X */ XLOCAL char *cnames[] = { X "unknown", /* 0 C_NONE */ X "pack", /* 1 C_PACK */ X "gzip", /* 2 C_GZIP */ X "lzw", /* 3 C_LZW */ X "freeze", /* 4 C_FREEZE */ X "lzh", /* 5 C_LZH */ X "pkzip", /* 6 C_PKZIP */ X "bzip2", /* 7 C_BZIP2 */ X "lzo", /* 8 C_LZO */ X "7z", /* 9 C_7Z */ X "xz", /* 10 C_XZ */ X "lzip", /* 11 C_LZIP */ X "zstd", /* 12 C_ZSTD */ X "lzma", /* 13 C_LZMA */ X "freeze2", /* 14 C_FREEZE2 */ X}; X Xextern FILE *tty; Xextern FILE *vpr; Xextern const char *tarfiles[]; /* Cycle list of all archives */ Xextern int tarfindex; /* Current index in list */ Xextern BOOL multivol; Xextern long hdrtype; Xextern long chdrtype; Xextern int cmptype; Xextern int version; Xextern int swapflg; Xextern BOOL print_artype; Xextern BOOL debug; Xextern BOOL numeric; Xextern int verbose; Xextern BOOL rflag; Xextern BOOL uflag; Xextern BOOL xflag; Xextern BOOL nflag; Xextern BOOL ignoreerr; Xextern BOOL signedcksum; Xextern BOOL nowarn; Xextern BOOL nullout; Xextern BOOL modebits; /* -modebits more than 12 bits */ Xextern BOOL linkdata; X Xextern Ullong tsize; X Xextern char *bigbuf; Xextern int bigsize; X XLOCAL Ulong checksum __PR((TCB *ptb)); XLOCAL Ulong bar_checksum __PR((TCB *ptb)); XLOCAL BOOL signedtarsum __PR((TCB *ptb, Ulong ocheck)); XEXPORT BOOL tarsum_ok __PR((TCB *ptb)); XLOCAL BOOL isstmagic __PR((char *s)); XLOCAL BOOL isxmagic __PR((TCB *ptb)); XLOCAL BOOL ismagic __PR((char *s)); XLOCAL BOOL isgnumagic __PR((char *s)); XLOCAL BOOL strxneql __PR((char *s1, char *s2, int l)); XLOCAL BOOL istarnumber __PR((char *s, int fieldw)); XLOCAL BOOL ustmagcheck __PR((TCB *ptb)); XEXPORT void print_hdrtype __PR((FILE *f, int type)); XEXPORT char *hdr_name __PR((int type)); XEXPORT char *hdr_text __PR((int type)); XEXPORT int hdr_type __PR((char *name)); XEXPORT void hdr_usage __PR((void)); XEXPORT int get_hdrtype __PR((TCB *ptb, BOOL isrecurse)); XLOCAL int get_xhtype __PR((TCB *ptb, int htype)); XEXPORT int get_compression __PR((TCB *ptb)); XEXPORT char *get_cmpname __PR((int type)); XEXPORT int get_tcb __PR((TCB *ptb)); XEXPORT void put_tcb __PR((TCB *ptb, FINFO *info)); XEXPORT void write_tcb __PR((TCB *ptb, FINFO *info)); XEXPORT void info_to_tcb __PR((FINFO *info, TCB *ptb)); XLOCAL void info_to_star __PR((FINFO *info, TCB *ptb)); XLOCAL void info_to_ustar __PR((FINFO *info, TCB *ptb)); XLOCAL void info_to_xstar __PR((FINFO *info, TCB *ptb)); XLOCAL void info_to_gnutar __PR((FINFO *info, TCB *ptb)); XEXPORT int tcb_to_info __PR((TCB *ptb, FINFO *info)); XLOCAL void tar_to_info __PR((TCB *ptb, FINFO *info)); XLOCAL void star_to_info __PR((TCB *ptb, FINFO *info)); XLOCAL void ustar_to_info __PR((TCB *ptb, FINFO *info)); XLOCAL void xstar_to_info __PR((TCB *ptb, FINFO *info)); XLOCAL void gnutar_to_info __PR((TCB *ptb, FINFO *info)); XLOCAL int ustoxt __PR((int ustype)); XLOCAL BOOL checkeof __PR((TCB *ptb)); XLOCAL BOOL eofblock __PR((TCB *ptb)); XLOCAL void stoli __PR((char *s, Ulong * l, int fieldw)); XEXPORT void stolli __PR((char *s, Ullong *ull)); XLOCAL void litos __PR((char *s, Ulong l, int fieldw)); XEXPORT void llitos __PR((char *s, Ullong ull, int fieldw)); XLOCAL void stob __PR((char *s, Ulong *l, int fieldw)); XLOCAL void stollb __PR((char *s, Ullong *ull, int fieldw)); XLOCAL void btos __PR((char *s, Ulong l, int fieldw)); XLOCAL void llbtos __PR((char *s, Ullong ull, int fieldw)); XLOCAL BOOL nameascii __PR((char *name)); XLOCAL void print_hrange __PR((char *type, Ullong ull)); XEXPORT void dump_info __PR((FINFO *info)); X X/* X * XXX Hier sollte eine tar/bar universelle Checksummenfunktion sein! X */ X#define CHECKS sizeof (ptb->ustar_dbuf.t_chksum) X/* X * We know, that sizeof (TCP) is 512 and therefore has no X * reminder when dividing by 8 X * X * CHECKS is known to be 8 too, use loop unrolling. X */ X#define DO8(a) a; a; a; a; a; a; a; a; X XLOCAL Ulong Xchecksum(ptb) X register TCB *ptb; X{ X register int i; X register Ulong sum = 0; X register Uchar *us; X X if (signedcksum) { X register char *ss; X register long ssum = 0; X X ss = (char *)ptb; X for (i = sizeof (*ptb)/8; --i >= 0; ) { X DO8(ssum += *ss++); X } X if (ssum == 0L) { /* Block containing 512 nul's? */ X signedcksum = FALSE; X sum = checksum(ptb); X signedcksum = TRUE; X return (sum); X } X X ss = (char *)ptb->ustar_dbuf.t_chksum; X DO8(ssum -= *ss++); X ssum += CHECKS*' '; X sum = ssum; X } else { X us = (Uchar *)ptb; X for (i = sizeof (*ptb)/8; --i >= 0; ) { X DO8(sum += *us++); X } X if (sum == 0L) /* Block containing 512 nul's */ X return (sum); X X us = (Uchar *)ptb->ustar_dbuf.t_chksum; X DO8(sum -= *us++); X sum += CHECKS*' '; X } X return (sum); X} X#undef CHECKS X X#define CHECKS sizeof (ptb->bar_dbuf.t_chksum) X XLOCAL Ulong Xbar_checksum(ptb) X register TCB *ptb; X{ X register int i; X register Ulong sum = 0; X register Uchar *us; X X if (signedcksum) { X register char *ss; X register long ssum = 0; X X ss = (char *)ptb; X for (i = sizeof (*ptb); --i >= 0; ) X ssum += *ss++; X if (ssum == 0L) { /* Block containing 512 nul's? */ X signedcksum = FALSE; X sum = bar_checksum(ptb); X signedcksum = TRUE; X return (sum); X } X X for (i = CHECKS, ss = (char *)ptb->bar_dbuf.t_chksum; --i >= 0; ) X ssum -= *ss++; X ssum += CHECKS*' '; X sum = ssum; X } else { X us = (Uchar *)ptb; X for (i = sizeof (*ptb); --i >= 0; ) X sum += *us++; X if (sum == 0L) /* Block containing 512 nul's */ X return (sum); X X for (i = CHECKS, us = (Uchar *)ptb->bar_dbuf.t_chksum; --i >= 0; ) X sum -= *us++; X sum += CHECKS*' '; X } X return (sum); X} X#undef CHECKS X XLOCAL BOOL Xsignedtarsum(ptb, ocheck) X TCB *ptb; X Ulong ocheck; X{ X BOOL osigned = signedcksum; X Ulong check; X X if (ocheck == 0) X return (FALSE); X X signedcksum = !signedcksum; X check = checksum(ptb); X if (ocheck == check) { X errmsgno(EX_BAD, "WARNING: archive uses %s checksums.\n", X signedcksum?"signed":"unsigned"); X return (TRUE); X } X signedcksum = osigned; X return (FALSE); X} X X/* X * XXX Shouldn't we use this or something similar from get_tcb() too? X */ XEXPORT BOOL Xtarsum_ok(ptb) X TCB *ptb; X{ X Ulong ocheck; X Ulong check; X X /* X * We are currently only called with TAR type archives, so using 7 for X * fieldwidth is OK. X */ X stoli(ptb->dbuf.t_chksum, &ocheck, 7); X if (ocheck == 0) X return (FALSE); X check = checksum(ptb); X if (ocheck != check && !signedtarsum(ptb, ocheck)) X return (FALSE); X return (TRUE); X} X XLOCAL BOOL Xisstmagic(s) X char *s; X{ X return (strxneql(s, stmagic, STMAGLEN)); X} X X/* X * Check for XSTAR / XUSTAR format. X * X * Since we ise this function after we checked for the "tar" signature, it X * is unly used as a XUSTAR check. X * X * This is star's upcoming new standard format. This format understands star's X * old extended POSIX format and in future will write POSIX.1-2001 extensions X * using 'x' headers. X * Star also detects the archive format from the value of X * the "SCHILY.archtype=" POSIX.1-2001 header tag. X */ XLOCAL BOOL Xisxmagic(ptb) X TCB *ptb; X{ X register int i; X X /* X * prefix[130] is is granted to be '\0' with 'xstar'. X */ X if (ptb->xstar_dbuf.t_prefix[130] == '\0') { X /* X * True for all 'standard' TCBs except with typeflag 'M' X */ X /* EMPTY */ X ; X } else if (ptb->ustar_dbuf.t_typeflag == 'M') { X /* X * We come only here if we try to read in a multivol archive X * starting past volume #0. If we start with volume #0, all X * multi volume headers are skiped by the low level multi X * volume handling code. X */ X if ((ptb->xstar_in_dbuf.t_offset[11] != ' ') && X ((ptb->xstar_in_dbuf.t_offset[0] & 0x80) == 0)) X return (FALSE); X } else { X return (FALSE); X } X X /* X * If atime[0]...atime[10] or ctime[0]...ctime[10] X * is not a POSIX octal number it cannot be 'xstar'. X * With the octal representation we may store any date X * for 1970 +- 136 years (1834 ... 2106). X * X * After 2106 we will most likely always use POSIX.1-2001 'x' X * headers but still use base 256 numbers in the old tar header. X * We thus still need to check for base 256 numbers even though X * this is very unlikely since we create 'x' headers if nanoseconds X * are != 0 and then use a 0 time stamp for atime/ctime in the X * 'x' header. X */ X for (i = 0; i < 11; i++) { X if ((ptb->xstar_dbuf.t_atime[0] & 0x80) == 0 && X (ptb->xstar_dbuf.t_atime[i] < '0' || X ptb->xstar_dbuf.t_atime[i] > '7')) X return (FALSE); X if (((ptb->xstar_dbuf.t_ctime[0] & 0x80) == 0) && X (ptb->xstar_dbuf.t_ctime[i] < '0' || X ptb->xstar_dbuf.t_ctime[i] > '7')) X return (FALSE); X } X X /* X * Check for both POSIX compliant end of number characters X * if not using base 256. X */ X if ((ptb->xstar_dbuf.t_atime[0] & 0x80) == 0 && X ptb->xstar_dbuf.t_atime[11] != ' ' && X ptb->xstar_dbuf.t_atime[11] != '\0') X return (FALSE); X X if ((ptb->xstar_dbuf.t_ctime[0] & 0x80) == 0 && X ptb->xstar_dbuf.t_ctime[11] != ' ' && X ptb->xstar_dbuf.t_ctime[11] != '\0') X return (FALSE); X X return (TRUE); X} X XLOCAL BOOL Xismagic(s) X char *s; X{ X return (strxneql(s, magic, TMAGLEN)); X} X XLOCAL BOOL Xisgnumagic(s) X char *s; X{ X return (strxneql(s, gmagic, GMAGLEN)); X} X XLOCAL BOOL Xstrxneql(s1, s2, l) X register char *s1; X register char *s2; X register int l; X{ X while (--l >= 0) X if (*s1++ != *s2++) X return (FALSE); X return (TRUE); X} X X/* X * Check whether a field looks like a TAR numeric field. X * This intentionally does not include a check for base-256 numbers. X */ XLOCAL BOOL Xistarnumber(s, fieldw) X char *s; X int fieldw; X{ X register int c; X X while (*s == ' ' && --fieldw >= 0) X s++; X X /* X * We need at least one octal number, skip other octals numbers. X */ X c = *s; X if (fieldw < 0 || !isoctal(c)) X return (FALSE); X while ((c = *s) && --fieldw >= 0) { X if (!isoctal(c)) X break; X s++; X } X X /* X * All digits used within fieldw. This is the non-compliant case X * where the number is followed by the next one (starting with space X * or an octal digit. We are gracious and permit this case. X */ X c = *s; X if ((c == ' ' || isoctal(c)) && fieldw == -1) X return (TRUE); X X /* X * Typical standard compliant end. X */ X if ((c == '\0' || c == ' ') && (fieldw <= 2 && fieldw >= 0)) X return (TRUE); X X /* X * We either got a field separator too early or after X * fieldw was exhausted. This still may be tolerable. X */ X if (fieldw < 0 || !isoctal(c)) X return (FALSE); X X return (TRUE); X} X XLOCAL BOOL Xustmagcheck(ptb) X TCB *ptb; X{ X if (ismagic(ptb->xstar_dbuf.t_magic) && X strxneql(ptb->xstar_dbuf.t_version, "00", 2)) X return (TRUE); X return (FALSE); X} X XEXPORT void Xprint_hdrtype(f, type) X FILE *f; X int type; X{ X BOOL isswapped = H_ISSWAPPED(type); X X if (H_TYPE(type) > H_MAX_ARCH) X type = H_UNDEF; X type = H_TYPE(type); X X fgtprintf(f, "%s%s archive.\n", isswapped?"swapped ":"", hdr_name(type)); X} X XEXPORT char * Xhdr_name(type) X int type; X{ X register htab_t *htp = htab; X X for (; htp->h_name; htp++) { X if (htp->h_type == type) X return (htp->h_name); X } X return (htab->h_name); X} X XEXPORT char * Xhdr_text(type) X int type; X{ X register htab_t *htp = htab; X X for (; htp->h_name; htp++) { X if (htp->h_type == type) X return (htp->h_text); X } X return (htab->h_text); X} X XEXPORT int Xhdr_type(name) X char *name; X{ X register htab_t *htp = htab; X X for (; htp->h_name; htp++) { X if (htp->h_flags & HF_RO) X continue; X if (streql(name, htp->h_name)) X return (htp->h_type); X } X return (-1); X} X XEXPORT void Xhdr_usage() X{ X register htab_t *htp = htab; X X for (; htp->h_name; htp++) { X if (htp->h_flags & HF_RO) X continue; X error("%s\t%s\t%s\n", X hdrtype == htp->h_type ? "*":"", X htp->h_name, htp->h_text); X } X} X XEXPORT int Xget_hdrtype(ptb, isrecurse) X TCB *ptb; X BOOL isrecurse; X{ X Ulong check; X Ulong ocheck; X int ret = H_UNDEF; X X /* X * We don't like to get "WARNING: Unterminated octal number at..." X * when we may have e.g. a CPIO archive to check. X * So enforce to null-terminate the TAR checksum field and use a X * fieldwidth of 8 as CPIO archives may have all characters from X * ptb->dbuf.t_chksum[] != 0. X */ X check = ptb->dbuf.t_linkflag; X ptb->dbuf.t_linkflag = 0; X stoli(ptb->dbuf.t_chksum, &ocheck, 8); X ptb->dbuf.t_linkflag = check; /* Restore old value */ X if (ocheck == 0) X goto nottar; X check = checksum(ptb); X if (ocheck != check && !signedtarsum(ptb, ocheck)) { X if (debug && !isrecurse) { X errmsgno(EX_BAD, X "Bad tar checksum at: %lld: 0%lo should be 0%lo.\n", X tblocks(), X ocheck, check); X } X goto nottar; X } X X /* X * t_mode never needs base-256, so this is a good place to check. X * X * Unfortunately, GNU tar does not fill in t_mode for 'V'holhdr, X * but only t_mtime. X * Unfortunately, GNU tar does not fill in t_mode for 'M'ultivol, X * but only t_size. X */ X if (!istarnumber(ptb->dbuf.t_mode, 8)) { X /* X * A non standard compliant header was seen. Try to work around X * the deviations from GNU tar and permit GNU tar headers to be X * seen as OK. X */ X switch (ptb->ustar_dbuf.t_typeflag) { X X case 'V': X if (!(ptb->dbuf.t_mtime[0] & 0x80) && X !istarnumber(ptb->dbuf.t_mtime, 12)) X goto nottar; X break; X case 'M': X if (!(ptb->dbuf.t_size[0] & 0x80) && X !istarnumber(ptb->dbuf.t_size, 12)) X goto nottar; X break; X X default: /* Not a problematic GNU tar header */ X goto nottar; X } X } X X if (isstmagic(ptb->dbuf.t_magic)) { /* Check for 'tar\0' at end */ X if (ustmagcheck(ptb)) X ret = H_XSTAR; X else X ret = H_STAR; X if (debug) print_hdrtype(stderr, ret); X return (ret); X } X if (ustmagcheck(ptb)) { /* 'ustar\000' POSIX magic */ X if (isxmagic(ptb)) { /* Check for xustar */ X#ifdef __historic__ X /* X * H_EXUSTAR was introduced in August 2001 but since X * October 2003 we have SCHILY.archtype that is always X * used together with H_EXUSTAR. Determine the achive X * type from SCHILY.archtype in the 'g' header. X */ X if (ptb->ustar_dbuf.t_typeflag == 'g' || X ptb->ustar_dbuf.t_typeflag == 'x') X ret = H_EXUSTAR; X else X#endif X ret = H_XUSTAR; X } else { X if (ptb->ustar_dbuf.t_typeflag == 'g' || X ptb->ustar_dbuf.t_typeflag == 'x') X ret = H_PAX; X else if (ptb->ustar_dbuf.t_typeflag == 'X') X ret = H_SUNTAR; X else X ret = H_USTAR; X } X if (debug) print_hdrtype(stderr, ret); X return (ret); X } X if (isgnumagic(ptb->ustar_dbuf.t_magic)) { /* 'ustar ' GNU magic */ X ret = H_GNUTAR; X if (debug) print_hdrtype(stderr, ret); X return (ret); X } X if ((ptb->dbuf.t_mode[6] == ' ' && ptb->dbuf.t_mode[7] == '\0')) { X ret = H_OTAR; X if (debug) print_hdrtype(stderr, ret); X return (ret); X } X if (ptb->ustar_dbuf.t_typeflag == LF_VOLHDR || X ptb->ustar_dbuf.t_typeflag == LF_MULTIVOL) { X /* X * Gnu volume headers & multi volume headers X * are no real tar headers. X */ X if (debug) error("gnutar buggy archive.\n"); X ret = H_GNUTAR; X if (debug) print_hdrtype(stderr, ret); X return (ret); X } X /* X * The only thing we know here is: X * we found a header with a correct tar checksum. X */ X ret = H_TAR; X if (debug) print_hdrtype(stderr, ret); X return (ret); X Xnottar: X if (ptb->bar_dbuf.bar_magic[0] == 'V') { X /* X * We don't like "WARNING: Unterminated octal number at..." X * when we may have e.g. a CPIO archive to check. X * So enforce to null-terminate the BAR checksum field and use a X * fieldwidth of 8 as junk may have all characters from X * ptb->bar_dbuf.t_chksum[] != 0. X */ X check = ptb->bar_dbuf.rdev[0]; X stoli(ptb->bar_dbuf.t_chksum, &ocheck, 8); X ptb->bar_dbuf.rdev[0] = check; X check = bar_checksum(ptb); X X if (ocheck == 0) { X /* EMPTY */ X ; X } else if (ocheck == check) { X ret = H_BAR; X if (debug) print_hdrtype(stderr, ret); X return (ret); X } else if (debug && !isrecurse) { X errmsgno(EX_BAD, X "Bad bar checksum at: %lld: 0%lo should be 0%lo.\n", X tblocks(), X ocheck, check); X } X X } X if (strxneql((char *)ptb, "070701", 6)) { X /* X * CPIO ASCII hex header with expanded device numbers X */ X ret = H_CPIO_ASC; /* cpio -c */ X if (debug) print_hdrtype(stderr, ret); X return (ret); X } X if (strxneql((char *)ptb, "070702", 6)) { X /* X * CPIO ASCII hex header with expanded device numbers and CRC X */ X ret = H_CPIO_ACRC; /* cpio -Hcrc */ X if (debug) print_hdrtype(stderr, ret); X return (ret); X } X if (strxneql((char *)ptb, "070707", 6)) { X /* X * POSIX small (6 octal digit device numbers) X */ X ret = H_CPIO_CHR; /* cpio -Hodc */ X if (debug) print_hdrtype(stderr, ret); X return (ret); X X } X if (strxneql((char *)ptb, "\161\301", 2)) { X /* X * 0161 0301 -> 0x71 0xC1 -> 070701 X */ X ret = H_CPIO_NBIN; X if (debug) print_hdrtype(stderr, ret); X return (ret); X } X if (strxneql((char *)ptb, "\161\302", 2)) { X /* X * 0161 0302 -> 0x71 0xC2 -> 070702 X */ X ret = H_CPIO_CRC; X if (debug) print_hdrtype(stderr, ret); X return (ret); X } X if (strxneql((char *)ptb, "\161\307", 2) || X strxneql((char *)ptb, "\307\161", 2)) { X /* X * cpio default X * 0161 0307 -> 0x71 0xC7 -> 070707 X * 0307 0161 -> 0xC7 0x71 -> 0143561 X * X * Binary cpio archives may use any byte order for the numbers X * in the header so we cannot use the byte order in the header X * to detect swapped archives. X * Filenames with odd length result in a null byte inside the X * filename and this allows us to auto-detect byte swapped X * archives. X * X * If strlen(info->f_name) is odd, we may autodetect X * whether this archive has been swapped as whole. X * cpio_checkswab() returns either H_CPIO_BIN or X * H_SWAPPED(H_CPIO_BIN). X */ X ret = cpio_checkswab(ptb); X if (debug) print_hdrtype(stderr, ret); X return (ret); X } X if (debug) error("no tar archive??\n"); X X if (!isrecurse) { X int rret; X swabbytes((char *)ptb, TBLOCK); X rret = get_hdrtype(ptb, TRUE); X swabbytes((char *)ptb, TBLOCK); X rret = H_SWAPPED(rret); X if (debug) print_hdrtype(stderr, rret); X return (rret); X } X X if (debug) print_hdrtype(stderr, ret); X return (ret); X} X XLOCAL int Xget_xhtype(ptb, htype) X TCB *ptb; X int htype; X{ X FINFO finfo; X Ullong ull; X int xhsiz = bigsize-TBLOCK; X char *xhp = &bigbuf[TBLOCK]; X BOOL swapped; X int t; X GINFO gsav; Xextern GINFO *grip; /* Global read info pointer */ X X gsav = *grip; /* Save old content */ X X t = H_TYPE(htype); X if (t < H_TARMIN || t > H_TARMAX) X return (htype); X X swapped = H_ISSWAPPED(htype); X /* X * Swap TCB & io buffer. X */ X if (swapped) { X swabbytes(ptb, TBLOCK); X swabbytes(bigbuf, bigsize); X } X X if (ptb->ustar_dbuf.t_typeflag != 'g' && X ptb->ustar_dbuf.t_typeflag != 'x') X goto out; X X /* X * File size is strlen of extended header X */ X stolli(ptb->dbuf.t_size, &ull); X finfo.f_size = ull; X finfo.f_rsize = (off_t)finfo.f_size; X X if (xhsiz > ull) X xhsiz = ull; X X /* X * Mark the path name and link name pointer uninitalized to avoid that X * xhparse() will try to copy a possible path= or lpath= entry in the X * first extended header to finfo->f_name & finfo->f_lname. X */ X finfo.f_name = NULL; X finfo.f_lname = NULL; X finfo.f_devminorbits = 0; X finfo.f_xflags = 0; X X grip->archtype = H_UNDEF; X xhparse(&finfo, xhp, xhp+xhsiz); X if (grip->archtype != H_UNDEF) { X htype = grip->archtype; X if (swapped) X htype = H_SWAPPED(htype); X } X *grip = gsav; /* Restore old content */ X Xout: X /* X * Swap back TCB & io buffer. X */ X if (swapped) { X swabbytes(ptb, TBLOCK); X swabbytes(bigbuf, bigsize); X } X return (htype); X} X XEXPORT int Xget_compression(ptb) X TCB *ptb; X{ X char *p = (char *)ptb; X X if (p[0] == '\037') { X if (p[1] == '\036') /* Packed */ X return (C_PACK); X if (p[1] == '\213') /* Gzip compressed */ X return (C_GZIP); X if (p[1] == '\235') /* LZW compressed */ X return (C_LZW); X if (p[1] == '\236') /* Freezed */ X return (C_FREEZE); X if (p[1] == '\237') /* Freeze-2 */ X return (C_FREEZE2); X if (p[1] == '\240') /* SCO LZH compressed */ X return (C_LZH); X } X if (p[0] == 'P' && p[1] == 'K' && p[2] == '\003' && p[3] == '\004') X return (C_PKZIP); X if (p[0] == 'B' && p[1] == 'Z' && p[2] == 'h') X return (C_BZIP2); X if (p[0] == '\211' && p[1] == 'L' && p[2] == 'Z' && p[3] == 'O') X return (C_LZO); X X /* X * p[6] && p[7] contain the version number X */ X if (p[0] == '7' && p[1] == 'z' && p[2] == '\274' && p[3] == '\257' && X p[4] == '\047' && p[5] == '\034') X return (C_7Z); X X /* X * p[6] && p[7] contain the stream flags X */ X if (p[0] == '\375' && X p[1] == '7' && p[2] == 'z' && p[3] == 'X' && p[4] == 'Z' && X p[5] == '\0') X return (C_XZ); X X /* X * The lzip file format has four "magic bytes", followed by a version X * byte (0 or 1 currently), then the coded dictionary size. To reduce X * the number of false-positive detections, require the version byte X * be 0 or 1, and validate the dictionary size. X */ X if (p[0] == 'L' && p[1] == 'Z' && p[2] == 'I' && p[3] == 'P' && X (p[4] == '\0' || p[4] == '\001') && X ((p[5] & 0x1f) > 12 || (p[5] & 0x1f) == 0 || p[5] == 12)) X return (C_LZIP); X X if (p[0] == (char) 0x28 && p[1] == (char) 0xB5 && X p[2] == (char) 0x2F && p[3] == (char) 0xFD) X return (C_ZSTD); X X /* X * There is no grant that this is true, but it seems to be OK from the X * magic used by file(1) from Christos Zoulas X */ X if (p[0] == ']' && p[1] == 0 && p[2] == 0) X return (C_LZMA); X X return (C_NONE); X} X XEXPORT char * Xget_cmpname(type) X int type; X{ X if (type < 0 || type > C_MAX) X type = C_NONE; X X /* X * Paranoia for incomplete cnames[] entries. X */ X if (type >= (sizeof (cnames) / sizeof (cnames[0]))) X type = C_NONE; X X return (cnames[type]); X} X XEXPORT int Xget_tcb(ptb) X TCB *ptb; X{ X Ulong check; X Ulong ocheck; X BOOL eof = FALSE; X X /* X * bei der Option -i wird ein genulltes File X * fehlerhaft als EOF Block erkannt ! X * wenn nicht t_magic gesetzt ist. X */ X do { X /* X * First tar control block X */ X if (swapflg < 0) { X BOOL swapped; X X if (peekblock((char *)ptb, TBLOCK) == EOF) { X /* X * The minimal size of a senseful TAR archive is X * 3 blocks (1536). X * The minimal size of a senseful CPIO archive is X * 26+2 + 26+12 = 66 bytes for a BIN archive, but X * a CPIO archive in whole needs to a multiple of X * 512 bytes. X */ X errmsgno(EX_BAD, X "Hard EOF on input, first EOF block is missing at %lld.\n", X tblocks()); X#ifdef FIFO_EOF_DEBUG X if (use_fifo) /* Debug a rare EOF problem */ X fifo_prmp(1); X#endif X xstats.s_hardeof++; X return (EOF); X } X hdrtype = get_hdrtype(ptb, FALSE); X hdrtype = get_xhtype(ptb, hdrtype); X if (print_artype) { X printf("%s: ", tarfiles[tarfindex]); X if (cmptype != C_NONE) { X gtprintf("%s compressed ", X get_cmpname(cmptype)); X } X print_hdrtype(stdout, hdrtype); X exit(0); X } X swapped = H_ISSWAPPED(hdrtype); X if (chdrtype != H_UNDEF && X swapped != H_ISSWAPPED(chdrtype)) { X X swapped = H_ISSWAPPED(chdrtype); X } X if (swapped) { X swapflg = 1; X /* X * We swap everything already read here. X * We tell the input routines later (inside the X * buf_resume() call) that further swapping is X * needed. X */ X swabbytes((char *)ptb, TBLOCK); /* copy of TCB */ X swabbytes(bigbuf, bigsize); /* io buffer */ X } else { X swapflg = 0; X } X if (H_TYPE(hdrtype) == H_BAR) { X comerrno(EX_BAD, "Can't handle bar archives (yet).\n"); X } X if (H_TYPE(hdrtype) == H_UNDEF) { X int t; X X switch (t = get_compression(ptb)) { X X case C_NONE: X break; X case C_PACK: X case C_GZIP: X case C_LZW: X case C_FREEZE: X case C_LZH: X case C_PKZIP: X comerrno(EX_BAD, "Archive is '%s' compressed, try to use the -z option.\n", X get_cmpname(t)); X break; X case C_BZIP2: X comerrno(EX_BAD, "Archive is 'bzip2' compressed, try to use the -bz option.\n"); X break; X case C_LZO: X comerrno(EX_BAD, "Archive is 'lzop' compressed, try to use the -bz option.\n"); X break; X case C_7Z: X comerrno(EX_BAD, "Archive is '7z' compressed, try to use the -7z option.\n"); X break; X case C_XZ: X comerrno(EX_BAD, "Archive is 'xz' compressed, try to use the -xz option.\n"); X break; X case C_LZIP: X comerrno(EX_BAD, "Archive is 'lzip' compressed, try to use the -lzip option.\n"); X break; X case C_ZSTD: X comerrno(EX_BAD, "Archive is 'zstd' compressed, try to use the -zstd option.\n"); X break; X case C_LZMA: X comerrno(EX_BAD, "Archive is 'lzma' compressed, try to use the -lzma option.\n"); X break; X case C_FREEZE2: X comerrno(EX_BAD, "Archive is 'freeze2' compressed, try to use the -freeze option.\n"); X break; X default: X errmsgno(EX_BAD, "WARNING: Unknown compression type %d.\n", t); X break; X } X if (!ignoreerr) { X comerrno(EX_BAD, X "Unknown archive type (neither tar, nor bar/cpio).\n"); X } X } X if ((chdrtype != H_UNDEF || (rflag || uflag)) && X chdrtype != hdrtype) { X errmsgno(EX_BAD, "Found: "); X print_hdrtype(stderr, hdrtype); X if (chdrtype == H_UNDEF) { X chdrtype = hdrtype; X if (rflag || uflag) { X setprops(hdrtype); X star_verifyopts(); X } X } else { X errmsgno(EX_BAD, X "WARNING: extracting as "); X print_hdrtype(stderr, chdrtype); X } X hdrtype = chdrtype; X } X setprops(hdrtype); X /* X * If the archive format contains extended headers, we X * need to set up iconv(). X */ X if (props.pr_flags & PR_XHDR) { X int t = S_EXTRACT; X X if (rflag || uflag) X t |= S_CREATE; X utf8_init(t); /* iconv() setup for xhd */ X } X /* X * Wake up fifo (first block has been swapped above) X * buf_resume() will trigger a shadow call to X * setprops() in the fifo process to make sure that X * the props structure is correct even in the second X * process. X */ X buf_resume(); X buf_rwake(props.pr_hdrsize); /* eat up archive header */ X } else { X if (readblock((char *)ptb, props.pr_hdrsize) == EOF) { X errmsgno(EX_BAD, X "Hard EOF on input, first EOF block is missing at %lld.\n", X tblocks()); X#ifdef FIFO_EOF_DEBUG X if (use_fifo) /* Debug a rare EOF problem */ X fifo_prmp(1); X#endif X xstats.s_hardeof++; X return (EOF); X } X } X X if (H_TYPE(hdrtype) >= H_CPIO_BASE) { X /* X * CPIO EOF check is currently in cpiotcb_to_info() X * There is no checksum for the CPIO header. X */ X check = ocheck = 1; X } else { X /* X * We have a TAR type archive. X */ X eof = (ptb->dbuf.t_name[0] == '\0') && checkeof(ptb); X if (eof && !ignoreerr) { X return (EOF); X } X /* X * XXX Hier muß eine Universalchecksummenüberprüfung hin X * XXX Shouldn't we use tarsum_ok() from here? X */ X stoli(ptb->dbuf.t_chksum, &ocheck, 7); X check = checksum(ptb); X } X /* X * check == 0 : genullter Block. X */ X if (check != 0 && ocheck == check) { X char *tmagic = ptb->ustar_dbuf.t_magic; X X switch (H_TYPE(hdrtype)) { X X case H_XUSTAR: X case H_EXUSTAR: X if (ismagic(tmagic) && isxmagic(ptb)) X return (0); X /* X * Both formats are equivalent. X * Acept XSTAR too. X */ X /* FALLTHROUGH */ X case H_XSTAR: X if (ismagic(tmagic) && X isstmagic(ptb->xstar_dbuf.t_xmagic)) X return (0); X break; X case H_PAX: X case H_EPAX: X case H_USTAR: X case H_SUNTAR: X if (ismagic(tmagic)) X return (0); X break; X case H_GNUTAR: X if (isgnumagic(tmagic)) X return (0); X break; X case H_STAR: X tmagic = ptb->star_dbuf.t_magic; X if (ptb->dbuf.t_vers < STVERSION || X isstmagic(tmagic)) X return (0); X break; X default: X case H_TAR: X case H_OTAR: X return (0); X X case H_CPIO_CHR: /* cpio -Hodc */ X if (strxneql((char *)ptb, "070707", 6)) X return (0); X break; X case H_CPIO_ASC: /* cpio -c */ X if (strxneql((char *)ptb, "070701", 6)) X return (0); X break; X case H_CPIO_ACRC: /* cpio -Hcrc */ X if (strxneql((char *)ptb, "070702", 6)) X return (0); X break; X case H_CPIO_NBIN: X case H_CPIO_CRC: X errmsgno(EX_BAD, "Unimplemented %ld cpio format.\n", X hdrtype); X break; X case H_CPIO_BIN: /* cpio default */ X if (strxneql((char *)ptb, "\161\307", 2)) X return (0); X if (strxneql((char *)ptb, "\307\161", 2)) X return (0); X break; X } X switch (H_TYPE(hdrtype)) { X X case H_CPIO_CHR: /* cpio -Hodc */ X case H_CPIO_ASC: /* cpio -c */ X case H_CPIO_ACRC: /* cpio -Hcrc */ X /* First Block# is 0 */ X errmsgno(EX_BAD, "Wrong magic at: %lld: '%.6s'.\n", X tblocks(), (char *)ptb); X break; X case H_CPIO_NBIN: X case H_CPIO_CRC: X case H_CPIO_BIN: /* cpio default */ X /* First Block# is 0 */ X errmsgno(EX_BAD, "Wrong magic at: %lld: '0%6.6o'.\n", X tblocks(), X (((char *)ptb)[0] & 0xFF) * 256 + X (((char *)ptb)[1] & 0xFF)); X break; X default: X /* First Block# is 0 */ X errmsgno(EX_BAD, "Wrong magic at: %lld: '%.8s'.\n", X tblocks(), tmagic); X } X /* X * Allow buggy gnu Volheaders & Multivolheaders to work X */ X if (H_TYPE(hdrtype) == H_GNUTAR) X return (0); X X } else if (eof) { X errmsgno(EX_BAD, "EOF Block at: %lld ignored.\n", X tblocks()); X } else { X if (signedtarsum(ptb, ocheck)) X return (0); X errmsgno(EX_BAD, "Checksum error at: %lld: 0%lo should be 0%lo.\n", X tblocks(), X ocheck, check); X } X if (ignoreerr) { X if (H_TYPE(hdrtype) >= H_CPIO_BASE) X cpio_resync(); X } X } while (ignoreerr); X exprstats(EX_BAD); X /* NOTREACHED */ X return (EOF); /* Keep lint happy */ X} X XEXPORT void Xput_tcb(ptb, info) X TCB *ptb; X register FINFO *info; X{ X TCB tb; X int x1 = 0; X int x2 = 0; X BOOL xhdr = FALSE; Xextern BOOL ghdr; X X if ((props.pr_flags & PR_CPIO) != 0) { X put_cpioh(ptb, info); X return; X } X X if (info->f_flags & (F_LONGNAME|F_LONGLINK)) X x1++; X if (info->f_xflags & (XF_PATH|XF_LINKPATH)) X x1++; X X/* XXX start alter code und Test */ X if (((info->f_flags & F_ADDSLASH) ? 1:0 + X info->f_namelen > props.pr_maxsname && X (ptb->dbuf.t_prefix[0] == '\0' || H_TYPE(hdrtype) == H_GNUTAR)) || X info->f_lnamelen > props.pr_maxslname) X x2++; X X if ((x1 != x2) && info->f_xftype != XT_META) { Xerror("type: %ld name: '%s' x1 %d x2 %d namelen: %ld prefix: '%s' lnamelen: %ld\n", Xinfo->f_filetype, info->f_name, x1, x2, Xinfo->f_namelen, ptb->dbuf.t_prefix, info->f_lnamelen); X } X/* XXX ende alter code und Test */ X X if (props.pr_flags & PR_XHDR) { X if (!(info->f_xflags & XF_PATH)) { X if (info->f_name && !nameascii(info->f_name)) X info->f_xflags |= XF_PATH; X } X if (!(info->f_xflags & XF_LINKPATH) && info->f_lnamelen) { X if (info->f_lname && !nameascii(info->f_lname)) X info->f_xflags |= XF_LINKPATH; X } X } X X if (x1 || x2 || (info->f_xflags != 0) || ghdr) X xhdr = TRUE; X X if (!multivol && tsize > 0) { X Llong left; X off_t size = info->f_rsize; X X left = tsize - tblocks(); X if (xhdr) X left -= 6; /* Extimated for Longname/Longlink */ X X if (is_link(info)) X size = 0L; X /* file + tcb + EOF */ X if (left < (tarblocks(size)+1+2)) { X if ((info->f_flags & F_TCB_BUF) != 0) { X movetcb(ptb, &tb); X ptb = &tb; X info->f_flags &= ~F_TCB_BUF; X } X nextotape(); X newvolhdr((char *)NULL, 0, use_fifo); X } X } X X if (xhdr) { X if ((info->f_flags & F_TCB_BUF) != 0) { /* TCB is on buffer */ X movetcb(ptb, &tb); X ptb = &tb; X info->f_flags &= ~F_TCB_BUF; X } X if ((info->f_xflags != 0) || ghdr) { X info_to_xhdr(info, ptb); X } else { X write_longnames(info); X } X } X write_tcb(ptb, info); X} X XEXPORT void Xwrite_tcb(ptb, info) X TCB *ptb; X register FINFO *info; X{ X char *addr; X X if (!nullout) { /* 17 (> 16) Bit !!! */ X if (props.pr_fillc == '0') X litos(ptb->dbuf.t_chksum, checksum(ptb) & 0x1FFFF, 7); X else X litos(ptb->dbuf.t_chksum, checksum(ptb) & 0x1FFFF, 6); X } X if ((info->f_flags & F_TCB_BUF) != 0) { /* TCB is on buffer */ X addr = (char *)ptb; X put_block(TBLOCK); X } else { X addr = writeblock((char *)ptb); X } X marktcb(addr); X} X XEXPORT void Xinfo_to_tcb(info, ptb) X register FINFO *info; X register TCB *ptb; X{ X if (nullout) X return; X X if (H_TYPE(hdrtype) >= H_CPIO_BASE) { X cpioinfo_to_tcb(info, ptb); X return; X } X X if (props.pr_fillc == '0') { X /* X * This is a POSIX compliant header, it is allowed to use X * 7 bytes from 8 byte headers as POSIX only requires a ' ' or X * '\0' as last char. X */ X if (modebits) X litos(ptb->dbuf.t_mode, (Ulong)(info->f_mode|info->f_type) & 0xFFFF, 7); X else X litos(ptb->dbuf.t_mode, (Ulong)info->f_mode & 0xFFFF, 7); X X if (info->f_uid > MAXOCTAL7) { X if (props.pr_flags & PR_XHDR) X info->f_xflags |= XF_UID; X X if (props.pr_flags & PR_BASE256) { X#if SIZEOF_UID_T > SIZEOF_UNSIGNED_LONG_INT X if (!(info->f_uid <= ULONG_MAX)) X llbtos(ptb->dbuf.t_uid, (Ullong)info->f_uid, 7); X else X#endif X btos(ptb->dbuf.t_uid, info->f_uid, 7); X } else { X /* X * Use uid_nobody? X */ X litos(ptb->dbuf.t_uid, (Ulong)0, 7); X if ((info->f_xflags & XF_UID) == 0 && X !errhidden(E_ID, info->f_name)) { X if (!errwarnonly(E_ID, info->f_name)) X xstats.s_id++; X errmsgno(EX_BAD, X "Uid %lld for '%s' out of range.\n", X (Ullong)info->f_uid, info->f_name); X (void) errabort(E_ID, info->f_name, TRUE); X } X } X } else { X litos(ptb->dbuf.t_uid, info->f_uid, 7); X } X X if (info->f_gid > MAXOCTAL7) { X if (props.pr_flags & PR_XHDR) X info->f_xflags |= XF_GID; X X if (props.pr_flags & PR_BASE256) { X#if SIZEOF_GID_T > SIZEOF_UNSIGNED_LONG_INT X if (!(info->f_gid <= ULONG_MAX)) X llbtos(ptb->dbuf.t_gid, (Ullong)info->f_gid, 7); X else X#endif X btos(ptb->dbuf.t_gid, info->f_gid, 7); X } else { X /* X * Use gid_nobody? X */ X litos(ptb->dbuf.t_gid, (Ulong)0, 7); X if ((info->f_xflags & XF_GID) == 0 && X !errhidden(E_ID, info->f_name)) { X if (!errwarnonly(E_ID, info->f_name)) X xstats.s_id++; X errmsgno(EX_BAD, X "Gid %lld for '%s' out of range.\n", X (Ullong)info->f_gid, info->f_name); X (void) errabort(E_ID, info->f_name, TRUE); X } X } X } else { X litos(ptb->dbuf.t_gid, info->f_gid, 7); X } X } else { X /* X * This is a pre POSIX header, it is only allowed to use X * 6 bytes from 8 byte headers as historic TAR requires a ' ' X * and a '\0' as last char. X */ X if (modebits) X litos(ptb->dbuf.t_mode, (Ulong)(info->f_mode|info->f_type) & 0xFFFF, 6); X else X litos(ptb->dbuf.t_mode, (Ulong)info->f_mode & 0xFFFF, 6); X X if (info->f_uid > MAXOCTAL6) { X if (props.pr_flags & PR_XHDR) X info->f_xflags |= XF_UID; X X if (props.pr_flags & PR_BASE256) { X#if SIZEOF_UID_T > SIZEOF_UNSIGNED_LONG_INT X if (!(info->f_uid <= ULONG_MAX)) X llbtos(ptb->dbuf.t_uid, (Ullong)info->f_uid, 7); X else X#endif X btos(ptb->dbuf.t_uid, info->f_uid, 7); X } else { X /* X * Use uid_nobody? X */ X litos(ptb->dbuf.t_uid, (Ulong)0, 6); X if ((info->f_xflags & XF_UID) == 0 && X !errhidden(E_ID, info->f_name)) { X if (!errwarnonly(E_ID, info->f_name)) X xstats.s_id++; X errmsgno(EX_BAD, X "Uid %lld for '%s' out of range.\n", X (Ullong)info->f_uid, info->f_name); X (void) errabort(E_ID, info->f_name, TRUE); X } X } X } else { X litos(ptb->dbuf.t_uid, info->f_uid, 6); X } X X if (info->f_gid > MAXOCTAL6) { X if (props.pr_flags & PR_XHDR) X info->f_xflags |= XF_GID; X X if (props.pr_flags & PR_BASE256) { X#if SIZEOF_GID_T > SIZEOF_UNSIGNED_LONG_INT X if (!(info->f_gid <= ULONG_MAX)) X llbtos(ptb->dbuf.t_gid, (Ullong)info->f_gid, 7); X else X#endif X btos(ptb->dbuf.t_gid, info->f_gid, 7); X } else { X /* X * Use gid_nobody? X */ X litos(ptb->dbuf.t_gid, (Ulong)0, 6); X if ((info->f_xflags & XF_GID) == 0 && X !errhidden(E_ID, info->f_name)) { X if (!errwarnonly(E_ID, info->f_name)) X xstats.s_id++; X errmsgno(EX_BAD, X "Gid %lld for '%s' out of range.\n", X (Ullong)info->f_gid, info->f_name); X (void) errabort(E_ID, info->f_name, TRUE); X } X } X } else { X litos(ptb->dbuf.t_gid, info->f_gid, 6); X } X } X X if (info->f_rsize > MAXOCTAL11 && (props.pr_flags & PR_XHDR)) { X info->f_xflags |= XF_SIZE; X } X/* XXX */ X if (info->f_rsize <= MAXINT32) { X litos(ptb->dbuf.t_size, (Ulong)info->f_rsize, 11); X } else { X if (info->f_rsize > MAXOCTAL11 && X (props.pr_flags & PR_BASE256) == 0) { X litos(ptb->dbuf.t_size, (Ulong)0, 11); X } else { X llitos(ptb->dbuf.t_size, (Ullong)info->f_rsize, 11); X } X } X X if (info->f_mtime < 0 || info->f_mtime > MAXOCTAL11) { X if (props.pr_flags & PR_XHDR) X info->f_xflags |= XF_ATIME|XF_MTIME|XF_CTIME; X X if (props.pr_flags & PR_BASE256) { X if (info->f_mtime <= ULONG_MAX) X btos(ptb->dbuf.t_mtime, info->f_mtime, 11); X else X llbtos(ptb->dbuf.t_mtime, (Ullong)info->f_mtime, 11); X } else { X litos(ptb->dbuf.t_mtime, (Ulong)info->f_mtime, 11); X if ((info->f_xflags & XF_MTIME) == 0 && X !errhidden(E_TIME, info->f_name)) { X if (!errwarnonly(E_TIME, info->f_name)) X xstats.s_time++; X errmsgno(EX_BAD, X "Time %lld for '%s' out of range.\n", X (Ullong)info->f_mtime, info->f_name); X (void) errabort(E_TIME, info->f_name, TRUE); X } X } X } else { X if (props.pr_flags & PR_XHDR) { X if (info->f_mnsec != 0) X info->f_xflags |= XF_ATIME|XF_MTIME|XF_CTIME; X } X litos(ptb->dbuf.t_mtime, (Ulong)info->f_mtime, 11); X } X X ptb->dbuf.t_linkflag = XTTOUS(info->f_xftype); X X if (H_TYPE(hdrtype) == H_USTAR) { X info_to_ustar(info, ptb); X } else if (H_TYPE(hdrtype) == H_PAX) { X info_to_ustar(info, ptb); X } else if (H_TYPE(hdrtype) == H_EPAX) { X info_to_ustar(info, ptb); X } else if (H_TYPE(hdrtype) == H_SUNTAR) { X info_to_ustar(info, ptb); X } else if (H_TYPE(hdrtype) == H_XSTAR) { X info_to_xstar(info, ptb); X } else if (H_TYPE(hdrtype) == H_XUSTAR) { X info_to_xstar(info, ptb); X } else if (H_TYPE(hdrtype) == H_EXUSTAR) { X info_to_xstar(info, ptb); X } else if (H_TYPE(hdrtype) == H_GNUTAR) { X info_to_gnutar(info, ptb); X } else if (H_TYPE(hdrtype) == H_STAR) { X info_to_star(info, ptb); X } X} X X/* X * Used to create old star format header. X */ XLOCAL void Xinfo_to_star(info, ptb) X register FINFO *info; X register TCB *ptb; X{ X ptb->dbuf.t_vers = STVERSION; X litos(ptb->dbuf.t_filetype, info->f_filetype & 0xFFFF, 6); /* XXX -> 7 ??? */ X litos(ptb->dbuf.t_type, (Ulong)info->f_type & 0xFFFF, 11); X#ifdef needed X /* XXX we need to do something if st_rdev is > 32 bits */ X if ((info->f_rdevmaj > MAXOCTAL7 || info->f_rdevmin > MAXOCTAL7) && X (props.pr_flags & PR_XHDR)) { X info->f_xflags |= XF_DEVMAJOR|XF_DEVMINOR; X } X#endif X X#if (SIZEOF_DEV_T > SIZEOF_UNSIGNED_LONG_INT) || (SIZEOF_DEV_T > 4) X if (info->f_rdev > MAXOCTAL11) { X if (info->f_rdev <= ULONG_MAX) X btos(ptb->dbuf.t_rdev, info->f_rdev, 10); X else X llbtos(ptb->dbuf.t_rdev, (Ullong)info->f_rdev, 10); X } else X#endif X litos(ptb->dbuf.t_rdev, info->f_rdev, 11); X X#ifdef DEV_MINOR_NONCONTIG X ptb->dbuf.t_devminorbits = '@'; X if (props.pr_flags & PR_XHDR) { X info->f_xflags |= XF_DEVMAJOR|XF_DEVMINOR; X } X#else X ptb->dbuf.t_devminorbits = '@' + minorbits; X#endif X X if (info->f_atime < 0 || info->f_atime > MAXOCTAL11) { X if (info->f_atime <= ULONG_MAX) X btos(ptb->dbuf.t_atime, info->f_atime, 11); X else X llbtos(ptb->dbuf.t_atime, (Ullong)info->f_atime, 11); X } else { X litos(ptb->dbuf.t_atime, (Ulong)info->f_atime, 11); X } X if (info->f_ctime < 0 || info->f_ctime > MAXOCTAL11) { X if (info->f_ctime <= ULONG_MAX) X btos(ptb->dbuf.t_ctime, info->f_ctime, 11); X else X llbtos(ptb->dbuf.t_ctime, (Ullong)info->f_ctime, 11); X } else { X litos(ptb->dbuf.t_ctime, (Ulong)info->f_ctime, 11); X } X ptb->dbuf.t_magic[0] = 't'; X ptb->dbuf.t_magic[1] = 'a'; X ptb->dbuf.t_magic[2] = 'r'; X if (!numeric) { X char opfx0 = ptb->dbuf.t_prefix[0]; X X if (ic_nameuid(ptb->dbuf.t_uname, STUNMLEN+1, info->f_uid) > X TRUE) { X if (props.pr_flags & PR_XHDR) X info->f_xflags |= XF_UNAME; X } X /* XXX Korrektes overflowchecking */ X if (ptb->dbuf.t_uname[STUNMLEN-1] != '\0' && X props.pr_flags & PR_XHDR) { X info->f_xflags |= XF_UNAME; X } X if (ic_namegid(ptb->dbuf.t_gname, STGNMLEN+1, info->f_gid) > X TRUE) { X if (props.pr_flags & PR_XHDR) X info->f_xflags |= XF_GNAME; X } X /* XXX Korrektes overflowchecking */ X if (ptb->dbuf.t_gname[STGNMLEN-1] != '\0' && X props.pr_flags & PR_XHDR) { X info->f_xflags |= XF_GNAME; X } X if (*ptb->dbuf.t_uname) { X info->f_uname = ptb->dbuf.t_uname; X info->f_umaxlen = STUNMLEN; X } X if (*ptb->dbuf.t_gname) { X info->f_gname = ptb->dbuf.t_gname; X info->f_gmaxlen = STGNMLEN; X } X ptb->dbuf.t_prefix[0] = opfx0; /* Overwritten by strlcpy() */ X } X X if (is_sparse(info) || is_multivol(info)) { X if (info->f_size > MAXOCTAL11 && (props.pr_flags & PR_XHDR)) { X info->f_xflags |= XF_REALSIZE; X } X /* XXX Korrektes overflowchecking fuer xhdr */ X if (info->f_size <= MAXINT32) { X litos(ptb->xstar_in_dbuf.t_realsize, (Ulong)info->f_size, 11); X } else { X llitos(ptb->xstar_in_dbuf.t_realsize, (Ullong)info->f_size, 11); X } X } X if (is_multivol(info)) { X if (info->f_contoffset > MAXOCTAL11 && (props.pr_flags & PR_XHDR)) { X info->f_xflags |= XF_OFFSET; X } X if ((info->f_xflags & XF_OFFSET) == 0) { X /* X * Don't fill out contoffset if we have a xheader. X */ X if (info->f_contoffset <= MAXINT32) { X litos(ptb->xstar_in_dbuf.t_offset, X (Ulong)info->f_contoffset, 11); X } else { X llitos(ptb->xstar_in_dbuf.t_offset, X (Ullong)info->f_contoffset, 11); X } X } X } X} X X/* X * Used to create USTAR, PAX, SunTAR format header. X */ XLOCAL void Xinfo_to_ustar(info, ptb) X register FINFO *info; X register TCB *ptb; X{ X ptb->ustar_dbuf.t_magic[0] = 'u'; X ptb->ustar_dbuf.t_magic[1] = 's'; X ptb->ustar_dbuf.t_magic[2] = 't'; X ptb->ustar_dbuf.t_magic[3] = 'a'; X ptb->ustar_dbuf.t_magic[4] = 'r'; X X /* X * strncpy is slow: use handcrafted replacement. X */ X ptb->ustar_dbuf.t_version[0] = '0'; X ptb->ustar_dbuf.t_version[1] = '0'; X X if (!numeric) { X /* XXX Korrektes overflowchecking fuer xhdr */ X if (ic_nameuid(ptb->ustar_dbuf.t_uname, TUNMLEN, info->f_uid) > X TRUE) { X if (props.pr_flags & PR_XHDR) X info->f_xflags |= XF_UNAME; X } X /* XXX Korrektes overflowchecking fuer xhdr */ X if (ic_namegid(ptb->ustar_dbuf.t_gname, TGNMLEN, info->f_gid) > X TRUE) { X if (props.pr_flags & PR_XHDR) X info->f_xflags |= XF_GNAME; X } X if (*ptb->ustar_dbuf.t_uname) { X info->f_uname = ptb->ustar_dbuf.t_uname; X info->f_umaxlen = TUNMLEN; X } X if (*ptb->ustar_dbuf.t_gname) { X info->f_gname = ptb->ustar_dbuf.t_gname; X info->f_gmaxlen = TGNMLEN; X } X } X if (info->f_rdevmaj > MAXOCTAL7) { X if (props.pr_flags & PR_XHDR) X info->f_xflags |= XF_DEVMAJOR; X /* X * XXX If we ever need to write more than a long into X * XXX devmajor, we need to change llitos() to check X * XXX for 7 char limits too. X */ X/* XXX */ X btos(ptb->ustar_dbuf.t_devmajor, info->f_rdevmaj, 7); X } else { X litos(ptb->ustar_dbuf.t_devmajor, info->f_rdevmaj, 7); X } X#if DEV_MINOR_BITS > 21 /* XXX */ X /* X * XXX The DEV_MINOR_BITS autoconf macro is only tested with 32 bit X * XXX ints but this does not matter as it is sufficient to know that X * XXX it will not fit into a 7 digit octal number. X */ X if (info->f_rdevmin > MAXOCTAL7) { X extern BOOL hpdev; X X if (props.pr_flags & PR_XHDR) { X info->f_xflags |= XF_DEVMINOR; X } X if ((info->f_rdevmin <= MAXOCTAL8) && hpdev) { X char c; X X /* X * Implement the method from HP-UX that allows 24 bit X * for the device minor number. Note that this method X * violates the POSIX specs. X */ X c = ptb->ustar_dbuf.t_prefix[0]; X litos(ptb->ustar_dbuf.t_devminor, info->f_rdevmin, 8); X ptb->ustar_dbuf.t_prefix[0] = c; X } else { X /* X * XXX If we ever need to write more than a long into X * XXX devmainor, we need to change llitos() to check X * XXX for 7 char limits too. X */ X/* XXX */ X btos(ptb->ustar_dbuf.t_devminor, info->f_rdevmin, 7); X } X } else X#endif X { X litos(ptb->ustar_dbuf.t_devminor, info->f_rdevmin, 7); X } X} X X/* X * Used to create XSTAR, XUSTAR, EXUSTAR format header. X */ XLOCAL void Xinfo_to_xstar(info, ptb) X register FINFO *info; X register TCB *ptb; X{ X info_to_ustar(info, ptb); X X if (info->f_atime < 0 || info->f_atime > MAXOCTAL11) { X if (info->f_atime <= ULONG_MAX) X btos(ptb->xstar_dbuf.t_atime, (Ulong)info->f_atime, 11); X else X llbtos(ptb->xstar_dbuf.t_atime, (Ullong)info->f_atime, 11); X } else { X litos(ptb->xstar_dbuf.t_atime, (Ulong)info->f_atime, 11); X } X if (info->f_ctime < 0 || info->f_ctime > MAXOCTAL11) { X if (info->f_ctime <= ULONG_MAX) X btos(ptb->xstar_dbuf.t_ctime, (Ulong)info->f_ctime, 11); X else X llbtos(ptb->xstar_dbuf.t_ctime, (Ullong)info->f_ctime, 11); X } else { X litos(ptb->xstar_dbuf.t_ctime, (Ulong)info->f_ctime, 11); X } X X /* X * Help recognition in isxmagic(), make sure that prefix[130] is null. X */ X ptb->xstar_dbuf.t_prefix[130] = '\0'; X X if (H_TYPE(hdrtype) == H_XSTAR) { X ptb->xstar_dbuf.t_xmagic[0] = 't'; X ptb->xstar_dbuf.t_xmagic[1] = 'a'; X ptb->xstar_dbuf.t_xmagic[2] = 'r'; X } X if (is_sparse(info) || is_multivol(info)) { X if (info->f_size > MAXOCTAL11 && (props.pr_flags & PR_XHDR)) { X info->f_xflags |= XF_REALSIZE; X } X /* XXX Korrektes overflowchecking fuer xhdr */ X if (info->f_size <= MAXINT32) { X litos(ptb->xstar_in_dbuf.t_realsize, (Ulong)info->f_size, 11); X } else { X llitos(ptb->xstar_in_dbuf.t_realsize, (Ullong)info->f_size, 11); X } X } X if (is_multivol(info)) { X if (info->f_contoffset > MAXOCTAL11 && (props.pr_flags & PR_XHDR)) { X info->f_xflags |= XF_OFFSET; X } X if ((info->f_xflags & XF_OFFSET) == 0) { X /* X * Don't fill out contoffset if we have a xheader. X */ X if (info->f_contoffset <= MAXINT32) { X litos(ptb->xstar_in_dbuf.t_offset, X (Ulong)info->f_contoffset, 11); X } else { X llitos(ptb->xstar_in_dbuf.t_offset, X (Ullong)info->f_contoffset, 11); X } X } X } X} X X/* X * Used to create GNU tar format header. X */ XLOCAL void Xinfo_to_gnutar(info, ptb) X register FINFO *info; X register TCB *ptb; X{ X strcpy(ptb->gnu_dbuf.t_magic, gmagic); X X if (!numeric) { X if (ic_nameuid(ptb->ustar_dbuf.t_uname, TUNMLEN, info->f_uid) > X TRUE) { X if (props.pr_flags & PR_XHDR) X info->f_xflags |= XF_UNAME; X } X if (ic_namegid(ptb->ustar_dbuf.t_gname, TGNMLEN, info->f_gid) > X TRUE) { X if (props.pr_flags & PR_XHDR) X info->f_xflags |= XF_GNAME; X } X if (*ptb->ustar_dbuf.t_uname) { X info->f_uname = ptb->ustar_dbuf.t_uname; X info->f_umaxlen = TUNMLEN; X } X if (*ptb->ustar_dbuf.t_gname) { X info->f_gname = ptb->ustar_dbuf.t_gname; X info->f_gmaxlen = TGNMLEN; X } X } X if (info->f_xftype == XT_CHR || info->f_xftype == XT_BLK) { X if (info->f_rdevmaj > MAXOCTAL7) { X btos(ptb->ustar_dbuf.t_devmajor, info->f_rdevmaj, 7); X } else { X litos(ptb->ustar_dbuf.t_devmajor, info->f_rdevmaj, 7); X } X if (info->f_rdevmin > MAXOCTAL7) { X btos(ptb->ustar_dbuf.t_devminor, info->f_rdevmin, 7); X } else { X litos(ptb->ustar_dbuf.t_devminor, info->f_rdevmin, 7); X } X } X X /* X * XXX GNU tar only fill this if doing a gnudump. X */ X if (info->f_atime < 0 || info->f_atime > MAXOCTAL11) { X if (info->f_atime <= ULONG_MAX) X btos(ptb->gnu_dbuf.t_atime, (Ulong)info->f_atime, 11); X else X llbtos(ptb->gnu_dbuf.t_atime, (Ullong)info->f_atime, 11); X } else { X litos(ptb->gnu_dbuf.t_atime, (Ulong)info->f_atime, 11); X } X if (info->f_ctime < 0 || info->f_ctime > MAXOCTAL11) { X if (info->f_ctime <= ULONG_MAX) X btos(ptb->gnu_dbuf.t_ctime, (Ulong)info->f_ctime, 11); X else X llbtos(ptb->gnu_dbuf.t_ctime, (Ullong)info->f_ctime, 11); X } else { X litos(ptb->gnu_dbuf.t_ctime, (Ulong)info->f_ctime, 11); X } X X if (is_sparse(info)) { X if (info->f_size <= MAXINT32) { X litos(ptb->gnu_in_dbuf.t_realsize, (Ulong)info->f_size, 11); X } else { X llitos(ptb->gnu_in_dbuf.t_realsize, (Ullong)info->f_size, 11); X } X } X} X XEXPORT int Xtcb_to_info(ptb, info) X register TCB *ptb; X register FINFO *info; X{ X int ret = 0; X char xname; X char xlink; X char xpfx; X Ulong ul; X Ullong ull; X int xt = XT_BAD; X int rxt = XT_BAD; Xstatic BOOL posixwarn = FALSE; Xstatic BOOL namewarn = FALSE; Xstatic BOOL modewarn = FALSE; X X /* X * F_HAS_NAME is only used from list.c when the -listnew option is X * present. Keep f_lname and f_name, don't read LF_LONGLINK/LF_LONGNAME X * in this case. X */ X info->f_namelen = info->f_lnamelen = 0; X info->f_uname = info->f_gname = NULL; X info->f_umaxlen = info->f_gmaxlen = 0L; X info->f_xftype = XT_BAD; X info->f_rxftype = XT_BAD; X info->f_xflags = 0; X info->f_contoffset = (off_t)0; X info->f_flags &= F_HAS_NAME; X info->f_timeres = 1L; X info->f_fflags = 0L; X info->f_nlink = 0; X info->f_dir = NULL; X info->f_dirinos = NULL; X info->f_dirents = 0; X info->f_llsize = 0; X info->f_devminorbits = 0; X X tcb_to_xhdr_reset(); /* Falsch wenn wir mehr als @ in list wollen */ X X if (H_TYPE(hdrtype) >= H_CPIO_BASE) X return (cpiotcb_to_info(ptb, info)); X X while (pr_isxheader(ptb->dbuf.t_linkflag)) { X /* X * Handle POSIX.1-2001 extensions. X */ X if ((ptb->dbuf.t_linkflag == LF_XHDR || X ptb->dbuf.t_linkflag == LF_GHDR || X ptb->dbuf.t_linkflag == LF_VU_XHDR)) { X ret = tcb_to_xhdr(ptb, info); X info->f_flags &= ~F_DATA_SKIPPED; X if (ret != 0) X return (ret); X X xt = info->f_xftype; X rxt = info->f_rxftype; X } X /* X * Handle very long names the old (star & gnutar) way. X */ X if ((info->f_flags & F_HAS_NAME) == 0 && X props.pr_nflags & PR_LONG_NAMES) { X while (ret == 0 && X (ptb->dbuf.t_linkflag == LF_LONGLINK || X ptb->dbuf.t_linkflag == LF_LONGNAME)) { X ret = tcb_to_longname(ptb, info); X info->f_flags &= ~F_DATA_SKIPPED; X } X if (ret) X return (ret); X } X } X if (!pr_validtype(ptb->dbuf.t_linkflag)) { X errmsgno(EX_BAD, X "WARNING: Archive contains unknown typeflag '%c' (0x%02X) at %lld.\n", X ptb->dbuf.t_linkflag, ptb->dbuf.t_linkflag, tblocks()); X } X X if (ptb->ndbuf.t_name[NAMSIZ] == '\0') { /* "ndbuf" is NAMSIZE+1 */ X if (ptb->dbuf.t_name[NAMSIZ-1] == '\0') { X if (!nowarn && !modewarn) { X errmsgno(EX_BAD, X "WARNING: Archive violates POSIX 1003.1 (mode field starts with null byte).\n"); X modewarn = TRUE; X } X } else if (!nowarn && !namewarn) { X errmsgno(EX_BAD, X "WARNING: Archive violates POSIX 1003.1 (100 char filename is null terminated).\n"); X namewarn = TRUE; X } X ptb->ndbuf.t_name[NAMSIZ] = ' '; X } X stoli(ptb->dbuf.t_mode, &ul, 7); X info->f_mode = ul; X if (info->f_mode & ~07777) { X if (!nowarn && !modebits && H_TYPE(hdrtype) == H_USTAR && !posixwarn) { X errmsgno(EX_BAD, X "WARNING: Archive violates POSIX 1003.1 (too many bits in mode field).\n"); X posixwarn = TRUE; X } X info->f_mode &= 07777; X } X if ((info->f_xflags & XF_UID) == 0) { X if (ptb->dbuf.t_uid[0] & 0x80) X stob(ptb->dbuf.t_uid, &ul, 7); X else X stoli(ptb->dbuf.t_uid, &ul, 7); X info->f_uid = ul; X if (info->f_uid != ul) { X print_hrange("uid", (Ullong)ul); X info->f_flags |= F_BAD_UID; X info->f_uid = ic_uid_nobody(); X } X } X if ((info->f_xflags & XF_UID) == 0) { X if (ptb->dbuf.t_gid[0] & 0x80) X stob(ptb->dbuf.t_gid, &ul, 7); X else X stoli(ptb->dbuf.t_gid, &ul, 7); X info->f_gid = ul; X if (info->f_gid != ul) { X print_hrange("gid", (Ullong)ul); X info->f_flags |= F_BAD_GID; X info->f_gid = ic_gid_nobody(); X } X } X X /* X * Possible flags from extended header: X * XF_SIZE|XF_REALSIZE Found either "size" or X * "SCHILY.realsize" and "size" X * XF_REALSIZE Found only "SCHILY.realsize" X * 0 Found neither "SCHILY.realsize" nor "size" X */ X if ((info->f_xflags & XF_SIZE) == 0) { X stolli(ptb->dbuf.t_size, &ull); X if ((info->f_xflags & XF_SIZE) == 0) { X info->f_rsize = info->f_llsize = ull; X if (info->f_rsize != ull) { X print_hrange("size", ull); X info->f_rsize = 0, X info->f_flags |= (F_BAD_META | F_BAD_SIZE); X } X } X if ((info->f_xflags & XF_REALSIZE) == 0) X info->f_size = ull; X } X X switch (ptb->dbuf.t_linkflag) { X X case LNKTYPE: X if (linkdata) X break; X if (props.pr_flags & PR_LINK_DATA) X break; X /* FALLTHROUGH */ X case DIRTYPE: X case CHRTYPE: X case BLKTYPE: X case FIFOTYPE: X case LF_META: X info->f_rsize = 0L; X info->f_llsize = 0L; X break; X X default: X /* X * Nothing to do here, we did handle this already above the X * switch statement. X */ X break; X } X X if ((info->f_xflags & XF_MTIME) == 0) { X if (ptb->dbuf.t_mtime[0] & 0x80) X stob(ptb->dbuf.t_mtime, &ul, 11); X else X stoli(ptb->dbuf.t_mtime, &ul, 11); X info->f_mtime = (time_t)ul; X info->f_mnsec = 0L; X if (info->f_mtime != ul) { X print_hrange("time", (Ullong)ul); X info->f_mtime = 0; X } X } X X info->f_typeflag = ptb->ustar_dbuf.t_typeflag; X X switch (H_TYPE(hdrtype)) { X X default: X case H_TAR: X case H_OTAR: X tar_to_info(ptb, info); X break; X case H_PAX: X case H_EPAX: X case H_USTAR: X case H_SUNTAR: X ustar_to_info(ptb, info); X break; X case H_XSTAR: X case H_XUSTAR: X case H_EXUSTAR: X xstar_to_info(ptb, info); X break; X case H_GNUTAR: X gnutar_to_info(ptb, info); X break; X case H_STAR: X star_to_info(ptb, info); X break; X } X info->f_rxftype = info->f_xftype; X if (rxt != XT_BAD) { X info->f_rxftype = rxt; X info->f_filetype = XTTOST(info->f_rxftype); X info->f_type = XTTOIF(info->f_rxftype); X /* X * XT_LINK may be any 'real' file type, X * XT_META may be either a regular file or a contigouos file. X */ X if (info->f_xftype != XT_LINK && info->f_xftype != XT_META) X info->f_xftype = info->f_rxftype; X } X if (xt != XT_BAD) { X info->f_xftype = xt; X } X X /* X * Hack for list module (option -newest) ... X * Save and restore t_name[NAMSIZ] & t_linkname[NAMSIZ] X * Use "ndbuf" to permit NAMESIZE as index. X */ X xname = ptb->ndbuf.t_name[NAMSIZ]; X ptb->ndbuf.t_name[NAMSIZ] = '\0'; /* allow 100 chars in name */ X xlink = ptb->ndbuf.t_linkname[NAMSIZ]; X ptb->ndbuf.t_linkname[NAMSIZ] = '\0'; /* allow 100 chars in linkname */ X xpfx = ptb->ndbuf.t_prefix[PFXSIZ]; X ptb->ndbuf.t_prefix[PFXSIZ] = '\0'; /* allow 155 chars in prefix */ X X /* X * Handle long name in posix split form now. X * Also copy ptb->dbuf.t_linkname[] if namelen is == 100. X */ X tcb_to_name(ptb, info); X X ptb->ndbuf.t_name[NAMSIZ] = xname; /* restore remembered value */ X ptb->ndbuf.t_linkname[NAMSIZ] = xlink; /* restore remembered value */ X ptb->ndbuf.t_prefix[PFXSIZ] = xpfx; /* restore remembered value */ X X if (info->f_flags & F_BAD_UID) X info->f_mode &= ~TSUID; X if (info->f_flags & F_BAD_GID) X info->f_mode &= ~TSGID; X X return (ret); X} X X/* X * Used to convert from old tar format header. X */ XLOCAL void Xtar_to_info(ptb, info) X register TCB *ptb; X register FINFO *info; X{ X register int typeflag = ptb->ustar_dbuf.t_typeflag; X char xname; X X xname = ptb->ndbuf.t_name[NAMSIZ]; X ptb->ndbuf.t_name[NAMSIZ] = '\0'; /* allow 100 chars in name */ X X if (ptb->ndbuf.t_name[0] != '\0' && X ptb->ndbuf.t_name[strlen(ptb->ndbuf.t_name) - 1] == '/') { X typeflag = DIRTYPE; X info->f_filetype = F_DIR; X info->f_rsize = (off_t)0; /* XXX hier?? siehe oben */ X } else if (typeflag == SYMTYPE) { X info->f_filetype = F_SLINK; X } else if (typeflag != DIRTYPE) { X info->f_filetype = F_FILE; X } X ptb->ndbuf.t_name[NAMSIZ] = xname; /* restore remembered value */ X X info->f_xftype = USTOXT(typeflag); X info->f_type = XTTOIF(info->f_xftype); X info->f_rdevmaj = info->f_rdevmin = info->f_rdev = 0; X info->f_ctime = info->f_atime = info->f_mtime; X info->f_cnsec = info->f_ansec = 0L; X} X X/* X * Used to convert from old star format header. X */ XLOCAL void Xstar_to_info(ptb, info) X register TCB *ptb; X register FINFO *info; X{ X Ulong id; X uid_t uid; X gid_t gid; X Ullong ull; X int mbits; X X version = ptb->dbuf.t_vers; X if (ptb->dbuf.t_vers < STVERSION) { X tar_to_info(ptb, info); X return; X } X stoli(ptb->dbuf.t_filetype, &info->f_filetype, 7); X stoli(ptb->dbuf.t_type, &id, 11); X info->f_type = id; X /* X * star Erweiterungen sind wieder ANSI kompatibel, d.h. linkflag X * hält den echten Dateityp (LONKLINK, LONGNAME, SPARSE ...) X */ X if (ptb->dbuf.t_linkflag < '1') X info->f_xftype = IFTOXT(info->f_type); X else X info->f_xftype = USTOXT(ptb->ustar_dbuf.t_typeflag); X X if (ptb->dbuf.t_rdev[0] & 0x80) X stob(ptb->dbuf.t_rdev, &id, 10); /* Last c is t_devminorbits */ X else X stoli(ptb->dbuf.t_rdev, &id, 11); X info->f_rdev = id; X if ((info->f_rdev != id) && is_dev(info)) { X print_hrange("rdev", (Ullong)id); X info->f_flags |= F_BAD_META; X } X if ((info->f_xflags & (XF_DEVMAJOR|XF_DEVMINOR)) != X (XF_DEVMAJOR|XF_DEVMINOR)) { X mbits = ptb->dbuf.t_devminorbits - '@'; X if (((mbits + CHAR_BIT-1) / CHAR_BIT) > sizeof (info->f_rdev)) { X errmsgno(EX_BAD, X "WARNING: Too many (%d) minor bits in header at %lld.\n", X mbits, X tblocks()); X mbits = -1; X } X if (mbits == 0) { X static BOOL dwarned = FALSE; X if (!dwarned && is_dev(info)) { /* Only warn for devices */ X#ifdef DEV_MINOR_NONCONTIG X errmsgno(EX_BAD, X "WARNING: Minor device numbers are non contiguous.\n"); X errmsgno(EX_BAD, X "WARNING: Devices may not be extracted correctly.\n"); X#else X errmsgno(EX_BAD, X "WARNING: The archiving system used non contiguous minor numbers.\n"); X errmsgno(EX_BAD, X "WARNING: Cannot extract devices correctly.\n"); X#endif X dwarned = TRUE; X } X /* X * Let us hope that both, the archiving and the X * extracting system use the same major()/minor() X * mapping. X */ X info->f_rdevmaj = major(info->f_rdev); X info->f_rdevmin = minor(info->f_rdev); X } else { X /* X * Convert from remote major()/minor() mapping to X * local major()/minor() mapping. X */ X if (mbits < 0) /* Old star format */ X mbits = 8; X info->f_rdevmaj = _dev_major(mbits, info->f_rdev); X info->f_rdevmin = _dev_minor(mbits, info->f_rdev); X info->f_rdev = makedev(info->f_rdevmaj, info->f_rdevmin); X } X } X X if ((info->f_xflags & XF_ATIME) == 0) { X if (ptb->dbuf.t_atime[0] & 0x80) X stob(ptb->dbuf.t_atime, &id, 11); X else X stoli(ptb->dbuf.t_atime, &id, 11); X info->f_atime = (time_t)id; X info->f_ansec = 0L; X } X if ((info->f_xflags & XF_CTIME) == 0) { X if (ptb->dbuf.t_ctime[0] & 0x80) X stob(ptb->dbuf.t_ctime, &id, 11); X else X stoli(ptb->dbuf.t_ctime, &id, 11); X info->f_ctime = (time_t)id; X info->f_cnsec = 0L; X } X X if ((info->f_xflags & XF_UNAME) == 0) { X if (*ptb->dbuf.t_uname) { X info->f_uname = ptb->dbuf.t_uname; X info->f_umaxlen = STUNMLEN; X } X } X if (info->f_uname) { X char xname; X X xname = ptb->dbuf.t_gname[0]; X ptb->dbuf.t_gname[0] = '\0'; X if (!numeric && ic_uidname(info->f_uname, info->f_umaxlen, &uid)) { X info->f_flags &= ~F_BAD_UID; X info->f_uid = uid; X } X ptb->dbuf.t_gname[0] = xname; X } X if ((info->f_xflags & XF_GNAME) == 0) { X if (*ptb->dbuf.t_gname) { X info->f_gname = ptb->dbuf.t_gname; X info->f_gmaxlen = STGNMLEN; X } X } X if (info->f_gname) { X char xname; X X xname = ptb->dbuf.t_prefix[0]; X ptb->dbuf.t_prefix[0] = '\0'; X if (!numeric && ic_gidname(info->f_gname, info->f_gmaxlen, &gid)) { X info->f_flags &= ~F_BAD_GID; X info->f_gid = gid; X } X ptb->dbuf.t_prefix[0] = xname; X } X X if (is_sparse(info) || is_multivol(info)) { X if ((info->f_xflags & XF_REALSIZE) == 0) { X stolli(ptb->xstar_in_dbuf.t_realsize, &ull); X info->f_size = ull; X } X } X if (is_multivol(info)) { X if ((info->f_xflags & XF_OFFSET) == 0) { X stolli(ptb->xstar_in_dbuf.t_offset, &ull); X info->f_contoffset = ull; X } X } X} X X/* X * Used to convert from USTAR, PAX, SunTAR format header. X */ XLOCAL void Xustar_to_info(ptb, info) X register TCB *ptb; X register FINFO *info; X{ X uid_t uid; X gid_t gid; X dev_t d; X Ulong ul; X char c; X X info->f_xftype = USTOXT(ptb->ustar_dbuf.t_typeflag); X info->f_filetype = XTTOST(info->f_xftype); X info->f_type = XTTOIF(info->f_xftype); X X if ((info->f_xflags & XF_UNAME) == 0) { X if (*ptb->ustar_dbuf.t_uname) { X info->f_uname = ptb->ustar_dbuf.t_uname; X info->f_umaxlen = TUNMLEN; X } X } X if (info->f_uname) { X char xname; X X xname = ptb->ustar_dbuf.t_gname[0]; X ptb->ustar_dbuf.t_gname[0] = '\0'; X if (!numeric && ic_uidname(info->f_uname, info->f_umaxlen, &uid)) { X info->f_flags &= ~F_BAD_UID; X info->f_uid = uid; X } X ptb->ustar_dbuf.t_gname[0] = xname; X } X if ((info->f_xflags & XF_GNAME) == 0) { X if (*ptb->ustar_dbuf.t_gname) { X info->f_gname = ptb->ustar_dbuf.t_gname; X info->f_gmaxlen = TGNMLEN; X } X } X if (info->f_gname) { X char xname; X X xname = ptb->ustar_dbuf.t_devmajor[0]; X ptb->ustar_dbuf.t_devmajor[0] = '\0'; X if (!numeric && ic_gidname(info->f_gname, info->f_gmaxlen, &gid)) { X info->f_flags &= ~F_BAD_GID; X info->f_gid = gid; X } X ptb->ustar_dbuf.t_devmajor[0] = xname; X } X X if ((info->f_xflags & XF_DEVMAJOR) == 0) { X if (ptb->ustar_dbuf.t_devmajor[0] & 0x80) X stob(ptb->ustar_dbuf.t_devmajor, &ul, 7); X else X stoli(ptb->ustar_dbuf.t_devmajor, &ul, 7); X info->f_rdevmaj = ul; X d = makedev(info->f_rdevmaj, 0); X d = major(d); X if ((d != ul) && is_dev(info)) { X print_hrange("rdevmajor", (Ullong)ul); X info->f_flags |= F_BAD_META; X } X } X X if ((info->f_xflags & XF_DEVMINOR) == 0) { X if (ptb->ustar_dbuf.t_devminor[0] & 0x80) { X stob(ptb->ustar_dbuf.t_devminor, &ul, 7); X } else { X /* X * The 'tar' that comes with HP-UX writes illegal tar X * archives. It includes 8 characters in the minor X * field and allows to archive 24 bits for the minor X * device which are used by HP-UX. As we like to be X * able to read these archives, we need to convert X * the number carefully by temporarily writing a NULL X * to the next character and restoring the right X * content afterwards. X */ X c = ptb->ustar_dbuf.t_prefix[0]; X ptb->ustar_dbuf.t_prefix[0] = '\0'; X stoli(ptb->ustar_dbuf.t_devminor, &ul, 8); X ptb->ustar_dbuf.t_prefix[0] = c; X } X info->f_rdevmin = ul; X d = makedev(0, info->f_rdevmin); X d = minor(d); X if ((d != ul) && is_dev(info)) { X print_hrange("rdevminor", (Ullong)ul); X info->f_flags |= F_BAD_META; X } X } X X info->f_rdev = makedev(info->f_rdevmaj, info->f_rdevmin); X X /* X * ANSI Tar hat keine atime & ctime im Header! X */ X if ((info->f_xflags & XF_ATIME) == 0) { X info->f_atime = info->f_mtime; X info->f_ansec = 0L; X } X if ((info->f_xflags & XF_CTIME) == 0) { X info->f_ctime = info->f_mtime; X info->f_cnsec = 0L; X } X} X X/* X * Used to convert from XSTAR, XUSTAR, EXUSTAR format header. X */ XLOCAL void Xxstar_to_info(ptb, info) X register TCB *ptb; X register FINFO *info; X{ X Ulong ul; X Ullong ull; X X ustar_to_info(ptb, info); X X if ((info->f_xflags & XF_ATIME) == 0) { X if (ptb->xstar_dbuf.t_atime[0] & 0x80) X stob(ptb->xstar_dbuf.t_atime, &ul, 11); X else X stoli(ptb->xstar_dbuf.t_atime, &ul, 11); X info->f_atime = (time_t)ul; X info->f_ansec = 0L; X } X if ((info->f_xflags & XF_CTIME) == 0) { X if (ptb->xstar_dbuf.t_ctime[0] & 0x80) X stob(ptb->xstar_dbuf.t_ctime, &ul, 11); X else X stoli(ptb->xstar_dbuf.t_ctime, &ul, 11); X info->f_ctime = (time_t)ul; X info->f_cnsec = 0L; X } X X if (is_sparse(info) || is_multivol(info)) { X if ((info->f_xflags & XF_REALSIZE) == 0) { X stolli(ptb->xstar_in_dbuf.t_realsize, &ull); X info->f_size = ull; X } X } X if (is_multivol(info)) { X if ((info->f_xflags & XF_OFFSET) == 0) { X stolli(ptb->xstar_in_dbuf.t_offset, &ull); X info->f_contoffset = ull; X } X } X} X X/* X * Used to convert from GNU tar format header. X */ XLOCAL void Xgnutar_to_info(ptb, info) X register TCB *ptb; X register FINFO *info; X{ X Ulong ul; X Ullong ull; X X ustar_to_info(ptb, info); X X if ((info->f_xflags & XF_ATIME) == 0) { X if (ptb->gnu_dbuf.t_atime[0] & 0x80) X stob(ptb->gnu_dbuf.t_atime, &ul, 11); X else X stoli(ptb->gnu_dbuf.t_atime, &ul, 11); X info->f_atime = (time_t)ul; X info->f_ansec = 0L; X if (info->f_atime == 0 && ptb->gnu_dbuf.t_atime[0] == '\0') X info->f_atime = info->f_mtime; X } X X if ((info->f_xflags & XF_CTIME) == 0) { X if (ptb->gnu_dbuf.t_ctime[0] & 0x80) X stob(ptb->gnu_dbuf.t_ctime, &ul, 11); X else X stoli(ptb->gnu_dbuf.t_ctime, &ul, 11); X info->f_ctime = (time_t)ul; X info->f_cnsec = 0L; X if (info->f_ctime == 0 && ptb->gnu_dbuf.t_ctime[0] == '\0') X info->f_ctime = info->f_mtime; X } X X if (is_sparse(info)) { X stolli(ptb->gnu_in_dbuf.t_realsize, &ull); X info->f_size = ull; X } X if (is_multivol(info)) { X stolli(ptb->gnu_dbuf.t_offset, &ull); X info->f_contoffset = ull; X } X} X XLOCAL int Xustoxt(ustype) X char ustype; X{ X /* X * Map ANSI types X */ X if (ustype >= REGTYPE && ustype <= CONTTYPE) X return (_USTOXT(ustype)); X X /* X * Map Vendor Unique (Gnu tar & Star) types ANSI: "local enhancements" X */ X if ((props.pr_flags & (PR_LOCAL_STAR|PR_LOCAL_GNU)) && X ustype >= 'A' && ustype <= 'Z') X return (_VTTOXT(ustype)); X X /* X * treat unknown types as regular files conforming to standard X */ X return (XT_FILE); X} X XLOCAL BOOL Xcheckeof(ptb) X TCB *ptb; X{ Xextern m_stats *stats; Xextern long bigcnt; Xextern char *bigbase; X long lastsize = 0; X X if (!eofblock(ptb)) X return (FALSE); X if (debug) X errmsgno(EX_BAD, "First EOF Block at %lld OK\n", tblocks()); X X stats->eofblock = tblocks(); X markeof(); X if (bigcnt == 0 && (rflag || uflag)) { X /* X * If bigcnt == 0, the next readblock() call reads a new X * tape record and overwrites the current bigbuf data. X * Save the current read data in the buffer save area. X */ X movebytes(bigbuf, bigbase, bigsize); X lastsize = stats->lastsize; X } X X if (readblock((char *)ptb, TBLOCK) == EOF) { X errmsgno(EX_BAD, X "Incorrect EOF, second EOF block is missing at %lld.\n", X tblocks()); X goto goteof; X } X if (!eofblock(ptb)) { X if (!nowarn) X errmsgno(EX_BAD, X "WARNING: Partial (single block) EOF detected at %lld.\n", X tblocks()); X return (FALSE); X } X if (debug) X errmsgno(EX_BAD, "Second EOF Block OK at %lld\n", tblocks()); X X stats->eofblock = tblocks(); Xgoteof: X if (lastsize) { X /* X * Restore the old buffer content and back position the archive X * by one more tape block. X */ X movebytes(bigbase, bigbuf, bigsize); X stats->lastsize = lastsize; X backtape(); X } X return (TRUE); X} X XLOCAL BOOL Xeofblock(ptb) X TCB *ptb; X{ X register short i; X register char *s = (char *)ptb; X X if (props.pr_nflags & PR_DUMB_EOF) X return (ptb->dbuf.t_name[0] == '\0'); X X for (i = 0; i < TBLOCK; i++) X if (*s++ != '\0') X return (FALSE); X return (TRUE); X} X X/* X * Convert string -> long int X */ XLOCAL void Xstoli(s, l, fieldw) X register char *s; X Ulong *l; X int fieldw; X{ X register Ulong ret = 0L; X register char c; X register int t; X register char *ep = s + fieldw; X X#ifdef __nonono__ X /* X * We do not like this to be used for the t_chksum field. X */ X if (*((Uchar*)s) & 0x80) { X stob(s, l, 7); X return; X } X#endif X X while (*s == ' ') { X if (s++ >= ep) X break; X } X X for (; s <= ep; ) { X c = *s++; X if (isoctal(c)) { X t = c - '0'; X } else { X --s; X break; X } X ret *= 8; X ret += t; X } X *l = ret; X if (s > ep) { X errmsgno(EX_BAD, X "WARNING: Unterminated octal number at %lld.\n", X tblocks()); X } X} X X/* X * Convert string -> long long int X */ XEXPORT void Xstolli(s, ull) X register char *s; X Ullong *ull; X{ X register Ullong ret = (Ullong)0; X register char c; X register int t; X register char *ep = s + 11; X X if (*((Uchar*)s) & 0x80) { X stollb(s, ull, 11); X#ifdef B256_DEBUG X fprintf(stderr, "VALL %lld\n", *ull); X#endif X return; X } X X while (*s == ' ') { X if (s++ >= ep) X break; X } X X for (; s <= ep; ) { X c = *s++; X if (isoctal(c)) { X t = c - '0'; X } else { X --s; X break; X } X ret *= 8; X ret += t; X } X *ull = ret; X if (s > ep) { X errmsgno(EX_BAD, X "WARNING: Unterminated octal number at %lld.\n", X tblocks()); X } X} X X/* X * Convert long int -> string. X */ XLOCAL void Xlitos(s, l, fieldw) X char *s; X register Ulong l; X register int fieldw; X{ X register char *p = &s[fieldw+1]; X register char fill = props.pr_fillc; X X /* X * Bei 12 Byte Feldern würde hier das Nächste Feld überschrieben, wenn X * entgegen der normalen Reihenfolge geschrieben wird! X * Da der TCB sowieso vorher genullt wird ist es aber kein Problem X * das bei 8 Bytes Feldern notwendige Nullbyte wegzulassen. X */ X#ifdef __needed__ X *p = '\0'; X#endif X /* X * Das Zeichen nach einer Zahl. X * XXX Soll hier besser ein NULL Byte bei POSIX Tar hin? X * XXX Wuerde das Probleme mit einer automatischen Erkennung geben? X */ X *--p = ' '; X X do { X *--p = (l%8) + '0'; /* Compiler optimiert */ X X } while (--fieldw > 0 && (l /= 8) > 0); X X switch (fieldw) { X X default: X break; X case 11: *--p = fill; /* FALLTHROUGH */ X case 10: *--p = fill; /* FALLTHROUGH */ X case 9: *--p = fill; /* FALLTHROUGH */ X case 8: *--p = fill; /* FALLTHROUGH */ X case 7: *--p = fill; /* FALLTHROUGH */ X case 6: *--p = fill; /* FALLTHROUGH */ X case 5: *--p = fill; /* FALLTHROUGH */ X case 4: *--p = fill; /* FALLTHROUGH */ X case 3: *--p = fill; /* FALLTHROUGH */ X case 2: *--p = fill; /* FALLTHROUGH */ X case 1: *--p = fill; /* FALLTHROUGH */ X case 0:; X } X} X X/* X * Convert long long int -> string. X */ XEXPORT void Xllitos(s, ull, fieldw) X char *s; X register Ullong ull; X register int fieldw; X{ X register char *p = &s[fieldw+1]; X register char fill = props.pr_fillc; X X /* X * Currently only used with fieldwidth == 11. X * XXX Large 8 byte fields are handled separately. X */ X if (/* fieldw == 11 && */ ull > MAXOCTAL11) { X llbtos(s, ull, fieldw); X return; X } X X /* X * Bei 12 Byte Feldern würde hier das Nächste Feld überschrieben, wenn X * entgegen der normalen Reihenfolge geschrieben wird! X * Da der TCB sowieso vorher genullt wird ist es aber kein Problem X * das bei 8 Bytes Feldern notwendige Nullbyte wegzulassen. X */ X#ifdef __needed__ X *p = '\0'; X#endif X /* X * Das Zeichen nach einer Zahl. X * XXX Soll hier besser ein NULL Byte bei POSIX Tar hin? X * XXX Wuerde das Probleme mit einer automatischen Erkennung geben? X */ X *--p = ' '; X X do { X *--p = (ull%8) + '0'; /* Compiler optimiert */ X X } while (--fieldw > 0 && (ull /= 8) > 0); X X switch (fieldw) { X X default: X break; X case 11: *--p = fill; /* FALLTHROUGH */ X case 10: *--p = fill; /* FALLTHROUGH */ X case 9: *--p = fill; /* FALLTHROUGH */ X case 8: *--p = fill; /* FALLTHROUGH */ X case 7: *--p = fill; /* FALLTHROUGH */ X case 6: *--p = fill; /* FALLTHROUGH */ X case 5: *--p = fill; /* FALLTHROUGH */ X case 4: *--p = fill; /* FALLTHROUGH */ X case 3: *--p = fill; /* FALLTHROUGH */ X case 2: *--p = fill; /* FALLTHROUGH */ X case 1: *--p = fill; /* FALLTHROUGH */ X case 0:; X } X} X X/* X * Convert binary (base 256) string -> long int. X */ XLOCAL void Xstob(s, l, fieldw) X register char *s; X Ulong *l; X register int fieldw; X{ X register Ulong ret = 0L; X register Uchar c; X X c = *s++ & 0x7F; X ret = c * 256; X X while (--fieldw >= 0) { X c = *s++; X ret *= 256; X ret += c; X } X *l = ret; X} X X/* X * Convert binary (base 256) string -> long long int. X */ XLOCAL void Xstollb(s, ull, fieldw) X register char *s; X Ullong *ull; X register int fieldw; X{ X register Ullong ret = 0L; X register Uchar c; X X c = *s++ & 0x7F; X ret = c * 256; X X while (--fieldw >= 0) { X c = *s++; X ret *= 256; X ret += c; X } X *ull = ret; X} X X/* X * Convert long int -> binary (base 256) string. X */ XLOCAL void Xbtos(s, l, fieldw) X char *s; X register Ulong l; X register int fieldw; X{ X register char *p = &s[fieldw+1]; X X do { X *--p = l%256; /* Compiler optimiert */ X X } while (--fieldw > 0 && (l /= 256) > 0); X X s[0] |= 0x80; X} X X/* X * Convert long long int -> binary (base 256) string. X */ XLOCAL void Xllbtos(s, ull, fieldw) X char *s; X register Ullong ull; X register int fieldw; X{ X register char *p = &s[fieldw+1]; X X do { X *--p = ull%256; /* Compiler optimiert */ X X } while (--fieldw > 0 && (ull /= 256) > 0); X X s[0] |= 0x80; X} X XLOCAL BOOL Xnameascii(name) X register char *name; X{ X register unsigned char c; X while ((c = (unsigned char)*name++) != '\0') { X if (c > 127) X return (FALSE); X } X return (TRUE); X} X XLOCAL void Xprint_hrange(type, ull) X char *type; X Ullong ull; X{ X if (nowarn) X return; X errmsgno(EX_BAD, X "WARNING: %s '%llu' in header exceeds local range at %lld.\n", X type, ull, tblocks()); X} X X/* ------------------------------------------------------------------------- */ XEXPORT void Xdump_info(info) X FINFO *info; X{ X error("f_name: '%s'\n", info->f_name); X error("f_namelen: %lu\n", info->f_namelen); X error("f_lname: '%s'\n", info->f_lname); X error("f_lnamelen: %lu\n", info->f_lnamelen); X error("f_uname: '%s'\n", info->f_uname); X error("f_umaxlen: %lu\n", info->f_umaxlen); X error("f_gname: '%s'\n", info->f_gname); X error("f_gmaxlen: %lu\n", info->f_gmaxlen); X X error("f_dir: %p\n", info->f_dir); X error("f_dirinos: %p\n", info->f_dirinos); X error("f_dirlen: %d\n", info->f_dirlen); X error("f_dirents: %d\n", info->f_dirents); X error("f_dev: 0x%llX\n", (Ullong)info->f_dev); X error("f_ino: %llu\n", (Ullong)info->f_ino); X error("f_nlink: %llu\n", (Ullong)info->f_nlink); X error("f_mode: 0%llo\n", (Ullong)info->f_mode); X error("f_uid: %lld\n", (Llong)info->f_uid); X error("f_gid: %lld\n", (Llong)info->f_gid); X X error("f_size: %lld\n", (Llong)info->f_size); X error("f_rsize: %lld\n", (Llong)info->f_rsize); X error("f_contoffset:%lld\n", (Llong)info->f_contoffset); X error("f_flags: 0x%lX\n", info->f_flags); X error("f_xflags: 0x%lX\n", info->f_xflags); X error("f_xftype: %lu (%s)\n", info->f_xftype, XTTONAME(info->f_xftype)); X error("f_rxftype: %lu (%s)\n", info->f_rxftype, XTTONAME(info->f_rxftype)); X error("f_filetype: %lu\n", info->f_filetype); X error("f_typeflag: '%c'\n", info->f_typeflag); X error("f_type: 0%llo\n", (Ullong)info->f_type); X error("f_rdev: %lu\n", info->f_rdev); X error("f_rdevmaj: %lu\n", info->f_rdevmaj); X error("f_rdevmin: %lu\n", info->f_rdevmin); X error("f_atime: %.24s +0.%9.9ld s\n", ctime(&info->f_atime), info->f_ansec); X error("f_mtime: %.24s +0.%9.9ld s\n", ctime(&info->f_mtime), info->f_mnsec); X error("f_ctime: %.24s +0.%9.9ld s\n", ctime(&info->f_ctime), info->f_cnsec); X error("f_fflags: 0x%lX\n", info->f_fflags); X} END-of-star-1.6/star/header.c echo x - star-1.6/star/list.c sed 's/^X//' >star-1.6/star/list.c << 'END-of-star-1.6/star/list.c' X/* @(#)list.c 1.83 19/04/07 Copyright 1985, 1995, 2000-2019 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)list.c 1.83 19/04/07 Copyright 1985, 1995, 2000-2019 J. Schilling"; X#endif X/* X * List the content of an archive X * X * Copyright (c) 1985, 1995, 2000-2019 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include "star.h" X#include "props.h" X#include "table.h" X#include X#include X#include X#include X#define GT_COMERR /* #define comerr gtcomerr */ X#define GT_ERROR /* #define error gterror */ X#include X#include "starsubs.h" X#ifdef USE_FIND X#include X#endif X Xextern FILE *tarf; Xextern FILE *vpr; Xextern char *listfile; Xextern Llong curblockno; X Xextern time_t sixmonth; /* 6 months before limit (ls) */ Xextern time_t now; /* now limit (ls) */ X Xextern BOOL havepat; Xextern int iftype; Xextern BOOL paxls; Xextern int xdebug; Xextern BOOL numeric; Xextern int verbose; Xextern BOOL prblockno; Xextern BOOL tpath; Xextern BOOL cflag; Xextern BOOL xflag; Xextern BOOL interactive; X Xextern BOOL acctime; Xextern BOOL no_dirslash; Xextern BOOL Ctime; Xextern BOOL prinodes; X Xextern BOOL listnew; Xextern BOOL listnewf; X Xextern BOOL do_subst; X X#ifdef USE_FIND Xextern BOOL dofind; X#endif X XEXPORT void list __PR((void)); XLOCAL void modstr __PR((FINFO *info, char *s, mode_t mode)); XEXPORT void list_file __PR((FINFO *info)); XEXPORT void vprint __PR((FINFO *info)); X XEXPORT void Xlist() X{ X#ifdef USE_FIND Xextern struct WALK walkstate; X#endif X FINFO finfo; X FINFO newinfo; X TCB tb; X TCB newtb; X register TCB *ptb = &tb; X X fillbytes((char *)&finfo, sizeof (finfo), '\0'); X fillbytes((char *)&newinfo, sizeof (newinfo), '\0'); X X if (init_pspace(PS_STDERR, &finfo.f_pname) < 0) X return; X if (init_pspace(PS_STDERR, &finfo.f_plname) < 0) X return; X if (listnew || listnewf) { X if (init_pspace(PS_STDERR, &newinfo.f_pname) < 0) X return; X if (init_pspace(PS_STDERR, &newinfo.f_plname) < 0) X return; X } X X#ifdef USE_FIND X if (dofind) { X walkopen(&walkstate); X walkgethome(&walkstate); /* Needed in case we chdir */ X } X#endif X finfo.f_tcb = ptb; X for (;;) { X if (get_tcb(ptb) == EOF) X break; X if (prblockno) X (void) tblocks(); /* set curblockno */ X X finfo.f_name = finfo.f_pname.ps_path; X finfo.f_lname = finfo.f_plname.ps_path; X if (tcb_to_info(ptb, &finfo) == EOF) X break; X if (xdebug > 0) X dump_info(&finfo); X X#ifdef USE_FIND X if (dofind && !findinfo(&finfo)) { X void_file(&finfo); X continue; X } X#endif X X if (do_subst) { X subst(&finfo); X } X X if (listnew || listnewf) { X /* X * nsec beachten wenn im Archiv! X */ X if (((finfo.f_mtime > newinfo.f_mtime) || X ((finfo.f_xflags & XF_MTIME) && X (newinfo.f_xflags & XF_MTIME) && X (finfo.f_mtime == newinfo.f_mtime) && X (finfo.f_mnsec > newinfo.f_mnsec))) && X (!listnewf || is_file(&finfo))) { X movebytes(&finfo, &newinfo, X offsetof(FINFO, f_pname)); X movetcb(&tb, &newtb); X if (strcpy_pspace(PS_STDERR, X &newinfo.f_pname, X finfo.f_name) < 0) { X newinfo.f_name = ""; X } else { X newinfo.f_name = X newinfo.f_pname.ps_path; X } X if (newinfo.f_lname[0] != '\0') { X if (strcpy_pspace(PS_STDERR, X &newinfo.f_plname, X finfo.f_lname) < 0) { X newinfo.f_lname = ""; X } else { X newinfo.f_lname = X newinfo.f_plname.ps_path; X } X } X newinfo.f_flags |= F_HAS_NAME; X } X void_file(&finfo); X continue; X } X if (listfile && !hash_lookup(finfo.f_name)) { X void_file(&finfo); X continue; X } X if (hash_xlookup(finfo.f_name)) { X void_file(&finfo); X continue; X } X if (havepat && !match(finfo.f_name)) { X void_file(&finfo); X continue; X } X list_file(&finfo); X void_file(&finfo); X } X#ifdef USE_FIND X if (dofind) { X walkhome(&walkstate); X walkclose(&walkstate); X free(walkstate.twprivate); X } X#endif X if ((listnew || listnewf) && newinfo.f_mtime != 0L) { X /* X * XXX X * XXX Achtung!!! tcb_to_info zerstört t_name[NAMSIZ] X * XXX und t_linkname[NAMSIZ]. X * XXX Ist dies noch richtig? X * XXX Es sieht so aus as ob nur noch t_name[NAMSIZ] auf ' ' X * XXX gesetzt wird wenn dort ein null Byte steht. X */ X if ((props.pr_flags & PR_CPIO) == 0) { X /* X * Needed to set up the uname/gname fields for the X * various TAR headers. X */ X tcb_to_info(&newtb, &newinfo); X } X list_file(&newinfo); X } X} X X/* X * Convert POSIX.1 TAR mode/permission flags into string. X */ XLOCAL void X#ifdef PROTOTYPES Xmodstr(FINFO *info, char *s, register mode_t mode) X#else Xmodstr(info, s, mode) X FINFO *info; X char *s; X register mode_t mode; X#endif X{ X register char *mstr = "xwrxwrxwr"; X register char *str = s; X register int i; X X *str++ = '?'; /* Unknown file type */ X for (i = 9; --i >= 0; ) { X if (mode & (1 << i)) X *str++ = mstr[i]; X else X *str++ = '-'; X } X#ifdef USE_ACL X *str++ = ' '; X#endif X#ifdef USE_XATTR X *str++ = '\0'; /* Don't claim space for '@' */ X#endif X *str = '\0'; X str = s; X if (mode & TSVTX) { X if (mode & TOEXEC) { X str[9] = 't'; /* Sticky & exec. by others */ X } else { X str[9] = 'T'; /* Sticky but !exec. by oth */ X } X } X if (mode & TSGID) { X if (mode & TGEXEC) { X str[6] = 's'; /* Sgid & executable by grp */ X } else { X if (!is_file(info)) X str[6] = 'S'; /* Sgid directory, or other */ X else X str[6] = 'l'; /* Mandatory lock file */ X } X } X if (mode & TSUID) { X if (mode & TUEXEC) X str[3] = 's'; /* Suid & executable by own. */ X else X str[3] = 'S'; /* Suid but not executable */ X } X i = 10; X#ifdef USE_ACL X if ((info->f_xflags & (XF_ACL_ACCESS|XF_ACL_DEFAULT|XF_ACL_ACE)) != 0) X str[i++] = '+'; X#endif X#ifdef USE_XATTR X if ((info->f_xflags & XF_XATTR) != 0) X str[i++] = '@'; X#endif X i++; /* Make lint believe that we always use i. */ X} X XEXPORT void Xlist_file(info) X register FINFO *info; X{ X FILE *f; X time_t *tp; X char *tstr; X char mstr[13]; /* 10 UNIX chars + ACL '+' XATTR '@' + nul */ X char lstr[22]; /* ' ' + link count as string - 64 bits */ X static char nuid[21]; /* uid as 64 bit long */ X static char ngid[21]; /* gid as 64 bit long */ X char *add = ""; X X f = vpr; X if (prblockno) X fgtprintf(f, "block %9lld: ", curblockno); X if (cflag) X fprintf(f, "a "); X else if (xflag) X fprintf(f, "x "); X X if (prinodes && info->f_ino > 0) X fprintf(f, "%7llu ", (Llong)info->f_ino); X if (cflag && is_dir(info) && !no_dirslash) { X int len = info->f_namelen; X X if (len == 0) X len = strlen(info->f_name); X if (info->f_name[len-1] != '/') X add = "/"; X } X if (verbose) { X register Uint xft = info->f_xftype; X X tp = acctime ? &info->f_atime : X (Ctime ? &info->f_ctime : &info->f_mtime); X tstr = ctime(tp); X if (numeric || info->f_uname == NULL) { X sprintf(nuid, "%lld", (Llong)info->f_uid); X info->f_uname = nuid; X info->f_umaxlen = sizeof (nuid)-1; X } X if (numeric || info->f_gname == NULL) { X sprintf(ngid, "%lld", (Llong)info->f_gid); X info->f_gname = ngid; X info->f_gmaxlen = sizeof (ngid)-1; X } X X if (!paxls) { X if (is_special(info)) X fprintf(f, "%3lu %3lu", X info->f_rdevmaj, info->f_rdevmin); X else X fprintf(f, "%7llu", (Llong)info->f_size); X } X modstr(info, mstr, info->f_mode); X X if (paxls && info->f_nlink == 0 && is_link(info)) { X info->f_nlink = 2; X } X if (paxls || info->f_nlink > 0) { X /* X * UNIX ls uses %3d for the link count X * and does not claim space for ACL '+' X */ X js_sprintf(lstr, " %2llu", (Ullong)info->f_nlink); X } else { X lstr[0] = 0; X } X/* X * XXX Übergangsweise, bis die neue Filetypenomenklatur sauber eingebaut ist. X */ Xif (xft == 0 || xft == XT_BAD) { X xft = info->f_xftype = IFTOXT(info->f_type); X errmsgno(EX_BAD, "XXXXX xftype == 0 (typeflag = '%c' 0x%02X)\n", X info->f_typeflag, info->f_typeflag); X} X if (xft == XT_LINK) X xft = info->f_rxftype; X { X char *p = XTTOSTR(xft); X X if (p) X mstr[0] = *p; X } X if (!paxls) { X fprintf(f, X " %s%s %3.*s/%-3.*s %.12s %4.4s ", X mstr, X lstr, X (int)info->f_umaxlen, info->f_uname, X (int)info->f_gmaxlen, info->f_gname, X &tstr[4], &tstr[20]); X } else { X fprintf(f, X "%s%s %-8.*s %-8.*s ", X mstr, X lstr, X (int)info->f_umaxlen, info->f_uname, X (int)info->f_gmaxlen, info->f_gname); X if (is_special(info)) X fprintf(f, "%3lu %3lu", X info->f_rdevmaj, info->f_rdevmin); X else X fprintf(f, "%7llu", (Llong)info->f_size); X if ((*tp < sixmonth) || (*tp > now)) { X fprintf(f, " %.6s %4.4s ", X &tstr[4], &tstr[20]); X } else { X fprintf(f, " %.12s ", X &tstr[4]); X } X } X } X fprintf(f, "%s%s", info->f_name, add); X if (tpath) { X fprintf(f, "\n"); X return; X } X /* X * In case of a hardlinked symlink, we currently do not have the symlink X * target path and thus cannot check the synlink target. So first check X * whether it is a hardlink. X */ X if (is_link(info)) { X if (is_dir(info)) X fgtprintf(f, " directory"); X fprintf(f, " %s %s", X paxls ? "==" : "link to", X info->f_lname); X } else if (is_symlink(info)) X fprintf(f, " -> %s", info->f_lname); X if (is_volhdr(info)) X fgtprintf(f, " --Volume Header--"); X if (is_multivol(info)) { X fgtprintf(f, " --Continued at byte %lld--", X (Llong)info->f_contoffset); X } X fprintf(f, "\n"); X} X XEXPORT void Xvprint(info) X FINFO *info; X{ X FILE *f; X char *mode; X char *add = ""; X X if (verbose || interactive) { X if (verbose > 1) { X list_file(info); X return; X } X X f = vpr; X X if (prblockno) X fgtprintf(f, "block %9lld: ", curblockno); X if (cflag) X mode = "a "; X else if (xflag) X mode = "x "; X else X mode = ""; X X if (cflag && is_dir(info) && !no_dirslash) { X int len = info->f_namelen; X X if (len == 0) X len = strlen(info->f_name); X if (info->f_name[len-1] != '/') X add = "/"; X } X if (tpath) { X fprintf(f, "%s%s\n", info->f_name, add); X return; X } X if (is_dir(info)) { X if (is_link(info)) { X fgtprintf(f, "%s%s%s directory %s %s\n", X mode, info->f_name, add, X paxls ? "==" : "link to", X info->f_lname); X } else { X fgtprintf(f, "%s%s%s directory\n", mode, X info->f_name, add); X } X } else if (is_link(info)) { X fprintf(f, "%s%s %s %s\n", X mode, info->f_name, X paxls ? "==" : "link to", X info->f_lname); X } else if (is_symlink(info)) { X fprintf(f, "%s%s %s %s\n", X mode, info->f_name, X paxls ? "->" : "symbolic link to", X info->f_lname); X } else if (is_special(info)) { X fgtprintf(f, "%s%s special\n", mode, info->f_name); X } else { X fgtprintf(f, "%s%s %lld bytes, %lld tape blocks\n", X mode, info->f_name, (Llong)info->f_size, X (Llong)tarblocks(info->f_rsize)); X } X } X} END-of-star-1.6/star/list.c echo x - star-1.6/star/pax.mk sed 's/^X//' >star-1.6/star/pax.mk << 'END-of-star-1.6/star/pax.mk' X#ident @(#)pax.mk 1.20 13/11/07 X########################################################################### X#include $(MAKE_M_ARCH).def XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= bin XTARGET= spax X#SYMLINKS= ustar tar XCPPOPTS += -D__STAR__ XCPPOPTS += -DSET_CTIME -DFIFO -DUSE_MMAP -DUSE_REMOTE -DUSE_RCMD_RSH X#CPPOPTS += -DSET_CTIME -DFIFO -DUSE_MMAP X#CPPOPTS += -DSET_CTIME -DUSE_MMAP X#CPPOPTS += -DFIFO -DUSE_MMAP XCPPOPTS += -DUSE_LARGEFILES XCPPOPTS += -DUSE_FIND XCPPOPTS += -DUSE_ACL XCPPOPTS += -DUSE_XATTR XCPPOPTS += -DUSE_FFLAGS XCPPOPTS += -DPAX XCPPOPTS += -DSCHILY_PRINT XCFILES= pax.c header.c cpiohdr.c xheader.c xattr.c \ X list.c extract.c create.c append.c diff.c restore.c \ X remove.c star_unix.c acl_unix.c acltext.c fflags.c \ X buffer.c dirtime.c lhash.c \ X hole.c longnames.c \ X movearch.c table.c props.c \ X unicode.c \ X subst.c volhdr.c \ X chdir.c match.c defaults.c dumpdate.c \ X fifo.c device.c checkerr.c \ X findinfo.c pathname.c XHFILES= star.h starsubs.h dirtime.h xtab.h xutimes.h \ X movearch.h table.h props.h fifo.h diff.h \ X checkerr.h dumpdate.h bitstring.h pathname.h XLIBS= -ldeflt -lrmt -lfind -lschily $(LIB_ACL) $(LIB_ATTR) $(LIB_SOCKET) $(LIB_INTL) $(LIB_CAP) XXMK_FILE= spaxman.mk X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.cmd X########################################################################### Xcount: $(CFILES) $(HFILES) X count $r1 X END-of-star-1.6/star/pax.mk echo x - star-1.6/star/restore.c sed 's/^X//' >star-1.6/star/restore.c << 'END-of-star-1.6/star/restore.c' X/* @(#)restore.c 1.78 19/01/16 Copyright 2003-2019 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)restore.c 1.78 19/01/16 Copyright 2003-2019 J. Schilling"; X#endif X/* X * Data base management for incremental restores X * needed to detect and execute rename() and unlink() X * operations between two incremental dumps. X * X * File renames and file deletions are handled here as well. X * Since we cannot immediately know whether a file is deleted X * or just renamed, files that disappear from their old location X * are first moved to "star-tmpdir" and finally removed from there X * when we decide to exit star. X * X * Copyright (c) 2003-2019 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X/* X * Problems: X * X * - lost+found will usually not be extracted and thus X * get no new inode number. X * **** Solution: Use -U **** X * X * - chmod(1) only changes st_ctime but star will X * extract neither data nor permissions if only X * a chmod(1), chown(1) or smilar change did ocur. X * **** Solution: Use -U **** X * X * - unlink(dev) .... create(dev) and get same inode # X * **** Solution: sym_typecheck() **** X * The Solution creates a new problem that the new X * node created after sym_typecheck() may have a X * different inode number and we need to change the node. X */ X X#include X#include X#include /* Wegen AT_REMOVEDIR */ X#include X#include X#include "star.h" X#include "props.h" X#include "table.h" X#include "diff.h" X#include X#define GT_COMERR /* #define comerr gtcomerr */ X#define GT_ERROR /* #define error gterror */ X#include X#include /* XXX Wegen S_IFLNK */ X#include /* XXX Wegen S_IRWXU */ X#include /* XXX Wegen ENOENT */ X#include "restore.h" X#include "dumpdate.h" X#include "starsubs.h" X#include X X#define PADD_NODE_DEBUG X X#define PRINT_L_SYM /* Include symbols for star_sym.c */ X Xextern BOOL debug; Xextern int xdebug; Xextern int verbose; Xextern dev_t curfs; Xextern BOOL dopartial; Xextern BOOL forcerestore; Xextern char *vers; Xextern GINFO *grip; /* Global read info pointer */ X XLOCAL char *overs; /* Star version used with last restore */ XLOCAL int odtype; /* Old Dump type */ XLOCAL GINFO *ogp; /* Global information from last restore */ XEXPORT BOOL restore_valid; /* TRUE when after we did read a valid header */ X /* Also needed by star_sym.c */ XEXPORT BOOL is_star = TRUE; /* TRUE with star and we check the version */ X /* We do not abort if this is for star_sym.c */ X X#define HASH_ENTS 1024 X XLOCAL imap_t *iroot = NULL; /* The root directory */ XLOCAL imap_t *itmp = NULL; /* The temp directory star-tmpdir */ XLOCAL imap_t *isym = NULL; /* The temp directory star-symtable */ XLOCAL imap_t *imaps = NULL; XLOCAL imap_t **himaps = NULL; XLOCAL imap_t **hoimaps = NULL; XLOCAL imap_t **hnimaps = NULL; X#ifdef DEBUG XLOCAL int nimp; X#endif X X#ifdef PADD_NODE_DEBUG Xchar *padd_node_caller = NULL; X#endif X XLOCAL char sym_tmpdir[] = "star-tmpdir"; XLOCAL char sym_symtable[] = "star-symtable"; XLOCAL char sym_oldsymtable[] = "star-symtable.old"; XLOCAL char sym_symdump[] = "star-symdump"; XLOCAL char sym_lock[] = "star-lock"; X XLOCAL ino_t lock_ino; X XLOCAL int hashval __PR((Uchar *str)); XLOCAL imap_t *nfind_node __PR((char *name, imap_t *idir)); XLOCAL imap_t *pfind_node __PR((char *name)); XEXPORT imap_t *padd_node __PR((char *name, ino_t oino, ino_t nino, Int32_t flags)); XLOCAL imap_t *oifind_node __PR((imap_t *idir, ino_t nino)); XLOCAL imap_t *nifind_node __PR((imap_t *idir, ino_t nino)); XLOCAL imap_t *add_node __PR((imap_t *cwd, char *name, ino_t oino, ino_t nino, Int32_t flags)); XEXPORT imap_t *sym_addrec __PR((FINFO *info)); XEXPORT void sym_addstat __PR((FINFO *info, imap_t *imp)); XEXPORT imap_t *sym_dirprerpare __PR((FINFO *info, imap_t *idir)); XLOCAL void move2tmp __PR((char *dir, char *name, ino_t oino, ino_t nino)); XLOCAL void move2dir __PR((char *dir, char *name, ino_t oino)); XEXPORT imap_t *sym_typecheck __PR((FINFO *info, FINFO *cinfo, imap_t *imp)); XLOCAL BOOL removefile __PR((char *name)); XLOCAL BOOL removetree __PR((char *name)); XEXPORT void sym_initmaps __PR((void)); XEXPORT void sym_open __PR((char *name)); XLOCAL int xgetline __PR((FILE *f, char **bufp, size_t *lenp, char *name)); XLOCAL void checknl __PR((FILE *f)); XLOCAL void sym_initsym __PR((void)); XLOCAL void tmpnotempty __PR((void)); XLOCAL void purgeent __PR((imap_t *imp)); XLOCAL void purgetree __PR((imap_t *imp)); XEXPORT void sym_init __PR((GINFO *gp)); XEXPORT void sym_close __PR((void)); XLOCAL void sym_dump __PR((void)); XLOCAL void writeheader __PR((FILE *f)); XLOCAL void readheader __PR((FILE *f)); XLOCAL void checkheader __PR((void)); XLOCAL void useforce __PR((void)); XLOCAL void usepartial __PR((void)); XLOCAL size_t fullnlen __PR((imap_t *imp, BOOL top)); XLOCAL char *fullname __PR((imap_t *imp, char *cp, char *ep, BOOL top)); XLOCAL void printfullname __PR((FILE *f, imap_t *imp)); XLOCAL void printonesym __PR((FILE *f, imap_t *imp)); XLOCAL void printsyms __PR((FILE *f, imap_t *imp)); X#ifdef PRINT_L_SYM XLOCAL void printoneLsym __PR((FILE *f, imap_t *imp)); XLOCAL void printLsyms __PR((FILE *f, imap_t *imp)); XEXPORT void printLsym __PR((FILE *f)); X#endif X#ifdef __needed__ XLOCAL BOOL dirdiskonly __PR((FINFO *info, int *odep, char ***odp)); X#endif X XLOCAL int Xhashval(str) X register Uchar *str; X{ X register int sum = 0; X register int i; X register int c; X X for (i = 0; (c = *str++) != '\0'; i++) X sum ^= (c << (i&7)); X return (sum); X} X X/* X * Find a node by path name component and directory node pointer X */ XLOCAL imap_t * Xnfind_node(name, idir) X char *name; X register imap_t *idir; X{ X register imap_t *imp; X register char *np; X register char *inp; X register int nhash; X X np = name; X if (np[0] == '\0') X return (idir); X if (np[0] == '.') { X if (np[1] == '\0') X return (idir); X if (np[1] == '.' && np[2] == '\0') X return (idir->i_dparent); X } X nhash = hashval((Uchar *)name); X imp = himaps[nhash%HASH_ENTS]; X X for (; imp; imp = imp->i_hnext) { X X if (nhash != imp->i_hash) X continue; X if (imp->i_dparent != idir) X continue; X if (imp->i_flags & I_DELETE) X continue; X X np = name; X inp = imp->i_name; X while (*inp) { X if (*np++ != *inp++) X goto nextmatch; X } X if (np[0] == '\0') X break; Xnextmatch: X ; X } X return (imp); X} X X/* X * Find a node by full path name X */ XLOCAL imap_t * Xpfind_node(name) X char *name; X{ X register imap_t *imp = iroot; X register char *np = name; X register char *sp; X X if (imp == NULL) X return (imp); X X while (*np) { X if ((sp = strchr(np, '/')) != NULL) X *sp = '\0'; X if ((imp->i_flags & I_DIR) == 0) { X errmsgno(EX_BAD, X "pfind_node(): Not a directory '%s' for '%s' flags %X i_dir %p.\n", X imp->i_name, name, X imp->i_flags, imp->i_dir); X return (NULL); X } X imp = nfind_node(np, imp); X if (sp) X *sp = '/'; X else X break; X np = &sp[1]; X if (imp == NULL) X break; X } X return (imp); X} X X/* X * Add a new full path name and return a node pointer X * Also used by star_sym.c X */ XEXPORT imap_t * Xpadd_node(name, oino, nino, flags) X char *name; X ino_t oino; X ino_t nino; X Int32_t flags; X{ X register imap_t *imp = iroot; X register imap_t *idir; X register char *np = name; X register char *sp; X X if (imp == NULL) { X if ((np[0] == '.' && np[1] == '\0') || X (np[0] == '.' && np[1] == '/' && np[2] == '\0')) { X imp = add_node(NULL, ".", oino, nino, flags); X imp->i_dparent = imp; X iroot = imp; X return (imp); X } X comerrno(EX_BAD, "Panic no root to add '%s'.\n", name); X /* NOTREACHED */ X } X X while (*np) { X if ((sp = strchr(np, '/')) != NULL) X *sp = '\0'; X X if ((imp->i_flags & I_DIR) == 0) { X#ifdef PADD_NODE_DEBUG X errmsgno(EX_BAD, "padd_node(): caller '%s'.\n", padd_node_caller); X#endif X errmsgno(EX_BAD, X "padd_node(): Not a directory '%s' for '%s' flags %X i_dir %p.\n", X imp->i_name, name, X imp->i_flags, imp->i_dir); X return (NULL); X } X idir = imp; X imp = nfind_node(np, idir); X if (imp == NULL) { X if (sp != NULL && strchr(&sp[1], '/') != NULL) X imp = add_node(idir, np, 0, 0, I_DIR); X else X imp = add_node(idir, np, oino, nino, flags); X } X if (sp) X *sp = '/'; X else X break; X np = &sp[1]; X } X if (imp->i_oino == 0 && oino != 0) { X int hv; X X imp->i_oino = oino; X hv = oino % HASH_ENTS; X imp->i_honext = hoimaps[hv]; X hoimaps[hv] = imp; X } X if (imp->i_nino == 0 && nino != 0) { X int hv; X X /* X * This is (most likely) a temporary node. X * We need to set up the flags acording to the right file. X */ X if (imp->i_flags != 0) { X /* X * Not a temporarary node found? X */ X#ifdef PADD_NODE_DEBUG X errmsgno(EX_BAD, "padd_node(): caller '%s'.\n", padd_node_caller); X#endif X errmsgno(EX_BAD, X "padd_node(): Panic: Flags 0x%X on temp node '%s' for '%s'.\n", X imp->i_flags, imp->i_name, name); X } X imp->i_flags = flags; X imp->i_nino = nino; X hv = nino % HASH_ENTS; X imp->i_hnnext = hnimaps[hv]; X hnimaps[hv] = imp; X } X return (imp); X} X X/* X * Find a node by old inode number X */ XLOCAL imap_t * Xoifind_node(idir, oino) X imap_t *idir; X ino_t oino; X{ X register imap_t *imp; X X imp = hoimaps[oino%HASH_ENTS]; X X for (; imp; imp = imp->i_honext) { X X if (imp->i_flags & I_DELETE) X continue; X if (idir && idir != imp->i_dparent) X continue; X X /* X * XXX Dies ist eine halbfertige Directory. X * XXX Hoffentlich brauchen wir diesen Knoten nie. X */ X if (imp->i_nino == 0) X continue; X if (oino == imp->i_oino) X break; X } X return (imp); X} X X/* X * Find a node by new inode number X */ XLOCAL imap_t * Xnifind_node(idir, nino) X imap_t *idir; X ino_t nino; X{ X register imap_t *imp; X X imp = hnimaps[nino%HASH_ENTS]; X X for (; imp; imp = imp->i_hnnext) { X X if (imp->i_flags & I_DELETE) X continue; X if (idir && idir != imp->i_dparent) X continue; X if (nino == imp->i_nino) X break; X } X return (imp); X} X X/* X * Add a new node by path name component and directory node pointer X * return a node pointer X */ XLOCAL imap_t * Xadd_node(cwd, name, oino, nino, flags) X imap_t *cwd; X char *name; X ino_t oino; X ino_t nino; X Int32_t flags; X{ X register imap_t *imp; X register int hv; X X imp = ___malloc(sizeof (imap_t), "new imap"); X imp->i_name = ___savestr(name); X imp->i_hash = hashval((Uchar *)imp->i_name); X imp->i_oino = oino; X imp->i_nino = nino; X imp->i_flags = flags; X imp->i_next = imaps; X imaps = imp; X X imp->i_dir = NULL; X imp->i_dnext = NULL; X imp->i_dxnext = NULL; X imp->i_dparent = cwd; X if (cwd) { X imp->i_dxnext = cwd->i_dir; X cwd->i_dir = imp; X } X X hv = imp->i_hash % HASH_ENTS; X imp->i_hnext = himaps[hv]; X himaps[hv] = imp; X X if (oino) { X hv = oino % HASH_ENTS; X imp->i_honext = hoimaps[hv]; X hoimaps[hv] = imp; X } else { X imp->i_honext = NULL; X } X if (nino) { X hv = nino % HASH_ENTS; X imp->i_hnnext = hnimaps[hv]; X hnimaps[hv] = imp; X } else { X imp->i_hnnext = NULL; X } X#ifdef DEBUG X nimp++; X#endif X X return (imp); X} X X/* X * Add a record for a file. If this is a directory, add entries for the X * directory content. X */ XEXPORT imap_t * Xsym_addrec(info) X FINFO *info; X{ X imap_t *imp; X BOOL isold = TRUE; X X#ifdef XXX_DEBUG X if (grip->dumplevel > 0) { X error("sym_addrec(%s) Type %s\n", X info->f_name, XTTONAME(info->f_rxftype)); X } X#endif X if ((imp = pfind_node(info->f_name)) == NULL) { X isold = FALSE; X#ifdef PADD_NODE_DEBUG X padd_node_caller = "sym_addrec"; X#endif X imp = padd_node(info->f_name, info->f_ino, (ino_t)0, 0); X#ifdef PADD_NODE_DEBUG X if (imp == NULL) X errmsgno(EX_BAD, "padd_node(%s, %lld, 0, 0) = NULL\n", X info->f_name, (Llong)info->f_ino); X#endif X } else { X#ifdef XXX_DEBUG X if (grip->dumplevel > 0) { X error("sym_addrec(%s) found dir: %d TYPECHANGE: %d\n", X info->f_name, X imp->i_flags & I_DIR, X is_dir(info) != ((imp->i_flags & I_DIR) != 0)); X } X#endif X } X if (imp == NULL) { X sym_dump(); X comerrno(EX_BAD, X "Panic: cannot add node '%s' in sym_addrec().\n", X info->f_name); X /* NOTREACHED */ X } X X if (is_dir(info)) { X /* X * If the node for the name of this dir is an old node and X * does not have the DIR flag set, we may not set up the dir X * content as we later will move this node away and create a X * new one for the new dir that is going to be created. X */ X if (isold && (imp->i_flags & I_DIR) == 0) X return (imp); X X imp->i_flags |= I_DIR; X } X X if (is_dir(info)) { X imap_t *idir; X char *dp; X ino_t *ip; X int len; X int i; X X idir = imp; X dp = info->f_dir; X ip = info->f_dirinos; X if (dp == NULL || ip == NULL) X return (idir); X X i = 0; X while (*dp) { X dp++; X len = strlen(dp); X X if ((imp = nfind_node(dp, idir)) == NULL) { X imp = add_node(idir, dp, (ino_t)0, (ino_t)0, 0); X } X if (imp->i_oino == (ino_t)0) { X int hv; X X imp->i_oino = ip[i]; X hv = imp->i_oino % HASH_ENTS; X imp->i_honext = hoimaps[hv]; X hoimaps[hv] = imp; X } X i++; X dp += len+1; X } X return (idir); X } X return (imp); X} X X/* X * Add status information for a node. X */ XEXPORT void Xsym_addstat(info, imp) X FINFO *info; X imap_t *imp; X{ X FINFO finfo; X BOOL isold = TRUE; X int hv; X X if (imp == NULL && (imp = pfind_node(info->f_name)) == NULL) { X isold = FALSE; X#ifdef PADD_NODE_DEBUG X padd_node_caller = "sym_addstat"; X#endif X imp = padd_node(info->f_name, info->f_ino, (ino_t)0, 0); X#ifdef PADD_NODE_DEBUG X if (imp == NULL) X errmsgno(EX_BAD, "padd_node(%s, %lld, 0, 0) = NULL\n", X info->f_name, (Llong)info->f_ino); X#endif X } X if (imp == NULL) { X sym_dump(); X comerrno(EX_BAD, X "Panic: cannot add node '%s' in sym_addstat().\n", X info->f_name); X /* NOTREACHED */ X } X if (imp->i_oino == 0) { X if (imp != iroot) { X errmsgno(EX_BAD, X "WARNING: late old inode add for '%s'\n", info->f_name); X } X imp->i_oino = info->f_ino; X hv = imp->i_oino % HASH_ENTS; X imp->i_honext = hoimaps[hv]; X hoimaps[hv] = imp; X } X X fillbytes((char *)&finfo, sizeof (finfo), '\0'); X _getinfo(info->f_name, &finfo); X if (imp->i_nino != 0 && imp->i_nino != finfo.f_ino) { X errmsgno(EX_BAD, "sym_addstat(): %s nino change from %lld to %lld flags %X\n", X info->f_name, X (Llong)imp->i_nino, (Llong)finfo.f_ino, X imp->i_flags); X } X X /* X * An nino change implies a hash change. We need to remove the node X * from the old hash list and put it into the new list. X */ X if (imp->i_nino != finfo.f_ino) { X BOOL newhash = FALSE; X X if ((imp->i_nino != 0) && X ((imp->i_nino % HASH_ENTS) != (finfo.f_ino % HASH_ENTS))) { X imap_t *tnp; X X tnp = hnimaps[imp->i_nino % HASH_ENTS]; X for (; tnp; tnp = tnp->i_hnnext) { X if (imp == tnp->i_hnnext) { X tnp->i_hnnext = imp->i_hnnext; X break; X } X } X newhash = TRUE; X } X X if (imp->i_nino == 0 || newhash) { X hv = finfo.f_ino % HASH_ENTS; X imp->i_hnnext = hnimaps[hv]; X hnimaps[hv] = imp; X } X imp->i_nino = finfo.f_ino; X } X X if (is_dir(info)) { X int len = strlen(imp->i_name); X X if (imp->i_name[len-1] == '/') X imp->i_name[len-1] = '\0'; X imp->i_flags |= I_DIR; X } X} X X/* X * Prepare the directory for the following extraction. X * This is done by first removing all files that are no longer present on the X * current incremental and then trying to move/link missing files that are X * a result of a rename or link operation. X */ XEXPORT imap_t * Xsym_dirprepare(info, idir) X FINFO *info; X imap_t *idir; X{ X int dlen; X ino_t *oino; X char **dname; X char *p; X int i; X int j; X FINFO finfo; X char *dp2; X int ents2; X char **dname2; X ino_t *ino2; X ino_t *oino2; X char *slashp = NULL; X DIR *dirp; X X if (info->f_dir == NULL) { X /* X * Most likely a mount point X */ X if (info->f_dev == curfs) { X lunlinkat(sym_lock, 0); X comerrno(EX_BAD, "Archive contains directory '%s' without name list\n", info->f_name); X /* NOTREACHED */ X } X return (idir); X } X X#ifdef DIRP_DEBUG X if (!_getinfo(info->f_name, &finfo) && geterrno() != ENOENT) X errmsg("DEBUG1: stat for '%s' failed.\n", X info->f_name); X#endif X /* X * Try to work around a moving POSIX target. X * POSIX.1-1988 requires that stat("/etc/passwd/", ) works. X * While POSIX.1-2001 requires to return ENOTDIR. X */ X info->f_namelen = strlen(info->f_name); X if (info->f_name[info->f_namelen-1] == '/') { X slashp = &info->f_name[info->f_namelen-1]; X *slashp = '\0'; X } X /* X * Check if the node on disk is really a directory. X * As we did already check the directory content of the higher direcory X * it should never happen that the on disk node is not a directory. X */ X fillbytes((char *)&finfo, sizeof (finfo), '\0'); X seterrno(0); X (void) _getinfo(info->f_name, &finfo); X X if (!is_dir(&finfo)) { /* Also catches the ENOENT case */ X /* X * There is either no file on disk, we cannot stat() it, or X * the file on the disk has the same name and inode number X * as the directory in the archive. X * XXX Should we rather use move2tmp()? X */ X imap_t *imp; X X imp = idir; X if (geterrno() != ENOENT) { X if (lunlinkat(info->f_name, 0) < 0) X comerr("Cannot unlink '%s'.\n", info->f_name); X } X#ifdef MKD_DEBUG X { extern char *mkdwhy; mkdwhy = "restore"; } X#endif X if (!make_adir(info)) { X if (slashp) X *slashp = '/'; X return (imp); X } X if ((imp->i_flags & I_DIR) == 0) { X purgeent(imp); X imp = sym_addrec(info); X } X if (!_getinfo(info->f_name, &finfo)) { X if (slashp) X *slashp = '/'; X return (imp); X } X sym_addstat(&finfo, imp); X idir = imp; X } X if (slashp) X *slashp = '/'; X X if ((dname = ___malloc(info->f_dirents * sizeof (char *), "sym_dirprepare name")) == NULL) { X return (idir); X } X /* X * Put directory names from archive into array. X */ X p = info->f_dir; X oino = info->f_dirinos; X dlen = info->f_dirents; X for (i = 0; i < dlen; i++) { X dname[i] = &p[1]; X p += strlen(&p[1]) + 2; X } X X#ifdef RES_DEBUG X for (i = 0; i < dlen; i++) { X error("INO %lld NAME %s\n", X (Llong)info->f_dirinos[i], X dname[i]); X } X#endif X X ents2 = 0; X dirp = lopendir(info->f_name); X if (dirp == NULL) { X return (idir); X } else { X dp2 = dfetchdir(dirp, info->f_name, &ents2, 0, &ino2); X closedir(dirp); X } X if ((oino2 = ___malloc(ents2 * sizeof (ino_t), "sym_dirprepare oino2")) == NULL) { X return (idir); X } X if ((dname2 = ___malloc(ents2 * sizeof (char *), "sym_dirprepare name2")) == NULL) { X return (idir); X } X /* X * Put directory names from disk into array. X */ X p = dp2; X for (i = 0; i < ents2; i++) { X dname2[i] = &p[1]; X p += strlen(&p[1]) + 2; X } X for (i = 0; i < ents2; i++) { X imap_t *imp; X imp = nifind_node((imap_t *)0, ino2[i]); X if (imp == NULL) { X if (ino2[i] != lock_ino) { X errmsgno(EX_BAD, X "Panic: No symbol entry for inode %lld (%s).\n", X (Llong)ino2[i], dname2[i]); X } X oino2[i] = 0; X continue; X } X if (imp->i_oino == (ino_t)0) { X if (imp != itmp && imp != isym) { X errmsgno(EX_BAD, X "Panic: No old inode for inode %lld (%s).\n", X (Llong)ino2[i], dname2[i]); X } X } X oino2[i] = imp->i_oino; X } X X if (xdebug) X error("sym_dirprepare(%s)\n", info->f_name); X /* X * Check for all files that are in the current on disk directory X * but no longer exist on the current incremental with the same X * name and inode number as before. X */ X for (i = 0; i < ents2; i++) { X ino_t in; X if (oino2[i] == 0) X continue; X in = oino2[i]; X X if (xdebug) X error("Checking ino %lld (%s)...", (Llong)oino2[i], dname2[i]); X for (j = 0; j < dlen; j++) { X if (xdebug > 1) X error("in %lld oino %lld\n", (Llong)in, (Llong)oino[j]); X if (in == oino[j] && streql(dname2[i], dname[j])) X break; X } X if (j >= dlen) { X if (xdebug) X error("RM\n"); X /* dir name, file name, old inode#, new inode # */ X move2tmp(info->f_name, dname2[i], in, ino2[i]); X } else { X if (xdebug) X error("found\n"); X } X } X X if (xdebug) X error("sym_dirprepare(%s) <<<<\n", info->f_name); X /* X * Check for all files that are on the current incremental but X * are not in the current on disk directory with the same X * and inode number. X */ X for (i = 0; i < dlen; i++) { X ino_t in; X in = oino[i]; X X if (xdebug) X error("Checking ino %lld (%s)...", (Llong)oino[i], dname[i]); X for (j = 0; j < ents2; j++) { X if (in == oino2[j] && streql(dname2[j], dname[i])) X break; X } X if (j >= ents2) { X if (xdebug) X error("LINK\n"); X /* dir name, file name, old inode# */ X move2dir(info->f_name, dname[i], in); X } else { X if (xdebug) X error("found\n"); X } X } X X if (dname != NULL) X free(dname); X if (oino2 != NULL) X free(oino2); X if (dname2 != NULL) X free(dname2); X if (dp2 != NULL) X free(dp2); X if (ino2 != NULL) X free(ino2); X return (idir); X} X X/* X * Move a file to the temp directory. This file has been identified X * to be no longer in the current directory pointed to by 'dir'. X */ XLOCAL void Xmove2tmp(dir, name, oino, nino) X char *dir; X char *name; X ino_t oino; X ino_t nino; X{ X char path[2*PATH_MAX+1]; X char tpath[2*PATH_MAX+1]; /* "star-tmpdir/#%lld" */ X char *pathp = path; X size_t pathlen = sizeof (path); X size_t plen; X imap_t *onp; X imap_t *nnp; X X plen = strlen(dir) + strlen(name) + 2; /* "%s/%s" + Nul */ X if (plen > pathlen) { X pathp = ___malloc(plen, "name buffer"); X pathlen = plen; X } X js_snprintf(pathp, pathlen, "%s/%s", dir, name); X X onp = pfind_node(pathp); X if (onp == NULL) { X sym_dump(); X comerrno(EX_BAD, X "Panic: amnesia in inode data base for '%s'.\n", X pathp); X /* NOTREACHED */ X } X nnp = nifind_node(itmp, nino); X if (nnp) { /* inode is already in star-tmpdir */ X if (xdebug) X error("unlink(%s)\n", pathp); X if (lunlinkat(pathp, 0) < 0) X comerr("Cannot unlink '%s'.\n", pathp); X purgeent(onp); X goto out; X } X X js_snprintf(tpath, sizeof (tpath), "%s/#%lld", sym_tmpdir, (Llong)nino); X if (xdebug) X error("rename(%s, %s)\n", pathp, tpath); X if (lrename(pathp, tpath) < 0) X comerr("Cannot rename '%s' to '%s'.\n", pathp, tpath); X X#ifdef PADD_NODE_DEBUG X padd_node_caller = "move2tmp"; X#endif X nnp = padd_node(tpath, onp->i_oino, onp->i_nino, onp->i_flags); X#ifdef PADD_NODE_DEBUG X if (nnp == NULL) X errmsgno(EX_BAD, "padd_node(%s, %lld, %lld, %X) = NULL\n", X tpath, (Llong)onp->i_oino, X (Llong)onp->i_nino, onp->i_flags); X#endif X if (xdebug) X error("move2tmp() itmp %p onp %p nnp %p\n", itmp, onp, nnp); X X purgeent(onp); X nnp->i_dir = onp->i_dir; X for (onp = nnp->i_dir; onp; onp = onp->i_dxnext) { X onp->i_dparent = nnp; X } Xout: X if (pathp != path) X free(pathp); X} X X/* X * Try to move a file from the temp directory to the current directory X * pointed to by 'dir'. X */ XLOCAL void Xmove2dir(dir, name, oino) X char *dir; X char *name; X ino_t oino; X{ X char path[2*PATH_MAX+1]; X char *pathp = path; X size_t pathlen = sizeof (path); X char tpath[2*PATH_MAX+1]; X char *tpathp = tpath; X size_t tpathlen = sizeof (tpath); X imap_t *onp; X imap_t *nnp; X char *p; X size_t plen; X X plen = strlen(dir) + strlen(name) + 2; X if (plen > pathlen) { X pathp = ___malloc(plen, "name buffer"); X pathlen = plen; X } X js_snprintf(pathp, pathlen, "%s/%s", dir, name); X onp = oifind_node(itmp, oino); X X#ifdef RES_DEBUG X if (onp) X error("move2dir(%s, %s, %lld) = %s\n", X dir, name, (Llong)oino, onp->i_name); X else X error("move2dir(%s, %s, %lld) = NOT FOUND\n", X dir, name, (Llong)oino); X#endif X X if (onp) { X /* X * Since our static buffer is 2*PATH_MAX, we cannot get more X * here because "star-tmpdir" + one path name component cannot X * result in more than 2*256 chars and PATH_MAX is at least 256. X */ X js_snprintf(tpath, sizeof (tpath), "%s/%s", X sym_tmpdir, onp->i_name); X if (xdebug) X error("rename(%s, %s)\n", tpath, pathp); X if (lrename(tpath, pathp) < 0) { X errmsg("Cannot rename '%s' to '%s'.\n", tpath, pathp); X /* XXX set error code */ X goto out; X } X#ifdef PADD_NODE_DEBUG X padd_node_caller = "move2dir"; X#endif X nnp = padd_node(pathp, onp->i_oino, onp->i_nino, onp->i_flags); X#ifdef PADD_NODE_DEBUG X if (nnp == NULL) X errmsgno(EX_BAD, "padd_node(%s, %lld, %lld, %X) = NULL\n", X pathp, (Llong)onp->i_oino, X (Llong)onp->i_nino, onp->i_flags); X#endif X if (xdebug) { X error("move2dir() itmp %p onp %p nnp %p\n", X itmp, onp, nnp); X } X purgeent(onp); X nnp->i_dir = onp->i_dir; X for (onp = nnp->i_dir; onp; onp = onp->i_dxnext) { X onp->i_dparent = nnp; X } X goto out; X } X X /* X * XXX Wenn nicht in star-tmpdir, dann X * X * - hard link zu File versuchen X * X * - rename einer Directory versuchen und Flag setzen X * X * - Ist Flag gesetzt, dann Hard Link auf Dir setzen. X */ X if (xdebug) X error("Cannot rename '%s' from '%s'.\n", pathp, sym_tmpdir); X X onp = oifind_node((imap_t *)0, oino); X if (onp == NULL) { X if (xdebug) X error("Cannot link/move any file to '%s'.\n", X pathp); X goto out; X } X plen = fullnlen(onp, TRUE); X if (plen == 0) { X /* XXX error code */ X errmsgno(EX_BAD, "Path name '"); X printfullname(stderr, onp); X error("' cannot rename\n"); X goto out; X } X if (plen > tpathlen) { X tpathp = ___malloc(plen, "name buffer"); X tpathlen = plen; X } X p = fullname(onp, tpathp, &tpathp[tpathlen], TRUE); X if (p == NULL) { X /* XXX error code */ X errmsgno(EX_BAD, "Path name '"); X printfullname(stderr, onp); X error("' too long, cannot rename\n"); X goto out; X } X if (xdebug) X error("move2dir(%s, %s, %lld) found path => '%s'\n", X dir, name, (Llong)oino, tpathp); X X if ((onp->i_flags & (I_DIR|I_DID_RENAME)) == I_DIR) { X if (xdebug) X error("rename(%s, %s)\n", tpathp, pathp); X if (lrename(tpathp, pathp) < 0) { X /* XXX error code */ X errmsg("Cannot rename(%s, %s)\n", tpathp, pathp); X } else { X#ifdef PADD_NODE_DEBUG X padd_node_caller = "move2dir 2"; X#endif X nnp = padd_node(pathp, onp->i_oino, onp->i_nino, onp->i_flags); X#ifdef PADD_NODE_DEBUG X if (nnp == NULL) X errmsgno(EX_BAD, "padd_node(%s, %lld, %lld, %X) = NULL\n", X pathp, (Llong)onp->i_oino, X (Llong)onp->i_nino, onp->i_flags); X#endif X purgeent(onp); X nnp->i_flags |= I_DID_RENAME; X if ((onp->i_flags & I_DIR) == 0) X comerrno(EX_BAD, "Panic: Not a dir '%s'.\n", pathp); X nnp->i_dir = onp->i_dir; X for (onp = nnp->i_dir; onp; onp = onp->i_dxnext) { X onp->i_dparent = nnp; X } X } X goto out; X } X if (xdebug) X error("link(%s, %s)\n", tpathp, pathp); X#ifdef HAVE_LINK X if (llink(tpathp, pathp) < 0) { X#else X if (1) { X#ifdef ENOSYS X seterrno(ENOSYS); X#else X seterrno(EINVAL); X#endif X#endif X /* XXX error code */ X errmsg("Cannot link(%s, %s)\n", tpathp, pathp); X } else { X#ifdef PADD_NODE_DEBUG X padd_node_caller = "move2dir 3"; X#endif X nnp = padd_node(pathp, onp->i_oino, onp->i_nino, onp->i_flags); X#ifdef PADD_NODE_DEBUG X if (nnp == NULL) X errmsgno(EX_BAD, "padd_node(%s, %lld, %lld, %X) = NULL\n", X pathp, (Llong)onp->i_oino, X (Llong)onp->i_nino, onp->i_flags); X#endif X#ifdef nonono X /* X * XXX It is not clear how to handle new hard links X * XXX to directories correctly. X */ X nnp->i_dir = onp->i_dir; X for (onp = nnp->i_dir; onp; onp = onp->i_dxnext) { X onp->i_dparent = nnp; X } X#endif X } Xout: X if (pathp != path) X free(pathp); X if (tpathp != tpath) X free(tpathp); X} X X/* X * Check whether the target file exists and has a X * different type or is a dev node with different X * major/minor numbers. In this case, we need to X * remove the file. This happend when the original X * file has been removed and a new (different) file X * with the same name did get the same inode number. X */ XEXPORT imap_t * Xsym_typecheck(info, cinfo, imp) X FINFO *info; X FINFO *cinfo; X imap_t *imp; X{ X char *slashp = NULL; Xextern BOOL uncond; Xextern BOOL nowarn; X BOOL ouncond = uncond; X BOOL onowarn = nowarn; X X#ifdef RES2_DEBUG X error("sym_typecheck(%s) NEW type: %s\n", X info->f_name, X XTTONAME(info->f_rxftype)); X#endif X#ifdef RES2_DEBUG X seterrno(0); X#endif X /* X * Try to work around a moving POSIX target. X * POSIX.1-1988 requires that stat("/etc/passwd/", ) works. X * While POSIX.1-2001 requires to return ENOTDIR. X */ X info->f_namelen = strlen(info->f_name); X if (info->f_name[info->f_namelen-1] == '/') { X slashp = &info->f_name[info->f_namelen-1]; X *slashp = '\0'; X } X fillbytes((char *)cinfo, sizeof (*cinfo), '\0'); X if (!_getinfo(info->f_name, cinfo)) { X cinfo->f_rxftype = XT_NONE; X#ifdef RES2_DEBUG X errmsg("sym_typecheck(%s) ---> OLD FILE NOT found\n", X info->f_name); X#endif X if (slashp) X *slashp = '/'; X return (imp); X } X X#ifdef RES2_DEBUG X error("sym_typecheck(%s) OLD FILE found, type: %s\n", X info->f_name, X XTTONAME(cinfo->f_rxftype)); X#endif X X if (info->f_filetype == cinfo->f_filetype && X !is_special(cinfo) && !is_symlink(cinfo)) { X if (slashp) X *slashp = '/'; X if (!(cinfo->f_mode & TUWRITE)) { X#ifdef RES2_DEBUG X error("sym_typecheck(%s) OLD FILE mode: %o\n", X info->f_name, cinfo->f_mode); X#endif X /* X * Need to give write permissions to allow to run X * "star -restore" as non-root user. X * X * info->f_mode | TUWRITE may be closer to the X * final modes than cinfo->f_mode | TUWRITE. X */ X if (lchmodat(info->f_name, X osmode(info->f_mode | TUWRITE), X 0 /* chmod */) < 0) { X errmsg("Cannot chmod +w '%s'\n", X info->f_name); X } X } X return (imp); X } X X uncond = FALSE; X nowarn = TRUE; X if (is_symlink(cinfo) && same_symlink(cinfo)) X cinfo->f_flags |= F_SAME; X if (is_special(cinfo) && same_special(cinfo)) X cinfo->f_flags |= F_SAME; X uncond = ouncond; X onowarn = nowarn; X X if ((is_symlink(cinfo) || is_special(cinfo)) && X (cinfo->f_flags & F_SAME) == 0) { X#ifdef RES2_DEBUG X error("sym_typecheck(%s) REMOVE OLD\n", X info->f_name); X#endif X removefile(info->f_name); X purgeent(imp); X if (slashp) X *slashp = '/'; X return (NULL); X } X X if (info->f_type == cinfo->f_type) { X if (slashp) X *slashp = '/'; X return (imp); X } X X if (imp == NULL) { X if (slashp) X *slashp = '/'; X return (imp); X } X X if (is_dir(cinfo)) { X imap_t *cmp; X X#ifdef RES2_DEBUG X error("sym_typecheck(%s) MOVE DIRCONT\n", X info->f_name); X#endif X for (cmp = imp->i_dir; cmp; cmp = cmp->i_dxnext) { X if (cmp->i_flags & I_DELETE) X continue; X X move2tmp(info->f_name, cmp->i_name, cmp->i_oino, cmp->i_nino); X } X } X X#ifdef RES2_DEBUG X error("sym_typecheck(%s) REMOVE OLD\n", X info->f_name); X#endif X removefile(info->f_name); X purgeent(imp); X if (slashp) X *slashp = '/'; X return (NULL); X} X XLOCAL BOOL Xremovefile(name) X char *name; X{ X extern BOOL force_remove; X BOOL of = force_remove; X BOOL ret; X X if (xdebug) X error("REMOVE %s\n", name); X X force_remove = TRUE; X ret = remove_file(name, TRUE); X force_remove = of; X return (ret); X} X XLOCAL BOOL Xremovetree(name) X char *name; X{ X extern BOOL force_remove; X extern BOOL remove_recursive; X BOOL of = force_remove; X BOOL or = remove_recursive; X BOOL ret; X X if (xdebug) X error("REMOVE tree %s\n", name); X X force_remove = TRUE; X remove_recursive = TRUE; X ret = remove_file(name, TRUE); X force_remove = of; X remove_recursive = or; X return (ret); X} X X/* X * Needed separately by star_sym X */ XEXPORT void Xsym_initmaps() X{ X if (himaps == NULL) { X register int hv; X X himaps = ___malloc(HASH_ENTS * sizeof (imap_t *), "imap hash"); X hoimaps = ___malloc(HASH_ENTS * sizeof (imap_t *), "oimap hash"); X hnimaps = ___malloc(HASH_ENTS * sizeof (imap_t *), "nimap hash"); X for (hv = 0; hv < HASH_ENTS; hv++) { X himaps[hv] = 0; X hoimaps[hv] = 0; X hnimaps[hv] = 0; X } X } X} X X/* X * Read in the old inode symbol table X */ XEXPORT void Xsym_open(name) X char *name; X{ X char *buf; X size_t buflen = PATH_MAX; X FILE *f; X int amt; X char *p; X Llong ll; X ino_t oino; X ino_t nino; X mode_t old_umask; Xstatic char td[] = "star-tmpdir/."; X imap_t *ilast = NULL; X imap_t *icwd = NULL; X FINFO finfo; X X#define PERM_BITS (S_IRWXU|S_IRWXG|S_IRWXO) /* u/g/o basic perm */ X X if (name) X f = lfilemopen(name, "r", S_IRUSR|S_IWUSR); X else X f = lfilemopen(sym_symtable, "r", S_IRUSR|S_IWUSR); X X fillbytes((char *)&finfo, sizeof (finfo), '\0'); X if (_getinfo(sym_symtable, &finfo) && !is_file(&finfo)) { X errmsgno(EX_BAD, "'%s' is not a file.\n", sym_symtable); X comerrno(EX_BAD, "Remove '%s' and try again.\n", sym_symtable); X } X sym_initmaps(); X X old_umask = umask((mode_t)0); X umask(PERM_BITS & ~S_IRWXU); X if (!create_dirs(td)) { X /* X * This also fails if star-tmpdir is not a directory. X */ X comerrno(EX_BAD, "Cannot create '%s'.\n", sym_tmpdir); X } X umask(old_umask); X X if (f == NULL) X return; X X buf = ___malloc(buflen, "line buffer"); X (void) xgetline(f, &buf, &buflen, sym_symtable); X if (!streql(buf, vers)) { X errmsgno(EX_BAD, "Restore version mismatch '%s' '%s'.\n", X buf, vers); X if (is_star) { X comerrno(EX_BAD, X "All restores need to be done with the same star version.\n"); X } X } X overs = ___savestr(buf); /* Restore SCHILY.release */ X X readheader(f); X X while ((amt = getdelim(&buf, &buflen, '\0', f)) > 0) { X Int32_t flags; X X checknl(f); X X if (buf[0] == '>' && buf[1] == '\0') { X if (iroot == NULL) { X iroot = icwd = ilast; X icwd->i_dparent = icwd; X if (icwd->i_name[0] != '.' || icwd->i_name[1] != '\0') X comerrno(EX_BAD, "Bad root dir '%s' in '%s'.\n", X icwd->i_name, X sym_symtable); X } else { X icwd->i_dnext = ilast; X if (ilast->i_dparent != icwd) X comerrno(EX_BAD, "Bad parent dir.\n"); X ilast->i_dparent = icwd; X icwd = ilast; X } X continue; X } X if (buf[0] == '<' && buf[1] == '\0') { X icwd = icwd->i_dparent; X icwd->i_dnext = NULL; X continue; X } X X p = buf; X flags = 0; X if (*p == 'D') X flags |= I_DIR; X X p++; /* Skip Flag */ X p = astollb(p, &ll, 10); X if (*p != '\t') { X comerrno(EX_BAD, X "Missing TAB after old ino in '%s'.\n", X sym_symtable); X } X oino = ll; X p = astollb(p, &ll, 10); X if (*p != '\t') { X comerrno(EX_BAD, X "Missing TAB after NEW ino '%s'.\n", X sym_symtable); X } X nino = ll; X ilast = add_node(icwd, ++p, oino, nino, flags); X#ifdef __needed__ X if (0) { X imap_t *ip = iroot; X X for (; ip; ip = ip->i_dnext) { X printf("%s/", ip->i_name); X if (ip == icwd) X break; X } X printf("%s\n", p); X } X#endif X } X fclose(f); X free(buf); X X#ifdef OLDSYM_DEBUG X printsyms(stderr, iroot); X printLsyms(stderr, iroot); X#endif X} X XLOCAL int Xxgetline(f, bufp, lenp, name) X FILE *f; X char **bufp; X size_t *lenp; X char *name; X{ X int amt; X X clearerr(f); X if ((amt = getdelim(bufp, lenp, '\0', f)) < 0) { X if (feof(f)) { X amt = 0; X } else { X comerr("Cannot read '%s'.\n", name); X } X } X if (amt == 0) X comerrno(EX_BAD, "File '%s' too short.\n", name); X checknl(f); X return (amt); X} X XLOCAL void Xchecknl(f) X FILE *f; X{ X if (getc(f) != '\n') { X comerrno(EX_BAD, X "Missing newline at end of record in '%s'.\n", X sym_symtable); X } X} X X/* X * Make sure "star-tmpdir" exists and is part of the inode symbol cache. X * Make sure that "star-symtable" is part of the inode symbol cache if X * it exists. X */ XLOCAL void Xsym_initsym() X{ X char tpath[2*PATH_MAX+1]; X FINFO finfo; X imap_t *imp; X char *dp; X int ents; X DIR *dirp; X X fillbytes((char *)&finfo, sizeof (finfo), '\0'); X if (!_getinfo(sym_tmpdir, &finfo)) { X lunlinkat(sym_lock, 0); X comerr("Cannot stat '%s'\n", sym_tmpdir); X } X X if (iroot == NULL) { X#ifdef PADD_NODE_DEBUG X padd_node_caller = "sym_initsym"; X#endif X imp = padd_node(".", (ino_t)0, (ino_t)0, I_DIR); X } X if ((imp = pfind_node(sym_tmpdir)) == NULL) { X#ifdef PADD_NODE_DEBUG X padd_node_caller = "sym_initsym 2"; X#endif X imp = padd_node(sym_tmpdir, (ino_t)0, finfo.f_ino, I_DIR); X } X if (imp->i_nino != finfo.f_ino) X errmsgno(EX_BAD, "sym_initsym(): %s nino change from %lld to %lld flags %X\n", X sym_tmpdir, X (Llong)imp->i_nino, (Llong)finfo.f_ino, X imp->i_flags); X X imp->i_nino = finfo.f_ino; X itmp = imp; X X for (imp = imp->i_dir; imp; imp = imp->i_dxnext) { X if (imp->i_flags & I_DELETE) X continue; X X js_snprintf(tpath, sizeof (tpath), "%s/%s", X sym_tmpdir, imp->i_name); X if (!_getinfo(tpath, &finfo)) X purgetree(imp); X else X tmpnotempty(); X } X ents = 0; X dirp = lopendir(sym_tmpdir); X if (dirp) { X dp = dfetchdir(dirp, sym_tmpdir, &ents, 0, (ino_t **)0); X closedir(dirp); X } else { X dp = NULL; X } X if (dp) X free(dp); X if (ents > 0) X tmpnotempty(); X X fillbytes((char *)&finfo, sizeof (finfo), '\0'); X if (_getinfo(sym_symtable, &finfo)) { X if ((imp = pfind_node(sym_symtable)) == NULL) { X#ifdef PADD_NODE_DEBUG X padd_node_caller = "sym_initsym 3"; X#endif X imp = padd_node(sym_symtable, (ino_t)0, finfo.f_ino, 0); X } X isym = imp; X } X} X XLOCAL void Xtmpnotempty() X{ X errmsgno(EX_BAD, "The directory '%s' is not empty.\n", sym_tmpdir); X comerrno(EX_BAD, "Remove all files in '%s' and try again.\n", sym_tmpdir); X} X XLOCAL void Xpurgeent(imp) X imap_t *imp; X{ X if (imp == NULL) X return; X imp->i_flags |= I_DELETE; X free(imp->i_name); X imp->i_name = NULL; X} X XLOCAL void Xpurgetree(imp) X imap_t *imp; X{ X if (imp == NULL) X return; X X for (; imp; imp = imp->i_dxnext) { X X if (imp->i_flags & I_DELETE) X continue; X X purgetree(imp->i_dir); X purgeent(imp); X } X} X X/* X * Do some checks and initialisations before the symbols are going to be used X */ XEXPORT void Xsym_init(gp) X GINFO *gp; X{ X FILE *f; X FINFO finfo; X#ifdef VERS_DEBUG X extern char *vers; X X error("Star version '%s'\n", vers); X error("imaps: %p level %d\n", imaps, gp->dumplevel); X#endif X X f = lfilemopen(sym_lock, "wce", S_IRUSR|S_IWUSR); X if (f == NULL) { X comerr("Cannot create '%s', restore is already running.\n", X sym_lock); X /* NOTREACHED */ X } X fclose(f); X fillbytes((char *)&finfo, sizeof (finfo), '\0'); X _getinfo(sym_lock, &finfo); X lock_ino = finfo.f_ino; X X if (ogp == NULL) /* If star-symtable not read */ X odtype = gp->dumptype; /* Use this dump type */ X X /* X * XXX imaps -> iroot ??? X */ X if (gp->dumplevel == 0 && imaps != NULL) { X errmsgno(EX_BAD, "Trying to extract a level 0 dump but '%s' exists.\n", sym_symtable); X lunlinkat(sym_lock, 0); X comerrno(EX_BAD, "Remove '%s' and try again.\n", sym_symtable); X } X if (gp->dumplevel > 0 && imaps == NULL) { X errmsgno(EX_BAD, "Trying to extract a level %d dump but '%s' does not exist.\n", X gp->dumplevel, sym_symtable); X lunlinkat(sym_lock, 0); X comerrno(EX_BAD, "Restore the level 0 dump first and try again.\n"); X } X if (gp->dumptype != DT_FULL || odtype != DT_FULL) { X if (gp->dumptype != DT_FULL) { X errmsgno(EX_BAD, X "WARNING: This dump is a '%s' dump and not a 'full' dump.\n", X dt_name(gp->dumptype)); X } else { X errmsgno(EX_BAD, X "WARNING: Restore status is '%s' and not from a 'full' dump.\n", X dt_name(odtype)); X } X errmsgno(EX_BAD, "WARNING: An incremental restore may not work correctly.\n"); X if (!dopartial && !forcerestore) { X usepartial(); X /* NOTREACHED */ X } X if (gp->dumptype < odtype) X odtype = gp->dumptype; X } X X checkheader(); /* Check Dump level & Dump date */ X sym_initsym(); X} X X/* X * Write back the inode symbol table X */ XEXPORT void Xsym_close() X{ X char tpath[2*PATH_MAX+1]; X FINFO finfo; X FILE *f; X imap_t *imp; X BOOL warned = FALSE; X BOOL tmpremove = TRUE; X BOOL ok = TRUE; X int err; X#ifdef HAVE_FSYNC X int cnt; X#endif X X if (!restore_valid) { X errmsgno(EX_BAD, X "Invalid or empty dump, will not overwrite '%s'\n", X sym_symtable); X return; X } X if (_getinfo(sym_symtable, &finfo) && X lrename(sym_symtable, sym_oldsymtable) < 0) { X errmsg("Cannot rename %s to %s.\n", X sym_symtable, sym_oldsymtable); X } X f = lfilemopen(sym_symtable, "wct", S_IRUSR|S_IWUSR); X if (f == NULL) { X errmsg("Cannot create '%s'.\n", sym_symtable); X return; X } X fillbytes((char *)&finfo, sizeof (finfo), '\0'); X if (!_getinfo(sym_symtable, &finfo)) X comerr("Cannot stat '%s'\n", sym_symtable); X if ((imp = pfind_node(sym_symtable)) == NULL) { X X#ifdef PADD_NODE_DEBUG X padd_node_caller = "sym_close"; X#endif X imp = padd_node(sym_symtable, (ino_t)0, finfo.f_ino, 0); X } X imp->i_nino = finfo.f_ino; X X if (isym == NULL) X isym = imp; X X if (getenv("STAR_DEBUG")) X tmpremove = FALSE; X else if (itmp != NULL) X error("Removing all in '%s'.\n", sym_tmpdir); X if (itmp != NULL) X for (imp = itmp->i_dir; imp; imp = imp->i_dxnext) { X if (imp->i_flags & I_DELETE) X continue; X X js_snprintf(tpath, sizeof (tpath), "%s/%s", X sym_tmpdir, imp->i_name); X fillbytes((char *)&finfo, sizeof (finfo), '\0'); X if (_getinfo(tpath, &finfo)) { X if (is_dir(&finfo)) { X /* rmdir */ X if (lunlinkat(tpath, AT_REMOVEDIR) >= 0) { X purgeent(imp); X } else if (tmpremove) { X /* X * This is a shortcut. We do not walk X * through the imap tree but rather X * remove anything we find via readdir. X */ X if (removetree(tpath)) X purgeent(imp); X } X } else { X if (tmpremove || finfo.f_nlink > 1) { X if (lunlinkat(tpath, 0) >= 0) X purgeent(imp); X } X } X if ((imp->i_flags & I_DELETE) == 0 && !warned) { X if (tmpremove) { X errmsgno(EX_BAD, X "A problem occured, not all files in '%s' could be removed.\n", X sym_tmpdir); X } X errmsgno(EX_BAD, X "Don't forget to remove the files in '%s'.\n", X sym_tmpdir); X warned = TRUE; X } X } X } X X writeheader(f); X printsyms(f, iroot); X X if (fflush(f) != 0) X ok = FALSE; X#ifdef HAVE_FSYNC X err = 0; X cnt = 0; X do { X if (fsync(fdown(f)) != 0) X err = geterrno(); X X if (err == EINVAL) X err = 0; X } while (err == EINTR && ++cnt < 10); X if (err != 0) X ok = FALSE; X#endif X if (fclose(f) != 0) X ok = FALSE; X if (ok) { X lunlinkat(sym_oldsymtable, 0); X } else { X xstats.s_restore++; X if (lrename(sym_oldsymtable, sym_symtable) < 0) X errmsg("Cannot rename %s to %s.\n", X sym_oldsymtable, sym_symtable); X } X X lunlinkat(sym_lock, 0); X} X XLOCAL void Xsym_dump() X{ X FILE *f; X X f = lfilemopen(sym_symdump, "wct", S_IRUSR|S_IWUSR); X if (f == NULL) { X errmsg("Panic: cannot open '%s'\n", sym_symdump); X return; X } X writeheader(f); X printsyms(f, iroot); X fclose(f); X} X X/* X * star 1.5 (i386-pc-solaris2.9) last star X * partial last Dump X * star 1.5 (i386-pc-solaris2.9) last Dump star X * exustar last Dump archive type X * hugo last Dump host name X * /tmp last Dump filesys X * partial last Dump dumptype X * 1 last Dump dumplevel X * 0 last Dump reflevel X * 1097092599.544044 last Dump dumpdate X * 1096935113.887915 last Dump refdate X */ XLOCAL void Xwriteheader(f) X FILE *f; X{ X fprintf(f, "%s%c\n", vers, 0); X fprintf(f, "%s%c\n", dt_name(odtype), 0); X fprintf(f, "%s%c\n", grip->release, 0); X fprintf(f, "%s%c\n", hdr_name(grip->archtype), 0); X fprintf(f, "%s%c\n", grip->hostname, 0); X fprintf(f, "%s%c\n", grip->filesys, 0); X fprintf(f, "%s%c\n", dt_name(grip->dumptype), 0); X fprintf(f, "%d%c\n", grip->dumplevel, 0); X fprintf(f, "%d%c\n", grip->reflevel, 0); X fprintf(f, "%10lld.%9.9lld%c\n", X (Llong)grip->dumpdate.tv_sec, X (Llong)grip->dumpdate.tv_nsec, X 0); X fprintf(f, "%10lld.%9.9lld%c\n", X (Llong)grip->refdate.tv_sec, X (Llong)grip->refdate.tv_nsec, X 0); X} X XLOCAL void Xreadheader(f) X FILE *f; X{ X char *buf; X size_t buflen = PATH_MAX; X char *p; X Llong ll; X X buf = ___malloc(buflen, "line buffer"); X (void) xgetline(f, &buf, &buflen, sym_symtable); X odtype = dt_type(buf); /* Old Dump type */ X X ogp = ___malloc(sizeof (*ogp), "ogp"); X fillbytes(ogp, sizeof (*ogp), '\0'); X (void) xgetline(f, &buf, &buflen, sym_symtable); X ogp->release = ___savestr(buf); /* Last dump SCHILY.release */ X (void) xgetline(f, &buf, &buflen, sym_symtable); X ogp->archtype = hdr_type(buf); /* Last dump SCHILY.archtype */ X (void) xgetline(f, &buf, &buflen, sym_symtable); X ogp->hostname = ___savestr(buf); /* " SCHILY.volhdr.hostname */ X (void) xgetline(f, &buf, &buflen, sym_symtable); X ogp->filesys = ___savestr(buf); /* " SCHILY.volhdr.filesys */ X (void) xgetline(f, &buf, &buflen, sym_symtable); X ogp->dumptype = dt_type(buf); /* " SCHILY.volhdr.dumptype */ X (void) xgetline(f, &buf, &buflen, sym_symtable); X p = astollb(buf, &ll, 10); X if (*p != '\0') X comerrno(EX_BAD, "Bad dumplevel '%s' in '%s'.\n", X buf, sym_symtable); X ogp->dumplevel = ll; /* " SCHILY.volhdr.dumplevel */ X (void) xgetline(f, &buf, &buflen, sym_symtable); X p = astollb(buf, &ll, 10); X if (*p != '\0') X comerrno(EX_BAD, "Bad reflevel '%s' in '%s'.\n", X buf, sym_symtable); X ogp->reflevel = ll; /* " SCHILY.volhdr.reflevel */ X (void) xgetline(f, &buf, &buflen, sym_symtable); X if (!getdumptime(buf, &ogp->dumpdate)) /* " SCHILY.volhdr.dumpdate */ X exit(EX_BAD); X (void) xgetline(f, &buf, &buflen, sym_symtable); X if (!getdumptime(buf, &ogp->refdate)) /* " SCHILY.volhdr.refdate */ X exit(EX_BAD); X ogp->gflags = GF_RELEASE | GF_ARCHTYPE | GF_HOSTNAME | GF_FILESYS | X GF_DUMPTYPE | GF_DUMPLEVEL | GF_REFLEVEL | X GF_DUMPDATE | GF_REFDATE; X X free(buf); X} X XLOCAL void Xcheckheader() X{ X#ifdef DEBUG X extern FILE *vpr; X X fprintf(vpr, "Last restored dump:\n"); X verbose++; X if (ogp) X griprint(ogp); X fprintf(vpr, "This dump:\n"); X griprint(grip); X verbose--; X#endif X X error("Validating this dump against restored filesystem...\n"); X if (ogp == NULL) { /* star-symtable not read */ X if (grip->dumplevel == 0) { X restore_valid = TRUE; X error("Dump level 0 on empty filesystem, starting restore.\n"); X return; X } X } X if (!streql(grip->hostname, ogp->hostname)) X comerrno(EX_BAD, "Wrong dumphost '%s', last restored dump is from '%s'.\n", X grip->hostname, ogp->hostname); X if (!streql(grip->filesys, ogp->filesys)) X comerrno(EX_BAD, "Wrong filesys '%s', last restored dump is from '%s'.\n", X grip->filesys, ogp->filesys); X if ((grip->dumplevel == ogp->dumplevel) && X (grip->reflevel == ogp->reflevel) && X (grip->refdate.tv_sec == ogp->refdate.tv_sec) && X (grip->dumpdate.tv_sec == ogp->dumpdate.tv_sec)) { X comerrno(EX_BAD, "This dump has already been restored.\n"); X } X if ((grip->dumplevel == ogp->dumplevel) && X (grip->reflevel == ogp->reflevel) && X (grip->refdate.tv_sec == ogp->refdate.tv_sec) && X (grip->dumpdate.tv_sec > ogp->dumpdate.tv_sec)) { X errmsgno(EX_BAD, "A level %d dump has already been restored.\n", X grip->dumplevel); X errmsgno(EX_BAD, "Is is sufficient to restore the most recent dump of each level.\n"); X } else { X if (grip->reflevel != ogp->dumplevel) { X errmsgno(EX_BAD, X "Wrong reflevel %d, last restored dump level was %d.\n", X grip->reflevel, ogp->dumplevel); X if (!forcerestore) { X errmsgno(EX_BAD, X "Restore a level %d (or higher) dump with reflevel %d.\n", X ogp->dumplevel+1, ogp->dumplevel); X useforce(); X /* NOTREACHED */ X } X } X if (grip->refdate.tv_sec != ogp->dumpdate.tv_sec) { X if (ogp->dumpdate.tv_sec > grip->refdate.tv_sec) { X errmsgno(EX_BAD, "WARNING: refdate %s is older than last restored dump ", X dumpdate(&grip->refdate)); X error("%s.\n", dumpdate(&ogp->dumpdate)); X } else { X errmsgno(EX_BAD, "Wrong refdate %s, last restored dump was from ", X dumpdate(&grip->refdate)); X error("%s.\n", dumpdate(&ogp->dumpdate)); X if (forcerestore) X goto force; X useforce(); X /* NOTREACHED */ X } X } X } X restore_valid = TRUE; X error("Dump is valid, starting restore.\n"); X return; Xforce: X restore_valid = TRUE; X error("Dump is not valid, starting restore because of -force-restore.\n"); X} X XLOCAL void Xuseforce() X{ X lunlinkat(sym_lock, 0); X comerrno(EX_BAD, "Use -force-restore if you want to restore anyway.\n"); X /* NOTREACHED */ X} X XLOCAL void Xusepartial() X{ X lunlinkat(sym_lock, 0); X comerrno(EX_BAD, "Use -partial if you want to restore anyway.\n"); X /* NOTREACHED */ X} X X/* X * Compute the name length for full path name for imp X */ XLOCAL size_t Xfullnlen(imp, top) X imap_t *imp; X BOOL top; X{ X ssize_t len = 1; /* Final Null Byte */ X X if (imp == iroot) X return (len); X X if (imp == NULL) { X errmsgno(EX_BAD, "Panic: fullnlen(NULL)\n"); X return (0); X } X len = fullnlen(imp->i_dparent, FALSE); X if (len == 0) X return (len); X X if (imp->i_name == NULL) { X errmsgno(EX_BAD, "Panic: fullnlen NULL i_name\n"); X return (0); X } X len += strlen(imp->i_name) + (top ? 0:1); /* Add '/' if not top */ X return (len); X} X X/* X * Create a full path name for imp in cp X */ XLOCAL char * Xfullname(imp, cp, ep, top) X imap_t *imp; X char *cp; X char *ep; X BOOL top; X{ X int len; X X if (imp == iroot) X return (cp); X X if (imp == NULL) { X errmsgno(EX_BAD, "Panic: fullname(NULL)\n"); X return (NULL); X } X cp = fullname(imp->i_dparent, cp, ep, FALSE); X if (cp == NULL) X return (NULL); X X if (imp->i_name == NULL) { X errmsgno(EX_BAD, "Panic: fullname NULL i_name\n"); X return (NULL); X } X len = strlen(imp->i_name) + (top ? 0:1); X if (cp + len >= ep) X return (NULL); X X strcpy(cp, imp->i_name); X if (!top) { X cp += len-1; X *cp++ = '/'; X *cp = '\0'; X } else { X cp += len; X } X return (cp); X} X X/* X * Print a full path name by parsing the tree of parent directories X */ XLOCAL void Xprintfullname(f, imp) X FILE *f; X imap_t *imp; X{ X if (imp == iroot) X return; X printfullname(f, imp->i_dparent); X fprintf(f, "/%s", imp->i_name); X} X X/* X * Print a single symbol to a file X */ XLOCAL void Xprintonesym(f, imp) X FILE *f; X imap_t *imp; X{ X /* Flags Old ino New Ino Name */ X fprintf(f, "%c %lld %lld %s%c\n", X imp->i_flags & I_DIR ? 'D':' ', X (Llong)imp->i_oino, (Llong)imp->i_nino, X imp->i_name, X 0); X X if (imp->i_oino == 0) { X if (imp != itmp && imp != isym) { X errmsgno(EX_BAD, "WARNING: No old inode number for "); X printfullname(stderr, imp); X fprintf(stderr, "\n"); X } X } X if (imp->i_nino == 0) { X errmsgno(EX_BAD, "WARNING: No new inode number for "); X printfullname(stderr, imp); X fprintf(stderr, "\n"); X } X} X X/* X * Print all symbols to a file X */ XLOCAL void Xprintsyms(f, imp) X FILE *f; X imap_t *imp; X{ X#ifdef DEBUG X error("nimp %d\n", nimp); X#endif X for (; imp; imp = imp->i_dxnext) { X X if (imp->i_flags & I_DELETE) X continue; X X printonesym(f, imp); X X if (imp->i_flags & I_DIR && imp->i_dir) { X fprintf(f, ">%c\n", 0); X printsyms(f, imp->i_dir); X fprintf(f, "<%c\n", 0); X } X } X} X X X#ifdef PRINT_L_SYM X/* X * Print a single symbol with long filenames to a file X */ XLOCAL void XprintoneLsym(f, imp) X FILE *f; X imap_t *imp; X{ X /* Flags Old ino New Ino Name */ X fprintf(f, "%c %lld %lld ", X imp->i_flags & I_DIR ? 'D':' ', X (Llong)imp->i_oino, (Llong)imp->i_nino); X printfullname(f, imp); X fprintf(f, "\n"); X X if (imp->i_oino == 0) { X if (imp != itmp && imp != isym) { X errmsgno(EX_BAD, "WARNING: No old inode number for "); X printfullname(stderr, imp); X fprintf(stderr, "\n"); X } X } X} X X/* X * Print all symbols with long filenames to a file X */ XLOCAL void XprintLsyms(f, imp) X FILE *f; X imap_t *imp; X{ X#ifdef DEBUG X error("nimp %d\n", nimp); X#endif X for (; imp; imp = imp->i_dxnext) { X X if (imp->i_flags & I_DELETE) X continue; X X printoneLsym(f, imp); X X if (imp->i_flags & I_DIR && imp->i_dir) X printLsyms(f, imp->i_dir); X } X} X XEXPORT void XprintLsym(f) X FILE *f; X{ X printLsyms(f, iroot); X} X#endif /* PRINT_L_SYM */ X X#ifdef __needed__ X/* EXPORT BOOL */ XLOCAL BOOL Xdirdiskonly(info, odep, odp) X FINFO *info; X int *odep; X char ***odp; X{ X register char **ep1; /* Directory entry pointer array (arch) */ X register char **ep2 = 0; /* Directory entry pointer array (disk) */ X register char *dp2; /* Directory names string from disk */ X register char **oa = 0; /* Only in arch pointer array */ X register char **od = 0; /* Only on disk pointer array */ X register int i; X int ents1 = -1; X int ents2; X int dlen = 0; /* # of entries only on disk */ X int alen = 0; /* # of entries only in arch */ X BOOL diffs = FALSE; X DIR *dirp; X X /* X * Old archives had only one nul at the end X * xheader.c already increments info->f_dirlen in this case X * but a newline may appear to be the last char. X * Note that we receicve the space from the xheader X * extract buffer. X */ X i = info->f_dirlen; X if (info->f_dir[i-1] != '\0') X info->f_dir[i-1] = '\0'; /* Kill '\n' */ X X ep1 = sortdir(info->f_dir, &ents1); /* from archive */ X dirp = lopendir(info->f_name); X if (dirp) { X dp2 = dfetchdir(dirp, info->f_name, &ents2, 0, (ino_t **)0); X closedir(dirp); X } else { X dp2 = NULL; X } X if (dp2 == NULL) { X diffs = TRUE; X errmsg("Cannot read dir '%s'.\n", info->f_name); X goto no_dircmp; X } X ep2 = sortdir(dp2, &ents2); /* from disk */ X X if (ents1 != ents2) { X if (debug || verbose > 2) { X error("Archive ents: %d Disk ents: %d '%s'\n", X ents1, ents2, info->f_name); X } X diffs = TRUE; X } X X if (cmpdir(ents1, ents2, ep1, ep2, NULL, NULL, &alen, &dlen) > 0) X diffs = TRUE; X X oa = ___malloc(alen * sizeof (char *), "dir diff array"); X od = ___malloc(dlen * sizeof (char *), "dir diff array"); X cmpdir(ents1, ents2, ep1, ep2, oa, od, &alen, &dlen); X X#ifdef DEBUG X for (i = 0; i < dlen; i++) { X error("Only on disk '%s': '%s'\n", X info->f_name, od[i] + 1); X } X for (i = 0; i < alen; i++) { X error("Only in archive '%s': '%s'\n", X info->f_name, oa[i] + 1); X } X#endif X Xno_dircmp: X if (odep) X *odep = dlen; X X if (dp2) X free(dp2); X if (ep1) X free(ep1); X if (ep2) X free(ep2); X if (odp) X *odp = od; X else if (od) X free(od); X if (oa) X free(oa); X X return (diffs); X} X#endif /* __needed__ */ END-of-star-1.6/star/restore.c echo x - star-1.6/star/star.c sed 's/^X//' >star-1.6/star/star.c << 'END-of-star-1.6/star/star.c' X/* @(#)star.c 1.391 19/03/27 Copyright 1985, 88-90, 92-96, 98, 99, 2000-2019 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)star.c 1.391 19/03/27 Copyright 1985, 88-90, 92-96, 98, 99, 2000-2019 J. Schilling"; X#endif X/* X * Copyright (c) 1985, 88-90, 92-96, 98, 99, 2000-2019 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#define STAR_MAIN X X#include X#include X#include X#include X#include X#include "star.h" X#include "props.h" X#include "diff.h" X#include X#include X#define __XDEV__ /* Needed to activate _dev_init() */ X#include X#include /* Needed for O_XATTR */ X#include /* Needed for umask(2) */ X#include X#define GT_COMERR /* #define comerr gtcomerr */ X#define GT_ERROR /* #define error gterror */ X#include X#include X#include "fifo.h" /* Needed for #undef FIFO */ X#include "dumpdate.h" X#ifdef USE_FIND X#include X#include X#endif X X#include X X#include "starsubs.h" X#include "dirtime.h" X#include "checkerr.h" X XEXPORT int main __PR((int ac, char **av)); XLOCAL void star_create __PR((int ac, char *const *av)); XLOCAL void checkdumptype __PR((GINFO *gp)); XLOCAL void init_ddate __PR((char *name)); XEXPORT void copy_create __PR((int ac, char *const *av)); XLOCAL int getfilecount __PR((int ac, char *const *av, const char *fmt)); XLOCAL void getdir __PR((int *acp, char *const **avp, X const char **dirp)); XLOCAL void openlist __PR((void)); XLOCAL void check_stdin __PR((char *name)); XLOCAL void susage __PR((int ret)); XLOCAL void usage __PR((int ret)); XLOCAL void xusage __PR((int ret)); XLOCAL void dusage __PR((int ret)); XLOCAL void husage __PR((int ret)); XLOCAL void gargs __PR((int ac, char *const *av)); XLOCAL void star_mkvers __PR((void)); XLOCAL void star_helpvers __PR((char *name, BOOL help, BOOL xhelp, BOOL prvers)); XLOCAL void star_checkopts __PR((BOOL oldtar, BOOL dodesc, BOOL usetape, X int archive, BOOL no_fifo, X const char *paxopts, X Llong llbs)); XEXPORT void star_verifyopts __PR((void)); XLOCAL void star_nfiles __PR((int files, int minfiles)); XLOCAL int getpaxH __PR((char *arg, long *valp, int *pac, char *const **pav)); XLOCAL int getpaxL __PR((char *arg, long *valp, int *pac, char *const **pav)); XLOCAL int getpaxP __PR((char *arg, long *valp, int *pac, char *const **pav)); XLOCAL int getfind __PR((char *arg, long *valp, int *pac, char *const **pav)); XLOCAL int getpaxpriv __PR((char *arg, long *valp)); XLOCAL int getlldefault __PR((char *arg, Llong *valp, int mult)); XEXPORT int getbnum __PR((char *arg, Llong *valp)); XEXPORT int getknum __PR((char *arg, Llong *valp)); XEXPORT int getknum __PR((char *arg, Llong *valp)); XLOCAL int getenum __PR((char *arg, long *valp)); XLOCAL int addtarfile __PR((const char *tarfile)); XLOCAL int add_diffopt __PR((char *optstr, long *flagp)); XLOCAL int gethdr __PR((char *optstr, long *typep)); XLOCAL int getexclude __PR((char *arg, long *valp, int *pac, char *const **pav)); X#ifdef USED XLOCAL int addfile __PR((char *optstr, long *dummy)); X#endif XEXPORT void set_signal __PR((int sig, RETSIGTYPE (*handler)(int))); XLOCAL void exsig __PR((int sig)); XLOCAL void sighup __PR((int sig)); XLOCAL void sigintr __PR((int sig)); XLOCAL void sigquit __PR((int sig)); XLOCAL void getstamp __PR((void)); XLOCAL const char *has_cli __PR((int ac, char *const *av)); XLOCAL int get_ptype __PR((const char *p)); XLOCAL void set_ptype __PR((int *pac, char *const **pav)); XLOCAL void docompat __PR((int *pac, char *const **pav)); XEXPORT BOOL ttyerr __PR((FILE *f)); X X#if defined(SIGDEFER) || defined(SVR4) X#define signal sigset X#endif X X#define QIC_24_TSIZE 122880 /* 61440 kBytes */ X#define QIC_120_TSIZE 256000 /* 128000 kBytes */ X#define QIC_150_TSIZE 307200 /* 153600 kBytes */ X#define QIC_250_TSIZE 512000 /* 256000 kBytes (XXX not verified) */ X#define QIC_525_TSIZE 1025000 /* 512500 kBytes */ X#define TSIZE(s) ((s)*TBLOCK) X Xchar *vers; /* the full version string */ X Xstruct star_stats xstats; /* for printing statistics */ X Xextern BOOL havepat; /* Pattern matching in use */ X X#define NTARFILE 100 /* Max # of archive files */ X XFILE *tarf; /* The current archive */ XFILE *listf; /* File for list= option */ XFILE *tty; /* Open /dev/tty for questions */ XFILE *vpr; /* File for verbose printing */ XBOOL did_stdin = FALSE; /* Did use stdin for any option */ Xconst char *tarfiles[NTARFILE]; /* Cycle list of all archives */ Xint ntarfiles; /* Number of entries in list */ Xint tarfindex; /* Current index in list */ Xchar *newvol_script; /* -new-volume-script name */ XBOOL multivol = FALSE; /* -multivol specified */ XBOOL force_noremote = FALSE; /* -force-local specified */ Xchar *rmt; /* -rmt specify remote server */ Xchar *rsh; /* -rsh specify rsh command */ Xchar *listfile; /* File name for list= */ XBOOL pkglist = FALSE; /* pkglist= specified */ Xchar *stampfile; /* Time stamp file for -newer */ XBOOL errflag; /* -e for abort on error */ Xconst char *wdir; /* current working dir name */ Xconst char *currdir; /* current -C dir argument */ Xconst char *dir_flags = NULL; /* One/more -C options present */ XBOOL bsdchdir = FALSE; /* -C only valid for next arg */ Xchar *volhdr; /* VOLHDR= argument */ Xchar *fs_name; /* fs-name= for snapshot fs */ Xchar *dd_name; /* dumpdate= for snapshots */ Xdev_t tape_dev; /* st_dev for current archive */ Xino_t tape_ino; /* st_ino for current archive */ XBOOL tape_isreg = FALSE; /* Tape is a regular file */ X#ifdef FIFO XBOOL use_fifo = TRUE; /* Whether to use a FIFO or not */ X#else XBOOL use_fifo = FALSE; /* Whether to use a FIFO or not */ X#endif XBOOL shmflag = FALSE; /* Whether to use shmem f. FIFO */ Xlong fs; /* FIFO size */ Xlong bs; /* TAPE block size (bytes) */ Xint nblocks = 20; /* TAPE blocks (512 byte units) */ XBOOL not_tape = FALSE; /* -sun-n not a Tape */ Xuid_t dir_uid = _BAD_UID; /* -dir-owner */ Xgid_t dir_gid = _BAD_GID; /* -dir-group */ Xuid_t my_uid; /* Current euid */ Xdev_t curfs = NODEV; /* Current st_dev for -M option */ Xstruct timespec ddate; /* The current dump date */ Xtime_t sixmonth; /* 6 months before limit (ls) */ Xtime_t now; /* now limit (ls) */ X/* X * Change default header format into XUSTAR in 2004 (see below in gargs()) X */ Xlong hdrtype = H_XSTAR; /* default header format */ Xlong chdrtype = H_UNDEF; /* command line hdrtype */ Xint cmptype = C_NONE; /* compression type */ Xint iftype = I_TAR; /* command line interface type */ Xint ptype = P_STAR; /* program interface type */ Xconst char *pname = NULL; /* program name with cli= */ XBOOL paxls = FALSE; /* create PAX type listing */ Xint version = 0; /* Version from POSIX TAR hdr */ Xint swapflg = -1; /* Whether to swap input */ XBOOL debug = FALSE; /* -debug has been specified */ Xint xdebug = 0; /* eXtended debug level */ Xint dumplevel = -1; /* level for incremental dumps */ Xint oldlevel = 0; /* dumpleve this dump refers to */ XBOOL dump_partial = FALSE; /* Dump is not a full dump */ XBOOL dump_cumulative = FALSE; /* -cumulative has b. specified */ Xchar *dumpdates = "/etc/tardumps"; /* Database for increment. dump */ XBOOL wtardumps = FALSE; /* Should update above file */ XBOOL print_artype = FALSE; XBOOL showtime = FALSE; /* -time has been specified */ XBOOL no_stats = FALSE; /* -no-statistics specified */ XBOOL cpio_stats = FALSE; /* -cpio-statistics specified */ XBOOL do_fifostats = FALSE; /* -fifostats specified */ XBOOL numeric = FALSE; /* -numeric user ids */ Xint verbose = 0; /* -v has been specified */ XBOOL silent = FALSE; /* -silent no informal msg */ XBOOL prblockno = FALSE; /* -block-number for all files */ XBOOL no_xheader = FALSE; /* -no-xheader ignore P.2001 */ XBOOL no_fsync = -1; /* -no-fsync on extract */ XBOOL readnull = FALSE; /* -read0 on with list= */ XBOOL tpath = FALSE; /* -tpath print path only */ XBOOL cflag = FALSE; /* -c has been specified */ XBOOL uflag = FALSE; /* -u has been specified */ XBOOL rflag = FALSE; /* -r has been specified */ XBOOL xflag = FALSE; /* -x has been specified */ XBOOL tflag = FALSE; /* -t has been specified */ XBOOL copyflag = FALSE; /* -copy has been specified */ XBOOL binflag = FALSE; /* -o binary has been specified */ XBOOL nflag = FALSE; /* -n dummy extract mode */ XBOOL diff_flag = FALSE; /* -diff has been specified */ XBOOL Zflag = FALSE; /* -Z has been specified */ XBOOL zflag = FALSE; /* -z has been specified */ XBOOL bzflag = FALSE; /* -bz has been specified */ XBOOL lzoflag = FALSE; /* -lzo has been specified */ XBOOL p7zflag = FALSE; /* -7z has been specified */ XBOOL xzflag = FALSE; /* -xz has been specified */ XBOOL lzipflag = FALSE; /* -lzip has been specified */ XBOOL zstdflag = FALSE; /* -zstd has been specified */ XBOOL lzmaflag = FALSE; /* -lzma has been specified */ XBOOL freezeflag = FALSE; /* -freeze has been specified */ Xchar *compress_prg = NULL; /* -compress-program specified */ XBOOL multblk = FALSE; /* -B has been specified */ XBOOL ignoreerr = FALSE; /* -i has been specified */ XBOOL nodir = FALSE; /* -d do not store dirs */ XBOOL noxdir = FALSE; /* -d do not create dirs */ XBOOL noatime = FALSE; /* -p a pax do not restore atime */ XBOOL nomtime = FALSE; /* -m do not restore times */ XBOOL nochown = FALSE; /* -o do not restore owner */ XBOOL acctime = FALSE; /* -atime has been specified */ XBOOL pflag = FALSE; /* -p restore permissions */ XBOOL nopflag = FALSE; /* -no-p don't restore perms */ XBOOL dirmode = FALSE; /* -dirmode wr. dirs past files */ XBOOL nolinkerr = FALSE; /* pr. link # err depends on -l */ XBOOL follow = FALSE; /* -h follow symbolic links */ XBOOL paxfollow = FALSE; /* PAX -L follow symbolic links */ XBOOL paxHflag = FALSE; /* PAX -H follow symbolic links */ XBOOL nodesc = FALSE; /* -D do not descenc dirs */ XBOOL nomount = FALSE; /* -M do not cross mount points */ XBOOL interactive = FALSE; /* -w has been specified */ XBOOL paxinteract = FALSE; /* PAX -i has been specified */ XBOOL signedcksum = FALSE; /* -signed-checksum */ XBOOL partial = FALSE; /* -P write partial last record */ XBOOL nospec = FALSE; /* -S no special files */ Xint Fflag = 0; /* -F,-FF,... no SCCS/RCS/... */ XBOOL uncond = FALSE; /* -U unconditional extract */ XBOOL uncond_rename = FALSE; /* -uncond-rename - ask always */ XBOOL xdir = FALSE; /* -xdir uncond. dir extract */ XBOOL xdot = FALSE; /* -xdot uncond '.' dir extract */ XBOOL keep_old = FALSE; /* -k do not overwrite files */ XBOOL refresh_old = FALSE; /* -refresh existing only */ XBOOL abs_path = FALSE; /* -/ absolute path allowed */ XBOOL allow_dotdot = FALSE; /* -.. '..' in path allowed */ XBOOL secure_links = -1; /* -secure-links (no .. & /) */ XBOOL no_dirslash = FALSE; /* -no-dirslash option */ XBOOL notpat = FALSE; /* -not invert pattern matcher */ XBOOL match_tree = FALSE; /* -match-tree match dir -> tree */ XBOOL notarg = FALSE; /* PAX -c invert match */ XBOOL paxmatch = FALSE; /* Do PAX like matching */ XBOOL paxnflag = FALSE; /* PAX -n one match only */ XBOOL force_hole = FALSE; /* -force-hole on extract */ XBOOL sparse = FALSE; /* -sparse has been specified */ XBOOL to_stdout = FALSE; /* -to-stdout extraction */ XBOOL wready = FALSE; /* -wready wait for ready tape */ XBOOL force_remove = FALSE; /* -force-remove on extraction */ XBOOL ask_remove = FALSE; /* -ask-remove on extraction */ XBOOL remove_first = FALSE; /* -remove-first on extraction */ XBOOL remove_recursive = FALSE; /* -remove-recursive on extract */ XBOOL keep_nonempty_dirs = FALSE; /* -keep-nonempty-dirs on extract */ XBOOL do_install = FALSE; /* -install on extract */ XBOOL nullout = FALSE; /* -onull - simulation write */ XBOOL prinodes = FALSE; /* -prinodes print ino # w. -tv */ X XUllong maxsize = 0; /* max file size for create */ Xstruct timespec Newer = {0, 0}; /* Time stamp to compare with */ XUllong tsize = 0; /* Max tape size in tar blocks */ Xlong diffopts = 0L; /* diffopts= bit mask */ XBOOL nowarn = FALSE; /* -nowarn has been specified */ XBOOL Ctime = FALSE; /* -ctime has been specified */ XBOOL nodump = FALSE; /* -nodump has been specified */ X XBOOL listnew = FALSE; /* -newest list newest only */ XBOOL listnewf = FALSE; /* -newest-file list n. plain f */ XBOOL hpdev = FALSE; /* -hpdev non POSIX dev # */ XBOOL modebits = FALSE; /* -modebits more than 12 bits */ XBOOL copylinks = FALSE; /* -copylinks rather than link */ XBOOL copyhardlinks = FALSE; /* -copyhardlinks rather than link */ XBOOL copysymlinks = FALSE; /* -copysymlinks rather than link */ XBOOL copydlinks = FALSE; /* copy content of linked dirs */ XBOOL hardlinks = FALSE; /* -hardlinks ext. sym as hard */ XBOOL symlinks = FALSE; /* -symlinks ext. hard as syml */ XBOOL linkdata = FALSE; /* -link-data data in hardlinks */ XBOOL doacl = FALSE; /* -acl handle ACLs */ XBOOL doxattr = FALSE; /* -xattr handle extended fattr */ XBOOL dolxattr = FALSE; /* -xattr-linux extended fattr */ XBOOL dofflags = FALSE; /* -xfflags handle extended ffl */ XBOOL link_dirs = FALSE; /* -link-dirs hard linked dirs */ XBOOL dodump = FALSE; /* -dump mode with all ino prop */ XBOOL dorestore = FALSE; /* -restore in incremental mode */ XBOOL dopartial = FALSE; /* -partial in incremental mode */ XBOOL forcerestore = FALSE; /* -force-restore in incremental mode */ XBOOL dometa = FALSE; /* -meta ino metadata only */ XBOOL dumpmeta = FALSE; /* -dumpmeta metadata for ctime */ XBOOL xmeta = FALSE; /* -xmeta extract meta files */ XBOOL lowmem = FALSE; /* -lowmem use less memory */ X#ifdef USE_FIND XBOOL dofind = FALSE; /* -find option found */ Xint find_ac = 0; /* ac past -find option */ Xchar *const *find_av = NULL; /* av past -find option */ Xint find_pac = 0; /* ac for first find primary */ Xchar *const *find_pav = NULL; /* av for first find primary */ Xfindn_t *find_node; /* syntaxtree from find_parse() */ Xvoid *plusp; /* residual for -exec ...{} + */ Xint find_patlen; /* len for -find pattern state */ Xchar *codeset = "ISO8859-1"; X#ifdef USE_SELINUX XBOOL selinux_enabled; X#endif X X XLOCAL int walkflags = WALK_CHDIR | WALK_PHYS | WALK_NOEXIT | X WALK_STRIPLDOT; XLOCAL int maxdepth = -1; XLOCAL int mindepth = -1; XEXPORT struct WALK walkstate; X#endif X XBOOL tcompat = FALSE; /* Tar compatibility (av[0] is tar/ustar) */ XBOOL fcompat = FALSE; /* Archive file compatibility was requested */ X Xint intr = 0; /* Did catch a ^C */ X XBOOL do_subst; X X/* X * _grinfo is only used to read the information. X */ XGINFO _ginfo; /* Global (volhdr) information */ XGINFO _grinfo; /* Global read information */ XGINFO *gip = &_ginfo; /* Global information pointer */ XGINFO *grip = &_grinfo; /* Global read info pointer */ X Xstruct ga_props gaprops; X X#ifdef STAR_FAT X#include "suntar.c" X#include "gnutar.c" X#include "cpio.c" X#include "pax.c" X#endif X X#ifndef NO_STAR_MAIN X#define PTYPE_DEFAULT P_STAR X/* X * Achtung: Optionen wie f= sind problematisch denn dadurch dass -ffilename geht, X * werden wird bei Falschschreibung von -fifo evt. eine Datei angelegt wird. X */ X/* BEGIN CSTYLED */ Xchar _opts[] = "C*,find~,help,xhelp,version,debug,xdebug#,xd#,bsdchdir,pax-ls,level#,tardumps*,wtardumps,time,no_statistics,no-statistics,cpio-statistics,fifostats,numeric,v+,block-number,tpath,c,u,r,x,t,copy,xcopy,n,diff,diffopts&,H&,artype&,print-artype,fs-name*,force_hole,force-hole,sparse,to_stdout,to-stdout,wready,force_remove,force-remove,ask_remove,ask-remove,remove_first,remove-first,remove_recursive,remove-recursive,keep-nonempty-dirs,install,nullout,onull,fifo,no_fifo,no-fifo,shm,fs&,VOLHDR*,list*,pkglist*,multivol,new-volume-script*,force-local,restore,partial,force-restore,freeze,file&,f&,T,Z,z,bz,j,lzo,7z,xz,lzip,zstd,lzma,compress-program*,rmt*,rsh*,bs&,blocks&,b&,B,pattern&,pat&,i,d,m,o,nochown,pax-o*,pax-p&,a,atime,p,no-p,dirmode,l,h,L,pax-L~,pax-H~,pax-P~,D,dodesc,M,xdev,w,pax-i,I,X&,exclude-from&,O,signed_checksum,signed-checksum,P,S,F+,U,uncond-rename,xdir,xdot,k,keep_old_files,keep-old-files,refresh_old_files,refresh-old-files,refresh,/,..,secure-links,no-secure-links%0,no-dirslash,not,V,match-tree,pax-match,pax-n,pax-c,notarg,maxsize&,newer*,ctime,nodump,tsize&,qic24,qic120,qic150,qic250,qic525,nowarn,newest_file,newest-file,newest,hpdev,modebits,copylinks,copyhardlinks,copysymlinks,copydlinks,hardlinks,symlinks,link-data,acl,xattr,xattr-linux,xfflags,link-dirs,dumpdate*,dump,cumulative,dump-cumulative,meta,dumpmeta,xmeta,silent,lowmem,no-xheader,no-fsync%1,do-fsync%0,read0,errctl&,e,data-change-warn,prinodes,dir-owner*,dir-group*,umask*,s&,?"; X/* END CSTYLED */ Xchar *opts = _opts; X#else Xextern char *opts; X#endif /* NO_STAR_MAIN */ X XEXPORT int Xmain(ac, av) X int ac; X char **av; X{ X int cac = ac; X char *const *cav = av; X int oac; X char *const *oav; X int excode = 0; X char *tgt_dir = NULL; X X save_args(ac, av); X X#ifdef USE_NLS X if (setlocale(LC_ALL, "") != NULL) { X#ifdef CODESET X codeset = nl_langinfo(CODESET); X#endif X } X X#if !defined(TEXT_DOMAIN) /* Should be defined by cc -D */ X#define TEXT_DOMAIN "star" /* Use this only if it weren't */ X#endif X { char *dir; X dir = searchfileinpath("share/locale", F_OK, X SIP_ANY_FILE|SIP_NO_PATH, NULL); X if (dir) X (void) bindtextdomain(TEXT_DOMAIN, dir); X else X#if defined(PROTOTYPES) && defined(INS_BASE) X (void) bindtextdomain(TEXT_DOMAIN, INS_BASE "/share/locale"); X#else X (void) bindtextdomain(TEXT_DOMAIN, "/usr/share/locale"); X#endif X (void) textdomain(TEXT_DOMAIN); X } X X#endif /* USE_NLS */ X X my_uid = geteuid(); X my_uid = getuid(); X X docompat(&cac, &cav); X X gargs(cac, cav); X if (pname) { /* cli=xxx seen as argv[1] */ X --cac, cav++; X } X --cac, cav++; X oac = cac; X oav = cav; X X#ifdef SIGHUP X if (signal(SIGHUP, SIG_IGN) != SIG_IGN) X set_signal(SIGHUP, sighup); X#endif X#ifdef SIGINT X if (signal(SIGINT, SIG_IGN) != SIG_IGN) X set_signal(SIGINT, sigintr); X#endif X#ifdef SIGQUIT X if (signal(SIGQUIT, SIG_IGN) != SIG_IGN) X set_signal(SIGQUIT, sigquit); X#endif X#ifdef SIGINFO X /* X * Be polite to *BSD users. X * They copied our idea and implemented intermediate status X * printing in 'dd' in 1990. X */ X if (signal(SIGINFO, SIG_IGN) != SIG_IGN) X set_signal(SIGINFO, sigquit); X#endif X X file_raise((FILE *)NULL, FALSE); X X initbuf(nblocks); /* Calls initfifo() if needed */ X X (void) openremote(); /* This needs super user privilleges */ X X if (geteuid() != getuid()) { /* AIX does not like to do this */ X /* If we are not root */ X#ifdef HAVE_SETREUID X if (setreuid(-1, getuid()) < 0) X#else X#ifdef HAVE_SETEUID X if (seteuid(getuid()) < 0) X#else X if (setuid(getuid()) < 0) X#endif X#endif X comerr("Panic cannot set back effective uid.\n"); X } X my_uid = geteuid(); X /* X * WARNING: We now are no more able to open a new remote connection X * unless we have been called by root. X * It you like to do a remote multi-tape backup to different hosts X * and do not call star from root, you are lost. X */ X X#ifdef USE_SELINUX X selinux_enabled = is_selinux_enabled() > 0; X#endif X X opentape(); X X if (stampfile) X getstamp(); X X star_mkvers(); /* Create version string */ X setprops(chdrtype); /* Set up properties for archive format */ X /* X * If the archive format contains extended headers, we X * need to set up iconv(). X */ X if (cflag && props.pr_flags & PR_XHDR) X utf8_init(S_CREATE); /* Init. iconv() setup for xheader */ X X if (!(rflag || uflag) || chdrtype != H_UNDEF) X star_verifyopts(); /* Chk if options are valid for chdrtype */ X X if (dumplevel >= 0) X initdumpdates(dumpdates, wtardumps); X dev_init(debug); /* Init device macro handling */ X xbinit(); /* Initialize buffer for extended headers */ X X if (dir_flags && (!tflag || copyflag)) X wdir = dogetwdir(TRUE); /* Exit on failure */ X else if (xflag) X wdir = dogetwdir(FALSE); /* Return NULL on failure */ X X getnstimeofday(&ddate); X now = ddate.tv_sec + 60; X sixmonth = ddate.tv_sec - 6L*30L*24L*60L*60L; X#ifdef USE_FIND X find_timeinit(ddate.tv_sec); X walkinitstate(&walkstate); X#endif X if (dd_name) X init_ddate(dd_name); X X ginit(); /* Initialize global (volhdr) info */ X X if (copyflag) { X int lac = cac; X char *const *lav = cav; X X if (tflag) { X /* X * Flag no args at 'extract' side in -c -list mode. X */ X cav = &oav[oac]; X cac = 0; X } else { X /* X * Find last file type argument. X */ X for (; ; --cac, cav++) { X if (getlfiles(&cac, &cav, &gaprops, opts) == 0) X break; X lac = cac; X lav = cav; X } X tgt_dir = lav[0]; X cav = &lav[1]; X cac = lac-1; X if (cac > 0) { X errmsgno(EX_BAD, X "Badly placed option after target directory.\n"); X susage(EX_BAD); X } X } X } X X /* X * These callbacks are only called in case we leave star via comexit(). X * We do this only in case of a severe error. X * These functions are called in the inverse set up oder, so checkerrs() X * called last. X */ X on_comerr((void(*)__PR((int, void *)))checkerrs, (void *)0); X on_comerr((void(*)__PR((int, void *)))prstats, (void *)0); X if (xflag) X on_comerr((void(*)__PR((int, void *)))flushdirtimes, (void *)0); X#ifdef FIFO X if (use_fifo) { X runfifo(oac, oav); /* Run FIFO, fork() is called here */ X on_comerr(fifo_onexit, /* For foreground FIFO process only */ X (void *)0); X } X#endif X X if (copyflag) { X do_subst = FALSE; /* Substitution only at create side */ X havepat = FALSE; /* Patterns only at create side */ X listfile = NULL; /* Listfile only at create side */ X swapflg = 0; /* Don't try to find out the hdrtype */ X dir_flags = tgt_dir; /* Target directory only at extract */ X#ifdef USE_FIND X dofind = FALSE; /* -find expr only at create side */ X#endif X } X X if (xflag || tflag || diff_flag) { X /* X * cflag will never be TRUE in this case X */ X if (listfile) { X openlist(); X hash_build(listf); X if ((currdir = dir_flags) != NULL) X dochdir(currdir, TRUE); X } else { X#ifdef USE_FIND X if (!dofind) { X#endif X for (; ; --cac, cav++) { X if (dir_flags) X getdir(&cac, &cav, &currdir); X if (getlfiles(&cac, &cav, &gaprops, opts) == 0) X break; X addarg(cav[0]); X } X#ifdef USE_FIND X } X#endif X closepattern(); X } X if (tflag) { X list(); X } else { X /* X * xflag || diff_flag X * First change dir to the one or last -C arg X * in case there is no pattern in list. X */ X if ((currdir = dir_flags) != NULL) X dochdir(currdir, TRUE); X if (xflag) X extract(volhdr); X else X diff(); X } X } X closepattern(); X if (uflag || rflag) { X /* X * cflag will also be TRUE in this case X */ X skipall(); X syncbuf(); X backtape(); X } X if (cflag) { X /* X * xflag, tflag, diff_flag will never be TRUE in this case X */ X star_create(cac, cav); X } X X#ifdef USE_FIND X find_plusflush(plusp, &walkstate); X#endif X fflush(vpr); /* Avoid output mix with checklinks() from 2>&1 | tee */ X if (!nolinkerr) X checklinks(); X if (!use_fifo) X closetape(); X#ifdef FIFO X if (use_fifo) X fifo_exit(0); X#endif X X#ifdef HAVE_FORK X while (wait(0) >= 0) { X ; X /* LINTED */ X } X#endif X if (!no_stats) X prpatstats(); X prstats(); X if (checkerrs()) { X if (!nowarn && !no_stats) { X errmsgno(EX_BAD, X "Processed all possible files, despite earlier errors.\n"); X } X excode = -2; X } X if (intr) { X /* X * This happens when we are in create mode and the interrupt is X * delayed in order to prevent inconsistent archives. X */ X if (excode == 0) X excode = -4; X } X if (!isatty(fdown(stderr))) { X char *p; X X /* X * Try to avoid that the verbose or diagnostic messages are X * sometimes lost if called on Linux via "ssh". Unfortunately X * this does not always help. If you like to make sure that X * nothing gets lost, call: ssh host "star .... ; sleep 10" X */ X fflush(vpr); X fflush(stderr); X#ifdef HAVE_FSYNC X if (!no_fsync) { X fsync(fdown(vpr)); X fsync(fdown(stderr)); X } X#endif X /* X * Use the sleep only in case that the environment is set, but X * keep the fflush() as stderr may be buffered. X */ X if ((p = getenv("STAR_WORKAROUNDS")) != NULL && X strstr(p, "ssh-tcpip") != NULL) X usleep(100000); X } X#ifdef FIFO X /* X * Fetch errno from FIFO if available. X */ X if (fifo_errno()) X excode = fifo_errno(); X#endif X if (dumplevel >= 0 && wtardumps) { X if (excode != 0 || intr) { X errmsgno(EX_BAD, "'%s' not written due to problems during backup.\n", X dumpdates); X } else { X int dflags = 0; X X if (gip->dumptype != DT_FULL) X dflags |= DD_PARTIAL; X if (dump_cumulative) X dflags |= DD_CUMULATIVE; X X writedumpdates(dumpdates, gip->filesys, dumplevel, dflags, &ddate); X } X } X#ifdef DBG_MALLOC X aprintlist(stdout, 1); X#endif X X exit(excode); X /* NOTREACHED */ X return (excode); /* keep lint happy */ X} X XLOCAL void Xstar_create(ac, av) X int ac; X char *const *av; X{ X /* X * xflag, tflag, diff_flag will never be TRUE in this case X */ X put_release(); /* Pax 'g' vendor unique */ X put_archtype(); /* Pax 'g' vendor unique */ X if (dumplevel < 0) /* In dump mode we first collect the data */ X put_volhdr(volhdr, TRUE); X#ifdef USE_FIND X if (dumplevel >= 0 && (listfile || dofind)) X comerrno(EX_BAD, X "Cannot do incremental dumps with list= or -find.\n"); X#else X if (dumplevel >= 0 && listfile) X comerrno(EX_BAD, "Cannot do incremental dumps with list=.\n"); X#endif X#ifdef USE_FIND X if (dofind) { X if (find_patlen > 0) { X walkstate.patstate = ___malloc(sizeof (int) * find_patlen, X "space for pattern state"); X } X X walkstate.walkflags = walkflags; X walkstate.maxdepth = maxdepth; X walkstate.mindepth = mindepth; X walkstate.lname = NULL; X walkstate.tree = find_node; X walkstate.err = 0; X walkstate.pflags = 0; X X if ((currdir = dir_flags) != NULL) X dochdir(currdir, TRUE); X nodesc = TRUE; X for (av = find_av; av != find_pav; av++) { X treewalk(*av, walkfunc, &walkstate); X } X } else X#endif X if (listfile) { X openlist(); X if ((currdir = dir_flags) != NULL) X dochdir(currdir, TRUE); X /* X * We do not allow file type args together with list= X * Note that Sun tar allows a mix. X */ X if (getlfiles(&ac, &av, &gaprops, opts) > 0) X comerrno(EX_BAD, "Too many args for list= option.\n"); X createlist(); X } else { X const char *cdir = NULL; X X for (; ; --ac, av++) { X if (dir_flags) X getdir(&ac, &av, &currdir); X if (currdir && cdir != currdir) { X if (!(dochdir(wdir, FALSE) && X dochdir(currdir, FALSE))) X break; X cdir = currdir; X } X X if (getlfiles(&ac, &av, &gaprops, opts) == 0) X break; X if (dumplevel >= 0) { X dumpd_t *dp; X int dflags = 0; X X /* X * The next message is only for debugging X * purposes to find problems related to option X * parsing. X */ X if (ac > 1) X errmsgno(EX_BAD, "INFO: ac %c av[0] '%s'\n", ac, av[0]); X X /* X * We cannot have more than one file type X * argument in dump mode if we like to grant X * the consistency of dumps. In theory, it would X * be possible to allow it, but then we will not X * be able to deal with renames from outside the X * scope to inside the scope. X */ X if (ac > 1) X comerrno(EX_BAD, X "Only one file type arg allowed in dump mode.\n"); X if (cdir == NULL) { X comerrno(EX_BAD, X "Need '-C dir' in dump mode.\n"); X /* NOTREACHED */ X } X if (cdir[0] != '/') X comerrno(EX_BAD, X "Need absolute path with '-C dir' in dump mode.\n"); X if (!streql(av[0], ".")) X comerrno(EX_BAD, X "File type arg must be '.' in dump mode.\n"); X X gip->filesys = (char *)cdir; X gip->gflags |= GF_FILESYS; X if (fs_name) { X gip->filesys = fs_name; X gip->cwd = (char *)cdir; X gip->gflags |= GF_CWD; X } X /* X * Set dump type to full/partial. X */ X checkdumptype(gip); X if (gip->dumptype != DT_FULL) X dflags |= DD_PARTIAL; X if (dump_cumulative) X dflags |= DD_CUMULATIVE; X dp = checkdumpdates(gip->filesys, dumplevel, dflags); X if (dp == NULL && dumplevel > 0 && gip->dumptype != DT_FULL) X dp = checkdumpdates(gip->filesys, dumplevel, 0); X if (dp == NULL && dumplevel > 0) { X errmsgno(EX_BAD, X "No level 0 dump entry found in '%s'.\n", X dumpdates); X comerrno(EX_BAD, "Perform a level 0 dump first.\n"); X } X if (dp) { X oldlevel = dp->dd_level; X Newer = dp->dd_date; X gip->reflevel = dp->dd_level; X gip->refdate = dp->dd_date; X gip->gflags |= (GF_REFLEVEL|GF_REFDATE); X } X X adddumpdates(gip->filesys, dumplevel, dflags, X &ddate, TRUE); X X error("Type of this level %d%s dump: %s\n", X dumplevel, X (dflags & DD_PARTIAL) ? "P":" ", X dt_name(gip->dumptype)); X error("Date of this level %d%s dump: %s\n", X dumplevel, X (dflags & DD_PARTIAL) ? "P":" ", X dumpdate(&ddate)); X error("Date of last level %d%s dump: %s\n", X oldlevel, X (dp && (dp->dd_flags & DD_PARTIAL)) ? X "P":" ", X dumpdate(&Newer)); X X put_volhdr(volhdr, TRUE); X } X if (intr) X break; X curfs = NODEV; X /* X * To avoid empty incremental dumps, make sure that X * av[0] is always in the archive in with dumplevel >= 0 X */ X create(av[0], paxHflag, dumplevel >= 0); X if (bsdchdir && wdir && !dochdir(wdir, FALSE)) X break; X } X } X flushlinks(); X weof(); X buf_drain(); X} X XLOCAL void Xcheckdumptype(gp) X GINFO *gp; X{ X FINFO dinfo; X FINFO ddinfo; X BOOL full = FALSE; X X if (!_getinfo(".", &dinfo)) X return; X if (!_getinfo("..", &ddinfo)) X return; X X if (dinfo.f_ino == ddinfo.f_ino && dinfo.f_dev == ddinfo.f_dev) X full = TRUE; X X if (dinfo.f_dev != ddinfo.f_dev) X full = TRUE; X if (full && !dump_partial && !havepat) { X gp->gflags |= GF_DUMPTYPE; X gp->dumptype = DT_FULL; X } else { X gp->gflags |= GF_DUMPTYPE; X gp->dumptype = DT_PARTIAL; X } X} X XLOCAL void Xinit_ddate(name) X char *name; X{ X FINFO ddinfo; X X if (!_getinfo(name, &ddinfo)) X comerr("Cannot stat '%s'.\n", name); X X ddate.tv_sec = ddinfo.f_mtime; X ddate.tv_nsec = ddinfo.f_mnsec; X} X XEXPORT void Xcopy_create(ac, av) X int ac; X char *const *av; X{ X int oac = ac; X char *const *oav = av; X int lac = ac; X#ifdef __needed__ X char *const *lav = av; X#endif X X verbose = 0; /* Verbose not at create side */ X interactive = FALSE; /* Interactive not at create side */ X X if (!tflag) { X /* X * Cut off beginning at last file type arg. X */ X for (; ; --ac, av++) { X if (getlfiles(&ac, &av, &gaprops, opts) == 0) X break; X lac = ac; X#ifdef __needed__ X lav = av; X#endif X } X ac = oac-lac; X av = oav; X } X X star_create(ac, av); X /* X * XXX Fehlerzusammenfassung fuer die -c reate Seite? X */ X} X XLOCAL int Xgetfilecount(ac, av, fmt) X int ac; X char *const *av; X const char *fmt; X{ X int files = 0; X X for (; ; --ac, av++) { X if (getlfiles(&ac, &av, &gaprops, fmt) == 0) X break; X files++; X } X return (files); X} X XLOCAL void Xgetdir(acp, avp, dirp) X int *acp; X char *const **avp; X const char **dirp; X{ X int len = strlen(opts); X char *dir = NULL; X X if (iftype == I_CPIO || iftype == I_PAX) X return; X /* X * Skip all other flags. X * Note that we need to patch away "...,?" at the end of the X * option string so this will not interfere with a -C dir X * option in the command line. X */ X if (opts[len-1] == '?' && opts[len-2] == ',') X opts[len-2] = '\0'; X getlfiles(acp, avp, &gaprops, &opts[3]); X X if (debug) /* temporary */ X errmsgno(EX_BAD, "Flag/File: '%s'.\n", (*avp)[0]); X Xagain: X /* X * Get next '-C dir' option X */ X if (getlargs(acp, avp, &gaprops, "C*", &dir) < 0) { X int cac = *acp; X /* X * Skip all other flags that are known to star. X */ X if (getlfiles(acp, avp, &gaprops, &opts[3]) < 0) { X /* X * If we did find other legal flags, try again. X */ X if (cac > *acp) X goto again; X X errmsgno(EX_BAD, "Badly placed Option: %s.\n", X (*avp)[0]); X if ((*avp)[1] != NULL) X errmsgno(EX_BAD, "Next arg is '%s'.\n", X (*avp)[1]); X susage(EX_BAD); X } X } X if (opts[len-2] == '\0') X opts[len-2] = ','; X if (dir) X *dirp = dir; X if (debug) /* temporary */ X errmsgno(EX_BAD, "Dirp: '%s' Dir: %s.\n", *dirp, dir); X} X XLOCAL void Xopenlist() X{ X if (streql(listfile, "-")) { X check_stdin("list="); X listf = stdin; X listfile = "stdin"; X } else if ((listf = lfilemopen(listfile, "r", S_IRWALL)) == (FILE *)NULL) X comerr("Cannot open '%s'.\n", listfile); X} X XLOCAL void Xcheck_stdin(name) X char *name; X{ X if (did_stdin) { X comerrno(EX_BAD, X "Did already use stdin, cannot use stdin for '%s' option.\n", X name); X } X did_stdin = TRUE; X} X X#ifndef NO_STAR_MAIN X/* X * Short usage X */ XLOCAL void Xsusage(ret) X int ret; X{ X#ifdef STAR_FAT X switch (ptype) { X X case P_SUNTAR: X suntar_susage(ret); exit(ret); X case P_GNUTAR: X gnutar_susage(ret); exit(ret); X case P_PAX: X pax_susage(ret); exit(ret); X case P_CPIO: X cpio_susage(ret); exit(ret); X } X#endif X#ifdef USE_FIND X error("Usage:\t%s cmd [options] [-find] file1 ... filen [find expression]\n", get_progname()); X#else X error("Usage:\t%s cmd [options] file1 ... filen\n", get_progname()); X#endif X error("\t%s cli=name ...\n", get_progname()); X error("\nUse\t%s -help\n", get_progname()); X error("and\t%s -xhelp\n", get_progname()); X error("to get a list of valid cmds and options.\n"); X error("\nUse\t%s H=help\n", get_progname()); X error("to get a list of valid archive header formats.\n"); X error("\nUse\t%s diffopts=help\n", get_progname()); X error("to get a list of valid diff options.\n"); X exit(ret); X /* NOTREACHED */ X} X XLOCAL void Xusage(ret) X int ret; X{ X#ifdef STAR_FAT X switch (ptype) { X X case P_SUNTAR: X suntar_usage(ret); exit(ret); X case P_GNUTAR: X gnutar_usage(ret); exit(ret); X case P_PAX: X pax_usage(ret); exit(ret); X case P_CPIO: X cpio_usage(ret); exit(ret); X } X#endif X#ifdef USE_FIND X error("Usage:\t%s cmd [options] [-find] file1 ... filen [find expression]\n", get_progname()); X#else X error("Usage:\t%s cmd [options] file1 ... filen\n", get_progname()); X#endif X error("\t%s cli=name ...\n", get_progname()); X error("Cmd:\n"); X error("\t-c/-u/-r\tcreate/update/replace archive with named files to tape\n"); X error("\t-x/-t/-n\textract/list/trace named files from tape\n"); X error("\t-copy\t\tcopy named files to destination directory\n"); X error("\t-diff\t\tdiff archive against file system (see -xhelp)\n"); X error("Options:\n"); X error("\t-help\t\tprint this help\n"); X error("\t-xhelp\t\tprint extended help\n"); X error("\t-version\tprint version information and exit\n"); X error("\t-xcopy\t\talias for -copy -sparse -acl\n"); X error("\tblocks=#,b=#\tset blocking factor to #x512 Bytes (default 20)\n"); X error("\tfile=nm,f=nm\tuse 'nm' as tape instead of stdin/stdout\n"); X error("\t-T\t\tuse $TAPE as tape instead of stdin/stdout\n"); X error("\t-[0-7]\t\tSelect an alternative tape drive\n"); X#ifdef FIFO X error("\t-fifo/-no-fifo\tuse/don't use a fifo to optimize data flow from/to tape\n"); X#if defined(USE_MMAP) && defined(USE_USGSHM) X error("\t-shm\t\tuse SysV shared memory for fifo\n"); X#endif X#endif X error("\t-v\t\tincrement verbose level\n"); X error("\t-block-number\tprint the block numbers where the TAR headers start\n"); X error("\t-tpath\t\tuse with -t, -cv or -diff to list path names only\n"); X error("\tH=header\tgenerate 'header' type archive (see H=help)\n"); X error("\tartype=header\tgenerate 'header' type archive (see artype=help)\n"); X error("\t-print-artype\tcheck and print archive and compression type on one line and exit.\n"); X error("\tC=dir\t\tperform a chdir to 'dir' before storing/extracting next file\n"); X error("\t-bsdchdir\tdo BSD style C= (only related to the next file type arg)\n"); X#ifdef USE_FIND X error("\t-find\t\tOption separator: Use find command line to the right.\n"); X#endif X error("\t-Z\t\tpipe input/output through compress, does not work on tapes\n"); X error("\t-z\t\tpipe input/output through gzip, does not work on tapes\n"); X error("\t-j,-bz\t\tpipe input/output through bzip2, does not work on tapes\n"); X error("\t-lzo\t\tpipe input/output through lzop, does not work on tapes\n"); X error("\t-7z\t\tpipe input/output through p7zip, does not work on tapes\n"); X error("\t-xz\t\tpipe input/output through xz, does not work on tapes\n"); X error("\t-lzip\t\tpipe input/output through lzip, does not work on tapes\n"); X error("\t-zstd\t\tpipe input/output through zstd, does not work on tapes\n"); X error("\t-lzma\t\tpipe input/output through lzma, does not work on tapes\n"); X error("\t-freeze\t\tpipe input/output through freeze, does not work on tapes\n"); X error("\tcompress-program=name\tpipe input/output through program 'name', does not work on tapes\n"); X error("\t-B\t\tperform multiple reads (needed on pipes)\n"); X error("\t-i\t\tignore checksum errors\n"); X error("\t-d\t\tdo not store/create directories\n"); X error("\t-m\t\tdo not restore access and modification time\n"); X error("\t-o,-nochown\tdo not restore owner and group\n"); X error("\t-pax-o string\tPAX options (none specified with SUSv2 / UNIX-98)\n"); X error("\t-pax-p string\tuse PAX like privileges set up\n"); X error("\t-a,-atime\treset access time after storing file\n"); X error("\t-p\t\trestore file permissions\n"); X error("\t-no-p\t\tdo not restore file permissions\n"); X error("\t-l\t\tdo not print a message if not all links are dumped\n"); X error("\t-h,-L\t\tfollow symbolic links as if they were files\n"); X error("\t-pax-L\t\tfollow symbolic links as if they were files (PAX style)\n"); X error("\t-pax-H\t\tfollow symbolic links from cmdline as if they were files (PAX style)\n"); X error("\t-D\t\tdo not descend directories\n"); X error("\t-M,-xdev\tdo not descend mounting points\n"); X error("\t-w\t\tdo interactive creation/extraction/renaming\n"); X error("\t-pax-i\t\tdo interactive creation/extraction/renaming (PAX style)\n"); X error("\t-O\t\tbe compatible to old tar (except for checksum bug)\n"); X error("\t-P\t\tlast record may be partial (useful on cartridge tapes)\n"); X error("\t-S\t\tdo not store/create special files\n"); X error("\t-F,-FF,-FFF,...\tdo not store/create SCCS/RCS, core and object files\n"); X error("\t-U\t\trestore files unconditionally\n"); X error("\t-uncond-rename\twith interactive restore unconditionally ask for name\n"); X exit(ret); X /* NOTREACHED */ X} X XLOCAL void Xxusage(ret) X int ret; X{ X#ifdef STAR_FAT X switch (ptype) { X X case P_SUNTAR: X suntar_xusage(ret); exit(ret); X case P_GNUTAR: X gnutar_xusage(ret); exit(ret); X case P_PAX: X pax_xusage(ret); exit(ret); X case P_CPIO: X cpio_xusage(ret); exit(ret); X } X#endif X#ifdef USE_FIND X error("Usage:\t%s cmd [options] [-find] file1 ... filen [find expression]\n", get_progname()); X#else X error("Usage:\t%s cmd [options] file1 ... filen\n", get_progname()); X#endif X error("\t%s cli=name ...\n", get_progname()); X error("Extended options:\n"); X error("\tdiffopts=optlst\tcomma separated list of diffopts (see diffopts=help)\n"); X error("\t-debug\t\tprint additional debug messages\n"); X error("\txdebug=#,xd=#\tset extended debug level\n"); X error("\t-pax-ls\t\tprint a PAX type file listing\n"); X error("\t-silent\t\tno not print informational messages\n"); X error("\t-lowmem\t\ttry to use less memory for operation\n"); X error("\t-not,-V\t\tuse those files which do not match pat= pattern\n"); X error("\t-pax-match\tuse PAX like pattern matching\n"); X error("\t-pax-n\t\tonly one match per pattern allowed\n"); X error("\t-notarg,-pax-c\tuse those files which do not match file type pattern\n"); X error("\tVOLHDR=name\tuse name to generate a volume header\n"); X error("\t-xdir\t\textract dir even if the current is never\n"); X error("\t-xdot\t\textract first '.' or './' dir even if the current is never\n"); X error("\t-dirmode\twrite directories after the files they contain\n"); X error("\t-link-dirs\tlook for hard linked directories in create mode\n"); X error("\t-dump\t\tarchive more ino metadata (needed for incremental dumps)\n"); X error("\t-restore\trestore incremental dumps\n"); X error("\t-partial\tpermit to restore partial incremental dumps\n"); X error("\t-force-restore\tforce to restore partial incremental dumps\n"); X error("\t-no-xheader\tdo not read or write extended headers regardless of format\n"); X error("\t-meta\t\tuse inode metadata only (omit file content)\n"); X error("\t-xmeta\t\textract meta files\n"); X error("\t-dumpmeta\tuse inode metadata in dump mode if only ctime is newer\n"); X error("\t-keep-old-files,-k\tkeep existing files\n"); X error("\t-refresh-old-files\trefresh existing files, don't create new files\n"); X error("\t-refresh\trefresh existing files, don't create new files\n"); X error("\t-/\t\tdon't strip leading '/'s from file names\n"); X error("\t-..\t\tdon't skip filenames that contain '..' in non-interactive extract\n"); X error("\t-secure-links\tdon't extract links that start with '/' or contain '..' (default)\n"); X error("\t-no-secure-links\textract links that start with '/' or contain '..'\n"); X error("\t-no-dirslash\tdon't append a slash to directory names\n"); X error("\tlist=name\tread filenames from named file\n"); X error("\t-X name\t\texclude filenames from named file\n"); X error("\t-exclude-from name\texclude filenames from named file\n"); X error("\tpkglist=name\tread filenames from named file (unstable interface for sps)\n"); X error("\t-read0\t\tread null terminated filenames with list=\n"); X error("\t-data-change-warn\ttreat data/size changes in create more as warning only\n"); X error("\t-e\t\tabort on all error conditions undefined by errctl=\n"); X error("\terrctl=name\tread error contrl definitions from named file\n"); X error("\t-dodesc\t\tdo descend directories found in a list= file\n"); X error("\tpattern=p,pat=p\tset matching pattern\n"); X error("\t-match-tree\tdo not scan the content of non matching dirs in create mode\n"); X error("\ts=replstr\tApply ed like pattern substitution -s /old/new/gp on filenames\n"); X error("\tlevel=dumplevel\tset current incremental dump level\n"); X error("\t-cumulative\tmake a cumulative incremental dump (relative to same level)\n"); X error("\ttardumps=name\tset file name for tar dump dates, default is %s\n", dumpdates); X error("\t-wtardumps\tupdate file for tar dump dates if in dump mode\n"); X error("\tdumpdate=name\tuse timestamp from name instead of current time for %s\n", dumpdates); X error("\tfs-name=name\tuse name instead of mount point for %s\n", dumpdates); X error("\tmaxsize=#\tdo not store file if bigger than # (default mult is kB)\n"); X error("\tnewer=name\tstore only files which are newer than 'name'\n"); X error("\t-multivol\tread/write/list a multi volume archive\n"); X error("\tnew-volume-script=script\tcall 'script' at end of each volume\n"); X error("\t-ctime\t\tuse ctime for newer= option\n"); X error("\t-nodump\t\tdo not dump files that have the nodump flag set\n"); X error("\t-acl\t\thandle access control lists\n"); X error("\t-xattr\t\thandle extended file attributes\n"); X error("\t-xattr-linux\t\thandle extended file attributes (Linux variant)\n"); X error("\t-xfflags\thandle extended file flags\n"); X error("\t-prinodes\tif archive contains inode number, print them in list mode\n"); X error("\tbs=#\t\tset (output) block size to #\n"); X#ifdef FIFO X error("\tfs=#\t\tset fifo size to #\n"); X#endif X error("\ttsize=#\t\tset tape volume size to # (default multiplier is 512)\n"); X error("\t-qic24\t\tset tape volume size to %d kBytes\n", X TSIZE(QIC_24_TSIZE)/1024); X error("\t-qic120\t\tset tape volume size to %d kBytes\n", X TSIZE(QIC_120_TSIZE)/1024); X error("\t-qic150\t\tset tape volume size to %d kBytes\n", X TSIZE(QIC_150_TSIZE)/1024); X error("\t-qic250\t\tset tape volume size to %d kBytes\n", X TSIZE(QIC_250_TSIZE)/1024); X error("\t-qic525\t\tset tape volume size to %d kBytes\n", X TSIZE(QIC_525_TSIZE)/1024); X error("\t-no-fsync\tdo not call fsync() for each extracted file (may be dangerous)\n"); X error("\t-nowarn\t\tdo not print warning messages\n"); X error("\t-time\t\tprint timing info\n"); X error("\t-no-statistics\tdo not print statistics\n"); X error("\t-cpio-statistics\tprint cpio style statistics\n"); X#ifdef FIFO X error("\t-fifostats\tprint fifo statistics\n"); X#endif X error("\t-numeric\tdon't use user/group name from tape\n"); X error("\t-newest\t\tfind newest file on tape\n"); X error("\t-newest-file\tfind newest regular file on tape\n"); X error("\t-hpdev\t\tuse HP's non POSIX compliant method to store dev numbers\n"); X error("\t-modebits\tinclude all 16 bits from stat.st_mode, this violates POSIX-1003.1\n"); X error("\t-copylinks\tCopy hard and symlinks rather than linking\n"); X error("\t-copyhardlinks\tCopy hardlink source files rather than linking\n"); X error("\t-copysymlinks\tCopy symlink source files rather than linking\n"); X error("\t-copydlinks\tCopy the content of linked dirs\n"); X error("\t-hardlinks\tExtract symlinks as hardlinks\n"); X error("\t-link-data\tInclude data for hard linked files\n"); X error("\t-symlinks\tExtract hardlinks as symlinks\n"); X error("\t-signed-checksum\tuse signed chars to calculate checksum\n"); X error("\trmt=path\tSpecify remote path to remote tape server program\n"); X error("\trsh=path\tSpecify path to remote login program\n"); X error("\t-sparse\t\thandle file with holes effectively on store/create\n"); X error("\t-force-hole\ttry to extract all files with holes\n"); X error("\t-to-stdout\textract files to stdout\n"); X error("\t-wready\t\twait for tape drive to become ready\n"); X error("\t-force-remove\tforce to remove non writable files on extraction\n"); X error("\t-ask-remove\task to remove non writable files on extraction\n"); X error("\t-remove-first\tremove files before extraction\n"); X error("\t-remove-recursive\tremove files recursive\n"); X error("\t-keep-nonempty-dirs\tdo not complain about non-empty dirs\n"); X error("\t-install\tcarefully replace old files with -x, similar to install(1)\n"); X error("\tdir-owner=user\tIntermediate created directories will be owned by 'user'.\n"); X error("\tdir-group=user\tIntermediate created directories will be owned by 'group'.\n"); X error("\tumask=mask\tSet star's umask to 'mask'.\n"); X error("\t-onull,-nullout\tsimulate creating an achive to compute the size\n"); X exit(ret); X /* NOTREACHED */ X} X#endif /* NO_STAR_MAIN */ X XLOCAL void Xdusage(ret) X int ret; X{ X error("Diff options:\n"); X error("\tnot\t\tif this option is present, exclude listed options\n"); X error("\t!\t\tif this option is present, exclude listed options\n"); X error("\tall\t\tcompare everything\n"); X error("\tperm\t\tcompare file permissions\n"); X error("\tmode\t\tcompare file permissions\n"); X error("\tsymperm\t\tcompare symlink permissions\n"); X error("\ttype\t\tcompare file type\n"); X error("\tnlink\t\tcompare linkcount (star dump mode only)\n"); X error("\tuid\t\tcompare owner of file\n"); X error("\tgid\t\tcompare group of file\n"); X error("\tuname\t\tcompare name of owner of file\n"); X error("\tgname\t\tcompare name of group of file\n"); X error("\tid\t\tcompare owner, group, ownername and groupname of file\n"); X error("\tsize\t\tcompare file size\n"); X error("\tdata\t\tcompare content of file\n"); X error("\tcont\t\tcompare content of file\n"); X error("\trdev\t\tcompare rdev of device node\n"); X error("\thardlink\tcompare target of hardlink\n"); X error("\tsymlink\t\tcompare target of symlink\n"); X error("\tsympath\t\tcompare target pathname of symlink\n"); X error("\tsparse\t\tcompare if both files are sparse or not\n"); X error("\tatime\t\tcompare access time of file (only star)\n"); X error("\tmtime\t\tcompare modification time of file\n"); X error("\tctime\t\tcompare creation time of file (only star)\n"); X error("\ttimes\t\tcompare all times of file\n"); X error("\tlmtime\t\tcompare modification time of symlinks\n"); X error("\txtimes\t\tcompare all times and lmtime\n"); X error("\tnsecs\t\tcompare nanoseconds in times\n"); X error("\tdir\t\tcompare directory content (star dump mode only)\n"); X#ifdef USE_ACL X error("\tacl\t\tcompare access control lists (specify -acl also)\n"); X#endif X#ifdef USE_XATTR X error("\txattr\t\tcompare extended attributes (specify -xattr also)\n"); X#endif X#ifdef USE_FFLAGS X error("\tfflags\t\tcompare extended file flags (specify -xfflags also)\n"); X#endif X error("\n"); X error("Default is to compare everything except atime.\n"); X exit(ret); X /* NOTREACHED */ X} X XLOCAL void Xhusage(ret) X int ret; X{ X error("Header types (default marked with '*'):\n"); X hdr_usage(); X exit(ret); X /* NOTREACHED */ X} X X#ifndef NO_STAR_MAIN XLOCAL void Xgargs(ac, av) X int ac; X char *const *av; X{ X int files = 0; X int minfiles = 1; X BOOL help = FALSE; X BOOL xhelp = FALSE; X BOOL prvers = FALSE; X BOOL xcopy = FALSE; X BOOL oldtar = FALSE; X BOOL no_fifo = FALSE; X BOOL usetape = FALSE; X BOOL dodesc = FALSE; X BOOL qic24 = FALSE; X BOOL qic120 = FALSE; X BOOL qic150 = FALSE; X BOOL qic250 = FALSE; X BOOL qic525 = FALSE; X BOOL dchangeflag = FALSE; X char *pkglistfile = NULL; X char *diruid = NULL; X char *dirgid = NULL; X char *u_mask = NULL; X char *paxopts = NULL; X const char *p; X Llong llbs = 0; Xsigned char archive = -1; /* On IRIX, we have unsigned chars by default */ XBOOL Ointeractive = FALSE; X X/* BEGIN CSTYLED */ X/*char _opts[] = "C*,find~,help,xhelp,version,debug,xdebug#,xd#,bsdchdir,pax-ls,level#,tardumps*,wtardumps,time,no_statistics,no-statistics,cpio-statistics,fifostats,numeric,v+,block-number,tpath,c,u,r,x,t,copy,xcopy,n,diff,diffopts&,H&,artype&,print-artype,fs-name*,force_hole,force-hole,sparse,to_stdout,to-stdout,wready,force_remove,force-remove,ask_remove,ask-remove,remove_first,remove-first,remove_recursive,remove-recursive,keep-nonempty-dirs,install,nullout,onull,fifo,no_fifo,no-fifo,shm,fs&,VOLHDR*,list*,pkglist*,multivol,new-volume-script*,force-local,restore,partial,force-restore,freeze,file&,f&,T,Z,z,bz,j,lzo,7z,xz,lzip,zstd,lzma,compress-program*,rmt*,rsh*,bs&,blocks&,b&,B,pattern&,pat&,i,d,m,o,nochown,pax-o*,pax-p&,a,atime,p,no-p,dirmode,l,h,L,pax-L~,pax-H~,pax-P~,D,dodesc,M,xdev,w,pax-i,I,X&,exclude-from&,O,signed_checksum,signed-checksum,P,S,F+,U,uncond-rename,xdir,xdot,k,keep_old_files,keep-old-files,refresh_old_files,refresh-old-files,refresh,/,..,secure-links,no-secure-links%0,no-dirslash,not,V,match-tree,pax-match,pax-n,pax-c,notarg,maxsize&,newer*,ctime,nodump,tsize&,qic24,qic120,qic150,qic250,qic525,nowarn,newest_file,newest-file,newest,hpdev,modebits,copylinks,copyhardlinks,copysymlinks,copydlinks,hardlinks,symlinks,link-data,acl,xattr,xattr-linux,xfflags,link-dirs,dumpdate*,dump,cumulative,dump-cumulative,meta,dumpmeta,xmeta,silent,lowmem,no-xheader,no-fsync%1,do-fsync%0,read0,errctl&,e,data-change-warn,prinodes,dir-owner*,dir-group*,umask*,s&,?";*/ X/* END CSTYLED */ X X getarginit(&gaprops, GAF_DEFAULT); /* Set default behavior */ X#ifdef STAR_FAT X switch (ptype) { X X case P_SUNTAR: X suntar_gargs(ac, av); X return; X case P_GNUTAR: X gnutar_gargs(ac, av); X return; X case P_PAX: X pax_gargs(ac, av); X return; X case P_CPIO: X cpio_gargs(ac, av); X return; X } X#endif X X p = filename(av[0]); X if (streql(p, "ustar")) { X /* X * If we are called as "ustar" we are as POSIX-1003.1-1988 X * compliant as possible. There are no enhancements at all. X */ X hdrtype = H_USTAR; X } else if (streql(p, "tar")) { X /* X * If we are called as "tar" we are mostly POSIX compliant X * and use POSIX-1003.1-2001 extensions. The differences of the X * base format compared to POSIX-1003.1-1988 can only be X * regocnised by star. Even the checsum bug of the "pax" X * reference implementation is not hit by the fingerprint X * used to allow star to discriminate XUSTAR from USTAR. X */ X hdrtype = H_XUSTAR; X } X /* X * Current default archive format in all other cases is XSTAR (see X * above). This will not change until 2004 (then the new XUSTAR format X * is recognised by star for at least 5 years and we may asume that X * all star installations will properly handle it. X * XSTAR is USTAR with extensions similar to GNU tar. X */ X X iftype = I_TAR; /* command line interface */ X ptype = P_STAR; /* program interface type */ X X if (pname) { /* cli=xxx seen as argv[1] */ X --ac, av++; X } X --ac, ++av; X files = getfilecount(ac, av, opts); X if (getlallargs(&ac, &av, &gaprops, opts, X &dir_flags, X getfind, NULL, X &help, &xhelp, &prvers, &debug, &xdebug, &xdebug, X &bsdchdir, &paxls, X &dumplevel, &dumpdates, &wtardumps, X &showtime, &no_stats, &no_stats, &cpio_stats, X &do_fifostats, X &numeric, &verbose, &prblockno, &tpath, X#ifndef __old__lint X &cflag, X &uflag, X &rflag, X &xflag, X &tflag, X ©flag, &xcopy, X &nflag, X &diff_flag, add_diffopt, &diffopts, X gethdr, &chdrtype, gethdr, &chdrtype, X &print_artype, X &fs_name, X &force_hole, &force_hole, &sparse, &to_stdout, &to_stdout, &wready, X &force_remove, &force_remove, &ask_remove, &ask_remove, X &remove_first, &remove_first, &remove_recursive, &remove_recursive, X &keep_nonempty_dirs, &do_install, X &nullout, &nullout, X &use_fifo, &no_fifo, &no_fifo, &shmflag, X getenum, &fs, X &volhdr, X &listfile, &pkglistfile, X &multivol, &newvol_script, X &force_noremote, X &dorestore, &dopartial, &forcerestore, X &freezeflag, X /* X * All options starting with -f need to appear X * before this line. X */ X addtarfile, NULL, X addtarfile, NULL, X &usetape, X &Zflag, &zflag, &bzflag, &bzflag, &lzoflag, X &p7zflag, &xzflag, &lzipflag, &zstdflag, &lzmaflag, X &compress_prg, X &rmt, &rsh, X getenum, &bs, X getbnum, &llbs, X getbnum, &llbs, X &multblk, X addpattern, NULL, X addpattern, NULL, X &ignoreerr, X &nodir, X &nomtime, &nochown, &nochown, X &paxopts, X getpaxpriv, NULL, X &acctime, &acctime, X &pflag, &nopflag, &dirmode, X &nolinkerr, X &follow, &follow, X#ifdef USE_FIND X getpaxL, &walkflags, X getpaxH, &walkflags, X getpaxP, &walkflags, X#else X getpaxL, NULL, X getpaxH, NULL, X getpaxP, NULL, X#endif X &nodesc, X &dodesc, X &nomount, &nomount, X &interactive, &paxinteract, X &Ointeractive, X getexclude, NULL, X getexclude, NULL, X &oldtar, &signedcksum, &signedcksum, X &partial, X &nospec, &Fflag, X &uncond, &uncond_rename, X &xdir, &xdot, X &keep_old, &keep_old, &keep_old, X &refresh_old, &refresh_old, &refresh_old, X &abs_path, &allow_dotdot, X &secure_links, &secure_links, X &no_dirslash, X ¬pat, ¬pat, &match_tree, X &paxmatch, &paxnflag, ¬arg, ¬arg, X getknum, &maxsize, X &stampfile, X &Ctime, X &nodump, X getbnum, &tsize, X &qic24, X &qic120, X &qic150, X &qic250, X &qic525, X &nowarn, X#endif /* __old__lint */ X &listnewf, &listnewf, X &listnew, X &hpdev, &modebits, X ©links, ©hardlinks, ©symlinks, X ©dlinks, X &hardlinks, &symlinks, &linkdata, X &doacl, &doxattr, &dolxattr, &dofflags, X &link_dirs, X &dd_name, X &dodump, &dump_cumulative, &dump_cumulative, X &dometa, &dumpmeta, &xmeta, X &silent, &lowmem, &no_xheader, X &no_fsync, &no_fsync, X &readnull, X errconfig, NULL, X &errflag, &dchangeflag, X &prinodes, X &diruid, &dirgid, &u_mask, X parsesubst, &do_subst, &archive) < 0) { X errmsgno(EX_BAD, "Bad Option: %s.\n", av[0]); X susage(EX_BAD); X } X X if (archive != -1 && !(archive >= '0' && archive <= '7')) { X errmsgno(EX_BAD, "Bad Option: -%c.\n", archive); X susage(EX_BAD); X } X star_helpvers("star", help, xhelp, prvers); X X if (Ointeractive) { X comerrno(EX_BAD, "Option -I is obsolete and will get a different meaning in next release, use -w instead.\n"); X } X if (xcopy) { X copyflag = TRUE; X sparse = TRUE; X doacl = TRUE; X xdot = TRUE; X } X if (tsize == 0) { X if (qic24) tsize = QIC_24_TSIZE; X if (qic120) tsize = QIC_120_TSIZE; X if (qic150) tsize = QIC_150_TSIZE; X if (qic250) tsize = QIC_250_TSIZE; X if (qic525) tsize = QIC_525_TSIZE; X } X if (pkglistfile != NULL) { X listfile = pkglistfile; X pkglist = TRUE; X } X if (u_mask) { X long l; X X if (*astolb(u_mask, &l, 8)) X comerrno(EX_BAD, "Bad umask '%s'.\n", u_mask); X umask((mode_t)l); X } X if (diruid) { X Llong ll; X uid_t uid; X X if (!ic_uidname(diruid, strlen(diruid), &uid)) { X if (*astollb(diruid, &ll, 10)) X comerrno(EX_BAD, "Bad uid '%s'.\n", diruid); X dir_uid = ll; X } else { X dir_uid = uid; X } X } X if (dirgid) { X Llong ll; X gid_t gid; X X if (!ic_gidname(dirgid, strlen(dirgid), &gid)) { X if (*astollb(dirgid, &ll, 10)) X comerrno(EX_BAD, "Bad gid '%s'.\n", diruid); X dir_gid = ll; X } else { X dir_gid = gid; X } X } X X if (dchangeflag) X errconfig("WARN|GROW|SHRINK *"); X X star_checkopts(oldtar, dodesc, usetape, archive, no_fifo, X paxopts, llbs); X#ifdef USE_FIND X if (dofind && find_ac > 0) { X int cac = find_ac; X char *const * cav = find_av; X finda_t fa; X X if (copyflag) X cac--; X find_firstprim(&cac, &cav); X find_pac = cac; X find_pav = cav; X files = find_ac - cac; X if (!copyflag && !cflag && files > 0) X comerrno(EX_BAD, "Path arguments not yet supported in extract mode.\n"); X X if (cac > 0) { X BOOL did_stdout = FALSE; X int i; X X now = time(0); X now = now +60; X find_argsinit(&fa); X fa.walkflags = walkflags; X fa.Argc = cac; X fa.Argv = (char **)cav; X find_node = find_parse(&fa); X if (fa.primtype == FIND_ERRARG) X comexit(fa.error); X if (fa.primtype != FIND_ENDARGS) X comerrno(EX_BAD, "Incomplete expression.\n"); X plusp = fa.plusp; X find_patlen = fa.patlen; X walkflags = fa.walkflags; X maxdepth = fa.maxdepth; X mindepth = fa.mindepth; X X for (i = 0; i < ntarfiles; i++) { X if (tarfiles[i][0] == '-' && tarfiles[i][1] == '\0') X did_stdout = TRUE; X } X if (ntarfiles == 1 && nullout) X did_stdout = FALSE; X X if (find_node && (did_stdin || did_stdout)) { X if (find_pname(find_node, "-exec") || X find_pname(find_node, "-execdir") || X find_pname(find_node, "-exec+") || X find_pname(find_node, "-execdir+") || X find_pname(find_node, "-ok") || X find_pname(find_node, "-okdir")) X comerrno(EX_BAD, X "Cannot -exec with f=-.\n"); X if (cflag && did_stdout && X (find_pname(find_node, "-print") || X find_pname(find_node, "-print0") || X find_pname(find_node, "-printnnl") || X find_pname(find_node, "-ls"))) X comerrno(EX_BAD, X "Cannot -print/-ls with f=-.\n"); X } X } X } X#endif X star_nfiles(files, minfiles); X} X#endif /* NO_STAR_MAIN */ X XLOCAL void Xstar_mkvers() X{ X char buf[512]; Xextern char strvers[]; Xextern char dvers[]; X X if (vers != NULL) X return; X X js_snprintf(buf, sizeof (buf), X "%s %s (%s-%s-%s) %s", "star", strvers, X HOST_CPU, HOST_VENDOR, HOST_OS, X dvers); X X vers = ___savestr(buf); X} X XLOCAL void Xstar_helpvers(name, help, xhelp, prvers) X char *name; X BOOL help; X BOOL xhelp; X BOOL prvers; X{ X if (help) X usage(0); X if (xhelp) X xusage(0); X star_mkvers(); X if (prvers) { X printf("%s: %s\n\n", name, vers); X gtprintf("Options:"); X#ifdef USE_ACL X opt_acl(); X#endif X#ifdef USE_FIND X printf(" find"); X#endif X#ifdef USE_FFLAGS X opt_fflags(); X#endif X#ifdef USE_REMOTE X opt_remote(); X#endif X#ifdef USE_XATTR X opt_xattr(); X#endif X#ifdef USE_SELINUX X opt_selinux(); X#endif X gtprintf("\n\n"); X gtprintf("Copyright (C) 1985, 88-90, 92-96, 98, 99, 2000-2019 Jörg Schilling\n"); X gtprintf("This is free software; see the source for copying conditions. There is NO\n"); X gtprintf("warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"); X exit(0); X } X} X XLOCAL void Xstar_checkopts(oldtar, dodesc, usetape, archive, no_fifo, paxopts, llbs) X BOOL oldtar; /* -O oldtar option */ X BOOL dodesc; /* -dodesc descend dirs from listfile */ X BOOL usetape; /* -T usetape option */ X int archive; /* -0 .. -9 archive option */ X BOOL no_fifo; /* -no-fifo option */ X const char * paxopts; /* -pax-o / -o option */ X Llong llbs; /* blocks= option */ X{ X int n; X X if (print_artype) { X tflag = TRUE; X no_fifo = TRUE; X } X if ((n = xflag + cflag + uflag + rflag + tflag + copyflag + nflag + diff_flag) > 1) { X if ((n == 2) && copyflag && (tflag || diff_flag)) { X /* X * This is OK: star -copy -t or star -copy -diff X */ X /* EMPTY */ X } else if ((n == 2) && cflag && (tflag || diff_flag)) { X copyflag = TRUE; X cflag = FALSE; X } else { X errmsgno(EX_BAD, X "Too many commands, only one of -x -c -u -r -t -copy -n or -diff is allowed.\n"); X susage(EX_BAD); X } X } X if (!(xflag | cflag | uflag | rflag | tflag | copyflag | nflag | diff_flag)) { X errmsgno(EX_BAD, "Missing command, must specify -x -c -u -r -t -copy -n or -diff.\n"); X susage(EX_BAD); X } X if (uflag || rflag) { X cflag = TRUE; X no_fifo = TRUE; /* Until we are able to reverse the FIFO */ X dump_partial = TRUE; X } X if (nullout && !cflag) { X errmsgno(EX_BAD, "-nullout only makes sense in create mode.\n"); X susage(EX_BAD); X } X if (no_fifo || nullout) X use_fifo = FALSE; X#ifndef FIFO X if (use_fifo) { X errmsgno(EX_BAD, "Fifo not configured in.\n"); X susage(EX_BAD); X } X#endif X X if (ptype == P_SUNTAR) X nolinkerr ^= tcompat; X X noxdir = nodir; X if (xdir) /* Extract all dirs uncond */ X xdot = FALSE; X X if (copylinks) { X copyhardlinks = TRUE; X copysymlinks = TRUE; X } X if (copyflag) { X hdrtype = chdrtype = H_EXUSTAR; X dodump = TRUE; X partial = TRUE; /* Important as we fiddle with FIFO obs */ X binflag = TRUE; X nodir = FALSE; X multivol = FALSE; X linkdata = FALSE; X X if (!tflag && !diff_flag) X xflag = TRUE; X X if (!use_fifo) { X errmsgno(EX_BAD, "Need fifo for -copy mode.\n"); X susage(EX_BAD); X } X } X if (cflag && linkdata && sparse) X linkdata = FALSE; /* XXX Cannot yet do sparse datalinks */ X X if (dumplevel >= 0) { X /* X * This is an articicial limitation, our code supports an X * unlimited number of dump levels. X */ X if (dumplevel > 99) X comerrno(EX_BAD, "Illegal dump level, use 0..99\n"); X dodump = TRUE; X if (!nomount) X comerrno(EX_BAD, "A dump needs the -M/-xdev option.\n"); X } X if (dodump) { X chdrtype = H_EXUSTAR; X if (lowmem) X comerrno(EX_BAD, "Dump mode does not work with -lowmem.\n"); X } X if (dump_cumulative) { X if (dumplevel < 0) X comerrno(EX_BAD, "With -cumulative, level= is needed.\n"); X } X if (maxsize > 0 || Fflag > 0 || nospec || nodump) X dump_partial = TRUE; X X if (dopartial) X dorestore = TRUE; X if (forcerestore) X dorestore = TRUE; X if (dorestore) { X xdir = TRUE; X if (secure_links < 0) X secure_links = FALSE; X if (!uncond) X comerrno(EX_BAD, "A restore needs the -U option.\n"); X if (do_install) X comerrno(EX_BAD, "-install not allowed in restore mode.\n"); X } X if (secure_links < 0) X secure_links = TRUE; X if (oldtar) X chdrtype = H_OTAR; X if (chdrtype != H_UNDEF) { X if (H_TYPE(chdrtype) == H_OTAR) X oldtar = TRUE; /* XXX hack */ X } X /* X * We do not set chdrtype here in case it is H_UNDEF and -r or -u have X * been specified. X */ X if (cflag && (!(rflag || uflag) || chdrtype != H_UNDEF)) { X if (chdrtype != H_UNDEF) X hdrtype = chdrtype; X chdrtype = hdrtype; /* wegen setprops(chdrtype) in main() */ X X /* X * hdrtype und chdrtype X * bei uflag, rflag sowie xflag, tflag, nflag, diff_flag X * in get_tcb vergleichen ! X */ X } X if (no_dirslash && chdrtype == H_OTAR) { X errmsgno(EX_BAD, "-no-dirslash cannot be used with the old tar format\n"); X susage(EX_BAD); X } X if (diff_flag) { X if (diffopts == 0) X diffopts = D_DEFLT; X } else if (diffopts != 0) { X errmsgno(EX_BAD, "diffopts= only makes sense with -diff\n"); X susage(EX_BAD); X } X if (fs == 0L) { X char *ep = getenv("STAR_FIFOSIZE"); X X if (ep) { X if (getnum(ep, &fs) != 1) { X comerrno(EX_BAD, X "Bad fifo size environment '%s'.\n", X ep); X } X } X } X if (llbs != 0 && bs != 0) { X errmsgno(EX_BAD, "Only one of blocks= b= bs=.\n"); X susage(EX_BAD); X } X if (llbs != 0) { X bs = (long)llbs; X if (bs != llbs) { X errmsgno(EX_BAD, "Blocksize used with blocks= or b= too large.\n"); X susage(EX_BAD); X } X } X if (bs % TBLOCK) { X errmsgno(EX_BAD, "Invalid block size %ld.\n", bs); X susage(EX_BAD); X } X if (bs) X nblocks = bs / TBLOCK; X if ((nblocks <= 0) || X ((rflag || uflag) && nblocks < 2)) { X errmsgno(EX_BAD, "Invalid block size %d blocks.\n", nblocks); X susage(EX_BAD); X } X bs = nblocks * TBLOCK; X if (debug) { X errmsgno(EX_BAD, "Block size %d blocks (%ld bytes).\n", nblocks, bs); X } X if (tsize > 0) { X if (tsize % TBLOCK) { X errmsgno(EX_BAD, "Invalid tape size %llu.\n", tsize); X susage(EX_BAD); X } X tsize /= TBLOCK; X } X X if (pkglist) { X dodesc = FALSE; X readnull = FALSE; X if (!cflag) X comerrno(EX_BAD, "pkglist= option only works in create mode.\n"); X } X if (listfile != NULL) X dump_partial = TRUE; X X if (listfile != NULL && !dodesc) X nodesc = TRUE; X if (oldtar) X nospec = TRUE; X if (!tarfiles[0]) { X if (usetape) { X tarfiles[0] = getenv("TAPE"); X } X if ((usetape || archive > 0) && X !tarfiles[0]) { X static char arname[] = "archive0="; X Ullong otsize = tsize; X char *dfltfile = NULL; X X#ifdef DFLT_FILE X#define DFILE DFLT_FILE X#else X#define DFILE NULL X#endif X /* X * If we got a digit option, check for an 'archive#=' X * entry in /etc/default/[s!]tar. If there was no -f X * or digit option, look for 'archive0='. X */ X if (archive < '0' || archive > '9') X archive = '0'; X arname[7] = (char)archive; X if (ptype == P_SUNTAR) X dfltfile = DFILE; X if (!star_darchive(arname, dfltfile)) { X errmsgno(EX_BAD, X "Archive entry %c not found in %s. %s", X archive, X get_stardefaults(DFILE), X "Using stdin/stdout as archive.\n"); X tarfiles[0] = NULL; X tsize = otsize; X } X } X if (!tarfiles[0]) X tarfiles[0] = "-"; X ntarfiles++; X } X if (!cflag && !copyflag) { X for (n = 0; n < ntarfiles; n++) { X if (tarfiles[n][0] == '-' && tarfiles[n][1] == '\0') X check_stdin("-f"); X } X } X if (tsize % nblocks) { X /* X * Silently round down to a multiple of the tape block size. X */ X tsize /= nblocks; X tsize *= nblocks; X } X /* X * XXX This must be rethought with files split by multi volume and X * XXX with with volume headers and continuation headers. X */ X if (tsize > 0 && tsize < 3) { X errmsgno(EX_BAD, "Tape size must be at least 3 blocks.\n"); X susage(EX_BAD); X } X /* X * XXX This is a place that should be checked every time, when X * XXX possible interactivity is modified. X */ X if (interactive || ask_remove || X ((multivol || tsize > 0) && !newvol_script)) { X#ifdef JOS X tty = stderr; X#else X#ifdef HAVE__DEV_TTY X if ((tty = lfilemopen("/dev/tty", "r", S_IRWALL)) == (FILE *)NULL) X comerr("Cannot open '/dev/tty'.\n"); X#else X tty = stderr; X#endif X#endif X } X if (nflag) { X xflag = TRUE; X interactive = TRUE; X if (verbose == 0 && !tpath) X verbose = 1; X } X if (to_stdout) { X force_hole = FALSE; X } X if (keep_old && refresh_old) { X errmsgno(EX_BAD, "Cannot use -keep-old-files and -refresh-old-files together.\n"); X susage(EX_BAD); X } X if ((copylinks + hardlinks + symlinks) > 1) { X errmsgno(EX_BAD, "Only one of -copylinks -hardlinks -symlinks.\n"); X susage(EX_BAD); X } X X if (my_uid == 0 && !nopflag) X pflag = TRUE; X X /* X * -acl includes -p X */ X if (doacl) X pflag = TRUE; X X if (doxattr) { X#ifndef O_XATTR X errmsgno(EX_BAD, X "This platform does not support NFSv4 extended attribute files.\n"); X comerrno(EX_BAD, X "-xattr is reserved for NFSv4 extended attributes, for Linux use -xattr-linux\n"); X#else X comerrno(EX_BAD, X "NFSv4 extended attribute files are not yet supported.\n"); X#endif X } X X if (paxopts) { X if (!ppaxopts(paxopts)) { X errmsgno(EX_BAD, "Unsupported option '%s' for %s.\n", X paxopts, X iftype == I_PAX ? "-o" : "-pax-o"); X susage(EX_BAD); X } X } X X star_defaults(&fs, &no_fsync, NULL); X if (no_fsync < 0) X no_fsync = FALSE; X} X XEXPORT void Xstar_verifyopts() X{ X if (cflag && (props.pr_flags & PR_LINK_DATA) == 0) X linkdata = FALSE; X if (cflag && multivol && (props.pr_flags & PR_MULTIVOL) == 0) { X errmsgno(EX_BAD, X "Multi volume archives are not supported with %s format.\n", X hdr_name(chdrtype)); X susage(EX_BAD); X } X if (cflag && doacl) { X /* X * Check properties for archive format. X */ X if ((props.pr_xhmask & (XF_ACL_ACCESS|XF_ACL_DEFAULT|XF_ACL_ACE)) == 0) { X errmsgno(EX_BAD, X "Archive format '%s' does not support -acl.\n", X hdr_name(chdrtype)); X susage(EX_BAD); X } X } X} X XLOCAL void Xstar_nfiles(files, minfiles) X int files; X int minfiles; X{ X if (cflag || copyflag) { X if (copyflag && !tflag) X minfiles++; X if (listfile) X minfiles--; X if (files < minfiles) { X errmsgno(EX_BAD, "Too few arguments; will not create an empty archive.\n"); X susage(EX_BAD); X } X } X} X X/* ARGSUSED */ XLOCAL int XgetpaxH(arg, valp, pac, pav) X char *arg; X long *valp; X int *pac; X char *const **pav; X{ X#ifdef GETARG_DEBUG X error("paxH\n"); X#endif X paxfollow = FALSE; X paxHflag = TRUE; X#ifdef USE_FIND X *(int *)valp |= WALK_ARGFOLLOW; X#endif X return (1); X} X X/* ARGSUSED */ XLOCAL int XgetpaxL(arg, valp, pac, pav) X char *arg; X long *valp; X int *pac; X char *const **pav; X{ X#ifdef GETARG_DEBUG X error("paxL\n"); X#endif X paxfollow = TRUE; X paxHflag = FALSE; X#ifdef USE_FIND X *(int *)valp |= WALK_ALLFOLLOW; X#endif X return (1); X} X X/* ARGSUSED */ XLOCAL int XgetpaxP(arg, valp, pac, pav) X char *arg; X long *valp; X int *pac; X char *const **pav; X{ X#ifdef GETARG_DEBUG X error("paxP\n"); X#endif X paxfollow = FALSE; X paxHflag = FALSE; X#ifdef USE_FIND X *(int *)valp &= ~(WALK_ARGFOLLOW | WALK_ALLFOLLOW); X#endif X return (1); X} X X/* ARGSUSED */ XLOCAL int Xgetfind(arg, valp, pac, pav) X char *arg; X long *valp; /* Not used until we introduce a ptr to opt struct */ X int *pac; X char *const **pav; X{ X#ifdef USE_FIND X dofind = TRUE; X find_ac = *pac; X find_av = *pav; X find_ac--, find_av++; X return (NOARGS); X#else X return (BADFLAG); X#endif X} X X/* ARGSUSED */ XLOCAL int Xgetpaxpriv(arg, valp) X char *arg; X long *valp; /* Not used until we introduce a ptr to opt struct */ X{ X register char *p = arg; X register char c; X X while ((c = *p++) != '\0') { X switch (c) { X X case 'a': /* do not preserve access time */ X noatime = TRUE; X break; X X case 'e': /* preserve everything */ X pflag = TRUE; X doacl = TRUE; X doxattr = TRUE; X dolxattr = TRUE; X dofflags = TRUE; X noatime = FALSE; X nomtime = FALSE; X nochown = FALSE; X break; X X case 'm': /* do not preserve modification time */ X nomtime = TRUE; X break; X X case 'o': /* preserve userid/grupid & SUID/SGID */ X nochown = FALSE; X break; X X case 'p': /* preserve file mode bits (permissions) */ X pflag = TRUE; X break; X X default: X errmsgno(EX_BAD, X "Bad character '%c' in option '-p %s'.\n", X c, arg); X return (-1); X } X } X return (1); X} X XLOCAL int Xgetlldefault(arg, valp, mult) X char *arg; X Llong *valp; X int mult; X{ X int ret = 1; X int len = strlen(arg); X X if (len > 0) { X len = (Uchar)arg[len-1]; X if (!isdigit(len)) X mult = 1; X } X ret = getllnum(arg, valp); X if (ret == 1) X *valp *= mult; X else X errmsgno(EX_BAD, "Badly formed number '%s'.\n", arg); X return (ret); X} X XEXPORT int Xgetbnum(arg, valp) X char *arg; X Llong *valp; X{ X return (getlldefault(arg, valp, 512)); X} X XEXPORT int Xgetknum(arg, valp) X char *arg; X Llong *valp; X{ X return (getlldefault(arg, valp, 1024)); X} X XLOCAL int Xgetenum(arg, valp) X char *arg; X long *valp; X{ X int ret = getnum(arg, valp); X X if (ret != 1) X errmsgno(EX_BAD, "Badly formed number '%s'.\n", arg); X return (ret); X} X XLOCAL int Xaddtarfile(tarfile) X const char *tarfile; X{ X#ifdef ADDARG_DEBUG X if (debug) X error("Add tar file '%s'.\n", tarfile); X#endif X X if (ntarfiles >= NTARFILE) X comerrno(EX_BAD, "Too many tar files (max is %d).\n", NTARFILE); X X if (ntarfiles > 0 && (streql(tarfile, "-") || streql(tarfiles[0], "-"))) X comerrno(EX_BAD, "Cannot handle multi volume archives from/to stdin/stdout.\n"); X X tarfiles[ntarfiles] = tarfile; X ntarfiles++; X return (TRUE); X} X XLOCAL int Xadd_diffopt(optstr, flagp) X char *optstr; X long *flagp; X{ X char *ep; X char *np; X int optlen; X long optflags = 0; X BOOL not = FALSE; X X while (*optstr) { X if ((ep = strchr(optstr, ',')) != NULL) { X Intptr_t pdiff = ep - optstr; X X optlen = (int)pdiff; X if (optlen != pdiff) /* lint paranoia */ X return (-1); X np = &ep[1]; X } else { X optlen = strlen(optstr); X np = &optstr[optlen]; X } X if (optstr[0] == '!') { X optstr++; X optlen--; X not = TRUE; X } X if (strncmp(optstr, "not", optlen) == 0 || X strncmp(optstr, "!", optlen) == 0) { X not = TRUE; X } else if (strncmp(optstr, "all", optlen) == 0) { X optflags |= D_ALL; X } else if (strncmp(optstr, "perm", optlen) == 0) { X optflags |= D_PERM; X } else if (strncmp(optstr, "mode", optlen) == 0) { X optflags |= D_PERM; X } else if (strncmp(optstr, "symperm", optlen) == 0) { X optflags |= D_SYMPERM; X } else if (strncmp(optstr, "type", optlen) == 0) { X optflags |= D_TYPE; X } else if (strncmp(optstr, "nlink", optlen) == 0) { X optflags |= D_NLINK; X } else if (strncmp(optstr, "uid", optlen) == 0) { X optflags |= D_UID; X } else if (strncmp(optstr, "gid", optlen) == 0) { X optflags |= D_GID; X } else if (strncmp(optstr, "uname", optlen) == 0) { X optflags |= D_UNAME; X } else if (strncmp(optstr, "gname", optlen) == 0) { X optflags |= D_GNAME; X } else if (strncmp(optstr, "id", optlen) == 0) { X optflags |= D_ID; X } else if (strncmp(optstr, "size", optlen) == 0) { X optflags |= D_SIZE; X } else if (strncmp(optstr, "data", optlen) == 0) { X optflags |= D_DATA; X } else if (strncmp(optstr, "cont", optlen) == 0) { X optflags |= D_DATA; X } else if (strncmp(optstr, "rdev", optlen) == 0) { X optflags |= D_RDEV; X } else if (strncmp(optstr, "hardlink", optlen) == 0) { X optflags |= D_HLINK; X } else if (strncmp(optstr, "symlink", optlen) == 0) { X optflags |= D_SLINK; X } else if (strncmp(optstr, "sympath", optlen) == 0) { X optflags |= D_SLPATH; X } else if (strncmp(optstr, "sparse", optlen) == 0) { X optflags |= D_SPARS; X } else if (strncmp(optstr, "atime", optlen) == 0) { X optflags |= D_ATIME; X } else if (strncmp(optstr, "mtime", optlen) == 0) { X optflags |= D_MTIME; X } else if (strncmp(optstr, "ctime", optlen) == 0) { X optflags |= D_CTIME; X } else if (strncmp(optstr, "lmtime", optlen) == 0) { X optflags |= D_LMTIME; X } else if (strncmp(optstr, "times", optlen) == 0) { X optflags |= D_TIMES; X } else if (strncmp(optstr, "xtimes", optlen) == 0) { X optflags |= D_XTIMES; X } else if (strncmp(optstr, "nsecs", optlen) == 0) { X optflags |= D_ANTIME|D_MNTIME|D_CNTIME; X } else if (strncmp(optstr, "dir", optlen) == 0) { X optflags |= D_DIR; X#ifdef USE_ACL X } else if (strncmp(optstr, "acl", optlen) == 0) { X optflags |= D_ACL; X#endif X#ifdef USE_XATTR X } else if (strncmp(optstr, "xattr", optlen) == 0) { X optflags |= D_XATTR; X#endif X#ifdef USE_FFLAGS X } else if (strncmp(optstr, "fflags", optlen) == 0) { X optflags |= D_FFLAGS; X#endif X } else if (strncmp(optstr, "help", optlen) == 0) { X dusage(0); X } else { X error("Illegal diffopt.\n"); X dusage(EX_BAD); X return (-1); X } X optstr = np; X } X if (not) X optflags = ~optflags; X X if ((optflags & D_MTIME) == 0) X optflags &= ~D_LMTIME; X X if ((optflags & D_SLINK) == 0) X optflags &= ~D_SLPATH; X X *flagp = optflags; X X return (TRUE); X} X XLOCAL int Xgethdr(optstr, typep) X char *optstr; X long *typep; X{ X BOOL swapped = FALSE; X long type = H_UNDEF; X X if (*optstr == 'S') { X swapped = TRUE; X optstr++; X } X if (streql(optstr, "help")) { X husage(0); X } else if ((type = hdr_type(optstr)) < 0) { X error("Illegal header type '%s'.\n", optstr); X husage(EX_BAD); X return (-1); X } X if (swapped) X *typep = H_SWAPPED(type); X else X *typep = type; X return (TRUE); X} X X/* ARGSUSED */ XLOCAL int Xgetexclude(arg, valp, pac, pav) X char *arg; X long *valp; X int *pac; X char *const **pav; X{ X FILE *xf; X X if (streql(arg, "-")) { X check_stdin("-X"); X xf = stdin; X } else if ((xf = lfilemopen(arg, "r", S_IRWALL)) == (FILE *)NULL) X comerr("Cannot open '%s'.\n", arg); X hash_xbuild(xf); X fclose(xf); X return (1); X} X X#ifdef USED X/* X * Add archive file. X * May currently not be activated: X * If the option string ends with ",&", the -C option will not work X * anymore. X */ XLOCAL int Xaddfile(optstr, dummy) X char *optstr; X long *dummy; X{ X char *p; X X#ifdef ADDARG_DEBUG X error("got_it: %s\n", optstr); X#endif X X if (!strchr("01234567", optstr[0])) X return (NOTAFILE); /* Tell getargs that this may be a flag */ X X for (p = &optstr[1]; *p; p++) { X if (*p != 'l' && *p != 'm' && *p != 'h') X return (BADFLAG); X } X#ifdef ADDARG_DEBUG X error("is_tape: %s\n", optstr); X#endif X X comerrno(EX_BAD, "Options [0-7][lmh] currently not supported.\n"); X /* X * The tape device should be determined from the defaults file X * in the near future. X * Search for /etc/opt/schily/star, /etc/default/star, /etc/default/tar X */ X X return (1); /* Success */ X} X#endif X XEXPORT void Xset_signal(sig, handler) X int sig; X RETSIGTYPE (*handler) __PR((int)); X{ X#if defined(HAVE_SIGPROCMASK) && defined(SA_RESTART) X struct sigaction sa; X X sigemptyset(&sa.sa_mask); X sa.sa_handler = handler; X sa.sa_flags = SA_RESTART; X (void) sigaction(sig, &sa, (struct sigaction *)0); X#else X#ifdef HAVE_SIGSETMASK X struct sigvec sv; X X sv.sv_mask = 0; X sv.sv_handler = handler; X sv.sv_flags = 0; X (void) sigvec(sig, &sv, (struct sigvec *)0); X#else X (void) signal(sig, handler); X#endif X#endif X} X XLOCAL void Xexsig(sig) X int sig; X{ X (void) signal(sig, SIG_DFL); X kill(getpid(), sig); X} X X/* ARGSUSED */ XLOCAL void Xsighup(sig) X int sig; X{ X#ifdef SIGHUP X set_signal(SIGHUP, sighup); X#endif X prstats(); X intr++; X if (!cflag) X exsig(sig); X} X X/* ARGSUSED */ XLOCAL void Xsigintr(sig) X int sig; X{ X#ifdef SIGINT X set_signal(SIGINT, sigintr); X#endif X prstats(); X intr++; X if (!cflag) X exsig(sig); X} X X/* ARGSUSED */ XLOCAL void Xsigquit(sig) X int sig; X{ X /* X * sig may be either SIGQUIT or SIGINFO (*BSD only). X */ X set_signal(sig, sigquit); X prstats(); X} X XLOCAL void Xgetstamp() X{ X FINFO finfo; X BOOL ofollow = follow; X X follow = TRUE; X if (!_getinfo(stampfile, &finfo)) X comerr("Cannot stat '%s'.\n", stampfile); X follow = ofollow; X X Newer.tv_sec = finfo.f_mtime; X Newer.tv_nsec = finfo.f_mnsec; X} X XLOCAL const char * Xhas_cli(ac, av) X int ac; X char *const *av; X{ X if (ac > 1) { X const char *p = av[1]; X X if (p[0] == 'c' && p[1] == 'l' && p[2] == 'i' && p[3] == '=') X return (&p[4]); X } X return (NULL); X} X XLOCAL struct clis { X char *name; X int type; X} clis[] = { X { "star", P_STAR }, X { "suntar", P_SUNTAR }, X { "tar", P_SUNTAR }, X { "gnutar", P_GNUTAR }, X { "gtar", P_GNUTAR }, X { "pax", P_PAX }, X { "cpio", P_CPIO }, X { NULL, C_NONE }, X}; X XLOCAL int Xget_ptype(p) X const char *p; X{ X struct clis *clp = clis; X X while (clp->name) { X if (streql(clp->name, p)) X return (clp->type); X clp++; X } X X return (C_NONE); X} X XLOCAL void Xset_ptype(pac, pav) X int *pac; X char *const **pav; X{ X int ac = *pac; X char *const *av = *pav; Xconst char *p; X X if ((p = has_cli(ac, av)) != NULL) { X ptype = get_ptype(p); X if (ptype == C_NONE) { X struct clis *clp = clis; X X errmsgno(EX_BAD, "Illegal cli name '%s'.\n", p); X errmsgno(EX_BAD, "Use one of:"); X while (clp->name) { X error(" %s", (clp++)->name); X } X error(".\n\n"); X susage(EX_BAD); X } X pname = p; X return; X } X X p = filename(av[0]); X X /* X * If you like different behavior, you need to insert exceptional X * code before the switch statement. X * X * These are the names we support: X * X * cpio gnutar pax star suntar ustar X */ X switch (p[0]) { X X case 'c': /* 'c'pio */ X ptype = P_CPIO; X return; X X case 'g': /* 'g'*tar */ X ptype = P_GNUTAR; X return; X X case 'p': /* 'p'ax */ X ptype = P_PAX; X return; X X case 't': /* 't'ar */ X /* X * If we put something different here (e.g. P_STAR), we may X * set the default behavior to be the behavor of 'star'. X */ X ptype = P_SUNTAR; X return; X case 's': X if (streql(p, "suntar")) { X ptype = P_SUNTAR; X return; X } X if (streql(p, "scpio")) { X ptype = P_CPIO; X return; X } X if (streql(p, "spax")) { X ptype = P_PAX; X return; X } X /* FALLTHRU */ X X case 'u': /* 'u'star */ X ptype = P_STAR; X return; X default: X ptype = PTYPE_DEFAULT; X return; X } X} X X/* BEGIN CSTYLED */ X/* X * Convert old tar type syntax into the new UNIX option syntax. X * Allow only a limited subset of the single character options to avoid X * collisions between interpretation of options in different X * tar implementations. The old syntax has a risk to damage files X * which is avoided with the 'fcompat' flag (see opentape()). X * X * The UNIX-98 documentation lists the following tar options: X * Function Key: crtux X * c Create X * r Append X * t List X * u Update X * x Extract X * Additional Key: vwfblmo X * v Verbose X * w Wait for confirmation X * f Archive file X * b Blocking factor X * l Report missing links X * m Do not restore mtime from archive X * o Do not restore owner/group from archive X * X * Incompatibilities with UNIX-98 tar: X * l works the oposite way round as with star, but X * if TAR_COMPAT is defined, star will behave X * as documented in UNIX-98 if av[0] is either X * "tar" or "ustar". X * X * Additional functions from historic UNIX tar versions: X * 0..7 magtape_0 .. magtape_7 X * X * Additional functions from historic BSD tar versions: X * p Extract dir permissions too X * h Follow symbolic links X * i ignore directory checksum errors X * B do multiple reads to reblock pipes X * F Ommit unwanted files (e.g. core) X * X * Additional functions from historic Star versions: X * T Use $TAPE environment as archive X * L Follow symbolic links X * d do not archive/extract directories X * k keep old files X * n do not extract but tell what to do X * X * Additional functions from historic SVr4 tar versions: X * e Exit on unexpected errors X * X Arg is File with unwanted filenames X * X * Additional functions from historic GNU tar versions: X * z do inline compression X * X * Missing in star (from SVr4/Solaris tar): X * E Extended headers X * P Supress '/' at beginning of filenames X * q quit after extracting first file X * Incompatibilities with SVr4/Solaris tar: X * I Arg is File with filenames to be included X * The -I option is not handled as option. X * P SVr4/solaris: Supress '/', star: last partial X * k set tape size for multi volume archives X * n non tape device (do seeks) X * X * Incompatibilities with GNU tar: X * There are many. GNU programs in many cases make smooth X * coexistence hard. X * X * Problems: X * The 'e' and 'X' option are currently not implemented. X * There is a collision between the BSD -I (include) and X * star's -I (interactive) which may be solved by using -w instead. X */ X/* END CSTYLED */ XLOCAL void Xdocompat(pac, pav) X int *pac; X char *const **pav; X{ X int ac = *pac; X char *const *av = *pav; X int nac; X char **nav; X char nopt[3]; X char *_copt = "crtuxbfXBFTLdehijklmnopvwz01234567"; X char *copt = _copt; Xconst char *p; X char c; X char *const *oa; X char **na; X int coff = 1; X X set_ptype(pac, pav); X switch (ptype) { X X case P_SUNTAR: X iftype = I_TAR; X#ifdef SUN_TAR X copt = sun_copt; X#endif X break; X case P_GNUTAR: X iftype = I_TAR; X#ifdef GNU_TAR X copt = gnu_copt; X#endif X break; X case P_PAX: X iftype = I_PAX; X break; X case P_CPIO: X iftype = I_CPIO; X break; X case P_STAR: X default: X iftype = I_TAR; X copt = _copt; X } X X /* X * We must check this first to be able to set 'tcompat'. X */ X p = filename(av[0]); X if (streql(p, "tar") || streql(p, "ustar") || X streql(p, "suntar") || streql(p, "gnutar") || streql(p, "gtar")) X tcompat = TRUE; X X if (pname) /* cli=xxx seen as argv[1] */ X coff++; X X if (ac <= coff) X return; X if (iftype != I_TAR) X return; X X X /* X * If we come here, this is for a tar type CLI. X */ X if (ptype != P_SUNTAR && ptype != P_GNUTAR) { X /* X * For "suntar" & "gnutar" the first option string may start X * with '-', and still may need a conversion, else only convert X * to new syntax if the first arg is a non '-' arg. X */ X if (av[1][0] == '-') /* Do not convert new syntax */ X return; X } X if (av[coff][0] == '-' && av[coff][1] == '-') /* Do not convert new syntax */ X return; X X if (strchr(av[coff], '=') != NULL) /* Do not try to convert bs= */ X return; X X nac = ac + strlen(av[coff]); X nav = ___malloc(nac-- * sizeof (char *), /* keep space for NULL ptr */ X "compat argv"); X oa = av; /* remember old arg pointer */ X na = nav; /* set up new arg pointer */ X *na++ = *oa++; /* copy over av[0] */ X if (coff > 1) /* If we have a cli= argument */ X *na++ = *oa++; /* copy over av[1] (cli=...) */ X oa++; /* Skip over av[coff] */ X X nopt[0] = '-'; X nopt[2] = '\0'; X X for (p = av[coff]; (c = *p) != '\0'; p++) { X if (c == '-') { X nac--; X continue; X } X if (strchr(copt, c) == NULL) { X if (ptype == P_SUNTAR || ptype == P_GNUTAR) X errmsgno(EX_BAD, "Illegal option '%c'.\n", c); X else X errmsgno(EX_BAD, "Illegal option '%c' for compat mode.\n", c); X X susage(EX_BAD); X } X nopt[1] = c; X *na++ = ___savestr(nopt); X X if (c == 'f' || c == 'b' || (ptype == P_SUNTAR && c == 'k') || c == 'X') { X if ((av + ac) <= oa) { X comerrno(EX_BAD, X "Missing arg for '%s' option.\n", X nopt); X } X *na++ = *oa++; X /* X * The old syntax has a high risk of corrupting X * files if the user disorders the args. X */ X if (c == 'f') X fcompat = TRUE; X } X } X X /* X * Now copy over the rest... X */ X while ((av + ac) > oa) X *na++ = *oa++; X *na = NULL; X X *pac = nac; X *pav = nav; X X#ifdef COMPAT_DEBUG X { int i; X printf("agrc: %d\n", nac); X for (i = 0; i < nac; i++) X printf("%i: '%s'\n", i, nav[i]); X } X#endif X} X XEXPORT BOOL Xttyerr(f) X FILE *f; X{ X /* X * We may get EIO in case that we received an ignored SIGTTIN. X */ X if (ferror(f)) { X errmsgno(EX_BAD, "No access to tty.\n"); X return (TRUE); X } X if (feof(f)) { X errmsgno(EX_BAD, "EOF on tty.\n"); X return (TRUE); X } X return (FALSE); X} END-of-star-1.6/star/star.c echo x - star-1.6/star/star.mk sed 's/^X//' >star-1.6/star/star.mk << 'END-of-star-1.6/star/star.mk' X#ident @(#)star.mk 1.56 19/03/27 X########################################################################### X#include $(MAKE_M_ARCH).def XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= bin XTARGET= star XSYMLINKS= ustar tar XCPPOPTS += -D__STAR__ XCPPOPTS += -DSET_CTIME -DFIFO -DUSE_MMAP -DUSE_REMOTE -DUSE_RCMD_RSH X#CPPOPTS += -DSET_CTIME -DFIFO -DUSE_MMAP X#CPPOPTS += -DSET_CTIME -DUSE_MMAP X#CPPOPTS += -DFIFO -DUSE_MMAP XCPPOPTS += -DUSE_LARGEFILES XCPPOPTS += -DUSE_FIND XCPPOPTS += -DUSE_ACL XCPPOPTS += -DUSE_XATTR XCPPOPTS += -DUSE_FFLAGS XCPPOPTS += -DCOPY_LINKS_DELAYED XCPPOPTS += -DUSE_NLS XCPPOPTS += -DTEXT_DOMAIN=\"SCHILY_utils\" XCPPOPTS += -DSCHILY_PRINT XCFILES= star.c header.c cpiohdr.c xheader.c xattr.c \ X list.c extract.c create.c append.c diff.c restore.c \ X remove.c star_unix.c lpath_unix.c \ X acl_unix.c acltext.c fflags.c \ X buffer.c dirtime.c lhash.c \ X hole.c longnames.c \ X movearch.c table.c props.c \ X unicode.c \ X subst.c volhdr.c \ X chdir.c match.c defaults.c dumpdate.c \ X fifo.c device.c checkerr.c paxopts.c \ X findinfo.c pathname.c version.c XHFILES= star.h starsubs.h dirtime.h xtab.h xutimes.h \ X movearch.h table.h props.h fifo.h diff.h restore.h \ X checkerr.h dumpdate.h bitstring.h XLIBS= -ldeflt -lrmt -lfind -lschily $(LIB_ACL) $(LIB_ATTR) $(LIB_SOCKET) $(LIB_INTL) XXMK_FILE= Makefile.man starformatman.mk X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.cmd X########################################################################### Xcount: $(CFILES) $(HFILES) X count $r1 X END-of-star-1.6/star/star.mk echo x - star-1.6/star/star_fat.c sed 's/^X//' >star-1.6/star/star_fat.c << 'END-of-star-1.6/star/star_fat.c' X/* @(#)star.c 1.391 19/03/27 Copyright 1985, 88-90, 92-96, 98, 99, 2000-2019 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)star.c 1.391 19/03/27 Copyright 1985, 88-90, 92-96, 98, 99, 2000-2019 J. Schilling"; X#endif X/* X * Copyright (c) 1985, 88-90, 92-96, 98, 99, 2000-2019 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#define STAR_MAIN X X#include X#include X#include X#include X#include X#include "star.h" X#include "props.h" X#include "diff.h" X#include X#include X#define __XDEV__ /* Needed to activate _dev_init() */ X#include X#include /* Needed for O_XATTR */ X#include /* Needed for umask(2) */ X#include X#define GT_COMERR /* #define comerr gtcomerr */ X#define GT_ERROR /* #define error gterror */ X#include X#include X#include "fifo.h" /* Needed for #undef FIFO */ X#include "dumpdate.h" X#ifdef USE_FIND X#include X#include X#endif X X#include X X#include "starsubs.h" X#include "dirtime.h" X#include "checkerr.h" X XEXPORT int main __PR((int ac, char **av)); XLOCAL void star_create __PR((int ac, char *const *av)); XLOCAL void checkdumptype __PR((GINFO *gp)); XLOCAL void init_ddate __PR((char *name)); XEXPORT void copy_create __PR((int ac, char *const *av)); XLOCAL int getfilecount __PR((int ac, char *const *av, const char *fmt)); XLOCAL void getdir __PR((int *acp, char *const **avp, X const char **dirp)); XLOCAL void openlist __PR((void)); XLOCAL void check_stdin __PR((char *name)); XLOCAL void susage __PR((int ret)); XLOCAL void usage __PR((int ret)); XLOCAL void xusage __PR((int ret)); XLOCAL void dusage __PR((int ret)); XLOCAL void husage __PR((int ret)); XLOCAL void gargs __PR((int ac, char *const *av)); XLOCAL void star_mkvers __PR((void)); XLOCAL void star_helpvers __PR((char *name, BOOL help, BOOL xhelp, BOOL prvers)); XLOCAL void star_checkopts __PR((BOOL oldtar, BOOL dodesc, BOOL usetape, X int archive, BOOL no_fifo, X const char *paxopts, X Llong llbs)); XEXPORT void star_verifyopts __PR((void)); XLOCAL void star_nfiles __PR((int files, int minfiles)); XLOCAL int getpaxH __PR((char *arg, long *valp, int *pac, char *const **pav)); XLOCAL int getpaxL __PR((char *arg, long *valp, int *pac, char *const **pav)); XLOCAL int getpaxP __PR((char *arg, long *valp, int *pac, char *const **pav)); XLOCAL int getfind __PR((char *arg, long *valp, int *pac, char *const **pav)); XLOCAL int getpaxpriv __PR((char *arg, long *valp)); XLOCAL int getlldefault __PR((char *arg, Llong *valp, int mult)); XEXPORT int getbnum __PR((char *arg, Llong *valp)); XEXPORT int getknum __PR((char *arg, Llong *valp)); XEXPORT int getknum __PR((char *arg, Llong *valp)); XLOCAL int getenum __PR((char *arg, long *valp)); XLOCAL int addtarfile __PR((const char *tarfile)); XLOCAL int add_diffopt __PR((char *optstr, long *flagp)); XLOCAL int gethdr __PR((char *optstr, long *typep)); XLOCAL int getexclude __PR((char *arg, long *valp, int *pac, char *const **pav)); X#ifdef USED XLOCAL int addfile __PR((char *optstr, long *dummy)); X#endif XEXPORT void set_signal __PR((int sig, RETSIGTYPE (*handler)(int))); XLOCAL void exsig __PR((int sig)); XLOCAL void sighup __PR((int sig)); XLOCAL void sigintr __PR((int sig)); XLOCAL void sigquit __PR((int sig)); XLOCAL void getstamp __PR((void)); XLOCAL const char *has_cli __PR((int ac, char *const *av)); XLOCAL int get_ptype __PR((const char *p)); XLOCAL void set_ptype __PR((int *pac, char *const **pav)); XLOCAL void docompat __PR((int *pac, char *const **pav)); XEXPORT BOOL ttyerr __PR((FILE *f)); X X#if defined(SIGDEFER) || defined(SVR4) X#define signal sigset X#endif X X#define QIC_24_TSIZE 122880 /* 61440 kBytes */ X#define QIC_120_TSIZE 256000 /* 128000 kBytes */ X#define QIC_150_TSIZE 307200 /* 153600 kBytes */ X#define QIC_250_TSIZE 512000 /* 256000 kBytes (XXX not verified) */ X#define QIC_525_TSIZE 1025000 /* 512500 kBytes */ X#define TSIZE(s) ((s)*TBLOCK) X Xchar *vers; /* the full version string */ X Xstruct star_stats xstats; /* for printing statistics */ X Xextern BOOL havepat; /* Pattern matching in use */ X X#define NTARFILE 100 /* Max # of archive files */ X XFILE *tarf; /* The current archive */ XFILE *listf; /* File for list= option */ XFILE *tty; /* Open /dev/tty for questions */ XFILE *vpr; /* File for verbose printing */ XBOOL did_stdin = FALSE; /* Did use stdin for any option */ Xconst char *tarfiles[NTARFILE]; /* Cycle list of all archives */ Xint ntarfiles; /* Number of entries in list */ Xint tarfindex; /* Current index in list */ Xchar *newvol_script; /* -new-volume-script name */ XBOOL multivol = FALSE; /* -multivol specified */ XBOOL force_noremote = FALSE; /* -force-local specified */ Xchar *rmt; /* -rmt specify remote server */ Xchar *rsh; /* -rsh specify rsh command */ Xchar *listfile; /* File name for list= */ XBOOL pkglist = FALSE; /* pkglist= specified */ Xchar *stampfile; /* Time stamp file for -newer */ XBOOL errflag; /* -e for abort on error */ Xconst char *wdir; /* current working dir name */ Xconst char *currdir; /* current -C dir argument */ Xconst char *dir_flags = NULL; /* One/more -C options present */ XBOOL bsdchdir = FALSE; /* -C only valid for next arg */ Xchar *volhdr; /* VOLHDR= argument */ Xchar *fs_name; /* fs-name= for snapshot fs */ Xchar *dd_name; /* dumpdate= for snapshots */ Xdev_t tape_dev; /* st_dev for current archive */ Xino_t tape_ino; /* st_ino for current archive */ XBOOL tape_isreg = FALSE; /* Tape is a regular file */ X#ifdef FIFO XBOOL use_fifo = TRUE; /* Whether to use a FIFO or not */ X#else XBOOL use_fifo = FALSE; /* Whether to use a FIFO or not */ X#endif XBOOL shmflag = FALSE; /* Whether to use shmem f. FIFO */ Xlong fs; /* FIFO size */ Xlong bs; /* TAPE block size (bytes) */ Xint nblocks = 20; /* TAPE blocks (512 byte units) */ XBOOL not_tape = FALSE; /* -sun-n not a Tape */ Xuid_t dir_uid = _BAD_UID; /* -dir-owner */ Xgid_t dir_gid = _BAD_GID; /* -dir-group */ Xuid_t my_uid; /* Current euid */ Xdev_t curfs = NODEV; /* Current st_dev for -M option */ Xstruct timespec ddate; /* The current dump date */ Xtime_t sixmonth; /* 6 months before limit (ls) */ Xtime_t now; /* now limit (ls) */ X/* X * Change default header format into XUSTAR in 2004 (see below in gargs()) X */ Xlong hdrtype = H_XSTAR; /* default header format */ Xlong chdrtype = H_UNDEF; /* command line hdrtype */ Xint cmptype = C_NONE; /* compression type */ Xint iftype = I_TAR; /* command line interface type */ Xint ptype = P_STAR; /* program interface type */ Xconst char *pname = NULL; /* program name with cli= */ XBOOL paxls = FALSE; /* create PAX type listing */ Xint version = 0; /* Version from POSIX TAR hdr */ Xint swapflg = -1; /* Whether to swap input */ XBOOL debug = FALSE; /* -debug has been specified */ Xint xdebug = 0; /* eXtended debug level */ Xint dumplevel = -1; /* level for incremental dumps */ Xint oldlevel = 0; /* dumpleve this dump refers to */ XBOOL dump_partial = FALSE; /* Dump is not a full dump */ XBOOL dump_cumulative = FALSE; /* -cumulative has b. specified */ Xchar *dumpdates = "/etc/tardumps"; /* Database for increment. dump */ XBOOL wtardumps = FALSE; /* Should update above file */ XBOOL print_artype = FALSE; XBOOL showtime = FALSE; /* -time has been specified */ XBOOL no_stats = FALSE; /* -no-statistics specified */ XBOOL cpio_stats = FALSE; /* -cpio-statistics specified */ XBOOL do_fifostats = FALSE; /* -fifostats specified */ XBOOL numeric = FALSE; /* -numeric user ids */ Xint verbose = 0; /* -v has been specified */ XBOOL silent = FALSE; /* -silent no informal msg */ XBOOL prblockno = FALSE; /* -block-number for all files */ XBOOL no_xheader = FALSE; /* -no-xheader ignore P.2001 */ XBOOL no_fsync = -1; /* -no-fsync on extract */ XBOOL readnull = FALSE; /* -read0 on with list= */ XBOOL tpath = FALSE; /* -tpath print path only */ XBOOL cflag = FALSE; /* -c has been specified */ XBOOL uflag = FALSE; /* -u has been specified */ XBOOL rflag = FALSE; /* -r has been specified */ XBOOL xflag = FALSE; /* -x has been specified */ XBOOL tflag = FALSE; /* -t has been specified */ XBOOL copyflag = FALSE; /* -copy has been specified */ XBOOL binflag = FALSE; /* -o binary has been specified */ XBOOL nflag = FALSE; /* -n dummy extract mode */ XBOOL diff_flag = FALSE; /* -diff has been specified */ XBOOL Zflag = FALSE; /* -Z has been specified */ XBOOL zflag = FALSE; /* -z has been specified */ XBOOL bzflag = FALSE; /* -bz has been specified */ XBOOL lzoflag = FALSE; /* -lzo has been specified */ XBOOL p7zflag = FALSE; /* -7z has been specified */ XBOOL xzflag = FALSE; /* -xz has been specified */ XBOOL lzipflag = FALSE; /* -lzip has been specified */ XBOOL zstdflag = FALSE; /* -zstd has been specified */ XBOOL lzmaflag = FALSE; /* -lzma has been specified */ XBOOL freezeflag = FALSE; /* -freeze has been specified */ Xchar *compress_prg = NULL; /* -compress-program specified */ XBOOL multblk = FALSE; /* -B has been specified */ XBOOL ignoreerr = FALSE; /* -i has been specified */ XBOOL nodir = FALSE; /* -d do not store dirs */ XBOOL noxdir = FALSE; /* -d do not create dirs */ XBOOL noatime = FALSE; /* -p a pax do not restore atime */ XBOOL nomtime = FALSE; /* -m do not restore times */ XBOOL nochown = FALSE; /* -o do not restore owner */ XBOOL acctime = FALSE; /* -atime has been specified */ XBOOL pflag = FALSE; /* -p restore permissions */ XBOOL nopflag = FALSE; /* -no-p don't restore perms */ XBOOL dirmode = FALSE; /* -dirmode wr. dirs past files */ XBOOL nolinkerr = FALSE; /* pr. link # err depends on -l */ XBOOL follow = FALSE; /* -h follow symbolic links */ XBOOL paxfollow = FALSE; /* PAX -L follow symbolic links */ XBOOL paxHflag = FALSE; /* PAX -H follow symbolic links */ XBOOL nodesc = FALSE; /* -D do not descenc dirs */ XBOOL nomount = FALSE; /* -M do not cross mount points */ XBOOL interactive = FALSE; /* -w has been specified */ XBOOL paxinteract = FALSE; /* PAX -i has been specified */ XBOOL signedcksum = FALSE; /* -signed-checksum */ XBOOL partial = FALSE; /* -P write partial last record */ XBOOL nospec = FALSE; /* -S no special files */ Xint Fflag = 0; /* -F,-FF,... no SCCS/RCS/... */ XBOOL uncond = FALSE; /* -U unconditional extract */ XBOOL uncond_rename = FALSE; /* -uncond-rename - ask always */ XBOOL xdir = FALSE; /* -xdir uncond. dir extract */ XBOOL xdot = FALSE; /* -xdot uncond '.' dir extract */ XBOOL keep_old = FALSE; /* -k do not overwrite files */ XBOOL refresh_old = FALSE; /* -refresh existing only */ XBOOL abs_path = FALSE; /* -/ absolute path allowed */ XBOOL allow_dotdot = FALSE; /* -.. '..' in path allowed */ XBOOL secure_links = -1; /* -secure-links (no .. & /) */ XBOOL no_dirslash = FALSE; /* -no-dirslash option */ XBOOL notpat = FALSE; /* -not invert pattern matcher */ XBOOL match_tree = FALSE; /* -match-tree match dir -> tree */ XBOOL notarg = FALSE; /* PAX -c invert match */ XBOOL paxmatch = FALSE; /* Do PAX like matching */ XBOOL paxnflag = FALSE; /* PAX -n one match only */ XBOOL force_hole = FALSE; /* -force-hole on extract */ XBOOL sparse = FALSE; /* -sparse has been specified */ XBOOL to_stdout = FALSE; /* -to-stdout extraction */ XBOOL wready = FALSE; /* -wready wait for ready tape */ XBOOL force_remove = FALSE; /* -force-remove on extraction */ XBOOL ask_remove = FALSE; /* -ask-remove on extraction */ XBOOL remove_first = FALSE; /* -remove-first on extraction */ XBOOL remove_recursive = FALSE; /* -remove-recursive on extract */ XBOOL keep_nonempty_dirs = FALSE; /* -keep-nonempty-dirs on extract */ XBOOL do_install = FALSE; /* -install on extract */ XBOOL nullout = FALSE; /* -onull - simulation write */ XBOOL prinodes = FALSE; /* -prinodes print ino # w. -tv */ X XUllong maxsize = 0; /* max file size for create */ Xstruct timespec Newer = {0, 0}; /* Time stamp to compare with */ XUllong tsize = 0; /* Max tape size in tar blocks */ Xlong diffopts = 0L; /* diffopts= bit mask */ XBOOL nowarn = FALSE; /* -nowarn has been specified */ XBOOL Ctime = FALSE; /* -ctime has been specified */ XBOOL nodump = FALSE; /* -nodump has been specified */ X XBOOL listnew = FALSE; /* -newest list newest only */ XBOOL listnewf = FALSE; /* -newest-file list n. plain f */ XBOOL hpdev = FALSE; /* -hpdev non POSIX dev # */ XBOOL modebits = FALSE; /* -modebits more than 12 bits */ XBOOL copylinks = FALSE; /* -copylinks rather than link */ XBOOL copyhardlinks = FALSE; /* -copyhardlinks rather than link */ XBOOL copysymlinks = FALSE; /* -copysymlinks rather than link */ XBOOL copydlinks = FALSE; /* copy content of linked dirs */ XBOOL hardlinks = FALSE; /* -hardlinks ext. sym as hard */ XBOOL symlinks = FALSE; /* -symlinks ext. hard as syml */ XBOOL linkdata = FALSE; /* -link-data data in hardlinks */ XBOOL doacl = FALSE; /* -acl handle ACLs */ XBOOL doxattr = FALSE; /* -xattr handle extended fattr */ XBOOL dolxattr = FALSE; /* -xattr-linux extended fattr */ XBOOL dofflags = FALSE; /* -xfflags handle extended ffl */ XBOOL link_dirs = FALSE; /* -link-dirs hard linked dirs */ XBOOL dodump = FALSE; /* -dump mode with all ino prop */ XBOOL dorestore = FALSE; /* -restore in incremental mode */ XBOOL dopartial = FALSE; /* -partial in incremental mode */ XBOOL forcerestore = FALSE; /* -force-restore in incremental mode */ XBOOL dometa = FALSE; /* -meta ino metadata only */ XBOOL dumpmeta = FALSE; /* -dumpmeta metadata for ctime */ XBOOL xmeta = FALSE; /* -xmeta extract meta files */ XBOOL lowmem = FALSE; /* -lowmem use less memory */ X#ifdef USE_FIND XBOOL dofind = FALSE; /* -find option found */ Xint find_ac = 0; /* ac past -find option */ Xchar *const *find_av = NULL; /* av past -find option */ Xint find_pac = 0; /* ac for first find primary */ Xchar *const *find_pav = NULL; /* av for first find primary */ Xfindn_t *find_node; /* syntaxtree from find_parse() */ Xvoid *plusp; /* residual for -exec ...{} + */ Xint find_patlen; /* len for -find pattern state */ Xchar *codeset = "ISO8859-1"; X#ifdef USE_SELINUX XBOOL selinux_enabled; X#endif X X XLOCAL int walkflags = WALK_CHDIR | WALK_PHYS | WALK_NOEXIT | X WALK_STRIPLDOT; XLOCAL int maxdepth = -1; XLOCAL int mindepth = -1; XEXPORT struct WALK walkstate; X#endif X XBOOL tcompat = FALSE; /* Tar compatibility (av[0] is tar/ustar) */ XBOOL fcompat = FALSE; /* Archive file compatibility was requested */ X Xint intr = 0; /* Did catch a ^C */ X XBOOL do_subst; X X/* X * _grinfo is only used to read the information. X */ XGINFO _ginfo; /* Global (volhdr) information */ XGINFO _grinfo; /* Global read information */ XGINFO *gip = &_ginfo; /* Global information pointer */ XGINFO *grip = &_grinfo; /* Global read info pointer */ X Xstruct ga_props gaprops; X X#ifdef STAR_FAT X#include "suntar.c" X#include "gnutar.c" X#include "cpio.c" X#include "pax.c" X#endif X X#ifndef NO_STAR_MAIN X#define PTYPE_DEFAULT P_STAR X/* X * Achtung: Optionen wie f= sind problematisch denn dadurch dass -ffilename geht, X * werden wird bei Falschschreibung von -fifo evt. eine Datei angelegt wird. X */ X/* BEGIN CSTYLED */ Xchar _opts[] = "C*,find~,help,xhelp,version,debug,xdebug#,xd#,bsdchdir,pax-ls,level#,tardumps*,wtardumps,time,no_statistics,no-statistics,cpio-statistics,fifostats,numeric,v+,block-number,tpath,c,u,r,x,t,copy,xcopy,n,diff,diffopts&,H&,artype&,print-artype,fs-name*,force_hole,force-hole,sparse,to_stdout,to-stdout,wready,force_remove,force-remove,ask_remove,ask-remove,remove_first,remove-first,remove_recursive,remove-recursive,keep-nonempty-dirs,install,nullout,onull,fifo,no_fifo,no-fifo,shm,fs&,VOLHDR*,list*,pkglist*,multivol,new-volume-script*,force-local,restore,partial,force-restore,freeze,file&,f&,T,Z,z,bz,j,lzo,7z,xz,lzip,zstd,lzma,compress-program*,rmt*,rsh*,bs&,blocks&,b&,B,pattern&,pat&,i,d,m,o,nochown,pax-o*,pax-p&,a,atime,p,no-p,dirmode,l,h,L,pax-L~,pax-H~,pax-P~,D,dodesc,M,xdev,w,pax-i,I,X&,exclude-from&,O,signed_checksum,signed-checksum,P,S,F+,U,uncond-rename,xdir,xdot,k,keep_old_files,keep-old-files,refresh_old_files,refresh-old-files,refresh,/,..,secure-links,no-secure-links%0,no-dirslash,not,V,match-tree,pax-match,pax-n,pax-c,notarg,maxsize&,newer*,ctime,nodump,tsize&,qic24,qic120,qic150,qic250,qic525,nowarn,newest_file,newest-file,newest,hpdev,modebits,copylinks,copyhardlinks,copysymlinks,copydlinks,hardlinks,symlinks,link-data,acl,xattr,xattr-linux,xfflags,link-dirs,dumpdate*,dump,cumulative,dump-cumulative,meta,dumpmeta,xmeta,silent,lowmem,no-xheader,no-fsync%1,do-fsync%0,read0,errctl&,e,data-change-warn,prinodes,dir-owner*,dir-group*,umask*,s&,?"; X/* END CSTYLED */ Xchar *opts = _opts; X#else Xextern char *opts; X#endif /* NO_STAR_MAIN */ X XEXPORT int Xmain(ac, av) X int ac; X char **av; X{ X int cac = ac; X char *const *cav = av; X int oac; X char *const *oav; X int excode = 0; X char *tgt_dir = NULL; X X save_args(ac, av); X X#ifdef USE_NLS X if (setlocale(LC_ALL, "") != NULL) { X#ifdef CODESET X codeset = nl_langinfo(CODESET); X#endif X } X X#if !defined(TEXT_DOMAIN) /* Should be defined by cc -D */ X#define TEXT_DOMAIN "star" /* Use this only if it weren't */ X#endif X { char *dir; X dir = searchfileinpath("share/locale", F_OK, X SIP_ANY_FILE|SIP_NO_PATH, NULL); X if (dir) X (void) bindtextdomain(TEXT_DOMAIN, dir); X else X#if defined(PROTOTYPES) && defined(INS_BASE) X (void) bindtextdomain(TEXT_DOMAIN, INS_BASE "/share/locale"); X#else X (void) bindtextdomain(TEXT_DOMAIN, "/usr/share/locale"); X#endif X (void) textdomain(TEXT_DOMAIN); X } X X#endif /* USE_NLS */ X X my_uid = geteuid(); X my_uid = getuid(); X X docompat(&cac, &cav); X X gargs(cac, cav); X if (pname) { /* cli=xxx seen as argv[1] */ X --cac, cav++; X } X --cac, cav++; X oac = cac; X oav = cav; X X#ifdef SIGHUP X if (signal(SIGHUP, SIG_IGN) != SIG_IGN) X set_signal(SIGHUP, sighup); X#endif X#ifdef SIGINT X if (signal(SIGINT, SIG_IGN) != SIG_IGN) X set_signal(SIGINT, sigintr); X#endif X#ifdef SIGQUIT X if (signal(SIGQUIT, SIG_IGN) != SIG_IGN) X set_signal(SIGQUIT, sigquit); X#endif X#ifdef SIGINFO X /* X * Be polite to *BSD users. X * They copied our idea and implemented intermediate status X * printing in 'dd' in 1990. X */ X if (signal(SIGINFO, SIG_IGN) != SIG_IGN) X set_signal(SIGINFO, sigquit); X#endif X X file_raise((FILE *)NULL, FALSE); X X initbuf(nblocks); /* Calls initfifo() if needed */ X X (void) openremote(); /* This needs super user privilleges */ X X if (geteuid() != getuid()) { /* AIX does not like to do this */ X /* If we are not root */ X#ifdef HAVE_SETREUID X if (setreuid(-1, getuid()) < 0) X#else X#ifdef HAVE_SETEUID X if (seteuid(getuid()) < 0) X#else X if (setuid(getuid()) < 0) X#endif X#endif X comerr("Panic cannot set back effective uid.\n"); X } X my_uid = geteuid(); X /* X * WARNING: We now are no more able to open a new remote connection X * unless we have been called by root. X * It you like to do a remote multi-tape backup to different hosts X * and do not call star from root, you are lost. X */ X X#ifdef USE_SELINUX X selinux_enabled = is_selinux_enabled() > 0; X#endif X X opentape(); X X if (stampfile) X getstamp(); X X star_mkvers(); /* Create version string */ X setprops(chdrtype); /* Set up properties for archive format */ X /* X * If the archive format contains extended headers, we X * need to set up iconv(). X */ X if (cflag && props.pr_flags & PR_XHDR) X utf8_init(S_CREATE); /* Init. iconv() setup for xheader */ X X if (!(rflag || uflag) || chdrtype != H_UNDEF) X star_verifyopts(); /* Chk if options are valid for chdrtype */ X X if (dumplevel >= 0) X initdumpdates(dumpdates, wtardumps); X dev_init(debug); /* Init device macro handling */ X xbinit(); /* Initialize buffer for extended headers */ X X if (dir_flags && (!tflag || copyflag)) X wdir = dogetwdir(TRUE); /* Exit on failure */ X else if (xflag) X wdir = dogetwdir(FALSE); /* Return NULL on failure */ X X getnstimeofday(&ddate); X now = ddate.tv_sec + 60; X sixmonth = ddate.tv_sec - 6L*30L*24L*60L*60L; X#ifdef USE_FIND X find_timeinit(ddate.tv_sec); X walkinitstate(&walkstate); X#endif X if (dd_name) X init_ddate(dd_name); X X ginit(); /* Initialize global (volhdr) info */ X X if (copyflag) { X int lac = cac; X char *const *lav = cav; X X if (tflag) { X /* X * Flag no args at 'extract' side in -c -list mode. X */ X cav = &oav[oac]; X cac = 0; X } else { X /* X * Find last file type argument. X */ X for (; ; --cac, cav++) { X if (getlfiles(&cac, &cav, &gaprops, opts) == 0) X break; X lac = cac; X lav = cav; X } X tgt_dir = lav[0]; X cav = &lav[1]; X cac = lac-1; X if (cac > 0) { X errmsgno(EX_BAD, X "Badly placed option after target directory.\n"); X susage(EX_BAD); X } X } X } X X /* X * These callbacks are only called in case we leave star via comexit(). X * We do this only in case of a severe error. X * These functions are called in the inverse set up oder, so checkerrs() X * called last. X */ X on_comerr((void(*)__PR((int, void *)))checkerrs, (void *)0); X on_comerr((void(*)__PR((int, void *)))prstats, (void *)0); X if (xflag) X on_comerr((void(*)__PR((int, void *)))flushdirtimes, (void *)0); X#ifdef FIFO X if (use_fifo) { X runfifo(oac, oav); /* Run FIFO, fork() is called here */ X on_comerr(fifo_onexit, /* For foreground FIFO process only */ X (void *)0); X } X#endif X X if (copyflag) { X do_subst = FALSE; /* Substitution only at create side */ X havepat = FALSE; /* Patterns only at create side */ X listfile = NULL; /* Listfile only at create side */ X swapflg = 0; /* Don't try to find out the hdrtype */ X dir_flags = tgt_dir; /* Target directory only at extract */ X#ifdef USE_FIND X dofind = FALSE; /* -find expr only at create side */ X#endif X } X X if (xflag || tflag || diff_flag) { X /* X * cflag will never be TRUE in this case X */ X if (listfile) { X openlist(); X hash_build(listf); X if ((currdir = dir_flags) != NULL) X dochdir(currdir, TRUE); X } else { X#ifdef USE_FIND X if (!dofind) { X#endif X for (; ; --cac, cav++) { X if (dir_flags) X getdir(&cac, &cav, &currdir); X if (getlfiles(&cac, &cav, &gaprops, opts) == 0) X break; X addarg(cav[0]); X } X#ifdef USE_FIND X } X#endif X closepattern(); X } X if (tflag) { X list(); X } else { X /* X * xflag || diff_flag X * First change dir to the one or last -C arg X * in case there is no pattern in list. X */ X if ((currdir = dir_flags) != NULL) X dochdir(currdir, TRUE); X if (xflag) X extract(volhdr); X else X diff(); X } X } X closepattern(); X if (uflag || rflag) { X /* X * cflag will also be TRUE in this case X */ X skipall(); X syncbuf(); X backtape(); X } X if (cflag) { X /* X * xflag, tflag, diff_flag will never be TRUE in this case X */ X star_create(cac, cav); X } X X#ifdef USE_FIND X find_plusflush(plusp, &walkstate); X#endif X fflush(vpr); /* Avoid output mix with checklinks() from 2>&1 | tee */ X if (!nolinkerr) X checklinks(); X if (!use_fifo) X closetape(); X#ifdef FIFO X if (use_fifo) X fifo_exit(0); X#endif X X#ifdef HAVE_FORK X while (wait(0) >= 0) { X ; X /* LINTED */ X } X#endif X if (!no_stats) X prpatstats(); X prstats(); X if (checkerrs()) { X if (!nowarn && !no_stats) { X errmsgno(EX_BAD, X "Processed all possible files, despite earlier errors.\n"); X } X excode = -2; X } X if (intr) { X /* X * This happens when we are in create mode and the interrupt is X * delayed in order to prevent inconsistent archives. X */ X if (excode == 0) X excode = -4; X } X if (!isatty(fdown(stderr))) { X char *p; X X /* X * Try to avoid that the verbose or diagnostic messages are X * sometimes lost if called on Linux via "ssh". Unfortunately X * this does not always help. If you like to make sure that X * nothing gets lost, call: ssh host "star .... ; sleep 10" X */ X fflush(vpr); X fflush(stderr); X#ifdef HAVE_FSYNC X if (!no_fsync) { X fsync(fdown(vpr)); X fsync(fdown(stderr)); X } X#endif X /* X * Use the sleep only in case that the environment is set, but X * keep the fflush() as stderr may be buffered. X */ X if ((p = getenv("STAR_WORKAROUNDS")) != NULL && X strstr(p, "ssh-tcpip") != NULL) X usleep(100000); X } X#ifdef FIFO X /* X * Fetch errno from FIFO if available. X */ X if (fifo_errno()) X excode = fifo_errno(); X#endif X if (dumplevel >= 0 && wtardumps) { X if (excode != 0 || intr) { X errmsgno(EX_BAD, "'%s' not written due to problems during backup.\n", X dumpdates); X } else { X int dflags = 0; X X if (gip->dumptype != DT_FULL) X dflags |= DD_PARTIAL; X if (dump_cumulative) X dflags |= DD_CUMULATIVE; X X writedumpdates(dumpdates, gip->filesys, dumplevel, dflags, &ddate); X } X } X#ifdef DBG_MALLOC X aprintlist(stdout, 1); X#endif X X exit(excode); X /* NOTREACHED */ X return (excode); /* keep lint happy */ X} X XLOCAL void Xstar_create(ac, av) X int ac; X char *const *av; X{ X /* X * xflag, tflag, diff_flag will never be TRUE in this case X */ X put_release(); /* Pax 'g' vendor unique */ X put_archtype(); /* Pax 'g' vendor unique */ X if (dumplevel < 0) /* In dump mode we first collect the data */ X put_volhdr(volhdr, TRUE); X#ifdef USE_FIND X if (dumplevel >= 0 && (listfile || dofind)) X comerrno(EX_BAD, X "Cannot do incremental dumps with list= or -find.\n"); X#else X if (dumplevel >= 0 && listfile) X comerrno(EX_BAD, "Cannot do incremental dumps with list=.\n"); X#endif X#ifdef USE_FIND X if (dofind) { X if (find_patlen > 0) { X walkstate.patstate = ___malloc(sizeof (int) * find_patlen, X "space for pattern state"); X } X X walkstate.walkflags = walkflags; X walkstate.maxdepth = maxdepth; X walkstate.mindepth = mindepth; X walkstate.lname = NULL; X walkstate.tree = find_node; X walkstate.err = 0; X walkstate.pflags = 0; X X if ((currdir = dir_flags) != NULL) X dochdir(currdir, TRUE); X nodesc = TRUE; X for (av = find_av; av != find_pav; av++) { X treewalk(*av, walkfunc, &walkstate); X } X } else X#endif X if (listfile) { X openlist(); X if ((currdir = dir_flags) != NULL) X dochdir(currdir, TRUE); X /* X * We do not allow file type args together with list= X * Note that Sun tar allows a mix. X */ X if (getlfiles(&ac, &av, &gaprops, opts) > 0) X comerrno(EX_BAD, "Too many args for list= option.\n"); X createlist(); X } else { X const char *cdir = NULL; X X for (; ; --ac, av++) { X if (dir_flags) X getdir(&ac, &av, &currdir); X if (currdir && cdir != currdir) { X if (!(dochdir(wdir, FALSE) && X dochdir(currdir, FALSE))) X break; X cdir = currdir; X } X X if (getlfiles(&ac, &av, &gaprops, opts) == 0) X break; X if (dumplevel >= 0) { X dumpd_t *dp; X int dflags = 0; X X /* X * The next message is only for debugging X * purposes to find problems related to option X * parsing. X */ X if (ac > 1) X errmsgno(EX_BAD, "INFO: ac %c av[0] '%s'\n", ac, av[0]); X X /* X * We cannot have more than one file type X * argument in dump mode if we like to grant X * the consistency of dumps. In theory, it would X * be possible to allow it, but then we will not X * be able to deal with renames from outside the X * scope to inside the scope. X */ X if (ac > 1) X comerrno(EX_BAD, X "Only one file type arg allowed in dump mode.\n"); X if (cdir == NULL) { X comerrno(EX_BAD, X "Need '-C dir' in dump mode.\n"); X /* NOTREACHED */ X } X if (cdir[0] != '/') X comerrno(EX_BAD, X "Need absolute path with '-C dir' in dump mode.\n"); X if (!streql(av[0], ".")) X comerrno(EX_BAD, X "File type arg must be '.' in dump mode.\n"); X X gip->filesys = (char *)cdir; X gip->gflags |= GF_FILESYS; X if (fs_name) { X gip->filesys = fs_name; X gip->cwd = (char *)cdir; X gip->gflags |= GF_CWD; X } X /* X * Set dump type to full/partial. X */ X checkdumptype(gip); X if (gip->dumptype != DT_FULL) X dflags |= DD_PARTIAL; X if (dump_cumulative) X dflags |= DD_CUMULATIVE; X dp = checkdumpdates(gip->filesys, dumplevel, dflags); X if (dp == NULL && dumplevel > 0 && gip->dumptype != DT_FULL) X dp = checkdumpdates(gip->filesys, dumplevel, 0); X if (dp == NULL && dumplevel > 0) { X errmsgno(EX_BAD, X "No level 0 dump entry found in '%s'.\n", X dumpdates); X comerrno(EX_BAD, "Perform a level 0 dump first.\n"); X } X if (dp) { X oldlevel = dp->dd_level; X Newer = dp->dd_date; X gip->reflevel = dp->dd_level; X gip->refdate = dp->dd_date; X gip->gflags |= (GF_REFLEVEL|GF_REFDATE); X } X X adddumpdates(gip->filesys, dumplevel, dflags, X &ddate, TRUE); X X error("Type of this level %d%s dump: %s\n", X dumplevel, X (dflags & DD_PARTIAL) ? "P":" ", X dt_name(gip->dumptype)); X error("Date of this level %d%s dump: %s\n", X dumplevel, X (dflags & DD_PARTIAL) ? "P":" ", X dumpdate(&ddate)); X error("Date of last level %d%s dump: %s\n", X oldlevel, X (dp && (dp->dd_flags & DD_PARTIAL)) ? X "P":" ", X dumpdate(&Newer)); X X put_volhdr(volhdr, TRUE); X } X if (intr) X break; X curfs = NODEV; X /* X * To avoid empty incremental dumps, make sure that X * av[0] is always in the archive in with dumplevel >= 0 X */ X create(av[0], paxHflag, dumplevel >= 0); X if (bsdchdir && wdir && !dochdir(wdir, FALSE)) X break; X } X } X flushlinks(); X weof(); X buf_drain(); X} X XLOCAL void Xcheckdumptype(gp) X GINFO *gp; X{ X FINFO dinfo; X FINFO ddinfo; X BOOL full = FALSE; X X if (!_getinfo(".", &dinfo)) X return; X if (!_getinfo("..", &ddinfo)) X return; X X if (dinfo.f_ino == ddinfo.f_ino && dinfo.f_dev == ddinfo.f_dev) X full = TRUE; X X if (dinfo.f_dev != ddinfo.f_dev) X full = TRUE; X if (full && !dump_partial && !havepat) { X gp->gflags |= GF_DUMPTYPE; X gp->dumptype = DT_FULL; X } else { X gp->gflags |= GF_DUMPTYPE; X gp->dumptype = DT_PARTIAL; X } X} X XLOCAL void Xinit_ddate(name) X char *name; X{ X FINFO ddinfo; X X if (!_getinfo(name, &ddinfo)) X comerr("Cannot stat '%s'.\n", name); X X ddate.tv_sec = ddinfo.f_mtime; X ddate.tv_nsec = ddinfo.f_mnsec; X} X XEXPORT void Xcopy_create(ac, av) X int ac; X char *const *av; X{ X int oac = ac; X char *const *oav = av; X int lac = ac; X#ifdef __needed__ X char *const *lav = av; X#endif X X verbose = 0; /* Verbose not at create side */ X interactive = FALSE; /* Interactive not at create side */ X X if (!tflag) { X /* X * Cut off beginning at last file type arg. X */ X for (; ; --ac, av++) { X if (getlfiles(&ac, &av, &gaprops, opts) == 0) X break; X lac = ac; X#ifdef __needed__ X lav = av; X#endif X } X ac = oac-lac; X av = oav; X } X X star_create(ac, av); X /* X * XXX Fehlerzusammenfassung fuer die -c reate Seite? X */ X} X XLOCAL int Xgetfilecount(ac, av, fmt) X int ac; X char *const *av; X const char *fmt; X{ X int files = 0; X X for (; ; --ac, av++) { X if (getlfiles(&ac, &av, &gaprops, fmt) == 0) X break; X files++; X } X return (files); X} X XLOCAL void Xgetdir(acp, avp, dirp) X int *acp; X char *const **avp; X const char **dirp; X{ X int len = strlen(opts); X char *dir = NULL; X X if (iftype == I_CPIO || iftype == I_PAX) X return; X /* X * Skip all other flags. X * Note that we need to patch away "...,?" at the end of the X * option string so this will not interfere with a -C dir X * option in the command line. X */ X if (opts[len-1] == '?' && opts[len-2] == ',') X opts[len-2] = '\0'; X getlfiles(acp, avp, &gaprops, &opts[3]); X X if (debug) /* temporary */ X errmsgno(EX_BAD, "Flag/File: '%s'.\n", (*avp)[0]); X Xagain: X /* X * Get next '-C dir' option X */ X if (getlargs(acp, avp, &gaprops, "C*", &dir) < 0) { X int cac = *acp; X /* X * Skip all other flags that are known to star. X */ X if (getlfiles(acp, avp, &gaprops, &opts[3]) < 0) { X /* X * If we did find other legal flags, try again. X */ X if (cac > *acp) X goto again; X X errmsgno(EX_BAD, "Badly placed Option: %s.\n", X (*avp)[0]); X if ((*avp)[1] != NULL) X errmsgno(EX_BAD, "Next arg is '%s'.\n", X (*avp)[1]); X susage(EX_BAD); X } X } X if (opts[len-2] == '\0') X opts[len-2] = ','; X if (dir) X *dirp = dir; X if (debug) /* temporary */ X errmsgno(EX_BAD, "Dirp: '%s' Dir: %s.\n", *dirp, dir); X} X XLOCAL void Xopenlist() X{ X if (streql(listfile, "-")) { X check_stdin("list="); X listf = stdin; X listfile = "stdin"; X } else if ((listf = lfilemopen(listfile, "r", S_IRWALL)) == (FILE *)NULL) X comerr("Cannot open '%s'.\n", listfile); X} X XLOCAL void Xcheck_stdin(name) X char *name; X{ X if (did_stdin) { X comerrno(EX_BAD, X "Did already use stdin, cannot use stdin for '%s' option.\n", X name); X } X did_stdin = TRUE; X} X X#ifndef NO_STAR_MAIN X/* X * Short usage X */ XLOCAL void Xsusage(ret) X int ret; X{ X#ifdef STAR_FAT X switch (ptype) { X X case P_SUNTAR: X suntar_susage(ret); exit(ret); X case P_GNUTAR: X gnutar_susage(ret); exit(ret); X case P_PAX: X pax_susage(ret); exit(ret); X case P_CPIO: X cpio_susage(ret); exit(ret); X } X#endif X#ifdef USE_FIND X error("Usage:\t%s cmd [options] [-find] file1 ... filen [find expression]\n", get_progname()); X#else X error("Usage:\t%s cmd [options] file1 ... filen\n", get_progname()); X#endif X error("\t%s cli=name ...\n", get_progname()); X error("\nUse\t%s -help\n", get_progname()); X error("and\t%s -xhelp\n", get_progname()); X error("to get a list of valid cmds and options.\n"); X error("\nUse\t%s H=help\n", get_progname()); X error("to get a list of valid archive header formats.\n"); X error("\nUse\t%s diffopts=help\n", get_progname()); X error("to get a list of valid diff options.\n"); X exit(ret); X /* NOTREACHED */ X} X XLOCAL void Xusage(ret) X int ret; X{ X#ifdef STAR_FAT X switch (ptype) { X X case P_SUNTAR: X suntar_usage(ret); exit(ret); X case P_GNUTAR: X gnutar_usage(ret); exit(ret); X case P_PAX: X pax_usage(ret); exit(ret); X case P_CPIO: X cpio_usage(ret); exit(ret); X } X#endif X#ifdef USE_FIND X error("Usage:\t%s cmd [options] [-find] file1 ... filen [find expression]\n", get_progname()); X#else X error("Usage:\t%s cmd [options] file1 ... filen\n", get_progname()); X#endif X error("\t%s cli=name ...\n", get_progname()); X error("Cmd:\n"); X error("\t-c/-u/-r\tcreate/update/replace archive with named files to tape\n"); X error("\t-x/-t/-n\textract/list/trace named files from tape\n"); X error("\t-copy\t\tcopy named files to destination directory\n"); X error("\t-diff\t\tdiff archive against file system (see -xhelp)\n"); X error("Options:\n"); X error("\t-help\t\tprint this help\n"); X error("\t-xhelp\t\tprint extended help\n"); X error("\t-version\tprint version information and exit\n"); X error("\t-xcopy\t\talias for -copy -sparse -acl\n"); X error("\tblocks=#,b=#\tset blocking factor to #x512 Bytes (default 20)\n"); X error("\tfile=nm,f=nm\tuse 'nm' as tape instead of stdin/stdout\n"); X error("\t-T\t\tuse $TAPE as tape instead of stdin/stdout\n"); X error("\t-[0-7]\t\tSelect an alternative tape drive\n"); X#ifdef FIFO X error("\t-fifo/-no-fifo\tuse/don't use a fifo to optimize data flow from/to tape\n"); X#if defined(USE_MMAP) && defined(USE_USGSHM) X error("\t-shm\t\tuse SysV shared memory for fifo\n"); X#endif X#endif X error("\t-v\t\tincrement verbose level\n"); X error("\t-block-number\tprint the block numbers where the TAR headers start\n"); X error("\t-tpath\t\tuse with -t, -cv or -diff to list path names only\n"); X error("\tH=header\tgenerate 'header' type archive (see H=help)\n"); X error("\tartype=header\tgenerate 'header' type archive (see artype=help)\n"); X error("\t-print-artype\tcheck and print archive and compression type on one line and exit.\n"); X error("\tC=dir\t\tperform a chdir to 'dir' before storing/extracting next file\n"); X error("\t-bsdchdir\tdo BSD style C= (only related to the next file type arg)\n"); X#ifdef USE_FIND X error("\t-find\t\tOption separator: Use find command line to the right.\n"); X#endif X error("\t-Z\t\tpipe input/output through compress, does not work on tapes\n"); X error("\t-z\t\tpipe input/output through gzip, does not work on tapes\n"); X error("\t-j,-bz\t\tpipe input/output through bzip2, does not work on tapes\n"); X error("\t-lzo\t\tpipe input/output through lzop, does not work on tapes\n"); X error("\t-7z\t\tpipe input/output through p7zip, does not work on tapes\n"); X error("\t-xz\t\tpipe input/output through xz, does not work on tapes\n"); X error("\t-lzip\t\tpipe input/output through lzip, does not work on tapes\n"); X error("\t-zstd\t\tpipe input/output through zstd, does not work on tapes\n"); X error("\t-lzma\t\tpipe input/output through lzma, does not work on tapes\n"); X error("\t-freeze\t\tpipe input/output through freeze, does not work on tapes\n"); X error("\tcompress-program=name\tpipe input/output through program 'name', does not work on tapes\n"); X error("\t-B\t\tperform multiple reads (needed on pipes)\n"); X error("\t-i\t\tignore checksum errors\n"); X error("\t-d\t\tdo not store/create directories\n"); X error("\t-m\t\tdo not restore access and modification time\n"); X error("\t-o,-nochown\tdo not restore owner and group\n"); X error("\t-pax-o string\tPAX options (none specified with SUSv2 / UNIX-98)\n"); X error("\t-pax-p string\tuse PAX like privileges set up\n"); X error("\t-a,-atime\treset access time after storing file\n"); X error("\t-p\t\trestore file permissions\n"); X error("\t-no-p\t\tdo not restore file permissions\n"); X error("\t-l\t\tdo not print a message if not all links are dumped\n"); X error("\t-h,-L\t\tfollow symbolic links as if they were files\n"); X error("\t-pax-L\t\tfollow symbolic links as if they were files (PAX style)\n"); X error("\t-pax-H\t\tfollow symbolic links from cmdline as if they were files (PAX style)\n"); X error("\t-D\t\tdo not descend directories\n"); X error("\t-M,-xdev\tdo not descend mounting points\n"); X error("\t-w\t\tdo interactive creation/extraction/renaming\n"); X error("\t-pax-i\t\tdo interactive creation/extraction/renaming (PAX style)\n"); X error("\t-O\t\tbe compatible to old tar (except for checksum bug)\n"); X error("\t-P\t\tlast record may be partial (useful on cartridge tapes)\n"); X error("\t-S\t\tdo not store/create special files\n"); X error("\t-F,-FF,-FFF,...\tdo not store/create SCCS/RCS, core and object files\n"); X error("\t-U\t\trestore files unconditionally\n"); X error("\t-uncond-rename\twith interactive restore unconditionally ask for name\n"); X exit(ret); X /* NOTREACHED */ X} X XLOCAL void Xxusage(ret) X int ret; X{ X#ifdef STAR_FAT X switch (ptype) { X X case P_SUNTAR: X suntar_xusage(ret); exit(ret); X case P_GNUTAR: X gnutar_xusage(ret); exit(ret); X case P_PAX: X pax_xusage(ret); exit(ret); X case P_CPIO: X cpio_xusage(ret); exit(ret); X } X#endif X#ifdef USE_FIND X error("Usage:\t%s cmd [options] [-find] file1 ... filen [find expression]\n", get_progname()); X#else X error("Usage:\t%s cmd [options] file1 ... filen\n", get_progname()); X#endif X error("\t%s cli=name ...\n", get_progname()); X error("Extended options:\n"); X error("\tdiffopts=optlst\tcomma separated list of diffopts (see diffopts=help)\n"); X error("\t-debug\t\tprint additional debug messages\n"); X error("\txdebug=#,xd=#\tset extended debug level\n"); X error("\t-pax-ls\t\tprint a PAX type file listing\n"); X error("\t-silent\t\tno not print informational messages\n"); X error("\t-lowmem\t\ttry to use less memory for operation\n"); X error("\t-not,-V\t\tuse those files which do not match pat= pattern\n"); X error("\t-pax-match\tuse PAX like pattern matching\n"); X error("\t-pax-n\t\tonly one match per pattern allowed\n"); X error("\t-notarg,-pax-c\tuse those files which do not match file type pattern\n"); X error("\tVOLHDR=name\tuse name to generate a volume header\n"); X error("\t-xdir\t\textract dir even if the current is never\n"); X error("\t-xdot\t\textract first '.' or './' dir even if the current is never\n"); X error("\t-dirmode\twrite directories after the files they contain\n"); X error("\t-link-dirs\tlook for hard linked directories in create mode\n"); X error("\t-dump\t\tarchive more ino metadata (needed for incremental dumps)\n"); X error("\t-restore\trestore incremental dumps\n"); X error("\t-partial\tpermit to restore partial incremental dumps\n"); X error("\t-force-restore\tforce to restore partial incremental dumps\n"); X error("\t-no-xheader\tdo not read or write extended headers regardless of format\n"); X error("\t-meta\t\tuse inode metadata only (omit file content)\n"); X error("\t-xmeta\t\textract meta files\n"); X error("\t-dumpmeta\tuse inode metadata in dump mode if only ctime is newer\n"); X error("\t-keep-old-files,-k\tkeep existing files\n"); X error("\t-refresh-old-files\trefresh existing files, don't create new files\n"); X error("\t-refresh\trefresh existing files, don't create new files\n"); X error("\t-/\t\tdon't strip leading '/'s from file names\n"); X error("\t-..\t\tdon't skip filenames that contain '..' in non-interactive extract\n"); X error("\t-secure-links\tdon't extract links that start with '/' or contain '..' (default)\n"); X error("\t-no-secure-links\textract links that start with '/' or contain '..'\n"); X error("\t-no-dirslash\tdon't append a slash to directory names\n"); X error("\tlist=name\tread filenames from named file\n"); X error("\t-X name\t\texclude filenames from named file\n"); X error("\t-exclude-from name\texclude filenames from named file\n"); X error("\tpkglist=name\tread filenames from named file (unstable interface for sps)\n"); X error("\t-read0\t\tread null terminated filenames with list=\n"); X error("\t-data-change-warn\ttreat data/size changes in create more as warning only\n"); X error("\t-e\t\tabort on all error conditions undefined by errctl=\n"); X error("\terrctl=name\tread error contrl definitions from named file\n"); X error("\t-dodesc\t\tdo descend directories found in a list= file\n"); X error("\tpattern=p,pat=p\tset matching pattern\n"); X error("\t-match-tree\tdo not scan the content of non matching dirs in create mode\n"); X error("\ts=replstr\tApply ed like pattern substitution -s /old/new/gp on filenames\n"); X error("\tlevel=dumplevel\tset current incremental dump level\n"); X error("\t-cumulative\tmake a cumulative incremental dump (relative to same level)\n"); X error("\ttardumps=name\tset file name for tar dump dates, default is %s\n", dumpdates); X error("\t-wtardumps\tupdate file for tar dump dates if in dump mode\n"); X error("\tdumpdate=name\tuse timestamp from name instead of current time for %s\n", dumpdates); X error("\tfs-name=name\tuse name instead of mount point for %s\n", dumpdates); X error("\tmaxsize=#\tdo not store file if bigger than # (default mult is kB)\n"); X error("\tnewer=name\tstore only files which are newer than 'name'\n"); X error("\t-multivol\tread/write/list a multi volume archive\n"); X error("\tnew-volume-script=script\tcall 'script' at end of each volume\n"); X error("\t-ctime\t\tuse ctime for newer= option\n"); X error("\t-nodump\t\tdo not dump files that have the nodump flag set\n"); X error("\t-acl\t\thandle access control lists\n"); X error("\t-xattr\t\thandle extended file attributes\n"); X error("\t-xattr-linux\t\thandle extended file attributes (Linux variant)\n"); X error("\t-xfflags\thandle extended file flags\n"); X error("\t-prinodes\tif archive contains inode number, print them in list mode\n"); X error("\tbs=#\t\tset (output) block size to #\n"); X#ifdef FIFO X error("\tfs=#\t\tset fifo size to #\n"); X#endif X error("\ttsize=#\t\tset tape volume size to # (default multiplier is 512)\n"); X error("\t-qic24\t\tset tape volume size to %d kBytes\n", X TSIZE(QIC_24_TSIZE)/1024); X error("\t-qic120\t\tset tape volume size to %d kBytes\n", X TSIZE(QIC_120_TSIZE)/1024); X error("\t-qic150\t\tset tape volume size to %d kBytes\n", X TSIZE(QIC_150_TSIZE)/1024); X error("\t-qic250\t\tset tape volume size to %d kBytes\n", X TSIZE(QIC_250_TSIZE)/1024); X error("\t-qic525\t\tset tape volume size to %d kBytes\n", X TSIZE(QIC_525_TSIZE)/1024); X error("\t-no-fsync\tdo not call fsync() for each extracted file (may be dangerous)\n"); X error("\t-nowarn\t\tdo not print warning messages\n"); X error("\t-time\t\tprint timing info\n"); X error("\t-no-statistics\tdo not print statistics\n"); X error("\t-cpio-statistics\tprint cpio style statistics\n"); X#ifdef FIFO X error("\t-fifostats\tprint fifo statistics\n"); X#endif X error("\t-numeric\tdon't use user/group name from tape\n"); X error("\t-newest\t\tfind newest file on tape\n"); X error("\t-newest-file\tfind newest regular file on tape\n"); X error("\t-hpdev\t\tuse HP's non POSIX compliant method to store dev numbers\n"); X error("\t-modebits\tinclude all 16 bits from stat.st_mode, this violates POSIX-1003.1\n"); X error("\t-copylinks\tCopy hard and symlinks rather than linking\n"); X error("\t-copyhardlinks\tCopy hardlink source files rather than linking\n"); X error("\t-copysymlinks\tCopy symlink source files rather than linking\n"); X error("\t-copydlinks\tCopy the content of linked dirs\n"); X error("\t-hardlinks\tExtract symlinks as hardlinks\n"); X error("\t-link-data\tInclude data for hard linked files\n"); X error("\t-symlinks\tExtract hardlinks as symlinks\n"); X error("\t-signed-checksum\tuse signed chars to calculate checksum\n"); X error("\trmt=path\tSpecify remote path to remote tape server program\n"); X error("\trsh=path\tSpecify path to remote login program\n"); X error("\t-sparse\t\thandle file with holes effectively on store/create\n"); X error("\t-force-hole\ttry to extract all files with holes\n"); X error("\t-to-stdout\textract files to stdout\n"); X error("\t-wready\t\twait for tape drive to become ready\n"); X error("\t-force-remove\tforce to remove non writable files on extraction\n"); X error("\t-ask-remove\task to remove non writable files on extraction\n"); X error("\t-remove-first\tremove files before extraction\n"); X error("\t-remove-recursive\tremove files recursive\n"); X error("\t-keep-nonempty-dirs\tdo not complain about non-empty dirs\n"); X error("\t-install\tcarefully replace old files with -x, similar to install(1)\n"); X error("\tdir-owner=user\tIntermediate created directories will be owned by 'user'.\n"); X error("\tdir-group=user\tIntermediate created directories will be owned by 'group'.\n"); X error("\tumask=mask\tSet star's umask to 'mask'.\n"); X error("\t-onull,-nullout\tsimulate creating an achive to compute the size\n"); X exit(ret); X /* NOTREACHED */ X} X#endif /* NO_STAR_MAIN */ X XLOCAL void Xdusage(ret) X int ret; X{ X error("Diff options:\n"); X error("\tnot\t\tif this option is present, exclude listed options\n"); X error("\t!\t\tif this option is present, exclude listed options\n"); X error("\tall\t\tcompare everything\n"); X error("\tperm\t\tcompare file permissions\n"); X error("\tmode\t\tcompare file permissions\n"); X error("\tsymperm\t\tcompare symlink permissions\n"); X error("\ttype\t\tcompare file type\n"); X error("\tnlink\t\tcompare linkcount (star dump mode only)\n"); X error("\tuid\t\tcompare owner of file\n"); X error("\tgid\t\tcompare group of file\n"); X error("\tuname\t\tcompare name of owner of file\n"); X error("\tgname\t\tcompare name of group of file\n"); X error("\tid\t\tcompare owner, group, ownername and groupname of file\n"); X error("\tsize\t\tcompare file size\n"); X error("\tdata\t\tcompare content of file\n"); X error("\tcont\t\tcompare content of file\n"); X error("\trdev\t\tcompare rdev of device node\n"); X error("\thardlink\tcompare target of hardlink\n"); X error("\tsymlink\t\tcompare target of symlink\n"); X error("\tsympath\t\tcompare target pathname of symlink\n"); X error("\tsparse\t\tcompare if both files are sparse or not\n"); X error("\tatime\t\tcompare access time of file (only star)\n"); X error("\tmtime\t\tcompare modification time of file\n"); X error("\tctime\t\tcompare creation time of file (only star)\n"); X error("\ttimes\t\tcompare all times of file\n"); X error("\tlmtime\t\tcompare modification time of symlinks\n"); X error("\txtimes\t\tcompare all times and lmtime\n"); X error("\tnsecs\t\tcompare nanoseconds in times\n"); X error("\tdir\t\tcompare directory content (star dump mode only)\n"); X#ifdef USE_ACL X error("\tacl\t\tcompare access control lists (specify -acl also)\n"); X#endif X#ifdef USE_XATTR X error("\txattr\t\tcompare extended attributes (specify -xattr also)\n"); X#endif X#ifdef USE_FFLAGS X error("\tfflags\t\tcompare extended file flags (specify -xfflags also)\n"); X#endif X error("\n"); X error("Default is to compare everything except atime.\n"); X exit(ret); X /* NOTREACHED */ X} X XLOCAL void Xhusage(ret) X int ret; X{ X error("Header types (default marked with '*'):\n"); X hdr_usage(); X exit(ret); X /* NOTREACHED */ X} X X#ifndef NO_STAR_MAIN XLOCAL void Xgargs(ac, av) X int ac; X char *const *av; X{ X int files = 0; X int minfiles = 1; X BOOL help = FALSE; X BOOL xhelp = FALSE; X BOOL prvers = FALSE; X BOOL xcopy = FALSE; X BOOL oldtar = FALSE; X BOOL no_fifo = FALSE; X BOOL usetape = FALSE; X BOOL dodesc = FALSE; X BOOL qic24 = FALSE; X BOOL qic120 = FALSE; X BOOL qic150 = FALSE; X BOOL qic250 = FALSE; X BOOL qic525 = FALSE; X BOOL dchangeflag = FALSE; X char *pkglistfile = NULL; X char *diruid = NULL; X char *dirgid = NULL; X char *u_mask = NULL; X char *paxopts = NULL; X const char *p; X Llong llbs = 0; Xsigned char archive = -1; /* On IRIX, we have unsigned chars by default */ XBOOL Ointeractive = FALSE; X X/* BEGIN CSTYLED */ X/*char _opts[] = "C*,find~,help,xhelp,version,debug,xdebug#,xd#,bsdchdir,pax-ls,level#,tardumps*,wtardumps,time,no_statistics,no-statistics,cpio-statistics,fifostats,numeric,v+,block-number,tpath,c,u,r,x,t,copy,xcopy,n,diff,diffopts&,H&,artype&,print-artype,fs-name*,force_hole,force-hole,sparse,to_stdout,to-stdout,wready,force_remove,force-remove,ask_remove,ask-remove,remove_first,remove-first,remove_recursive,remove-recursive,keep-nonempty-dirs,install,nullout,onull,fifo,no_fifo,no-fifo,shm,fs&,VOLHDR*,list*,pkglist*,multivol,new-volume-script*,force-local,restore,partial,force-restore,freeze,file&,f&,T,Z,z,bz,j,lzo,7z,xz,lzip,zstd,lzma,compress-program*,rmt*,rsh*,bs&,blocks&,b&,B,pattern&,pat&,i,d,m,o,nochown,pax-o*,pax-p&,a,atime,p,no-p,dirmode,l,h,L,pax-L~,pax-H~,pax-P~,D,dodesc,M,xdev,w,pax-i,I,X&,exclude-from&,O,signed_checksum,signed-checksum,P,S,F+,U,uncond-rename,xdir,xdot,k,keep_old_files,keep-old-files,refresh_old_files,refresh-old-files,refresh,/,..,secure-links,no-secure-links%0,no-dirslash,not,V,match-tree,pax-match,pax-n,pax-c,notarg,maxsize&,newer*,ctime,nodump,tsize&,qic24,qic120,qic150,qic250,qic525,nowarn,newest_file,newest-file,newest,hpdev,modebits,copylinks,copyhardlinks,copysymlinks,copydlinks,hardlinks,symlinks,link-data,acl,xattr,xattr-linux,xfflags,link-dirs,dumpdate*,dump,cumulative,dump-cumulative,meta,dumpmeta,xmeta,silent,lowmem,no-xheader,no-fsync%1,do-fsync%0,read0,errctl&,e,data-change-warn,prinodes,dir-owner*,dir-group*,umask*,s&,?";*/ X/* END CSTYLED */ X X getarginit(&gaprops, GAF_DEFAULT); /* Set default behavior */ X#ifdef STAR_FAT X switch (ptype) { X X case P_SUNTAR: X suntar_gargs(ac, av); X return; X case P_GNUTAR: X gnutar_gargs(ac, av); X return; X case P_PAX: X pax_gargs(ac, av); X return; X case P_CPIO: X cpio_gargs(ac, av); X return; X } X#endif X X p = filename(av[0]); X if (streql(p, "ustar")) { X /* X * If we are called as "ustar" we are as POSIX-1003.1-1988 X * compliant as possible. There are no enhancements at all. X */ X hdrtype = H_USTAR; X } else if (streql(p, "tar")) { X /* X * If we are called as "tar" we are mostly POSIX compliant X * and use POSIX-1003.1-2001 extensions. The differences of the X * base format compared to POSIX-1003.1-1988 can only be X * regocnised by star. Even the checsum bug of the "pax" X * reference implementation is not hit by the fingerprint X * used to allow star to discriminate XUSTAR from USTAR. X */ X hdrtype = H_XUSTAR; X } X /* X * Current default archive format in all other cases is XSTAR (see X * above). This will not change until 2004 (then the new XUSTAR format X * is recognised by star for at least 5 years and we may asume that X * all star installations will properly handle it. X * XSTAR is USTAR with extensions similar to GNU tar. X */ X X iftype = I_TAR; /* command line interface */ X ptype = P_STAR; /* program interface type */ X X if (pname) { /* cli=xxx seen as argv[1] */ X --ac, av++; X } X --ac, ++av; X files = getfilecount(ac, av, opts); X if (getlallargs(&ac, &av, &gaprops, opts, X &dir_flags, X getfind, NULL, X &help, &xhelp, &prvers, &debug, &xdebug, &xdebug, X &bsdchdir, &paxls, X &dumplevel, &dumpdates, &wtardumps, X &showtime, &no_stats, &no_stats, &cpio_stats, X &do_fifostats, X &numeric, &verbose, &prblockno, &tpath, X#ifndef __old__lint X &cflag, X &uflag, X &rflag, X &xflag, X &tflag, X ©flag, &xcopy, X &nflag, X &diff_flag, add_diffopt, &diffopts, X gethdr, &chdrtype, gethdr, &chdrtype, X &print_artype, X &fs_name, X &force_hole, &force_hole, &sparse, &to_stdout, &to_stdout, &wready, X &force_remove, &force_remove, &ask_remove, &ask_remove, X &remove_first, &remove_first, &remove_recursive, &remove_recursive, X &keep_nonempty_dirs, &do_install, X &nullout, &nullout, X &use_fifo, &no_fifo, &no_fifo, &shmflag, X getenum, &fs, X &volhdr, X &listfile, &pkglistfile, X &multivol, &newvol_script, X &force_noremote, X &dorestore, &dopartial, &forcerestore, X &freezeflag, X /* X * All options starting with -f need to appear X * before this line. X */ X addtarfile, NULL, X addtarfile, NULL, X &usetape, X &Zflag, &zflag, &bzflag, &bzflag, &lzoflag, X &p7zflag, &xzflag, &lzipflag, &zstdflag, &lzmaflag, X &compress_prg, X &rmt, &rsh, X getenum, &bs, X getbnum, &llbs, X getbnum, &llbs, X &multblk, X addpattern, NULL, X addpattern, NULL, X &ignoreerr, X &nodir, X &nomtime, &nochown, &nochown, X &paxopts, X getpaxpriv, NULL, X &acctime, &acctime, X &pflag, &nopflag, &dirmode, X &nolinkerr, X &follow, &follow, X#ifdef USE_FIND X getpaxL, &walkflags, X getpaxH, &walkflags, X getpaxP, &walkflags, X#else X getpaxL, NULL, X getpaxH, NULL, X getpaxP, NULL, X#endif X &nodesc, X &dodesc, X &nomount, &nomount, X &interactive, &paxinteract, X &Ointeractive, X getexclude, NULL, X getexclude, NULL, X &oldtar, &signedcksum, &signedcksum, X &partial, X &nospec, &Fflag, X &uncond, &uncond_rename, X &xdir, &xdot, X &keep_old, &keep_old, &keep_old, X &refresh_old, &refresh_old, &refresh_old, X &abs_path, &allow_dotdot, X &secure_links, &secure_links, X &no_dirslash, X ¬pat, ¬pat, &match_tree, X &paxmatch, &paxnflag, ¬arg, ¬arg, X getknum, &maxsize, X &stampfile, X &Ctime, X &nodump, X getbnum, &tsize, X &qic24, X &qic120, X &qic150, X &qic250, X &qic525, X &nowarn, X#endif /* __old__lint */ X &listnewf, &listnewf, X &listnew, X &hpdev, &modebits, X ©links, ©hardlinks, ©symlinks, X ©dlinks, X &hardlinks, &symlinks, &linkdata, X &doacl, &doxattr, &dolxattr, &dofflags, X &link_dirs, X &dd_name, X &dodump, &dump_cumulative, &dump_cumulative, X &dometa, &dumpmeta, &xmeta, X &silent, &lowmem, &no_xheader, X &no_fsync, &no_fsync, X &readnull, X errconfig, NULL, X &errflag, &dchangeflag, X &prinodes, X &diruid, &dirgid, &u_mask, X parsesubst, &do_subst, &archive) < 0) { X errmsgno(EX_BAD, "Bad Option: %s.\n", av[0]); X susage(EX_BAD); X } X X if (archive != -1 && !(archive >= '0' && archive <= '7')) { X errmsgno(EX_BAD, "Bad Option: -%c.\n", archive); X susage(EX_BAD); X } X star_helpvers("star", help, xhelp, prvers); X X if (Ointeractive) { X comerrno(EX_BAD, "Option -I is obsolete and will get a different meaning in next release, use -w instead.\n"); X } X if (xcopy) { X copyflag = TRUE; X sparse = TRUE; X doacl = TRUE; X xdot = TRUE; X } X if (tsize == 0) { X if (qic24) tsize = QIC_24_TSIZE; X if (qic120) tsize = QIC_120_TSIZE; X if (qic150) tsize = QIC_150_TSIZE; X if (qic250) tsize = QIC_250_TSIZE; X if (qic525) tsize = QIC_525_TSIZE; X } X if (pkglistfile != NULL) { X listfile = pkglistfile; X pkglist = TRUE; X } X if (u_mask) { X long l; X X if (*astolb(u_mask, &l, 8)) X comerrno(EX_BAD, "Bad umask '%s'.\n", u_mask); X umask((mode_t)l); X } X if (diruid) { X Llong ll; X uid_t uid; X X if (!ic_uidname(diruid, strlen(diruid), &uid)) { X if (*astollb(diruid, &ll, 10)) X comerrno(EX_BAD, "Bad uid '%s'.\n", diruid); X dir_uid = ll; X } else { X dir_uid = uid; X } X } X if (dirgid) { X Llong ll; X gid_t gid; X X if (!ic_gidname(dirgid, strlen(dirgid), &gid)) { X if (*astollb(dirgid, &ll, 10)) X comerrno(EX_BAD, "Bad gid '%s'.\n", diruid); X dir_gid = ll; X } else { X dir_gid = gid; X } X } X X if (dchangeflag) X errconfig("WARN|GROW|SHRINK *"); X X star_checkopts(oldtar, dodesc, usetape, archive, no_fifo, X paxopts, llbs); X#ifdef USE_FIND X if (dofind && find_ac > 0) { X int cac = find_ac; X char *const * cav = find_av; X finda_t fa; X X if (copyflag) X cac--; X find_firstprim(&cac, &cav); X find_pac = cac; X find_pav = cav; X files = find_ac - cac; X if (!copyflag && !cflag && files > 0) X comerrno(EX_BAD, "Path arguments not yet supported in extract mode.\n"); X X if (cac > 0) { X BOOL did_stdout = FALSE; X int i; X X now = time(0); X now = now +60; X find_argsinit(&fa); X fa.walkflags = walkflags; X fa.Argc = cac; X fa.Argv = (char **)cav; X find_node = find_parse(&fa); X if (fa.primtype == FIND_ERRARG) X comexit(fa.error); X if (fa.primtype != FIND_ENDARGS) X comerrno(EX_BAD, "Incomplete expression.\n"); X plusp = fa.plusp; X find_patlen = fa.patlen; X walkflags = fa.walkflags; X maxdepth = fa.maxdepth; X mindepth = fa.mindepth; X X for (i = 0; i < ntarfiles; i++) { X if (tarfiles[i][0] == '-' && tarfiles[i][1] == '\0') X did_stdout = TRUE; X } X if (ntarfiles == 1 && nullout) X did_stdout = FALSE; X X if (find_node && (did_stdin || did_stdout)) { X if (find_pname(find_node, "-exec") || X find_pname(find_node, "-execdir") || X find_pname(find_node, "-exec+") || X find_pname(find_node, "-execdir+") || X find_pname(find_node, "-ok") || X find_pname(find_node, "-okdir")) X comerrno(EX_BAD, X "Cannot -exec with f=-.\n"); X if (cflag && did_stdout && X (find_pname(find_node, "-print") || X find_pname(find_node, "-print0") || X find_pname(find_node, "-printnnl") || X find_pname(find_node, "-ls"))) X comerrno(EX_BAD, X "Cannot -print/-ls with f=-.\n"); X } X } X } X#endif X star_nfiles(files, minfiles); X} X#endif /* NO_STAR_MAIN */ X XLOCAL void Xstar_mkvers() X{ X char buf[512]; Xextern char strvers[]; Xextern char dvers[]; X X if (vers != NULL) X return; X X js_snprintf(buf, sizeof (buf), X "%s %s (%s-%s-%s) %s", "star", strvers, X HOST_CPU, HOST_VENDOR, HOST_OS, X dvers); X X vers = ___savestr(buf); X} X XLOCAL void Xstar_helpvers(name, help, xhelp, prvers) X char *name; X BOOL help; X BOOL xhelp; X BOOL prvers; X{ X if (help) X usage(0); X if (xhelp) X xusage(0); X star_mkvers(); X if (prvers) { X printf("%s: %s\n\n", name, vers); X gtprintf("Options:"); X#ifdef USE_ACL X opt_acl(); X#endif X#ifdef USE_FIND X printf(" find"); X#endif X#ifdef USE_FFLAGS X opt_fflags(); X#endif X#ifdef USE_REMOTE X opt_remote(); X#endif X#ifdef USE_XATTR X opt_xattr(); X#endif X#ifdef USE_SELINUX X opt_selinux(); X#endif X gtprintf("\n\n"); X gtprintf("Copyright (C) 1985, 88-90, 92-96, 98, 99, 2000-2019 Jörg Schilling\n"); X gtprintf("This is free software; see the source for copying conditions. There is NO\n"); X gtprintf("warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"); X exit(0); X } X} X XLOCAL void Xstar_checkopts(oldtar, dodesc, usetape, archive, no_fifo, paxopts, llbs) X BOOL oldtar; /* -O oldtar option */ X BOOL dodesc; /* -dodesc descend dirs from listfile */ X BOOL usetape; /* -T usetape option */ X int archive; /* -0 .. -9 archive option */ X BOOL no_fifo; /* -no-fifo option */ X const char * paxopts; /* -pax-o / -o option */ X Llong llbs; /* blocks= option */ X{ X int n; X X if (print_artype) { X tflag = TRUE; X no_fifo = TRUE; X } X if ((n = xflag + cflag + uflag + rflag + tflag + copyflag + nflag + diff_flag) > 1) { X if ((n == 2) && copyflag && (tflag || diff_flag)) { X /* X * This is OK: star -copy -t or star -copy -diff X */ X /* EMPTY */ X } else if ((n == 2) && cflag && (tflag || diff_flag)) { X copyflag = TRUE; X cflag = FALSE; X } else { X errmsgno(EX_BAD, X "Too many commands, only one of -x -c -u -r -t -copy -n or -diff is allowed.\n"); X susage(EX_BAD); X } X } X if (!(xflag | cflag | uflag | rflag | tflag | copyflag | nflag | diff_flag)) { X errmsgno(EX_BAD, "Missing command, must specify -x -c -u -r -t -copy -n or -diff.\n"); X susage(EX_BAD); X } X if (uflag || rflag) { X cflag = TRUE; X no_fifo = TRUE; /* Until we are able to reverse the FIFO */ X dump_partial = TRUE; X } X if (nullout && !cflag) { X errmsgno(EX_BAD, "-nullout only makes sense in create mode.\n"); X susage(EX_BAD); X } X if (no_fifo || nullout) X use_fifo = FALSE; X#ifndef FIFO X if (use_fifo) { X errmsgno(EX_BAD, "Fifo not configured in.\n"); X susage(EX_BAD); X } X#endif X X if (ptype == P_SUNTAR) X nolinkerr ^= tcompat; X X noxdir = nodir; X if (xdir) /* Extract all dirs uncond */ X xdot = FALSE; X X if (copylinks) { X copyhardlinks = TRUE; X copysymlinks = TRUE; X } X if (copyflag) { X hdrtype = chdrtype = H_EXUSTAR; X dodump = TRUE; X partial = TRUE; /* Important as we fiddle with FIFO obs */ X binflag = TRUE; X nodir = FALSE; X multivol = FALSE; X linkdata = FALSE; X X if (!tflag && !diff_flag) X xflag = TRUE; X X if (!use_fifo) { X errmsgno(EX_BAD, "Need fifo for -copy mode.\n"); X susage(EX_BAD); X } X } X if (cflag && linkdata && sparse) X linkdata = FALSE; /* XXX Cannot yet do sparse datalinks */ X X if (dumplevel >= 0) { X /* X * This is an articicial limitation, our code supports an X * unlimited number of dump levels. X */ X if (dumplevel > 99) X comerrno(EX_BAD, "Illegal dump level, use 0..99\n"); X dodump = TRUE; X if (!nomount) X comerrno(EX_BAD, "A dump needs the -M/-xdev option.\n"); X } X if (dodump) { X chdrtype = H_EXUSTAR; X if (lowmem) X comerrno(EX_BAD, "Dump mode does not work with -lowmem.\n"); X } X if (dump_cumulative) { X if (dumplevel < 0) X comerrno(EX_BAD, "With -cumulative, level= is needed.\n"); X } X if (maxsize > 0 || Fflag > 0 || nospec || nodump) X dump_partial = TRUE; X X if (dopartial) X dorestore = TRUE; X if (forcerestore) X dorestore = TRUE; X if (dorestore) { X xdir = TRUE; X if (secure_links < 0) X secure_links = FALSE; X if (!uncond) X comerrno(EX_BAD, "A restore needs the -U option.\n"); X if (do_install) X comerrno(EX_BAD, "-install not allowed in restore mode.\n"); X } X if (secure_links < 0) X secure_links = TRUE; X if (oldtar) X chdrtype = H_OTAR; X if (chdrtype != H_UNDEF) { X if (H_TYPE(chdrtype) == H_OTAR) X oldtar = TRUE; /* XXX hack */ X } X /* X * We do not set chdrtype here in case it is H_UNDEF and -r or -u have X * been specified. X */ X if (cflag && (!(rflag || uflag) || chdrtype != H_UNDEF)) { X if (chdrtype != H_UNDEF) X hdrtype = chdrtype; X chdrtype = hdrtype; /* wegen setprops(chdrtype) in main() */ X X /* X * hdrtype und chdrtype X * bei uflag, rflag sowie xflag, tflag, nflag, diff_flag X * in get_tcb vergleichen ! X */ X } X if (no_dirslash && chdrtype == H_OTAR) { X errmsgno(EX_BAD, "-no-dirslash cannot be used with the old tar format\n"); X susage(EX_BAD); X } X if (diff_flag) { X if (diffopts == 0) X diffopts = D_DEFLT; X } else if (diffopts != 0) { X errmsgno(EX_BAD, "diffopts= only makes sense with -diff\n"); X susage(EX_BAD); X } X if (fs == 0L) { X char *ep = getenv("STAR_FIFOSIZE"); X X if (ep) { X if (getnum(ep, &fs) != 1) { X comerrno(EX_BAD, X "Bad fifo size environment '%s'.\n", X ep); X } X } X } X if (llbs != 0 && bs != 0) { X errmsgno(EX_BAD, "Only one of blocks= b= bs=.\n"); X susage(EX_BAD); X } X if (llbs != 0) { X bs = (long)llbs; X if (bs != llbs) { X errmsgno(EX_BAD, "Blocksize used with blocks= or b= too large.\n"); X susage(EX_BAD); X } X } X if (bs % TBLOCK) { X errmsgno(EX_BAD, "Invalid block size %ld.\n", bs); X susage(EX_BAD); X } X if (bs) X nblocks = bs / TBLOCK; X if ((nblocks <= 0) || X ((rflag || uflag) && nblocks < 2)) { X errmsgno(EX_BAD, "Invalid block size %d blocks.\n", nblocks); X susage(EX_BAD); X } X bs = nblocks * TBLOCK; X if (debug) { X errmsgno(EX_BAD, "Block size %d blocks (%ld bytes).\n", nblocks, bs); X } X if (tsize > 0) { X if (tsize % TBLOCK) { X errmsgno(EX_BAD, "Invalid tape size %llu.\n", tsize); X susage(EX_BAD); X } X tsize /= TBLOCK; X } X X if (pkglist) { X dodesc = FALSE; X readnull = FALSE; X if (!cflag) X comerrno(EX_BAD, "pkglist= option only works in create mode.\n"); X } X if (listfile != NULL) X dump_partial = TRUE; X X if (listfile != NULL && !dodesc) X nodesc = TRUE; X if (oldtar) X nospec = TRUE; X if (!tarfiles[0]) { X if (usetape) { X tarfiles[0] = getenv("TAPE"); X } X if ((usetape || archive > 0) && X !tarfiles[0]) { X static char arname[] = "archive0="; X Ullong otsize = tsize; X char *dfltfile = NULL; X X#ifdef DFLT_FILE X#define DFILE DFLT_FILE X#else X#define DFILE NULL X#endif X /* X * If we got a digit option, check for an 'archive#=' X * entry in /etc/default/[s!]tar. If there was no -f X * or digit option, look for 'archive0='. X */ X if (archive < '0' || archive > '9') X archive = '0'; X arname[7] = (char)archive; X if (ptype == P_SUNTAR) X dfltfile = DFILE; X if (!star_darchive(arname, dfltfile)) { X errmsgno(EX_BAD, X "Archive entry %c not found in %s. %s", X archive, X get_stardefaults(DFILE), X "Using stdin/stdout as archive.\n"); X tarfiles[0] = NULL; X tsize = otsize; X } X } X if (!tarfiles[0]) X tarfiles[0] = "-"; X ntarfiles++; X } X if (!cflag && !copyflag) { X for (n = 0; n < ntarfiles; n++) { X if (tarfiles[n][0] == '-' && tarfiles[n][1] == '\0') X check_stdin("-f"); X } X } X if (tsize % nblocks) { X /* X * Silently round down to a multiple of the tape block size. X */ X tsize /= nblocks; X tsize *= nblocks; X } X /* X * XXX This must be rethought with files split by multi volume and X * XXX with with volume headers and continuation headers. X */ X if (tsize > 0 && tsize < 3) { X errmsgno(EX_BAD, "Tape size must be at least 3 blocks.\n"); X susage(EX_BAD); X } X /* X * XXX This is a place that should be checked every time, when X * XXX possible interactivity is modified. X */ X if (interactive || ask_remove || X ((multivol || tsize > 0) && !newvol_script)) { X#ifdef JOS X tty = stderr; X#else X#ifdef HAVE__DEV_TTY X if ((tty = lfilemopen("/dev/tty", "r", S_IRWALL)) == (FILE *)NULL) X comerr("Cannot open '/dev/tty'.\n"); X#else X tty = stderr; X#endif X#endif X } X if (nflag) { X xflag = TRUE; X interactive = TRUE; X if (verbose == 0 && !tpath) X verbose = 1; X } X if (to_stdout) { X force_hole = FALSE; X } X if (keep_old && refresh_old) { X errmsgno(EX_BAD, "Cannot use -keep-old-files and -refresh-old-files together.\n"); X susage(EX_BAD); X } X if ((copylinks + hardlinks + symlinks) > 1) { X errmsgno(EX_BAD, "Only one of -copylinks -hardlinks -symlinks.\n"); X susage(EX_BAD); X } X X if (my_uid == 0 && !nopflag) X pflag = TRUE; X X /* X * -acl includes -p X */ X if (doacl) X pflag = TRUE; X X if (doxattr) { X#ifndef O_XATTR X errmsgno(EX_BAD, X "This platform does not support NFSv4 extended attribute files.\n"); X comerrno(EX_BAD, X "-xattr is reserved for NFSv4 extended attributes, for Linux use -xattr-linux\n"); X#else X comerrno(EX_BAD, X "NFSv4 extended attribute files are not yet supported.\n"); X#endif X } X X if (paxopts) { X if (!ppaxopts(paxopts)) { X errmsgno(EX_BAD, "Unsupported option '%s' for %s.\n", X paxopts, X iftype == I_PAX ? "-o" : "-pax-o"); X susage(EX_BAD); X } X } X X star_defaults(&fs, &no_fsync, NULL); X if (no_fsync < 0) X no_fsync = FALSE; X} X XEXPORT void Xstar_verifyopts() X{ X if (cflag && (props.pr_flags & PR_LINK_DATA) == 0) X linkdata = FALSE; X if (cflag && multivol && (props.pr_flags & PR_MULTIVOL) == 0) { X errmsgno(EX_BAD, X "Multi volume archives are not supported with %s format.\n", X hdr_name(chdrtype)); X susage(EX_BAD); X } X if (cflag && doacl) { X /* X * Check properties for archive format. X */ X if ((props.pr_xhmask & (XF_ACL_ACCESS|XF_ACL_DEFAULT|XF_ACL_ACE)) == 0) { X errmsgno(EX_BAD, X "Archive format '%s' does not support -acl.\n", X hdr_name(chdrtype)); X susage(EX_BAD); X } X } X} X XLOCAL void Xstar_nfiles(files, minfiles) X int files; X int minfiles; X{ X if (cflag || copyflag) { X if (copyflag && !tflag) X minfiles++; X if (listfile) X minfiles--; X if (files < minfiles) { X errmsgno(EX_BAD, "Too few arguments; will not create an empty archive.\n"); X susage(EX_BAD); X } X } X} X X/* ARGSUSED */ XLOCAL int XgetpaxH(arg, valp, pac, pav) X char *arg; X long *valp; X int *pac; X char *const **pav; X{ X#ifdef GETARG_DEBUG X error("paxH\n"); X#endif X paxfollow = FALSE; X paxHflag = TRUE; X#ifdef USE_FIND X *(int *)valp |= WALK_ARGFOLLOW; X#endif X return (1); X} X X/* ARGSUSED */ XLOCAL int XgetpaxL(arg, valp, pac, pav) X char *arg; X long *valp; X int *pac; X char *const **pav; X{ X#ifdef GETARG_DEBUG X error("paxL\n"); X#endif X paxfollow = TRUE; X paxHflag = FALSE; X#ifdef USE_FIND X *(int *)valp |= WALK_ALLFOLLOW; X#endif X return (1); X} X X/* ARGSUSED */ XLOCAL int XgetpaxP(arg, valp, pac, pav) X char *arg; X long *valp; X int *pac; X char *const **pav; X{ X#ifdef GETARG_DEBUG X error("paxP\n"); X#endif X paxfollow = FALSE; X paxHflag = FALSE; X#ifdef USE_FIND X *(int *)valp &= ~(WALK_ARGFOLLOW | WALK_ALLFOLLOW); X#endif X return (1); X} X X/* ARGSUSED */ XLOCAL int Xgetfind(arg, valp, pac, pav) X char *arg; X long *valp; /* Not used until we introduce a ptr to opt struct */ X int *pac; X char *const **pav; X{ X#ifdef USE_FIND X dofind = TRUE; X find_ac = *pac; X find_av = *pav; X find_ac--, find_av++; X return (NOARGS); X#else X return (BADFLAG); X#endif X} X X/* ARGSUSED */ XLOCAL int Xgetpaxpriv(arg, valp) X char *arg; X long *valp; /* Not used until we introduce a ptr to opt struct */ X{ X register char *p = arg; X register char c; X X while ((c = *p++) != '\0') { X switch (c) { X X case 'a': /* do not preserve access time */ X noatime = TRUE; X break; X X case 'e': /* preserve everything */ X pflag = TRUE; X doacl = TRUE; X doxattr = TRUE; X dolxattr = TRUE; X dofflags = TRUE; X noatime = FALSE; X nomtime = FALSE; X nochown = FALSE; X break; X X case 'm': /* do not preserve modification time */ X nomtime = TRUE; X break; X X case 'o': /* preserve userid/grupid & SUID/SGID */ X nochown = FALSE; X break; X X case 'p': /* preserve file mode bits (permissions) */ X pflag = TRUE; X break; X X default: X errmsgno(EX_BAD, X "Bad character '%c' in option '-p %s'.\n", X c, arg); X return (-1); X } X } X return (1); X} X XLOCAL int Xgetlldefault(arg, valp, mult) X char *arg; X Llong *valp; X int mult; X{ X int ret = 1; X int len = strlen(arg); X X if (len > 0) { X len = (Uchar)arg[len-1]; X if (!isdigit(len)) X mult = 1; X } X ret = getllnum(arg, valp); X if (ret == 1) X *valp *= mult; X else X errmsgno(EX_BAD, "Badly formed number '%s'.\n", arg); X return (ret); X} X XEXPORT int Xgetbnum(arg, valp) X char *arg; X Llong *valp; X{ X return (getlldefault(arg, valp, 512)); X} X XEXPORT int Xgetknum(arg, valp) X char *arg; X Llong *valp; X{ X return (getlldefault(arg, valp, 1024)); X} X XLOCAL int Xgetenum(arg, valp) X char *arg; X long *valp; X{ X int ret = getnum(arg, valp); X X if (ret != 1) X errmsgno(EX_BAD, "Badly formed number '%s'.\n", arg); X return (ret); X} X XLOCAL int Xaddtarfile(tarfile) X const char *tarfile; X{ X#ifdef ADDARG_DEBUG X if (debug) X error("Add tar file '%s'.\n", tarfile); X#endif X X if (ntarfiles >= NTARFILE) X comerrno(EX_BAD, "Too many tar files (max is %d).\n", NTARFILE); X X if (ntarfiles > 0 && (streql(tarfile, "-") || streql(tarfiles[0], "-"))) X comerrno(EX_BAD, "Cannot handle multi volume archives from/to stdin/stdout.\n"); X X tarfiles[ntarfiles] = tarfile; X ntarfiles++; X return (TRUE); X} X XLOCAL int Xadd_diffopt(optstr, flagp) X char *optstr; X long *flagp; X{ X char *ep; X char *np; X int optlen; X long optflags = 0; X BOOL not = FALSE; X X while (*optstr) { X if ((ep = strchr(optstr, ',')) != NULL) { X Intptr_t pdiff = ep - optstr; X X optlen = (int)pdiff; X if (optlen != pdiff) /* lint paranoia */ X return (-1); X np = &ep[1]; X } else { X optlen = strlen(optstr); X np = &optstr[optlen]; X } X if (optstr[0] == '!') { X optstr++; X optlen--; X not = TRUE; X } X if (strncmp(optstr, "not", optlen) == 0 || X strncmp(optstr, "!", optlen) == 0) { X not = TRUE; X } else if (strncmp(optstr, "all", optlen) == 0) { X optflags |= D_ALL; X } else if (strncmp(optstr, "perm", optlen) == 0) { X optflags |= D_PERM; X } else if (strncmp(optstr, "mode", optlen) == 0) { X optflags |= D_PERM; X } else if (strncmp(optstr, "symperm", optlen) == 0) { X optflags |= D_SYMPERM; X } else if (strncmp(optstr, "type", optlen) == 0) { X optflags |= D_TYPE; X } else if (strncmp(optstr, "nlink", optlen) == 0) { X optflags |= D_NLINK; X } else if (strncmp(optstr, "uid", optlen) == 0) { X optflags |= D_UID; X } else if (strncmp(optstr, "gid", optlen) == 0) { X optflags |= D_GID; X } else if (strncmp(optstr, "uname", optlen) == 0) { X optflags |= D_UNAME; X } else if (strncmp(optstr, "gname", optlen) == 0) { X optflags |= D_GNAME; X } else if (strncmp(optstr, "id", optlen) == 0) { X optflags |= D_ID; X } else if (strncmp(optstr, "size", optlen) == 0) { X optflags |= D_SIZE; X } else if (strncmp(optstr, "data", optlen) == 0) { X optflags |= D_DATA; X } else if (strncmp(optstr, "cont", optlen) == 0) { X optflags |= D_DATA; X } else if (strncmp(optstr, "rdev", optlen) == 0) { X optflags |= D_RDEV; X } else if (strncmp(optstr, "hardlink", optlen) == 0) { X optflags |= D_HLINK; X } else if (strncmp(optstr, "symlink", optlen) == 0) { X optflags |= D_SLINK; X } else if (strncmp(optstr, "sympath", optlen) == 0) { X optflags |= D_SLPATH; X } else if (strncmp(optstr, "sparse", optlen) == 0) { X optflags |= D_SPARS; X } else if (strncmp(optstr, "atime", optlen) == 0) { X optflags |= D_ATIME; X } else if (strncmp(optstr, "mtime", optlen) == 0) { X optflags |= D_MTIME; X } else if (strncmp(optstr, "ctime", optlen) == 0) { X optflags |= D_CTIME; X } else if (strncmp(optstr, "lmtime", optlen) == 0) { X optflags |= D_LMTIME; X } else if (strncmp(optstr, "times", optlen) == 0) { X optflags |= D_TIMES; X } else if (strncmp(optstr, "xtimes", optlen) == 0) { X optflags |= D_XTIMES; X } else if (strncmp(optstr, "nsecs", optlen) == 0) { X optflags |= D_ANTIME|D_MNTIME|D_CNTIME; X } else if (strncmp(optstr, "dir", optlen) == 0) { X optflags |= D_DIR; X#ifdef USE_ACL X } else if (strncmp(optstr, "acl", optlen) == 0) { X optflags |= D_ACL; X#endif X#ifdef USE_XATTR X } else if (strncmp(optstr, "xattr", optlen) == 0) { X optflags |= D_XATTR; X#endif X#ifdef USE_FFLAGS X } else if (strncmp(optstr, "fflags", optlen) == 0) { X optflags |= D_FFLAGS; X#endif X } else if (strncmp(optstr, "help", optlen) == 0) { X dusage(0); X } else { X error("Illegal diffopt.\n"); X dusage(EX_BAD); X return (-1); X } X optstr = np; X } X if (not) X optflags = ~optflags; X X if ((optflags & D_MTIME) == 0) X optflags &= ~D_LMTIME; X X if ((optflags & D_SLINK) == 0) X optflags &= ~D_SLPATH; X X *flagp = optflags; X X return (TRUE); X} X XLOCAL int Xgethdr(optstr, typep) X char *optstr; X long *typep; X{ X BOOL swapped = FALSE; X long type = H_UNDEF; X X if (*optstr == 'S') { X swapped = TRUE; X optstr++; X } X if (streql(optstr, "help")) { X husage(0); X } else if ((type = hdr_type(optstr)) < 0) { X error("Illegal header type '%s'.\n", optstr); X husage(EX_BAD); X return (-1); X } X if (swapped) X *typep = H_SWAPPED(type); X else X *typep = type; X return (TRUE); X} X X/* ARGSUSED */ XLOCAL int Xgetexclude(arg, valp, pac, pav) X char *arg; X long *valp; X int *pac; X char *const **pav; X{ X FILE *xf; X X if (streql(arg, "-")) { X check_stdin("-X"); X xf = stdin; X } else if ((xf = lfilemopen(arg, "r", S_IRWALL)) == (FILE *)NULL) X comerr("Cannot open '%s'.\n", arg); X hash_xbuild(xf); X fclose(xf); X return (1); X} X X#ifdef USED X/* X * Add archive file. X * May currently not be activated: X * If the option string ends with ",&", the -C option will not work X * anymore. X */ XLOCAL int Xaddfile(optstr, dummy) X char *optstr; X long *dummy; X{ X char *p; X X#ifdef ADDARG_DEBUG X error("got_it: %s\n", optstr); X#endif X X if (!strchr("01234567", optstr[0])) X return (NOTAFILE); /* Tell getargs that this may be a flag */ X X for (p = &optstr[1]; *p; p++) { X if (*p != 'l' && *p != 'm' && *p != 'h') X return (BADFLAG); X } X#ifdef ADDARG_DEBUG X error("is_tape: %s\n", optstr); X#endif X X comerrno(EX_BAD, "Options [0-7][lmh] currently not supported.\n"); X /* X * The tape device should be determined from the defaults file X * in the near future. X * Search for /etc/opt/schily/star, /etc/default/star, /etc/default/tar X */ X X return (1); /* Success */ X} X#endif X XEXPORT void Xset_signal(sig, handler) X int sig; X RETSIGTYPE (*handler) __PR((int)); X{ X#if defined(HAVE_SIGPROCMASK) && defined(SA_RESTART) X struct sigaction sa; X X sigemptyset(&sa.sa_mask); X sa.sa_handler = handler; X sa.sa_flags = SA_RESTART; X (void) sigaction(sig, &sa, (struct sigaction *)0); X#else X#ifdef HAVE_SIGSETMASK X struct sigvec sv; X X sv.sv_mask = 0; X sv.sv_handler = handler; X sv.sv_flags = 0; X (void) sigvec(sig, &sv, (struct sigvec *)0); X#else X (void) signal(sig, handler); X#endif X#endif X} X XLOCAL void Xexsig(sig) X int sig; X{ X (void) signal(sig, SIG_DFL); X kill(getpid(), sig); X} X X/* ARGSUSED */ XLOCAL void Xsighup(sig) X int sig; X{ X#ifdef SIGHUP X set_signal(SIGHUP, sighup); X#endif X prstats(); X intr++; X if (!cflag) X exsig(sig); X} X X/* ARGSUSED */ XLOCAL void Xsigintr(sig) X int sig; X{ X#ifdef SIGINT X set_signal(SIGINT, sigintr); X#endif X prstats(); X intr++; X if (!cflag) X exsig(sig); X} X X/* ARGSUSED */ XLOCAL void Xsigquit(sig) X int sig; X{ X /* X * sig may be either SIGQUIT or SIGINFO (*BSD only). X */ X set_signal(sig, sigquit); X prstats(); X} X XLOCAL void Xgetstamp() X{ X FINFO finfo; X BOOL ofollow = follow; X X follow = TRUE; X if (!_getinfo(stampfile, &finfo)) X comerr("Cannot stat '%s'.\n", stampfile); X follow = ofollow; X X Newer.tv_sec = finfo.f_mtime; X Newer.tv_nsec = finfo.f_mnsec; X} X XLOCAL const char * Xhas_cli(ac, av) X int ac; X char *const *av; X{ X if (ac > 1) { X const char *p = av[1]; X X if (p[0] == 'c' && p[1] == 'l' && p[2] == 'i' && p[3] == '=') X return (&p[4]); X } X return (NULL); X} X XLOCAL struct clis { X char *name; X int type; X} clis[] = { X { "star", P_STAR }, X { "suntar", P_SUNTAR }, X { "tar", P_SUNTAR }, X { "gnutar", P_GNUTAR }, X { "gtar", P_GNUTAR }, X { "pax", P_PAX }, X { "cpio", P_CPIO }, X { NULL, C_NONE }, X}; X XLOCAL int Xget_ptype(p) X const char *p; X{ X struct clis *clp = clis; X X while (clp->name) { X if (streql(clp->name, p)) X return (clp->type); X clp++; X } X X return (C_NONE); X} X XLOCAL void Xset_ptype(pac, pav) X int *pac; X char *const **pav; X{ X int ac = *pac; X char *const *av = *pav; Xconst char *p; X X if ((p = has_cli(ac, av)) != NULL) { X ptype = get_ptype(p); X if (ptype == C_NONE) { X struct clis *clp = clis; X X errmsgno(EX_BAD, "Illegal cli name '%s'.\n", p); X errmsgno(EX_BAD, "Use one of:"); X while (clp->name) { X error(" %s", (clp++)->name); X } X error(".\n\n"); X susage(EX_BAD); X } X pname = p; X return; X } X X p = filename(av[0]); X X /* X * If you like different behavior, you need to insert exceptional X * code before the switch statement. X * X * These are the names we support: X * X * cpio gnutar pax star suntar ustar X */ X switch (p[0]) { X X case 'c': /* 'c'pio */ X ptype = P_CPIO; X return; X X case 'g': /* 'g'*tar */ X ptype = P_GNUTAR; X return; X X case 'p': /* 'p'ax */ X ptype = P_PAX; X return; X X case 't': /* 't'ar */ X /* X * If we put something different here (e.g. P_STAR), we may X * set the default behavior to be the behavor of 'star'. X */ X ptype = P_SUNTAR; X return; X case 's': X if (streql(p, "suntar")) { X ptype = P_SUNTAR; X return; X } X if (streql(p, "scpio")) { X ptype = P_CPIO; X return; X } X if (streql(p, "spax")) { X ptype = P_PAX; X return; X } X /* FALLTHRU */ X X case 'u': /* 'u'star */ X ptype = P_STAR; X return; X default: X ptype = PTYPE_DEFAULT; X return; X } X} X X/* BEGIN CSTYLED */ X/* X * Convert old tar type syntax into the new UNIX option syntax. X * Allow only a limited subset of the single character options to avoid X * collisions between interpretation of options in different X * tar implementations. The old syntax has a risk to damage files X * which is avoided with the 'fcompat' flag (see opentape()). X * X * The UNIX-98 documentation lists the following tar options: X * Function Key: crtux X * c Create X * r Append X * t List X * u Update X * x Extract X * Additional Key: vwfblmo X * v Verbose X * w Wait for confirmation X * f Archive file X * b Blocking factor X * l Report missing links X * m Do not restore mtime from archive X * o Do not restore owner/group from archive X * X * Incompatibilities with UNIX-98 tar: X * l works the oposite way round as with star, but X * if TAR_COMPAT is defined, star will behave X * as documented in UNIX-98 if av[0] is either X * "tar" or "ustar". X * X * Additional functions from historic UNIX tar versions: X * 0..7 magtape_0 .. magtape_7 X * X * Additional functions from historic BSD tar versions: X * p Extract dir permissions too X * h Follow symbolic links X * i ignore directory checksum errors X * B do multiple reads to reblock pipes X * F Ommit unwanted files (e.g. core) X * X * Additional functions from historic Star versions: X * T Use $TAPE environment as archive X * L Follow symbolic links X * d do not archive/extract directories X * k keep old files X * n do not extract but tell what to do X * X * Additional functions from historic SVr4 tar versions: X * e Exit on unexpected errors X * X Arg is File with unwanted filenames X * X * Additional functions from historic GNU tar versions: X * z do inline compression X * X * Missing in star (from SVr4/Solaris tar): X * E Extended headers X * P Supress '/' at beginning of filenames X * q quit after extracting first file X * Incompatibilities with SVr4/Solaris tar: X * I Arg is File with filenames to be included X * The -I option is not handled as option. X * P SVr4/solaris: Supress '/', star: last partial X * k set tape size for multi volume archives X * n non tape device (do seeks) X * X * Incompatibilities with GNU tar: X * There are many. GNU programs in many cases make smooth X * coexistence hard. X * X * Problems: X * The 'e' and 'X' option are currently not implemented. X * There is a collision between the BSD -I (include) and X * star's -I (interactive) which may be solved by using -w instead. X */ X/* END CSTYLED */ XLOCAL void Xdocompat(pac, pav) X int *pac; X char *const **pav; X{ X int ac = *pac; X char *const *av = *pav; X int nac; X char **nav; X char nopt[3]; X char *_copt = "crtuxbfXBFTLdehijklmnopvwz01234567"; X char *copt = _copt; Xconst char *p; X char c; X char *const *oa; X char **na; X int coff = 1; X X set_ptype(pac, pav); X switch (ptype) { X X case P_SUNTAR: X iftype = I_TAR; X#ifdef SUN_TAR X copt = sun_copt; X#endif X break; X case P_GNUTAR: X iftype = I_TAR; X#ifdef GNU_TAR X copt = gnu_copt; X#endif X break; X case P_PAX: X iftype = I_PAX; X break; X case P_CPIO: X iftype = I_CPIO; X break; X case P_STAR: X default: X iftype = I_TAR; X copt = _copt; X } X X /* X * We must check this first to be able to set 'tcompat'. X */ X p = filename(av[0]); X if (streql(p, "tar") || streql(p, "ustar") || X streql(p, "suntar") || streql(p, "gnutar") || streql(p, "gtar")) X tcompat = TRUE; X X if (pname) /* cli=xxx seen as argv[1] */ X coff++; X X if (ac <= coff) X return; X if (iftype != I_TAR) X return; X X X /* X * If we come here, this is for a tar type CLI. X */ X if (ptype != P_SUNTAR && ptype != P_GNUTAR) { X /* X * For "suntar" & "gnutar" the first option string may start X * with '-', and still may need a conversion, else only convert X * to new syntax if the first arg is a non '-' arg. X */ X if (av[1][0] == '-') /* Do not convert new syntax */ X return; X } X if (av[coff][0] == '-' && av[coff][1] == '-') /* Do not convert new syntax */ X return; X X if (strchr(av[coff], '=') != NULL) /* Do not try to convert bs= */ X return; X X nac = ac + strlen(av[coff]); X nav = ___malloc(nac-- * sizeof (char *), /* keep space for NULL ptr */ X "compat argv"); X oa = av; /* remember old arg pointer */ X na = nav; /* set up new arg pointer */ X *na++ = *oa++; /* copy over av[0] */ X if (coff > 1) /* If we have a cli= argument */ X *na++ = *oa++; /* copy over av[1] (cli=...) */ X oa++; /* Skip over av[coff] */ X X nopt[0] = '-'; X nopt[2] = '\0'; X X for (p = av[coff]; (c = *p) != '\0'; p++) { X if (c == '-') { X nac--; X continue; X } X if (strchr(copt, c) == NULL) { X if (ptype == P_SUNTAR || ptype == P_GNUTAR) X errmsgno(EX_BAD, "Illegal option '%c'.\n", c); X else X errmsgno(EX_BAD, "Illegal option '%c' for compat mode.\n", c); X X susage(EX_BAD); X } X nopt[1] = c; X *na++ = ___savestr(nopt); X X if (c == 'f' || c == 'b' || (ptype == P_SUNTAR && c == 'k') || c == 'X') { X if ((av + ac) <= oa) { X comerrno(EX_BAD, X "Missing arg for '%s' option.\n", X nopt); X } X *na++ = *oa++; X /* X * The old syntax has a high risk of corrupting X * files if the user disorders the args. X */ X if (c == 'f') X fcompat = TRUE; X } X } X X /* X * Now copy over the rest... X */ X while ((av + ac) > oa) X *na++ = *oa++; X *na = NULL; X X *pac = nac; X *pav = nav; X X#ifdef COMPAT_DEBUG X { int i; X printf("agrc: %d\n", nac); X for (i = 0; i < nac; i++) X printf("%i: '%s'\n", i, nav[i]); X } X#endif X} X XEXPORT BOOL Xttyerr(f) X FILE *f; X{ X /* X * We may get EIO in case that we received an ignored SIGTTIN. X */ X if (ferror(f)) { X errmsgno(EX_BAD, "No access to tty.\n"); X return (TRUE); X } X if (feof(f)) { X errmsgno(EX_BAD, "EOF on tty.\n"); X return (TRUE); X } X return (FALSE); X} END-of-star-1.6/star/star_fat.c echo x - star-1.6/star/gnutar.1 sed 's/^X//' >star-1.6/star/gnutar.1 << 'END-of-star-1.6/star/gnutar.1' X. \" @(#)gnutar.1 1.8 19/03/31 Copyr 2004-2019 J. Schilling X. \" Manual Seite fuer gnutar X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.75n'U X.if t .ds s \\(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH GNUTAR 1 "2019/03/31" "J\*org Schilling" "Schily\'s USER COMMANDS" X.SH NAME Xgnutar \- emulates the GNU version of the tar archiver X.SH SYNOPSIS X.B "gnutar\ " X.I command X[ X.I options X] X.I file1 .\|.\|. filen X.SH DESCRIPTION X.PP XThis manual page documents the GNU version of X.BR tar , Xan archiving program designed to store and extract files from Xan archive file known as a X.IR tarfile. XA X.IR tarfile Xmay be made on a tape drive, however, it is also common Xto write a X.IR tarfile Xto a normal file. XThe first argument to X.B gnutar Xmust be one of the options: X.BR Acdrtux , Xfollowed by any optional functions. XThe final arguments to X.B gnutar Xare the names of the files or directories which should be archived. The use Xof a directory name always implies that the subdirectories below should be Xincluded in the archive. X.SH COMMAND X.TP X.B "One of the following commands must be used: X.TP X.BR \-A ", " \-\-catenate ", " \-\-concatenate Xappend tar files to an archive X.TP X.BR \-c ", " \-\-create Xcreate a new archive X.TP X.BR \-d ", " \-\-diff ", " \-\-compare Xfind differences between archive and file system X.TP X.B \-\-delete Xdelete from the archive (not for use on mag tapes!) X.TP X.BR \-r ", " \-\-append Xappend files to the end of an archive X.TP X.BR \-t ", " \-\-list Xlist the contents of an archive X.TP X.BR \-u ", " \-\-update Xonly append files that are newer than copy in archive X.TP X.BR \-x ", " \-\-extract ", " \-\-get Xextract files from an archive X.SH OPTIONS X.TP X.B \-\-atime\-preserve Xdon't change access times on dumped files X.TP X.BR \-b ", " \-\-block\-size " N Xblock size of Nx512 bytes (default N=20) X.TP X.BR \-B ", " \-\-read\-full\-blocks Xreblock as we read (for reading 4.2BSD pipes) X.TP X.BR \-C ", " \-\-directory " DIR Xchange to directory DIR X.TP X.B \-\-checkpoint Xprint directory names while reading the archive X.TP X.BR \-f ", " \-\-file " [HOSTNAME:]F Xuse archive file or device F (default /dev/rmt0) X.TP X.B \-\-force\-local Xarchive file is local even if has a colon X.TP X.BR \-F ", " \-\-info\-script " F, " \-\-new\-volume\-script " F Xrun script at end of each tape (implies \-M) X.TP X.BR \-G ", " \-\-incremental Xcreate/list/extract old GNU-format incremental backup. XSince this feature did never work in the real GNU tar implementation, we cannot support it. X.TP X.BR \-g ", " \-\-listed\-incremental " F Xcreate/list/extract new GNU-format incremental backup XSince this feature did never work in the real GNU tar implementation, we cannot support it. X.TP X.BR \-h ", " \-\-dereference Xdon't dump symlinks; dump the files they point to X.TP X.BR \-i ", " \-\-ignore\-zeros Xignore blocks of zeros in archive (normally mean EOF) X.TP X.BR \-j ", " \-\-bzip Xfilter the archive through bzip2. X.TP X.B \-\-ignore\-failed\-read Xdon't exit with non-zero status on unreadable files X.TP X.BR \-k ", " \-\-keep\-old\-files Xkeep existing files; don't overwrite them from archive X.TP X.BR \-K ", " \-\-starting\-file " F Xbegin at file F in the archive X.TP X.BR \-l ", " \-\-one\-file\-system Xstay in local file system when creating an archive X.TP X.BR \-L ", " \-\-tape\-length " N Xchange tapes after writing N*1024 bytes X.TP X.BR \-m ", " \-\-modification\-time Xdon't extract file modified time X.TP X.BR \-M ", " \-\-multi\-volume Xcreate/list/extract multi-volume archive X.TP X.BR \-N ", " \-\-after\-date " DATE, " \-\-newer " DATE Xonly store files newer than DATE X.TP X.BR \-o ", " \-\-old\-archive ", " \-\-portability Xwrite a V7 format archive, rather than ANSI format X.TP X.BR \-O ", " \-\-to\-stdout Xextract files to standard output X.TP X.BR \-p ", " \-\-same\-permissions ", " \-\-preserve\-permissions Xextract all protection information X.TP X.BR \-P ", " \-\-absolute\-paths Xdon't strip leading `/'s from file names X.TP X.B \-\-preserve Xlike X.BR "\-p \-s" . X.TP X.BR \-R ", " \-\-record\-number Xshow record number within archive with each message X.TP X.B \-\-remove\-files Xremove files after adding them to the archive X.TP X.BR \-s ", " \-\-same\-order ", " \-\-preserve\-order Xlist of names to extract is sorted to match archive X.TP X.B \-\-same\-owner Xcreate extracted files with the same ownership X.TP X.BR \-S ", " \-\-sparse Xhandle sparse files efficiently X.TP X.BR \-T ", " \-\-files\-from= " F Xget names to extract or create from file F X.TP X.B \-\-null X\-T reads null-terminated names, disable \-C X.TP X.B \-\-totals Xprint total bytes written with \-\-create X.TP X.BR \-v ", " \-\-verbose Xverbosely list files processed X.TP X.BR \-V ", " \-\-label " NAME Xcreate archive with volume name NAME X.TP X.B \-\-version Xprint X.B gnutar Xprogram version number X.TP X.BR \-w ", " \-\-interactive ", " \-\-confirmation Xask for confirmation for every action X.TP X.BR \-W ", " \-\-verify Xattempt to verify the archive after writing it X.TP X.BI \-\-exclude " FILE Xexclude file FILE X.TP X.BR \-X ", " \-\-exclude\-from " FILE Xexclude files listed in FILE X.TP X.BR \-Z ", " \-\-compress ", " \-\-uncompress Xfilter the archive through compress X.TP X.BR \-z ", " \-\-gzip ", " \-\-ungzip Xfilter the archive through gzip X.TP X.BI \-\-use\-compress\-program " PROG Xfilter the archive through PROG (which must accept \-d) X.SH "EXTENDED OPTIONS X.PP XThe extended options are options taken from X.BR star . X.TP X.B \-\-help XPrints a summary of the most important options for X.BR gnutar (1) Xand exits. X.TP X.B \-\-xhelp XPrints a summary of the less important options for X.BR gnutar (1) Xand exits. X.TP X.B \-\-version XPrints the X.B gnutar Xversion number string and exists. X.TP X.B \-\-debug Xprint additional debug messages X.TP X.BI xdebug= # X.TP X.BI xd= # Xset extended debug level X.TP X.B \-/ Xdon't strip leading '/'s from file names X.TP X.B \-.. Xdon't skip filenames that contain '..' in non-interactive extract X.TP X.B \-\-secure\-links Xdon't extract links that start with '/' or contain '..' X.TP X.B \-\-acl Xhandle access control lists X.TP X.B \-\-xfflags Xhandle extended file flags X.TP X.BI bs= # Xset (output) block size to # X.TP X.BI fs= # Xset fifo size to # X.TP X.B \-\-no\-fsync Xdo not call fsync() for each extracted file (may be dangerous). X.TP X.B \-\-do\-fsync Xcall fsync() for each extracted file. X.TP X.B \-\-time X print timing info X.TP X.B \-\-no\-statistics Xdo not print statistics X.TP X.B \-\-fifostats Xprint fifo statistics X.TP X.B \-\-no\-fifo Xdon't use a fifo to optimize data flow from/to tape X.TP X.B \-\-numeric Xdon't use user/group name from tape X.TP X.B \-\-zstd Xrun the input or output through a X.B zstd Xpipe. X.PP XThe options above are not defined by GNU tar. X.PP XFor a complete documentation of the X.B star Xbased optione check X.BR star (1). X X.SH EXAMPLES X.SH ENVIRONMENT X.SH FILES X.SH "SEE ALSO" X.BR spax (1), X.BR suntar (1), X.BR scpio (1), X.BR tar (1), X.BR cpio (1), X.BR pax (1), X.BR rcp (1), X.BR mt (1), X.BR rmt (1), X.BR match (1), X.BR dd (1), X.BR sdd (1), X.BR rsh (1), X.BR ssh (1), X.BR star (1), X.BR star (4), X.BR rcmd (3), X.BR fssnap (1m) X.SH DIAGNOSTICS X.SH NOTES X.PP XThis X.B gnutar Ximplementation is based on the X.B star Ximplementation and does not implement all features of the original GNU tar Xprogram. X.SH BUGS X.SH AUTHOR X.nf XJ\*org Schilling XSeestr. 110 XD\-13353 Berlin XGermany X.fi X.PP XMail bugs and suggestions to: X.PP X.B Xjoerg.schilling@fokus.fraunhofer.de Xor X.B Xjoerg@schily.net END-of-star-1.6/star/gnutar.1 echo x - star-1.6/star/gnutar.c sed 's/^X//' >star-1.6/star/gnutar.c << 'END-of-star-1.6/star/gnutar.c' X/* @(#)gnutar.c 1.37 19/03/31 Copyright 1989, 2003-2019 J. Schilling */ X#include X#ifndef lint Xstatic const char _g_sccsid[] = X "@(#)gnutar.c 1.37 19/03/31 Copyright 1989, 2003-2019 J. Schilling"; X#endif X/* X * GNU TAR specific routines for star main program. X * X * Copyright (c) 1989, 2003-2019 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X Xstatic char *gnu_copt = "HcrtuxdAWkUSOGgmpsfMLFbiBVojzZCTXPhlKNvRw01234567"; X X#ifdef STAR_MAIN X/* X * We have been included from star.c X */ X#define opts gnutar_opts X#define _opts _gnutar_opts X#define gargs gnutar_gargs X#define susage gnutar_susage X#define usage gnutar_usage X#define xusage gnutar_xusage X#else X#define NO_STAR_MAIN X#define GNUTAR_MAIN X#define PTYPE_DEFAULT P_GNUTAR X X#include "star.c" X#endif X X#define GNU_TAR X XLOCAL void gargs __PR((int ac, char *const *av)); XLOCAL void susage __PR((int ret)); XLOCAL void usage __PR((int ret)); XLOCAL void xusage __PR((int ret)); X#ifdef STAR_MAIN XLOCAL void gnutar_setopts __PR((char *o)); X#endif X X/* X * Main operation mode: X * -t, --list list the contents of an archive X * -x, --extract, --get extract files from an archive X * -c, --create create a new archive X * -d, --diff, --compare find differences between archive and file system X * -r, --append append files to the end of an archive X * -u, --update only append files newer than copy in archive X * -A, --catenate append tar files to an archive X * --concatenate same as -A X * --delete delete from the archive (not on mag tapes!) X * X * Operation modifiers: X * -W, --verify attempt to verify the archive after writing it X * --remove-files remove files after adding them to the archive X * -k, --keep-old-files don't replace existing files when extracting X * --overwrite overwrite existing files when extracting X * --overwrite-dir overwrite directory metadata when extracting X * -U, --unlink-first remove each file prior to extracting over it X * --recursive-unlink empty hierarchies prior to extracting directory X * -S, --sparse handle sparse files efficiently X * -O, --to-stdout extract files to standard output X * -G, --incremental handle old GNU-format incremental backup X * -g, --listed-incremental=FILE X * handle new GNU-format incremental backup X * --ignore-failed-read do not exit with nonzero on unreadable files X * X * Handling of file attributes: X * --owner=NAME force NAME as owner for added files X * --group=NAME force NAME as group for added files X * --mode=CHANGES force (symbolic) mode CHANGES for added files X * --atime-preserve don't change access times on dumped files X * -m, --modification-time don't extract file modified time X * --same-owner try extracting files with the same ownership X * --no-same-owner extract files as yourself X * --numeric-owner always use numbers for user/group names X * -p, --same-permissions extract permissions information X * --no-same-permissions do not extract permissions information X * --preserve-permissions same as -p X * -s, --same-order sort names to extract to match archive X * --preserve-order same as -s X * --preserve same as both -p and -s X * X * Device selection and switching: X * -f, --file=ARCHIVE use archive file or device ARCHIVE X * --force-local archive file is local even if has a colon X * --rsh-command=COMMAND use remote COMMAND instead of rsh X * -[0-7][lmh] specify drive and density X * -M, --multi-volume create/list/extract multi-volume archive X * -L, --tape-length=NUM change tape after writing NUM x 1024 bytes X * -F, --info-script=FILE run script at end of each tape (implies -M) X * --new-volume-script=FILE same as -F FILE X * --volno-file=FILE use/update the volume number in FILE X * X * Device blocking: X * -b, --blocking-factor=BLOCKS BLOCKS x 512 bytes per record X * --record-size=SIZE SIZE bytes per record, multiple of 512 X * -i, --ignore-zeros ignore zeroed blocks in archive (means EOF) X * -B, --read-full-records reblock as we read (for 4.2BSD pipes) X * X * Archive format selection: X * X * -H, --format=FORMAT create archive of the given format X * X * -V, --label=NAME create archive with volume name NAME X * PATTERN at list/extract time, a globbing PATTERN X * -o, --old-archive, --portability write a V7 format archive X * --posix write a POSIX format archive X * -j, --bzip2 filter the archive through bzip2 X * -z, --gzip, --ungzip filter the archive through gzip X * -Z, --compress, --uncompress filter the archive through compress X * --use-compress-program=PROG filter through PROG (must accept -d) X * X * Local file selection: X * -C, --directory=DIR change to directory DIR X * -T, --files-from=NAME get names to extract or create from file NAME X * --null -T reads null-terminated names, disable -C X * --exclude=PATTERN exclude files, given as a PATTERN X * -X, --exclude-from=FILE exclude patterns listed in FILE X * --anchored exclude patterns match file name start (default) X * --no-anchored exclude patterns match after any / X * --ignore-case exclusion ignores case X * --no-ignore-case exclusion is case sensitive (default) X * --wildcards exclude patterns use wildcards (default) X * --no-wildcards exclude patterns are plain strings X * --wildcards-match-slash exclude pattern wildcards match '/' (default) X * --no-wildcards-match-slash exclude pattern wildcards do not match '/' X * -P, --absolute-names don't strip leading `/'s from file names X * -h, --dereference dump instead the files symlinks point to X * --no-recursion avoid descending automatically in directories X * -l, --one-file-system stay in local file system when creating archive X * -K, --starting-file=NAME begin at file NAME in the archive X * -N, --newer=DATE only store files newer than DATE X * --newer-mtime=DATE compare date and time when data changed only X * --after-date=DATE same as -N X * --backup[=CONTROL] backup before removal, choose version control X * --suffix=SUFFIX backup before removal, override usual suffix X * X * Informative output: X * --help print this help, then exit X * --version print tar program version number, then exit X * -v, --verbose verbosely list files processed X * --checkpoint print directory names while reading the archive X * --totals print total bytes written while creating archive X * -R, --block-number show block number within archive with each message X * -w, --interactive ask for confirmation for every action X * --confirmation same as -w X */ X X/* X * GNU TAR related options X */ X/* BEGIN CSTYLED */ Xchar _opts[] = "C*,help,xhelp,version,debug,xdebug#,xd#,time,no-statistics,do-statistics,fifostats,numeric,no-fifo,no-fsync,do-fsync%0,bs&,fs&,/,..,secure-links,no-secure-links%0,acl,xfflags,copy,diff,H&,format&,z,bz,create,c,append,r,list,t,update,u,extract,get,x,compare,d,catenate,concatenate,A,delete,verify,W,remove-files,keep-old-files,k,unlink-first,U,recursive-unlink,sparse,S,to-stdout,O,incremental,G,listed-incremental*,g*,ignore-failed-read,owner*,group*,mode*,atime-preserve,modification-time,m,same-owner,no-same-owner,numeric-owner,same-permissions,preserve-permissions,p,no-same-permissions,same-order,preserve,preserve-order,s,force-local,file&,f&,rsh-command*,multi-volume,M,tape-length&,L&,new-volume-script*,info-script*,F*,volno-file*,blocking-factor&,b&,record-size&,ignore-zeros,i,read-full-records,B,label*,V*,old-archive,portability,o,posix,bzip2,j,gzip,ungzip,compress,uncompress,Z,lzo,7z,xz,lzip,zstd,use-compress-program*,files-from*,T*,null,exclude&,exclude-from&,X&,anchored,no-anchored,ignore-case,no-ignore-case,wildcards,no-wildcards,wildcards-match-slash,no-wildcards-match-slash,absolute-names,P,dereference,h,no-recursion,one-file-system,l,starting-file*,K*,newer*,after-date*,N*,newer-mtime*,backup*,suffix*,v+,verbose+,checkpoint,totals,block-number,R,interactive,confirmation,w,?"; X/* END CSTYLED */ Xchar *opts = _opts; X#ifdef NO_STAR_MAIN Xstruct ga_props gaprops; X#endif X XLOCAL void gnutar_info __PR((void)); X XLOCAL void Xgargs(ac, av) X int ac; X char *const *av; X{ X int files = 0; X int minfiles = 1; X BOOL help = FALSE; X BOOL xhelp = FALSE; X BOOL prvers = FALSE; X BOOL no_fifo = FALSE; X BOOL oldtar = FALSE; X BOOL gnuconcat = FALSE; X BOOL gnudel = FALSE; X BOOL gnuveri = FALSE; X BOOL gnuremove = FALSE; X BOOL gnuincrem = FALSE; X char *gnulinc = NULL; X BOOL gnuignfail = FALSE; X char *gnuowner = NULL; X char *gnugroup = NULL; X char *gnumode = NULL; X BOOL gnuchown = FALSE; X BOOL gnuorder = FALSE; X char *rsh_command = NULL; X char *gnuvolno_file = NULL; X BOOL gnuposix = FALSE; X BOOL gnuanchored = FALSE; X BOOL gnuno_anchored = FALSE; X BOOL gnuignorecase = FALSE; X BOOL gnuno_ignorecase = FALSE; X BOOL gnuwildchards = FALSE; X BOOL gnuno_wildchards = FALSE; X BOOL gnumatchslash = FALSE; X BOOL gnuno_matchslash = FALSE; X char *gnustartf = NULL; X char *gnunewer = NULL; X char *gnunewermt = NULL; X char *gnubackup = NULL; X char *gnusuffix = NULL; X BOOL gnucheckpoint = FALSE; X BOOL gnutotals = FALSE; X BOOL do_stats = FALSE; X Llong llbs = 0; Xsigned char archive = -1; /* On IRIX, we have unsigned chars by default */ X X /* X * Current default archive format in all other cases is USTAR. X * We may change this to PAX in the future. X */ X hdrtype = H_USTAR; X#ifdef STAR_MAIN X gnutar_setopts(opts); /* set up opts for getfiles */ X#endif X getarginit(&gaprops, GAF_DEFAULT); /* Set default behavior */ X X iftype = I_TAR; /* command line interface */ X ptype = P_GNUTAR; /* program interface type */ X bsdchdir = TRUE; X no_dirslash = FALSE; X no_stats = TRUE; /* and -no-statitstics */ X X if (pname) { /* cli=xxx seen as argv[1] */ X --ac, av++; X } X --ac, ++av; X files = getfilecount(ac, av, opts); X if (getlallargs(&ac, &av, &gaprops, opts, X &dir_flags, X &help, &xhelp, &prvers, &debug, &xdebug, &xdebug, X#ifndef __old__lint X &showtime, &no_stats, &do_stats, &do_fifostats, X &numeric, &no_fifo, &no_fsync, &no_fsync, X getenum, &bs, X getenum, &fs, X &abs_path, &allow_dotdot, X &secure_links, &secure_links, X &doacl, &dofflags, X ©flag, &diff_flag, X gethdr, &chdrtype, gethdr, &chdrtype, X &zflag, &bzflag, X X &cflag, &cflag, X &rflag, &rflag, X &tflag, &tflag, X &uflag, &uflag, X &xflag, &xflag, &xflag, X &diff_flag, &diff_flag, X &gnuconcat, &gnuconcat, &gnuconcat, X &gnudel, X X &gnuveri, &gnuveri, X &gnuremove, X &keep_old, &keep_old, X/* --overwrite */ X/* --overwrite-dir / --nooverwrite-dir */ X &remove_first, &remove_first, X &remove_recursive, X &sparse, &sparse, X &to_stdout, &to_stdout, X &gnuincrem, &gnuincrem, X &gnulinc, &gnulinc, X &gnuignfail, X &gnuowner, &gnugroup, &gnumode, X &acctime, X &nomtime, &nomtime, X &gnuchown, X &nochown, X &numeric, X &pflag, &pflag, &pflag, X &nopflag, X &gnuorder, &gnuorder, &gnuorder, &gnuorder, X X &force_noremote, X addtarfile, NULL, /* -file archive */ X addtarfile, NULL, /* -f archive */ X &rsh_command, X X &multivol, &multivol, X getknum, &tsize, X getknum, &tsize, X &newvol_script, &newvol_script, &newvol_script, X &gnuvolno_file, X X getenum, &bs, /* -b blocks */ X getenum, &bs, /* -b blocks */ X getllnum, &llbs, X &ignoreerr, &ignoreerr, X &multblk, &multblk, X &volhdr, &volhdr, X &oldtar, &oldtar, &oldtar, X &gnuposix, X &bzflag, &bzflag, X &zflag, &zflag, X &Zflag, &Zflag, &Zflag, X &lzoflag, X &p7zflag, &xzflag, &lzipflag, &zstdflag, X &compress_prg, X &listfile, &listfile, X &readnull, X addpattern, NULL, X getexclude, NULL, X getexclude, NULL, X &gnuanchored, X &gnuno_anchored, X &gnuignorecase, X &gnuno_ignorecase, X &gnuwildchards, X &gnuno_wildchards, X &gnumatchslash, X &gnuno_matchslash, X &abs_path, &abs_path, X &follow, &follow, X &nodesc, X &nomount, &nomount, X &gnustartf, &gnustartf, X &gnunewer, &gnunewer, &gnunewer, X &gnunewermt, X &gnubackup, X &gnusuffix, X X &verbose, &verbose, X &gnucheckpoint, X &gnutotals, X &prblockno, &prblockno, X &interactive, &interactive, &interactive, X#endif /* __old__lint */ X &archive) < 0) { X errmsgno(EX_BAD, "Bad Option: %s.\n", av[0]); X susage(EX_BAD); X } X if (archive != -1 && !(archive >= '0' && archive <= '7')) { X errmsgno(EX_BAD, "Bad Option: -%c.\n", archive); X susage(EX_BAD); X } X star_helpvers("gnutar", help, xhelp, prvers); X X if (gnuconcat) { /* -A */ X errmsgno(EX_BAD, "The --concatenate option is not yet implemented.\n"); X susage(EX_BAD); X } X if (gnudel) { X errmsgno(EX_BAD, "The --delete option is not yet implemented.\n"); X susage(EX_BAD); X } X if (gnuveri) { /* -W */ X errmsgno(EX_BAD, "The --verify option is not implemented.\n"); X errmsgno(EX_BAD, "Use the rewind and -diff from star instead.\n"); X susage(EX_BAD); X } X if (gnuremove) { X errmsgno(EX_BAD, "The --remove-files option is not yet implemented.\n"); X susage(EX_BAD); X } X if (gnuincrem) { /* -G */ X errmsgno(EX_BAD, "The --incremental option is not implemented.\n"); X errmsgno(EX_BAD, "Use the true incremental dump feature from star instead.\n"); X susage(EX_BAD); X } X if (gnulinc) { /* -g */ X errmsgno(EX_BAD, "The --listed-incremental option is not implemented.\n"); X errmsgno(EX_BAD, "Use the true incremental dump feature from star instead.\n"); X susage(EX_BAD); X } X if (gnuignfail) { X errmsgno(EX_BAD, "The --ignore-failed-read option is not yet implemented.\n"); X susage(EX_BAD); X } X if (gnuowner) { X errmsgno(EX_BAD, "The --owner option is not yet implemented.\n"); X susage(EX_BAD); X } X if (gnugroup) { X errmsgno(EX_BAD, "The --group option is not yet implemented.\n"); X susage(EX_BAD); X } X if (gnumode) { X errmsgno(EX_BAD, "The --mode option is not yet implemented.\n"); X susage(EX_BAD); X } X if (gnuchown) X nochown = FALSE; X if (gnuorder) { /* -s */ X errmsgno(EX_BAD, "The --same-order option is completely useless.\n"); X errmsgno(EX_BAD, "It is not needed as star uses hash tables.\n"); X susage(EX_BAD); X } X if (rsh_command) { X int len = strlen(rsh_command) + 4; /* + "RSH=" */ X char *p; X X p = ___malloc(len, "putenv"); X strcatl(p, "RSH=", rsh_command, (char *)NULL); X#ifdef HAVE_PUTENV X putenv(p); X#else X comerrno(EX_BAD, "No putenv() on this platform, cannot use --rsh-command.\n"); X#endif X } X if (gnuvolno_file) { X errmsgno(EX_BAD, "The --volno-file option is not yet implemented.\n"); X susage(EX_BAD); X } X if (gnuposix) { X errmsgno(EX_BAD, "The --posix option is outdated - ignored.\n"); X errmsgno(EX_BAD, "Star is posix by default.\n"); X errmsgno(EX_BAD, "If you like to create other archive types, use -Htype from star instead.\n"); X } X if (gnuanchored) { X errmsgno(EX_BAD, "The --anchored option is not yet implemented.\n"); X susage(EX_BAD); X } X if (gnuno_anchored) { X errmsgno(EX_BAD, "The --no-anchored option is not yet implemented.\n"); X susage(EX_BAD); X } X if (gnuignorecase) { X errmsgno(EX_BAD, "The --ignore-case option is not yet implemented.\n"); X susage(EX_BAD); X } X if (gnuno_ignorecase) { X errmsgno(EX_BAD, "The --no-ignore-case option is not yet implemented.\n"); X susage(EX_BAD); X } X if (gnuwildchards) { X errmsgno(EX_BAD, "The --wildcards option is not yet implemented.\n"); X susage(EX_BAD); X } X if (gnuno_wildchards) { X errmsgno(EX_BAD, "The --no-wildcards option is not yet implemented.\n"); X susage(EX_BAD); X } X if (gnumatchslash) { X errmsgno(EX_BAD, "The --wildcards-match-slash option is not yet implemented.\n"); X susage(EX_BAD); X } X if (gnuno_matchslash) { X errmsgno(EX_BAD, "The --no-wildcards-match-slash option is not yet implemented.\n"); X susage(EX_BAD); X } X if (gnustartf) { /* -K */ X errmsgno(EX_BAD, "The --starting-file option is not yet implemented.\n"); X susage(EX_BAD); X } X if (gnunewer) { /* -N */ X errmsgno(EX_BAD, "The --newer option is not implemented.\n"); X errmsgno(EX_BAD, "Use the -newer option from star with -ctime instead.\n"); X susage(EX_BAD); X } X if (gnunewermt) { X errmsgno(EX_BAD, "The --newer-mtime option is not implemented.\n"); X errmsgno(EX_BAD, "Use the -newer option from star without -ctime instead.\n"); X susage(EX_BAD); X } X if (gnubackup) { X errmsgno(EX_BAD, "The --backup option is not yet implemented.\n"); X susage(EX_BAD); X } X if (gnusuffix) { X errmsgno(EX_BAD, "The --suffix option is not yet implemented.\n"); X susage(EX_BAD); X } X if (gnucheckpoint) { X errmsgno(EX_BAD, "The --checkpoint option is not yet implemented.\n"); X susage(EX_BAD); X } X if (gnutotals) X showtime = TRUE; X if (do_stats) X no_stats = FALSE; X X notpat = TRUE; /* GNU tar only supports exclude patterns */ X X star_checkopts(oldtar, /* dodesc */ FALSE, /* usetape */ TRUE, X archive, no_fifo, X /* paxopts */ NULL, X llbs); X star_nfiles(files, minfiles); X X if ((cflag || xflag) && verbose == 1) X tpath = TRUE; X /* X * Strange GNU tar semantics: X * tar -cf /dev/null . equals star -cf -nullout . X */ X if (cflag && archisnull(tarfiles[0])) X nullout = TRUE; X} X XLOCAL void Xgnutar_info() X{ X const char *n = pname ? pname : get_progname(); X X error("\nFor a more complete user interface use the star type command interface.\n"); X error("See 'man star'. The %s command is more or less limited to the\n", n); X error("GNU tar command line interface.\n"); X} X X/* X * Short usage X */ XLOCAL void Xsusage(ret) X int ret; X{ X const char *n = pname ? pname : get_progname(); X X error("Usage:\t%s cmd [options] file1 ... filen\n", n); X error("\nUse\t%s --help\n", n); X error("and\t%s --xhelp\n", n); X error("to get a list of valid cmds and options.\n"); X error("\nUse\t%s -H help\n", n); X error("to get a list of valid archive header formats.\n"); X gnutar_info(); X exit(ret); X /* NOTREACHED */ X} X XLOCAL void Xusage(ret) X int ret; X{ X const char *n = pname ? pname : get_progname(); X X gtprintf("Usage:\t%s cmd [options] file1 ... filen\n", n); X gtprintf("Cmd:\n"); X gtprintf("\t-c/-u/-r\tcreate/update/replace archive with named files to tape\n"); X gtprintf("\t-x/-t\t\textract/list named files from tape\n"); X gtprintf("\t--copy\t\t(*) copy named files to destination directory\n"); X gtprintf("\t--diff\t\tdiff archive against file system (see -xhelp)\n"); X gtprintf("Options:\n"); X gtprintf("\t--help\t\t(*) print this help\n"); X gtprintf("\t--xhelp\t\tprint extended help\n"); X gtprintf("\t--version\tprint version information and exit\n"); X X gtprintf("\tH=header\tgenerate 'header' type archive (see H=help)\n"); X gtprintf("\t-z\t\tpipe input/output through gzip, does not work on tapes\n"); X gtprintf("\t--bz\t\t(*) pipe input/output through bzip2, does not work on tapes\n"); X#ifdef FIFO X gtprintf("\t--no-fifo\t(*) don't use a fifo to optimize data flow from/to tape\n"); X#endif X gtprintf("\nAll options marked with (*) are not defined by GNU tar.\n"); X X /* BEGIN CSTYLED */ X gtprintf("\n\ XGNU tar help:\n\ XMain operation mode:\n\ X -t, --list list the contents of an archive\n\ X -x, --extract, --get extract files from an archive\n\ X -c, --create create a new archive\n\ X -d, --diff, --compare find differences between archive and file system\n\ X -r, --append append files to the end of an archive\n\ X -u, --update only append files newer than copy in archive\n\ X -A, --catenate append tar files to an archive\n\ X --concatenate same as -A\n\ X --delete delete from the archive (not on mag tapes!)\n"); X X gtprintf("\n\ XOperation modifiers:\n\ X -W, --verify attempt to verify the archive after writing it\n\ X --remove-files remove files after adding them to the archive\n\ X -k, --keep-old-files don't replace existing files when extracting\n\ X --overwrite overwrite existing files when extracting\n\ X --overwrite-dir overwrite directory metadata when extracting\n\ X -U, --unlink-first remove each file prior to extracting over it\n\ X --recursive-unlink empty hierarchies prior to extracting directory\n\ X -S, --sparse handle sparse files efficiently\n\ X -O, --to-stdout extract files to standard output\n\ X -G, --incremental handle old GNU-format incremental backup\n\ X -g, --listed-incremental=FILE\n\ X handle new GNU-format incremental backup\n\ X --ignore-failed-read do not exit with nonzero on unreadable files\n"); X X gtprintf("\n\ XHandling of file attributes:\n\ X --owner=NAME force NAME as owner for added files\n\ X --group=NAME force NAME as group for added files\n\ X --mode=CHANGES force (symbolic) mode CHANGES for added files\n\ X --atime-preserve don't change access times on dumped files\n\ X -m, --modification-time don't extract file modified time\n\ X --same-owner try extracting files with the same ownership\n\ X --no-same-owner extract files as yourself\n\ X --numeric-owner always use numbers for user/group names\n\ X -p, --same-permissions extract permissions information\n\ X --no-same-permissions do not extract permissions information\n\ X --preserve-permissions same as -p\n\ X -s, --same-order sort names to extract to match archive\n\ X --preserve-order same as -s\n\ X --preserve same as both -p and -s\n"); X X gtprintf("\n\ XDevice selection and switching:\n\ X -f, --file=ARCHIVE use archive file or device ARCHIVE\n\ X --force-local archive file is local even if has a colon\n\ X --rsh-command=COMMAND use remote COMMAND instead of rsh\n\ X -[0-7][lmh] specify drive and density\n\ X -M, --multi-volume create/list/extract multi-volume archive\n\ X -L, --tape-length=NUM change tape after writing NUM x 1024 bytes\n\ X -F, --info-script=FILE run script at end of each tape (implies -M)\n\ X --new-volume-script=FILE same as -F FILE\n\ X --volno-file=FILE use/update the volume number in FILE\n"); X X gtprintf("\n\ XDevice blocking:\n\ X -b, --blocking-factor=BLOCKS BLOCKS x 512 bytes per record\n\ X --record-size=SIZE SIZE bytes per record, multiple of 512\n\ X -i, --ignore-zeros ignore zeroed blocks in archive (means EOF)\n\ X -B, --read-full-records reblock as we read (for 4.2BSD pipes)\n"); X X gtprintf("\n\ XArchive format selection:\n\ X -H, --format=FORMAT create archive of the given format\n\ X -V, --label=NAME create archive with volume name NAME\n\ X PATTERN at list/extract time, a globbing PATTERN\n\ X -o, --old-archive, --portability write a V7 format archive\n\ X --posix write a POSIX format archive\n\ X -j, --bzip2 filter the archive through bzip2\n\ X -z, --gzip, --ungzip filter the archive through gzip\n\ X -Z, --compress, --uncompress filter the archive through compress\n\ X --use-compress-program=PROG filter through PROG (must accept -d)\n"); X X gtprintf("\n\ XLocal file selection:\n\ X -C, --directory=DIR change to directory DIR\n\ X -T, --files-from=NAME get names to extract or create from file NAME\n\ X --null -T reads null-terminated names, disable -C\n\ X --exclude=PATTERN exclude files, given as a PATTERN\n\ X -X, --exclude-from=FILE exclude patterns listed in FILE\n\ X --anchored exclude patterns match file name start (default)\n\ X --no-anchored exclude patterns match after any /\n\ X --ignore-case exclusion ignores case\n\ X --no-ignore-case exclusion is case sensitive (default)\n\ X --wildcards exclude patterns use wildcards (default)\n\ X --no-wildcards exclude patterns are plain strings\n\ X --wildcards-match-slash exclude pattern wildcards match '/' (default)\n\ X --no-wildcards-match-slash exclude pattern wildcards do not match '/'\n\ X -P, --absolute-names don't strip leading `/'s from file names\n\ X -h, --dereference dump instead the files symlinks point to\n\ X --no-recursion avoid descending automatically in directories\n\ X -l, --one-file-system stay in local file system when creating archive\n\ X -K, --starting-file=NAME begin at file NAME in the archive\n"); X X gtprintf("\ X -N, --newer=DATE only store files newer than DATE\n\ X --newer-mtime=DATE compare date and time when data changed only\n\ X --after-date=DATE same as -N\n"); X X gtprintf("\ X --backup[=CONTROL] backup before removal, choose version control\n\ X --suffix=SUFFIX backup before removal, override usual suffix\n"); X X gtprintf("\n\ XInformative output:\n\ X --help print this help, then exit\n\ X --version print tar program version number, then exit\n\ X -v, --verbose verbosely list files processed\n\ X --checkpoint print directory names while reading the archive\n\ X --totals print total bytes written while creating archive\n\ X -R, --block-number show block number within archive with each message\n\ X -w, --interactive ask for confirmation for every action\n\ X --confirmation same as -w\n"); X /* END CSTYLED */ X X gnutar_info(); X exit(ret); X /* NOTREACHED */ X} X XLOCAL void Xxusage(ret) X int ret; X{ X const char *n = pname ? pname : get_progname(); X X error("Usage:\t%s cmd [options] file1 ... filen\n", n); X error("Extended options:\n"); X error("\t--debug\t\tprint additional debug messages\n"); X error("\txdebug=#,xd=#\tset extended debug level\n"); X error("\t-/\t\tdon't strip leading '/'s from file names\n"); X error("\t-..\t\tdon't skip filenames that contain '..' in non-interactive extract\n"); X error("\t--secure-links\tdon't extract links that start with '/' or contain '..' (default)\n"); X error("\t--no-secure-links\textract links that start with '/' or contain '..'\n"); X error("\t--acl\t\thandle access control lists\n"); X error("\t--xfflags\thandle extended file flags\n"); X error("\tbs=#\t\tset (output) block size to #\n"); X#ifdef FIFO X error("\tfs=#\t\tset fifo size to #\n"); X#endif X error("\t--no-fsync\tdo not call fsync() for each extracted file (may be dangerous)\n"); X error("\t--do-fsync\tcall fsync() for each extracted file\n"); X error("\t--time\t\tprint timing info\n"); X error("\t--no-statistics\tdo not print statistics\n"); X error("\t--do-statistics\tprint statistics\n"); X#ifdef FIFO X error("\t--fifostats\tprint fifo statistics\n"); X#endif X error("\t--numeric\tdon't use user/group name from tape\n"); X error("\nAll options above are not defined by GNU tar.\n"); X exit(ret); X /* NOTREACHED */ X} X X#ifdef STAR_MAIN X#undef opts X#undef _opts X#undef gargs X#undef susage X#undef usage X#undef xusage X XLOCAL void Xgnutar_setopts(o) X char *o; X{ Xextern char *opts; X opts = o; X} X#endif END-of-star-1.6/star/gnutar.c echo x - star-1.6/star/star_fat.mk sed 's/^X//' >star-1.6/star/star_fat.mk << 'END-of-star-1.6/star/star_fat.mk' X#ident @(#)star_fat.mk 1.28 18/06/08 X########################################################################### X#include $(MAKE_M_ARCH).def XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X X# X# This is star_fat.mk, it creates one "fat" binary for all functionality. X# X# If you like to create non "fat" binaries, remove Makefile X# and copy all.mk to Makefile. X# XINSDIR= bin XTARGET= star X#SYMLINKS= ustar tar XSYMLINKS= ustar tar gnutar suntar scpio spax XCPPOPTS += -D__STAR__ XCPPOPTS += -DSET_CTIME # Include timestorm code to set ctime XCPPOPTS += -DFIFO # Include FIFO code XCPPOPTS += -DUSE_SSH # Use "ssh" by default instead of "rsh" XCPPOPTS += -DUSE_MMAP # Use mmap() for the FIFO XCPPOPTS += -DUSE_REMOTE # Add support for the rmt protocol XCPPOPTS += -DUSE_RCMD_RSH # Add fast support for rcmd() XCPPOPTS += -DUSE_LARGEFILES # Support files > 2 GB XCPPOPTS += -DUSE_FIND # Include support for libfind XCPPOPTS += -DUSE_ACL # Support file ACLs XCPPOPTS += -DUSE_XATTR # Support (currently Linux) xattr XCPPOPTS += -DUSE_FFLAGS # Support BSD style file flags XCPPOPTS += -DCOPY_LINKS_DELAYED # Delayed copy of hard/symlinks XCPPOPTS += -DSTAR_FAT # One binary for all CLI's XCPPOPTS += -DUSE_ICONV # Use iconv() for pax filenames XCPPOPTS += -DUSE_NLS # Include locale support XCPPOPTS += -DTEXT_DOMAIN=\"SCHILY_utils\" XCPPOPTS += -DSCHILY_PRINT XCFILES= star_fat.c header.c cpiohdr.c xheader.c xattr.c \ X list.c extract.c create.c append.c diff.c restore.c \ X remove.c star_unix.c acl_unix.c acltext.c fflags.c \ X buffer.c dirtime.c lhash.c \ X hole.c longnames.c \ X movearch.c table.c props.c \ X unicode.c \ X subst.c volhdr.c \ X chdir.c match.c defaults.c dumpdate.c \ X fifo.c device.c checkerr.c paxopts.c \ X \ X findinfo.c pathname.c X XHFILES= star.h starsubs.h dirtime.h xtab.h xutimes.h \ X movearch.h table.h props.h fifo.h diff.h restore.h \ X checkerr.h dumpdate.h bitstring.h pathname.h X X#LIBS= -lunos X#LIBS= -lschily -lc /usr/local/lib/gcc-gnulib X# X# LIB_CAP is needed for Linux capability support in librmt. X# XLIBS= -ldeflt -lrmt -lfind -lschily $(LIB_ACL) $(LIB_ATTR) $(LIB_SOCKET) $(LIB_ICONV) $(LIB_INTL) $(LIB_CAP) X# X# Wenn -lfind, dann auch $(LIB_INTL) X# XXMK_FILE= Makefile.man ustarman.mk starformatman.mk scpioman.mk gnutarman.mk \ X spaxman.mk suntarman.mk Makefile.dfl Makefile.doc X Xstar_fat.c: star.c X $(RM) $(RM_FORCE) $@; cp star.c $@ X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.cmd Xinclude $(SRCROOT)/$(RULESDIR)/rules.tst X########################################################################### Xcount: $(CFILES) $(HFILES) X count $r1 X END-of-star-1.6/star/star_fat.mk echo x - star-1.6/star/gnutarman.mk sed 's/^X//' >star-1.6/star/gnutarman.mk << 'END-of-star-1.6/star/gnutarman.mk' X#ident @(#)gnutarman.mk 1.1 04/09/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= gnutar XMANSECT= $(MANSECT_CMD) XMANSUFFIX= $(MANSUFF_CMD) XMANFILE= gnutar.1 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/star/gnutarman.mk echo x - star-1.6/star/starsubs.h sed 's/^X//' >star-1.6/star/starsubs.h << 'END-of-star-1.6/star/starsubs.h' X/* @(#)starsubs.h 1.135 19/03/11 Copyright 1996-2019 J. Schilling */ X/* X * Prototypes for star subroutines X * X * Copyright (c) 1996-2019 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X X#ifndef _SCHILY_UTYPES_H X#include X#endif X X#ifndef _SCHILY_TYPES_H X#include X#endif X X/* X * star.c X */ Xextern int main __PR((int ac, char **av)); Xextern int getnum __PR((char *arg, long *valp)); Xextern int getbnum __PR((char *arg, Llong *valp)); Xextern int getknum __PR((char *arg, Llong *valp)); Xextern void set_signal __PR((int sig, RETSIGTYPE (*handler)(int))); Xextern void copy_create __PR((int ac, char *const *av)); Xextern void star_verifyopts __PR((void)); X#ifdef EOF Xextern BOOL ttyerr __PR((FILE *f)); X#endif X X/* X * chdir.c X */ Xextern char *dogetwdir __PR((BOOL doexit)); Xextern BOOL dochdir __PR((const char *dir, BOOL doexit)); X X/* X * match.c X */ Xextern const char *filename __PR((const char *name)); Xextern BOOL match __PR((const char *name)); Xextern int addpattern __PR((const char *pattern)); Xextern int addarg __PR((const char *pattern)); Xextern void closepattern __PR((void)); Xextern void prpatstats __PR((void)); X X/* X * buffer.c X */ Xextern void opt_remote __PR((void)); Xextern BOOL openremote __PR((void)); Xextern void opentape __PR((void)); Xextern void closetape __PR((void)); Xextern void changetape __PR((BOOL donext)); Xextern void nextitape __PR((void)); Xextern void nextotape __PR((void)); Xextern int startvol __PR((char *buf, int amount)); Xextern void newvolhdr __PR((char *buf, int amount, BOOL do_fifo)); Xextern void initbuf __PR((int nblocks)); Xextern void markeof __PR((void)); Xextern void marktcb __PR((char *addr)); Xextern void syncbuf __PR((void)); Xextern int peekblock __PR((char *buf, int amount)); Xextern int readblock __PR((char *buf, int amount)); Xextern int readtape __PR((char *buf, int amount)); X#ifdef _STAR_H Xextern void filltcb __PR((TCB *ptb)); Xextern void movetcb __PR((TCB *from_ptb, TCB *to_ptb)); X#endif Xextern void *get_block __PR((int amount)); Xextern void put_block __PR((int amount)); Xextern char *writeblock __PR((char *buf)); Xextern int writetape __PR((char *buf, int amount)); Xextern void writeempty __PR((void)); Xextern void weof __PR((void)); Xextern void buf_sync __PR((int size)); Xextern void buf_drain __PR((void)); Xextern int buf_wait __PR((int amount)); Xextern void buf_wake __PR((int amount)); Xextern int buf_rwait __PR((int amount)); Xextern void buf_rwake __PR((int amount)); Xextern void buf_resume __PR((void)); Xextern void backtape __PR((void)); Xextern int mtioctl __PR((int cmd, int count)); Xextern off_t mtseek __PR((off_t offset, int whence)); Xextern Llong tblocks __PR((void)); Xextern void prstats __PR((void)); Xextern BOOL checkerrs __PR((void)); Xextern void exprstats __PR((int ret)); Xextern void excomerrno __PR((int err, X char *fmt, ...)) __printflike__(2, 3); Xextern void excomerr __PR((char *fmt, ...)) __printflike__(1, 2); Xextern void die __PR((int err)); X X/* X * append.c X */ X#ifdef _STAR_H Xextern void skipall __PR((void)); Xextern BOOL update_newer __PR((FINFO *info)); X#endif X X/* X * create.c X */ Xextern void checklinks __PR((void)); Xextern int _fileread __PR((int *fp, void *buf, int len)); Xextern void create __PR((char *name, BOOL Hflag, BOOL forceadd)); Xextern void createlist __PR((void)); X#ifdef _STAR_H Xextern BOOL read_symlink __PR((char *sname, char *name, X FINFO *info, TCB *ptb)); Xextern BOOL last_cpio_link __PR((FINFO *info)); Xextern BOOL xcpio_link __PR((FINFO *info)); Xextern void flushlinks __PR((void)); Xextern BOOL read_link __PR((char *name, int namlen, FINFO *info, X TCB *ptb)); X#ifdef EOF Xextern void put_file __PR((int *fp, FINFO *info)); X#endif Xextern void cr_file __PR((FINFO *info, X int (*)(void *, char *, int), X void *arg, int amt, char *text)); X#endif X#if defined(_SCHILY_STAT_H) && defined(_SCHILY_WALK_H) Xextern int walkfunc __PR((char *nm, struct stat *fs, X int type, struct WALK *state)); X#endif X X/* X * diff.c X */ Xextern void diff __PR((void)); X#ifdef EOF Xextern void prdiffopts __PR((FILE *f, char *label, int flags)); X#endif X X/* X * restore.c X */ X#ifdef _STAR_H X#ifdef _RESTORE_H Xextern imap_t *padd_node __PR((char *name, ino_t oino, ino_t nino, X Int32_t flags)); Xextern imap_t *sym_addrec __PR((FINFO *info)); Xextern void sym_addstat __PR((FINFO *info, imap_t *imp)); Xextern imap_t *sym_dirprepare __PR((FINFO *info, imap_t *idir)); Xextern imap_t *sym_typecheck __PR((FINFO *info, FINFO *cinfo, imap_t *imp)); X#endif X#endif Xextern void sym_initmaps __PR((void)); Xextern void sym_open __PR((char *name)); X#ifdef _STAR_H Xextern void sym_init __PR((GINFO *gp)); X#endif Xextern void sym_close __PR((void)); X#ifdef EOF Xextern void printLsym __PR((FILE *f)); X#endif X X/* X * dirtime.c X */ X/* The prototype definitions have been moved into dirtime.h */ X X/* X * extract.c X */ X#ifdef _STAR_H Xextern void extract __PR((char *vhname)); X#ifdef _RESTORE_H Xextern BOOL extracti __PR((FINFO *info, imap_t *imp)); X#endif Xextern BOOL newer __PR((FINFO *info, FINFO *cinfo)); Xextern BOOL same_symlink __PR((FINFO *info)); Xextern BOOL same_special __PR((FINFO *info)); Xextern BOOL create_dirs __PR((char *name)); Xextern BOOL make_adir __PR((FINFO *info)); Xextern BOOL void_file __PR((FINFO *info)); Xextern int xt_file __PR((FINFO *info, X int (*)(void *, char *, int), X void *arg, int amt, char *text)); Xextern void skip_slash __PR((FINFO *info)); X#endif X X/* X * fifo.c X */ X#ifdef FIFO Xextern void initfifo __PR((void)); Xextern void fifo_ibs_shrink __PR((int newsize)); Xextern void runfifo __PR((int ac, char *const *av)); Xextern void fifo_prmp __PR((int sig)); Xextern void fifo_stats __PR((void)); Xextern int fifo_amount __PR((void)); Xextern int fifo_iwait __PR((int amount)); Xextern void fifo_owake __PR((int amount)); Xextern void fifo_oflush __PR((void)); Xextern void fifo_oclose __PR((void)); Xextern int fifo_owait __PR((int amount)); Xextern void fifo_iwake __PR((int amt)); Xextern void fifo_reelwake __PR((void)); Xextern void fifo_resume __PR((void)); Xextern void fifo_sync __PR((int size)); Xextern int fifo_errno __PR((void)); Xextern void fifo_onexit __PR((int err, void *ignore)); Xextern void fifo_exit __PR((int err)); Xextern void fifo_chitape __PR((void)); Xextern void fifo_chotape __PR((void)); X#endif X X/* X * header.c X */ X#ifdef _STAR_H Xextern BOOL tarsum_ok __PR((TCB *ptb)); X#ifdef EOF Xextern void print_hdrtype __PR((FILE *f, int type)); X#endif Xextern char *hdr_name __PR((int type)); Xextern char *hdr_text __PR((int type)); Xextern int hdr_type __PR((char *name)); Xextern void hdr_usage __PR((void)); Xextern int get_hdrtype __PR((TCB *ptb, BOOL isrecurse)); Xextern int get_compression __PR((TCB *ptb)); Xextern char *get_cmpname __PR((int type)); Xextern int get_tcb __PR((TCB *ptb)); Xextern void put_tcb __PR((TCB *ptb, FINFO *info)); Xextern void write_tcb __PR((TCB *ptb, FINFO *info)); Xextern void info_to_tcb __PR((register FINFO *info, register TCB *ptb)); Xextern int tcb_to_info __PR((register TCB *ptb, register FINFO *info)); Xextern void stolli __PR((register char *s, Ullong *ull)); Xextern void llitos __PR((char *s, Ullong ull, int fieldw)); Xextern void dump_info __PR((FINFO *info)); X#endif X X/* X * volhdr.c X */ X#ifdef _STAR_H Xextern void ginit __PR((void)); Xextern void grinit __PR((void)); Xextern void gipsetup __PR((GINFO *gp)); Xextern void griprint __PR((GINFO *gp)); Xextern BOOL verifyvol __PR((char *buf, int amt, int volno, X int *skipp)); Xextern char *dt_name __PR((int type)); Xextern int dt_type __PR((char *name)); Xextern void put_release __PR((void)); Xextern void put_archtype __PR((void)); Xextern void put_volhdr __PR((char *name, BOOL putv)); Xextern void put_svolhdr __PR((char *name)); Xextern void put_multhdr __PR((off_t size, off_t off)); Xextern BOOL get_volhdr __PR((FINFO *info, char *vhname)); X#endif X X/* X * cpiohdr.c X */ X#ifdef _STAR_H Xextern void put_cpioh __PR((TCB *ptb, FINFO *info)); Xextern void cpioinfo_to_tcb __PR((FINFO *info, TCB *ptb)); Xextern int cpiotcb_to_info __PR((TCB *ptb, FINFO *info)); Xextern int cpio_checkswab __PR((TCB *ptb)); X#endif Xextern void cpio_weof __PR((void)); Xextern void cpio_resync __PR((void)); X X/* X * xheader.c X */ X#ifdef _STAR_H Xextern void xbinit __PR((void)); Xextern void xbbackup __PR((void)); Xextern void xbrestore __PR((void)); Xextern int xhsize __PR((void)); Xextern void info_to_xhdr __PR((FINFO *info, TCB *ptb)); Xextern BOOL xhparse __PR((FINFO *info, char *p, char *ep)); Xextern void xh_rangeerr __PR((char *keyword, char *arg, int len)); Xextern void gen_xtime __PR((char *keyword, time_t sec, Ulong nsec)); Xextern void gen_unumber __PR((char *keyword, Ullong arg)); Xextern void gen_number __PR((char *keyword, Llong arg)); Xextern void gen_text __PR((char *keyword, char *arg, int alen, X Uint flags)); X Xextern void tcb_to_xhdr_reset __PR((void)); Xextern int tcb_to_xhdr __PR((TCB *ptb, FINFO *info)); X Xextern BOOL get_xtime __PR((char *keyword, char *arg, int len, X time_t *secp, long *nsecp)); X#ifdef __needed_ Xextern BOOL get_number __PR((char *keyword, char *arg, Llong *llp)); X#endif Xextern BOOL get_unumber __PR((char *keyword, char *arg, Ullong *ullp, X Ullong maxval)); Xextern BOOL get_snumber __PR((char *keyword, char *arg, Ullong *ullp, X BOOL *negp, X Ullong minval, Ullong maxval)); X#endif X X/* X * xattr.c X */ X#ifdef _STAR_H Xextern void opt_xattr __PR((void)); Xextern void opt_selinux __PR((void)); Xextern BOOL get_xattr __PR((register FINFO *info)); Xextern BOOL set_xattr __PR((register FINFO *info)); X#ifdef USE_SELINUX Xextern BOOL setselinux __PR((register FINFO *info)); X#endif Xextern void free_xattr __PR((star_xattr_t **xattr)); X#endif X X/* X * hole.c X */ X#ifdef _STAR_H X#ifdef EOF Xextern int get_forced_hole __PR((FILE *f, FINFO *info)); Xextern int get_sparse __PR((FILE *f, FINFO *info)); Xextern int get_as_hole __PR((FILE *f, FINFO *info)); Xextern BOOL cmp_sparse __PR((FILE *f, FINFO *info)); Xextern void put_sparse __PR((int *fp, FINFO *info)); Xextern BOOL sparse_file __PR((int *fp, FINFO *info)); X#endif Xextern int gnu_skip_extended __PR((FINFO *info)); X#endif X X/* X * lhash.c X */ Xextern size_t hash_size __PR((size_t size)); X#ifdef EOF Xextern void hash_build __PR((FILE *fp)); Xextern void hash_xbuild __PR((FILE *fp)); X#endif Xextern BOOL hash_lookup __PR((char *str)); Xextern BOOL hash_xlookup __PR((char *str)); X X/* X * list.c X */ X#ifdef _STAR_H Xextern void list __PR((void)); Xextern void list_file __PR((register FINFO *info)); Xextern void vprint __PR((FINFO *info)); X#endif X X/* X * longnames.c X */ X#ifdef _STAR_H Xextern BOOL name_to_tcb __PR((FINFO *info, TCB *ptb)); Xextern void tcb_to_name __PR((TCB *ptb, FINFO *info)); Xextern void tcb_undo_split __PR((TCB *ptb, FINFO *info)); Xextern int tcb_to_longname __PR((register TCB *ptb, register FINFO *info)); Xextern void write_longnames __PR((register FINFO *info)); X#endif X X/* X * props.c X */ Xextern void setprops __PR((long htype)); Xextern void printprops __PR((void)); X X/* X * remove.c X */ Xextern BOOL remove_file __PR((char *name, BOOL isfirst)); X X/* X * star_unix.c X */ X#ifdef _STAR_H Xextern BOOL _getinfo __PR((char *name, FINFO *info)); Xextern BOOL _lgetinfo __PR((char *name, FINFO *info)); Xextern BOOL getinfo __PR((char *name, FINFO *info)); X#ifdef HAVE_FSTATAT Xextern BOOL getinfoat __PR((int fd, char *name, FINFO *info)); X#endif X#ifdef _SCHILY_STAT_H Xextern BOOL stat_to_info __PR((int fd, struct stat *sp, FINFO *info)); X#endif X#ifdef EOF Xextern void checkarch __PR((FILE *f)); Xextern BOOL samefile __PR((FILE *fp1, FILE *fp2)); X#endif Xextern BOOL archisnull __PR((const char *name)); Xextern void setmodes __PR((FINFO *info)); Xextern int snulltimes __PR((char *name, FINFO *info)); Xextern int sxsymlink __PR((char *name, FINFO *info)); Xextern int rs_acctime __PR((int fd, FINFO *info)); Xextern void setdirmodes __PR((char *name, mode_t mode)); Xextern mode_t osmode __PR((mode_t tarmode)); X X/* X * lpath_unix.c X */ Xextern int lchdir __PR((char *name)); Xextern char *lgetcwd __PR((void)); Xextern int lmkdir __PR((char *name, mode_t mode)); Xextern int laccess __PR((char *name, int amode)); X#ifdef _SCHILY_STAT_H Xextern int lstatat __PR((char *name, struct stat *buf, int flag)); X#endif Xextern int lchmodat __PR((char *name, mode_t mode, int flag)); X#ifdef _SCHILY_TIME_H Xextern int lutimensat __PR((char *name, struct timespec *ts, X int flag)); X#endif Xextern int lreadlink __PR((char *name, char *buf, size_t bufsize)); Xextern int lsymlink __PR((char *name, char *name2)); Xextern int llink __PR((char *name, char *name2)); Xextern int lrename __PR((char *name, char *name2)); Xextern int lmknod __PR((char *name, mode_t mode, dev_t dev)); Xextern int lmkfifo __PR((char *name, mode_t mode)); Xextern int lchownat __PR((char *name, uid_t uid, gid_t gid, X int flag)); Xextern int lunlinkat __PR((char *name, int flag)); Xextern char *lmktemp __PR((char *name)); X#ifdef EOF Xextern FILE *lfilemopen __PR((char *name, char *mode, mode_t cmode)); X#endif Xextern int _lfileopen __PR((char *name, char *mode)); X#ifdef _SCHILY_DIRENT_H XEXPORT DIR *lopendir __PR((char *name)); X#endif X#endif X X/* X * acl_unix.c X */ Xextern void opt_acl __PR((void)); X#ifdef _STAR_H Xextern BOOL get_acls __PR((FINFO *info)); Xextern void set_acls __PR((FINFO *info)); X#endif X X/* X * unicode.c X */ Xextern void utf8_init __PR((int type)); Xextern void utf8_fini __PR((void)); Xextern int to_utf8 __PR((Uchar *to, int tolen, X Uchar *from, int len)); Xextern BOOL from_utf8 __PR((Uchar *to, int tolen, X Uchar *from, int *len)); X X/* X * fflags.c X */ Xextern void opt_fflags __PR((void)); X#ifdef _STAR_H Xextern void get_fflags __PR((FINFO *info)); Xextern void set_fflags __PR((FINFO *info)); Xextern char *textfromflags __PR((FINFO *info, char *buf)); Xextern int texttoflags __PR((FINFO *info, char *buf)); X#endif X X/* X * defaults.c X */ Xextern char *get_stardefaults __PR((char *name)); Xextern void star_defaults __PR((long *fsp, BOOL *no_fsyncp, X char *dfltname)); Xextern BOOL star_darchive __PR((char *arname, char *dfltname)); X X/* X * subst.c X */ Xextern int parsesubst __PR((char *cmd, BOOL *arg)); X#ifdef _STAR_H Xextern BOOL subst __PR((FINFO *info)); Xextern BOOL ia_change __PR((TCB *ptb, FINFO *info)); X#endif X X/* X * findinfo.c X */ X#ifdef _STAR_H XEXPORT BOOL findinfo __PR((FINFO *info)); X#endif X X/* X * paxopts.c X */ Xextern int ppaxopts __PR((const char *opts)); END-of-star-1.6/star/starsubs.h echo x - star-1.6/star/hole.c sed 's/^X//' >star-1.6/star/hole.c << 'END-of-star-1.6/star/hole.c' X/* @(#)hole.c 1.67 18/11/28 Copyright 1993-2018 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)hole.c 1.67 18/11/28 Copyright 1993-2018 J. Schilling"; X#endif X/* X * Handle files with holes (sparse files) X * X * Copyright (c) 1993-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include "star.h" X#define GT_COMERR /* #define comerr gtcomerr */ X#define GT_ERROR /* #define error gterror */ X#include X#include "props.h" X#include "table.h" X#include "starsubs.h" X#include "checkerr.h" X#ifdef sun X#include X#if _FIOAI == _FIOOBSOLETE67 X#undef _FIOAI X#endif X#ifdef _FIOAI X#include X#endif X#endif /* sun */ X X#ifdef SEEK_DEBUG X#define SEEK_DATA 3 X#define SEEK_HOLE 4 X#endif X X/* X * Initial sparse (sp_t) array allocation. X * We currently use SPARSE_IN_HDR + SPARSE_EXT_HDR, X * if we implement a new POSIX.1-2001 based sparse file handling method, we X * need to rething this ad it would make sense to start with 512 (8 KB). X */ X#define NSPARSE_INIT 25 X X#define DEBUG X#ifdef DEBUG X#define EDEBUG(a) if (debug) error a X#else X#define EDEBUG(a) X#endif X Xextern long bigcnt; Xextern char *bigptr; X Xextern BOOL debug; Xextern BOOL force_hole; Xextern BOOL nullout; Xextern BOOL silent; X X/* X * XXX If we have really big files, there could in theory be more than X * XXX 2 billions of hole/nohole pairs in a file. X * XXX But if this happens, we would need > 32 GB of RAM for the hole list. X */ Xtypedef struct { X FILE *fh_file; X char *fh_name; X off_t fh_size; X off_t fh_newpos; X sp_t *fh_sparse; X int fh_nsparse; X int fh_spindex; X int fh_diffs; X} fh_t; X XLOCAL int force_hole_func __PR((fh_t *fh, char *p, int amount)); XEXPORT int get_forced_hole __PR((FILE *f, FINFO *info)); XLOCAL void bad_sparse_index __PR((fh_t *fh)); XLOCAL int get_sparse_func __PR((fh_t *fh, char *p, int amount)); XLOCAL int get_ssparse_func __PR((fh_t *fh, char *p, int amount)); XLOCAL int cmp_sparse_func __PR((fh_t *fh, char *p, int amount)); XLOCAL int put_sparse_func __PR((fh_t *fh, char *p, int amount)); XLOCAL sp_t *grow_sp_list __PR((sp_t *sparse, int *nspp)); XLOCAL sp_t *get_sp_list __PR((FINFO *info, int *nsparsep)); XLOCAL int mk_sp_list __PR((int *fp, FINFO *info, sp_t **spp)); X#if defined(SEEK_HOLE) && defined(SEEK_DATA) XLOCAL int smk_sp_list __PR((int f, FINFO *info, sp_t **spp, off_t hpos)); X#endif XLOCAL int get_end_hole __PR((fh_t *fh)); XLOCAL int write_end_hole __PR((fh_t *fh)); XEXPORT int gnu_skip_extended __PR((FINFO *info)); XEXPORT int get_sparse __PR((FILE *f, FINFO *info)); XEXPORT int get_as_hole __PR((FILE *f, FINFO *info)); XEXPORT BOOL cmp_sparse __PR((FILE *f, FINFO *info)); XEXPORT void put_sparse __PR((int *fp, FINFO *info)); XLOCAL void put_sp_list __PR((FINFO *info, sp_t *sparse, int nsparse)); XEXPORT BOOL sparse_file __PR((int *fp, FINFO *info)); X X#define vp_force_hole_func ((int(*)__PR((void *, char *, int)))force_hole_func) X XLOCAL int Xforce_hole_func(fh, p, amount) X register fh_t *fh; X register char *p; X int amount; X{ X register int cnt; X X fh->fh_newpos += amount; X if (amount < fh->fh_size && X cmpnullbytes(bigptr, amount) >= amount) { X if (lseek(fdown(fh->fh_file), fh->fh_newpos, SEEK_SET) == (off_t)-1) { X if (!errhidden(E_WRITE, fh->fh_name)) { X if (!errwarnonly(E_WRITE, fh->fh_name)) X xstats.s_rwerrs++; X errmsg("Error seeking '%s'.\n", fh->fh_name); X (void) errabort(E_WRITE, fh->fh_name, TRUE); X } X } X X fh->fh_size -= amount; X return (amount); X } X cnt = ffilewrite(fh->fh_file, p, amount); X fh->fh_size -= amount; X return (cnt); X} X XEXPORT BOOL Xget_forced_hole(f, info) X FILE *f; X FINFO *info; X{ X fh_t fh; X X fh.fh_file = f; X fh.fh_name = info->f_name; X fh.fh_size = info->f_rsize; X fh.fh_newpos = (off_t)0; X return (xt_file(info, vp_force_hole_func, &fh, TBLOCK, "writing")); X} X XLOCAL void Xbad_sparse_index(fh) X register fh_t *fh; X{ X errmsgno(EX_BAD, X "Trying to access sparse aray beyond end (index %d).\n", X fh->fh_spindex); X} X X/* X * Get "amount" bytes from the buffer and write it into the file. X * If "amount" spans more then a single data chunk in the resulting file, X * cut it into several chunks that probably start with a seek and get this X * done by get_ssparse_func(). X */ X#define vp_get_sparse_func ((int(*)__PR((void *, char *, int)))get_sparse_func) XLOCAL int Xget_sparse_func(fh, p, amount) X register fh_t *fh; X register char *p; X register int amount; X{ X register int cnt = 0; X register int amt; X off_t next_hole; X off_t newpos = fh->fh_newpos; X X do { X if (fh->fh_spindex >= fh->fh_nsparse) { X seterrno(EX_BAD); X bad_sparse_index(fh); X return (-1); X } X if (fh->fh_sparse[fh->fh_spindex].sp_offset > newpos) { X newpos = fh->fh_sparse[fh->fh_spindex].sp_offset; X } else { X newpos = fh->fh_newpos; X } X next_hole = fh->fh_sparse[fh->fh_spindex].sp_offset + X fh->fh_sparse[fh->fh_spindex].sp_numbytes; X amt = amount - cnt; X if ((newpos + amt) > next_hole) X amt = next_hole - newpos; X amt = get_ssparse_func(fh, p, amt); X if (amt < 0) X return (-1); X cnt += amt; X p += amt; X } while (cnt < amount); X return (cnt); X} X X/* X * Get a single chunk of data from the buffer and write it into the file. X */ XLOCAL int Xget_ssparse_func(fh, p, amount) X register fh_t *fh; X register char *p; X int amount; X{ X register int cnt; X X EDEBUG(("amount: %d newpos: %lld index: %d\n", X amount, (Llong)fh->fh_newpos, fh->fh_spindex)); X X if (fh->fh_sparse[fh->fh_spindex].sp_offset > fh->fh_newpos) { X X EDEBUG(("seek to: %lld\n", X (Llong)fh->fh_sparse[fh->fh_spindex].sp_offset)); X X if (lseek(fdown(fh->fh_file), X fh->fh_sparse[fh->fh_spindex].sp_offset, SEEK_SET) < 0) { X if (!errhidden(E_WRITE, fh->fh_name)) { X if (!errwarnonly(E_WRITE, fh->fh_name)) X xstats.s_rwerrs++; X errmsg("Error seeking '%s'.\n", fh->fh_name); X (void) errabort(E_WRITE, fh->fh_name, TRUE); X } X } X X fh->fh_newpos = fh->fh_sparse[fh->fh_spindex].sp_offset; X } X EDEBUG(("write %d at: %lld\n", amount, (Llong)fh->fh_newpos)); X X cnt = ffilewrite(fh->fh_file, p, amount); X fh->fh_size -= cnt; X fh->fh_newpos += cnt; X X EDEBUG(("off: %lld numb: %lld cnt: %d off+numb: %lld newpos: %lld index: %d\n", X (Llong)fh->fh_sparse[fh->fh_spindex].sp_offset, X (Llong)fh->fh_sparse[fh->fh_spindex].sp_numbytes, cnt, X (Llong)(fh->fh_sparse[fh->fh_spindex].sp_offset + X fh->fh_sparse[fh->fh_spindex].sp_numbytes), X (Llong)fh->fh_newpos, X fh->fh_spindex)); X X if ((fh->fh_sparse[fh->fh_spindex].sp_offset + X fh->fh_sparse[fh->fh_spindex].sp_numbytes) X <= fh->fh_newpos) { X X fh->fh_spindex++; X X EDEBUG(("new index: %d\n", fh->fh_spindex)); X } X EDEBUG(("return (%d)\n", cnt)); X return (cnt); X} X X#define vp_cmp_sparse_func ((int(*)__PR((void *, char *, int)))cmp_sparse_func) X XLOCAL int Xcmp_sparse_func(fh, p, amount) X register fh_t *fh; X register char *p; X int amount; X{ X register int cnt; X char *cmp_buf[TBLOCK]; X X EDEBUG(("amount: %d newpos: %lld index: %d\n", X amount, X (Llong)fh->fh_newpos, fh->fh_spindex)); X X if (fh->fh_spindex >= fh->fh_nsparse) { X seterrno(EX_BAD); X bad_sparse_index(fh); X return (-1); X } X X /* X * If we already found diffs we save time and only pass tape ... X */ X if (fh->fh_diffs) X return (amount); X X if (fh->fh_sparse[fh->fh_spindex].sp_offset > fh->fh_newpos) { X EDEBUG(("seek to: %lld\n", X (Llong)fh->fh_sparse[fh->fh_spindex].sp_offset)); X X while (fh->fh_newpos < fh->fh_sparse[fh->fh_spindex].sp_offset) { X register int amt; X X amt = min(TBLOCK, X fh->fh_sparse[fh->fh_spindex].sp_offset - X fh->fh_newpos); X X cnt = ffileread(fh->fh_file, cmp_buf, amt); X if (cnt != amt) X fh->fh_diffs++; X X if (cmpnullbytes(cmp_buf, amt) < cnt) X fh->fh_diffs++; X X fh->fh_newpos += cnt; X X if (fh->fh_diffs) X return (amount); X } X } X EDEBUG(("read %d at: %lld\n", amount, (Llong)fh->fh_newpos)); X X cnt = ffileread(fh->fh_file, cmp_buf, amount); X if (cnt != amount) X fh->fh_diffs++; X X if (cmpbytes(cmp_buf, p, cnt) < cnt) X fh->fh_diffs++; X X fh->fh_size -= cnt; X fh->fh_newpos += cnt; X X EDEBUG(("off: %lld numb: %lld cnt: %d off+numb: %lld newpos: %lld index: %d\n", X (Llong)fh->fh_sparse[fh->fh_spindex].sp_offset, X (Llong)fh->fh_sparse[fh->fh_spindex].sp_numbytes, cnt, X (Llong)(fh->fh_sparse[fh->fh_spindex].sp_offset + X fh->fh_sparse[fh->fh_spindex].sp_numbytes), X (Llong)fh->fh_newpos, X fh->fh_spindex)); X X if ((fh->fh_sparse[fh->fh_spindex].sp_offset + X fh->fh_sparse[fh->fh_spindex].sp_numbytes) X <= fh->fh_newpos) { X X fh->fh_spindex++; X X EDEBUG(("new index: %d\n", fh->fh_spindex)); X } X EDEBUG(("return (%d) diffs: %d\n", cnt, fh->fh_diffs)); X return (cnt); X} X X#define vp_put_sparse_func ((int(*)__PR((void *, char *, int)))put_sparse_func) X XLOCAL int Xput_sparse_func(fh, p, amount) X register fh_t *fh; X register char *p; X int amount; X{ X register int cnt; X X EDEBUG(("amount: %d newpos: %lld index: %d\n", X amount, X (Llong)fh->fh_newpos, fh->fh_spindex)); X X if (fh->fh_spindex < fh->fh_nsparse && X fh->fh_sparse[fh->fh_spindex].sp_offset > fh->fh_newpos) { X X EDEBUG(("seek to: %lld\n", X (Llong)fh->fh_sparse[fh->fh_spindex].sp_offset)); X X if (!nullout && X lseek(*(int *)(fh->fh_file), X fh->fh_sparse[fh->fh_spindex].sp_offset, SEEK_SET) < 0) { X if (!errhidden(E_READ, fh->fh_name)) { X if (!errwarnonly(E_READ, fh->fh_name)) X xstats.s_rwerrs++; X errmsg("Error seeking '%s'.\n", fh->fh_name); X (void) errabort(E_READ, fh->fh_name, TRUE); X } X } X X fh->fh_newpos = fh->fh_sparse[fh->fh_spindex].sp_offset; X } X /* X * I former times, cr_file has been called with an amt value of 512, X * we now try to optimize the I/O for the data chunk size. X * In case we are not yet at the expected end of the file, we limit the X * the amount to the end of the current data region, else (when cr_file X * tries to find whether the file did grow, we just pass the original. X */ X if (fh->fh_spindex < fh->fh_nsparse && X (fh->fh_newpos + amount) > X (fh->fh_sparse[fh->fh_spindex].sp_offset + X fh->fh_sparse[fh->fh_spindex].sp_numbytes)) { X amount = (fh->fh_sparse[fh->fh_spindex].sp_offset + X fh->fh_sparse[fh->fh_spindex].sp_numbytes) - X fh->fh_newpos; X } X EDEBUG(("read %d at: %lld\n", amount, (Llong)fh->fh_newpos)); X X if (nullout) { X cnt = amount; X if (cnt > fh->fh_size) X cnt = fh->fh_size; X } else { X cnt = _fileread((int *)fh->fh_file, p, amount); X } X fh->fh_size -= cnt; X fh->fh_newpos += cnt; X X EDEBUG(("off: %lld numb: %lld cnt: %d off+numb: %lld newpos: %lld index: %d\n", X (Llong)fh->fh_sparse[fh->fh_spindex].sp_offset, X (Llong)fh->fh_sparse[fh->fh_spindex].sp_numbytes, cnt, X (Llong)(fh->fh_sparse[fh->fh_spindex].sp_offset + X fh->fh_sparse[fh->fh_spindex].sp_numbytes), X (Llong)fh->fh_newpos, X fh->fh_spindex)); X X if ((fh->fh_sparse[fh->fh_spindex].sp_offset + X fh->fh_sparse[fh->fh_spindex].sp_numbytes) X <= fh->fh_newpos) { X X fh->fh_spindex++; X X EDEBUG(("new index: %d\n", fh->fh_spindex)); X } X EDEBUG(("return (%d)\n", cnt)); X return (cnt); X} X XLOCAL sp_t * Xgrow_sp_list(sparse, nspp) X sp_t *sparse; X int *nspp; X{ X sp_t *new; X X if (*nspp < 512) X *nspp *= 2; X else X *nspp += 512; X new = (sp_t *)realloc(sparse, *nspp*sizeof (sp_t)); X if (new == 0) { X errmsg("Cannot grow sparse buf.\n"); X free(sparse); X } X return (new); X} X XLOCAL sp_t * Xget_sp_list(info, nsparsep) X FINFO *info; X int *nsparsep; X{ X TCB tb; X TCB *ptb = info->f_tcb; X sp_t *sparse; X int nsparse = NSPARSE_INIT; X int extended; X register int i; X register int sparse_in_hdr = props.pr_sparse_in_hdr; X register int ind; X char *p; X extern long hdrtype; /* XXX */ X X EDEBUG(("rsize: %lld\n", (Llong)info->f_rsize)); X X sparse = (sp_t *)malloc(nsparse*sizeof (sp_t)); X if (sparse == 0) { X errmsg("Cannot alloc sparse buf.\n"); X *nsparsep = 0; X return (sparse); X } X X if (H_TYPE(hdrtype) == H_GNUTAR) { X p = (char *)ptb->gnu_in_dbuf.t_sp; X } else { X p = (char *)ptb->xstar_in_dbuf.t_sp; X X if (ptb->xstar_dbuf.t_prefix[0] == '\0' && X ptb->xstar_in_dbuf.t_sp[0].t_offset[10] != '\0') { X static BOOL warned; X extern BOOL nowarn; X X if (!nowarn && !warned) { X errmsgno(EX_BAD, "WARNING: Archive uses old sparse format. Please upgrade!\n"); X warned = TRUE; X } X sparse_in_hdr = SPARSE_IN_HDR; X } X } X X for (i = 0; i < sparse_in_hdr; i++) { X Ullong ull; X X stolli(p, &ull); p += 12; X sparse[i].sp_offset = ull; X stolli(p, &ull); p += 12; X sparse[i].sp_numbytes = ull; X if (sparse[i].sp_offset == 0 && X sparse[i].sp_numbytes == 0) X break; X } X#ifdef DEBUG X /* CSTYLED */ X if (debug) for (i = 0; i < sparse_in_hdr; i++) { X error("i: %d offset: %lld numbytes: %lld\n", i, X (Llong)sparse[i].sp_offset, X (Llong)sparse[i].sp_numbytes); X if (sparse[i].sp_offset == 0 && X sparse[i].sp_numbytes == 0) X break; X } X#endif X ind = sparse_in_hdr-SPARSE_EXT_HDR; X X if (H_TYPE(hdrtype) == H_GNUTAR) X extended = ptb->gnu_in_dbuf.t_isextended; X else X extended = ptb->xstar_in_dbuf.t_isextended; X X extended |= (sparse_in_hdr == 0); X /* X * Set "ind" to allow us to set *nsparsep past while loop. X */ X if (!extended) { X info->f_flags |= F_SP_EXTENDED; X ind = 0; X } X X EDEBUG(("isextended: %d\n", extended)); X X ptb = &tb; /* don't destroy orig TCB */ X while (extended) { X if (readblock((char *)ptb, TBLOCK) == EOF) { X free(sparse); X *nsparsep = 0; X return (0); X } X if ((props.pr_flags & PR_GNU_SPARSE_BUG) == 0) X info->f_rsize -= TBLOCK; X X EDEBUG(("rsize: %lld\n", (Llong)info->f_rsize)); X X ind += SPARSE_EXT_HDR; X X EDEBUG(("ind: %d\n", ind)); X X if ((ind+SPARSE_EXT_HDR) > nsparse) { X if ((sparse = grow_sp_list(sparse, &nsparse)) == 0) { X *nsparsep = 0; X return ((sp_t *)0); X } X } X p = (char *)ptb; X for (i = 0; i < SPARSE_EXT_HDR; i++) { X Ullong ull; X X stolli(p, &ull); p += 12; X sparse[i+ind].sp_offset = ull; X stolli(p, &ull); p += 12; X sparse[i+ind].sp_numbytes = ull; X X EDEBUG(("i: %d offset: %lld numbytes: %lld\n", i, X (Llong)sparse[i+ind].sp_offset, X (Llong)sparse[i+ind].sp_numbytes)); X X if (sparse[i+ind].sp_offset == 0 && X sparse[i+ind].sp_numbytes == 0) X break; X } X extended = ptb->gnu_ext_dbuf.t_isextended; X } X info->f_flags |= F_SP_SKIPPED; X ind += i; X *nsparsep = ind; X EDEBUG(("nsparse: %d\n", ind)); X if (ind < 1) X return (sparse); X EDEBUG(("i: %d offset: %lld numbytes: %lld\n", 0, X (Llong)sparse[0].sp_offset, X (Llong)sparse[0].sp_numbytes)); X for (i = 1; i < ind; i++) { X if (((sparse[i-1].sp_offset + sparse[i-1].sp_numbytes) > X sparse[i].sp_offset) && X (sparse[i].sp_offset != 0 || sparse[i].sp_numbytes != 0)) { X errmsgno(EX_BAD, X "Bad sparse data: offset %lld, numbytes %lld at idx %d.\n", X (Llong)sparse[i].sp_offset, X (Llong)sparse[i].sp_numbytes, i); X errmsgno(EX_BAD, "Current write position is %lld.\n", X (Llong)(sparse[i-1].sp_offset + X sparse[i-1].sp_numbytes)); X free(sparse); X *nsparsep = 0; X return (0); X } X EDEBUG(("i: %d offset: %lld numbytes: %lld\n", i, X (Llong)sparse[i].sp_offset, X (Llong)sparse[i].sp_numbytes)); X } X EDEBUG(("rsize: %lld\n", (Llong)info->f_rsize)); X X return (sparse); X} X X#if defined(SEEK_HOLE) && defined(SEEK_DATA) X/* X * The seek based sparse list parser for files. X * The interface has been defined in 2004 for Solaris & star and will hopefully X * be integrated into a future POSIX standard. X */ XLOCAL int Xsmk_sp_list(f, info, spp, hpos) X int f; X FINFO *info; X sp_t **spp; X register off_t hpos; X{ X register off_t dpos; X register sp_t *sparse = *spp; X int nsparse = NSPARSE_INIT; X register int i = 0; X X *spp = (sp_t *)0; X if (hpos != 0) { /* Starts with data */ X if ((hpos % 512) != 0) /* Unaligned hole ? */ X hpos = (hpos + 511) / 512 * 512; X X if (hpos >= info->f_size) { /* File has no hole */ X lseek(f, (off_t)0, SEEK_SET); X free(sparse); X return (0); X } X sparse[i].sp_offset = 0; X sparse[i].sp_numbytes = hpos; X X EDEBUG(("i: %d offset: %lld numbytes: %lld\n", i, X (Llong)sparse[i].sp_offset, X (Llong)sparse[i].sp_numbytes)); X X info->f_rsize += sparse[i].sp_numbytes; X i++; X } X while (hpos < info->f_size) { X dpos = lseek(f, hpos, SEEK_DATA); X if (dpos == (off_t)-1 && geterrno() == ENXIO) { X /* X * Catch the case "No more data past 'hpos'". X */ X dpos = info->f_size; X } else if (dpos == (off_t)-1) { X if (!errhidden(E_SHRINK, info->f_name)) { X if (!errwarnonly(E_SHRINK, info->f_name)) X xstats.s_sizeerrs++; X errmsg( X "'%s': SEEK_DATA file shrunk at offset %lld.\n", X info->f_name, (Llong)hpos); X (void) errabort(E_SHRINK, info->f_name, TRUE); X } X lseek(f, (off_t)0, SEEK_SET); X free(sparse); X return (0); X } X hpos = lseek(f, dpos, SEEK_HOLE); X if (hpos == (off_t)-1 && geterrno() == ENXIO) { X /* X * Catch the case "No more holes past 'dpos'". X */ X hpos = info->f_size; X } else if (hpos == (off_t)-1) { X if (!errhidden(E_SHRINK, info->f_name)) { X if (!errwarnonly(E_SHRINK, info->f_name)) X xstats.s_sizeerrs++; X errmsg( X "'%s': SEEK_HOLE file shrunk at offset %lld.\n", X info->f_name, (Llong)dpos); X (void) errabort(E_SHRINK, info->f_name, TRUE); X } X lseek(f, (off_t)0, SEEK_SET); X free(sparse); X return (0); X } X if (dpos < info->f_size && /* Not the hole at EOF ? */ X (dpos % 512) != 0) { /* Unaligned data ? */ X dpos = dpos / 512 * 512; X if (i > 0 && /* Combine with previous ? */ X (sparse[i-1].sp_offset + X sparse[i-1].sp_numbytes) >= dpos) { X i--; X dpos = sparse[i].sp_offset; X } X } X if (hpos < info->f_size && /* Not the hole at EOF ? */ X (hpos % 512) != 0) { /* Unaligned hole ? */ X hpos = (hpos + 511) / 512 * 512; X if (hpos > info->f_size) X hpos = info->f_size; X } X X sparse[i].sp_offset = dpos; X sparse[i].sp_numbytes = hpos - dpos; X X info->f_rsize += sparse[i].sp_numbytes; X X EDEBUG(("i: %d offset: %lld numbytes: %lld\n", i, X (Llong)sparse[i].sp_offset, X (Llong)sparse[i].sp_numbytes)); X X i++; X if (i >= nsparse) { X if ((sparse = grow_sp_list(sparse, X &nsparse)) == 0) { X lseek(f, (off_t)0, SEEK_SET); X return (0); X } X } X } X lseek(f, (off_t)0, SEEK_SET); X *spp = sparse; X return (i); X} X#endif X XLOCAL int Xmk_sp_list(fp, info, spp) X int *fp; X FINFO *info; X sp_t **spp; X{ X long rbuf[32*1024/sizeof (long)]; /* Force it be long aligned */ X sp_t *sparse; X int nsparse = NSPARSE_INIT; X register int amount = 0; X register int cnt = 0; X register char *rbp = (char *)rbuf; X register off_t pos = (off_t)0; X register int i = 0; X register BOOL data = FALSE; X register BOOL use_ai = FALSE; X register BOOL is_hole = FALSE; X#if defined(SEEK_HOLE) && defined(SEEK_DATA) X#else X#ifdef _FIOAI X int fai_idx; X struct fioai fai; X struct fioai *faip; X#define NFAI 1024 X daddr_t fai_arr[NFAI]; X#endif /* _FIOAI */ X#endif /* SEEK_HOLE */ X X *spp = (sp_t *)0; X info->f_rsize = 0; X sparse = (sp_t *)malloc(nsparse*sizeof (sp_t)); X if (sparse == 0) { X errmsg("Cannot alloc sparse buf.\n"); X return (i); X } X X#if defined(SEEK_HOLE) && defined(SEEK_DATA) X /* X * Error codes: EINVAL -> OS does not support SEEK_HOLE X * ENOTSUP -> Current filesystem does not support SEEK_HOLE. X */ X if (force_hole) X pos = (off_t)-1; X else X pos = lseek(*fp, (off_t)0, SEEK_HOLE); X if (pos != (off_t)-1) { /* Use if operational */ X *spp = sparse; X return (smk_sp_list(*fp, info, spp, pos)); X } X pos = (off_t)0; X#else X#ifdef _FIOAI X fai.fai_off = 0; X fai.fai_size = 512; X fai.fai_num = 1; X fai.fai_daddr = fai_arr; X use_ai = ioctl(*fp, _FIOAI, &fai) >= 0; /* Use if operational */ X fai_idx = 0; X fai.fai_num = 0; /* start at 0 again */ X#endif /* _FIOAI */ X#endif /* SEEK_HOLE */ X X /* X * Shortcut for files which consist of a single hole and no written X * data. In that case on some file systems a file may occupy 0 blocks X * on disk, and the F_ALL_HOLE flag could be set in info->f_flags. In X * such a case, we can avoid scanning the file on dumb operating X * systems that do not support SEEK_HOLE nor something equivalent. X * X * Before, we made a decision based on F_ALL_HOLE unconditionally but X * in October 2013, it turned out that at least NetAPP stores X * files up to 64 bytes in the inode and then returns X * sp->st_blocks == 0 for a non sparse file. We now moved this decision X * past the check for a working SEEK_HOLE in hope that noone will X * implement a filesystem that hides more than DEV_BSIZE without X * supporting SEEK_HOLE. X * X * Update: There seems to be a major problem in btrfs: X * There was a report that btrfs reports sp->st_blocks == 0 for a file X * with an 8 GB hole followed by 512 bytes of 'A'. While this is most X * likely a btrfs bug, in theory a filesystem could compress the data X * past the hole and hold the compressed data inside the inode. As a X * result, we needed to disable the F_ALL_HOLE check. X */ X if (info->f_flags & F_ALL_HOLE) { X pos = info->f_size; X goto scan_done; X } X X for (;;) { X if (use_ai) { X#if defined(SEEK_HOLE) && defined(SEEK_DATA) X /* EMPTY */ X#else X#ifdef _FIOAI X if (fai_idx >= fai.fai_num) { X fai.fai_off = pos; X fai.fai_size = 512 * NFAI; X fai.fai_num = NFAI; X retry: X ioctl(*fp, _FIOAI, &fai); X if (fai.fai_num == 0) { X /* X * Check whether we crossed the end of X * the file or off_t wrapps. X */ X if (pos < lseek(*fp, (off_t)0, SEEK_END)) { X off_t di; X X di = lseek(*fp, (off_t)0, SEEK_END); X di -= pos; X fai.fai_off = pos; X fai.fai_size = (di/512) * 512; X fai.fai_num = di/512; X if (fai.fai_num != 0) X goto retry; X if (di > 0 && di < 512) { X /* X * The last entry X * cannot be checked X * via the ooctl. X */ X fai.fai_size = 512; X fai.fai_num = 1; X fai.fai_daddr[0] = !_FIOAI_HOLE; X goto fake; X } X } X break; X } X fake: X fai_idx = 0; X } X is_hole = fai.fai_daddr[fai_idx++] == _FIOAI_HOLE; X X amount = 512; X if (pos + amount < 0) X amount = info->f_size - pos; X else if (pos + amount > info->f_size) X amount = info->f_size - pos; X#else X /* EMPTY */ X#endif /* _FIOAI */ X#endif /* SEEK_HOLE */ X } else { X if (cnt <= 0) { X if ((cnt = _fileread(fp, rbuf, sizeof (rbuf))) == 0) X break; X if (cnt < 0) { X errmsg( X "Error scanning for holes in '%s'.\n", X info->f_name); X X errmsg("Current pos: %lld\n", X (Llong)lseek(*fp, (off_t)0, SEEK_CUR)); X X free(sparse); X return (0); X } X rbp = (char *)rbuf; X } X if ((amount = cmpnullbytes(rbp, cnt)) >= cnt) { X is_hole = TRUE; X cnt = 0; X } else { X amount = (amount / TBLOCK) * TBLOCK; X if ((is_hole = amount != 0) == FALSE) { X amount += TBLOCK; X if (amount > cnt) X amount = cnt; X } X rbp += amount; X cnt -= amount; X } X } X X if (is_hole) { X if (data) { X sparse[i].sp_numbytes = X pos - sparse[i].sp_offset; X info->f_rsize += sparse[i].sp_numbytes; X X EDEBUG(("i: %d offset: %lld numbytes: %lld\n", i, X (Llong)sparse[i].sp_offset, X (Llong)sparse[i].sp_numbytes)); X X data = FALSE; X i++; X if (i >= nsparse) { X if ((sparse = grow_sp_list(sparse, X &nsparse)) == 0) { X lseek(*fp, (off_t)0, SEEK_SET); X return (0); X } X } X } X } else { X if (!data) { X sparse[i].sp_offset = pos; X data = TRUE; X } X } X pos += amount; X } X Xscan_done: X EDEBUG(("data: %d\n", data)); X X if (data) { X sparse[i].sp_numbytes = pos - sparse[i].sp_offset; X info->f_rsize += sparse[i].sp_numbytes; X X EDEBUG(("i: %d offset: %lld numbytes: %lld\n", i, X (Llong)sparse[i].sp_offset, X (Llong)sparse[i].sp_numbytes)); X } else { X#ifdef NO_HOLE_AT_END X sparse[i].sp_offset = pos -1; X sparse[i].sp_numbytes = 1; X info->f_rsize += 1; X#else X sparse[i].sp_offset = pos; X sparse[i].sp_numbytes = 0; X#endif X EDEBUG(("i: %d offset: %lld numbytes: %lld\n", i, X (Llong)sparse[i].sp_offset, X (Llong)sparse[i].sp_numbytes)); X } X lseek(*fp, (off_t)0, SEEK_SET); X *spp = sparse; X return (++i); X} X XLOCAL int Xget_end_hole(fh) X register fh_t *fh; X{ X#ifdef HAVE_FTRUNCATE X int f; X off_t off; X int add = 0; X#endif X X /* X * At end of sparse array: return TRUE. X * There is no "end hole" in this case. X */ X if (fh->fh_spindex == fh->fh_nsparse) X return (TRUE); X /* X * Out of sparse array: return FALSE. X */ X if (fh->fh_spindex > fh->fh_nsparse) X return (0); X X /* X * New offset is not > fh->fh_newpos: return. X */ X if (fh->fh_sparse[fh->fh_spindex].sp_offset <= fh->fh_newpos) X return (0); X X /* X * No hole at end of file: return. X */ X if (fh->fh_sparse[fh->fh_spindex].sp_numbytes != 0) X return (0); X X#ifdef HAVE_FTRUNCATE X /* X * In order to prevent Solaris from allocating space at the end of the X * file we need to shrink the file. For this reason, we first create X * the file a bit too large. X */ X f = fdown(fh->fh_file); X off = fh->fh_sparse[fh->fh_spindex].sp_offset; X X#ifdef _PC_MIN_HOLE_SIZE X add = fpathconf(f, _PC_MIN_HOLE_SIZE); X#endif X if (add <= 0) X add = 8192; X X if ((OFF_T_MAX - off) > add) X (void) ftruncate(f, off+add); X X if (ftruncate(f, off) < 0) X return (write_end_hole(fh)); X return (TRUE); X#else X return (write_end_hole(fh)); X#endif X} X XLOCAL int Xwrite_end_hole(fh) X register fh_t *fh; X{ X int f; X off_t off; X X f = fdown(fh->fh_file); X off = fh->fh_sparse[fh->fh_spindex].sp_offset; X X seterrno(0); X if (lseek(f, off-1, SEEK_SET) == (off_t)-1) { X if (!errhidden(E_WRITE, fh->fh_name)) { X if (!errwarnonly(E_WRITE, fh->fh_name)) X xstats.s_rwerrs++; X errmsg("Error seeking '%s'.\n", fh->fh_name); X (void) errabort(E_WRITE, fh->fh_name, TRUE); X return (FALSE); X } X } else if (ffilewrite(fh->fh_file, "", 1) != 1) { X if (!errhidden(E_WRITE, fh->fh_name)) { X if (!errwarnonly(E_WRITE, fh->fh_name)) X xstats.s_rwerrs++; X errmsg("Error writing '%s'.\n", fh->fh_name); X (void) errabort(E_WRITE, fh->fh_name, TRUE); X return (FALSE); X } X } X return (TRUE); X} X XEXPORT int Xgnu_skip_extended(info) X FINFO *info; X{ X TCB *ptb; X X if (info->f_flags & F_SP_SKIPPED) X return (0); X X ptb = info->f_tcb; X if (((info->f_flags & F_SP_EXTENDED) != 0) || X ptb->gnu_in_dbuf.t_isextended) do { X info->f_flags |= F_SP_EXTENDED; X if (readblock((char *)ptb, TBLOCK) == EOF) X return (EOF); X } while (ptb->gnu_ext_dbuf.t_isextended); X X info->f_flags |= F_SP_SKIPPED; X return (0); X} X XEXPORT int Xget_sparse(f, info) X FILE *f; X FINFO *info; X{ X fh_t fh; X sp_t *sparse; X int nsparse; X int ret; X X sparse = get_sp_list(info, &nsparse); X if (sparse == 0) { X errmsgno(EX_BAD, "Skipping '%s' sorry ...\n", info->f_name); X errmsgno(EX_BAD, "WARNING: '%s' is damaged\n", info->f_name); X void_file(info); X return (FALSE); X } X fh.fh_file = f; X fh.fh_name = info->f_name; X fh.fh_size = info->f_rsize; X fh.fh_newpos = (off_t)0; X fh.fh_sparse = sparse; X fh.fh_nsparse = nsparse; X fh.fh_spindex = 0; X ret = xt_file(info, vp_get_sparse_func, &fh, 0, "writing"); X if (ret == TRUE) X ret = get_end_hole(&fh); X free(sparse); X return (ret); X} X XEXPORT int Xget_as_hole(f, info) X FILE *f; X FINFO *info; X{ X fh_t fh; X sp_t sparse; X X sparse.sp_offset = info->f_size; X sparse.sp_numbytes = 0; X X fh.fh_file = f; X fh.fh_name = info->f_name; X fh.fh_size = info->f_rsize; X fh.fh_newpos = (off_t)0; X fh.fh_sparse = &sparse; X fh.fh_nsparse = 1; X fh.fh_spindex = 0; X X return (get_end_hole(&fh)); X} X XEXPORT BOOL Xcmp_sparse(f, info) X FILE *f; X FINFO *info; X{ X fh_t fh; X sp_t *sparse; X int nsparse; X X sparse = get_sp_list(info, &nsparse); X if (sparse == 0) { X errmsgno(EX_BAD, "Skipping '%s' sorry ...\n", info->f_name); X void_file(info); X fclose(f); X return (FALSE); X } X fh.fh_file = f; X fh.fh_name = info->f_name; X fh.fh_size = info->f_rsize; X fh.fh_newpos = (off_t)0; X fh.fh_sparse = sparse; X fh.fh_nsparse = nsparse; X fh.fh_spindex = 0; X fh.fh_diffs = 0; X if (xt_file(info, vp_cmp_sparse_func, &fh, TBLOCK, "reading") < 0) X die(EX_BAD); X if (fclose(f) != 0) { X if (!errhidden(E_READ, info->f_name)) { X if (!errwarnonly(E_SHRINK, info->f_name)) X xstats.s_rwerrs++; X (void) errabort(E_READ, info->f_name, TRUE); X } X } X free(sparse); X return (fh.fh_diffs == 0); X} X XEXPORT void Xput_sparse(fp, info) X int *fp; X FINFO *info; X{ X fh_t fh; X sp_t *sparse; X int nsparse; X off_t rsize; X X nsparse = mk_sp_list(fp, info, &sparse); X if (debug) X error("numsparse: %d\n", nsparse); X if (nsparse == 0) { X info->f_rsize = info->f_size; X put_tcb(info->f_tcb, info); X vprint(info); X errmsgno(EX_BAD, "Dumping SPARSE '%s' as file\n", info->f_name); X put_file(fp, info); X return; X } X rsize = info->f_rsize; X X /* X * If -force-hole was specified and the file is not sparse, only write X * it as sparse to the archive if the amount of all-zero data is at X * least TBLOCK bytes. X */ X if (force_hole && ((info->f_flags & F_SPARSE) == 0)) { X if (info->f_size - rsize < TBLOCK) { X info->f_rsize = info->f_size; X put_tcb(info->f_tcb, info); X vprint(info); X /* X * At this point, we found a file with no zeroed X * region of at least TBLOCK size. X */ X put_file(fp, info); X free(sparse); X return; X } else if (!silent) { X error("Treating '%s' as sparse\n", info->f_name); X } X } X X EDEBUG(("rsize: %lld\n", (Llong)rsize)); X X put_sp_list(info, sparse, nsparse); X fh.fh_file = (FILE *)fp; X fh.fh_name = info->f_name; X fh.fh_size = info->f_rsize = rsize; X fh.fh_newpos = (off_t)0; X fh.fh_sparse = sparse; X fh.fh_nsparse = nsparse; X fh.fh_spindex = 0; X cr_file(info, vp_put_sparse_func, &fh, 0, "reading"); X free(sparse); X} X XLOCAL void Xput_sp_list(info, sparse, nsparse) X FINFO *info; X sp_t *sparse; X int nsparse; X{ X register int i; X register int sparse_in_hdr = props.pr_sparse_in_hdr; X register char *p; X TCB tb; X TCB *ptb = info->f_tcb; X extern long hdrtype; /* XXX */ X X EDEBUG(("1nsparse: %d rsize: %lld\n", nsparse, (Llong)info->f_rsize)); X X if (nsparse > sparse_in_hdr) { X if ((props.pr_flags & PR_GNU_SPARSE_BUG) == 0) X info->f_rsize += X (((nsparse-sparse_in_hdr)+SPARSE_EXT_HDR-1)/ X SPARSE_EXT_HDR)*TBLOCK; X } X EDEBUG(("2nsparse: %d rsize: %lld added: %d\n", nsparse, (Llong)info->f_rsize, X (((nsparse-sparse_in_hdr)+SPARSE_EXT_HDR-1)/ X SPARSE_EXT_HDR)*TBLOCK)); X EDEBUG(("addr sp: %zd\n", (size_t)&((TCB *)0)->xstar_in_dbuf.t_sp)); X EDEBUG(("addr rs: %zd\n", (size_t)&((TCB *)0)->xstar_in_dbuf.t_realsize)); X EDEBUG(("flags: 0x%lX\n", info->f_flags)); X X info->f_rxftype = info->f_xftype = XT_SPARSE; X if (info->f_flags & F_SPLIT_NAME && props.pr_nflags & PR_PREFIX_REUSED) X tcb_undo_split(ptb, info); X X info->f_xflags &= ~XF_SIZE; /* Condensed file is smaller */ X info_to_tcb(info, ptb); /* Re-Compute anything */ X X if (H_TYPE(hdrtype) == H_GNUTAR) X p = (char *)ptb->gnu_in_dbuf.t_sp; X else X p = (char *)ptb->xstar_in_dbuf.t_sp; X for (i = 0; i < sparse_in_hdr && i < nsparse; i++) { X llitos(p, (Ullong)sparse[i].sp_offset, 11); p += 12; X llitos(p, (Ullong)sparse[i].sp_numbytes, 11); p += 12; X } X if (sparse_in_hdr > 0 && nsparse > sparse_in_hdr) { X if (H_TYPE(hdrtype) == H_GNUTAR) X ptb->gnu_in_dbuf.t_isextended = 1; X else X ptb->xstar_in_dbuf.t_isextended = '1'; X } X X put_tcb(ptb, info); X vprint(info); X X nsparse -= sparse_in_hdr; X sparse += sparse_in_hdr; X ptb = &tb; X while (nsparse > 0) { X filltcb(ptb); X p = (char *)ptb; X for (i = 0; i < SPARSE_EXT_HDR && i < nsparse; i++) { X llitos(p, (Ullong)sparse[i].sp_offset, 11); p += 12; X llitos(p, (Ullong)sparse[i].sp_numbytes, 11); p += 12; X } X nsparse -= SPARSE_EXT_HDR; X sparse += SPARSE_EXT_HDR; X if (nsparse > 0) X ptb->gnu_ext_dbuf.t_isextended = '1'; X writeblock((char *)ptb); X } X} X XEXPORT BOOL Xsparse_file(fp, info) X int *fp; X FINFO *info; X{ X#if defined(SEEK_HOLE) && defined(SEEK_DATA) X off_t pos; X int f = *fp; X X /* X * If we have been compiled on an OS that supports SEEK_HOLE but run X * on an OS that does not support SEEK_HOLE, we get EINVAL. X * If the underlying filesystem does not support the SEEK_HOLE call, X * we get ENOTSUP. In all other cases, we will get either the position X * of the first real hole in the file or statb.st_size in case the file X * definitely has no holes. X */ X pos = lseek(f, (off_t)0, SEEK_HOLE); /* Check for first hole */ X if (pos == (off_t)-1) /* SEEK_HOLE not supported */ X return ((info->f_flags & F_SPARSE) != 0); X X if (pos != 0) /* Not at pos 0: seek back */ X (void) lseek(f, 0, SEEK_SET); X X X if (pos >= info->f_size) { /* Definitely not sparse */ X#ifdef _PC_MIN_HOLE_SIZE X /* X * If we are on an unfixed Solaris kernel and if the X * underlying filesystem does not support SEEK_HOLE, X * the file may be sparse, but SEEK_HOLE returns info->f_size. X * Fortunately, the fpathconf call only takes 1usec on a 550MHz X * Pentium III, so this call typically takes less than 1% of X * the total system time. X */ X if (fpathconf(f, _PC_MIN_HOLE_SIZE) < 0) X return ((info->f_flags & F_SPARSE) != 0); X#endif X return (FALSE); X } X return (TRUE); /* Definitely sparse */ X#else X return ((info->f_flags & F_SPARSE) != 0); X#endif X} END-of-star-1.6/star/hole.c echo x - star-1.6/star/lhash.c sed 's/^X//' >star-1.6/star/lhash.c << 'END-of-star-1.6/star/lhash.c' X/* @(#)lhash.c 1.22 18/07/17 Copyright 1988, 1993-2018 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)lhash.c 1.22 18/07/17 Copyright 1988, 1993-2018 J. Schilling"; X#endif X/* X * Copyright (c) 1988, 1993-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X/* X * Hash table name lookup. X * X * Implemented 1988 with help from B. Mueller-Zimmermann X * X * hash_size(nqueue) size_t nqueue; X * `nqueue' ist ein tuning parameter und gibt die Zahl der X * Hash-queues an. Pro Hashqueue werden 4 Bytes benoetigt. X * X * hash_build(fp) FILE *fp; X * X * Liest das File `fp' zeilenweise. Jede Zeile enthaelt genau X * einen Namen. Blanks werden nicht entfernt. Alle so X * gefundenen Namen werden in der Hashtabelle gespeichert. X * X * hash_lookup(str) char *str; X * X * Liefert TRUE, wenn der angegebene String in der X * Hashtabelle vorkommt. X * X * Scheitert malloc(), gibt es eine Fehlermeldung und exit(). X */ X X#include X#include X#include X#include X#include "star.h" X#include X#define GT_COMERR /* #define comerr gtcomerr */ X#define GT_ERROR /* #define error gterror */ X#include X#include "starsubs.h" X Xextern BOOL notpat; Xextern BOOL readnull; X X#define HASH_DFLT_SIZE 1024 X Xstatic struct h_elem { X struct h_elem *h_next; X char h_data[1]; /* Variable size. */ X} **h_tab, **h_xtab; X Xstatic size_t h_size; X XEXPORT size_t hash_size __PR((size_t size)); XEXPORT void hash_build __PR((FILE *fp)); XEXPORT void hash_xbuild __PR((FILE *fp)); XLOCAL void _hash_build __PR((FILE *fp, struct h_elem **htab)); XEXPORT BOOL hash_lookup __PR((char *str)); XEXPORT BOOL hash_xlookup __PR((char *str)); XLOCAL int hashval __PR((unsigned char *str, unsigned int maxsize)); X XEXPORT size_t Xhash_size(size) X size_t size; X{ X if (h_size == 0) X h_size = size; X return (h_size); X} X XEXPORT void Xhash_build(fp) X FILE *fp; X{ X if (h_tab == NULL) { X register int i; X register size_t size = hash_size(HASH_DFLT_SIZE); X X h_tab = ___malloc(size * sizeof (struct h_elem *), "list option"); X for (i = 0; i < size; i++) h_tab[i] = 0; X } X _hash_build(fp, h_tab); X} X XEXPORT void Xhash_xbuild(fp) X FILE *fp; X{ X X if (h_xtab == NULL) { X register int i; X register size_t size = hash_size(HASH_DFLT_SIZE); X X h_xtab = ___malloc(size * sizeof (struct h_elem *), "exclude option"); X for (i = 0; i < size; i++) h_xtab[i] = 0; X } X _hash_build(fp, h_xtab); X} X XLOCAL void X_hash_build(fp, htab) X FILE *fp; X register struct h_elem **htab; X{ X register struct h_elem *hp; X register int len; X register int hv; X char *buf = NULL; X size_t bufsize = 0; X register size_t size; X X size = hash_size(HASH_DFLT_SIZE); X while ((len = getdelim(&buf, &bufsize, X readnull ? '\0' : '\n', fp)) >= 0) { X if (len == 0) X continue; X if (!readnull) { X if (buf[len-1] == '\n') X buf[--len] = '\0'; X if (len == 0) X continue; X } X hp = ___malloc((size_t)len + 1 + sizeof (struct h_elem *), "list option"); X strcpy(hp->h_data, buf); X hv = hashval((unsigned char *)buf, size); X hp->h_next = htab[hv]; X htab[hv] = hp; X } X if (buf) X free(buf); X} X X/* X * Hash Include lookup X * may be modfied via "notpat". X */ XEXPORT BOOL Xhash_lookup(str) X char *str; X{ X register struct h_elem *hp; X register int hv; X X /* X * If no include list exists, all files are included. X */ X if (h_tab == NULL) X return (TRUE); X X hv = hashval((unsigned char *)str, h_size); X for (hp = h_tab[hv]; hp; hp = hp->h_next) X if (streql(str, hp->h_data)) X return (!notpat); X return (notpat); X} X X/* X * Hash eXclude lookup. X */ XEXPORT BOOL Xhash_xlookup(str) X char *str; X{ X register struct h_elem *hp; X register int hv; X X /* X * If no exclude list exists, no files are excluded. X */ X if (h_xtab == NULL) X return (FALSE); X X hv = hashval((unsigned char *)str, h_size); X for (hp = h_xtab[hv]; hp; hp = hp->h_next) X if (streql(str, hp->h_data)) X return (TRUE); X return (FALSE); X} X XLOCAL int Xhashval(str, maxsize) X register unsigned char *str; X unsigned maxsize; X{ X register int sum = 0; X register int i; X register int c; X X for (i = 0; (c = *str++) != '\0'; i++) X sum ^= (c << (i&7)); X return (sum % maxsize); X} END-of-star-1.6/star/lhash.c echo x - star-1.6/star/suntar.mk sed 's/^X//' >star-1.6/star/suntar.mk << 'END-of-star-1.6/star/suntar.mk' X#ident @(#)suntar.mk 1.18 13/11/07 X########################################################################### X#include $(MAKE_M_ARCH).def XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= bin XTARGET= suntar X#SYMLINKS= ustar tar XCPPOPTS += -D__STAR__ XCPPOPTS += -DSET_CTIME -DFIFO -DUSE_MMAP -DUSE_REMOTE -DUSE_RCMD_RSH X#CPPOPTS += -DSET_CTIME -DFIFO -DUSE_MMAP X#CPPOPTS += -DSET_CTIME -DUSE_MMAP X#CPPOPTS += -DFIFO -DUSE_MMAP XCPPOPTS += -DUSE_LARGEFILES XCPPOPTS += -DUSE_FIND XCPPOPTS += -DUSE_ACL XCPPOPTS += -DUSE_XATTR XCPPOPTS += -DUSE_FFLAGS XCPPOPTS += -DSCHILY_PRINT XCFILES= suntar.c header.c cpiohdr.c xheader.c xattr.c \ X list.c extract.c create.c append.c diff.c restore.c \ X remove.c star_unix.c acl_unix.c acltext.c fflags.c \ X buffer.c dirtime.c lhash.c \ X hole.c longnames.c \ X movearch.c table.c props.c \ X unicode.c \ X subst.c volhdr.c \ X chdir.c match.c defaults.c dumpdate.c \ X fifo.c device.c checkerr.c \ X findinfo.c pathname.c XHFILES= star.h starsubs.h dirtime.h xtab.h xutimes.h \ X movearch.h table.h props.h fifo.h diff.h \ X checkerr.h dumpdate.h bitstring.h pathname.h XLIBS= -ldeflt -lrmt -lfind -lschily $(LIB_ACL) $(LIB_ATTR) $(LIB_SOCKET) $(LIB_INTL) $(LIB_CAP) XXMK_FILE= suntarman.mk X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.cmd X########################################################################### Xcount: $(CFILES) $(HFILES) X count $r1 X END-of-star-1.6/star/suntar.mk echo x - star-1.6/star/longnames.c sed 's/^X//' >star-1.6/star/longnames.c << 'END-of-star-1.6/star/longnames.c' X/* @(#)longnames.c 1.59 18/07/21 Copyright 1993, 1995, 2001-2018 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)longnames.c 1.59 18/07/21 Copyright 1993, 1995, 2001-2018 J. Schilling"; X#endif X/* X * Handle filenames that cannot fit into a single X * string of 100 charecters X * X * Copyright (c) 1993, 1995, 2001-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#define GT_COMERR /* #define comerr gtcomerr */ X#define GT_ERROR /* #define error gterror */ X#include X#include "star.h" X#include "props.h" X#include "table.h" X#include "starsubs.h" X#include "movearch.h" X#include "checkerr.h" X Xextern BOOL no_dirslash; X XLOCAL void enametoolong __PR((char *name, int len, int maxlen)); XLOCAL char *split_posix_name __PR((char *name, int namlen, int add)); XEXPORT BOOL name_to_tcb __PR((FINFO *info, TCB *ptb)); XEXPORT void tcb_to_name __PR((TCB *ptb, FINFO *info)); XEXPORT void tcb_undo_split __PR((TCB *ptb, FINFO *info)); XEXPORT int tcb_to_longname __PR((TCB *ptb, FINFO *info)); XEXPORT void write_longnames __PR((FINFO *info)); XLOCAL void put_longname __PR((FINFO *info, X char *name, int namelen, char *tname, X Ulong xftype)); X XLOCAL void Xenametoolong(name, len, maxlen) X char *name; X int len; X int maxlen; X{ X if (!errhidden(E_NAMETOOLONG, name)) { X if (!errwarnonly(E_NAMETOOLONG, name)) X xstats.s_toolong++; X errmsgno(EX_BAD, "%s: Name too long (%d > %d chars)\n", X name, len, maxlen); X (void) errabort(E_NAMETOOLONG, name, TRUE); X } X} X X XLOCAL char * Xsplit_posix_name(name, namlen, add) X char *name; X int namlen; X int add; X{ X register char *low; /* Lower margin to start searching for '/' */ X register char *high; /* Upper margin to start searching for '/' */ X X if (namlen+add > props.pr_maxprefix+1+props.pr_maxsname) { X /* X * Name too long to be split (does not fit in pfx + '/' + name) X */ X if ((props.pr_nflags & PR_LONG_NAMES) == 0) /* No longnames */ X enametoolong(name, namlen+add, X props.pr_maxprefix+1+props.pr_maxsname); X return (NULL); X } X /* X * 'low' is set to (namelen - 100) because we cannot split more than X * 100 chars before the end of the name. X * 'high' is set to 155 because we cannot put more than 155 chars into X * the prefix. X * Then start to look backwards from the rightmost position if there is X * slash where we may split. X */ X low = &name[namlen+add - props.pr_maxsname]; X if (--low < name) X low = name; X high = &name[props.pr_maxprefix > namlen ? namlen:props.pr_maxprefix]; X X#ifdef DEBUG Xerror("low: %d:%s high: %d:'%c',%s\n", X strlen(low), low, strlen(high), *high, high); X#endif X high++; X while (--high >= low) X if (*high == '/') X break; X /* X * We cannot split if we did either find no '/' (high < low), or if X * there is no name past the '/' we found (this is when a name ends X * on a '/' and there is no way to split off a suffix with a length X * that is <= 100 chars. X * Star and gtar would be happy with a zero length suffix, but X * traditional tar implementations ignore their own logical EOF X * definition that requires two blocks full of zeroes and stop on X * a null character at dbuf.t_name[0] already. X */ X if (high < low || high[1] == '\0') { X if ((props.pr_nflags & PR_LONG_NAMES) == 0) { X if (!errhidden(E_NAMETOOLONG, name)) { X if (!errwarnonly(E_NAMETOOLONG, name)) X xstats.s_toolong++; X errmsgno(EX_BAD, X "%s: Name too long (cannot split)\n", X name); X (void) errabort(E_NAMETOOLONG, name, TRUE); X } X } X return (NULL); X } X#ifdef DEBUG Xerror("solved: add: %d prefix: %d suffix: %d\n", X add, high-name, strlen(high+1)+add); X#endif X return (high); X} X X/* X * Es ist sichergestelt, daß namelen >= 1 ist. X */ XEXPORT BOOL Xname_to_tcb(info, ptb) X FINFO *info; X TCB *ptb; X{ X char *name = info->f_name; X int namelen = info->f_namelen; X int add = 0; X char *np = NULL; X X if (namelen == 0) X raisecond("name_to_tcb: namelen", 0L); X X /* X * We need a test without 'add' because we currently never add a slash X * at the end of a directiry name when in CPIO mode. X */ X if (namelen > props.pr_maxnamelen) { X enametoolong(name, namelen, props.pr_maxnamelen); X return (FALSE); X } X if ((props.pr_flags & PR_CPIO) != 0) X return (TRUE); X X if (is_dir(info) && !no_dirslash && name[namelen-1] != '/') X add++; X X if ((namelen+add) <= props.pr_maxsname) { /* Fits in shortname */ X if (add) X strcatl(ptb->ndbuf.t_name, name, "/", (char *)NULL); X else X strcpy(ptb->ndbuf.t_name, name); X return (TRUE); X } X X if (namelen+add > props.pr_maxnamelen) { /* Now we know 'add' */ X enametoolong(name, namelen+add, props.pr_maxnamelen); X return (FALSE); X } X if (props.pr_nflags & PR_POSIX_SPLIT) X np = split_posix_name(name, namelen, add); X if (np == NULL) { X /* X * Cannot split X * (namelen+add <= props.pr_maxnamelen) has been checked before X */ X if (props.pr_nflags & PR_LONG_NAMES) { X if (props.pr_flags & PR_XHDR) X info->f_xflags |= XF_PATH; X else X info->f_flags |= F_LONGNAME; X if (add) X info->f_flags |= F_ADDSLASH; X strncpy(ptb->dbuf.t_name, name, props.pr_maxsname); X return (TRUE); X } else { X /* X * In case of PR_POSIX_SPLIT we did already print the X * error message. X */ X if ((props.pr_nflags & PR_POSIX_SPLIT) == 0) { X enametoolong(name, namelen+add, X props.pr_maxnamelen); X } X return (FALSE); X } X } X X /* X * Do actual splitting based on split name pointer 'np'. X */ X if (add) X strcatl(ptb->ndbuf.t_name, &np[1], "/", (char *)NULL); X else X strcpy(ptb->ndbuf.t_name, &np[1]); X strncpy(ptb->dbuf.t_prefix, name, np - name); X info->f_flags |= F_SPLIT_NAME; X return (TRUE); X} X X/* X * This function is only called by tcb_to_info() with X * dbuf.t_name[100], dbuf.t_linkname[100] and dbuf.t_prefix[155] set to '\0'. X * If we ever decide to call it from somewhere else check if the linkname X * kludge for 100 char linknames does not make problems. X */ XEXPORT void Xtcb_to_name(ptb, info) X TCB *ptb; X FINFO *info; X{ X /* X * Name has already been set up from somwhere else. X * We have nothing to do. X */ X if (info->f_flags & F_HAS_NAME) X return; X X if ((info->f_flags & F_LONGLINK) == 0 && /* name from 'K' head */ X (info->f_xflags & XF_LINKPATH) == 0) { /* name from 'x' head */ X X /* X * Our caller has set ptb->dbuf.t_linkname[NAMSIZ] to '\0' X * if the link name len is exactly 100 chars. X */ X strcpy(info->f_lname, ptb->ndbuf.t_linkname); X } X X /* X * Name has already been set up because it is a very long name. X */ X if (info->f_flags & F_LONGNAME) X return; X /* X * Name has already been set up from a POSIX.1-2001 extended header. X */ X if (info->f_xflags & XF_PATH) X return; X X if (props.pr_nflags & PR_POSIX_SPLIT) { X strcatl(info->f_name, ptb->ndbuf.t_prefix, X *ptb->ndbuf.t_prefix?"/":"", X ptb->ndbuf.t_name, (char *)NULL); X } else { X strcpy(info->f_name, ptb->ndbuf.t_name); X } X} X XEXPORT void Xtcb_undo_split(ptb, info) X TCB *ptb; X FINFO *info; X{ X fillbytes(ptb->dbuf.t_name, NAMSIZ, '\0'); X fillbytes(ptb->dbuf.t_prefix, props.pr_maxprefix, '\0'); X X info->f_flags &= ~F_SPLIT_NAME; X X if (props.pr_flags & PR_XHDR) X info->f_xflags |= XF_PATH; X else X info->f_flags |= F_LONGNAME; X X strncpy(ptb->dbuf.t_name, info->f_name, props.pr_maxsname); X} X X/* X * A bad idea to do this here! X * We have to set up a more generalized pool of namebuffers wich are allocated X * on an actual MAX_PATH base or even better allocated on demand. X * X * XXX If we change the code to allocate the data, we need to make sure that X * XXX the allocated data holds one byte more than needed as movearch.c X * XXX adds a second null byte to the buffer to enforce null-termination. X */ X#ifdef __needed__ Xchar longlinkname[PATH_MAX+1]; X#endif X XEXPORT int Xtcb_to_longname(ptb, info) X register TCB *ptb; X register FINFO *info; X{ X move_t move; X Ullong ull; X X /* X * File size is strlen of name + 1 X */ X stolli(ptb->dbuf.t_size, &ull); X info->f_size = ull; X info->f_rsize = info->f_size; X if (info->f_size > props.pr_maxnamelen) { X /* X * We do not know the name here, X * we only have the short ptb->dbuf.t_name X */ X#ifdef __can_we__ X if (!errhidden(E_NAMETOOLONG, name)) { X if (!errwarnonly(E_NAMETOOLONG, name)) X#endif X xstats.s_toolong++; X errmsgno(EX_BAD, X "Long name too long (%lld) ignored.\n", X (Llong)info->f_size); X#ifdef __can_we__ X (void) errabort(E_NAMETOOLONG, name, TRUE); X } X#endif X void_file(info); X return (get_tcb(ptb)); X } X if (ptb->dbuf.t_linkflag == LF_LONGNAME) { X if ((info->f_xflags & XF_PATH) != 0) { X /* X * Ignore old star/gnutar extended headers for very X * long filenames if we already found a POSIX.1-2001 X * compliant long PATH name. X */ X void_file(info); X return (get_tcb(ptb)); X } X info->f_namelen = info->f_size -1; X info->f_flags |= F_LONGNAME; X if (grow_pspace(PS_STDERR, &info->f_pname, info->f_size) < 0) X die(EX_BAD); X move.m_data = info->f_name = info->f_pname.ps_path; X } else { X if ((info->f_xflags & XF_LINKPATH) != 0) { X /* X * Ignore old star/gnutar extended headers for very X * long linknames if we already found a POSIX.1-2001 X * compliant long LINKPATH name. X */ X void_file(info); X return (get_tcb(ptb)); X } X info->f_lnamelen = info->f_size -1; X info->f_flags |= F_LONGLINK; X if (grow_pspace(PS_STDERR, &info->f_plname, info->f_size) < 0) X die(EX_BAD); X move.m_data = info->f_lname = info->f_plname.ps_path; X } X move.m_flags = 0; X if (xt_file(info, vp_move_from_arch, &move, 0, "moving long name") < 0) X die(EX_BAD); X X return (get_tcb(ptb)); X} X XEXPORT void Xwrite_longnames(info) X register FINFO *info; X{ X /* X * XXX Should test for F_LONGNAME & F_FLONGLINK X */ X if ((info->f_flags & F_LONGNAME) || X (info->f_namelen > props.pr_maxsname)) { X put_longname(info, info->f_name, info->f_namelen+1, X "././@LongName", XT_LONGNAME); X } X if ((info->f_flags & F_LONGLINK) || X (info->f_lnamelen > props.pr_maxslname)) { X put_longname(info, info->f_lname, info->f_lnamelen+1, X "././@LongLink", XT_LONGLINK); X } X} X XLOCAL void Xput_longname(info, name, namelen, tname, xftype) X FINFO *info; X char *name; X int namelen; X char *tname; X Ulong xftype; X{ X FINFO finfo; X TCB tb; X TCB *ptb; X move_t move; X X fillbytes((char *)&finfo, sizeof (finfo), '\0'); X X if ((ptb = (TCB *)get_block(TBLOCK)) == NULL) X ptb = &tb; X else X finfo.f_flags |= F_TCB_BUF; X filltcb(ptb); X X strcpy(ptb->dbuf.t_name, tname); X X move.m_flags = 0; X if ((info->f_flags & F_ADDSLASH) != 0 && xftype == XT_LONGNAME) { X /* X * A slash is only added to the filename and not to the X * linkname. X */ X move.m_flags |= MF_ADDSLASH; X namelen++; X } X finfo.f_mode = TUREAD|TUWRITE; X finfo.f_rsize = finfo.f_size = namelen; X finfo.f_xftype = xftype; X info_to_tcb(&finfo, ptb); X write_tcb(ptb, &finfo); X X move.m_data = name; X move.m_size = finfo.f_size; X cr_file(&finfo, vp_move_to_arch, &move, 0, "moving long name"); X} END-of-star-1.6/star/longnames.c echo x - star-1.6/star/match.c sed 's/^X//' >star-1.6/star/match.c << 'END-of-star-1.6/star/match.c' X/* @(#)match.c 1.15 18/06/16 Copyright 1985, 88-90, 92-96, 98, 99, 2000-2018 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)match.c 1.15 18/06/16 Copyright 1985, 88-90, 92-96, 98, 99, 2000-2018 J. Schilling"; X#endif X/* X * Pattern matching routines for star X * X * Copyright (c) 1985, 88-90, 92-96, 98, 99, 2000-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#define GT_COMERR /* #define comerr gtcomerr */ X#define GT_ERROR /* #define error gterror */ X#include X#include X#include "starsubs.h" X XEXPORT const char *filename __PR((const char *name)); XLOCAL BOOL nameprefix __PR((int i, const char *name)); XLOCAL BOOL patprefix __PR((int i, const char *name, int namelen)); XLOCAL int namefound __PR((const char *name)); XEXPORT BOOL match __PR((const char *name)); XEXPORT int addpattern __PR((const char *pattern)); XEXPORT int addarg __PR((const char *pattern)); XEXPORT void closepattern __PR((void)); XEXPORT void prpatstats __PR((void)); XLOCAL void printpattern __PR((void)); XLOCAL BOOL issimple __PR((const char *pattern)); X Xextern BOOL debug; /* -debug has been specified */ Xextern BOOL cflag; /* -c has been specified */ Xextern BOOL xflag; /* -x has been specified */ Xextern BOOL diff_flag; /* -diff has been specified */ Xextern BOOL nodesc; /* -D do not descenc dirs */ Xextern BOOL notpat; /* -not invert pattern matcher */ Xextern BOOL notarg; /* PAX -c invert match */ Xextern BOOL paxmatch; /* Do PAX like matching */ Xextern BOOL paxnflag; /* PAX -n one match only */ X Xextern const char *wdir; /* current working dir name */ Xextern const char *dir_flags; /* -C dir from getallargs() */ Xextern const char *currdir; /* current -C dir argument */ X X#define NPAT 100 /* Max. number of patterns */ X XEXPORT BOOL havepat = FALSE; /* Pattern matching in use */ XLOCAL int npat = 0; /* Number of pat= patterns */ XLOCAL int narg = 0; /* Number of file arg patterns */ XLOCAL int maxplen = 0; /* Max pat len for state array */ XLOCAL int *aux[NPAT+1]; /* Aux array for pat matcher */ XLOCAL int alt[NPAT+1]; /* Alt values for pat matcher */ XLOCAL int *state; /* State array for matching */ XLOCAL const Uchar *pat[NPAT+1]; /* The plain text patterns */ XLOCAL const char *dirs[NPAT+1]; /* The coresponding directories */ XLOCAL char didm[NPAT+1]; /* If a match did happen */ X XEXPORT const char * Xfilename(name) X const char *name; X{ X char *p; X X if ((p = strrchr(name, '/')) == NULL) X return (name); X return (++p); X} X XLOCAL BOOL Xnameprefix(i, name) X int i; X register const char *name; X{ X register const char *patp; X X patp = (const char *)pat[i]; X while (*patp) { X if (*patp++ != *name++) X return (FALSE); X } X if (*name) { X if (nodesc) X return (FALSE); X if (*name != '/') /* Directory tree match */ X return (FALSE); X } X if (paxnflag && didm[i]) /* Only one exact match */ X return (FALSE); X didm[i] = TRUE; X return (TRUE); /* Names are equal */ X} X X/* X * XXX POSIX PAX requires that '/' characters need to be specified explicitly X * XXX as in shell pattern matching. We do not yet support this. X */ XLOCAL BOOL Xpatprefix(i, name, namelen) X register int i; X register const char *name; X register int namelen; X{ X char *ret; X X ret = (char *)patmatch(pat[i], aux[i], X (const Uchar *)name, 0, X namelen, alt[i], state); X if (ret != NULL) { X if (*ret == '\0' || *ret == '/') { X if (*ret == '\0') { X if (paxnflag && didm[i]) X return (FALSE); X didm[i] = TRUE; X } else { X if (nodesc) X return (FALSE); X } X return (TRUE); X } X } X return (FALSE); X} X X/* X * Match 'dirname' against 'dirname' and 'dirname/any' X * Match 'dirname/' against 'dirname' only. X * X * Return index in pattern list for a match. The index is used X * for indexing in the matching directory array later. X */ XLOCAL int Xnamefound(name) X const char *name; X{ X register int i; X register int namelen = -1; X X for (i = npat; i < narg; i++) { X if (aux[i] != NULL) { X if (namelen < 0) X namelen = strlen(name); X if (patprefix(i, name, namelen)) { X if (notarg) X return (-1); X return (i); X } X } else if (nameprefix(i, name)) { X if (notarg) X return (-1); X return (i); X } X } X if (notarg) X return (narg); X return (-1); X} X XEXPORT BOOL Xmatch(name) X const char *name; X{ X register int i; X register int namelen; X char *ret = NULL; X X if (!cflag && narg > 0) { X if ((i = namefound(name)) < 0) X return (FALSE); X if (npat == 0) X goto found; X } X X namelen = strlen(name); X X for (i = 0; i < npat; i++) { X if (paxnflag && didm[i]) X continue; X ret = (char *)patmatch(pat[i], aux[i], X (const Uchar *)name, 0, X namelen, alt[i], state); X if (ret != NULL && *ret == '\0') { X didm[i] = TRUE; X break; X } X } X if (notpat ^ (ret != NULL && *ret == '\0')) { Xfound: X if (!(xflag || diff_flag)) /* Chdir only on -x or -diff */ X return (TRUE); X if (dirs[i] != NULL && currdir != dirs[i]) { X currdir = dirs[i]; X dochdir(wdir, TRUE); X dochdir(currdir, TRUE); X } X return (TRUE); X } X return (FALSE); X} X XEXPORT int Xaddpattern(pattern) X const char *pattern; X{ X int plen; X X#ifdef ADDP_DEBUG X if (debug) X error("Add pattern: '%s' currdir: '%s'.\n", X pattern, currdir == NULL ? dir_flags:currdir); X#endif X X if (npat >= NPAT) X comerrno(EX_BAD, "Too many patterns (max is %d).\n", NPAT); X plen = strlen(pattern); X pat[npat] = (const Uchar *)pattern; X X if (plen > maxplen) X maxplen = plen; X X aux[npat] = ___malloc(plen*sizeof (int), "compiled pattern"); X if ((alt[npat] = patcompile((const Uchar *)pattern, X plen, aux[npat])) == 0) X comerrno(EX_BAD, "Bad pattern: '%s'.\n", pattern); X X if (currdir == NULL) X dirs[npat] = dir_flags; X else X dirs[npat] = currdir; X npat++; X return (TRUE); X} X XEXPORT int Xaddarg(pattern) X const char *pattern; X{ X int plen; X X /* X * Patterns from 'file type args' start after pat= patterns in the X * pat[] array. X */ X if (narg == 0) X narg = npat; X X#ifdef ADDARG_DEBUG X if (debug) X error("Add arg '%s'.\n", pattern); X#endif X X if (narg >= NPAT) X comerrno(EX_BAD, "Too many patterns (max is %d).\n", NPAT); X X plen = strlen(pattern); X pat[narg] = (const Uchar *)pattern; X X if (!paxmatch || issimple(pattern)) { X aux[narg] = NULL; X alt[narg] = 0; X } else { X if (plen > maxplen) X maxplen = plen; X aux[npat] = ___malloc(plen*sizeof (int), "compiled pattern"); X if ((alt[npat] = patcompile((const Uchar *)pattern, X plen, aux[npat])) == 0) { X comerrno(EX_BAD, "Bad pattern: '%s'.\n", pattern); X } X } X dirs[narg] = currdir; X narg++; X return (TRUE); X} X X/* X * Close pattern list: insert useful default directories. X */ XEXPORT void Xclosepattern() X{ X register int i; X X if (debug) { /* temporary */ X error("closepattern(), maxplen %d\n", maxplen); X printpattern(); X } X X for (i = 0; i < npat; i++) { X if (dirs[i] != NULL) X break; X } X while (--i >= 0) X dirs[i] = wdir; X X if (debug) /* temporary */ X printpattern(); X X if (npat > 0 || narg > 0) X havepat = TRUE; X X if (maxplen > 0) { X state = ___malloc((maxplen+1)*sizeof (int), "pattern state"); X } X} X XEXPORT void Xprpatstats() X{ X register int i; X X for (i = 0; i < narg; i++) { X if (didm[i]) X continue; X errmsgno(EX_BAD, "'%s' did not match\n", pat[i]); X } X} X XLOCAL void Xprintpattern() X{ X register int i; X X error("npat: %d narg: %d\n", npat, narg); X for (i = 0; i < npat; i++) { X error("pat %s dir %s\n", pat[i], dirs[i]); X } X for (i = npat; i < narg; i++) { X error("arg %s dir %s\n", pat[i], dirs[i]); X } X} X X/* X * Check if the pattern contains special characters of the pattern matcher. X * Do not look for characters that may be used only inside of a character set. X */ XLOCAL BOOL Xissimple(pattern) X register const char *pattern; X{ X while (*pattern != '\0') { X switch (*pattern++) { X X casePAT X return (FALSE); X } X } X return (TRUE); X} END-of-star-1.6/star/match.c echo x - star-1.6/star/movearch.c sed 's/^X//' >star-1.6/star/movearch.c << 'END-of-star-1.6/star/movearch.c' X/* @(#)movearch.c 1.35 09/10/16 Copyright 1993, 1995, 2001-2009 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)movearch.c 1.35 09/10/16 Copyright 1993, 1995, 2001-2009 J. Schilling"; X#endif X/* X * Handle non-file type data that needs to be moved from/to the archive. X * X * Copyright (c) 1993, 1995, 2001-2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include "star.h" X#include "props.h" X#include "table.h" X#include "starsubs.h" X#include "movearch.h" X XEXPORT int move_from_arch __PR((move_t *move, char *p, int amount)); XEXPORT int move_to_arch __PR((move_t *move, char *p, int amount)); X X X/* X * Move data from archive. X */ XEXPORT int Xmove_from_arch(move, p, amount) X move_t *move; X char *p; X int amount; X{ X movebytes(p, move->m_data, amount); X move->m_data += amount; X /* X * If we make sure that the buffer holds at least one character more X * than needed, then we may safely add another null byte at the end of X * the extracted buffer. X * This makes sure, that a buggy tar implementation which wight archive X * non null-terminated long filenames with 'L' or 'K' filetype may X * not cause us to core dump. X * It is needed when extracting extended attribute buffers from X * POSIX.1-2001 archives as POSIX.1-2001 makes the buffer '\n' but not X * null-terminated. X */ X move->m_data[0] = '\0'; X return (amount); X} X X/* X * Move data to archive. X */ XEXPORT int Xmove_to_arch(move, p, amount) X move_t *move; X char *p; X int amount; X{ X if (amount > move->m_size) X amount = move->m_size; X movebytes(move->m_data, p, amount); X move->m_data += amount; X move->m_size -= amount; X if (move->m_flags & MF_ADDSLASH) { X if (move->m_size == 1) { X p[amount-1] = '/'; X } else if (move->m_size == 0) { X if (amount > 1) X p[amount-2] = '/'; X p[amount-1] = '\0'; X } X } X return (amount); X} END-of-star-1.6/star/movearch.c echo x - star-1.6/star/movearch.h sed 's/^X//' >star-1.6/star/movearch.h << 'END-of-star-1.6/star/movearch.h' X/* @(#)movearch.h 1.2 03/06/12 Copyright 1993, 1995, 2001-2003 J. Schilling */ X/* X * Handle non-file type data that needs to be moved from/to the archive. X * X * Copyright (c) 1993, 1995, 2001-2003 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X Xtypedef struct { X char *m_data; /* Pointer to data to be moved ftom/to arch */ X int m_size; /* Size of data to be moved from/to arch */ X int m_flags; /* Flags holding different move options */ X} move_t; X X#define MF_ADDSLASH 0x01 /* Add a slash to the data on archive */ X X Xextern int move_from_arch __PR((move_t *move, char *p, int amount)); Xextern int move_to_arch __PR((move_t *move, char *p, int amount)); X X#define vp_move_from_arch ((int(*)__PR((void *, char *, int)))move_from_arch) X#define vp_move_to_arch ((int(*)__PR((void *, char *, int)))move_to_arch) END-of-star-1.6/star/movearch.h echo x - star-1.6/star/star.1 sed 's/^X//' >star-1.6/star/star.1 << 'END-of-star-1.6/star/star.1' X. \" @(#)star.1 1.218 19/03/27 Copyr 1982-2019 J. Schilling X. \" Manual Seite fuer star X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.75n'U X.if t .ds s \(*b X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds A Ae X.if n .ds O Oe X.if n .ds U Ue X.if n .ds s sz X.ds S SS X.TH STAR 1 "2019/03/27" "J\*org Schilling" "Schily\'s USER COMMANDS" X.SH NAME Xstar \- unique standard tape archiver X.SH SYNOPSIS X.ie n .B "star\ " X.el .B "star\ \ " X.I command X[\fIoptions\fP] X[\fB\-find\fP] X.I file1 .\|.\|. filen X[\fIfind_expr\fP] X.br X.B ustar X.I command X[\fIoptions\fP] X[\fB\-find\fP] X.I file1 .\|.\|. filen X[\fIfind_expr\fP] X.br X.ie n .B "tar\ \ " X.el .B "tar\ \ \ " X.I command X[\fIoptions\fP] X.ie n .B "\ \ \ \ \ \ \ " X.el .B "\ \ \ \ \ \ \ \ \ " X.I file1 .\|.\|. filen X.br X.B "star\ " X.ie n .B "\-copy\ \ " X.el .B "\-copy\ \ \ \ " X[\fIoptions\fP] X[\fB\-find\fP] X.I file1 .\|.\|. X.ie n [\fIf_expr\fP] X.el \fIfilen\fP [\fIfind_expr\fP] Xdirectory X.br X.B "star\ " X.ie n .B "\-copy\ \ " X.el .B "\-copy\ \ \ \ " X[\fIoptions\fP] X.B -C X.I "from_directory . to_directory X.br X.B "star\ " X.ie n .B "cli=\fIname\ \ " X.el .B "cli=\fIname\ \ \ \ " X.I ... X.SH DESCRIPTION X.B Star Xis a very fast X.BR tar (1) Xlike tape archiver with improved functionality. XIt supports unlimited path name lengths (up to 8 GB) in all cases that use Xsuitable archive types. X.PP X.B Star Xarchives and extracts multiple files to and from a single file Xcalled a X.I tarfile. XA X.I tarfile Xis usually a magnetic tape, but it can be any file. XIn all cases, appearance of a directory name refers to the files and X(recursively) subdirectories of that directory. X.PP X.B "Star's Xactions are controlled by the mandatory command flags from the Xlist below. XThe way X.B star Xacts may be modified by additional options. X.PP XNote that unpacking tar archives may be a security risk because X.B star Xmay overwrite existing files. XSee X.B SECURITY NOTES Xfor more information. X.PP XIf the first argument is in the form X.BI cli= name\fR, Xthe X.B command line interface Xis selected to match X.IR name . XSee section X.B CLI\ SELECTION Xbelow. X.SH FEATURES X.B Star Xincludes the first free implementation of X.B POSIX.1\-2001 Xextended X.B tar Xheaders. The X.B POSIX.1\-2001 Xextended X.B tar Xheaders define a new standard way Xfor going beyond the limitations of the historic X.B tar Xformat. XThey allow (among others) to archive all UNIX time stamps in sub\-second Xresolution, files of arbitrary size and filenames without length limitation Xusing X.B UNICODE UTF\-8 Xcoding for best exchange compatibility. X.PP X.B Star Xby default uses a fifo to optimize data flow from/to tape. This results in Xa normally streaming tape during the whole backup. XSee X.B \-fifo Xand X.B fs= Xoption to get information on how to find the best fifo size. X.PP X.B Star Xincludes a pattern matcher to control the list of files to be Xprocessed. This gives a convenient interface for archiving and Xrestoring complex lists of files. In conjunction with the X.B \-w Xflag it is easy to merge a X.B tar Xarchive into an existing file tree. See also X.B \-U Xoption. XIn create mode use the X.B pat= Xoption to specify either select or exclude patterns (depending on Xthe X.B \-V Xflag). In extract or list mode Xall file type arguments are interpreted as select patterns while Xthe patterns specified with the X.B pat= Xoption may be used as select or exclude patterns (depending on Xthe X.B \-V Xflag). XHave a look at the description of the X.B \-C Xoption to learn how to fetch files from a list of directories X(in create mode) or to distribute files to a list of directories X(in extract mode). XA substitute option allows X.BR ed (1) Xlike pattern substitution in file names. X.PP X.B Star Xincludes support for incremental X.B backup Xand X.B restore Xsimilar to the X.B BSD Xcommands X.BR dump (1) Xand X.BR restore (1) Xthat are known as X.BR ufsdump (1) Xand X.BR ufsrestore (1) Xon Solaris. X.PP X.B Star Xincludes an enhanced function that is similar to the X.BR find (1) Xcommand (see X.BR sfind (1)). XThis function is implemented in X.BR libfind . XIt allows to use X.B find Xexpressions, even in extract or list mode, directly on the Xcontent on an archive. XThe extensions to X.BR find (1) Xallow to modify the file metadata. X.PP X.B Star Xincludes a sophisticated X.B diff Xcommand that is able to compare file content and meta data. XSeveral diff options Xallow user tailorable functionality. X.B Star Xwon't show you differences you are not interested in. XCheck the X.B diffopts= Xoption for more details. X.PP X.B Star Xhas no limitation on filename length. Pathnames and linknames up to X.I PATH_MAX X(typically 1024\ bytes) may be archived by most tar implementrations. XStar allows to archive path names up to X.B 8 GB Xon modern platforms. X.PP X.B Star Xdeals with all 3 times, available for files on UNIX systems if the Xarchive format is either chosen from the star specific formats or Xis a format that uses POSIX.1\-2001 extended headers. XThis is either done in second resolution by using a star specific XPOSIX.1\-1988 compatible extension or in sub second resolution by Xusing POSIX.1\-2001 extended headers. X.B Star Xis able to store and restore all 3 times (mtime, atime and even Xctime). On Solaris 2.x systems - if run as root -, X.B star Xis able to do backups without changing any of the 3 the times. X.PP XIf used with the X.BI H= ustar Xoption, or if called as X.B ustar Xor X.B tar Xwhile the X.BR H= headertype Xoption is not used, X.B star Xis 100% POSIX compliant. X.PP X.B "Star's Xdefault format (if called as X.BR star ) Xis X.I xstar Xand is as posix compliant as possible. Enhancements to the standard that Xprevent correct extraction of single files when using a different X.B tar Ximplementation that is only POSIX.1\-1988 compliant may occur, Xbut they only affect single files with a pathname that is longer than 100+130 chars Xor when archiving sparse files with the X.B \-sparse Xoption in effect. XAll other files will extract correctly. XSee the description for the X.BI H= headertype Xoption below for more information on archive formats and possible archive Xinterchange problems. X.PP X.B Star Xmakes it easy to repair corrupted filesystems. After a fsck \-y Xhas been run on the filesystem, X.B star Xis able to restore only Xthe missing files automatically. XUse then X.I "star \-diff Xto check for differences (see EXAMPLES for more information). X.PP X.B Star Xautomatically recognizes the type of the archive. X.B Star Xtherefore is able to handle features and properties of different Xarchive types in their native mode, Xif it knows about the peculiarities of the archive type. XSee the X.BR H= headertype Xoption for more details. XTo be able to do this, X.B star Xadds hidden fingerprints to the archive header that allows to recognise Xall star specific archive formats. The GNU tar format is recognised by Xthe way it deviates from the standard. X.PP X.B Star Xautomatically recognizes and handles byte swapped archives. There is no Xoption to manually control byte swapping. X.PP X.B Star Xautomatically recognizes and handles compressed archives inside plain Xfiles. X.PP X.B Star Xis able to archive and restore X.B "Access Control Lists Xfor files using POSIX.1\-2001 extended headers. X.SH CLI SELECTION X.PP XIf the first argument is in the form X.BI cli= name\fR, Xthe X.B command line interface Xis selected to match one of the supported X.B CLI Xvariants. XThe following interfaces are supported: X.br X.ne 4 X.TP 15 X.B star XThe X.B star Xinterface selects the command line interface described in this manual page. X.br X.ne 4 X.TP X.B suntar XThe X.B suntar Xinterface selects the command line interface of the classical UNIX X.B tar Xcommand as described in X.BR suntar (1). X.br X.ne 4 X.TP X.B gnutar XThe X.B gnutar Xinterface selects the command line interface of the X.B GNU tar Xcommand as described in X.BR gnutar (1). X.br X.ne 4 X.TP X.B pax XThe X.B pax Xinterface selects the command line interface of the X.B POSIX pax Xcommand as described in X.BR spax (1). X.br X.ne 4 X.TP X.B cpio XThe X.B cpio Xinterface selects the command line interface of the classical UNIX X.B cpio Xcommand as described in X.BR scpio (1). X.SH COMMAND X.PP XIn native mode, X.B star Xis compatible to the command line syntax of a typical POSIX command Xand for this reason expects X.I commands Xand X.I options Xto start with a single dash (\-). In this case, commands Xand options may be specified separately, all boolean or increment type Xoptions may be specified either separately or combined. X.LP XFor compatibility with GNU programs, long options may alternatively Xstart with a double dash. X.LP XIn compatibility mode to POSIX X.BR tar , X.B star Xexpects commands and options to appear as one single string that does not start Xwith a dash. XIn POSIX tar compatibility mode, X.B additional non POSIX options Xmay be specified but must appear X.B after Xthe XPOSIX options and their args and need to start with a dash. X.TP X.B \-c XCreate a new X.I tarfile Xand write named files into it. XWriting starts at the beginning of X.I tarfile. XSee \-v option for information on how to increase verbosity while the Xarchive is written. X.sp XThe Option X.B \-c Xmay be used together with X.B \-diff Xand X.BR \-t . XIn this case, the whole command line has to be similar to the Xcommand line for the X.B \-copy Xmode. X.TP X.B \-copy XCopy named files to the target directory which is the last file type argument. XThe target directory must exist. XThe shorthand X.B \-cx Xinstead of X.B \-copy Xis not allowed because this could be a result of a typo. X.sp XIf the option X.B \-diff Xhas been specified in addition, X.B star Xperforms a one pass directory tree compare instead of copying files. XThe shorthand X.B \-c \-diff Xinstead of X.B \-copy \-diff Xis also allowed. X.sp XOn operating systems with slow file I/O (such as Linux with any filesystem or Xplatforms with Copy on Write filesystems like ZFS), it may help Xto use X.B \-no\-fsync Xin addition (see also X.B ENVIRONMENT Xand X.BR FILES ), Xbut then X.B star Xis unable to detect all error conditions; so use with care. X.sp XIf the option X.B \-t Xhas been specified in addition, the last file type argument is not a Xtarget directory and X.B star Xis performing a one pass listing instead of copying files. XThis makes sense as the listing from X.B star Xmay be better readable than the output from X.BR "ls \-lR" . XThe shorthand X.B \-c \-t Xor X.B \-ct Xinstead of X.B \-copy \-t Xis also allowed. X.sp XThe job is by default done in the best archive mode. XThis implies that it defaults to X.BR "H=exustar \-dump" . XWhen in X.B \-copy Xmode, X.B star Xforks into two processes and data exchange is done via the shared memory from the FIFO. XThis gives the best possible performance. XWithout FIFO, the X.B \-copy Xmode will not work. X.sp XThe X.B list= Xoption, patterns and substitutions apply only to the create side of the copy command. X.TP X.B \-diff XCompare the content and the attributes of the files from the archive in X.I tarfile Xto the filesystem. XThis may also be used to compare two file trees in the filesystem. XIf you use a set of X.I diffopts Xthat fits your needs, it will give X- in many cases - a more readable output than diff \-r. XIf you use X.B star's Xdump extensions for the tar archive, the X.B \-diff Xoption allows to find even if the directory in the file tree Xcontains more files than the archive. This way, it is possible to Xcompare all properties of two file trees in one run. XSee X.I diffopts Xfor more details. XAdding one or more X.B \-v Xoptions increases the verbosity. With X.B \-vv Xand above, the directory content is compared also if X.B star Xis reading a tar archive that has been created in X.B \-dump Xmode. X.TP X.B \-n XNo extraction. Show what X.B star Xwould do, in case the X.B \-x Xcommand had been specified. X.TP X.B \-r XReplace files in a X.I tarfile. XThe named files are written to the end of X.I tarfile. XThis implies that later, Xthe appropriate files will be found more than once on the X.I tarfile. X.TP X.B \-t XTable of contents. XList the contents of the X.I tarfile. XIf the \-v flag is used, the listing is similar to the format of ls \-l output. XWith this option, the flags X.BR \-a , X.B \-atime Xand X.B \-ctime Xhave a different meaning if the archive is in X.BR star , X.BR xstar , X.BR xustar , X.BR exustar , Xor X.BR pax / epax Xformat. XThe option X.B \-a Xor X.B \-atime Xlists the access time instead of the modification time, the option X.B \-ctime Xlists the file creation time instead of the modification time. XThe option X.B \-tpath Xmay be used in addition to modify the output so it may be used in shell scripts. X.TP X.B \-u XUpdate a X.I tarfile. XThe named files are written to the end of X.I tarfile Xif they are not already there or if the files are newer than the files Xof the same name found in the archive. XThe \-r and \-u command only work if the X.B tar Xarchives is a regular file or Xif the X.B tar Xarchive is an unblocked tape that may backspace. X.TP X.B \-x XExtract the named files from the X.I tarfile. XIf no filename argument or pattern is specified, the entire content of the X.I tarfile Xis restored. XIf the \-U flag is not used, X.B star Xextracts no file which is older than the corresponding file on disk. X.sp XOn operating systems with slow file I/O (such as Linux with any filesystem or Xplatforms with Copy on Write filesystems like ZFS), it may help Xto use X.B \-no\-fsync Xin addition (see also X.B ENVIRONMENT Xand X.BR FILES ), Xbut then X.B star Xis unable to detect all error conditions; so use with care. X.PP XExcept for the shorthands documented above, Xexactly one of the commands above must be specified. X.PP XIf one or more patterns or substitution commands have been specified, Xthey apply to any of the command listed above. XIn copy mode, all patterns and substitute commands apply to the create side. X X.SH OPTIONS X.TP X.B \-help XPrint a summary of the most important options for X.BR star (1). X.TP X.B \-xhelp XPrint a summary of the less important options for X.BR star (1). X.TP X.B \-/ XDon't strip leading slashes from file names when extracting an archive. XTar archives containing absolute pathnames are usually a bad idea. XWith other X.B tar Ximplementations, Xthey may possibly never be extracted without clobbering existing files. X.B Star Xfor that reason, by default strips leading slashes from filenames Xwhen in extract mode. XAs it may be impossible to create an archive where leading slashes have Xbeen stripped while retaining correct path names, X.B star Xdoes not strip leading slashes in create mode. X.sp XSee X.B SECURITY NOTES Xfor more information. X.TP X.B \-.. XDon't skip files that contain /../ in the name. Tar archives containing Xnames with /../ could be used to compromise the system. If they are Xunpacked together with a lot of other files, this would in most cases not Xeven be noticed. For this reason, X.B star Xby default does not extract files that contain /../ in the name if X.B star Xis not in interactive mode (see X.B \-w Xoption). X.sp XSee X.B SECURITY NOTES Xfor more information. X.TP X.B \-7z Xrun the input or output through a X.B p7zip Xpipe - see option X.B \-z Xbelow. X.sp XNote that the X.B p7zip Xprogram currently does not operate on a pipe but on a X/tmp file copy and thus limits the maximum archive size. X X.TP X.B \-0 X.TP X.B \-1 X.TP X.B \-2 X.TP X.B \-3 X.TP X.B \-4 X.TP X.B \-5 X.TP X.B \-6 X.TP X.B \-7 XSelect an archive entry from X.BR /etc/default/star . XThe format for the archive entries is the same as the format in X.B /etc/default/tar Xin Solaris. X.TP X.B \-acl XHandle X.B "Access Control List X(ACL) information in create and extract mode. XIf X.B \-acl Xhas been specified, X.B star Xis in create mode and the header type is X.BR exustar ", " star Xwill add ACL information to the archive using POSIX.1\-2001 extended headers. XIf X.B \-acl Xhas been specified and X.B star Xis in extract mode, X.B star Xwill try to restore ACL information. If there is no ACL information for Xone or all files in the archive, X.B star Xwill clear the ACL information for the specific file. XNote that if X.B \-acl Xhas not been specified, X.B star Xwill not handle ACL information at all and files may inherit ACL Xinformation from the parent directories. XIf the X.B \-acl Xoption has been specified, X.B star Xassumes that the X.B \-p Xoption has been specified too. X.sp XStar currently supports X.B ACLs Xfrom the X.B withdrawn POSIX.1e draft Xand X.BR "NFSv4 ACLs" . XTo check which ACL flavors are supported on the current platform, call X.BR "star \-version" . XWhether ACLs from the withdrawn POSIX.1e draft can be converted into NFSv4 ACLs Xdepends on the local ACL support library. X.TP X.BI artype= headertype XGenerate a tape archive in X.I headertype Xformat. XIf this option is used in extract/list mode this forces X.B star Xto interpret the headers to be of type X.I headertype. XAs X.B star Xeven in case of a user selected extract archive format does format checking, Xit may be that you will not be able to unpack a specific archive with all Xpossible forced archive formats. Selecting the old X.B tar Xformat for extraction will always work though. XValid parameter for X.I headertype Xare: X.RS X.TP 10 X.B help XPrint a help message about possible header types. X.TP 10 X.B v7tar XOld UNIX V7 X.B tar Xformat. XThis archive format may only store plain files. XPathnames or linknames longer than 99 chars may not be archived. X.sp XIf the X.B v7tar Xformat has been selected, X.B star Xwill not use enhancements to the historic UNIX V7 tar format. XFile size is limited to 2 GB - 2 bytes, uid/gid is limited to 262143. XSparse files will be filled up with zeroes. X.TP 10 X.B tar XOld BSD UNIX X.B tar Xformat. XThis archive format may only store plain files, directories and Xsymbolic links. XPathnames or linknames longer than 99 chars may not be archived. XSee also the X.B \-d Xoption as a note to some even older tar implementations. X.sp XIf the X.B tar Xformat has been selected, X.B star Xwill not use enhancements to the historic tar format. XFile size is limited to 2 GB - 2 bytes, uid/gid is limited to 262143. XSparse files will be filled up with zeroes. X.TP 10 X.B star XOld X.B star Xstandard format. This is an upward/downward compatible Xenhancement of the X.I old X(pre Posix) UNIX X.B tar Xformat. XIt has been introduced in 1985 and therefore is not Posix compliant. XThe X.B star Xformat allows to archive special files (even sockets) and records access time and Xcreation time besides the modification time. Newer versions of the old X.B star Xformat allow very long filenames (100+155\ chars and above), linknames > 100 chars Xand sparse files (if X.B \-sparse Xis used). XThis format is able to copy the device nodes on HP\-UX Xthat have 24 bits in the minor device number, which is more then the 21 bits Xthat are possible with the POSIX\-1003.1\-1988 archive format. X.sp XThe nonstandard extensions are located in the space between the link name and Xthe POSIX file name prefix. XAs the X.B star Xformat does not use a POSIX magic string, the extensions do not interfere Xwith the POSIX tar formats. XThe last 4 bytes of the X.B tar Xheader in the X.B star Xarchive format contain a X.B X\&'tar\e0' Xsignature. X.sp XThis archive format supports very long path names. X.TP 10 X.B gnutar XThis is a commonly used, but unfortunately not Posix compliant X(although designed after 1987) Xenhancement to the old X.B tar Xformat. XThe X.B gnutar Xformat has been defined between 1989 and 1994. XDo not use the X.B gnutar Xarchive format unless you want to create an archive for a target system Xthat is known to have only the gnutar program available. XThe X.B gnutar Xarchive format violates basic rules for any (even the historic) tar archive Xformat, in special when sparse files are archived using the X.B \-sparse Xoption. X.sp X.B GNU tar Xis not able to extract files with with long path names, but under some conditions Xcreates archives with long path names. We therefore do not limit the creation of X.B gnutar Xarchives with long path names. X.sp XUsing the X.B gnutar Xarchive format causes a high risk that the resulting archive may only be read Xby gnutar or by X.BR star . XThe implementation of the gnutar archive format within X.B star Xis not complete, but Xsufficient for most gnutar archives. XSee NOTES for more information. X.sp XThis archive format supports very long path names. X.TP 10 X.B ustar XIEEE/Posix1003/IEC\-9945\-1\-1988 Standard Data Interchange format. XWith this option in effect, X.B star Xwill generate 100% POSIX.1\-1988 compliant X.B tar Xarchives. XFiles with pathnames longer than 100+155 chars or linknames longer than X100 chars may not be archived. XIf X.B star Xis called as X.B ustar Xthe default archive format is X.BR ustar . X.sp XIf the X.B ustar Xformat has been selected, X.B star Xwill not use enhancements to the POSIX.1\-1988 tar format, the archive Xwill be strictly conforming. XFile size is limited to 8 GB, uid/gid/major/minor is limited to 2097151. XSparse files will be filled up with zeroes. X.TP 10 X.B pax XThe IEEE/Posix1003/IEC\-9945\-1\-1988 successor is Xthe POSIX\-1003.1\-2001 Standard Data Interchange format. XIt is called the X.B pax Xarchive format. X.sp XIf the X.B pax Xformat has been selected, X.B star Xwill not use enhancements to the POSIX.1\-2001 tar format, the archive Xwill be strictly conforming. XFile size is unlimited, uid/gid/uname/gidname is unlimited, Xmajor/minor is limited to 2097151. XSparse files will be filled up with zeroes. X.sp XThis archive format supports very long path names. X.TP X.B epax XA format similar to the X.B pax Xformat but with forced POSIX.1\-2001 extended headers. XThis enforces stimestamps with nanosecond resolution in the archive. X.sp XThis archive format supports very long path names. X.TP 10 X.B xstar XThe extended standard X.B tar Xformat has been introduced in 1994. X.B Star Xuses the X.B xstar Xformat as default archive format. XThis is an upward/downward compatible enhancement Xof the IEEE/Posix1003/IEC\-9945\-1 Standard Data Interchange format. XIt allows among others very long filenames (100+130\ chars and above) Xand records access time and creation time. XSparse files will be archived correctly (if X.B \-sparse Xis used). X.sp XThe access time and creation time are stored at the end of the POSIX Xfile name prefix (this limits the prefix to 130 chars). XThese extensions do not interfere with the POSIX standard as the Xfields for mtime and ctime field are always separated from the XPOSIX file name prefix by a null byte. XThe last 4 bytes of the X.B tar Xheader contain a X.B X\&'tar\e0' Xsignature. X.sp XThe X.B xstar Xformat is the default format when X.B star Xis neither called as X.B tar Xnor called as X.BR ustar . X.sp XThis archive format supports very long path names. X.TP X.B xustar XA new format introduced 1998, that omits the X.B X\&'tar\e0' Xsignature at the end of the X.B tar Xheader. It is otherwise identical Xto the X.B xstar Xformat. XAs some X.B tar Ximplementations do not follow the POSIX rules and compute Xthe checksum for less than 512 bytes of the X.B tar Xheader, this format may help Xto avoid problems with these broken X.B tar Ximplementations. XThe main other difference to the X.B xstar Xformat is that the X.B xustar Xformat uses POSIX.1\-2001 extended headers to overcome limitations of the Xhistoric X.B tar Xformat while the X.B xstar Xformat uses proprietary extensions. XThe X.B xustar Xformat is the default format when X.B star Xis called as X.BR tar . X.sp XFile size is unlimited, uid/gid/uname/gidname is unlimited, Xmajor/minor is unlimited. XSparse files will be archived correctly (if X.B \-sparse Xis used). X.sp XThis archive format supports very long path names. X.TP X.B exustar XA format similar to the X.B xustar Xformat but with forced POSIX.1\-2001 extended headers. XIf this format is used together with the X.B \-acl Xoption, X.B star Xrecords Access Control Lists (ACLs) in POSIX.1\-2001 extended headers. X.sp XThe X.B exustar Xformat allows to archive all file types but it does not Xarchive more than the POSIX.1-1988 set by default. XIf the X.B \-dump Xoption is used or if X.B star Xis otherwise on dump mode, star archives all file types Xand in addition archives more meta data then usual. X.sp XFile size is unlimited, uid/gid/uname/gidname is unlimited, Xmajor/minor is unlimited. XSparse files will be archived correctly (if X.B \-sparse Xis used). X.sp XThis archive format supports very long path names. X.TP X.B suntar XThe extended header format found on Solaris 7/8/9. This format is similar to the X.B pax Xformat but does not handle X.I atime Xand X.I ctime Xand in addition uses 'X' as the typeflag for the extended headers instead of Xthe standard 'x'. X.sp XFile size is unlimited, uid/gid/uname/gidname is unlimited, Xmajor/minor is unlimited. XSparse files will be filled up with zeroes. X.TP X.B bin XThe cpio UNIX V7 binary format. XThis is a format with big interoperability problems. Try to avoid this format. XIt is only present to make the X.B scpio Xcommand SVr4 compliant. X.TP X.B cpio XThe POSIX.1-1988 X.B cpio Xformat. This format uses octal ascii headers. A similar format is Xcreated by calling X.I "cpio \-o \-c Xon pre SYSVr4 systems and by calling X.I "cpio \-o \-Hodc Xon SYSVr4 systems. XThe POSIX.1-1988 X.B cpio Xformat allows a file name length up to 262142 characters and allows to Xarchive nearly any file type. XFile size is limited to 8 GB, uid/gid/st_dev is limited to 262143. XThe way major and minor device numbers are stored inside the st_dev Xfield is implementation dependent. X.sp XEven though this archive format is covered by the POSIX.1-1988 standard, Xit has a lower portability than the X.B ustar Xformat. Try to avoid the X.B cpio Xarchive format. X.TP X.B odc XThis archive format is similar to the The POSIX.1-1988 X.B cpio Xformat but the file name length is limited to 255 characters and Xthe socket file type is not allowed. XThis archive format has been introduced to allow non POSIX cpio implementations Xsuch as the cpio program on SYSV to accept the archive. Use this Xformat whenever you are not sure if the target system offers a fully POSIX Xcompliant cpio program. X.sp XEven though this archive format is covered by the POSIX.1-1988 standard, Xit has a lower portability than the X.B ustar Xformat. Try to avoid the X.B odc Xarchive format. X.TP X.B asc XTell X.B star Xto create a X.B cpio Xarchive in the ascii format that is created with X.I "cpio \-o \-c Xon SYSVr4 systems. XIt uses extended (32 bit) numbers for uid's, gid's and device numbers Xbut limits the file size to 4 GB - 2 bytes although the format has been Xspecified after the POSIX.1-1988 cpio format. XTry to avoid the X.B asc Xarchive format because of its limited portability. X.TP X.B crc XThis format is similar to the X.B asc Xcpio format but in addition uses a simple byte based 32-bit checksum. XHence the archive type name X.B CRC Xas used by AT&T is misleading. XTry to avoid the X.B crc Xarchive format because of its limited portability. X X.PP XAll X.B tar Xarchive formats may be interchanged if the archive contains Xno files that may not be archived by using the old X.B tar Xformat. XArchives in the X.I xstar Xformat may be extracted by any 100% POSIX compliant X.B tar Ximplementation if they contain no files with pathnames >\ 100+130\ chars Xand if they contain no sparse files that have been archived by using Xthe X.B \-sparse Xoption. X.RE X X.TP X.B \-ask_remove Xobsoleted by \-ask\-remove X.TP X.B \-ask\-remove XAsk to remove non writable files on extraction. XBy default, X.B star Xwill not overwrite files that are read only. XIf this option is in effect, X.B star Xwill ask whether it should remove these files to allow the extraction of a file Xin the following way: X.RS X.IP X.BI "remove '" filename "' ? Y(es)/N(o) : X.RE X.TP X.BR \-atime ", " \-a XReset access time of files after storing them to X.I tarfile. XOn Solaris 2.x, (if invoked by root) X.B star Xuses the X.I _FIOSATIME Xioctl to do this. This enables X.B star Xnot to trash the X.I ctime Xwhile resetting the X.I atime Xof the files. XIf the X.B \-atime Xoption is used in conjunction with the list command, X.B star Xlists access time instead of modification time. (This works only in Xconjunction with the X.BR star , X.BR xstar , X.BR xustar , X.BR exustar , Xand with the X.BR pax / epax Xformat.) XAnother option to retain the access time for the the files that Xare going to be archives is to readonly mount a X.B "UFS snapshot Xand to archive files from the mount point of the UFS snapshot. X.TP X.B \-B XForce X.B star Xto perform multiple reads (if necessary) to fill a block. XThis option exists so that X.B star Xcan work across the Ethernet, since pipes and sockets return partial blocks Xeven when more data is coming. XIf X.B star Xuses X.I stdin Xas archive file, X.B star Xbehaves as if it has been called with the X.B \-B Xoption. XFor this reason, the option \-B in practice is rarely needed. X.TP X.BI b= "#" XSet the block size for tape operations. XSee option X.BI blocks= #\c X\&. X.TP X.B \-block\-number XPrint the archive block number (archive offset / 512) at the beginning of Xeach line when in verbose mode. This allows to write backup scripts Xthat archive the offsets for files and that use X.sp X.BI " mt fsr" " blockno" X.sp Xto skip to the tape block number of interest in a fast way Xif a single file needs to be restored. X.sp XSince the numbers printed by the X.B \-block\-number Xoption are based on a block size of 512 bytes and the tape block size is Xusually larger, the tape block number for the X.B mt fsr Xcommand needs to be computed to honor the tape blocking factor. X.TP X.BI blocks= "#\fR, " b= "#" XSet the blocking factor of the X.I tarfile Xto #\ times 512\ bytes (unless a different multiplication factor has Xbeen specified - see X.B bs= Xoption for possible multiplication factors). XChanging the blocking factor only makes sense Xwhen the archive is located on a real tape device or when Xthe archive is accessed via the remote tape protocol (see X.B f= Xoption below). XThe default is to use a blocking factor of 20 i.e. X10\ kBytes. XIncreasing the blocksize will speed up the backup. XFor portability with very old X.B tar Ximplementations (pre BSD\ 4.2 or pre AT&T\ SVR4), Xblocksize should not be more than 10\ kBytes. XFor POSIX.1\-1988 compatibility, blocksize should be no more than 10\ kBytes. XFor POSIX.1\-2001 compatibility, blocksize should be no more than 32\ kBytes. XMost systems also have a hardware limitation for the blocksize, 32\ kBytes Xand 63\ kBytes are common limits on many systems. XThe upper limit in any case is the size of the buffer RAM in the tape drive. XMake a test if you want to make sure that the target system will handle Xthe intended blocksize. XIf you use X.B star Xfor data exchange via tape, it is a good idea to use a blocksize of 10\ kBytes Xunless you are sure that the reading system will handle a larger blocksize. XIf you use X.B star Xfor backup purposes with recent hardware (e.g. DLT tape drives), Xa blocksize of 256\ kBytes Xresults in sufficient speed and seems to be a good choice. X.B Star Xallows block sizes up to 2 GByte if the system does not impose a smaller limit. XIf you want to determine the blocking factor when reading an unknown X.B tar Xarchive Xon tape, specify a blocking factor that is higher than the supposed Xblocking factor of the tape. X.B Star Xthen will determine the blocking factor Xby reading the first record of the tape and print a message: X.RS X.IP X.B Xstar: Blocksize = # records. X.PP XWhere # is the blocking factor in multiples of 512 bytes. XThe X.I blocks= Xoption Xand the X.I bs= Xoption are equivalent methods to specify the tape block size. XThe X.B blocks= Xoption is preferred by people who like to use an option that behaves Xsimilar to the interface of the historic X.BR tar (1) Ximplementations. X.sp XThe best method to set the blocksize is to use the X.BI bs= # Xoption. X.RE X.TP X.BI bs= # XSet output block size to #. XYou may use the same method as in X.BR dd (1) Xand X.BR sdd (1). XThe number representing the size is taken in bytes unless otherwise specified. XIf a number is followed directly by the letter `.', `w', `b', `k', `m', `g', X`t', or `p', Xthe size is multiplied by 1, 2, 512, 1024, 1024*1024, 1024*1024*1024, X1024*1024*1024*1024 or 1024*1024*1024*1024*1024. XIf the size consists of numbers separated by `x' or `*', multiplication of the Xtwo numbers is performed. XThus X.I "bs=7x8k Xwill specify a blocksize of 56\ kBytes. XBlocksize must be a multiple of 512 bytes. XSee also the description of the X.I blocks= Xoption for more details on blocksizes. XThe option X.B bs= Xis preferred by people who like to use an option that behaves Xsimilar to the interface used by X.BR dd (1) Xand X.BR sdd (1). X.TP X.B \-bsdchdir XSwitch the behavior of the X.B C= Xoption to BSD style. XThe default behavior of X.B star Xis to stay in a working directory until a new X.B C= Xis seen. XWith BSD tar, the X.B C= Xoption is only related to the next file type argument. X.TP X.B \-bz Xrun the input or output through a X.B bzip2 Xpipe - see option X.B \-z X.B \-Z Xand X.B \-j Xbelow. XAs the X.B \-bz Xthe X.B \-j Xthe X.B \-Z Xand the X.B \-z Xoption are non standard, it makes sense to omit the X.B \-bz Xthe X.B \-j Xthe X.B \-Z Xand the X.B \-z Xoptions inside shell scripts if you are going to extract a compressed Xarchive that is located inside a plain file as X.B star Xwill auto detect compression and choose the right decompression Xoption to extract. X.TP X.BI C= dir X.TP X.BI \-C " dir XPerform a X.BR chdir (2) Xoperation to X.I dir Xbefore storing or extracting the next files. XIn all cases, X.B star Xwill perform the X.BR chdir (2) Xoperation relative to the current working directory of the shell. X.RS X.TP X.B \(bu XIn list mode (with the X.B \-t Xflag), X.B star Xignores all X.I \-C Xoptions. X.TP X.B \(bu XIn create mode (with the X.BR \-c ", " \-r " and " \-u Xflag), X.B star Xwalks through all X.I \-C Xoptions and file type arguments. XWhile a BSD derived X.BR tar (1) Ximplementation Xgoes back to the current working directory after storing Xone file argument that immediately follows the X.I \-C Xoption, X.B star Xchanges the directory only if a new X.B \-C Xoption follows. XTo emulate the behavior of a BSD derived X.BR tar (1), Xadd a X.BI \-C " ." Xoption after the file argument. X.TP X.B \(bu XIn extract mode (with the X.BR \-x ", " \-n " and " \-diff Xflag), X.B star Xbuilds a pattern list together with corresponding directories Xfrom previous X.BI C= dir Xoptions and performs a X.BR chdir (2) Xto the corresponding directory of a matching pattern. XAll X.B pat= Xoptions that do not follow a X.BI C= dir Xoption are interpreted as if they were preceded by a X.BI \-C " ." Xoption. XSee EXAMPLES for more information. X.RE X.TP X.BI compress-program= name XSet a named compress program. XThe program must compress in a pipe when called without parameters Xand decompress when run with the X.B \-d Xoption in a pipe. XThis option is otherwise similar to the X.B \-z Xthe X.B \-j Xthe X.B \-Z Xand the X.B \-bz Xoption. X.TP X.B \-copydlinks XTry to recursively copy the content of linked directories instead of Xcreating the link. This is an experimental feature that may help Xto unpack archives on DOS. X.TP X.B \-copyhardlinks XThis option allows to copy hardlinked targets Xrather than creating the link. XIt helps to extract X.B tar Xfiles on systems that do not implement Xhardlinks (e.g. BeOS). X.TP X.B \-copylinks XThis option allows to copy both, hard- and symlinked targets Xrather than creating a link. XIt helps to extract X.B tar Xfiles on systems that do not implement Xlinks (e.g. OS/2). XTo extract and copy all symlinks correctly, you may need to call X.B star Xtwice as X.B star Xcannot copy files that appear in the archive later than a symlink Xpointing to them. X.TP X.B \-copysymlinks XThis option allows to copy symlinked targets Xrather than creating a symbolic link. XIt helps to extract X.B tar Xfiles on systems that do not implement Xlinks (e.g. OS/2). XTo extract and copy all symlinks correctly, you may need to call X.B star Xtwice as X.B star Xcannot copy files that appear in the archive later than a symlink Xpointing to them. X.TP X.B \-cpio\-statistics XInstead of the X.B star Xflavor of the statistics, print statistics in X.B cpio Xflavor. X.TP X.B \-ctime XIf used with the list command, this lists X.I ctime Xrather than X.I mtime Xif the archive format is X.BR star , X.BR xstar , X.BR xustar , X.BR exustar , Xor X.BR pax / epax . X.sp XIf star is run as root and if X.B \-ctime Xis used with the extract command and the same archive formats, Xthis causes X.B star Xto try to restore even the X.I ctime Xof a file by generating time storms. XYou should not do this when in multi user mode because this may Xconfuse programs like cron and the news system. XAlthough X.B star Xtries to eliminate the accumulative effects of the time storm, Xthere is a tendency for the system clock to slow down a bit. XThe clock typically lags about one millisecond per extracted file. XUse with care and check the system clock after using this feature. X.sp XIf used with the create command this changes the behavior of the X.I newer= Xoption. X.BR Star , Xin this case compares the X.I ctime Xof all files to the X.I mtime Xof the stamp file rather then comparing the X.I mtimes Xof both files. X.TP X.B \-cumulative XA shorthand for X.BR \-dump\-cumulative . XSee X.B \-dump\-cumulative Xfor more information. X.TP X.B \-D XDo not descend directories when in create mode. XNormally, X.B star Xdescends the whole tree if it encounters a directory in Xin its file parameters. XThe option X.B \-D Xis in effect by default if the X.BI list= file Xoption is used. XIf you like X.B star Xto descend directories found in the list file, use the X.B \-dodesc Xoption (see below). X.TP X.B \-d XDo not store/create directories. XOld versions of X.B tar Xsuch as published with the seventh edition of UNIX Xare not able to deal with directories in X.B tar Xarchives. XIf a X.B tar Xarchive is generated without directories this avoids Xproblems with X.B tar Ximplementations found on SYSVr3 and earlier. XIf used during extract, no intermediate missing directories are created. X.TP X.B \-data\-change\-warn XIf the size of a file changes while the file is being archived, treat this Xcondition as a warning only that does not cause a non zero exit code. XA warning message is still written if the condition is not otherwise Xignored by another rule from an X.B errctl= Xoption. XThe X.B \-data\-change\-warn Xoption works as if the last error control option was X.sp X \fBerrctl=\fP\fI"WARN|GROW|SHRINK *"\fP X.sp XThe X.B \-e Xoption or an X.B ABORT Xentry in a condition set up by X.B errctl= Xhas a higher precedence than the X.B \-data\-change\-warn Xoption. XThis option is ignored in extract or list mode. X.TP X.B \-debug XPrint debug messages. Among other things, this gives debug messages for Xheader type recognition, X.B tar Xtype properties, EOF recognition, opening Xof remote archives and fifo internals. X.TP X.BI diffopts= optlst XComma separated list of diffopts. XValid members in X.I optlst Xare: X.RS X.TP 10 X.B help XPrint a summary of possible members of the diffopts list. X.TP 10 X.B ! XInvert the meaning of the following string. No comma is needed after the Xexclamation mark. X.TP 10 X.B not XInvert the meaning of all members in the diffopts list i.e. exclude Xall present options from an initially complete set compare list. XWhen using X.BR csh (1) Xyou might have problems to use X.B ! Xdue to its strange parser. XThis is why the X.B not Xalias exists. X.TP 10 X.B perm XCompare file permissions. With this option in effect, X.B star Xcompares the low order 12 bits of the st_mode field. X.TP 10 X.B mode XSame as X.I perm. X.TP 10 X.B symperm XCompare permissions even in case the target file on the local Xfilesystem is a symbolic link. XBy default, X.B star Xwill not compare the permission of symbolic links Xas most systems cannot set the permission Xof symbolic links. X.B Star Xcompares X.B symperm Xonly if X.B perm Xis compared also. X.TP 10 X.B type XCompare file type. XNote that X.B star Xcannot compare the file type in case of a hard link. X.TP 10 X.B nlink XCompare link count on hardlinks. XThis only works if the archive is in X.B exustar Xformat and contains X.B star's Xdump extensions. X.TP 10 X.B uid XCompare numerical user id of file. X.TP 10 X.B gid XCompare numerical group id of file. X.TP 10 X.B uname XCompare ASCII version of user id of file. XThe user name is mapped via the file /etc/passwd. X.TP 10 X.B gname XCompare ASCII version of group id of file. XThe group name is mapped via the file /etc/group. X.TP 10 X.B id XShorthand for: X.IR "uid,gid,uname,gname" . XCompare all user/group related info of file. XNote that this will always find differences if the source and Xtarget system use different user or group mappings. X.TP 10 X.B size XCompare file size. XNote that X.B star Xcannot compare the file size in case of a hard link. X.TP 10 X.B data XCompare content of file. XIf X.B star Xalready found that the size of the files differ, it will not Xcompare the content anymore. XIf the size of the files differ, X.B star Xwill always report different data. X.TP 10 X.B cont XSame as X.I data. X.TP X.B rdev XCompare major/minor numbers for device nodes. X.TP 10 X.B hardlink XCompare target of hardlinks. X.TP 10 X.B symlink XCompare target of symlinks. This evaluates the paths returned by the Xreadlink(2) call. X.sp XTwo symlinks are considered equal, it they either have a characterwise Xidentical link-name, or if they either both use an absolute path name Xor both use a relative path name and the following is true: XBoth symlinks point to the same file that must exist or both pathnames look Xsimilar enough. X.TP 10 X.B sympath XCompare the target pathnames of symlinks. This characterwise compares Xthe strings returned from the readlink(2) call. X.TP 10 X.B sparse XCompare if either both files are sparse or not. If only one of both files Xis sparse, then a difference is flagged. XThis only works with if the archive format is X.BR star , X.BR xstar , X.BR xustar , X.BR exustar , Xor X.BR gnutar . X.TP 10 X.B atime XCompare access time of file. XThis only works with if the archive format is X.BR star , X.BR xstar , X.BR xustar , X.BR exustar , Xor X.BR pax / epax . X.TP 10 X.B mtime XCompare modification time of file. X.TP 10 X.B ctime XThis only works with if the archive format is X.BR star , X.BR xstar , X.BR xustar , X.BR exustar , Xor X.BR pax / epax . X.TP 10 X.B lmtime XCompare the modification time Xeven in case the target file on the local filesystem is a Xsymbolic link. XBy default, X.B star Xwill not compare the modification time of symbolic links Xas most systems cannot set the modification time Xof symbolic links. X.B Star Xcompares X.B lmtime Xonly if X.B mtime Xis compared also. X.TP 10 X.B times XShorthand for: X.IR "atime,mtime,ctime" . X.TP X.B nsecs XCheck nanoseconds in all selected timestamps as well. X.sp XNote that the time resolution of various filesystem differs. XWhile modern filesystems like X.B ZFS Xand filesystems that introduced a sub-second resolution recently, Xtend to support a nanosecond granularity, filesystems like X.B UFS Xthat support a sub-second resolution since the early 1990s tend to Xsupport only a microsecond granularity. Since even in in 2018, Xthe POSIX.1-2008 feature X.B pathconf(_PC_TIMESTAMP_RESOLUTION) Xhas not yet been implemented on any platform, you may need to disable Xto compare nanoseconds in some cases. X.sp X.B Star Xcurrently first tries to compare the timestamps based on a nanosecond Xresolution and if that fails and one timestamp seems to have a microsecond Xresolution, the comparison is repeated with microsecond resolution only. X.TP 10 X.B dir XCompare the content of directories. XThis only works if the archive is in X.B exustar Xformat and contains X.B star's Xdump extensions. XTogether with increased verbose level X.RB ( \-vv ) Xthis will print a list of files that are only in the archive and a list of files Xthat are only on the current filesystem. X.TP 10 X.B xtimes XShorthand for: X.IR "atime,mtime,ctime,lmtime" . X.TP 10 X.B acl XCompare access control lists. XThis only works if the archive is in X.B exustar Xformat and has been created with X.B star's X.B \-acl Xoption. XYou need to specify the X.B \-acl Xoption in addition when running the diff. X.TP 10 X.B xattr XCompare extended file attributes. XThis only works if the archive is in X.B exustar Xformat and has been created with X.B star's X.B \-xattr Xoption. XYou need to specify the X.B \-xattr Xoption in addition when running the diff. X.TP 10 X.B fflags XCompare extended file flags. XThis only works if the archive is in X.B exustar Xformat and has been created with X.B star's X.B \-xfflags Xoption. XYou need to specify the X.B \-xfflags Xoption in addition when running the diff. X.PP XIf X.I optlst Xstarts with a ! the meaning of all members in X.I optlst Xis inverted as with the X.I not Xoptlist member. XIn this case, X.B star Xstarts with a complete list that includes X.B atime Xand X.BR lmtime . XReasonable diff options to use when comparing against a copy of a Xdirectory tree are X.BR diffopts=!atime,ctime,lmtime . X.PP XIf X.I diffopts Xare not specified, X.B star Xcompares everything but the access time of the files Xand the modification time of symbolic links. X.RE X.TP X.BI dir-group= group XIf X.B star Xextracts archives as root, this option allows to control the group id of Xintermediate directories created by X.BR star . X.TP X.BI dir-owner= user XIf X.B star Xextracts archives as root, this option allows to control the owner of Xintermediate directories created by X.TP X.B \-dirmode XIf in create mode (i.e. when storing files to archive), X.B star Xstores directories past the corresponding files. This guarantees that even old X.B tar Ximplementations without a directory cache will be able to restore the Xcorrect times of directories. XThe option X.B \-dirmode Xshould only be used if the archive needs to be extracted by an old X.B tar Ximplementation. If X.B star Xis used to extract an archive that has been created with X.B \-dirmode Xthe directories will not get an old time stamp unless the option X.B \-U Xis used while extracting the archive. X.TP X.B \-do\-fsync XTell X.B star Xto call X.BR fsync(2) Xfor every file when in extract mode. XThis enables X.B star Xto check whether a file could be successfully extracted. XSee X.B \-no\-fsync Xfor more information. X.TP X.B \-dodesc XForce X.B star Xto descend directories found in a X.BI list= file. XSee also the X.B \-D Xoption above. XThe X.B \-dodesc Xoption only works in create mode. X.TP X.B \-dump XAllows to create archives with the same number of attributes as an archive that Xhas been created with the X.B level= Xoption but without the restrictions that apply to a true dump. X.sp XThe resultant archive may be seen as a X.I level-less Xdump which includes similar attributes as a level 0 dump but may span more than Xa single file system and does not need to use a X.B \-C Xoption. XIt has been originally introduced to make it easier to implement a X.B star Xversion that supports X.IR "true incremental dumps" , Xbut it is kept as it gives additional benefits. X.B Star Xcurrently sets the archive type to X.B exustar Xand, in addition archives more inode meta data inside POSIX.1-2001 extended headers. XSee also X.B level= Xoption and the section X.B "INCREMENTAL BACKUPS Xfor more information on X.IR "true incremental dumps" . X.TP X.B \-dump\-cumulative Xinstructs X.B star Xto perform incremental dumps relatively to the last incremental dump of the same level. XIncremental dumps with a level higher than 0 are normally done relatively to Xthe content of a previous dump with lower level. If incremental dumps and restores Xare going to be used to synchronize filesystem content, every successive incremental Xdump will increase in size if X.B \-dump\-cumulative Xis not used. XSee section X.B "SYNCHRONIZING FILESYSTEMS Xfor more information. X X.TP X.BI dumpdate= name XTells X.B star Xto use the X.B mtime Xof the time stamp file X.I name Xinstead of using the start time of X.BR star . XThis is needed when X.B star Xis run on file system snapshots. XIf X.B star Xwould use the the it's own start time with snapshots, all files that Xhave been modified between the setup of the snapshot and the start Xof X.B star Xwould be missing on the backup. X.sp XA solution is to create the time stamp file, then to create the snapshot Xand later use the option X.BI dumpdate= name. X.TP X.B \-dumpmeta Xchanges the behavior of X.B star Xin incremental dump mode. XIf X.B \-dumpmeta Xis used and only the inode change time (st_ctime) of a file has been Xupdated since the last incremental dump, X.B star Xwill archive only the X.B meta Xdata of the file (e.g. uid, permissions, ...) but not the Xfile content. XUsing X.B \-dumpmeta Xwill result in smaller incremental dumps, but files that have been created Xbetween two incrementals and set to an old date in st_mtime (e.g. as a result Xfrom a tar extract) will not be archived with full content. XUsing X.B \-dumpmeta Xthus may result in incomplete incremental dumps, Xuse with extreme care. X.TP X.B \-e XExit immediately with exit status \-3 (253) if any unexpected error occurs. XThe X.B \-e Xoption works as if the last error control option was X.sp X \fBerrctl=\fP\fI"ABORT|ALL|DIFF *"\fP X.sp XThis allows to use the X.B errctl= Xoption together with the X.B \-e Xoption and thus to ignore some error conditions while aborting on all Xother conditions. X.TP X.PD 0 X.BI errctl= " name X.TP X.BI errctl= " error control spec X.PD XAdd the content from file X.I name Xto the error control definitions or add X.I error control spec Xto the error control definitions. XMore than one error control file and more than one X.I error control spec Xas well as a mixture of both forms is possible. X.sp XThe reason for using error control is to make X.B star Xquiet about error conditions that are known to be irrelevant on the quality Xof the archive or restore run or to tell X.B star Xto abort on certain error conditions instead of trying to continue Xwith the archive. X.sp X.ne 6 XA typical reason to use error control is to Xsuppress warnings about growing log files while doing a backup on a Xlive file system. XAnother typical reason to use error control is to tell X.B star Xto abort if e.g. a file could not be archived instead of continuing Xto archive other files from a list. X.sp XThe error control file contains a set of lines, each starting with a list Xof error conditions to be ignored followed by white space followed by a Xfile name pattern (see X.BR match (1) Xor X.BR patmatch (3) Xfor more information). XThe X.I error control spec Xuses the same syntax as a single line from the error control file. XIf the file name pattern needs to start with white space, use a backslash Xto escape the start of the file name. It is not possible to have new line Xcharacters in the file name pattern. XWhenever an error situation is encountered, X.B star Xchecks the lines in the error control file starting from the top. XIf the current error condition is listed on a line in the error control file, Xthen X.B star Xchecks whether the pattern on the rest of the line matches the current file name. XIf this is the case, X.B star Xuses the current error control specification to Xcontrol the current error condition. X.sp XThe list of error conditions to be handled may use one or more (in this case Xseparated by a '|' character) identifiers from the list below: X.RS X.TP 12 X.B ABORT XIf this meta condition is included in an error condition, X.B star Xaborts (exits) as soon as possible after this error condition has been Xseen instead of making X.B star Xquiet about the condition. XThis error condition flag may only be used together with at leat another Xerror condition or a list of error conditions X(separated by a '|' character). X.TP 12 X.B WARN XIf this meta condition is included in an error condition, X.B star Xprints the warning about the error condition but the error condition Xdoes not affect the exit code of X.B star Xand the error statistics (which is printed to the end) does not Xinclude the related errors. XThis error condition flag may only be used together with at another Xerror condition or a list of error conditions X(separated by a '|' character). XThe X.B WARN Xmeta condition has a lower precedence than X.BR ABORT . X.TP 12 X.B DIFF XSuppress output in case that X.B "star -diff Xdid encounter any differences. X.TP 12 X.B ALL XThis is a shortcut for all error conditions below. X.TP 12 X.B STAT XSuppress warnings that X.B star Xcould not X.BR stat (2) Xa file. X.TP X.B GETACL XSuppress warnings about files on which X.B star Xhad problems to retrieve the ACL information. X.TP X.B OPEN XSuppress warnings about files that could not be opened. X.TP X.B READ XSuppress warnings about read errors on files. X.TP X.B WRITE XSuppress warnings about write errors on files. X.TP X.B READLINK XSuppress warnings about X.BR readlink (2) Xerrors on symbolic links. X.TP X.B GROW XSuppress warnings about files that did grow while they have been Xarchived. X.TP X.B SHRINK XSuppress warnings about files that did shrink while they have been Xarchived. X.TP X.B MISSLINK XSuppress warnings about files for which X.B star Xwas unable to archive all hard links. X.TP X.B NAMETOOLONG XSuppress warnings about files that could not be archived because the name of Xthe file is too long for the archive format. X.TP X.B FILETOOBIG XSuppress warnings about files that could not be archived because the size of Xthe file is too big for the archive format. X.TP X.B SPECIALFILE XSuppress warnings about files that could not be archived because the file type Xis not supported by the archive format. X.TP X.B GETXATTR XSuppress warnings about files on that X.B star Xcould not retrieve the extended file attribute information. X.TP X.B CHDIR XSuppress warnings about X.BR chdir (2) Xerrors. X.TP X.B ICONV XSuppress warnings about X.BR iconv (3) Xerrors. XThese error happen, when text is converted from or to POSIX.1-2001 extended tar Xheaders. X.TP X.B ID XSuppress warnings about X.BR uid / gid Xrange errors. XThese errors happen when the archive format does not support the actual value. X.TP X.B SETTIME XSuppress warnings about files on that X.B star Xcould not set the time information during extraction. X.TP X.B SETMODE XSuppress warnings about files on that X.B star Xcould not set the access modes during extraction. X.TP X.B SECURITY XSuppress warnings about files that Xhave been skipped on extraction because they have been considered to be a Xsecurity risk. XThis currently applies to all files that have a '/../' sequence inside Xwhen X.B \-.. Xhas not been specified. X.TP X.B LSECURITY XSuppress warnings about links that Xhave been skipped on extraction because they have been considered to be a Xsecurity risk. XThis currently applies to all link target names that start with '/' or Xhave a '/../' sequence inside when X.B \-no\-secure\-links Xhas not been specified. XIn this case, X.B star Xtries to match the link name against the pattern in the error control file. X.TP X.B SAMEFILE XSuppress warnings about links that Xhave been skipped on extraction because source and target of the link Xare pointing to the same file. XIf X.B star Xwould not skip these files, it would end up with removing the file completely. XIn this case, X.B star Xtries to match the link name against the pattern in the error control file. X.TP X.B BADACL XSuppress warnings about access control list conversion problems. X.TP X.B SETACL XSuppress warnings about files on that X.B star Xcould not set the ACL information during extraction. X.TP X.B SETXATTR XSuppress warnings about files on that X.B star Xcould not set the extended file attribute information during extraction. X.RE X.sp XIf a specific error condition is ignored, then the error condition is not Xonly handled in a silent way but also excluded from the error statistics Xthat are printed at the end of the X.B star Xrun. X.sp XBe very careful when using error control as you may ignore any error condition. XIf you ignore the wrong error conditions, you may not be able to see real Xproblems anymore. X.TP X.BI \-exclude\-from " name XExclude from named file, this is an alias for the X.B \-X Xoption. See X.B \-X Xoption for more information. X.TP X.BR \-F , \-FF " ..." XFast and simple exclude option for create mode. XWith one X.B \-F Xargument, X.B star Xignores all directories called X.IR SCCS " and " RCS. XWith two X.B \-F Xarguments, X.B star Xin addition ignores all files called X.I core errs a.out Xall files ending with X.IR .o . X.IR OBJ/ . XWith three X.B \-F Xarguments, X.B star Xignores all sub trees starting from a directory that Xincludes a file X.I .mirror Xor X.I .exclude Xand all object files and files called X.I core errs a.out Xall files ending with X.IR .o . XWith four X.B \-F Xarguments, X.B star Xignores all sub trees starting from a directory that Xincludes a file X.I .mirror Xor X.I .exclude Xthe latter files are excluded too as well as Xand all object files and files called X.I core errs a.out Xall files ending with X.IR .o . XWith five X.B \-F Xarguments, X.B star Xin addition again excludes Xall directories called X.IR SCCS " and " RCS. X.TP X.BI f= "tarfilename" XUse X.I tarfilename Xas the name for the X.B tar Xarchive. XSee option X.BI file= tarfilename\c X\&. X.TP X.B \-fifo XUse a X.I fifo Xto optimize data flow from/to X.I tarfile. XThis option is in effect by default (it may be changed at compile time). XThe default fifo size is 8 MBytes on all platforms except Linux versions Xthat do not support mmap() (4 MB because kernels Xbefore 2.4 did not handle big shared memory areas) and Sun/mc68000 (1 MB). XThis will X.B star Xmake even work on a tiny machine like Xa Sun 3/50. The fifo size may be modified with the X.I fs= Xoption. A rule of dumb for the fifo size is to use more than the buffer size Xof the tape drive and less then half of the real memory of the machine. XA good choice would be to use a fifo size between 8 and 256 MB. XThis may increase backup speed up to 5% compared to the speed achieved Xwith the default fifo size. Note that with a DLT drive from y2000 that gives 12MB/s Xtransfer rate, a fifo of 256 MB size will keep the tape at least streaming Xin units of 20 seconds. X.sp XFuture LTO tape drives are expected to implement transfer rates of aprox. 3GB/s Xand need a much larger X.B fifo Xsize to keep the tape streaming. X.sp XAll options that start with the X.B \-f Xsequence are sensitive to typo problems, see BUGS section for more information. X.TP X.B \-fifostats XPrint fifo statistics at the end of a X.B star Xrun when the fifo has been in effect. XAll options that start with the X.B \-f Xsequence are sensitive to typo problems, see BUGS section for more information. X.TP X.BI file= "tarfilename\fR, " f= "tarfilename" XUse X.I tarfilename Xas the name for the X.B tar Xarchive. Currently up to 100 X.B file= Xoptions are possible. Specifying more then one X.B file= Xoption make sense in multi volume mode. In this case X.B star Xwill use the next name in the list every time a media change is needed. XTo make X.B star Xbehave consistent with the single file case, X.B star Xloops over the list of known archive files. XNote that if X.B star Xis installed suid root and the first tarfile is a remote archive, Xonly the connection to this archive will be created with root privileges. XAfter this connection has been established as root, X.B star Xswitches back to the id of the caller. XIf any of the other archives in the list is located on a different host, X.B star Xwill not be able to open this archive later on, unless run by root. X.sp X.B Star Xnormally uses X.IR stdin / stdout Xfor the X.B tar Xarchive because the most common way to use X.B star Xis in conjunction with pipes. XIf X.B star Xis installed suid root or if it has been called by root, X.I tarfilename Xmay be in remote syntax: user@host:filename as in X.BR rcp (1) Xeven if Xinvoked by non root users. XSee SUID NOTES for more information. X.sp XTo make a file local although it includes a colon (:), the filename Xmust start with: X.IR "'/'" , X.IR "'./'" " or" X.I "'../'" X.sp XNote that if X.B star Xtalks to an old X.B rmt Xremote tape server that does not support symbolic open modes, Xit does not open a remote tape with the X.B O_CREAT Xopen flag because this would be extremely dangerous. XIf the X.B rmt Xserver on the other side is the X.B rmt Xserver that comes with X.B star Xor the GNU X.B rmt Xserver, X.B star Xmay use the symbolic mode for the open flags. XOnly the symbolic open modes allow to send all possible open Xmodes in a portable way to remote tape servers. X.sp XIt is recommended to use the X.B rmt Xserver that comes with X.BR star . XIt is the only X.B rmt Xserver that gives platform independent compatibility with BSD, Sun and GNU X.B rmt Xclients and it includes security features that may be set up in /etc/default/rmt. XAll options that start with the X.B \-f Xsequence are sensitive to typo problems, see BUGS section for more information. X.sp XSee X.B \-rsh Xoption on how to set up a different protocol for the connection to the Xremote tape server. X.sp XSee ENVIRONMENT section for information on how to use X.B ssh(1) Xto create a remote tape server connection. X.sp XNote that if X.BI file= - Xhas been specified, it is no longer possible to use the X.B \-find X.B \-exec Xprimary. X.TP X.B \-find XThis option acts a separator. XIf it is used, all X.B star Xoptions must be to the left of the X.B \-find Xoption. To the right of the X.B \-find Xoption, X.B star Xaccepts the X.B find Xcommand line syntax only. X.sp XThe X.B find Xexpression acts as a filter between the source of file names and the Xconsumer, which may either be the archiving engine or list/extract Xengine. If the X.B find Xexpression evaluated as TRUE, then the related file is selected for Xprocessing, otherwise it is omited. X.sp XIn order to make the evaluation of the X.B find Xexpression more convenient, X.B star Ximplements additional X.B "find primaries Xthat have side effects on the file meta data. X.B Star Ximplements the following additional X.B find Xprimaries: X.RS X.br X.ne 5 X.TP X.BI \-chatime " timespec XThe primary always evaluates as true; Xit modifies the X.B time of last access Xof a file in X.BR "struct stat" . XSee X.BR sfind (1) Xfor a description of X.IR timespec . X.br X.ne 5 X.TP X.BI \-chctime " timespec XThe primary always evaluates as true; Xit modifies the X.B time of last status change Xof a file in X.BR "struct stat" . XSee X.BR sfind (1) Xfor a description of X.IR timespec . X.br X.ne 5 X.TP X.BI \-chmtime " timespec XThe primary always evaluates as true; Xit modifies the X.B time of last modification Xof a file in X.BR "struct stat" . XSee X.BR sfind (1) Xfor a description of X.IR timespec . X.TP X.BI \-chgrp " gname XThe primary always evaluates as true; Xit sets the group of the file to X.IR gname . X.TP X.BI \-chmod " mode XThe primary always evaluates as true; Xit sets the permissions of the file to X.IR mode . XOctal and symbolic permissions are accepted for X.I mode Xas with X.BR chmod (1). X.TP X.BI \-chown " uname XThe primary always evaluates as true; Xit sets the owner of the file to X.IR uname . X.TP X.B \-false XThe primary always evaluates as false; Xit allows to make the result of the full expression different from Xthe result of a part of the expression. X.TP X.B \-true XThe primary always evaluates as true; Xit allows to make the result of the full expression different from Xthe result of a part of the expression. X.PP XThe command line: X.PP X.B "star -c f=o.tar -find . ( -type d -ls -o false ) -o ! -type d X.PP Xlists all directories and archives all non-directories to the archive X.BR o.tar . X.PP XThe command line: X.PP X.B "star -c f=o.tar -find . ( -type d -chown root -o true ) X.PP Xarchives all directories so they appear to be owned by root in the archive, Xall non-directories are archived as they are in the file system. X.PP XNote that the X.BR \-ls , X.B \-exec Xand the X.B \-ok Xprimary cannot be used if X.B stdin Xor Xstdout Xhas been redirected by the X.BI list= \- Xof by the X.BI file= \- Xoptions. X.RE X.TP X.B \-force_hole Xobsoleted by \-force\-hole X.TP X.B \-force\-hole XTry to extract all files with holes. This even works with files that Xare created without the X.B \-sparse Xoption. X.BR Star , Xin this case examines Xthe content of the files in the archive and replaces writes to parts containing Xbinary zeroes with seeks. X.sp XIf used together with the X.B \-sparse Xoption in create mode, X.B star Xassumes all files to be sparse and archives files with blocks of nulls as sparse files. X.sp XThis option should be used with extreme care Xbecause you sometimes get in trouble when files get unattended holes. XAll options that start with the X.B \-f Xsequence are sensitive to typo problems, see BUGS section for more information. X.TP X.B \-force_remove Xobsoleted by \-force\-remove X.TP X.B \-force\-remove XForce to remove non writable files on extraction. XBy default, X.B star Xwill not overwrite files that are read only. XIf this option is in effect, X.B star Xwill silently remove these files to allow the extraction of a file. XAll options that start with the X.B \-f Xsequence are sensitive to typo problems, see BUGS section for more information. X.TP X.B \-force\-restore XForce an incremental restore even if there is a dump level mismatch or Xa reference date mismatch. XSee X.BR \-wtardumps , X.B level= Xand sections X.B "INCREMENTAL BACKUPS Xand X.B "INCREMENTAL RESTORES Xfor more information. X.TP X.B \-freeze Xrun the input or output through a X.B freeze Xpipe - see option X.B \-z Xbelow. X.TP X.BI fs= # XSet fifo size to #. XSee X.I bs= Xfor the possible syntax. X.sp XThe default size of the fifo is 1 Mbyte on Sun mc68000 systems, X4 Mbytes on non mmap() aware Linux systems and 8 Mbytes on all other systems. XSee X.B \-fifo Xoption for hints on using the right fifo size. X X.TP X.BI fs-name= mount_point XUse X.I mount_point Xwhen recording information in X.B /etc/tardumps Xand when comparing against information in X.B /etc/tardumps Xfor incremental backups. XThis makes sense when backups are made using file system snapshots Xand allows X.B /etc/tardumps Xand the archive to contain the real name of the file system instead of the Xtemporary mount point that is used for the snapshot device. X X.TP X.BI H= headertype XSee X.BI artype= headertype Xoption. XNote that POSIX.1-2001 defines an option X.B \-H Xthat follows symbolic links that have been encountered on the command line. XFor this reason, the old star option X.BI H= headertype Xoption may go away in the future even though this option has been in use by Xcpio since 1989. X.TP X.B \-h, \-L XFollow symbolic links as if they were files. XNormally X.B star Xwill not follow symbolic links but stores their values in X.I tarfile. XSee also the X.B \-L Xoption. X.TP X.B \-hardlinks XIn extract mode, this option tells X.B star Xto try to create a hardlink whenever a symlink is encountered in the archive. XIn create mode, this option tells X.B star Xto try to archive a hardlink whenever a symlink is encountered in the Xfile system. X.TP X.B \-hpdev XAllow 24 bits for the minor device number using 8 octal digits. XNote that although it allows to create X.B tar Xarchives Xthat can be read with HP\-UX tar, this creates X.B tar Xarchives Xwhich violate POSIX.1\-1988. XThis option is only needed if you like to use a POSIX.1\-1988 based archive Xformat that does not include extensions. XIf you use the X.B xstar Xformat, X.B star Xwill use a base 256 extension that allows bigger major/minor numbers by default, Xif you use the X.B xustar Xor the X.B exustar Xformat there is no limitation at all as these formats use POSIX.1\-2001 Xextended headers to archive the major/minor numbers by default. X.TP X.B \-i XIgnore checksum errors on X.B tar Xheaders. XIf this option is specified, X.B star Xwill not exit if a header with a bad checksum is found but search for the Xnext valid header. X.TP X.B \-install XCarefully replace existing files when extracting files. This is done Xsimilar to X.BR install "(1) Xby first extracting the files into a temporary name and renaming Xthe file to the final name after the extraction of that file was Xsuccessful. X.sp XAs X.B star Xby default does not remove non-empty directories, an install that needs Xto remove existing non-empty directories may also need the options X.B \-force\-remove Xand X.BR \-remove\-recursive . X.TP X.B \-j Xrun the input or output through a X.B bzip2 Xpipe - see option X.B \-z X.B \-Z Xand X.B \-bz Xbelow. XAs the X.B \-bz Xthe X.B \-j Xthe X.B \-Z Xand the X.B \-z Xoption are non standard, it makes sense to omit the X.B \-bz Xthe X.B \-j Xthe X.B \-Z Xand the X.B \-z Xoptions inside shell scripts if you are going to extract a compressed Xarchive that is located inside a plain file as X.B star Xwill auto detect compression and choose the right decompression Xoption to extract. X.TP X.B \-keep\-nonempty\-dirs XDo not complain about trying to remove nonempty directories in case that X.B \-remove\-recursive Xhas not been specified. X.TP X.B \-keep_old_files Xobsoleted by \-keep\-old\-files X.TP X.BR \-keep\-old\-files ", " \-k XKeep existing files rather than restoring them from X.I tarfile. XThis saves files from being clobbered even if X.I tarfile Xcontains a more recent version of the corresponding file. X.sp XSee X.B SECURITY NOTES Xfor more information. X.TP X.B \-L, \-h XFollow symbolic links as if they were files. XNormally X.B star Xwill not follow symbolic links but stores their values in X.I tarfile. XSee also the X.B \-h Xoption. X.TP X.B \-l XDo not print a warning message if not all links to hard linked files Xcould be dumped. This option is evaluated in the opposite way to historic X.BR tar (1) Ximplementations and to POSIX.1. XPOSIX.1 requests that by default no warning messages will be printed Xand X.B \-l Xwill enable warning messages when not all links could be archived. X.TP X.BI level= dumplevel XSet level for incremental dumps. XThis option is used to switch X.B star Xinto X.I "true incremental dump" Xmode. XThe X.I dumplevel Xmay be in the range between 0..99. X.sp XIn X.I "true incremental dump" Xmode, a X.B \-C Xoption which is followed by the name a mount point and a dot ('.') as Xstarting directory name is required. XOnly a single file system may be handled at a time. XIf the directory following the X.B \-C Xoption is not referring to a root directory of a file system, the dump Xis called a X.BR "partial dump" . XIf the directory following the X.B \-C Xoption is referring to a root directory of a file system Xand no other restrictions apply that exclude certain files Xfrom the dump, the dump is called a X.BR "full dump" . X.sp XBy default, the X.B tardumps Xdatabase is not written. XSee also the X.BI tardumps= name Xand X.B \-wtardumps Xoptions and the section X.B "INCREMENTAL BACKUPS Xfor more information. X.TP X.B \-link\-data XIn create mode, include the data for files even if these files are Xhard links. This feature in create mode is currently only available Xfor the X.B exustar Xarchive format and only in case X.B \-sparse Xhas not been specified. X.sp XIn extract mode, allow X.B star Xto deal with data in hard linked files even if the standard would not Xallow this for the used archive format. X.TP X.B \-link\-dirs XWhen in create mode, try to find hard linked directories. XUsing X.B \-link\-dirs Xwill force X.B star Xto keep track of all directories that will go into the archive and thus Xcauses a lot more memory to be allocated than in the default case. X.sp XIf you like to extract a X.B cpio Xarchive that contains hard linked directories, you also need to specify X.B \-link\-dirs Xin extract or diff mode. XThis is needed because many X.B cpio Ximplementations create buggy archives with respect to hard links. XIf X.B star Xwould look for hard linked directories in all cases, it would Xdetect many pseudo hard links to directories. XUse X.B \-link\-dirs Xwith care if you extract X.B cpio Xarchives. X.sp XNote that not all filesystem allow to create hard links to directories. XAlso note that even though a non-root user is able detect and archive Xhard linked directories, all known operating systems require the extraction Xto be done as root in order to be able to create or remove hard links to directories. XFor this reason its only recommended to use this option when doing accurate Xbackups and when hard links to directories are expected. X.sp XWhen the option X.B \-link\-dirs Xis not used and hard links to directories are present, the appendant sub-tree Xwill appear more than once on the archive and X.B star Xwill print X.I "Linkcount below zero Xwarnings for non directory hard links inside the sub-tree. X.TP X.BI list= filename XRead filenames for store/create/list/diff command from X.I filename. XThe file X.I filename Xmust contain a list of path names, each on a separate line. XThis option implies the X.B \-D Xoption. XTo force X.B star Xto descend directories, use the X.B \-dodesc Xoption in this case. XSee also the X.B \-X Xoption. X.sp XNote that if X.BI list= - Xhas been specified, it is no longer possible to use the X.B \-find X.B \-exec Xprimary. X.TP X.B \-lowmem XTry to run with reduced memory requirements. XThis causes X.B star Xto default to 1 MB of FIFO memory. XInstead of allocating memory to hold the directory content and reading the Xdirectory at once, X.B star Xreads the directory name by name. This may cause X.B star Xto close the directory if it rans out of file descriptors because of deeply Xnested directories. If a directory then does not support X.BR telldir(3)/seekdir(3) , X.B star Xwill fail. X.br X.ne 5 X.TP X.B \-lzip Xrun the input or output through a X.B lzip Xpipe - see option X.B \-z Xbelow. X.TP X.B \-lzma Xrun the input or output through a X.B lzma Xpipe - see option X.B \-z Xbelow. X.TP X.B \-lzo Xrun the input or output through a X.B lzop Xpipe - see option X.B \-z Xbelow. X.TP X.BR \-M ", " \-xdev XDo not descend mount points. XThis is useful when doing backups of complete file systems. XSee NOTES for more information. X.TP X.B \-m XDo not restore access and modification time. X(Access time is only available if X.B star Xis reading X.BR star , X.BR xstar , X.BR xustar , X.BR exustar , Xor X.BR pax / epax Xarchives). If X.B star Xextracts other archive types, the X.B \-m Xflag only refers to the modification time. X X.TP X.B \-match\-tree XIf in create mode a pattern does not match a directory, and X.B \-match\-tree Xhas been specified, the whole directory tree is excluded from Xthe archive and from further directory scans. XBy default, X.B star Xexcludes the directory but still recursively scans the content of this Xdirectory as complex patterns could allow files inside the directory tree Xto match. XUsing X.B \-match\-tree Xallows to efficiently exclude whole trees from scanning. This helps to Xavoid scannings directory trees that are on remote file systems or contain Xexcessive bad blocks. X.TP X.BI maxsize= # XDo not store files in X.I tarfile Xif they are bigger than #. XSee X.I bs= Xfor the possible syntax. XBy default, the number is multiplied by X1024, so the value counts in units of kBytes. XIf the size specifier ends with a valid multiplication character X(e.g '.' for bytes or 'M' for MB) the specified size is used as specified Xand not multiplied by 1024. XSee X.B bs= Xoption for all possible multipliers. X.TP X.B \-meta XIn create mode, X.B \-meta Xcauses X.B star Xto archive all X.B meta Xdata of the file (e.g. uid, permissions, ...) but not the Xfile content. In extract mode, it causes X.B star Xto restore all X.B meta Xdata but not the file content. In addition, in extract mode Xno plain file, special file or directory will be created. X.B Meta Xfiles are needed to support incremental backups. X.sp XWarning: Do not try to extract X.B star Xarchives containing X.B meta Xfiles using other tar implementations if they are not aware of the X.B meta Xfile extensions of X.BR star . X.B Star Xtries to force all tar implementations that are not standard compliant to abort. X.B Star Xalso tries to make all non POSIX.1-2001 compliant tar implementations unable Xto find a valid filename. However when other POSIX.1-2001 aware tar implementations Xcome up and don't know about X.B meta Xfiles, they will destroy files on disk. X.sp XThe problems result from the only current fallback in the POSIX standard that Xtells tar implementations to treat all unknown file types as if they were Xplain files. As X.B meta Xfiles are needed for incremental backups, I am looking for people and companies Xwho like to support me to be able to add the X.B meta Xfile concept to the POSIX.1-2005 standard. X.TP X.B \-modebits XThis options allows you to create X.B tar Xarchives that include Xmore than 12 bits from st_mode. Note this create X.B tar Xarchives Xthat violate POSIX but some X.B tar Ximplementations insist in reading Xsuch nonstandard archives. X.TP X.B \-multivol XSwitch to multi volume mode. XIn multi volume mode, there will be no logical EOF marker written to the end Xof a single tape. If X.B \-multivol Xis used in read mode, a hard EOF on input (if not preceded by a logical EOF) Xtriggers a medium change operation. X.sp XSpecifying X.B \-multivol Xtells X.B star Xto split files across volumes if needed. XThis way, a virtual archive is created that spans more than one medium. XMulti volume mode is needed whenever it is not possible to split the Xarchiving or extracting into several logically independent tasks. This is Xtrue for e.g. incremental dump/restore operations where inode numbers need Xto be traced for the whole task. X.sp XWhen X.BI tsize= # Xhas been specified, but X.B star Xis not in multi volume mode, files cannot be split across volumes. X.sp XWhen X.B \-multivol Xhas been specified in create mode together with X.BI tsize= # Xthen a media change is initiated exactly after an amount of X.I tsize Xdata has been written. XWhen X.B \-multivol Xhas been specified in create mode and X.BI tsize= # Xhas not been specified, then the medium change is triggered by a EOT condition Xfrom writing the medium. This allows to use media where the size cannot be known Xin advance (e.g. tapes with build in compression); it does not work if the XEOT condition is not returned in sync with the related write operation. For this Xreason, it is expected that data buffering inside a device driver cannot be used. X.sp XDepending on the selected archive format, X.B star Xwrites a volume header at the beginning of a new medium. This medium header Xallows to verify the correct volume after a change during read back. XIt is recommended to use the X.B exustar Xformat for best results. XIn create mode, X.B \-multivol Xis only supported for archives types that allow to write reliable multi volume Xheader information. X.sp XSee X.BI tsize= # Xoption for more information. X.sp XNote that X.B \-multivol Xis an interactive option that prevents X.B star Xfrom being used in non-interactive environments. XIf you like to use it in a non-interactive environment, you need to Xspecify X.BI new\-volume\-script= script Xin addition in order to automate the media change procedure. X.TP X.BI newer= filename XDo not store files to X.I tarfile Xif their modification time is not newer than the modification time of X.I filename. XSee X.B \-ctime Xoption for changing this behavior. X.TP X.B \-newest XIn conjunction with the list command this lists you only the newest file in X.I tarfile. X.TP X.B \-newest_file Xobsoleted by \-newest\-file X.TP X.B \-newest\-file XIn conjunction with the list command this lists you only the newest regular Xfile in X.I tarfile. X.TP X.BI new\-volume\-script= script XCall X.I script Xat end of each tape if in multi volume mode. XIf this option is not in effect, X.B star Xwill ask the user to confirm the volume change. XThe script is called with two parameters. XThe first parameter is the next volume number and the second Xparameter is the next archive file name. X.TP X.B \-nodump XIf this option is set, X.B star Xwill not dump files that have the X.B nodump Xflag set. Note that this currently only works on BSD\-4.4 derivates Xand on Linux. XOn Linux, using this option will cause a performance degradation X(the system time increases by 10%) because of the unlucky kernel interface Xthat requires a separate open and ioctl. X.TP X.B \-no-dirslash XDo not add a slash to the end of directory names if writing to an archive. XHistoric tar archive formats did only allow to specify plain files and hard links. XAround 1980, BSD added a feature to specify a directory on tape by adding Xa slash to the end of the name. POSIX.1-1988 defined the first official tar Xarchive format that had a clean method to specify the type of a directory. XAs old tar formats need the slash to recognize a directory, X.B \-no-dirslash Xmay not be used if archives should be compatible with the old tar format. X.TP X.B \-no_fifo Xobsoleted by \-no\-fifo X.TP X.B \-no\-fifo XDon't use a X.I fifo Xto optimize data flow from/to X.I tarfile. XCurrently the X.I \-fifo Xoption is used as default. (This may be changed at compile time.) X.TP X.B \-no\-fsync XDo not call X.B fsync(2) Xfor each file that has been extracted from the archive. XUsing X.B \-no\-fsync Xmay speed up extraction on operating systems Xwith slow file I/O (such as Linux with any filesystem or Xplatforms with Copy on Write filesystems like ZFS), Xbut includes the risk that X.B star Xmay not be able to detect extraction problems that occur after the call Xto X.BR close (2). XA typical cause for such problems is a NFS file system that Xfills up before the buffer cache is synced or Xa write error that occurs while the buffer cache is synced. XThere may be other reasons. XUse with extreme care. X.sp XSee also X.B \-do\-fsync Xand X.B STAR_FSYNC Xin X.B ENVIRONMENT Xand X.B /etc/default/star Xfor ways to configue the default behavior. X.TP X.BR \-nochown ", " \-o XDo not restore owner and group of files. XThis may be used if super user privileges are needed to overwrite Xexisting files but the local ownership of the existing files should Xnot change. X.TP X.B \-no\-p XDo not restore files and directories to their original permissions. XThis option is needed only if X.B star Xis called by the super user and the permissions should not be restored Xfrom the archive. XSee also the X.B \-p Xoption. The X.B \-p Xoptions has a higher precedence than the X.B \-no\-p Xoption. X.TP X.B \-no_statistics Xobsoleted by \-no\-statistics X.TP X.B \-no\-statistics XDo not print statistic messages at the end of a X.B star Xrun. X.TP X.B \-no\-secure\-links XExtract hard links or symbolic links even if the target of the link Xstarts with a slash (/) or if /../ is contained in the link target. XSee the description of the option X.B \-secure\-links Xbelow. X.TP X.B \-no\-xheader XDo not create or extract POSIX.1-2001 extended headers. XThis option may be used if you like to read an archive with broken Xextended headers. X.TP X.BR \-not ", " \-V XInvert the meaning of the pattern list. i.e. use those files which do not match Xany of the pattern. XNote that this option only applies to patterns that have been specified Xvia the X.BR pattern= "pattern or " pat= pattern Xoption. Patterns specified as file type arguments will not be affected. X.TP X.BR \-notarg ", " \-pax-c XMatch all file or archive members except those specified by the pattern or file operands. X.TP X.B \-nowarn XDo not print warning messages. XThis sometimes is useful to make the output more readable X(e.g. when hundreds of files that are going to be extracted are not newer Xin the archive then on the filesystem). X.TP X.B \-numeric XUse the numeric user/group fields in the listing rather than the Xdefault. XThe default allows to list the ASCII version of user/group of the file Xand to extract the owners of the files based on numeric values rather Xthan the names. XIn create mode, no user/groups names are put on the archive. XThe X.B \-numeric Xoption also applies when ACLs are going to be archived or extracted. X.TP X.B \-O XBe compatible to old versions of X.BR tar . XIf X.B star Xis invoked with this option, X.B star Xgenerates archives which are Xfully compatible with old UNIX X.B tar Xarchives. If in extract mode, X.B star Xignores any additional info in the headers. XThis implies neither that archives generated with this option are Xbinary equal with archives generated by old X.B tar Xversions nor that X.B star Xis trying to comprehend all bugs that are found in old X.B tar Xversions. XThe bug in old X.B tar Xversions that cause a reversal of a space and a NULL byte Xin the checksum field is not repeated. XIf you want to have signed checksums you have to specify the X.I \-signed\-checksum Xoption too. XIf you want directories not to be archived in order to be compatible Xto very old historic tar archives, you need to specify the X.I \-d Xoption too. X.sp XThis option is superseeded by the X.BR H= headertype Xoption. X.TP X.BR \-o ", " \-nochown XDo not restore owner and group of files. XThis may be used if super user privileges are needed to overwrite Xexisting files but the local ownership of the existing files should Xnot change. X.TP X.BR \-onull ", " \-nullout XDo not actually write to the archive but compute and add the sizes. XThis is useful when trying to figure out if a tape may hold Xthe current backup. XPlease only use the X.B \-onull Xoption as it is a similar option as used by the X.BR sdd (1) Xcommand. X.TP X.B \-P XAllow X.B star Xto write a partial record as the last record. XNormally, X.B star Xwrites each record with the same size. XThis option is useful on unblocked tapes i.e. cartridge tapes like QIC tapes Xas well as with archives that are located in files. XIf you use this option on local files, the size of the archive will be smaller. XIf you use this option on cartridge tapes, is makes sure that later - in extract mode - X.B star Xwill read up to the end of file marker on the tape and the next call to X.B star Xwill read from the next archive on the same tape. X.TP X.B \-p XRestore files and directories to their original permissions. XWithout this option, they are created using the permissions in the archive Xand the present X.BR umask (2). XIf X.B star Xis called by the super user, X.B star Xbehaves as if it has been called with the X.B \-p Xoption. See also X.B \-no\-p Xoption. XIf the archive contains Access Control Lists (ACLs) in XPOSIX.1\-2001 extended headers, X.B star Xwill restore the access control lists from the archive for files Xif the \-acl option is specified. XIf the option \-acl has not been specified, ACLs are not restored at all. X.TP X.B \-partial XForce an incremental restore even if the incremental dump is only a partial Xdump. See X.BR \-wtardumps , X.B level= Xand sections X.B "INCREMENTAL BACKUPS Xand X.B "INCREMENTAL RESTORES Xfor more information. X.TP X.BI pattern= "pattern\fR, " pat= pattern XSet matching pattern to X.I pattern. XA maximum of 100 pattern=pat options may be specified. XAs each pattern is unlimited in length, this is no real limitation. XIf more than one pattern is specified, a file matches if any of the Xspecified pattern matches. XPatterns may be used in create mode to select or exclude files Xfrom the list of file type arguments or the files located in a sub tree Xof a file type argument directory. XBy default, X.B star Xscans the whole directory tree underneath a directory that is in the argument Xlist. This may be modified by using the X.B \-match\-tree Xoption. XIn extract or list mode, all file type arguments are interpreted to be Xselect pattern and all option type patterns may be either select or exclude patterns Xdepending on the presence or absence of the X.B \-not Xoption. XIf you use file type select patterns, they work exactly like the method Xused by other (non pattern aware) X.BR tar (1) Ximplementations. XFile type select patterns do not offer pattern matching but allow to restore subtrees. XTo extract a complete sub tree Xfrom the directory X.I dir Xwith X.B star Xusing the X.B pattern= Xoption, use X.B pattern= X.I "dir/\\\\* Xif you like to select a subtree by using the historic method, use X.I "dir Xas file type argument. XIf you only like to extract the directory itself, use X.I "dir/ Xas file type argument. XSee manual page for X.BR match (1) Xfor more details of the pattern matcher. XAll patterns are selection patterns by default. To make them exclude patterns, Xuse the X.B \-not Xor the X.B \-V Xoption. X.TP X.BI pkglist= file XThis is (for now) an internal interface for the Schily Source Package System (sps). XIt only works in create mode and behaves similar to the X.B list= Xoption, but it allows to overwrite the X.BR permissions , Xthe X.B uid Xand X.B gid Xvalues from the content of the X.B pkglist= Xfile. XEach line from the X.B pkglist= Xfile contains a file name followed by the permission, a user name and a group name. XThe permission is an octal character string. XEach value that is not used to overwrite the original values may be replaced by a '?'. XThe fields are separated by spaces, so the X.B pkglist= Xoption does not allow files that contain newline or space characters. X.TP X.BR \-pax\-c ", " \-notarg XMatch all file or archive members except those specified by the pattern or file operands. X.TP X.B \-pax\-H XFollow symbolic links that have been encountered on the command line. XIf the referenced file does not exist, the file information and type will be for the link itself. XIf the link is referencing a file type that cannot be archived with the current archive format, Xthe file information and type will be for the link itself. X.TP X.B \-pax\-i XDo interactive renaming in a way that has been defined for POSIX X.BR pax . X.B Star Xwill print the original filename and prompt for a reply. XIf you type just X.BR RETURN , Xthan the file is skipped. XIf you type '.', then the original file name is retained. XIf you type anything else, then this is taken as the new file name. X.sp XNote that X.B \-pax\-i Xis an interactive option that prevents X.B star Xfrom being used in non-interactive environments. X.TP X.B \-pax\-L XFollow symbolic links. XIf the referenced file does not exist, the file information and type will be for the link itself. XIf the link is referencing a file type that cannot be archived with the current archive format, Xthe file information and type will be for the link itself. X.TP X.B \-pax\-ls XSwitch listing format to the format defined for POSIX X.B pax Xand X.BR ls . X.TP X.B \-pax-match XAllow file type arguments to be recognised as regular expressions in a way that has been defined Xfor POSIX X.BR pax . X.TP X.B \-pax\-n XAllow each pattern to match only once. XIf a pattern matches a directory, then the whole sub tree matches the pattern. X.TP X.BI \-pax\-o " string XSet a X.B pax Xlike option control pattern. X.sp XThe only argument that is currently supported is X.B binary Xto create a X.B hdrcharset=BINARY Xheader. X.TP X.BI \-pax\-p " string XPAX style privileges string. XSeveral characters (each has its own meaning). The following characters are defined: X.RS X.TP X.B a XDo not preserve file access times. XThis option is currently ignored. X.TP X.B e XPreserve the user ID, group ID, file mode bits. XThis is equivalent to calling X.BR "star \-p \-acl \-xfflags" ". X.TP X.B m XDo not preserve file modification times. XThis is currently equivalent to calling X.BR "star \-m" ". X.TP X.B o XPreserve the user ID and group ID. XThis is the default for X.B star Xif called as root. X.TP X.B p XPreserve the file mode bits. XThis is equivalent to calling X.BR "star \-p" ". X.RE X.TP X.B \-prinodes XPrint inode numbers in verbose list mode if the archive contains Xinode numbers. X.TP X.B \-print\-artype XCheck the type of the archive, print the archive and compression type on a single Xline and exit. X.TP X.B \-qic24 XSet tape volume size to 61440 kBytes. XSee X.BI tsize= # Xoption for more information. X.TP X.B \-qic120 XSet tape volume size to 128000 kBytes. XSee X.BI tsize= # Xoption for more information. X.TP X.B \-qic150 XSet tape volume size to 153600 kBytes. XSee X.BI tsize= # Xoption for more information. X.TP X.B \-qic250 XSet tape volume size to 256000 kBytes. XSee X.BI tsize= # Xoption for more information. X.TP X.B \-qic525 XSet tape volume size to 512500 kBytes. XSee X.BI tsize= # Xoption for more information. X.TP X.B \-read0 XRead null terminated file names from the file specified with the X.B list= Xoption. X.TP X.B \-refresh_old_files Xobsoleted by \-refresh\-old\-files X.TP X.B \-refresh\-old\-files X.TP X.B \-refresh XDo not create new files. Only already existing files may be overwritten from X.I tarfile Xif either newer versions are present in the archive or if the X.B \-U Xflag is used. XThis allows to overwrite files by more recent files from an archive Xthat contains more files than the target directory should contain. XThe option X.B \-refresh\-old\-files Xis the same as the X.B \-refresh Xoption. X.TP X.B \-remove_first Xobsoleted by \-remove\-first X.TP X.B \-remove\-first XRemove files before extraction. XIf this option is in effect, X.B star Xwill remove files before extracting a file from the archive. XThis is needed if you want to change the file type or if you need Xto break a hard link. XIf you do not use either X.B \-ask\-remove Xor X.B \-force\-remove Xtogether with X.BR \-remove\-first , Xthis option is useless and no files will be removed. X.TP X.B \-remove_recursive Xobsoleted by \-remove\-recursive X.TP X.B \-remove\-recursive XRemove files recursive. XIf removing of a file is permitted, X.B star Xwill only remove files, specials and empty directories. XIf this option is in effect, X.B star Xwill be allowed to recursively removes non empty directories too. X.TP X.B \-restore Xswitches X.B star Xinto X.I "true incremental restore" Xmode. XA file named X.B star-symtable Xand a directory named X.B star-tmpdir Xis created in the root directory of the file system where the extraction Xtakes place. XIf X.B \-restore Xhas been specified, star behaves as if X.B \-xdot Xhas been specified too. XSee also X.B level= Xoption Xand section X.B "INCREMENTAL BACKUPS Xfor more information. X.sp XNote: Do not use the X.B \-restore Xoption if you only like to restore a single file or a list of selected files. X.TP X.BI rmt= path XSpecify the path to the program at the remote tape server for the X.B RMT Xprotocol. X.sp X.B star Xby default calls the UNIX default path X.BR /etc/rmt . X.sp XSince most X.B rmt Ximplementations cause problems in case that server and client are on a different XOS, it is recommended to tell X.B star Xto call the X.B rmt Xprogram that comes with Xstar X.RB ( /opt/schily/sbin/rmt ). X.TP X.BI rsh= path XSpecify the program to log into the remote tape server for the X.B RMT Xprotocol. XIf the argument is the empty string, connections are made via X.BR rcmd (3). XThe default method to log into the remote server is configurable at compile Xtime. The current default is set up to use X.BR ssh . X.TP X.B \-S XDo not store/create special files. XA special files is any file except plain files, symbolic links and directories. XYou need to be super user to extract special files. X.TP X.BI \-s " replstr" XModify file or archive member names named by a pattern according to the Xsubstitution expression X.IR replstr . XThe format of X.I replstr Xis: X.sp X.BI " \-s\ " /old/new/[gp] X.sp XThe X.B old Xpattern may use regular expressions and the X.B new Xstring may contain the special character '&'. The character '&' is substituted by the Xstring that matches the X.B old Xpattern. XThe optional trailing 'g' means global substitution. If 'g' is not used, a substitution Xpattern is only used once on a name. XIf the optional trailing 'p' is used, the substitution is printed to standard error. X.sp XUp to 100 substitute options may be used. If more than one substitute option has been Xspecified, X.B star Xwill loop over all substitute patterns until one matches. X.sp XIf the name substitutes to the empty string, the file is skipped. X.TP X.B \-secure\-links XDo not extract hard links or symbolic links if the target of the link Xstarts with a slash X.RB ( / ) Xor if X.B /../ Xis contained in the link target. XTar archives containing such links could be used to compromise the system. If they are Xunpacked together with a lot of other files, this may not even be noticed. X.sp XLinks that do not point outside the tree that starts with the current Xworking directory are not seen as a security risk. This makes X.B star Xeasy to use. XIt is always safe to unpack an unknown archive in an empty directory. X.sp XMany system installations contain plenty of symbolic links with absolute Xpath name or with X.B /../ Xinside. XThe usability of a tar archiver for system backups would be limited if X.B \-secure\-links Xchecking would be done by default for backups as well, X.B star Xthus makes link checking optional when in X.B \-restore Xmode. XWhen X.B \-restore Xhas not been specified, link checking is the default, since this is the usual Xway where archives from unknown sources are going to be unpacked. X.sp XTo turn off Xthis default for the usual case, the option X.B \-no\-secure\-links Xmay be used and in X.B \-restore Xmode, X.B \-secure\-links Xmay be specified to turn it on. X.sp XIf you unpacked a tar archive while X.B \-secure\-links Xis effective and did not get a security warning at the end of the X.B star Xrun, all files and links have been extracted. XIf you get a warning, you should unpack the archive a second time and specify the Xoptions X.BR \-k ", " \-w " and " \-nowarn Xin addition to the options used for the first run. XTo speed this up, it helps to use: X.sp X.B " star -xvpw -find -type l X.sp XSee X.B SECURITY NOTES Xfor more information. X.TP X.B \-shm XUse System V shared memory for fifo. XNormally X.B star Xis compiled to use mapped /dev/zero pages for the fifo, if the operating system Xsupports this. XIf X.B star Xis compiled to have both code for mapped pages and for System V shared memory, X.B star Xwill use shared memory instead of the default. XIf the X.I \-help Xmenu doesn't show the X.I \-shm Xflag you have no choice. XWhen using System V shared memory, you may have to raise the system's internal Xlimit for shared memory resources to get enough shared memory for X.BR star . X.TP X.B \-signed_checksum Xobsoleted by \-signed\-checksum X.TP X.B \-signed\-checksum XUse signed chars to calculate checksums. This violates the X.B tar Xspecs but old Xversions of X.B tar Xderived from the seventh edition of UNIX are implemented in this way. XNote: Only filenames and linknames containing chars with the most Xsignificant bit set may trigger this problem because all Xother fields only contain 7 bit ASCII characters, octal digits or binary Xzeroes. X.TP X.B \-silent XSuppress informational messages like X.IR "foobar is sparse" . X.TP X.B \-sparse XHandle files with holes effectively on store/create. XNote that sparse files may not be archived this way if the archive format is X.BR tar , X.BR ustar , X.BR suntar , X.BR pax , Xor any X.B cpio Xvariant. XOn Solaris-2.3 ... Solaris-2.5.1 there is a special ioctl() called X.I _FIOAI Xthat allows root to get the allocation info more efficiently. XOn Solaris 11 there is an enhanced X.BR lseek (2) Xcall with additional whence values X.B SEEK_HOLE Xand X.B SEEK_DATA Xthat allow to find holes in an efficient way. XOther operating systems lack support to get the real allocation list Xand force X.B star Xto scan the files to look for blocks that only contain null characters. XThis may X.B star Xcause to assume more holes to be present than the number that the file really contains. X.TP X.B \-symlinks XThis option tells X.B star Xin extract mode to try to create a symlink whenever a hardlink is encountered Xin the archive. X.TP X.B \-T XIf the option X.B file= Xor X.B f= Xis omitted and the \-T option is present, X.B star Xwill use the device indicated by the X.SB TAPE Xenvironment variable, Xif set. X.TP X.BI tardumps= name XSet the file name for tar dump dates database to X.BR name . XThe default name is X.BR /etc/tardumps . XUse in combination with the X.B level= Xoption to create X.IR "true incremental dumps" . XSee also X.B \-wtardumps Xoption and section X.B "INCREMENTAL BACKUPS Xfor more information. X.TP X.B \-time XPrint timing info. XSee DIAGNOSTICS for more information. X.TP X.B \-to_stdout Xobsoleted by \-to\-stdout X.TP X.B \-to\-stdout XExtract files to stdout. This option may be used to extract X.I tarfiles Xcontaining X.I tarfiles X(see examples below). X.TP X.B \-tpath XUse this option together with the X.I \-t Xoption or with X.I \-cv X(verbose create) to get only a list of the Xpathnames of the files in the archive. XThis may be used in shell scripts to generate a name list. XIf used together with the X.I \-diff Xoption, X.B star Xwill only print the names of the files that differ. XA second run of X.B star Xmay then be used to restore all files that had differences to the archive. XUse the X.I list= Xoption to specify the namelist in this case. X.TP X.BR tsize= # XSet tape volume size to # to enable multi volume tape support. XThe value refers to the archive size without compression. XSee X.I bs= Xfor the possible syntax. XBy default, the number is multiplied by X512, so the value counts in units of 512 byte blocks. XIf the size specifier ends with a valid multiplication character X(e.g '.' for bytes or 'M' for MB) the specified size is used as specified Xand not multiplied by 512. XWith this option in effect, X.B star Xis able to archive filesystems that are bigger then the tape size. XIf the option X.BR tsize= # Xwithout X.B \-multivol Xthen no file will be split across volumes and each volume may in theory Xbe read back separately. XFiles that do not fit on a single tape may not be stored in this mode. XIf X.B \-multivol Xhas been specified in addition, X.B star Xwill split files when the maximum allowed tape size has been reached. XIf the tape volume size is not a multiple of the tape block size, Xthe tape volume size is silently rounded down to a value that is a Xmultiple of the tape block size. X.sp XSee X.B \-multivol Xoption for more information. X.TP X.B \-U XRestore files unconditionally. XBy default, an older file from the archive will not replace a corresponding newer file on Xdisk. X.TP X.BI umask= mask XSet X.B star's Xumask to X.IR mask . XThis allows to control the permissions for intermediate directories that Xare created by X.B star Xin extract mode. XSee also X.B \-p Xoption. X.TP X.B \-uncond\-rename XWhen in interactive restore mode or when the X.B \-s Xoption was specified, unconditionally ask for a new name or apply a substitution. XThis happens even when the current path name would be skipped otherwise Xbecause the file in the archive is not Xnewer than the file with the original name on disk. X.TP X.B \-v XIncrement verbose level by one. XThis normally results in more output during operation. XSee also in the description for the X.I \-t Xflag. XNormally, X.B star Xdoes its work silently. XIf the verbose level is 2 or more and X.B star Xis in create or update mode, X.B star Xwill produce a listing to the format of the ls \-l output. X.TP X.BR \-V ", " \-not XInvert the meaning of the pattern list. i.e. use those files which do not match Xany of the pattern. XNote that this option only applies to patterns that have been specified Xvia the X.BR pattern= "pattern or " pat= pattern Xoption. Patterns specified as file type arguments will not be affected. X.TP X.B \-version XPrint version information and exit. X.TP X.BI VOLHDR= name XUse X.I name Xto generate a volume header. X.TP X.B \-w XDo interactive creation, extraction or renaming. XFor every file that matches the list of patterns and that has a more Xrecent modification time in the X.B tar Xarchive (if in extract mode and Xthe \-U option is not specified) X.B star Xprints its name and asks: X.RS X.IP X.B Xget/put ? Y(es)/N(o)/C(hange name) : X.PP XYou may answer either `N' for No or to skip this file. XIf you answer `Y' the file is extracted or archived on tape with its Xoriginal name. XIf you answer `C', you are prompted for a new name. This name is used Xfor the filename on disk if X.B star Xis in extract mode or for the archive name if X.B star Xis in create mode. X.RE X.sp XSee X.B SECURITY NOTES Xfor more information. X.sp XNote that X.B \-w Xis an interactive option that prevents X.B star Xfrom being used in non-interactive environments. X.TP X.B \-wready XThis option tells X.B Star Xto wait up to two minutes for the drive to become ready. XIt has been added as a hack for a bug in the SunOS/Solaris X.I st Xdevice driver. This driver has problems to sense the loading time Xwith Exabyte drives with factory settings. XIt also makes sense to use X.B \-wready Xif multiple remote backups are made. In this case, the remote connection Xis closed while the remote tape server is still writing a file mark. XIf another remote backup is initiated before the old remote server did Xfinish to write the file mark, it would be impossible to open the Xtape driver unless X.B \-wready Xis specified to tell X.B star Xto wait for the drive to become ready again. X.TP X.B \-wtardumps XTell X.B star Xto update the file that contains the tar dump dates data base if in dump mode. XIf the dump is not a X.BR "full dump" , Xthe tar dump dates data base file is not written. XSee also X.BI tardumps= name Xand X.B \-C Xoption or X.B "INCREMENTAL BACKUPS Xsection for more information. X.TP X.BI \-X " filename XUse the file X.I filename Xas a file containing a list of path names to be excluded from the Xstore/create/list/diff operation. XThe file X.I filename Xmust contain a list of path names, each on a separate line. XBe careful with white space and note that path names in the list may not Xcontain new lines. XMultiple X.B \-X Xoptions may be used. Each argument must refer to a file containing path names. XThe X.B \-X Xoption has precedence before other options that select files to be included Xin the operation. XSee also X.B list= Xoption. X.TP X.B \-xattr XReserved for NFSv4 extended attributes. X.TP X.B \-xattr\-linux XStore and extract extended file attributes as found on Linux systems. XThis option only makes sense when creating or extracting X.B exustar Xarchives as it is based on POSIX.1\-2001 extended tar headers. X.sp XThe method used in the current implementation could be used to store and extract Xextended file attributes from BSD too. XNote that the current implementation is not generic enough to cover more general Xextended file attribute implementations as found on Solaris. XIf X.B star Xstarts to implement a method that covers extended file attributes on Solaris, Xthe new method will be used then X.B \-xattr Xhas been specified and X.B \-xattr\-linux Xwill refer to the old method. XThe method used with X.B \-xattr\-linux Xmay go away in the future. X.TP X.B \-xcopy XAn alias for X.B \-copy \-sparse \-acl X.TP X.BI xdebug= "#, " xd= # XSet extended debug level to #. X.TP X.BR \-xdev ", " \-M XDo not descend mount points. XThis is useful when doing backups of complete file systems. XSee NOTES for more information. X.TP X.B \-xdir XExtract directories even if the corresponding directories on the Xarchive are not newer. XThis is useful when for some reason, the directories are recorded Xafter their content (see X.B \-dirmode Xoption), or when the permissions of some directories Xmust be set in any case. XAs the classical UNIX X.B cpio Xprogram does not implement delayed directory permission and time stamp setting, X.B cpio Xusers often create archives in reverse order (directories past their Xcontent). For this reason, it makes sense Xto use X.B \-xdir Xwhile extracting X.B cpio Xarchives. X.TP X.B \-xdot XUnconditionally extract the first directory in the archive if the name of this Xdirectory is either '.' or './'. XThis helps to extract archives in an expected way if the target directory is Xa newly created empty directory. As this directory is newer than the top level Xdirectory in the archive, X.B star Xwould usually skip this directory during extraction. XThe effect of this directory is as if X.B \-xdir Xhas been specified but is switched off after the first directory has been found. X.TP X.B \-xfflags XStore and extract extended file flags as found on BSD and Linux systems. XThis option only makes sense when creating or extracting X.B exustar Xarchives as it is based on POSIX.1\-2001 extended tar headers. XSee NOTES section for problems with X.B \-xfflags Xon Linux systems. X.TP X.B \-xmeta XExtract X.B "meta files Xas if they were files. X.B "Meta files Xin archives are plain files that do not contain any content data in the archive. XThey may be created by using the X.B \-meta Xoption in X.B star's Xcreate mode. XExisting files are not overwritten. If a file is missing, a zero sized Xfile is created. XIf the option X.B \-meta Xis used together with the option X.BR \-force\-hole , Xmissing plain files are created as sparse empty files of the original size. X.TP X.B \-xz Xrun the input or output through a X.B xz Xpipe - see option X.B \-z Xbelow. X.TP X.B \-Z Xrun the input or output through a X.B compress Xpipe - see option X.B \-z Xbelow. X.TP X.B \-z Xrun the input or output through a X.B gzip Xpipe. XThis is currently a quick and dirty hack, that mainly will cover Xthe most common usage to compress the X.B tar Xoutput if it is a file. XNo reblocking will be done, so this option will currently only make sense Xon plain files. XAs the X.B \-bz Xthe X.B \-j Xthe X.B \-Z Xand the X.B \-z Xoption are non standard, it makes sense to omit the X.B \-bz Xthe X.B \-j Xthe X.B \-Z Xand the X.B \-z Xoptions inside shell scripts if you are going to extract a compressed Xarchive that is located inside a plain file as X.B star Xwill auto detect compression and choose the right decompression Xoption to extract. XThe environment variable X.B STAR_COMPRESS_FLAG Xmay be used to specify one option for gzip. XIf you want to write write compressed archives to tape, you should use X.br X.I "star \-c . | gzip | sdd ibs=4k obs=32k \-fill of=/dev/rmt/1bn X.br Xor X.br X.I "star \-c . | gzip | sdd ibs=4k obs=32k \-fill ovsize=60m of=/dev/rmt/1bn X.br Xif the tape can hold 60 MB. X.TP X.B \-zstd Xrun the input or output through a X.B zstd Xpipe - see option X.B \-z Xabove. X.SH "INCREMENTAL BACKUPS X.PP X.B Star Xis able to back up file system in full and incremental mode. XTo allow incremental backups, the file system must implement XPOSIX semantics. X.PP XTo be more verbose: X.TP X.B \(bu XThe filesystem needs to uniquely identify files by the two numbers X.B st_dev X(The filesystem ID or device ID of the device containing the file) and X.B st_ino X(The file serial number). XIf a file is renamed, these numbers need to be retained. XBoth numbers need to be a cardinal Xscalar that is expressible in a decimal number. X.TP X.B \(bu XThe filesystem needs to implement at least two time stamps, X.B st_mtime Xthe file's last modification time and X.B st_ctime Xthe file's last status change time. XBoth time stamps need to be dealt with as documented by Xthe POSIX standard. XBoth numbers need to be a cardinal Xscalar that is expressible in a decimal number or as a decimal number Xthat counts in seconds plus another number that counts in fractions of Xa second. X.TP X.B \(bu XThe filesystem needs to allow to rename files Xand directories by either calling X.BR rename(2), Xor X.BR link(2) Xand X.BR unlink(2). X.TP X.B \(bu XThe filesystem needs to honor and preserve the case of file names. X.PP XThe incremental backup method used by X.B star Xdepends on comparing the time stamps of all files against Xthe time of the last backup. Note that this method only works Xcorrectly if the level 0 backup and all higher level Xincrementals include the whole file system. XAs X.B star Xarchives all inode meta data, X.B star Xis able to detect renamed files by comparing the X.B "inode numbers" Xof all files while in incremental restore mode. X.PP XDetecting renamed files only works if X.BR star , Xwhile in backup mode, Xscans the whole file system tree for each full and incremental backup. XThis will work in case no files are excluded and the dump starts Xat the root directory of a file system. XIn case that no files are renamed from excluded parts to included parts, Xpartial backups may be taken also. Partial backups only make sense if Xa complete directory sub tree is excluded (e.g. by using the X.B pat= Xoption) or if a partial backup starts at a sub directory that is not the Xroot directory of the file system. X.PP XIn case of a partial backup, it is important that no file or directory will Xever be moved outside the scope and later move into the scope again. Moving Xfiles or directories outside the scope of a partial backup is detected as Xdeletion and moving the files back into the scope does not make them Xappear in an incremental backup since the time stamps of files from inside Xrenamed directories did not change. X.PP XNote that a backup must not include files that are mounted from another Xfilesystem and a restore cannot be done with more than one filesystem as Xtarget. X.PP XFiles in the backup tree that are hidden under a mount point cannot be Xpart of the backup as long as the backup is not done from a snapshot. X.PP XTo create a level 0 dump call: X.PP X.B "star \-c \-xdev \-sparse \-acl \-link\-dirs level=0 \-wtardumps \e X.br X.B "\ \ \ \ f=\fIarchive-name\fP \-C /\fIfilestem-mount-point\fP . X.PP XTo create a level 1 dump call: X.PP X.B "star \-c \-xdev \-sparse \-acl \-link\-dirs level=1 \-wtardumps \e X.br X.B "\ \ \ \ f=\fIarchive-name\fP -C /\fIfilestem-mount-point\fP . X.PP XDo not forget the dot at the end of the command line that specifies the Xdirectory to start the operation. X.PP XBackups from live filesystems should be avoided. XOn operating systems that support X.BR "file system snapshots" , Xbackups should be made from a read-only mount of a Xsnapshot. Be careful that all files that have been Xcreated between setting up a snapshot and starting an Xincremental backup may be missing from all backups unless the X.BI dumpdate= name Xoption is used. X.PP XIf the system that is going to be backed up is not Xacting as a file server, it makes sense to shut down Xall services that may result in inconsistent file states Xbefore setting up the filesystem snapshot. After the Xfilesystem snapshot has been set up, the services may be Xrestarted. X.PP XIf the the system that is going to be backed up is Xacting as a file server, it may be that services Xon remote clients cause inconsistent file states Xunless all such services that remotely access files Xare shut down before the snapshot is set up. X.PP X.B Star Xincludes options that help to deal with X.BR "file system snapshots" . XThe following example backs up a file system on Solaris using a Xfile system snapshot from UFS: X.PP X.B "echo > /tmp/snapstamp" X.sp X.B "mount -r `fssnap -F ufs -o \e X.br X.B "\ \ \ \ backing-store=/var/tmp/EXPORT-NFS.snap /export/nfs` /mnt X.sp X.B "star \-c \-xdev \-sparse \-acl \-link\-dirs level=0 \-wtardumps \e X.br X.B "\ \ \ \ f=\fIarchive-name\fP dumpdate=/tmp/snapstamp \e X.br X.B "\ \ \ \ fs-name=/export/nfs \-C /mnt . X.PP XFirst a file with a current time stamp is created, then a snapshot for X/export/nfs is created and mounted on /mnt. XThe following X.B star Xcommand then creates a level 0 backup from the file system using the Xtime the snapshot was created and the original mount point of the Xfile system for /etc/tardumps and the archive header. X.PP XNote that if the backup is done on a live file system, it may be Xunreliable. A typical problem problem in this context is caused Xby growing log files. XAs growing files are not a real problem with backups, the best way Xof dealing with growing files is to set up a X.B star Xerror control file (see X.B errctl= Xoption) and to tell X.B star Xto ignore growing files. X.SH "BACKUP SCHEDULES XFull (level 0) dumps should be made on a regular base X(e.g. once a month). XAs a full dump may take a long time and takes a lot of tape, Xit is wise to make higher level incremental dumps with shorter intervals. XThe next table shows a dump level list that may be used if Xmonthly full dumps take place: X.PP X.RS X.nf X.ta 12n 18n 24n 30n 36n 42n 48n X \f2Sun Mon Tue Wed Thu Fri\fP X\f2Week 1:\f3 0 10 10 10 10 5 X\f2Week 2:\f3 10 10 10 10 10 5 X\f2Week 3:\f3 10 10 10 10 10 5 X\f2Week 4:\f3 10 10 10 10 10 5 X\f1 X.fi X.RE X.DT X.PP XThe level 10 dumps made between Monday and Friday accumulate all Xchanges made within the week, but you only need to restore the Xlatest level 10 dump in order to get all changes back. XIf you don't like the size of the accumulated changes, Xuse the following backup schedule: X.PP X.RS X.nf X.ta 12n 18n 24n 30n 36n 42n 48n X \f2Sun Mon Tue Wed Thu Fri\fP X\f2Week 1:\f3 0 20 30 40 50 5 X\f2Week 2:\f3 10 20 30 40 50 5 X\f2Week 3:\f3 10 20 30 40 50 5 X\f2Week 4:\f3 10 20 30 40 50 5 X\f1 X.fi X.RE X.DT X.PP XNote that in this case, 7 dumps need to be restored if the Xa crash happens at the worst case date (just before the Friday dump Xin week 2 or later). X X.SH "INCREMENTAL RESTORES XIncremental restores should be made to an empty file system (except Xfor the X.B lost+found Xdirectory). X.B Star Xis currently unable to perform incremental restores to a Xfile system that contains active mount points. X.PP XIncremental restores should be run as X.B root Xuser. X.B Star Xsupports private incremental dumps and restores run as an unprivileged user, Xbut this mode has been tested less frequently. X.PP XThe incremental restore procedure starts with restoring the last Xfull (level 0) dump. Then the latest incremental dump of each Xdump level (with ascending order of dump levels) need to be restored. X.PP XLet us assume the first example from the section X.B "BACKUP SCHEDULES Xfor the backup schedule. If a disk Xcrash happens before the Thursday dump of week 3 has been made, Xthe following restore procedure needs to be applied: X.TP X.B level 0 Xstarting with an empty disk, the full (level 0) dump from week 1 Xis restored. X.TP X.B level 5 Xafter the level 0 restore has been finished, the level 5 dump from XFriday in week 2 is restored. X.TP X.B level 10 Xafter the level 5 restore has been finished, the level 10 dump from XWednesday in week 3 is restored. X.PP XThe disk now contains the same files as it did when the level 10 Xdump has been made on Wednesday of week 3. X.PP XTo extract a level 0 dump call: X.PP X.B "cd /\fIextract-filestem-mount-point\fP X.br X.B "star \-xpU \-restore f=\fIarchive-name\fP X.PP XThis creates the directory X.B star-tmpdir Xand the database X.B star-symtable Xin the root directory of the new file system. XSubsequent restores with higher level backups Xdepend on these files. X.PP XTo extract a level 1 (or higher) dump call: X.PP X.B "cd /\fIextract-filestem-mount-point\fP X.br X.B "star \-xpU \-restore f=\fIarchive-name\fP X.PP XIn order to restore a partial dump, the X.B \-partial Xoption needs to be specified. This is to make sure that the user understands Xthat renames to a path outside the scope of the partial dump may result in Xinconsistencies during a restore. X.PP XIn case there is a dump level mismatch or a reference date mismatch, Xit is possible to give a restore a chance by specifying the X.B \-force\-restore Xoption. X.PP XNote that the environment variable X.B STAR_DEBUG Xexists, X.B star Xdoes not remove files with link count 1 that have been Xremoved between incremental dumps. These files are moved to the Xdirectory X.BR star-tmpdir . XBefore you start to extract the next Xincremental, you need to remove all files in X.BR star-tmpdir . X X.SH "SYNCHRONIZING FILESYSTEMS X.PP X.B Star Xmay be used to synchronize filesystem content. XTo do this, an initial copy of the current content of the source Xfilesystem needs to be performed first. X.PP XTo create an initial copy of a filesystem call: X.PP X.B "star \-c \-xdev \-sparse \-acl \-link\-dirs level=0 \-wtardumps \e X.br X.B "\ \ \ \ \-C /\fIfilestem-mount-point\fP . | \e X.br X.B "\ \ \ \ star \-xpU \-restore -C /\fIextract-target-dir\fP X.PP XIn order to perform subsequent synchronization of the target filesystem Xwith the content of the source filesystem, a modified incremental dump/restore Xprocedure may be used. X.PP XTo copy incremental content of a filesystem call: X.PP X.B "star \-c \-xdev \-sparse \-acl \-link\-dirs level=1 \-wtardumps \e X.br X.B "\ \ \ \ \-cumulative \-C /\fIfilestem-mount-point\fP . | \e X.br X.B "\ \ \ \ star \-xpU \-restore -C /\fIextract-target-dir\fP X.PP XNote that like with backups in general, Xcopies from a live filesystem should be avoided. XOn operating systems that support X.BR "file system snapshots" , Xcopies should be made from a read-only mount of a Xsnapshot. Be careful that all files that have been Xcreated between setting up a snapshot and starting an Xincremental copy may be missing from all copies unless the X.BI dumpdate= name Xoption is used. X.PP XSee section X.B "INCREMENTAL BACKUPS Xto learn how to modify the command line in case X.B "file system snapshots" Xare used. X.SH SIGNALS X.PP XIf X.B star Xhandles a signal, it first prints the statistics. X.B Star Xhandles the following signals: X.TP 10 X.B SIGINT Xusually generated by ^C from the controlling tty. XUpon receipt of a SIGINT, X.B star Xprints statistics and exits. XIf in create mode i.e. storing files to archive, X.B star Xfinishes with the current file to ensure that no Xpartial file is written to the archive, write an eof record and then exits. X.TP 10 X.B SIGHUP Xnot to be generated from a tty. The actions are the same as upon receipt Xof a SIGINT. X.PD 0 X.TP 10 X.B SIGQUIT X.TP X.B SIGINFO X.PD Xusually generated by ^\\ from the controlling tty. XUpon receipt of a SIGQUIT, X.B star Xprints statistics and continues with the current operation. This is Xuseful to watch the progress of the current operation. X.SH "EXIT STATUS XThe following exit values are returned. Note that the negative values are only Xavailable to modern shells and programs that use X.BR waitid (2) Xon a X.B POSIX OS Xand thus can retrieve the full 32 bits of the X.B star Xexit code. The positive number variants are what you get when only the low X8 bits from the exit code are available. X.TP X.B 0 XAll files were processed successfully. X.br X.ne 3 X.TP X.B -4 / 252 X.B Star Xhas been interrupted in create mode and the end of star has been delayed Xuntil the current file has been archived completely. This error is only Xused in case that no other error occured and the tar archive only has Xbecome shorter than expected. X.br X.ne 3 X.TP X.B -3 / 253 X.B Star Xhas been called with the option X.BR \-e , Xor the X.B errctl= Xoption has been used to mark the current error fatal. X.br X.ne 3 X.TP X.B -2 / 254 XOne or more files could not be processed successfully. X.br X.ne 3 X.TP X.B -1 / 255 XCommand line parsing error. X.br X.ne 3 X.TP X.B >0 XOther positive exit codes: The X.B errno Xof the call that caused the fatal error. X.SH EXAMPLES X.PP XTo get a listing in a way similar to ls \-l one might use: X.IP X.B Xexample% star \-tv f=/dev/rmt/1bn X.PP XThe same command as listed above in a X.B "POSIX tar Xcommand line syntax compliant way is: X.IP X.B Xexample% star tvf /dev/rmt/1mbn X.PP XTo copy the directory tree in X.I /home/someuser Xto the directory X.I /home/fs Xuse: X.IP X.nf X.B Xexample% (cd /home/someuser; star \-c .) | (cd /home/fs ; star \-xp) X.fi X.PP Xor by using the change directory option of X.BR star : X.IP X.B X.nf Xexample% star \-c \-C /home/someuser . | star \-xp \-C /home/fs X.fi X.PP XNote that both examples above are not the optimum way to copy a Xdirectory tree. A more efficient way to copy a directory tree Xis to use the X.B \-copy Xoption. X.IP X.nf X.B Xexample% star \-copy \-p \-xdot \-C /home/someuser . /home/fs X.fi X.PP XTo copy a file tree including the X.B "Access Control List Xentries for all files and to correctly copy sparse (holey) files use: X.IP X.B X.nf Xexample% star \-copy \-p \-xdot \-acl \-sparse \-C /home/someuser . /home/fs X.fi X.PP XTo compare the content of a tape to the filesystem one might use: X.IP X.B Xexample% star \-diff \-v f=/dev/rmt/1bn X.PP XTo compare two directory trees one might use: X.IP X.B X.nf Xexample% star \-c . | star \-C todir \-diff \-v diffopts=!times X.fi X.PP Xor better by using a method similar to the X.B \-copy Xmethod above: X.IP X.B X.nf Xexample% star \-c \-diff \-v diffopts=!times \-C fromdir . todir X.fi X.PP XTo compare all properties of two file trees, use: X.IP X.B X.nf Xexample% star \-c \-diff \-vv \-dump \-acl \-sparse \-C fromdir . todir X.fi X.PP XTo extract a backup of the /usr tree without all files residing below X/usr/openwin one might use: X.IP X.B Xexample% star \-xp \-V pat=openwin/\\* f=/dev/rmt/1bn X.PP XTo extract all X.I .c Xfiles to X.BR src , Xall X.I .o Xfiles to X.B obj Xand all other files to /tmp one might use: X.IP X.B X.nf Xexample% star \-xp \-C src '*.c' \-C obj '*.o' \-C /tmp '*' f=/dev/rmt/1bn X.fi X.PP XTo extract files from a zipped X.B tar Xarchive that is located on a read only filesystem Xe.g. a CD while having the shell's working directory on the CD one might use: X.IP X.B Xexample% star \-zxp \-C /tmp f=star\-1.1.tar.gz X.PP Xto extract the files from the X.B tar Xarchive to the /tmp directory. X.PP XTo backup a list of files generated by the X.BR find (1) Xcommand: X.IP X.B X.nf Xexample% find . \fIfind_options\fP \-print | star \-c list=\- f=/dev/rmt/1bn X.fi X.PP XNote that this does not work if the file names from output of the X.B find Xcommand include new line characters. X.PP XTo extract a X.I tarfile Xthat contains a X.I tarfile Xone might use: X.IP X.B X.nf Xexample% star \-x \-to\-stdout f=/dev/rmt/1bn pat=\fIpat\fP | star \-xp X.fi X.PP X.I Pat, Xin this case should match the X.I tarfile Xin the X.I tarfile Xon tape that Xshould be extracted. X.PP XTo make a backup of the root filesystem to a tape drive connected to a Xremote machine, one might use: X.IP X.B Xexample# cd / X.br X.B X.nf Xexample# star \-cM fs=128m bs=63k f=tape@remotehost:/dev/rmt/1bn . X.fi X.PP XYou need a line in /etc/passwd like the following to enable this: X.IP X.B Xtape:NP:60001:60001:Tape:/etc/tapehome:/opt/schily/sbin/rmt X.PP XAnd a .rhosts file in /etc/tapehome to allow remote connections from Xthe appropriate hosts. XMake sure that the file /etc/default/rmt exists and allows remote access Xto the requested tape drive. X.PP XTo use a faster X.B rcmd(3) Xconnection for a backup to a remote tape server, one might use: X.IP X.B Xexample# env RSH='' star \-cM fs=128m bs=63k f=tape@remotehost:/dev/rmt/1bn . X.TP XNote that this requires root privileges. X X.PP XTo repair a corrupted filesystem for which no recent backup exists, Xdo the following: X.IP X.B Xexample# fsck \-y /filesys X.br X.B Xexample# mount /filesys X.br X.B Xexample# cd /filesys X.br X.B Xexample# star \-xpk f=/dev/rmt/1bn X.br X.B Xexample# mt \-f /dev/rmt/1bn rewind X.br X.B Xexample# star \-diff \-v diffopts=!times f=/dev/rmt/1bn X.PP XNow check the differences and decide whether to restore additional Xfiles. This may be done by generating a list containing the needed Xfilenames and using the list= option or by using the interactive mode X(see \-w option). X.PP XIf you want a list that only contains all filenames from files with Xdifferences you may use: X.IP X.B Xexample# star \-diff \-tpath diffopts=!times f=/dev/rmt/1bn X.PP XIf you are looking for files that changed the type or the access permission Xbecause this is a common case on still corrupted files, use: X.IP X.B Xexample# star \-diff \-tpath diffopts=type,perm f=/dev/rmt/1bn X.PP XIf you like to archive all directories only that are part of the directory Xtree under ".", use: X.IP X.B Xexample# star \-c f=\fIarchive-name\fP \-find . \-type d X.PP XIf you like to archive all files as owner root and group root and Xmake all files world readable in the archive, use: X.IP X.B Xexample# star \-c f=\fIarchive-name\fP \-find . \-chown root \-chgrp root \-chmod o+r X.PP XIf you like to archive all files with a mtime of X.BR now , Xuse: X.IP X.B Xexample# star \-c f=\fIarchive-name\fP \-find . \-chmtime now X.PP XIf you like to list all files in an archive in a way like X.BR sfind (1), Xinstead of the way used by star, use: X.IP X.B Xexample# star \-t f=\fIarchive-name\fP \-find . \-ls \-false X X.SH ENVIRONMENT X.TP X.B STAR_COMPRESS_FLAG XIf you like X.B star Xto always create compressed files that use maximum compression, you may set Xthe environment variable X.B STAR_COMPRESS_FLAG Xto \-9. X.TP X.B STAR_DEBUG XIf this environment variable is present, X.B star Xwill not remove temporary files from X.BR ./star-tmpdir . XThe files in this directory are files that have been removed by users Xbefore the last incremental dump did take place on the master filesystem. X.TP X.B STAR_FIFOSIZE XIf you like to by default let X.B star Xuse a different fifo size, set this environment variable to the desired size. X.TP X.B STAR_FSYNC XIf set to X.RB ` N ', Xthe default behavior of X.B star Xis as if the X.B \-no\-fsync Xoption has always been specified. X.sp XThis grants that X.B star Xis always faster than other archivers, but makes it impossible for X.B star Xto check whether the extracion of a file to the filesystem was successful. X.sp XIf set to any other value, Xthe default behavior of X.B star Xis as if the X.B \-do\-fsync Xoption has always been specified. X.sp XThe environment X.B STAR_FSYNC Xhas precedence over X.B /etc/default/star Xbut may still be overwritten by command line options. X.TP X.B STAR_WORKAROUNDS XIf this environment variable is present, Ximplement workarounds for named problems. XThe environment variable is expected to contain a comma separated list of Xbug names: X.RS X.TP X.B ssh-tcpip Ximplement a workaround for a bug caused by X.B ssh Xor X.B TCP-IP Xseen on Linux in 2003. XThe bug caused the verbose output from X.B star Xon X.B stderr Xto be lost when calling something like: X.sp X.B " ssh \c X.I host \c X.B 'star -c ...' X.sp XThe workaround is activated when X.B stderr Xis not connected to a terminal and works by waiting for 0.1\ seconds Xfor the output to appear. X.RE X.TP X.B TAPE XUnlike other X.BR tar (1) Ximplementations, X.B star Xdefaults to use stdin/stdout for the archive. XIf you like X.B star Xto use the file name from the X.B TAPE Xenvironment instead, you need to specify the X.B \-T Xoption too. X.TP X.B RSH XIf the X.B RSH Xenvironment is present, the remote connection will not be created via Xthe default method, but rather uses the program specified by X.BR RSH . XUse e.g. X.BR RSH= /path/to/ssh Xto create a secure shell connection using a specific X.B ssh Xversion. X.sp XIf the X.B RSH Xenvironment is not present, the compiled in default is used. XThis currently is X.BR ssh . X.sp XIf the X.B RSH Xenvironment is empty, then X.BR rcmd (3) Xis used. X.sp XFormer versions of X.B star Xby default did use X.BR rcmd (3) Xto create a remote connection. XUsing a different method forces X.B star Xto create a pipe to the X.B rsh(1) Xor X.B ssh (1) Xprogram and disallows X.B star Xto directly access the network socket to the remote server. XThis makes it impossible to work at maximum performance and slows down Xthe connection compared to a X.B root Xinitiated X.B rcmd(3) Xconnection. X.sp XSee X.B rsh= Xoption for more information. X.sp XSee BUGS section for more information. X.TP X.B RMT XIf the X.B RMT Xenvironment is present, the remote tape server will not be the program X.B /etc/rmt Xbut the program pointed to by X.BR RMT . XNote that the remote tape server program name will be ignored if you log in Xusing an account that has been created with a remote tape server program as Xlogin shell. X.sp XSee X.B rmt= Xoption for more information. X.SH FILES X.TP X.B "/etc/default/star XDefault values can be set for the following options in /etc/default/star. XFor example: X.SM CDR_FIFOSIZE=64m X.RS X.TP X.B STAR_FIFOSIZE XSets the default size of the FIFO (see also X.BR fs= # Xoption). X.TP X.B STAR_FIFOSIZE_MAX XSets the maximum size of the FIFO (see also X.BR fs= # Xoption). XSetting X.B STAR_FIFOSIZE_MAX Xin X.B "/etc/default/star Xallows to overwrite global values from backup scripts for machines Xwith less memory. X.TP X.B STAR_FSYNC XIf set to X.RB ` N ', Xthe default behavior of X.B star Xis as if the X.B \-no\-fsync Xoption has always been specified. X.sp XThis grants that X.B star Xis always faster than other archivers, but makes it impossible for X.B star Xto check whether the extracion of a file to the filesystem was successful. X.sp XIf you like to make the default fast, keep in mind that you need to specify X.B \-do\-fsync Xfor cases where X.B star Xneeds to be able to know whether the extraction was successful. X.TP X.B archive0= X.TP X.B archive1= X.TP X.B archive2= X.TP X.B archive3= X.TP X.B archive4= X.TP X.B archive5= X.TP X.B archive6= X.TP X.B archive7= XArchive entries for the X.B \-[0..7] Xoption. X.sp XA correct X.B archive?= Xline has 3..4 space separated entries. XThe first is the device entry (e.g. X.IR archive0=/dev/tape ). XThe second is the blocking factor in 512 byte units. XThe third is the maximum media size in 1024 byte units. XIf this entry contains a 0, then the media size is unlimited. XThe fourth entry is optional. If it contains a 'n' or a 'N', Xthen the archive device is not a tape. X.sp XExamples: X.sp Xarchive0=/dev/tape 512 0 y X.br Xarchive1=/dev/fd0 1 1440 n X.br Xarchive2=/dev/rmt/0mbn 512 0 X.sp XIf the default file does not need to be shared with the tar program from XSolaris, any number may be used like a generic size option like bs=. X.sp XExample: X.sp Xarchive0=/dev/tape 256k 40G y X.RE X.TP X.B "/etc/tardumps XThe default name for the dump level archive. The default name is used Xwhenever the X.BI tardumps= name Xoption has not been specified. XThe file is written or updated when X.B \-wtardumps Xis used. X.sp XThe file holds one or more lines, each specifying a dump level entry. XEach dump level entry starts with a mount point name followed by a XTAB and one or more spaces, followed by the decimal dump level, a space and Xthe dump time. X.sp XIf the dump level is directly followed by a 'P', then the dump refers to Xa partial dump (a dump that does not include the whole filesystem). X.sp XThe dump time itself includes the decimal representation of the UTC seconds Xsince Jan 01 1970, a space and the textual local time representation of the Xdump time. X.sp XThe numerical decimal dump time representation may be followed by a dot and Xa sub second value. XThe textual local time representation is for informational use by humans only Xand not evaluated by X.BR star . X.TP X.B ./star-symtable XContains a database that is needed in incremental restore mode. X.TP X.B ./star-symdump XContains an intermediate dump of restore database after a fatal error Xcondition was met during an incremental restore operation. X.TP X.B ./star-tmpdir XIs the temporary directory that is used as intermediate file storage by X.B star Xif in incremental restore mode. X.TP X.B ./star-lock XIs a lock file created by star when doing an incremental restore. XIf this file is present, it prevents X.B star Xfrom running another incremental restore operation. This helps to Xavoid more than one restore operation at a time (e.g. from a Xcron script). X.TP X.B "/dev/tty XIs used for the interactive user interface. X.SH "SEE ALSO" X.BR spax (1), X.BR suntar (1), X.BR scpio (1), X.BR tar (1), X.BR cpio (1), X.BR pax (1), X.BR rcp (1), X.BR mt (1), X.BR rmt (1), X.BR match (1), X.BR dd (1), X.BR sdd (1), X.BR rsh (1), X.BR ssh (1), X.BR star_sym (1), X.BR tartest (1), X.BR star (4), X.BR rcmd (3), X.BR fssnap (1m) X.SH DIAGNOSTICS Xstar: f records + p bytes (total of x bytes = d.nnk). X.PP XThe number of full records, the number of bytes in partial records Xand the total amount of data in KBytes. X.PP Xstar: Total time x.yyysec (z kBytes/sec) X.PP XThe time used and the transfer speed from/to the archive. X.PP XIf there have been non fatal errors during the archive processing, X.B star Xwill display a delayed error summary before exiting. X X.SH NOTES X.PP XThe command line syntax for the tar command (as defined in SUSv2 - UNIX-98) Xdeviates from the command line syntax defined for all other commands. While the X.B "POSIX command line syntax Xrequests Xall options to start with a dash (\-) and allows to either write options separately Xor combined (in case of boolean flags), the X.B tar Xcommand line syntax Xrequires all options to be combined into a single string that does not start with Xa dash. X.B Star Xby default assumes a command line syntax like a typical POSIX command and includes Xa compatibility mode that allows to specify a command line syntax as documented Xfor the X.B UNIX-98 tar Xcommand. XIf you believe that you found a bug in the way X.B star Xparses the command line, please first check your command line for correctness before Xyou make a bug report for X.BR star . X.PP XIf you like to write portable shell scripts that call tar, use the X.B UNIX-98 tar Xcommand line syntax (i.e. a single option string and no dash), choose the Xcommands and options from the following set of characters ( X.I "rxtuc vxfblmo" X) and check the shell script with both, your local tar and X.B star Xfor correct behavior. It you expect the script to call gnutar, do not include Xthe X.B \-o Xoption as gnutar implements this option in a way that violates UNIX-98. X.PP X.B Star Xstrips leading ./ sequences from pathnames. This lets X.B star Xin many cases store longer pathnames than other implementations. X.PP XThe POSIX.1\-1988 method (ustar format) of storing files with pathnames that are Xlonger than 100 chars has some limitations: X.IP XThe name field (100 chars) an inserted slash (`/') Xand the prefix field (155 chars) produce Xthe pathname of the file. When recreating the original filename, Xname and prefix are concatenated, using Xa slash character in the middle. If a pathname does not fit in the Xspace provided or may not be split at a slash character so that the Xparts will fit into 100 + 155 chars, the file may not be archived. XLinknames longer than 100 chars may not be archived too. X.PP XThe X.IR star , X.IR xstar , X.IR xustar , X.IR exustar , X.IR pax , Xand X.I gnutar Xarchive formats don't have these limitations. While gnutar uses a Xmethod that makes it impossible for other X.B tar Ximplementations (except X.BR star ) Xto restore filenames that are longer than 100 chars, the X.IR xstar , X.IR xustar , X.IR exustar Xand X.IR pax / epax Xarchive format uses a method that allows an POSIX.1\-1988 compliant way of Xstoring filenames, if the POSIX method would allow this. XWhen the archive format is X.IR xustar , X.IR exustar Xor X.IR pax / epax Xvery long filenames are stored using extended headers from the POSIX.1\-2001 standard. X.PP XSome buggy X.B tar Ximplementations will generate incorrect filenames Xduring a restore operation if the archive contains pathnames or linknames of Xexactly 100 chars length. X.PP X.B Star Xadds a X.I tar Xsignature in the last four bytes of each X.B tar Xheader if the archive format is X.I star Xor X.IR xstar . XThis is no problem Xwith the X.B star Xarchive format as it is an extension of the old pre POSIX.1\-1988 tar format. XOn the other side, the X.B xstar Xarchive format claims to be as POSIX.1\-1988 compliant as possible. XInserting this X.I tar Xsignature is a minor deviation from the standard that has the last 12 bytes Xof each header reserved for future use. On the other side, X.B tar Ximplementations Xsuch as some X.B pax Ximplementations that only compute checksums on the first 500 bytes of the header Xare violating the standard that requests the checksum to be computed on all X512 bytes of the tar header. All X.B tar Ximplementations that are 100% Posix Xcompliant will be able to extract X.B xstar Xarchives as long as no new standard is defined that claims the last 12 bytes Xof the header for a different use. XBut then the X.B "ustar version Xnumber should be changed from `00' Xto `01'. XNow, that the POSIX\-2001 standard has been accepted, it is even predictable Xthat all extensions to the standard X.B tar Xformat will go into the POSIX.1\-2001 extended headers Xwhich are extensible to include any feature without future limitation. XThe only known X.B tar Ximplementation that also uses the last 12 bytes of the X.B tar Xheader is Sun's X.B tar Xwhich uses these 12 bytes for files that are split over Xseveral archives. Such archives created by Sun's tar are not Xreadable by the buggy X.B pax Ximplementation too. The Sun extension is not incompatible to the X.B star Xsignature because Sun expects an octal number at the beginning of the X12 byte field which is a null character in the X.B star Xcase. X.PP X.B Star Xuses these four bytes since 1985 without problems. XIf you need a 100% POSIX.1\-1988 and 100% POSIX.1\-2001 compliant tar archive, Xyou may use the X.IR xustar , X.IR exustar Xor the X.IR pax / epax Xarchive format. XThe probability of falsely detecting other X.B tar Xformats as X.B xustar Xor X.B exustar Xformat however is higher. X.PP XThere is no way to ask for the X.IR n \-th Xoccurrence of a file. X.PP XThe way EOF is handled by X.B star Xdiffers, whether the fifo is in effect or not. XIf the fifo is not used, X.B star Xstops reading the archive if it Xencounters a logical EOF record in the archive. XIf the fifo is used, X.B star Xmay read until the fifo is full or until the real EOF mark on tape is reached. XHow much data X.B star actually reads depends on the time when the X.B star Xforeground process sends a fifo shutdown signal to the background fifo read Xprocess. X.PP XGnu tar often creates X.B tar Xarchives with incorrect logical EOF marks. XThe standard requires two blocks that are completely zeroed, whereas gnutar Xoften only adds one of them. X.PP XOld versions of X.B tar Xfound on SYSVr3 and earlier cannot read X.B tar Xarchives Xwith a blocksize greater than 10\ kBytes. X.PP XThe method of storing X.I sparse Xfiles currently used with the X.I star Xand X.I xstar Xformat is not guaranteed to be used in later versions of X.BR star . XIf the author decides to change this method, later versions of X.B star Xmay not be able to restore sparse files from X.B tar Xarchives made by the current version of X.BR star . X.PP XSome X.B tar Ximplementations violate the standard in using only the first 500 XBytes of the header for checksum computation. These X.B tar Ximplementations Xwill not accept X.I star Xand X.I xstar Xtype X.B tar Xarchives. X.PP XSun's Solaris 2.x X.B tar Ximplementation violates the Posix standard. Tar Xarchives generated by X.B star Xcause Sun's X.B tar Xto print tar: impossible file type messages. You may Xignore these messages. X.PP XGnutar's dumpdirs are non standard and are currently not implemented. X.PP XIf gnutar archives sparse files with more than four holes, it produces Xarchives that violate the standard in a way that prevents other X.B tar Ximplementations to read these archives. X.B Star Xknows about that and is able to handle these gnutar archives. X.PP XThe filetype X.I N X(LF_NAMES) from gnutar (an obsolete method of storing long names) will never be Ximplemented. X.PP XNote that on operating systems (like DOS) that do not implement real pipes, X.B star Ximplements compression via a temporary file. XUsing compression thus is limited by the maximum file size and the available Xdisk space. X.PP XThe extended file flags implementation (see X.B \-xfflags Xoption) Xon Linux is buggy by design. XIn order to retrieve the needed information, every file needs to be opened. XIf the /dev directory is included in create mode, every possible driver will be Xloaded which may hang the system for a long time. In the worst case, unwanted Xside effects from opening devices (such as causing tape drives to rewind the media) Xmay be caused. X X.SH "SECURITY NOTES XIf you unpack a tar archive in a non empty directory, any file in that directory Xmay be overwritten unless you specify the X.B \-k Xoption. XIf the archive contains symbolic links or hard links, X.B star Xmay even overwrite files outside the current directory. XIf the directory where the archive is been unpacked is not empty and Xcontains contains symbolic links or hard links to directories outside that Xdirectory, X.B star Xmay also overwrite files outside the current directory. XAs many other commands, X.B star Xusually has all possible permissions when run as root. XUnpacking archives as root thus may have fatal results to any file on your system. XBe very careful when you try to extract an archive that has not been Xcreated by you. It is possible to create hand crafted tar archives that may overwrite Xcritical files (like /etc/passwd) on your system. XIn addition all tar archives that have been created with the X.B list= Xoption and tar archives where the X.B C= Xoption was not specified before all file type arguments may be critical. X.PP XA good advise is to extract all doubtful archives as non root in an empty Xdirectory and to neither specify the X.B \-/ Xnor X.B \-.. Xor X.B \-no\-secure\-links Xoptions. XIf you get a warning, you should unpack the archive a second time and specify the Xoptions X.BR \-k ", " \-w " and " \-nowarn Xin addition to the options used for the first run. X.SH SUID NOTES XIf X.B star Xis installed suid root, X.B star Xis able to make connections to remote archives for non root users. XThis is done by using the Xrcmd(3) interface to get a connection to a rmt(1) server. X.PP X.B Star Xresets its effective uid back to the real user id immediately after setting up Xthe remote connection to the rmt server and before opening any other file. X.PP XIf X.B star Xhas not been installed suid root and not called by root, it will try to create Xthe remote connection via X.B rsh(1) Xor X.B ssh(1) X(in case the environment X.B RSH Xhas been set to X.BR ssh ). XNote that in this case, the throughput to the remote tape server will be much Xlower than with a connection that has been initiated via X.BR rcmd(3) . X.SH LIMITATIONS XIf X.B star Xis running on a large file aware platform, X.B star Xis able to handle files up to 8 GB in a mode that is compliant to the POSIX.1\-1988 X.B ustar Xformat. With a nonstandard X.B star Xspecific extension, up to 95 bits may be used to code the filesize. XThis will handle files up to 200,000,000 TB. XWith the new POSIX.1\-2001 extended headers Xused by the X.IR xustar , X.I exustar Xand X.IR pax / epax Xformat, any filesize may be archived. X.SH BUGS XThe fact that the X.B \-f Xoption has to be implemented in a way that is compatible with old tar Ximplementations gives several problems. XThe options X.BR \-fifostats , X.BR \-force\-hole , X.B \-force\-remove Xand X.B \-fifo Xinterfere with the X.B \-f Xoption and the fact that they exist prevents users from using filenames like Xe.g. X.B ifo Xusing the traditional way where the filename directly follows the string X.B \-f Xwithout any space between the option name and the file name. XHowever, there is no problem to use a file named X.B ifo Xby by calling X.BR "\-f ifo" , X.BR f=ifo , X.BR \-f=ifo Xor X.BR "\-f= ifo" . XBe careful not to make typos with the above options. The result could be Xthat a file is created as a result of the mistyped option. X.PP XThere is currently no way to set the fifo lowwater and highwater marks. X.PP XIf you ever discover a hang in the X.B fifo Xof star, get the process ids for both star processes, send both a X.B RTMAX Xsignal using X.BR kill (1) Xand report the disgnostic output. X.PP XThere is currently no way to automatically delete files in the target file tree Xif they are obsolete. X.B Star Xshould implement something similar to gnutar's dumpdirs. X.PP XIf not invoked by the super user X.B star Xmay not be able to extract files Xif they reside in read only directories. X.PP X.B Star Xis not able to make a complete backup of a filesystem if files Xare hidden by a mount that is in effect on a directory of this Xfilesystem. XThis may be avoided in case of the ufs filesystem Xif the backup is made off a ufs snapshot (see the man page for X.BR fssnap (1m) XIt could be avoided for any filesystem if the loopback filesystem had an Xoption that tells X.I lofs Xnot to traverse mountpoints. X.PP XFor now (late 2002), we know that the following programs Xare broken and do not implement signal handling correctly: X.TP Xrsh Xon SunOS-5.0...SunOS-5.9 X.TP Xssh Xfrom ssh.com X.TP Xssh Xfrom openssh.org X.LP XSun already did accept a bug report for X.BR rsh (1) / ssh(1) . XOpenssh.org accepted and fixed Xa bug for their implementation of X.BR ssh (1). X.LP XIf you use X.B star Xto create a remote connection via an unfixed X.BR rsh (1) Xor X.BR ssh (1), Xbe prepared that terminal generated signals may interrupt the Xremote connection. X X.SH HISTORY XA X.B tar Xcommand appeared in Seventh Edition Unix, which was released in XJanuary, 1979. It replaced the X.B tp Xprogram from Fourth Edition Unix which replaced the X.B tap Xprogram from First Edition Unix. X.LP X.B Star Xwas first created in 1982 to extract tapes on a UNIX clone X.RB ( UNOS ) Xthat had no X.B tar Xcommand. XIn 1985 the first fully functional version has been released as X.B mtar. X.PP XWhen the old X.B star Xformat extensions have been introduced in 1985, it was renamed to X.B star X(Schily tar). XIn 1994, Posix 1003.1\-1988 extensions were added and X.B star Xwas renamed to X.B star X(Standard tar). X X.SH AUTHOR X.nf XJ\*org Schilling XSeestr. 110 XD\-13353 Berlin XGermany X.fi X.PP XMail bugs and suggestions to: X.PP X.B Xjoerg.schilling@fokus.fraunhofer.de Xor X.B Xjoerg@schily.net X X.SH "SOURCE DOWNLOAD" XThe source code for X.B star Xis in the star project at Sourceforge at: X.LP X.B X http://sourceforge.net/projects/s-tar/ X.LP XThe download directory is: X.LP X.B X http://sourceforge.net/projects/s-tar/files/ X.LP XFrequent development snapshots of the X.B star Xsource are also included in the X.B schilytools Xproject and may be retrieved from the X.B schilytools Xproject at Sourceforge at: X.LP X.B X http://sourceforge.net/projects/schilytools/ X.LP XThe download directory is: X.LP X.B X http://sourceforge.net/projects/schilytools/files/ X.LP XCheck for the X.B schily\-*.tar.bz2 Xarchives. END-of-star-1.6/star/star.1 echo x - star-1.6/star/pax.c sed 's/^X//' >star-1.6/star/pax.c << 'END-of-star-1.6/star/pax.c' X/* @(#)pax.c 1.41 19/03/27 Copyright 1989, 2003-2019 J. Schilling */ X#include X#ifndef lint Xstatic const char _p_sccsid[] = X "@(#)pax.c 1.41 19/03/27 Copyright 1989, 2003-2019 J. Schilling"; X#endif X/* X * PAX specific routines for star main program. X * X * Copyright (c) 1989, 2003-2019 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifdef STAR_MAIN X/* X * We have been included from star.c X */ X#define opts pax_opts X#define _opts _pax_opts X#define gargs pax_gargs X#define susage pax_susage X#define usage pax_usage X#define xusage pax_xusage X#else X#define NO_STAR_MAIN X#define PAX_MAIN X#define PTYPE_DEFAULT P_PAX X X#include "star.c" X#endif X XLOCAL void gargs __PR((int ac, char *const *av)); XLOCAL void susage __PR((int ret)); XLOCAL void usage __PR((int ret)); XLOCAL void xusage __PR((int ret)); X#ifdef STAR_MAIN XLOCAL void pax_setopts __PR((char *o)); X#endif X X/* X * -r Read tar x X * -w Write tar c X * -a Append -w -a tar r X * Update -w -a -u tar u X * X * -b Blocksize in Bytes X * -c Invert match for pattern and files X * -d Do not descend dirs X * -f Archive File X * -i Interactive Rename X * -k Noklobber X * -l Create hard links in copy mode X * -n Select first archive member per pattern only X * -o Future Options X * -p Privilleges: X * e everything X * a Do NOT preserve access time X * m Do NOT preserve mod time X * o Preserve UID/GID X * p Preserve perm X * -s Substitution X * -t Reset access time X * -u Gegenteil von -U X * -v List Verbose X * -x Archive Format X * -X Wie star -M X * X * -H SUSv3 X * -L SUSv3 X */ X X/* X * PAX related options X * X * The official POSIX options start after the -bz/-lzo/-7z/-xz/-lzip/-zstd option. X */ X/* BEGIN CSTYLED */ Xchar _opts[] = "help,xhelp,version,debug,xdebug#,xd#,time,no-statistics,do-statistics,fifostats,numeric,no-fifo,no-fsync,do-fsync%0,bs&,fs&,/,..,secure-links,no-secure-links%0,acl,xfflags,z,bz,lzo,7z,xz,lzip,zstd,r,w,a,b&,c,d,f&,H,i,k,L,l,n,o*,p&,s&,t,u,v+,x&,artype&,X"; X/* END CSTYLED */ Xchar *opts = _opts; X#ifdef NO_STAR_MAIN Xstruct ga_props gaprops; X#endif X XLOCAL void pax_info __PR((void)); X XLOCAL void Xgargs(ac, av) X int ac; X char *const *av; X{ X int files = 0; X BOOL help = FALSE; X BOOL xhelp = FALSE; X BOOL prvers = FALSE; X BOOL no_fifo = FALSE; X BOOL paxrflag = FALSE; X BOOL paxwflag = FALSE; X BOOL paxaflag = FALSE; X BOOL paxtflag = FALSE; X BOOL paxdflag = FALSE; X BOOL paxiflag = FALSE; X BOOL paxlflag = FALSE; X char *paxopts = NULL; X BOOL paxuflag = FALSE; X BOOL do_stats = FALSE; X X /* X * Current default archive format in all other cases is USTAR. X * We may change this to PAX in the future. X */ X hdrtype = H_USTAR; X#ifdef STAR_MAIN X pax_setopts(opts); /* set up opts for getfiles */ X#endif X getarginit(&gaprops, GAF_SINGLEARG); /* POSIX combined args */ X X iftype = I_PAX; /* command line interface */ X ptype = P_PAX; /* program interface type */ X paxls = TRUE; X paxmatch = TRUE; X nopflag = TRUE; /* pax default */ X no_stats = TRUE; /* -no-statitstics */ X nochown = TRUE; /* chown only with -po / -pe */ X X if (pname) { /* cli=xxx seen as argv[1] */ X --ac, av++; X } X --ac, ++av; X files = getfilecount(ac, av, opts); X if (getlallargs(&ac, &av, &gaprops, opts, X &help, &xhelp, &prvers, &debug, &xdebug, &xdebug, X#ifndef __old__lint X &showtime, &no_stats, & do_stats, &do_fifostats, X &numeric, &no_fifo, &no_fsync, &no_fsync, X getenum, &bs, X getenum, &fs, X &abs_path, &allow_dotdot, X &secure_links, &secure_links, X &doacl, &dofflags, X &zflag, &bzflag, &lzoflag, X &p7zflag, &xzflag, &lzipflag, &zstdflag, X &paxrflag, X &paxwflag, X &paxaflag, X getenum, &bs, X ¬arg, /* -c */ X &paxdflag, /* -d */ X addtarfile, NULL, /* -f */ X &paxHflag, /* -H */ X &paxiflag, /* -i */ X &keep_old, /* -k */ X &paxfollow, /* -L */ X &paxlflag, /* -l */ X &paxnflag, /* -n */ X &paxopts, /* -o */ X getpaxpriv, NULL, /* -p */ X parsesubst, &do_subst, /* -s */ X &paxtflag, /* -t */ X &paxuflag, /* -u */ X &verbose, /* -v */ X gethdr, &chdrtype, /* -x */ X gethdr, &chdrtype, /* artype= */ X#endif /* __old__lint */ X &nomount) < 0) { X errmsgno(EX_BAD, "Bad Option: %s.\n", av[0]); X susage(EX_BAD); X } X star_helpvers("spax", help, xhelp, prvers); X X if (!paxrflag && !paxwflag) { X tflag = TRUE; X } else if (paxrflag && paxwflag) { X copyflag = TRUE; X if (files == 1) X listfile = "-"; X } else if (paxwflag && paxaflag) { X if (paxuflag) X uflag = TRUE; X else X rflag = TRUE; X } else if (paxwflag) { X cflag = TRUE; X if (files == 0) X listfile = "-"; X } else { X xflag = TRUE; X } X X if ((cflag || uflag || rflag || copyflag) && paxtflag) X acctime = TRUE; X X if (paxdflag) { X /* XXX nodesc aber mit pattern match bei extract */ X nodesc = TRUE; X } X if (paxiflag) { X interactive = TRUE; X paxinteract = TRUE; X } X if (paxlflag) { X /* link bei -copy */ X errmsgno(EX_BAD, "Unsupported option -l.\n"); X susage(EX_BAD); X } X uncond = !paxuflag; X X if (do_stats) X no_stats = FALSE; X X star_checkopts(/* oldtar */ FALSE, /* dodesc */ TRUE, X /* usetape */ FALSE, X /* archive */ -1, no_fifo, X paxopts, X /* llbs */ 0); X X nolinkerr = FALSE; X} X XLOCAL void Xpax_info() X{ X const char *n = pname ? pname : get_progname(); X X error("\nFor a more complete user interface use the tar type command interface.\n"); X error("See 'man star'. The %s command is more or less limited to the\n", n); X error("POSIX standard pax command line interface.\n"); X} X X/* X * Short usage X */ XLOCAL void Xsusage(ret) X int ret; X{ X const char *n = pname ? pname : get_progname(); X X error("Usage:\t%s cmd [options] file1 ... filen\n", n); X error("\nUse\t%s -help\n", n); X error("and\t%s -xhelp\n", n); X error("to get a list of valid cmds and options.\n"); X error("\nUse\t%s -x help\n", n); X error("to get a list of valid archive header formats.\n"); X pax_info(); X exit(ret); X /* NOTREACHED */ X} X XLOCAL void Xusage(ret) X int ret; X{ X const char *n = pname ? pname : get_progname(); X X error("Usage:\t%s cmd [options] file1 ... filen\n", n); X error("Cmd:\n"); X error("\t\t\tlist named files from tape\n"); X error("\t-r\t\textract named files from tape\n"); X error("\t-w\t\twrite archive with named files to tape\n"); X error("\t-w -a\t\tupdate/replace named files to tape\n"); X error("\t-r -w\t\tcopy named files to destination directory\n"); X error("Options:\n"); X error("\t-help\t\t(*) print this help\n"); X error("\t-xhelp\t\t(*) print extended help\n"); X error("\t-version\t(*) print version information and exit\n"); X error("\t-b #\t\tset blocking factor to # Bytes (default 10240)\n"); X error("\t-c\t\tinvert matching rules\n"); X error("\t-d\t\tdo not descend directories\n"); X error("\t-f nm\t\tuse 'nm' as tape instead of stdin/stdout\n"); X error("\t-H\t\tfollow symbolic links from cmdline as if they were files\n"); X error("\t-i\t\tdo interactive creation/extraction/renaming\n"); X error("\t-k\t\tkeep existing files\n"); X error("\t-l\t\tlink files rather than copying them\n"); X error("\t-L\t\tfollow symbolic links as if they were files\n"); X error("\t-n\t\tone match per pattern only\n"); X error("\t-o\t\toptions (none specified with SUSv2 / UNIX-98)\n"); X error("\t-p string\tset privileges\n"); X error("\t-s replstr\tApply ed like pattern substitution -s /old/new/gp on filenames\n"); X error("\t-t\t\trestore atime after reading files\n"); X error("\t-u\t\treplace/restore files only if they are newer\n"); X error("\t-v\t\tincrement verbose level\n"); X error("\t-x header\tgenerate 'header' type archive (see -x help)\n"); X error("\tartype=header\t(*) generate 'header' type archive (see artype=help)\n"); X error("\t-X\t\tdo not descend mounting points\n"); X error("\t-z\t\t(*) pipe input/output through gzip, does not work on tapes\n"); X error("\t-bz\t\t(*) pipe input/output through bzip2, does not work on tapes\n"); X error("\t-lzo\t\t(*) pipe input/output through lzop, does not work on tapes\n"); X error("\t-7z\t\t(*) pipe input/output through p7zip, does not work on tapes\n"); X error("\t-xz\t\t(*) pipe input/output through xz, does not work on tapes\n"); X error("\t-lzip\t\t(*) pipe input/output through lzip, does not work on tapes\n"); X error("\t-zstd\t\t(*) pipe input/output through zstd, does not work on tapes\n"); X#ifdef FIFO X error("\t-no-fifo\t(*) don't use a fifo to optimize data flow from/to tape\n"); X#endif X error("\nAll options marked with (*) are not defined by POSIX.\n"); X pax_info(); X exit(ret); X /* NOTREACHED */ X} X XLOCAL void Xxusage(ret) X int ret; X{ X const char *n = pname ? pname : get_progname(); X X error("Usage:\t%s cmd [options] file1 ... filen\n", n); X error("Extended options:\n"); X error("\t-debug\t\tprint additional debug messages\n"); X error("\txdebug=#,xd=#\tset extended debug level\n"); X error("\t-/\t\tdon't strip leading '/'s from file names\n"); X error("\t-..\t\tdon't skip filenames that contain '..' in non-interactive extract\n"); X error("\t-secure-links\tdon't extract links that start with '/' or contain '..' (default)\n"); X error("\t-no-secure-links\textract links that start with '/' or contain '..'\n"); X error("\t-acl\t\thandle access control lists\n"); X error("\t-xfflags\thandle extended file flags\n"); X error("\tbs=#\t\tset (output) block size to #\n"); X#ifdef FIFO X error("\tfs=#\t\tset fifo size to #\n"); X#endif X error("\t-no-fsync\tdo not call fsync() for each extracted file (may be dangerous)\n"); X error("\t-do-fsync\tcall fsync() for each extracted file\n"); X error("\t-time\t\tprint timing info\n"); X error("\t-no-statistics\tdo not print statistics\n"); X error("\t-do-statistics\tprint statistics\n"); X#ifdef FIFO X error("\t-fifostats\tprint fifo statistics\n"); X#endif X error("\t-numeric\tdon't use user/group name from tape\n"); X error("\nAll options above are not defined by POSIX.\n"); X exit(ret); X /* NOTREACHED */ X} X X#ifdef STAR_MAIN X#undef opts X#undef _opts X#undef gargs X#undef susage X#undef usage X#undef xusage X XLOCAL void Xpax_setopts(o) X char *o; X{ Xextern char *opts; X opts = o; X} X#endif END-of-star-1.6/star/pax.c echo x - star-1.6/star/xheader.c sed 's/^X//' >star-1.6/star/xheader.c << 'END-of-star-1.6/star/xheader.c' X/* @(#)xheader.c 1.99 19/03/09 Copyright 2001-2019 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)xheader.c 1.99 19/03/09 Copyright 2001-2019 J. Schilling"; X#endif X/* X * Handling routines to read/write, parse/create X * POSIX.1-2001 extended archive headers X * X * Copyright (c) 2001-2019 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include /* getpagesize() */ X#include /* getpagesize() */ X#include "star.h" X#include "props.h" X#include "table.h" X#include X#include X#include X#define __XDEV__ /* Needed to activate _dev_major()/_dev_minor() */ X#include X#define GT_COMERR /* #define comerr gtcomerr */ X#define GT_ERROR /* #define error gterror */ X#include X#include X#include "starsubs.h" X#include "movearch.h" X#include "xtab.h" X#include "pathname.h" X Xextern BOOL no_xheader; Xextern BOOL nowarn; Xextern BOOL binflag; X Xextern GINFO *grip; /* Global read info pointer */ X X#define MAX_UNAME 64 /* The maximum length of a user/group name */ X X/* X * Flags for gen_text() X */ X#define T_ADDSLASH 1 /* Add slash to the argument */ X#define T_UTF8 2 /* Convert arg to UTF-8 coding */ X Xtypedef struct _unknown unkn_t; X Xstruct _unknown { X unkn_t *u_next; X char u_name[1]; X}; X XLOCAL void _xbinit __PR((void)); XEXPORT void xbinit __PR((void)); XLOCAL void xbgrow __PR((int newsize)); XEXPORT void xbbackup __PR((void)); XEXPORT void xbrestore __PR((void)); XEXPORT int xhsize __PR((void)); XLOCAL void write_xhdr __PR((int type)); XEXPORT void info_to_xhdr __PR((FINFO * info, TCB * ptb)); XLOCAL void check_xtime __PR((char *keyword, FINFO *info)); XEXPORT void gen_xtime __PR((char *keyword, time_t sec, Ulong nsec)); XEXPORT void gen_unumber __PR((char *keyword, Ullong arg)); XEXPORT void gen_number __PR((char *keyword, Llong arg)); XLOCAL void gen_iarray __PR((char *keyword, ino_t *arg, int ents, int len)); XEXPORT void gen_text __PR((char *keyword, char *arg, int alen, X Uint flags)); XLOCAL int len_len __PR((int len)); XLOCAL xtab_t *lookup __PR((char *cmd, int clen, xtab_t *cp)); XEXPORT int tcb_to_xhdr __PR((TCB * ptb, FINFO * info)); XEXPORT BOOL xhparse __PR((FINFO *info, char *p, char *ep)); XLOCAL void print_unknown __PR((char *keyword)); XEXPORT void xh_rangeerr __PR((char *keyword, char *arg, int len)); XLOCAL void print_toolong __PR((char *keyword, char *arg, int len)); XLOCAL void get_xvolhdr __PR((FINFO *info, char *keyword, int klen, char *arg, int len)); XLOCAL void info_xcopy __PR((FINFO *ninfo, FINFO *oinfo)); XEXPORT BOOL get_xtime __PR((char *keyword, char *arg, int len, X time_t *secp, long *nsecp)); XLOCAL void get_atime __PR((FINFO *info, char *keyword, int klen, char *arg, int len)); XLOCAL void get_ctime __PR((FINFO *info, char *keyword, int klen, char *arg, int len)); XLOCAL void get_mtime __PR((FINFO *info, char *keyword, int klen, char *arg, int len)); X#ifdef __needed_ XEXPORT BOOL get_number __PR((char *keyword, char *arg, Llong *llp)); X#endif XLOCAL BOOL get_xnumber __PR((char *keyword, char *arg, Ullong *llp, char *type)); XEXPORT BOOL get_unumber __PR((char *keyword, char *arg, Ullong *ullp, Ullong maxval)); XEXPORT BOOL get_snumber __PR((char *keyword, char *arg, Ullong *ullp, BOOL *negp, Ullong minval, Ullong maxval)); XLOCAL void get_uid __PR((FINFO *info, char *keyword, int klen, char *arg, int len)); XLOCAL void get_gid __PR((FINFO *info, char *keyword, int klen, char *arg, int len)); XLOCAL void get_uname __PR((FINFO *info, char *keyword, int klen, char *arg, int len)); XLOCAL void get_gname __PR((FINFO *info, char *keyword, int klen, char *arg, int len)); XLOCAL void get_path __PR((FINFO *info, char *keyword, int klen, char *arg, int len)); XLOCAL void get_lpath __PR((FINFO *info, char *keyword, int klen, char *arg, int len)); XLOCAL void get_size __PR((FINFO *info, char *keyword, int klen, char *arg, int len)); XLOCAL void get_realsize __PR((FINFO *info, char *keyword, int klen, char *arg, int len)); XLOCAL void get_offset __PR((FINFO *info, char *keyword, int klen, char *arg, int len)); XLOCAL void get_major __PR((FINFO *info, char *keyword, int klen, char *arg, int len)); XLOCAL void get_minor __PR((FINFO *info, char *keyword, int klen, char *arg, int len)); XLOCAL void get_minorbits __PR((FINFO *info, char *keyword, int klen, char *arg, int len)); XLOCAL void get_dev __PR((FINFO *info, char *keyword, int klen, char *arg, int len)); XLOCAL void get_ino __PR((FINFO *info, char *keyword, int klen, char *arg, int len)); XLOCAL void get_nlink __PR((FINFO *info, char *keyword, int klen, char *arg, int len)); XLOCAL void get_filetype __PR((FINFO *info, char *keyword, int klen, char *arg, int len)); X#ifdef USE_ACL XLOCAL void get_acl_type __PR((FINFO *info, char *keyword, int klen, char *arg, int len)); XLOCAL void get_acl_access __PR((FINFO *info, char *keyword, int klen, char *arg, int len)); XLOCAL void get_acl_default __PR((FINFO *info, char *keyword, int klen, char *arg, int len)); XLOCAL void get_acl_ace __PR((FINFO *info, char *keyword, int klen, char *arg, int len)); X#endif X#ifdef USE_XATTR XLOCAL void get_attr __PR((FINFO *info, char *keyword, int klen, char *arg, int len)); X#endif X#ifdef USE_FFLAGS XLOCAL void get_xfflags __PR((FINFO *info, char *keyword, int klen, char *arg, int len)); X#endif XLOCAL void get_dir __PR((FINFO *info, char *keyword, int klen, char *arg, int len)); XLOCAL void get_iarray __PR((FINFO *info, char *keyword, int klen, char *arg, int len)); XLOCAL void get_release __PR((FINFO *info, char *keyword, int klen, char *arg, int len)); XLOCAL void get_archtype __PR((FINFO *info, char *keyword, int klen, char *arg, int len)); XLOCAL void get_hdrcharset __PR((FINFO *info, char *keyword, int klen, char *arg, int len)); XLOCAL void get_dummy __PR((FINFO *info, char *keyword, int klen, char *arg, int len)); XLOCAL void unsup_arg __PR((char *keyword, char *arg)); XLOCAL void bad_utf8 __PR((char *keyword, char *arg)); X X/* X * Convert unsigned integer into a decimal string. X * The parameter 'val' is of the needed size (basic type), so it is as fast X * as possible. X * X * The string is written starting from the end backwards for best speed. X */ XLOCAL Uchar dtab[] = "0123456789"; X X#define ui2decimal(val, np) do { \ X *--(np) = dtab[(val) % (unsigned)10]; \ X (val) = (val) / (unsigned)10; \ X } while ((val) > 0) X X#define scopy(to, from) while ((*(to)++ = *(from)++) != '\0') X X XLOCAL char *xbuf; /* Space used to prepare I/O from/to extended headers */ XLOCAL int xblen; /* the length of the buffer for the extended headers */ XLOCAL int xbidx; /* The index where we start to prepare next entry */ X XEXPORT BOOL ghdr; /* We need wo write a 'g'lobal header */ XLOCAL FINFO ginfo; /* The 'g'lobal FINFO data */ XLOCAL char *guname; XLOCAL char *ggname; X XLOCAL unkn_t *unkn; /* A list of unknown keywords to print warnings once */ XLOCAL Ulong badf; /* A list of bad flags */ X X/* X * Important for the correctness of gen_number(): As long as we stay <= 55 X * chars for the keyword, a 128 bit number entry will fit into 100 chars. X * X * x_name, x_namelen, x_func, x_flag X */ XLOCAL xtab_t xtab[] = { X { "atime", 5, get_atime, 0 }, X { "ctime", 5, get_ctime, 0 }, X { "mtime", 5, get_mtime, 0 }, X X { "uid", 3, get_uid, 0 }, X { "uname", 5, get_uname, 0 }, X { "gid", 3, get_gid, 0 }, X { "gname", 5, get_gname, 0 }, X X { "path", 4, get_path, 0 }, X { "linkpath", 8, get_lpath, 0 }, X X { "size", 4, get_size, 0 }, X X { "charset", 7, get_dummy, 0 }, X { "comment", 7, get_dummy, 0 }, X { "hdrcharset", 10, get_hdrcharset, 0 }, X/* "BINARY" */ X X { "SCHILY.devmajor", 15, get_major, 0 }, X { "SCHILY.devminor", 15, get_minor, 0 }, X X#ifdef USE_ACL X { "SCHILY.acl.access", 17, get_acl_access, 0 }, X { "SCHILY.acl.default", 18, get_acl_default, 0 }, X { "SCHILY.acl.ace", 14, get_acl_ace, 0 }, X { "SCHILY.acl.type", 15, get_acl_type, 0 }, X#else X/* X * We don't want star to complain about unknown extended headers when it X * has been compiled without ACL support. X */ X { "SCHILY.acl.access", 17, get_dummy, 0 }, X { "SCHILY.acl.default", 18, get_dummy, 0 }, X { "SCHILY.acl.ace", 14, get_dummy, 0 }, X { "SCHILY.acl.type", 15, get_dummy, 0 }, X#endif X#ifdef USE_XATTR X { "SCHILY.xattr.*", 14, get_attr, 0 }, X#else X { "SCHILY.xattr.*", 14, get_dummy, 0 }, X#endif X X#ifdef USE_FFLAGS X { "SCHILY.fflags", 13, get_xfflags, 0 }, X#else X/* X * We don't want star to complain about unknown extended headers when it X * has been compiled without extended file flag support. X */ X { "SCHILY.fflags", 13, get_dummy, 0 }, X#endif X { "SCHILY.dev", 10, get_dev, 0 }, X { "SCHILY.devminorbits", 19, get_minorbits, 0 }, X { "SCHILY.ino", 10, get_ino, 0 }, X { "SCHILY.nlink", 12, get_nlink, 0 }, X { "SCHILY.filetype", 15, get_filetype, 0 }, X { "SCHILY.tarfiletype", 18, get_filetype, 0 }, X { "SCHILY.realsize", 15, get_realsize, 0 }, X { "SCHILY.offset", 13, get_offset, 0 }, X X { "SCHILY.dir", 10, get_dir, 0 }, X { "SCHILY.ddev", 11, get_dummy, 0 }, X { "SCHILY.dino", 11, get_iarray, 0 }, X X { "SCHILY.release", 14, get_release, 0 }, X { "SCHILY.archtype", 15, get_archtype, 0 }, X { "SCHILY.volhdr.*", 15, get_xvolhdr, 0 }, X X { "SUN.devmajor", 12, get_major, 0 }, X { "SUN.devminor", 12, get_minor, 0 }, X X { NULL, 0, NULL, 0 }}; X X/* X * Initialize the growable buffer used for reading the extended headers X */ XLOCAL void X_xbinit() X{ X xbuf = ___malloc(1, "growable xheader"); X xblen = 1; X xbidx = 0; X} X XEXPORT void Xxbinit() X{ X _xbinit(); X X init_pspace(PS_EXIT, &ginfo.f_pname); X ginfo.f_name = ginfo.f_pname.ps_path; X ginfo.f_name[0] = '\0'; X X init_pspace(PS_EXIT, &ginfo.f_plname); X ginfo.f_lname = ginfo.f_plname.ps_path; X ginfo.f_lname[0] = '\0'; X X ginfo.f_uname = ___malloc(MAX_UNAME+1, "global user name"); X ginfo.f_gname = ___malloc(MAX_UNAME+1, "global group name"); X ginfo.f_uname[0] = '\0'; X ginfo.f_gname[0] = '\0'; X ginfo.f_devminorbits = 0; X ggname = ginfo.f_gname; X ginfo.f_xflags = 0; X guname = ginfo.f_uname; X ggname = ginfo.f_gname; X} X X/* X * Grow the growable buffer used for reading the extended headers X */ XLOCAL void Xxbgrow(newsize) X int newsize; X{ X char *newbuf; X int i; X int ps = getpagesize(); X X /* X * grow in pagesize units X */ X for (i = 0; i < newsize; i += ps) X /* LINTED */ X ; X newsize = i + xblen; X newbuf = ___realloc(xbuf, newsize, "growable xheader"); X xbuf = newbuf; X xblen = newsize; X} X X/* X * Variables used to allow us to create an extended header while we write one X */ XLOCAL char *oxbuf; /* Space used to prepare I/O from/to extended headers */ XLOCAL int oxblen; /* the length of the buffer for the extended headers */ XLOCAL int oxbidx; /* The index where we start to prepare next entry */ X XEXPORT void Xxbbackup() X{ X oxbuf = xbuf; X oxblen = xblen; X oxbidx = xbidx; X X _xbinit(); X} X XEXPORT void Xxbrestore() X{ X free(xbuf); X X xbuf = oxbuf; X xblen = oxblen; X xbidx = oxbidx; X} X XEXPORT int Xxhsize() X{ X return (xbidx); X} X XLOCAL void Xwrite_xhdr(type) X int type; X{ X FINFO finfo; X TCB tb; X TCB *xptb; X move_t move; X X fillbytes((char *)&finfo, sizeof (finfo), '\0'); X X if ((xptb = (TCB *)get_block(TBLOCK)) == NULL) X xptb = &tb; X else X finfo.f_flags |= F_TCB_BUF; X filltcb(xptb); X strcpy(xptb->dbuf.t_name, "././@PaxHeader"); X finfo.f_name = xptb->dbuf.t_name; X finfo.f_mode = TUREAD|TUWRITE; X finfo.f_rsize = finfo.f_size = xbidx; X finfo.f_xftype = XT_FILE; X info_to_tcb(&finfo, xptb); X xptb->dbuf.t_linkflag = (char)type; X write_tcb(xptb, &finfo); X X move.m_data = xbuf; X move.m_size = finfo.f_size; X move.m_flags = 0; X cr_file(&finfo, vp_move_to_arch, &move, 0, "moving extended header"); X X xbidx = 0; /* Reset xbuffer index to start of buffer. */ X} X X/* X * Prepare and write out the extended header X */ X/* ARGSUSED */ XEXPORT void Xinfo_to_xhdr(info, ptb) X register FINFO *info; X register TCB *ptb; X{ X char name[MAX_UNAME+1]; X register Ulong xflags; Xextern long hdrtype; Xextern BOOL dodump; X X if (no_xheader) X return; X X if (ghdr) { X /* X * Delayed writing of a 'g' header is required. X */ X write_xhdr('g'); X ghdr = FALSE; X } X X xflags = info->f_xflags & (props.pr_xhmask | XF_NOTIME); X /* X * Unless we really don't want extended sub-second resolution X * timestamps or a specific selection of timestams has been set up, X * include all times (atime/ctime/mtime) if we need to include extended X * headers at all. X */ X if ((xflags & (XF_ATIME|XF_CTIME|XF_MTIME|XF_NOTIME)) == 0) X xflags |= (XF_ATIME|XF_CTIME|XF_MTIME); X else if (xflags & XF_NOTIME) X xflags &= ~(XF_ATIME|XF_CTIME|XF_MTIME); X X#ifdef DEBUG_XHDR X xflags = 0xffffffff; X#endif X if ((xflags & ~XF_NOTIME) == 0) X return; X X if (xflags & XF_ATIME) { X check_xtime("atime", info); X gen_xtime("atime", info->f_atime, info->f_ansec); X } X if (xflags & XF_CTIME) { X check_xtime("ctime", info); X gen_xtime("ctime", info->f_ctime, info->f_cnsec); X } X if (xflags & XF_MTIME) { X check_xtime("mtime", info); X gen_xtime("mtime", info->f_mtime, info->f_mnsec); X } X X if (xflags & XF_UID) { X /* LINTED */ X if (info->f_uid >= 0) X gen_unumber("uid", (Ullong)info->f_uid); X else X gen_number("uid", (Llong)info->f_uid); X } X if (xflags & XF_GID) { X /* LINTED */ X if (info->f_gid >= 0) X gen_unumber("gid", (Ullong)info->f_gid); X else X gen_number("gid", (Llong)info->f_gid); X } X X if (xflags & XF_UNAME) { X ic_nameuid(name, sizeof (name)-1, info->f_uid); X gen_text("uname", name, -1, T_UTF8); X } X if (xflags & XF_GNAME) { X ic_namegid(name, sizeof (name)-1, info->f_gid); X gen_text("gname", name, -1, T_UTF8); X } X X if (xflags & XF_PATH) { X gen_text("path", info->f_name, -1, X (info->f_flags & F_ADDSLASH) != 0 ? X (T_ADDSLASH|T_UTF8) : T_UTF8); X } X X if (xflags & XF_LINKPATH && info->f_lnamelen) X gen_text("linkpath", info->f_lname, -1, T_UTF8); X X if (xflags & XF_SIZE) X gen_unumber("size", (Ullong)info->f_rsize); X X /* X * If "SCHILY.realsize" is needed, it must be past any "size" keyword X * in case a "size" keyword is also present. X */ X if (xflags & XF_REALSIZE) X gen_unumber("SCHILY.realsize", (Ullong)info->f_size); X if (xflags & XF_OFFSET) X gen_unumber("SCHILY.offset", (Ullong)info->f_contoffset); X X if (H_TYPE(hdrtype) == H_SUNTAR) { X if (xflags & XF_DEVMAJOR) { X /* LINTED */ X if (info->f_rdevmaj >= 0) X gen_unumber("SUN.devmajor", (Ullong)info->f_rdevmaj); X else X gen_number("SUN.devmajor", (Llong)info->f_rdevmaj); X } X if (xflags & XF_DEVMINOR) { X /* LINTED */ X if (info->f_rdevmin >= 0) X gen_unumber("SUN.devminor", (Ullong)info->f_rdevmin); X else X gen_number("SUN.devminor", (Llong)info->f_rdevmin); X } X } else { X if (xflags & XF_DEVMAJOR) { X /* LINTED */ X if (info->f_rdevmaj >= 0) X gen_unumber("SCHILY.devmajor", (Ullong)info->f_rdevmaj); X else X gen_number("SCHILY.devmajor", (Llong)info->f_rdevmaj); X } X if (xflags & XF_DEVMINOR) { X /* LINTED */ X if (info->f_rdevmin >= 0) X gen_unumber("SCHILY.devminor", (Ullong)info->f_rdevmin); X else X gen_number("SCHILY.devminor", (Llong)info->f_rdevmin); X } X } X X#ifdef USE_ACL X /* X * POSIX draft Access Control Lists, currently supported e.g. by Linux. X * Solaris ACLs have been converted to POSIX draft ACLs before. X */ X#ifdef __later__ X if (xflags & (XF_ACL_ACCESS|XF_ACL_DEFAULT)) { X gen_text("SCHILY.acl.type", "POSIX draft", 11, 0); X } X if (xflags & XF_ACL_ACE) { X gen_text("SCHILY.acl.type", "NFSv4", 5, 0); X } X#endif X if (xflags & XF_ACL_ACE) { X gen_text("SCHILY.acl.ace", info->f_acl_ace, -1, T_UTF8); X } X X if (xflags & XF_ACL_ACCESS) { X gen_text("SCHILY.acl.access", info->f_acl_access, -1, T_UTF8); X } X X if (xflags & XF_ACL_DEFAULT) { X gen_text("SCHILY.acl.default", info->f_acl_default, -1, T_UTF8); X } X#endif /* USE_ACL */ X X#ifdef USE_XATTR X if ((xflags & XF_XATTR) && info->f_xattr) { X star_xattr_t *x; X X for (x = info->f_xattr; x->name; x++) { X char aname[PATH_MAX]; X js_snprintf(aname, PATH_MAX, "SCHILY.xattr.%s", x->name); X gen_text(aname, x->value, x->value_len, 0); X } X } X#endif /* USE_XATTR */ X X#ifdef USE_FFLAGS X if (xflags & XF_FFLAGS) { Xextern char *textfromflags __PR((FINFO *, char *)); X X char fbuf[512]; X gen_text("SCHILY.fflags", textfromflags(info, fbuf), -1, 0); X } X#endif X X if (dodump) { X /* LINTED */ X if (info->f_dev >= 0) X gen_unumber("SCHILY.dev", (Ullong)info->f_dev); X else X gen_number("SCHILY.dev", (Llong)info->f_dev); X gen_unumber("SCHILY.ino", (Ullong)info->f_ino); X gen_unumber("SCHILY.nlink", (Ullong)info->f_nlink); X gen_text("SCHILY.filetype", XTTONAME(info->f_rxftype), -1, 0); X#ifdef __needed__ X if (info->f_rxftype != info->f_xftype) X gen_text("SCHILY.tarfiletype", XTTONAME(info->f_xftype), -1, 0); X#endif X if (is_dir(info)) { X int oidx = xbidx; X X if (info->f_dir) X gen_text("SCHILY.dir", X info->f_dir, info->f_dirlen, T_UTF8); X /* X * Estimate same length for inode array and dir content X * Add 1 to (xbidx - oidx) as "SCHILY.dino" is one X * longer than "SCHILY.dir". X */ X if (info->f_dirinos) X gen_iarray("SCHILY.dino", X info->f_dirinos, info->f_dirents, X xbidx - oidx + 1); X } X } else if (is_multivol(info)) { X gen_text("SCHILY.filetype", XTTONAME(info->f_rxftype), -1, 0); X } X X write_xhdr(props.pr_xc); X} X XLOCAL void Xcheck_xtime(keyword, info) X register char *keyword; X register FINFO *info; X{ X long l = 0; /* Make GCC happy */ X X if (*keyword == 'a') X l = info->f_ansec; X else if (*keyword == 'c') X l = info->f_cnsec; X else if (*keyword == 'm') X l = info->f_mnsec; X X if (l >= 0 && l < 1000000000) X return; X X /* X * check_xtime() is used in write mode so info->f_name is valid. X */ X errmsgno(EX_BAD, "Bad '%s' nsec value %ld for '%s' at %lld.\n", X keyword, l, info->f_name, tblocks()); X l = 0; X X if (*keyword == 'a') X info->f_ansec = l; X else if (*keyword == 'c') X info->f_cnsec = l; X else if (*keyword == 'm') X info->f_mnsec = l; X} X X/* X * Create a time string with sub-second granularity. X * X * =.\n X * X * 00 atime=.123456789\n X * 00 ctime=.123456789\n X * 00 mtime=.123456789\n X * X * 00 mtime=.123456789\n X * .123456789.123456789 X * X * As we always emmit 9 digits for the sub-second part, the X * length of this entry is always more than 20 and less than 100. X * The size of an entry is 20 + the size of the "seconds" part of the entry. X * With 64 bit unsigned numbers, the "seconds" part will be 20 char at max. X * We may safely fill in the two digit later, when we know the value. X * X * The code is highly optimised because in PAX (extended TAR) mode we are X * spending a significant amount of user CPU time in it. X */ XEXPORT void Xgen_xtime(keyword, sec, nsec) X char *keyword; X register time_t sec; X register Ulong nsec; X{ X char nb[32]; X register char *p; X register char *np; X register int len; X X if (nsec >= 1000000000) /* We would create an unusable string */ X nsec = 0; X X if ((xbidx + 100) > xblen) X xbgrow(100); X X /* X * The following code is equivalent to: X * X * sprintf(p, "%d %s=%lld.%9.9ld\n", length, keyword, (Llong)sec, nsec) X * X * But is twice as fast. X */ X len = 20; /* Base length, second field must be added */ X p = &xbuf[xbidx+2]; /* point past length field */ X /* X * Fill in " ?time=" X */ X *p++ = ' '; X if (keyword[0] == 'a' || keyword[0] == 'c' || keyword[0] == 'm') { X *p++ = keyword[0]; X *p++ = 't'; *p++ = 'i'; *p++ = 'm'; *p++ = 'e'; X } else { X len = 15; /* 2digitlen + ' ' + '=' + '.' + nsec + '\n' */ X np = keyword; X while ((*p++ = *np++) != '\0') X len++; X --p; X } X *p++ = '='; X if (sec < 0) { /* Time is before 01.01.1970 ... */ X *p++ = '-'; X sec = -sec; X len += 1; X } X X np = &nb[sizeof (nb)-1]; /* Point to end of number string buffer */ X *np = '\0'; /* Null terminate */ X ui2decimal(sec, np); /* Convert to unsigned decimal string */ X len += &nb[sizeof (nb)-1] - np; X X scopy(p, np); /* Copy number string buffer to xheader */ X --p, /* Overshoot compensation */ X *p++ = '.'; /* Decimal point between secs and nsecs */ X X np = &p[10]; /* Point to end of string part */ X *np = '\0'; /* Null terminate */ X *--np = '\n'; /* Newline at end of line */ X ui2decimal(nsec, np); /* Convert to unsigned decimal string */ X while (np > p) X *--np = '0'; /* Left fill with '0' to 9 digits */ X X np = &xbuf[xbidx+2]; /* Point to end of length string part */ X xbidx += len; /* 'len' is trashed in ui2decimal() */ X ui2decimal(len, np); /* Convert to unsigned decimal string */ X} X X/* X * Create a generic unsigned number string. X * X * =\n X * X * The length of this entry is always less than 100 chars if the length of the X * 'name-spec' is less than 75 chars (the maximum length of a 64 bit number in X * decimal is 20 digits). Even in case of a 128 bit number length will be less X * than 100 chars if the length of 'name-spec' is less than 55 chars. X * X * The code is highly optimised because in dump mode when using extended TAR X * headers with additional fields, we are spending a significant amount of X * user CPU time in it. X */ XEXPORT void Xgen_unumber(keyword, arg) X register char *keyword; X register Ullong arg; X{ X char nb[64]; /* 41 is enough for unsigned 128 bit ints */ X register char *p; X register char *np; X register int len; X register int i; X X if ((xbidx + 100) > xblen) X xbgrow(100); X X /* X * The following code is equivalent to: X * X * sprintf(p, "%d %s=%llu\n", length, keyword, arg); X * X * But is twice as fast. X */ X np = &nb[sizeof (nb)-1]; /* Point to end of number string buffer */ X *np = '\0'; /* Null terminate */ X ui2decimal(arg, np); /* Convert to unsigned decimal string */ X X len = strlen(keyword); /* Compute the length, start with strlen(kw) */ X X len += &nb[sizeof (nb)-1] - np; /* Add strlen(number) */ X len += 2 + 3; /* Add 2 for strlen(len) and 3 for " =\n" */ X X if (len < 10) { /* If < 10, the len field is 1 digit only */ X len -= 1; /* This happens when strlen(keyword) is < 4 */ X i = 1; /* and number is one digit only. */ X } else { X i = 2; X } X p = &xbuf[xbidx+i]; /* Point past length field */ X *p++ = ' '; /* Fill in space after length field */ X scopy(p, keyword); /* Copy keyword into to xheader */ X --p, /* Overshoot compensation */ X *p++ = '='; /* Fill in '=' after keyword field */ X X scopy(p, np); /* Copy number string buffer to xheader */ X *--p = '\n'; /* Newline at end of line */ X X np = &xbuf[xbidx+i]; /* Point to end of length string part */ X xbidx += len; /* 'len' is trashed in ui2decimal() */ X ui2decimal(len, np); /* Convert to unsigned decimal string */ X} X X/* X * Create a generic signed number string. X * X * =\n X * X * The length of this entry is always less than 100 chars if the length of the X * 'name-spec' is less than 75 chars (the maximum length of a 64 bit number in X * decimal is 20 digits). Even in case of a 128 bit number length will be less X * than 100 chars if the length of 'name-spec' is less than 55 chars. X * X * The code is highly optimised because in dump mode when using extended TAR X * headers with additional fields, we are spending a significant amount of X * user CPU time in it. X */ XEXPORT void Xgen_number(keyword, arg) X register char *keyword; X register Llong arg; X{ X char nb[64]; /* 41 is enough for unsigned 128 bit ints */ X register char *p; X register char *np; X register int len; X register int i; X BOOL neg = FALSE; X X if ((xbidx + 100) > xblen) X xbgrow(100); X X /* X * The following code is equivalent to: X * X * sprintf(p, "%d %s=%lld\n", length, keyword, arg); X * X * But is twice as fast. X */ X np = &nb[sizeof (nb)-1]; /* Point to end of number string buffer */ X *np = '\0'; /* Null terminate */ X if (arg < 0) { X arg = -arg; X neg = TRUE; X } X ui2decimal(arg, np); /* Convert to unsigned decimal string */ X if (neg) X *--np = '-'; X X len = strlen(keyword); /* Compute the length, start with strlen(kw) */ X X len += &nb[sizeof (nb)-1] - np; /* Add strlen(number) */ X len += 2 + 3; /* Add 2 for strlen(len) and 3 for " =\n" */ X X if (len < 10) { /* If < 10, the len field is 1 digit only */ X len -= 1; /* This happens when strlen(keyword) is < 4 */ X i = 1; /* and number is one digit only. */ X } else { X i = 2; X } X p = &xbuf[xbidx+i]; /* Point past length field */ X *p++ = ' '; /* Fill in space after length field */ X scopy(p, keyword); /* Copy keyword into to xheader */ X --p, /* Overshoot compensation */ X *p++ = '='; /* Fill in '=' after keyword field */ X X scopy(p, np); /* Copy number string buffer to xheader */ X *--p = '\n'; /* Newline at end of line */ X X np = &xbuf[xbidx+i]; /* Point to end of length string part */ X xbidx += len; /* 'len' is trashed in ui2decimal() */ X ui2decimal(len, np); /* Convert to unsigned decimal string */ X} X X/* X * Create a string from an array of unsigned inode numbers. X * X * =\n X * X * is a space separated list of unsigned integers in decimal ascii. X * X * The len parameter is the estimated length of the whole string. It is used X * to pre-allocate a buffer that hopefully has the right size already in order X * to avoid copying the content. X * X * The code is highly optimised because in dump mode when using extended TAR X * headers with additional fields, we are spending a significant amount of X * user CPU time in it. X */ XLOCAL void Xgen_iarray(keyword, arg, ents, len) X register char *keyword; X ino_t *arg; X int ents; X register int len; /* Estimated length */ X{ X char nb[64]; /* 41 is enough for unsigned 128 bit ints */ X register Ullong ll; X register char *p; X register char *np; X register int i; X register int llen; X register int olen; X X /* X * The following code is equivalent to: X * X * sprintf(p, "%d %s=%llu %llu ...\n", length, keyword, arg[...]...); X * X * But avoids copying if possible. X */ X i = len; X if (len <= 0) /* No estimated length already */ X len = strlen(keyword) + 3; /* + ' ' + '=' + '\n' */ X olen = len; X len += llen = len_len(len); /* add length of length string */ X X if (i <= 0) X i = len + ents * 2; /* Make a minimal guess on the len */ X else X i = len; /* Use guessed value from parameter */ X X if ((xbidx + i) > xblen) X xbgrow(i); X X p = &xbuf[xbidx+llen]; /* Point past length field */ X *p++ = ' '; /* Fill in space after length field */ X scopy(p, keyword); /* Copy keyword into to xheader */ X --p, /* Overshoot compensation */ X *p++ = '='; /* Fill in '=' after keyword field */ X X len = p - &xbuf[xbidx]; /* strlen(keyword) + ' ' + '=' */ X for (i = 0; i < ents; i++) { X if (((p - xbuf) + 100) > xblen) { X register int xb_idx; X /* X * The address for xbuf may change in case that X * realloc() cannot grow the current memory chunk, X * recalculate 'p' in this case. X */ X xb_idx = p - xbuf; X xbgrow(100); X p = xbuf + xb_idx; X } X ll = (Llong)arg[i]; X np = &nb[sizeof (nb)-1]; /* Point to end of number str. buf */ X *np = '\0'; /* Null terminate */ X ui2decimal(ll, np); /* Convert to unsigned decimal str. */ X len += &nb[sizeof (nb)-1] - np; /* strlen(number) */ X len += 1; /* Space (' ') or Newline ('\n') */ X X scopy(p, np); /* Copy number str. buf to xheader */ X p[-1] = ' '; /* Space at end of number */ X } X *--p = '\n'; /* Overwrite last space by newline */ X i = p - &xbuf[xbidx] + 1; /* Total string length */ X i -= llen; /* Subtract old length length value */ X X if (olen != i) { /* Length without length string changed */ X olen = llen; /* Save old length string length */ X llen = len_len(i); /* New length of length string */ X if (olen != llen) { /* We need to move the whole text */ X p = &xbuf[xbidx+olen]; X olen = llen - olen; X movebytes(p, p+olen, i); X } X len = i + llen; X } X X np = &xbuf[xbidx+llen]; /* Point to end of length string part */ X *np = ' '; /* May have been overwritten by movebytes() */ X xbidx += len; /* 'len' is trashed in ui2decimal() */ X ui2decimal(len, np); /* Convert to unsigned decimal string */ X} X X/* X * Create a generic text string in UTF-8 coding. X * X * =\n X * X * This function will have to carefully check for the resultant length X * and thus compute the total length in advance. If the rare case that the X * UTF-8 conversion changes the length so much that the length of the length X * string will be different from the estimated value, we need to move whole X * text by one. X * X * The code is highly optimised because in dump mode when using extended TAR X * headers with additional fields, we may need to copy directory listings X * that are longer then 100000 bytes. X */ XEXPORT void Xgen_text(keyword, arg, alen, flags) X register char *keyword; X char *arg; X int alen; X Uint flags; X{ X register char *p; X register char *np; X register int len; X register int i; X register int llen; X register int olen; X X /* X * The following code is equivalent to: X * X * sprintf(p, "%d %s=%s\n", length, keyword, arg); X * X * But avoids copying if possible. X */ X if ((len = alen) == -1) X len = strlen(arg); X alen = len; X if (flags & T_ADDSLASH) /* only used if 'path' is a dir */ X len++; X X len += strlen(keyword) + 3; /* + ' ' + '=' + '\n' */ X olen = len; X len += llen = len_len(len); /* add length of length string */ X X i = len; X if (flags & T_UTF8) X i *= 6; /* UTF-8 Factor may be up to 6! */ X if ((xbidx + i) > xblen) X xbgrow(i); X X X p = &xbuf[xbidx+llen]; /* Point past length field */ X *p++ = ' '; /* Fill in space after length field */ X scopy(p, keyword); /* Copy keyword into to xheader */ X --p, /* Overshoot compensation */ X *p++ = '='; /* Fill in '=' after keyword field */ X X if (flags & T_UTF8 && !binflag) { X i = to_utf8((Uchar *)p, i, (Uchar *)arg, alen); X p += i + 1; X } else { X p = movebytes(arg, p, alen); X p++; X } X X if (flags & T_ADDSLASH) { /* only used if 'path' is a dir */ X i++; /* String length increases by '/' */ X *--p = '/'; /* Slash at end of string */ X *++p = '\n'; /* Newline at end of line */ X } else { X *--p = '\n'; /* Newline at end of line */ X } X i = p - &xbuf[xbidx] + 1; /* Total string length */ X i -= llen; /* Subtract old length length value */ X X if (olen != i) { /* Length without length string changed */ X olen = llen; /* Save old length string length */ X llen = len_len(i); /* New length of length string */ X if (olen != llen) { /* We need to move the whole text */ X p = &xbuf[xbidx+olen]; X olen = llen - olen; X movebytes(p, p+olen, i); X } X len = i + llen; X } X X np = &xbuf[xbidx+llen]; /* Point to end of length string part */ X *np = ' '; /* May have been overwritten by movebytes() */ X xbidx += len; /* 'len' is trashed in ui2decimal() */ X ui2decimal(len, np); /* Convert to unsigned decimal string */ X} X X/* X * It bad to see new global variables while we are working on a star library. X */ XLOCAL star_xattr_t *static_xattr; X X/* X * The xattr list grows dynamically. Reset it before reading X * the next Extended Header. X */ XEXPORT void Xtcb_to_xhdr_reset() X{ X /* X * XXX Dies soll laut A Grünbacher in tcb_to_info() aufgerufen werden X */ X free_xattr(&static_xattr); X} X XLOCAL int Xlen_len(len) X register int len; X{ X if (len <= 8) X return (1); X if (len <= 97) X return (2); X if (len <= 996) X return (3); X if (len <= 9995) X return (4); X if (len <= 99994) X return (5); X if (len <= 999993) X return (6); X if (len <= 9999992) X return (7); X if (len <= 99999991) X return (8); X if (len <= 999999990) X return (9); X X return (10); X} X X/* X * Lookup command in command tab X */ XLOCAL xtab_t * Xlookup(cmd, clen, cp) X register char *cmd; X register int clen; X register xtab_t *cp; X{ X for (; cp->x_name; cp++) { X register int len = cp->x_namelen-1; X X if (cp->x_name[len] == '*') { X if (strncmp(cmd, cp->x_name, len) == 0) X return (cp); X } X if (clen != cp->x_namelen) X continue; X X if ((*cmd == *cp->x_name) && X strcmp(cmd, cp->x_name) == 0) { X return (cp); X } X } X return ((xtab_t *)NULL); X} X X/* X * Read extended POSIX.1-2001 header and parse the content. X */ XEXPORT int Xtcb_to_xhdr(ptb, info) X register TCB *ptb; X register FINFO *info; X{ X register char *p; X register char *ep; X FINFO *oinfo = info; X move_t move; X Ullong ull; X X#ifdef XH_DEBUG Xerror("Block: %lld\n", tblocks()); X#endif X if (ptb->dbuf.t_linkflag == LF_GHDR) { X grinit(); X info = &ginfo; X } X /* X * File size is strlen of extended header X */ X stolli(ptb->dbuf.t_size, &ull); X info->f_size = ull; X info->f_rsize = (off_t)info->f_size; X /* X * Reset xbidx to make xbgrow() work correctly for our case. X */ X xbidx = 0; X if ((info->f_size+1) > xblen) X xbgrow(info->f_size+1); X X /* X * move_from_arch() always adds null byte to make decoding easier. X */ X move.m_data = xbuf; X move.m_flags = 0; X if (xt_file(info, vp_move_from_arch, &move, 0, X "moving extended header") < 0) { X die(EX_BAD); X } X X#ifdef XH_DEBUG Xerror("Block: %lld\n", tblocks()); Xerror("xbuf: '%s'\n", xbuf); X#endif X X p = xbuf; X ep = p + ull; X if (!no_xheader) X xhparse(info, p, ep); X X if (ptb->dbuf.t_linkflag == LF_GHDR) { X griprint(grip); X gipsetup(grip); X info_xcopy(oinfo, info); X } X return (get_tcb(ptb)); X} X XEXPORT BOOL Xxhparse(info, p, ep) X register FINFO *info; X register char *p; X register char *ep; X{ X register xtab_t *cp; X register char *keyword; X register char *arg; X long length; X X while (p < ep) { X register int klen; X X if (*p < '0' || *p > '9') { X errmsgno(EX_BAD, X "Syntax error in extended header: non digit in len at %lld.\n", X tblocks()); X return (FALSE); X } X keyword = astolb(p, &length, 10); X if (*keyword != ' ') { X errmsgno(EX_BAD, X "Syntax error in extended header: missing ' ' at %lld.\n", X tblocks()); X return (FALSE); X } X keyword++; X arg = strchr(keyword, '='); X klen = arg - keyword; X if ((arg == NULL) || (klen > length)) { X errmsgno(EX_BAD, X "Syntax error in extended header: missing '=' at %lld.\n", X tblocks()); X return (FALSE); X } X *arg++ = '\0'; /* Kill equal sign */ X X if (*(p + length -1) != '\n') { X arg[-1] = '='; X errmsgno(EX_BAD, X "Syntax error in extended header: missing '\\n' at %lld.\n", X tblocks()); X return (FALSE); X } X *(p + length -1) = '\0'; /* Kill new-line character */ X X if ((cp = lookup(keyword, klen, xtab)) != NULL) { X (*cp->x_func)(info, keyword, klen, X arg, length - (arg-p) - 1); X } else { X print_unknown(keyword); X } X arg[-1] = '='; X p += length; X p[-1] = '\n'; X } X return (TRUE); X} X XLOCAL void Xprint_unknown(keyword) X register char *keyword; X{ X register unkn_t *up = unkn; X X while (up) { X if (streql(keyword, up->u_name)) X break; X up = up->u_next; X } X if (up == NULL) { X errmsgno(EX_BAD, X "Unknown extended header keyword '%s' ignored at %lld.\n", X keyword, tblocks()); X X up = ___malloc(sizeof (*up) + strlen(keyword), "unknown list"); X strcpy(up->u_name, keyword); X up->u_next = unkn; X unkn = up; X } X} X XEXPORT void Xxh_rangeerr(keyword, arg, len) X char *keyword; X char *arg; X int len; X{ X if (nowarn) X return; X errmsgno(EX_BAD, X "WARNING: %s '%.*s' in extended header at %lld exceeds local range.\n", X keyword, len, arg, tblocks()); X} X XLOCAL void Xprint_toolong(keyword, arg, len) X char *keyword; X char *arg; X int len; X{ X if (nowarn) X return; X errmsgno(EX_BAD, X "WARNING: %s '%.*s' in extended header at %lld too long, ignoring.\n", X keyword, len, arg, tblocks()); X} X XLOCAL void Xget_xvolhdr(info, keyword, klen, arg, len) X FINFO *info; X char *keyword; X int klen; X char *arg; X int len; X{ X register xtab_t *cp; Xextern xtab_t volhtab[]; X X if ((cp = lookup(keyword, klen, volhtab)) != NULL) { X (*cp->x_func)(info, keyword, klen, X arg, len); X } else { X print_unknown(keyword); X } X} X XLOCAL void Xinfo_xcopy(ninfo, oinfo) X register FINFO *ninfo; X register FINFO *oinfo; X{ X if (oinfo->f_xflags & XF_ATIME) { X ninfo->f_atime = oinfo->f_atime; X ninfo->f_ansec = oinfo->f_ansec; X ninfo->f_xflags |= XF_ATIME; X } X if (oinfo->f_xflags & XF_CTIME) { X ninfo->f_ctime = oinfo->f_ctime; X ninfo->f_cnsec = oinfo->f_cnsec; X ninfo->f_xflags |= XF_CTIME; X } X if (oinfo->f_xflags & XF_MTIME) { X ninfo->f_mtime = oinfo->f_mtime; X ninfo->f_mnsec = oinfo->f_mnsec; X ninfo->f_xflags |= XF_MTIME; X } X /* We ignore XF_COMMENT */ X if (oinfo->f_xflags & XF_UID) { X ninfo->f_uid = oinfo->f_uid; X ninfo->f_xflags |= XF_UID; X } X if (oinfo->f_xflags & XF_UNAME) { X strcpy(guname, oinfo->f_uname); X ninfo->f_uname = oinfo->f_uname; X ninfo->f_umaxlen = ninfo->f_umaxlen; X oinfo->f_uname = guname; X ninfo->f_xflags |= XF_UNAME; X } X if (oinfo->f_xflags & XF_GID) { X ninfo->f_gid = oinfo->f_gid; X ninfo->f_xflags |= XF_GID; X } X if (oinfo->f_xflags & XF_GNAME) { X strcpy(ggname, oinfo->f_gname); X ninfo->f_gname = oinfo->f_gname; X ninfo->f_gmaxlen = ninfo->f_gmaxlen; X oinfo->f_gname = ggname; X ninfo->f_xflags |= XF_GNAME; X } X if (oinfo->f_xflags & XF_PATH) { X strcpy(ninfo->f_name, oinfo->f_name); X ninfo->f_xflags |= XF_PATH; X } X if (oinfo->f_xflags & XF_LINKPATH) { X strcpy(ninfo->f_lname, oinfo->f_lname); X ninfo->f_xflags |= XF_LINKPATH; X } X X if (oinfo->f_xflags & XF_SIZE) { X ninfo->f_rsize = oinfo->f_rsize; X ninfo->f_xflags |= XF_SIZE; X } X /* XF_CHARSET currently is a dummy */ X X if (oinfo->f_xflags & XF_DEVMAJOR) { X ninfo->f_rdevmaj = oinfo->f_rdevmaj; X ninfo->f_xflags |= XF_DEVMAJOR; X } X if (oinfo->f_xflags & XF_DEVMINOR) { X ninfo->f_rdevmin = oinfo->f_rdevmin; X ninfo->f_xflags |= XF_DEVMINOR; X } X if (oinfo->f_xflags & (XF_ACL_ACCESS|XF_ACL_DEFAULT)) { X errmsgno(EX_BAD, "WARNING: Found global ACL data at %lld.\n", X tblocks()); X } X if (oinfo->f_xflags & XF_FFLAGS) { X ninfo->f_fflags = oinfo->f_fflags; X ninfo->f_xflags |= XF_FFLAGS; X } X if (oinfo->f_xflags & XF_REALSIZE) { X ninfo->f_size = oinfo->f_size; X ninfo->f_xflags |= XF_REALSIZE; X } X if (oinfo->f_xflags & XF_OFFSET) { X ninfo->f_contoffset = oinfo->f_contoffset; X ninfo->f_xflags |= XF_OFFSET; X } X if (oinfo->f_xflags & XF_XATTR) { X errmsgno(EX_BAD, "WARNING: Found global XATTR data at %lld.\n", X tblocks()); X } X} X X/* X * generic function to read args that hold times X * X * The time may either be in second resolution or in sub-second resolution. X * In the latter case the second fraction and the sub second fraction X * is separated by a dot ('.'). X */ XEXPORT BOOL Xget_xtime(keyword, arg, len, secp, nsecp) X char *keyword; X char *arg; X int len; X time_t *secp; X long *nsecp; X{ X#ifdef __use_default_time__ Xextern struct timespec ddate; X#endif X Llong ll; X long l; X int flen; X char *p; X X p = astollb(arg, &ll, 10); X if (*p == '\0' || *p == '.') { X time_t secs = ll; X if (secs != ll) { X xh_rangeerr(keyword, arg, len); X#ifdef __use_default_time__ X *secp = ddate.tv_sec; X#endif X goto bad; X } X *secp = ll; /* XXX Check for NULL ptr? */ X } X if (*p == '\0') { /* time has second resolution only */ X if (nsecp == NULL) X return (TRUE); X *nsecp = 0; X return (TRUE); X } else if (*p == '.') { /* time has sub-second resolution */ X flen = strlen(++p); /* remember resolution */ X if (flen > 9) /* if resolution is better than */ X p[9] = '\0'; /* nanoseconds kill rest of line as */ X p = astolb(p, &l, 10); /* we don't understand more. */ X if (*p == '\0') { /* number read correctly */ X if (l >= 0) { X while (flen < 9) { /* convert to nsecs */ X l *= 10; X flen++; X } X if (nsecp == NULL) X return (TRUE); X *nsecp = l; X return (TRUE); X } X } X } Xbad: X errmsgno(EX_BAD, "Bad timespec '%s' for '%s' in extended header at %lld.\n", X arg, keyword, tblocks()); X return (FALSE); X} X X/* X * get read access time from extended header X */ X/* ARGSUSED */ XLOCAL void Xget_atime(info, keyword, klen, arg, len) X FINFO *info; X char *keyword; X int klen; X char *arg; X int len; X{ X if (len == 0) { X info->f_xflags &= ~XF_ATIME; X return; X } X if (get_xtime(keyword, arg, len, &info->f_atime, &info->f_ansec)) X info->f_xflags |= XF_ATIME; X} X X/* X * get inode status change time from extended header X */ X/* ARGSUSED */ XLOCAL void Xget_ctime(info, keyword, klen, arg, len) X FINFO *info; X char *keyword; X int klen; X char *arg; X int len; X{ X if (len == 0) { X info->f_xflags &= ~XF_CTIME; X return; X } X if (get_xtime(keyword, arg, len, &info->f_ctime, &info->f_cnsec)) X info->f_xflags |= XF_CTIME; X} X X/* X * get modification time from extended header X */ X/* ARGSUSED */ XLOCAL void Xget_mtime(info, keyword, klen, arg, len) X FINFO *info; X char *keyword; X int klen; X char *arg; X int len; X{ X if (len == 0) { X info->f_xflags &= ~XF_MTIME; X return; X } X if (get_xtime(keyword, arg, len, &info->f_mtime, &info->f_mnsec)) X info->f_xflags |= XF_MTIME; X} X X/* X * generic function to read args that hold decimal numbers X */ X#ifdef __needed_ XEXPORT BOOL Xget_number(keyword, arg, llp) X char *keyword; X char *arg; X Llong *llp; X{ X Llong ll; X char *p; X X p = astollb(arg, &ll, 10); X if (*p == '\0') { /* number read correctly */ X *llp = ll; /* XXX Check for NULL ptr? */ X return (TRUE); X } X errmsgno(EX_BAD, "Bad number '%s' for '%s' in extended header at %lld.\n", X arg, keyword, tblocks()); X return (FALSE); X} X#endif X X/* X * generic function to read args that hold unsigned decimal numbers X */ XLOCAL BOOL Xget_xnumber(keyword, arg, ullp, type) X char *keyword; X char *arg; X Ullong *ullp; X char *type; X{ X Ullong ull; X char *p; X X seterrno(0); X p = astoullb(arg, &ull, 10); X if (*p == '\0') { /* number read correctly */ X if (geterrno() != 0) { X errmsgno(EX_BAD, X "Number overflow with '%s' for '%s' in extended header at %lld.\n", X arg, keyword, tblocks()); X return (FALSE); X } X *ullp = ull; /* XXX Check for NULL ptr? */ X return (TRUE); X } X errmsgno(EX_BAD, "Bad %s number '%s' for '%s' in extended header at %lld.\n", X type, X arg, keyword, tblocks()); X return (FALSE); X} X XEXPORT BOOL Xget_unumber(keyword, arg, ullp, maxval) X char *keyword; X char *arg; X Ullong *ullp; X Ullong maxval; X{ X if (!get_xnumber(keyword, arg, ullp, "unsigned")) X return (FALSE); X X if (*ullp > maxval) { X errmsgno(EX_BAD, X "Value '%s' is out of range 0..%llu for '%s' in extended header at %lld.\n", X arg, maxval, keyword, tblocks()); X return (FALSE); X } X return (TRUE); X} X X X/* X * generic function to read args that hold signed decimal numbers X */ XEXPORT BOOL Xget_snumber(keyword, arg, ullp, negp, minval, maxval) X char *keyword; X char *arg; X Ullong *ullp; X BOOL *negp; X Ullong minval; X Ullong maxval; X{ X char *p = arg; X#define is_space(c) ((c) == ' ' || (c) == '\t') X X while (is_space(*p)) X p++; X X *negp = FALSE; X if (*p == '-') { X p++; X *negp = TRUE; X } X return (get_xnumber(keyword, p, ullp, "signed")); X} X X/* X * get user id (if > 2097151) X * POSIX requires uid_t to be a signed int but the values for uid_t to be X * non-negative. X * We allow signed ints and carefully check the values. X */ X/* ARGSUSED */ XLOCAL void Xget_uid(info, keyword, klen, arg, len) X FINFO *info; X char *keyword; X int klen; X char *arg; X int len; X{ X Ullong ull; X BOOL neg = FALSE; X X if (len == 0) { X info->f_xflags &= ~XF_UID; X return; X } X if (get_snumber(keyword, arg, &ull, &neg, X -(Ullong)UID_T_MIN, UID_T_MAX)) { X info->f_xflags |= XF_UID; X if (neg) X info->f_uid = -ull; X else X info->f_uid = ull; X X if ((neg && -info->f_uid != ull) || X (!neg && info->f_uid != ull)) { X X xh_rangeerr(keyword, arg, len); X info->f_flags |= F_BAD_UID; X info->f_uid = ic_uid_nobody(); X } X } X} X X/* X * get group id (if > 2097151) X * POSIX requires gid_t to be a signed int but the values for gid_t to be X * non-negative. X * We allow signed ints and carefully check the values. X */ X/* ARGSUSED */ XLOCAL void Xget_gid(info, keyword, klen, arg, len) X FINFO *info; X char *keyword; X int klen; X char *arg; X int len; X{ X Ullong ull; X BOOL neg = FALSE; X X if (len == 0) { X info->f_xflags &= ~XF_GID; X return; X } X if (get_snumber(keyword, arg, &ull, &neg, X -(Ullong)GID_T_MIN, GID_T_MAX)) { X info->f_xflags |= XF_UID; X if (neg) X info->f_gid = -ull; X else X info->f_gid = ull; X X if ((neg && -info->f_gid != ull) || X (!neg && info->f_gid != ull)) { X X xh_rangeerr(keyword, arg, len); X info->f_flags |= F_BAD_GID; X info->f_gid = ic_gid_nobody(); X } X } X} X X/* X * Space for returning user/group names. X * XXX If we ever change to use allocated space, we need to change info_xcopy() X */ XLOCAL Uchar _uname[MAX_UNAME+2]; XLOCAL Uchar _gname[MAX_UNAME+2]; X X/* X * get user name (if name length is > 32 chars or if contains non ASCII chars) X */ X/* ARGSUSED */ XLOCAL void Xget_uname(info, keyword, klen, arg, len) X FINFO *info; X char *keyword; X int klen; X char *arg; X int len; X{ X if (len == 0) { X info->f_xflags &= ~XF_UNAME; X return; X } X if (len > MAX_UNAME) { X print_toolong(keyword, arg, len); X return; X } X if (ginfo.f_xflags & XF_BINARY) { X strcpy((char *)_uname, arg); X info->f_xflags |= XF_UNAME; X info->f_uname = (char *)_uname; X info->f_umaxlen = len; X } else if (from_utf8(_uname, sizeof (_uname), (Uchar *)arg, &len)) { X info->f_xflags |= XF_UNAME; X info->f_uname = (char *)_uname; X info->f_umaxlen = len; X } else { X bad_utf8(keyword, arg); X } X} X X/* X * get group name (if name length is > 32 chars or if contains non ASCII chars) X */ X/* ARGSUSED */ XLOCAL void Xget_gname(info, keyword, klen, arg, len) X FINFO *info; X char *keyword; X int klen; X char *arg; X int len; X{ X if (len == 0) { X info->f_xflags &= ~XF_GNAME; X return; X } X if (len > MAX_UNAME) { X print_toolong(keyword, arg, len); X return; X } X if (ginfo.f_xflags & XF_BINARY) { X strcpy((char *)_gname, arg); X info->f_xflags |= XF_GNAME; X info->f_gname = (char *)_gname; X info->f_gmaxlen = len; X } else if (from_utf8(_gname, sizeof (_gname), (Uchar *)arg, &len)) { X info->f_xflags |= XF_GNAME; X info->f_gname = (char *)_gname; X info->f_gmaxlen = len; X } else { X bad_utf8(keyword, arg); X } X} X X/* X * get path (if name length is > 100-255 chars or if contains non ASCII chars) X */ X/* ARGSUSED */ XLOCAL void Xget_path(info, keyword, klen, arg, len) X FINFO *info; X char *keyword; X int klen; X char *arg; X int len; X{ X if (len == 0) { X info->f_xflags &= ~XF_PATH; X return; X } X X /* X * Check whether we are called via get_xhtype() -> xhparse() X */ X if (info->f_name == NULL) X return; X X if (ginfo.f_xflags & XF_BINARY) { X if (strlcpy_pspace(PS_STDERR, &info->f_pname, arg, len) < 0) { X print_toolong(keyword, arg, len); X info->f_xflags |= F_BAD_META; X return; X } X info->f_name = info->f_pname.ps_path; X info->f_namelen = len; X info->f_xflags |= XF_PATH; X } else { X int ilen = len; X BOOL ret; X X do { X len = ilen; X ret = from_utf8((Uchar *)info->f_name, X info->f_pname.ps_size, X (Uchar *)arg, &len); X if (len >= info->f_pname.ps_size) { X /* X * An increment of 1 is OK, since it is unlikely X * that the path grows by more than 256 per dir. X */ X if (incr_pspace(PS_STDERR, X &info->f_pname, 1) < 0) { X print_toolong(keyword, arg, len); X info->f_xflags |= F_BAD_META; X return; X } X info->f_name = info->f_pname.ps_path; X } else X break; X } while (1); X X if (ret) { X info->f_namelen = len; X info->f_xflags |= XF_PATH; X } else { X bad_utf8(keyword, arg); X } X } X} X X/* X * get link path (if name length is > 100 chars or if contains non ASCII chars) X */ X/* ARGSUSED */ XLOCAL void Xget_lpath(info, keyword, klen, arg, len) X FINFO *info; X char *keyword; X int klen; X char *arg; X int len; X{ X if (len == 0) { X info->f_xflags &= ~XF_LINKPATH; X return; X } X X /* X * Check whether we are called via get_xhtype() -> xhparse() X */ X if (info->f_lname == NULL) X return; X X if (ginfo.f_xflags & XF_BINARY) { X if (strlcpy_pspace(PS_STDERR, &info->f_plname, arg, len) < 0) { X print_toolong(keyword, arg, len); X info->f_xflags |= F_BAD_META; X return; X } X info->f_lname = info->f_plname.ps_path; X info->f_lnamelen = len; X info->f_xflags |= XF_LINKPATH; X } else { X int ilen = len; X BOOL ret; X X do { X len = ilen; X ret = from_utf8((Uchar *)info->f_lname, X info->f_plname.ps_size, X (Uchar *)arg, &len); X if (len >= info->f_plname.ps_size) { X /* X * An increment of 1 is OK, since it is unlikely X * that the path grows by more than 256 per dir. X */ X if (incr_pspace(PS_STDERR, X &info->f_plname, 1) < 0) { X print_toolong(keyword, arg, len); X info->f_xflags |= F_BAD_META; X return; X } X info->f_lname = info->f_plname.ps_path; X } else X break; X } while (1); X X if (ret) { X info->f_lnamelen = len; X info->f_xflags |= XF_LINKPATH; X } else { X bad_utf8(keyword, arg); X } X } X} X X/* X * get size, either real size or size on tape (usually when size is > 8 GB) X * The file size is doubtlessly an ungined integer X */ X/* ARGSUSED */ XLOCAL void Xget_size(info, keyword, klen, arg, len) X FINFO *info; X char *keyword; X int klen; X char *arg; X int len; X{ X Ullong ull; X X if (len == 0) { X info->f_xflags &= ~XF_SIZE; X return; X } X if (get_unumber(keyword, arg, &ull, OFF_T_MAX)) { X info->f_xflags |= XF_SIZE; X info->f_llsize = ull; X info->f_rsize = (off_t)ull; X if (info->f_rsize != ull) { X xh_rangeerr(keyword, arg, len); X ull = 0; X info->f_flags |= (F_BAD_META | F_BAD_SIZE); X info->f_rsize = (off_t)ull; X } X /* X * If real size is not yet known, copy over the tape size to X * avoid problems. If real size is found later, it will X * overwrite unconditional. X */ X if ((info->f_xflags & XF_REALSIZE) == 0) { X info->f_xflags |= XF_REALSIZE; X info->f_size = (off_t)ull; X } X } X} X X/* X * get real file size (usually when size is > 8 GB) X * The real file size is doubtlessly an ungined integer X */ X/* ARGSUSED */ XLOCAL void Xget_realsize(info, keyword, klen, arg, len) X FINFO *info; X char *keyword; X int klen; X char *arg; X int len; X{ X Ullong ull; X X if (len == 0) { X info->f_xflags &= ~XF_REALSIZE; X return; X } X if (get_unumber(keyword, arg, &ull, OFF_T_MAX)) { X info->f_xflags |= XF_REALSIZE; X info->f_size = (off_t)ull; X if (info->f_size != ull) { X xh_rangeerr(keyword, arg, len); X info->f_size = (off_t)0; X } X } X} X X/* X * get multivolume file offset (usually when size is > 8 GB) X * The multivolume file offset is doubtlessly an ungined integer X */ X/* ARGSUSED */ XLOCAL void Xget_offset(info, keyword, klen, arg, len) X FINFO *info; X char *keyword; X int klen; X char *arg; X int len; X{ X Ullong ull; X X if (len == 0) { X info->f_xflags &= ~XF_OFFSET; X return; X } X if (get_unumber(keyword, arg, &ull, OFF_T_MAX)) { X info->f_xflags |= XF_OFFSET; X info->f_contoffset = (off_t)ull; X if (info->f_contoffset != ull) { X xh_rangeerr(keyword, arg, len); X info->f_contoffset = (off_t)0; X } X } X} X X/* X * get major device number (always vendor unique) X * The major device number should be unsigned but POSIX does not say anything X * about the content and defined dev_t to be a signed int. X */ X/* ARGSUSED */ XLOCAL void Xget_major(info, keyword, klen, arg, len) X FINFO *info; X char *keyword; X int klen; X char *arg; X int len; X{ X Ullong ull; X BOOL neg = FALSE; X dev_t d; X X if (len == 0) { X info->f_xflags &= ~XF_DEVMAJOR; X return; X } X if (get_snumber(keyword, arg, &ull, &neg, X -(Ullong)MAJOR_T_MIN, MAJOR_T_MAX)) { X info->f_xflags |= XF_DEVMAJOR; X if (neg) X info->f_rdevmaj = -ull; X else X info->f_rdevmaj = ull; X d = makedev(info->f_rdevmaj, 0); X d = major(d); X if ((neg && -d != ull) || (!neg && d != ull)) { X xh_rangeerr(keyword, arg, len); X info->f_flags |= F_BAD_META; X } X } X} X X/* X * get minor device number (always vendor unique) X * The minor device number should be unsigned but POSIX does not say anything X * about the content and defined dev_t to be a signed int. X */ X/* ARGSUSED */ XLOCAL void Xget_minor(info, keyword, klen, arg, len) X FINFO *info; X char *keyword; X int klen; X char *arg; X int len; X{ X Ullong ull; X BOOL neg = FALSE; X dev_t d; X X if (len == 0) { X info->f_xflags &= ~XF_DEVMINOR; X return; X } X if (get_snumber(keyword, arg, &ull, &neg, X -(Ullong)MINOR_T_MIN, MINOR_T_MAX)) { X info->f_xflags |= XF_DEVMINOR; X if (neg) X info->f_rdevmin = -ull; X else X info->f_rdevmin = ull; X d = makedev(0, info->f_rdevmin); X d = minor(d); X if ((neg && -d != ull) || (!neg && d != ull)) { X xh_rangeerr(keyword, arg, len); X info->f_flags |= F_BAD_META; X } X } X} X X/* X * get number of minor bits for this file (vendor unique) X * This is naturally unsigned. X */ X/* ARGSUSED */ XLOCAL void Xget_minorbits(info, keyword, klen, arg, len) X FINFO *info; X char *keyword; X int klen; X char *arg; X int len; X{ X Ullong ull; X X if (len == 0) { X info->f_devminorbits = 0; X return; X } X if (get_unumber(keyword, arg, &ull, INO_T_MAX)) { X info->f_devminorbits = ull; X if (info->f_devminorbits != ull) { X xh_rangeerr(keyword, arg, len); X info->f_devminorbits = 0; X } X } X} X X/* X * get device number of device containing FS (vendor unique) X * The device number should be unsigned but POSIX does not say anything X * about the content and defined dev_t to be a signed int. X */ X/* ARGSUSED */ XLOCAL void Xget_dev(info, keyword, klen, arg, len) X FINFO *info; X char *keyword; X int klen; X char *arg; X int len; X{ X Ullong ull; X BOOL neg = FALSE; X X info->f_devmaj = 0; X info->f_devmin = 0; X if (len == 0) { X info->f_dev = 0; X return; X } X if (get_snumber(keyword, arg, &ull, &neg, X -(Ullong)DEV_T_MIN, DEV_T_MAX)) { X int mbits; X Llong ll; X X if (neg) X info->f_dev = ll = -ull; X else X info->f_dev = ll = ull; X X mbits = info->f_devminorbits; X if (mbits == 0) X mbits = ginfo.f_devminorbits; X if (mbits) { X int oerr = geterrno(); X X seterrno(0); X info->f_devmaj = _dev_major(mbits, ll); X info->f_devmin = _dev_minor(mbits, ll); X info->f_dev = makedev(info->f_devmaj, info->f_devmin); X ull = dev_make(info->f_devmaj, info->f_devmin); X /* X * Check whether the device from the archive X * can be represented on the local system. X */ X if (geterrno() || X info->f_devmaj != major(info->f_dev) || X info->f_devmin != minor(info->f_dev) || X (Ullong)info->f_dev != ull) { X xh_rangeerr(keyword, arg, len); X info->f_dev = 0; X info->f_devmaj = 0; X info->f_devmin = 0; X } X seterrno(oerr); X return; X } X /* X * Let us hope that both, the archiving and the X * extracting system use the same major()/minor() X * mapping. X */ X info->f_devmaj = major(ll); X info->f_devmin = minor(ll); X X if ((neg && -info->f_dev != ull) || X (!neg && info->f_dev != ull)) { X xh_rangeerr(keyword, arg, len); X info->f_dev = 0; X } X } X} X X/* X * get inode number for this file (vendor unique) X * POSIX defines ino_t to be unsigned. X */ X/* ARGSUSED */ XLOCAL void Xget_ino(info, keyword, klen, arg, len) X FINFO *info; X char *keyword; X int klen; X char *arg; X int len; X{ X Ullong ull; X X if (len == 0) { X info->f_ino = 0; X return; X } X if (get_unumber(keyword, arg, &ull, INO_T_MAX)) { X info->f_ino = ull; X if (info->f_ino != ull) { X xh_rangeerr(keyword, arg, len); X info->f_ino = 0; X } X } X} X X/* X * get link count for this file (vendor unique) X * POSIX defines nlink_t to ne signed but all real link counts in archives X * need to be positive numbers. X */ X/* ARGSUSED */ XLOCAL void Xget_nlink(info, keyword, klen, arg, len) X FINFO *info; X char *keyword; X int klen; X char *arg; X int len; X{ X Ullong ull; X X if (len == 0) { X info->f_nlink = 0; X return; X } X if (get_unumber(keyword, arg, &ull, NLINK_T_MAX)) { X info->f_nlink = ull; X if (info->f_nlink != ull) { X xh_rangeerr(keyword, arg, len); X info->f_nlink = 0; X } X } X} X X/* X * get tar file type or real file type for this file (vendor unique) X */ X/* ARGSUSED */ XLOCAL void Xget_filetype(info, keyword, klen, arg, len) X FINFO *info; X char *keyword; X int klen; X char *arg; X int len; X{ X int i; X X if (len == 0) { X if (keyword[7] == 'f') /* "SCHILY.filetype" */ X info->f_rxftype = XT_BAD; X else X info->f_xftype = XT_BAD; X return; X } X X for (i = 0; i <= XT_BAD; i++) { X if (xtnamelen_tab[i] != len) X continue; X if (streql(xttoname_tab[i], arg)) X break; X } X if (i >= XT_BAD) /* Use type from tarhdr */ X return; X X if (keyword[7] == 'f') { /* "SCHILY.filetype" */ X info->f_rxftype = i; X info->f_filetype = XTTOST(info->f_rxftype); X info->f_type = XTTOIF(info->f_rxftype); X } else { /* "SCHILY.tarfiletype" */ X info->f_xftype = i; X } X} X X#ifdef USE_ACL X X/* X * XXX acl_access_text/acl_default_text are a bad idea. (see acl_unix.c) X */ XLOCAL pathstore_t acl_access_text; XLOCAL pathstore_t acl_default_text; X X/* ARGSUSED */ XLOCAL void Xget_acl_type(info, keyword, klen, arg, len) X FINFO *info; X char *keyword; X int klen; X char *arg; X int len; X{ X if (len == 11 && streql(arg, "POSIX draft")) X return; X if (len == 5 && streql(arg, "NFSv4")) X return; X X info->f_flags |= F_BAD_ACL; X X if (badf & F_BAD_ACL) X return; X errmsgno(EX_BAD, X "Unknown ACL type '%s' ignored at %lld.\n", X arg, tblocks()); X badf |= F_BAD_ACL; X} X X/* ARGSUSED */ XLOCAL void Xget_acl_access(info, keyword, klen, arg, len) X FINFO *info; X char *keyword; X int klen; X char *arg; X int len; X{ X if (len == 0 || (info->f_flags & F_BAD_ACL)) { X info->f_xflags &= ~XF_ACL_ACCESS; X info->f_acl_access = NULL; X return; X } X if ((len + 2) > acl_access_text.ps_size) X grow_pspace(PS_EXIT, &acl_access_text, (len + 2)); X if (acl_access_text.ps_path == NULL) X return; X if (ginfo.f_xflags & XF_BINARY) { X strcpy(acl_access_text.ps_path, arg); X info->f_xflags |= XF_ACL_ACCESS; X info->f_acl_access = acl_access_text.ps_path; X } else if (from_utf8((Uchar *)acl_access_text.ps_path, X acl_access_text.ps_size, X (Uchar *)arg, &len)) { X info->f_xflags |= XF_ACL_ACCESS; X info->f_acl_access = acl_access_text.ps_path; X } else { X bad_utf8(keyword, arg); X } X} X X/* ARGSUSED */ XLOCAL void Xget_acl_default(info, keyword, klen, arg, len) X FINFO *info; X char *keyword; X int klen; X char *arg; X int len; X{ X if (len == 0 || (info->f_flags & F_BAD_ACL)) { X info->f_xflags &= ~XF_ACL_DEFAULT; X info->f_acl_default = NULL; X return; X } X if ((len + 2) > acl_default_text.ps_size) X grow_pspace(PS_EXIT, &acl_default_text, (len + 2)); X if (acl_default_text.ps_path == NULL) X return; X if (ginfo.f_xflags & XF_BINARY) { X strcpy(acl_default_text.ps_path, arg); X info->f_xflags |= XF_ACL_DEFAULT; X info->f_acl_default = acl_default_text.ps_path; X } else if (from_utf8((Uchar *)acl_default_text.ps_path, X acl_default_text.ps_size, X (Uchar *)arg, &len)) { X info->f_xflags |= XF_ACL_DEFAULT; X info->f_acl_default = acl_default_text.ps_path; X } else { X bad_utf8(keyword, arg); X } X} X XLOCAL pathstore_t acl_ace_text; X X/* ARGSUSED */ XLOCAL void Xget_acl_ace(info, keyword, klen, arg, len) X FINFO *info; X char *keyword; X int klen; X char *arg; X int len; X{ X if (len == 0 || (info->f_flags & F_BAD_ACL)) { X info->f_xflags &= ~XF_ACL_ACE; X info->f_acl_ace = NULL; X return; X } X if ((len + 2) > acl_ace_text.ps_size) X grow_pspace(PS_EXIT, &acl_ace_text, (len + 2)); X if (acl_ace_text.ps_path == NULL) X return; X if (ginfo.f_xflags & XF_BINARY) { X strcpy(acl_ace_text.ps_path, arg); X info->f_xflags |= XF_ACL_ACE; X info->f_acl_ace = acl_ace_text.ps_path; X } else if (from_utf8((Uchar *)acl_ace_text.ps_path, X acl_ace_text.ps_size, X (Uchar *)arg, &len)) { X info->f_xflags |= XF_ACL_ACE; X info->f_acl_ace = acl_ace_text.ps_path; X } else { X bad_utf8(keyword, arg); X } X} X X#endif /* USE_ACL */ X X#ifdef USE_XATTR X X/* ARGSUSED */ XLOCAL void Xget_attr(info, keyword, klen, arg, len) X FINFO *info; X char *keyword; X int klen; X char *arg; X int len; X{ X register star_xattr_t *x; X register int num = 0; X X if (len == 0) { X /* X * This is not the right way as we clear all xattr info. X */ X if (static_xattr) { X free(static_xattr); X static_xattr = NULL; X } X info->f_fflags = 0; X info->f_xflags &= ~XF_FFLAGS; X return; X } X if (static_xattr) { X for (x = static_xattr; x->name; x++) X num++; X x = ___realloc(static_xattr, X (num+2) * sizeof (star_xattr_t), "extended attribute"); X } else { X x = ___malloc( X (num+2) * sizeof (star_xattr_t), "extended attribute"); X } X static_xattr = x; X x += num; X X /* X * should always succeed ... X */ X if (strncmp(keyword, "SCHILY.xattr.", 13) == 0) X keyword += 13; X X x->name = ___malloc(strlen(keyword)+1, "extended attribute"); X x->value = ___malloc(len+1, "extended attribute"); X strcpy(x->name, keyword); X x->value_len = len; X movebytes(arg, x->value, len); X ((char *)x->value)[len] = '\0'; X fillbytes(x+1, sizeof (star_xattr_t), '\0'); X X info->f_xattr = static_xattr; X info->f_xflags |= XF_XATTR; X} X X#endif /* USE_XATTR */ X X#ifdef USE_FFLAGS X X/* ARGSUSED */ XLOCAL void Xget_xfflags(info, keyword, klen, arg, len) X FINFO *info; X char *keyword; X int klen; X char *arg; X int len; X{ X if (len == 0) { X info->f_fflags = 0; X info->f_xflags &= ~XF_FFLAGS; X return; X } X texttoflags(info, arg); X info->f_xflags |= XF_FFLAGS; X} X X#endif /* USE_FFLAGS */ X X/* ARGSUSED */ XLOCAL void Xget_dir(info, keyword, klen, arg, len) X FINFO *info; X char *keyword; X int klen; X char *arg; X int len; X{ X info->f_dir = 0; X info->f_dirlen = 0; X X if (len == 0) X return; X /* X * Old archives had only one nul at the end. X * Note that we propagate the space from the xheader extract buffer X * to the extraction process (e.g. diff.c or incremental restore.c) X */ X if (arg[len-2] != '\0') X arg[len++] = '\0'; /* Kill '\n' */ X X if (ginfo.f_xflags & XF_BINARY) { X ; X } else { X /* X * The non UTF-8 string is shorter so we convert in place. X */ X from_utf8((Uchar *)arg, len, (Uchar *)arg, &len); X } X info->f_dir = arg; X info->f_dirlen = len; X} X X/* ARGSUSED */ XLOCAL void Xget_iarray(info, keyword, klen, arg, len) X FINFO *info; X char *keyword; X int klen; X char *arg; X int len; X{ X register int dirents = 0; X register int i; X register char *p = arg; X register ino_t *ino; X Ullong ull; X X if (info->f_dirinos) X free(info->f_dirinos); X info->f_dirinos = NULL; X info->f_dirents = 0; X X if (len == 0) X return; X X while (p) { X if (*p == ' ') X p++; X p = strchr(p, ' '); X dirents++; X } X ino = ___malloc(dirents * sizeof (ino_t), "inos"); X X for (p = arg, i = 0; i < dirents; i++) { X if (*p == ' ') X p++; X seterrno(0); X p = astoullb(p, &ull, 10); X if (*p != ' ' && *p != '\0') { X errmsgno(EX_BAD, X "Bad number '%s' for '%s' in extended header al %lld.\n", X arg, keyword, tblocks()); X /* XXX ino -> 0 and continue instead? */ X free(ino); X return; X } else { X if (geterrno() != 0) { X errmsgno(EX_BAD, X "Number overflow with '%s' for '%s' in extended header at %lld.\n", X arg, keyword, tblocks()); X /* XXX ino -> 0 and continue instead? */ X free(ino); X return; X } X } X if (ull > INO_T_MAX) { X xh_rangeerr(keyword, arg, len); X ino[i] = 0; X } else { X ino[i] = ull; X } X } X info->f_dirinos = ino; X info->f_dirents = dirents; X} X X/* ARGSUSED */ XLOCAL void Xget_release(info, keyword, klen, arg, len) X FINFO *info; X char *keyword; X int klen; X char *arg; X int len; X{ X if (len == 0) { X if (grip->release) { X if ((grip->gflags & GF_NOALLOC) == 0) X free(grip->release); X grip->release = NULL; X } X grip->gflags &= ~GF_RELEASE; X return; X } X if (ginfo.f_xflags & XF_BINARY) { X ; X } else { X /* X * The non UTF-8 string is shorter so we convert in place. X */ X from_utf8((Uchar *)arg, len, (Uchar *)arg, &len); X } X grip->gflags |= GF_RELEASE; X grip->release = ___savestr(arg); X} X X/* ARGSUSED */ XLOCAL void Xget_archtype(info, keyword, klen, arg, len) X FINFO *info; X char *keyword; X int klen; X char *arg; X int len; X{ X if (len == 0) { X grip->gflags &= ~GF_ARCHTYPE; X grip->archtype = H_UNDEF; X return; X } X grip->gflags |= GF_ARCHTYPE; X grip->archtype = hdr_type(arg); X} X X/* X * Get the charset used for path, linkpath, uname and gname. X */ X/* ARGSUSED */ XLOCAL void Xget_hdrcharset(info, keyword, klen, arg, len) X FINFO *info; X char *keyword; X int klen; X char *arg; X int len; X{ X#ifdef __needed__ X BOOL is_global = info == &ginfo; X#endif X X if (len == 23 && streql("ISO-IR 10646 2000 UTF-8", arg)) { X info->f_xflags &= ~XF_BINARY; X } else if (len == 6 && streql("BINARY", arg)) { X info->f_xflags |= XF_BINARY; X } else { X unsup_arg(keyword, arg); X } X} X X/* X * Dummy 'get' function used for all fields that we don't yet understand or X * fields that we indent to ignore. X */ X/* ARGSUSED */ XLOCAL void Xget_dummy(info, keyword, klen, arg, len) X FINFO *info; X char *keyword; X int klen; X char *arg; X int len; X{ X} X XLOCAL void Xunsup_arg(keyword, arg) X char *keyword; X char *arg; X{ X errmsgno(EX_BAD, X "Unsupported arg '%s' for '%s' in extended header at %lld.\n", X arg, keyword, tblocks()); X} X XLOCAL void Xbad_utf8(keyword, arg) X char *keyword; X char *arg; X{ X errmsgno(EX_BAD, "Bad UTF-8 arg '%s' for '%s' in extended header at %lld.\n", X arg, keyword, tblocks()); X} END-of-star-1.6/star/xheader.c echo x - star-1.6/star/props.c sed 's/^X//' >star-1.6/star/props.c << 'END-of-star-1.6/star/props.c' X/* @(#)props.c 1.65 19/01/07 Copyright 1994-2019 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)props.c 1.65 19/01/07 Copyright 1994-2019 J. Schilling"; X#endif X/* X * Set up properties for different archive types X * X * NOTE that part of the information in struct propertiesis available more X * than once. This is needed as different parts of the source need the X * information in different ways. Partly for performance reasons, partly X * because one method of storing the information is inappropriate for all X * places in the source. X * X * If you add new features or information related to the fields X * pr_flags/pr_nflags or the fields pr_xftypetab[]/pr_typeflagtab[] X * take care of possible problems due to this fact. X * X * Copyright (c) 1994-2019 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include "star.h" X#include "props.h" X#include "table.h" X#include "diff.h" X#include X#define GT_COMERR /* #define comerr gtcomerr */ X#define GT_ERROR /* #define error gterror */ X#include X#include "starsubs.h" X Xextern BOOL debug; Xextern BOOL dodump; X Xstruct properties props; X XEXPORT void setprops __PR((long htype)); XEXPORT void printprops __PR((void)); XLOCAL void prsettypeflags __PR((char *types, int typeflag)); X XEXPORT void Xsetprops(htype) X long htype; X{ X fillbytes(props.pr_typeflagtab, sizeof (props.pr_typeflagtab), '\0'); X X switch (H_TYPE(htype)) { X X case H_STAR: /* Old star format (1985) */ X props.pr_maxsize = 0; X props.pr_hdrsize = TAR_HDRSZ; X props.pr_flags = PR_LOCAL_STAR|PR_SPARSE|PR_VOLHDR|PR_BASE256; X props.pr_xhdflags = 0; X props.pr_xhmask = 0; X props.pr_fillc = ' '; /* Use old tar octal format */ X props.pr_xc = 'x'; /* Use POSIX.1-2001 x-hdr */ X props.pr_pad = 0; X props.pr_diffmask = 0L; X props.pr_nflags = X PR_POSIX_SPLIT|PR_PREFIX_REUSED|PR_LONG_NAMES; X#ifdef HAVE_FCHDIR X props.pr_maxnamelen = INT_MAX; X props.pr_maxlnamelen = INT_MAX; X#else X props.pr_maxnamelen = PATH_MAX; X props.pr_maxlnamelen = PATH_MAX; X#endif X props.pr_maxsname = NAMSIZ; X props.pr_maxslname = NAMSIZ; X props.pr_maxprefix = PFXSIZ; X props.pr_sparse_in_hdr = 0; X /* X * The STAR format extensions from 1986 archive nearly any UNIX file type X */ X movebytes(xtstar_tab, props.pr_xftypetab, sizeof (props.pr_xftypetab)); X X /* X * The STAR format is pre-POSIX but supports many POSIX/GNU X * extensions. X */ X prsettypeflags("01234567gxIKLMSV", TF_VALIDTYPE); X prsettypeflags("gxKL", TF_XHEADERS); X break; X X case H_XSTAR: /* ext P-1988 format (1994) */ X case H_XUSTAR: /* ext ^ no "tar" sig (1998) */ X case H_EXUSTAR: /* ext P-2001 format (2001) */ X props.pr_maxsize = 0; X props.pr_hdrsize = TAR_HDRSZ; X props.pr_flags = X PR_POSIX_OCTAL|PR_LOCAL_STAR|PR_SPARSE| X PR_MULTIVOL|PR_VOLHDR|PR_BASE256; X props.pr_xhdflags = 0; X props.pr_xhmask = 0; X if (H_TYPE(htype) == H_XUSTAR || H_TYPE(htype) == H_EXUSTAR) { X props.pr_flags |= (PR_XHDR|PR_VU_XHDR); X props.pr_xhmask = ~0; /* xustar/exustar supp. all */ X } X if (H_TYPE(htype) == H_EXUSTAR) { X props.pr_flags |= PR_LINK_DATA; X props.pr_xhdflags |= (XF_ATIME|XF_CTIME|XF_MTIME); X } X props.pr_fillc = '0'; /* Use ustar octal format */ X props.pr_xc = 'x'; /* Use POSIX.1-2001 x-hdr */ X props.pr_pad = 0; X props.pr_diffmask = 0L; X props.pr_nflags = X PR_POSIX_SPLIT|PR_PREFIX_REUSED|PR_LONG_NAMES; X#ifdef HAVE_FCHDIR X props.pr_maxnamelen = INT_MAX; X props.pr_maxlnamelen = INT_MAX; X#else X props.pr_maxnamelen = PATH_MAX; X props.pr_maxlnamelen = PATH_MAX; X#endif X props.pr_maxsname = NAMSIZ; X props.pr_maxslname = NAMSIZ; X props.pr_maxprefix = 130; X props.pr_sparse_in_hdr = 0; X /* X * As long as we don't support the POSIX.1-2001 speudo 'x' file X * We can only archive file types from the USTAR list and X * sparse files as well as X * meta files (regular files without archived content). X */ X movebytes(xtustar_tab, props.pr_xftypetab, sizeof (props.pr_xftypetab)); X props.pr_xftypetab[XT_SPARSE] = 1; X props.pr_xftypetab[XT_META] = 1; X X /* X * Extended PAX format may allow more filetypes in a vendor X * unique extension of the POSIX.1-2001 extended headers. X * XXX As we currently only add the SCHILY.filetype headers X * XXX if -dump has been specified, we can only allow more X * XXX filetypes in this case. X */ X if (dodump && H_TYPE(htype) == H_EXUSTAR) X movebytes(xtexustar_tab, props.pr_xftypetab, sizeof (props.pr_xftypetab)); X X /* X * The X-STAR format family is POSIX with extensions. X */ X prsettypeflags("01234567gxIKLMSV", TF_VALIDTYPE); X prsettypeflags("gxKL", TF_XHEADERS); X break; X X case H_PAX: /* ieee 1003.1-2001 ext ustar */ X case H_EPAX: /* ieee 1003.1-2001 ext ustar + xheader */ X case H_USTAR: /* ieee 1003.1-1988 ustar */ X case H_SUNTAR: /* Sun's tar from Solaris 7-9 */ X props.pr_maxsize = MAXOCTAL11; X props.pr_hdrsize = TAR_HDRSZ; X props.pr_flags = PR_POSIX_OCTAL; X if (H_TYPE(htype) == H_PAX || X H_TYPE(htype) == H_EPAX || X H_TYPE(htype) == H_SUNTAR) { X props.pr_maxsize = 0; X props.pr_flags |= PR_XHDR; X } X props.pr_xhdflags = 0; X props.pr_xhmask = 0; X if (H_TYPE(htype) == H_PAX || X H_TYPE(htype) == H_EPAX) X props.pr_xhmask = XF_POSIX; X if (H_TYPE(htype) == H_EPAX) { X props.pr_xhdflags |= (XF_ATIME|XF_CTIME|XF_MTIME); X } X props.pr_fillc = '0'; /* Use ustar octal format */ X props.pr_xc = 'x'; /* Use POSIX.1-2001 x-hdr */ X props.pr_pad = 0; X if (H_TYPE(htype) == H_SUNTAR) { X props.pr_flags |= PR_VU_XHDR; X props.pr_xhdflags = XF_MTIME; X props.pr_xhmask = XF_MTIME|XF_UID|XF_UNAME| X XF_GID|XF_GNAME| X XF_PATH|XF_LINKPATH| X XF_SIZE|XF_DEVMAJOR|XF_DEVMINOR; X props.pr_xc = 'X'; /* Use Sun Solaris X-hdr */ X } X props.pr_diffmask = (D_SPARS|D_ATIME|D_CTIME); X if (H_TYPE(htype) == H_PAX || X H_TYPE(htype) == H_EPAX) { X props.pr_diffmask = 0L; X } X props.pr_nflags = PR_POSIX_SPLIT; X props.pr_maxnamelen = NAMSIZ + 1 + PFXSIZ; /* 256 */ X props.pr_maxlnamelen = NAMSIZ; X if (H_TYPE(htype) == H_PAX || X H_TYPE(htype) == H_EPAX || X H_TYPE(htype) == H_SUNTAR) { X props.pr_nflags |= PR_LONG_NAMES; X#ifdef HAVE_FCHDIR X props.pr_maxnamelen = INT_MAX; X props.pr_maxlnamelen = INT_MAX; X#else X props.pr_maxnamelen = PATH_MAX; X props.pr_maxlnamelen = PATH_MAX; X#endif X } X if (H_TYPE(htype) == H_SUNTAR) { X props.pr_maxnamelen = PATH_MAX; X props.pr_maxlnamelen = PATH_MAX; X } X props.pr_maxsname = NAMSIZ; X props.pr_maxslname = NAMSIZ; X props.pr_maxprefix = PFXSIZ; X props.pr_sparse_in_hdr = 0; X /* X * USTAR is limited to 7 basic file types X */ X movebytes(xtustar_tab, props.pr_xftypetab, sizeof (props.pr_xftypetab)); X X /* X * Even the USTAR format should support POSIX extension headers. X */ X prsettypeflags("01234567gx", TF_VALIDTYPE); X prsettypeflags("gx", TF_XHEADERS); X if (H_TYPE(htype) == H_SUNTAR) { X prsettypeflags("01234567gxX", TF_VALIDTYPE); X prsettypeflags("gxX", TF_XHEADERS); X } X break; X X case H_GNUTAR: /* gnu tar format (1989) */ X props.pr_maxsize = 0; X props.pr_hdrsize = TAR_HDRSZ; X props.pr_flags = X PR_LOCAL_GNU|PR_SPARSE|PR_GNU_SPARSE_BUG|PR_VOLHDR|PR_BASE256; X props.pr_xhdflags = 0; X props.pr_xhmask = 0; X props.pr_fillc = ' '; /* Use old tar octal format */ X props.pr_xc = 'x'; /* Really ??? */ X props.pr_pad = 0; X props.pr_diffmask = 0L; X props.pr_nflags = PR_LONG_NAMES; X#ifdef HAVE_FCHDIR X /* X * GNU tar cannot extract archives with long path names but X * under some conditions creates them. For this reason, it X * does not seem to be a problem if we do not prevent to X * create "gnutar" archives with long path names. X */ X props.pr_maxnamelen = INT_MAX; X props.pr_maxlnamelen = INT_MAX; X#else X props.pr_maxnamelen = PATH_MAX; X props.pr_maxlnamelen = PATH_MAX; X#endif X props.pr_maxsname = NAMSIZ-1; X props.pr_maxslname = NAMSIZ-1; X props.pr_maxprefix = 0; X props.pr_sparse_in_hdr = SPARSE_IN_HDR; X /* X * GNU tar is limited to the USTAR file types + sparse files X */ X movebytes(xtustar_tab, props.pr_xftypetab, sizeof (props.pr_xftypetab)); X props.pr_xftypetab[XT_SPARSE] = 1; X X prsettypeflags("01234567DKLMNSV", TF_VALIDTYPE); X prsettypeflags("KL", TF_XHEADERS); X break; X X default: X errmsgno(EX_BAD, "setprops: unexpected header type %ld '%s' (%s).\n", X htype, X hdr_name(htype), X hdr_text(htype)); X errmsgno(EX_BAD, "setprops: defaulting to '%s' (%s).\n", X hdr_name(H_OTAR), X hdr_text(H_OTAR)); X /* FALLTHRU */ X case H_UNDEF: /* from star main read mode */ X case H_TAR: /* tar with unknown format */ X case H_V7TAR: /* tar old UNIX V7 format */ X case H_OTAR: /* tar old BSD format (1978) */ X /* X * Since the large file summit was in 1995, we may assume X * that any large file aware TAR implementation must be POSIX X * compliant too. The only known exception is GNU tar which X * is recognised separately. X * Limit max file size to the max that is supported X * by non large file aware systems. X */ X props.pr_maxsize = MAXNONLARGEFILE; X props.pr_hdrsize = TAR_HDRSZ; X props.pr_flags = 0; X props.pr_xhdflags = 0; X props.pr_xhmask = 0; X props.pr_fillc = ' '; /* Use old tar octal format */ X props.pr_xc = 'x'; /* Really ??? */ X props.pr_pad = 0; X props.pr_diffmask = (D_SPARS|D_ATIME|D_CTIME); X props.pr_nflags = PR_DUMB_EOF; X props.pr_maxnamelen = NAMSIZ-1; X props.pr_maxlnamelen = NAMSIZ-1; X props.pr_maxsname = NAMSIZ-1; X props.pr_maxslname = NAMSIZ-1; X props.pr_maxprefix = 0; X props.pr_sparse_in_hdr = 0; X /* X * Only a very limited set of file types (file,symlink,dir) X */ X if (H_TYPE(htype) == H_V7TAR) X movebytes(xtv7tar_tab, props.pr_xftypetab, sizeof (props.pr_xftypetab)); X else X movebytes(xttar_tab, props.pr_xftypetab, sizeof (props.pr_xftypetab)); X X /* X * Old BSD tar does no know about file types beyond "012" but X * the USTAR basic format has been designed to be compatible X * with the old tar format. X * OLD UNIX V7 tar does not know anything but plain files and X * hard links. Note that we never see H_TYPE(htype) == H_V7TAR X * in extract mode. X */ X if (H_TYPE(htype) == H_V7TAR) X prsettypeflags("01", TF_VALIDTYPE); X else X prsettypeflags("01234567", TF_VALIDTYPE); X prsettypeflags("", TF_XHEADERS); X break; X X case H_BAR: /* Sun bar format */ X props.pr_maxsize = MAXNONLARGEFILE; /* bar is pre-largefile */ X props.pr_hdrsize = BAR_HDRSZ; X props.pr_flags = 0; X props.pr_xhdflags = 0; X props.pr_xhmask = 0; X props.pr_fillc = ' '; /* Use old tar octal format */ X props.pr_xc = 'x'; /* Really ??? */ X props.pr_pad = 0; X props.pr_diffmask = (D_SPARS|D_ATIME|D_CTIME); X props.pr_nflags = PR_DUMB_EOF; X props.pr_maxnamelen = PATH_MAX; X props.pr_maxlnamelen = PATH_MAX; X props.pr_maxsname = NAMSIZ-1; /* XXX Really ??? */ X props.pr_maxslname = NAMSIZ-1; /* XXX Really ??? */ X props.pr_maxprefix = 0; X props.pr_sparse_in_hdr = 0; X /* X * BAR is limited to 7 basic file types X */ X movebytes(xtcpio_tab, props.pr_xftypetab, sizeof (props.pr_xftypetab)); X props.pr_xftypetab[XT_SOCK] = 0; X break; X X case H_CPIO_BIN: X props.pr_maxsize = MAXNONLARGEFILE; X props.pr_hdrsize = CPIOBIN_HDRSZ; X props.pr_flags = PR_CPIO; X props.pr_xhdflags = 0; X props.pr_xhmask = 0; X props.pr_fillc = '0'; X props.pr_xc = 'x'; /* Not needed */ X props.pr_pad = 1; X props.pr_diffmask = (D_SPARS|D_ATIME|D_CTIME); X props.pr_nflags = PR_LONG_NAMES; X props.pr_maxnamelen = 256; X props.pr_maxlnamelen = PATH_MAX; X props.pr_maxsname = NAMSIZ-1; /* XXX Really ??? */ X props.pr_maxslname = NAMSIZ-1; /* XXX Really ??? */ X props.pr_maxprefix = 0; X props.pr_sparse_in_hdr = 0; X /* X * CPIO is limited to 7 basic file types X */ X movebytes(xtcpio_tab, props.pr_xftypetab, sizeof (props.pr_xftypetab)); X props.pr_xftypetab[XT_SOCK] = 0; X break; X X case H_CPIO_CHR: X case H_CPIO_ODC: X props.pr_maxsize = MAXOCTAL11; X props.pr_hdrsize = CPIOODC_HDRSZ; X props.pr_flags = PR_CPIO; X props.pr_xhdflags = 0; X props.pr_xhmask = 0; X props.pr_fillc = '0'; X props.pr_xc = 'x'; /* Not needed */ X props.pr_pad = 0; X props.pr_diffmask = (D_SPARS|D_ATIME|D_CTIME); X props.pr_nflags = PR_LONG_NAMES; X props.pr_maxnamelen = PATH_MAX; X props.pr_maxlnamelen = PATH_MAX; X props.pr_maxsname = NAMSIZ-1; /* XXX Really ??? */ X props.pr_maxslname = NAMSIZ-1; /* XXX Really ??? */ X props.pr_maxprefix = 0; X props.pr_sparse_in_hdr = 0; X /* X * CPIO is limited to 7 basic file types + sockets X */ X movebytes(xtcpio_tab, props.pr_xftypetab, sizeof (props.pr_xftypetab)); X X if (H_TYPE(htype) == H_CPIO_ODC) { X /* X * Be compatible to the useless SYSv cpio -Hodc X * limitations. X */ X props.pr_maxnamelen = 255; X props.pr_xftypetab[XT_SOCK] = 0; X } X break; X X case H_CPIO_ASC: X case H_CPIO_ACRC: X props.pr_maxsize = (unsigned long)0xFFFFFFFF; X props.pr_hdrsize = CPIOCRC_HDRSZ; X props.pr_flags = PR_CPIO | PR_SV_CPIO_LINKS; X props.pr_xhdflags = 0; X props.pr_xhmask = 0; X props.pr_fillc = '0'; X props.pr_xc = 'x'; /* Not needed */ X props.pr_pad = 3; X props.pr_diffmask = (D_SPARS|D_ATIME|D_CTIME); X props.pr_nflags = PR_LONG_NAMES; X props.pr_maxnamelen = PATH_MAX; X props.pr_maxlnamelen = PATH_MAX; X props.pr_maxsname = NAMSIZ-1; /* XXX Really ??? */ X props.pr_maxslname = NAMSIZ-1; /* XXX Really ??? */ X props.pr_maxprefix = 0; X props.pr_sparse_in_hdr = 0; X /* X * CPIO is limited to 7 basic file types X */ X movebytes(xtcpio_tab, props.pr_xftypetab, sizeof (props.pr_xftypetab)); X props.pr_xftypetab[XT_SOCK] = 0; X break; X } X if (debug) printprops(); X} X XEXPORT void Xprintprops() X{ Xextern long hdrtype; X error("hdrtype: %s (%ld)\n", hdr_name(hdrtype), hdrtype); X if (props.pr_maxsize) X error("pr_maxsize: %llu\n", (Ullong)props.pr_maxsize); X else X error("pr_maxsize: unlimited\n"); X error("pr_flags: 0x%X\n", props.pr_flags); X error("pr_xhdflags: 0x%X\n", props.pr_xhdflags); X error("pr_xhmask: 0x%X\n", props.pr_xhmask); X error("pr_fillc: '%c'\n", props.pr_fillc); X prdiffopts(stderr, "pr_diffmask: ", props.pr_diffmask); X error("pr_nflags: 0x%X\n", props.pr_nflags); X error("pr_maxnamelen: %d\n", props.pr_maxnamelen); X error("pr_maxlnamelen: %d\n", props.pr_maxlnamelen); X error("pr_maxsname: %d\n", props.pr_maxsname); X error("pr_maxslname: %d\n", props.pr_maxslname); X error("pr_maxprefix: %d\n", props.pr_maxprefix); X error("pr_sparse_in_hdr: %d\n", props.pr_sparse_in_hdr); X} X XLOCAL void Xprsettypeflags(types, typeflag) X char *types; X int typeflag; X{ X register Uchar *ucp = (Uchar *)types; X X /* X * 'Otar' flag for plain file is always a valid typeflag. X */ X if (typeflag == TF_VALIDTYPE) X props.pr_typeflagtab[0] = typeflag; X X while (*ucp != '\0') X props.pr_typeflagtab[*ucp++] |= typeflag; X} END-of-star-1.6/star/props.c echo x - star-1.6/star/props.h sed 's/^X//' >star-1.6/star/props.h << 'END-of-star-1.6/star/props.h' X/* @(#)props.h 1.24 10/08/27 Copyright 1994-2010 J. Schilling */ X/* X * Properties definitions to handle different X * archive types X * X * Copyright (c) 1994-2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X X/* X * Properties to describe the different archive formats. X * X * if pr_maxnamelen id == pr_maxsname, we cannot have long names X * besides file name splitting. X * X * NOTE that part of the information in struct propertiesis available more X * than once. This is needed as different parts of the source need the X * information in different ways. Partly for performance reasons, partly X * because one method of storing the information is inappropriate for all X * places in the source. X * X * If you add new features or information related to the fields X * pr_flags/pr_nflags or the fields pr_xftypetab[]/pr_typeflagtab[] X * take care of possible problems due to this fact. X * X */ Xstruct properties { X Ullong pr_maxsize; /* max file size */ X int pr_hdrsize; /* header size */ X int pr_flags; /* gerneral flags */ X int pr_xhdflags; /* default extended header flags */ X int pr_xhmask; /* supported extended header tags */ X char pr_fillc; /* fill prefix for numbers in TCB */ X char pr_xc; /* typeflag used for extended headers */ X char pr_pad; /* cpio filename/data size padding */ X long pr_diffmask; /* diffopts not supported */ X int pr_nflags; /* name related flags */ X int pr_maxnamelen; /* max length for filename */ X int pr_maxlnamelen; /* max length for linkname */ X int pr_maxsname; /* max length for short filename */ X int pr_maxslname; /* max length for short linkname */ X int pr_maxprefix; /* max length of prefix if splitting */ X int pr_sparse_in_hdr; /* # of sparse entries in header */ X char pr_xftypetab[32]; /* (*1) list of supported file types */ X char pr_typeflagtab[256]; /* (*2) list of supported TCB typeflg */ X}; X X/* X * 1) pr_xftypetab is used when creating archives only. X * 2) pr_typeflagtab is used when extracting archives only. X */ X X/* X * general flags (pr_flags) X */ X#define PR_POSIX_OCTAL 0x0001 /* left fill octal number with '0' */ X#define PR_LOCAL_STAR 0x0002 /* can handle local star filetypes */ X#define PR_LOCAL_GNU 0x0004 /* can handle local gnu filetypes */ X#define PR_CPIO 0x0008 /* Unblocked CPIO archive */ X#define PR_SPARSE 0x0010 /* can handle sparse files */ X#define PR_GNU_SPARSE_BUG 0x0020 /* size does not contain ext. headr */ X#define PR_VOLHDR 0x0100 /* can handle volume headers */ X#define PR_XHDR 0x0200 /* POSIX.1-2001 extended headers */ X#define PR_VU_XHDR 0x0400 /* emit vendor unique P-2001 xhdrs */ X#define PR_BASE256 0x0800 /* can handle base 256 for numbers */ X#define PR_MULTIVOL 0x1000 /* can handle reliable multi vol ar */ X#define PR_SV_CPIO_LINKS 0x2000 /* hard link handling for SVr4 cpio */ X#define PR_LINK_DATA 0x4000 /* may include data for hard links */ X X/* X * name related flags (pr_nflags) X */ X#define PR_POSIX_SPLIT 0x01 /* can do posix filename splitting */ X#define PR_PREFIX_REUSED 0x02 /* prefix space used by other option */ X#define PR_LONG_NAMES 0x04 /* can handle very long names */ X#define PR_DUMB_EOF 0x10 /* handle t_name[0] == '\0' as EOF */ X X/* X * Macro to make pr_xftypetab easier to use. See also table.h/table.c. X */ X#define pr_unsuptype(i) (props.pr_xftypetab[(i)->f_xftype] == 0) X X/* X * typeflagtab related flags X */ X#define TF_VALIDTYPE 0x01 /* A valid typeflag for extraction */ X#define TF_XHEADERS 0x02 /* This is a valid extended header */ X X#define _pr_typeflags(c) (props.pr_typeflagtab[(Uchar)(c)]) X#define pr_validtype(c) ((_pr_typeflags(c) & TF_VALIDTYPE) != 0) X#define pr_isxheader(c) ((_pr_typeflags(c) & TF_XHEADERS) != 0) X Xextern struct properties props; END-of-star-1.6/star/props.h echo x - star-1.6/star/readme.mk sed 's/^X//' >star-1.6/star/readme.mk << 'END-of-star-1.6/star/readme.mk' X#ident @(#)readme.mk 1.1 07/06/15 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= share/doc/star XTARGET= README X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### END-of-star-1.6/star/readme.mk echo x - star-1.6/star/remove.c sed 's/^X//' >star-1.6/star/remove.c << 'END-of-star-1.6/star/remove.c' X/* @(#)remove.c 1.61 18/10/23 Copyright 1985, 1991-2018 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)remove.c 1.61 18/10/23 Copyright 1985, 1991-2018 J. Schilling"; X#endif X/* X * remove files an file trees X * X * Copyright (c) 1985, 1992-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include /* Wegen AT_REMOVEDIR */ X#include "star.h" X#include "table.h" X#include /* XXX Wegen S_IFLNK */ X#include X#define GT_COMERR /* #define comerr gtcomerr */ X#define GT_ERROR /* #define error gterror */ X#include X#include X#include X#include "starsubs.h" X#include "pathname.h" X X Xextern FILE *tty; Xextern FILE *vpr; Xextern BOOL interactive; Xextern BOOL force_remove; Xextern BOOL ask_remove; Xextern BOOL remove_first; Xextern BOOL remove_recursive; Xextern BOOL keep_nonempty_dirs; X XEXPORT BOOL remove_file __PR((char *name, BOOL isfirst)); XLOCAL BOOL _remove_file __PR((char *name, pathstore_t *path, X BOOL isfirst, int depth)); XLOCAL BOOL remove_tree __PR((char *name, pathstore_t *path, X BOOL isfirst, int depth)); X X/* X * Remove a file or a directory tree. X * If star has been called with -remove-first "isfirst" needs to be set. X */ XEXPORT BOOL Xremove_file(name, isfirst) X register char *name; X BOOL isfirst; X{ X static int depth = -10; X static int dinit = 0; X pathstore_t path; X char pbuf[PATH_MAX+1]; X BOOL ret; X X if (!dinit) { X#ifdef _SC_OPEN_MAX X depth += sysconf(_SC_OPEN_MAX); X#else X depth += getdtablesize(); X#endif X dinit = 1; X } X path.ps_size = 0; X path.ps_tail = 0; X path.ps_path = pbuf; X ret = _remove_file(name, &path, isfirst, depth); X if (path.ps_path != pbuf) X free_pspace(&path); X return (ret); X} X XLOCAL BOOL X_remove_file(name, path, isfirst, depth) X register char *name; X pathstore_t *path; X BOOL isfirst; X int depth; X{ X char buf[32]; X char ans = '\0'; X int err = EX_BAD; X int len; X BOOL fr_save = force_remove; X BOOL rr_save = remove_recursive; X BOOL ret; X X if (remove_first && !isfirst) X return (FALSE); X if (!force_remove && (interactive || ask_remove)) { X fgtprintf(vpr, "remove '%s' ? Y(es)/N(o) :", name); fflush(vpr); X buf[0] = '\0'; X len = fgetstr(tty, buf, 3); X if (len > 0 && buf[len-1] != '\n') { X while (getc(tty) != '\n') { X if (feof(tty) || ferror(tty)) X break; X } X } X } X if (force_remove || X ((interactive || ask_remove) && (ans = toupper(buf[0])) == 'Y')) { X X /* X * only unlink non directories or empty directories X */ X if (lunlinkat(name, AT_REMOVEDIR) < 0) { /* rmdir() */ X err = geterrno(); X if (err == ENOTDIR) { X if (lunlinkat(name, 0) < 0) { X err = geterrno(); X#ifdef RM_DEBUG X errmsg("rmdir: Not a dir but cannot unlink file.\n"); X#endif X goto cannot; X } X return (TRUE); X } X#if defined(ENOTEMPTY) && ENOTEMPTY != EEXIST X if (err == EEXIST || err == ENOTEMPTY) { X#else X if (err == EEXIST) { X#endif X if (!remove_recursive) { X if (ans == 'Y') { X fgtprintf(vpr, X "Recursive remove nonempty '%s' ? Y(es)/N(o) :", X name); X fflush(vpr); X buf[0] = '\0'; X len = fgetstr(tty, buf, 3); X if (len > 0 && buf[len-1] != '\n') { X while (getc(tty) != '\n') { X if (feof(tty) || ferror(tty)) X break; X } X } X if (toupper(buf[0]) == 'Y') { X force_remove = TRUE; X remove_recursive = TRUE; X } else { X goto nonempty; X } X } else { X nonempty: X if (!keep_nonempty_dirs) X errmsgno(err, X "Nonempty directory '%s' not removed.\n", X name); X return (FALSE); X } X } X ret = remove_tree(name, path, isfirst, depth); X X force_remove = fr_save; X remove_recursive = rr_save; X return (ret); X } X#ifdef RM_DEBUG X else { X errmsgno(err, "rmdir: err != EEXIST.\n"); X } X errmsgno(err, "rmdir: unknown reason.\n"); X#endif X goto cannot; X } X return (TRUE); X } X#ifdef RM_DEBUG X else { X errmsgno(EX_BAD, "remove_file: if (force_remove || .... else part\n"); X errmsgno(EX_BAD, "force_remove %d interactive %d ask_remove %d ans '%c' (%d)\n", X force_remove, interactive, ask_remove, ans, ans); X } X#endif Xcannot: X errmsgno(err, "File '%s' not removed.\n", name); X return (FALSE); X} X XLOCAL BOOL Xremove_tree(name, path, isfirst, depth) X register char *name; X pathstore_t *path; X BOOL isfirst; X int depth; X{ X DIR *d; X struct dirent *dir; X BOOL ret = TRUE; X size_t otail; X size_t nlen; X char *p; X X if ((d = lopendir(name)) == NULL) { X return (FALSE); X } X depth--; X X if (path->ps_tail == 0) { X nlen = strlen(name); X if (path->ps_size == 0 && nlen > (PATH_MAX-2)) { X /* X * Does not fit into static buffer. X */ X init_pspace(PS_STDERR, path); X strcpy_pspace(PS_STDERR, path, name); X } else { X strcpy(path->ps_path, name); X path->ps_tail = nlen; X } X } X otail = path->ps_tail; X p = path->ps_path + path->ps_tail; X *p++ = '/'; /* Trailing '/' */ X *p = '\0'; X X while ((dir = readdir(d)) != NULL) { X X if (streql(dir->d_name, ".") || X streql(dir->d_name, "..")) X continue; X X nlen = strlen(dir->d_name); X if ((nlen + 2 + path->ps_tail) > PATH_MAX) { X if (path->ps_size == 0) { X /* X * Does not fit into static buffer. X */ X name[path->ps_tail + 1] = '\0'; X init_pspace(PS_STDERR, path); X strcpy_pspace(PS_STDERR, path, name); X path->ps_tail--; /* Trailing '/' */ X } X grow_pspace(PS_STDERR, X path, (nlen + 2 + path->ps_tail)); X p = path->ps_path + path->ps_tail + 1; X *p = 0; X } X strcpy(p, dir->d_name); X path->ps_tail += nlen + 1; X X if (depth <= 0) { X closedir(d); X } X if (!_remove_file(path->ps_path, path, isfirst, depth)) X ret = FALSE; X path->ps_tail = otail; X X if (depth <= 0 && (d = lopendir(name)) == NULL) { X p[-1] = '\0'; /* Trailing '/' */ X return (FALSE); X } X } X X closedir(d); X p[-1] = '\0'; /* Trailing '/' */ X X if (ret == FALSE) X return (ret); X X if (lunlinkat(name, AT_REMOVEDIR) >= 0) /* rmdir() */ X return (ret); X X errmsg("Directory '%s' not removed.\n", name); X return (FALSE); X} END-of-star-1.6/star/remove.c echo x - star-1.6/star/restore.h sed 's/^X//' >star-1.6/star/restore.h << 'END-of-star-1.6/star/restore.h' X/* @(#)restore.h 1.3 04/09/06 Copyright 2004 J. Schilling */ X/* X * Data structures used to map old to new inode numbers X * when in incremental restore mode. X * X * Copyright (c) 2004 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _RESTORE_H X#define _RESTORE_H X X/* X * Inode mapping from archive and /star-symtable X */ Xtypedef struct imap imap_t; X Xstruct imap { X/* ? */ imap_t *i_next; /* Next in list */ X imap_t *i_hnext; /* Next in name hash list */ X imap_t *i_honext; /* Next in old inode hash list */ X imap_t *i_hnnext; /* Next in new inode hash list */ X/* ? */ imap_t *i_dnext; /* Next Directory in cwd list */ X imap_t *i_dparent; /* Parent Directory */ X imap_t *i_dir; /* Directory content */ X imap_t *i_dxnext; /* Next entry in Directory cont */ X char *i_name; /* File name */ X int i_hash; /* File name hash value */ X ino_t i_oino; /* Old inode number */ X ino_t i_nino; /* New inode number */ X Int32_t i_flags; /* Flags (see below) */ X}; X X/* X * Flags for i_flags: X */ X#define I_DIR 0x01 /* This is a directory */ X#define I_NOARCHIVE 0x02 /* Name in archive, file is not */ X#define I_DID_RENAME 0x04 /* Entry (dir) has been renamed */ X#define I_DELETE 0x80 /* Entry has been deleted */ X X#define I_NO_INO (ino_t)-1 X X#endif /* _RESTORE_H */ END-of-star-1.6/star/restore.h echo x - star-1.6/star/scpio.1 sed 's/^X//' >star-1.6/star/scpio.1 << 'END-of-star-1.6/star/scpio.1' X. \" @(#)scpio.1 1.9 19/01/05 Copyright (C) 1997 by The Open Group, Copyright (C) 2004-2019 J. Schilling X. \" Manual page for scpio X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH SCPIO 1L "2019/01/05" "J\*org Schilling" "Schily\'s USER COMMANDS" X.SH NAME Xscpio \- copy file archives in and out (LEGACY) X.SH SYNOPSIS X.B Xscpio X[ X.I "other options X] X\-o[aBcv] X.br X.B Xscpio X[ X.I "other options X] X\-i[Bcdmruvf] X[ X.I "pattern ... X] X.br X.B Xscpio X[ X.I "other options X] X\-it[Bcvf] X[ X.I "pattern ... X] X.br X.B Xscpio X[ X.I "other options X] X\-p[adlmuv] X.I directory X.SH DESCRIPTION XThe X.B scpio Xutility, depending on the options used: X.TP X.B \(bu Xcopies files to an archive file X.TP X.B \(bu Xextracts files from an archive file X.TP X.B \(bu Xlists files from an archive file X.TP X.B \(bu Xcopies files from one directory tree to another. X. \" .SH RETURNS X. \" .SH ERRORS X.SH OPTIONS XThe X.B scpio Xutility supports the XBD specification Utility Syntax XGuidelines. The X.B cpio Xstandard does not allow Xthe option modifiers to be presented as Xseparate arguments from the option letters. XThe X.B scpio Ximplementation allows option modifiers to be presented as Xseparate arguments from the option letters. When writing Xportable shell scripts do never make use of this feature. X.PP XThe following options are supported: X.TP X.B \-o X(Copy Out.) Read the standard input to obtain a list of Xpathnames and copy those files onto the standard output Xtogether with pathname and status information. Output is Xpadded to a 512-byte boundary. X.TP X.B \-i X(Copy In.) Extract files from the standard input, which is Xassumed to be the product of a previous X.BR "scpio \-o" . XOnly files Xwith names that match X.I patterns Xare selected. The extracted Xfiles are conditionally created and copied into the current Xdirectory tree based upon the options described below. The Xpermissions of the files will be those of the previous X.BR "scpio \-o" . XThe owner and group of the files will be that of the Xcurrent user unless the user has appropriate privileges, Xwhich causes X.B scpio Xto retain the owner and group of the files Xof the previous X.BR "scpio \-o" . XIf the archive being read does not Xmatch the modifier specified, X.B scpio Xmay consider this to be an Xerror and exit or may recognise the archive and continue Xprocessing. Only a user with appropriate privileges can Xextract block special or character special files from an Xarchive. X.TP X.B \-it X(List.) List files from the archive. This is a sub mode of the Xcopy in mode, no files are created in list mode. X.TP X.B \-p X(Pass.) Read the standard input to obtain a list of pathnames Xof files that are conditionally created and copied into the Xdestination directory tree based upon the option modifiers Xdescribed below. X.PP XThe following option modifiers can be appended in any sequence to Xthe X.BR \-o ", " \-i " or " \-p Xoptions: X.TP X.B a XReset access times of input files after they have been Xcopied. (When option X.B l X(see below) is also specified, the Xaccess times of the linked files are not reset.) X.TP X.B B XBlock input/output 5120 bytes to the record (does not apply Xto the X.B \-p Xoption; meaningful only with data directed to or Xfrom character special files). X.TP X.B d XCreate directories as needed. X.TP X.B c XWrite or read header information in character form for Xportability. XNote that the Open Group standard does not specify the archive Xformat that should be used with the X.B c Xoption. XFor this reason it is questionable wether the X.B c Xoption increases portability in general. X.sp XThe archive format used by X.B scpio Xwith the X.B c Xoption is the format from the X.B "\-H asc Xoption. XIt gives best X.B cpio Xcompatibility when transferring files to SVR4-based systems X(except that the file size is limited to 2\ gigabytes). XWhen transferring files in X.B cpio Xarchives to unknown operating systems, it is unwise to use the X.BR c "\ option. X.TP X.B r XInteractively rename files. For each archive member matching X.I pattern Xoperand, a prompt will be written to the file X.BR /dev/tty . XThe prompt will contain the name of the archive Xmember, but the format is otherwise unspecified. A line will Xthen be read from X.BR /dev/tty . XIf this line is blank, the Xarchive member will be skipped. If this line consists of a Xsingle period, the archive member will be processed with no Xmodification to its name. Otherwise, its name will be Xreplaced with the contents of the line. The X.B scpio Xutility will Ximmediately exit with a non-zero exit status if end-of-file is Xencountered when reading a response, or if X.B /dev/tty Xcannot be Xopened for reading and writing. X.TP X.B t XWrite a table of contents of the input. No files are created. X.TP X.B u XCopy unconditionally (normally, an older file will not Xreplace a newer file with the same name). X.TP X.B v XVerbose: print the names of the affected files. With the X.B t Xoption, provides a detailed listing. X.TP X.B l XWhenever possible, link files rather than copying them. XUsable only with the X.B \-p Xoption. XThe X.B l Xoption modifier is not yet supported by X.BR scpio . X X.TP X.B m XRetain previous file modification time. This option is Xineffective on directories that are being copied. X.TP X.B f XCopy in all files except those in X.IR patterns . X X.PP XThe following X.I "other options Xare implemented as X.B SVr4 compliant Xextension to the Open Group standard: X.PP X.TP X.B \-6 XExtract X.B UNIX System Sixth Edition Xcpio archives. This option is not valid in archive create mode, Xit is mutually exclusive with X.BR \-c , X.BR \-H , Xand X.BR artype= . XAs is is unclear how X.B UNIX System Sixth Edition Xcpio archives look like, this option is currently unsupported. X.TP X.B \-@ XInclude extended file attributes in the archive. XThis option is currently unsupported. X.TP X.B \-A XAppend files to an existing archive. XThe X.B \-A Xoption only works together with the X.B \-O Xoption. XSee X.B star -r Xfor more information. X.TP X.B \-b XReverses the order of the bytes within each word. XIt is unclear what a X.I word Xis supposed to be. XThis option is unsupported but not needed as X.B scpio Xincludes automatic byte order recognition. X.TP X.BI \-C " # XSets (input/output) archive block size to # bytes. X.TP X.BI \-E " name XRead filenames for store/create/list command from X.IR name . XThe file X.I name Xmust contain a list of filenames, each on a separate line. X.TP X.BI \-H " header XSet the archive type to X.IR header . XSee X.BR star (1) Xfor more information. X.TP X.BI \-I " nm XUse X.I nm Xas archive file name instead of stdin. X.TP X.B \-k XTry to skip corrupt archive headers. X.TP X.B \-L XFollow symbolic links as if they were files. X.TP X.BI \-M " message XDefine a message that is uses when switching media. XThis option is currently unsupported. X.TP X.BI \-O " nm XUse X.I nm Xas archive file name instead of stdout. X.TP X.B \-P XHandle X.B Access Control List X(ACL) information in create and extract mode. XSee X.B star -acl Xfor more information. X.TP X.BI \-R " nm XReassign ownership and group for all files based on X.IR nm . XThis option is currently unsupported. X.TP X.B \-s XReverses the order of the bytes within each word. XIt is unclear what a X.I word Xis supposed to be. XThis option is unsupported but not needed as X.B scpio Xincludes automatic byte order recognition. X.TP X.B \-S XReverses the order of the halfwords within each word. XIt is unclear what a X.I word Xis supposed to be. XThis option is unsupported but not needed as X.B scpio Xincludes automatic byte order recognition. X.TP X.B \-V XSpecial verbose. Print a dot for each file that is read or written. XThis option is currently unsupported. X.PP XThe following X.I "other options Xare implemented as X.B star Xextension to the Open Group standard: X.TP X.B \-help XPrints a summary of the most important options for X.BR scpio (1) Xand exits. X.TP X.B \-xhelp XPrints a summary of the less important options for X.BR scpio (1) Xand exits. X.TP X.B \-version XPrints the X.B scpio Xversion number string and exists. X.TP X.B \-/ XDon't strip leading slashes from file names when extracting an archive. XSee X.BR star (1) Xfor more information. X.TP X.B .. XDon't skip files that contain /../ in the name. XSee X.BR star (1) Xfor more information. X.TP X.B \-7z Xrun the input or output through a X.B p7zip Xpipe - see option X.B \-z Xbelow. X.sp XNote that the X.B p7zip Xprogram currently does not operate on a pipe but on a X/tmp file copy and thus limits the maximum archive size. X X.TP X.B \-acl XHandle X.B Access Control List X(ACL) information in create and extract mode. XSee X.BR star (1) Xfor more information. X.TP X.BI artype= header XSet the archive type to X.IR header . XSee X.BR star (1) Xfor more information. X.TP X.B \-lzo XRun the input or output through a X.B lzop Xpipe - see option X.B \-z Xbelow. X.TP X.B \-bz XRun the input or output through a X.B bzip2 Xpipe - see option X.B \-z Xbelow. As the X.B \-bz Xthe X.B \-z Xoptions are non standard, it makes sense to omit X.B \-bz Xoptions the inside shell scripts. XIf you are going to extract a compressed archive that is located Xinside a plain file, X.B scpio Xwill auto detect compression and choose the right Xdecompression option to extract. X.TP X.BI bs= # XSet block size to #. You may use the same method as in X.BR dd (1) Xand X.BR sdd (1). XSee X.BR star (1) Xfor more information. X.TP X.B \-fifostats XPrint fifo statistics at the end of a X.B scpio Xrun when the fifo has been in effect. X.TP X.BI fs= # XSet fifo size to #. XSee X.BR star (1) Xfor more information. X.TP X.B \-no\-fifo XDo not use a fifo to optimize data flow from/to tape. XSee X.BR star (1) Xfor more information. X.TP X.B \-no\-fsync XDo not call X.BR fsync (2) Xfor each file that has been extracted from the archive. XSee X.BR star (1) Xfor more information. X.TP X.B \-do\-fsync XCall X.BR fsync (2) Xfor each file that has been extracted from the archive. XSee X.BR star (1) Xfor more information. X.TP X.B \-no-statistics XDo not print statistic messages at the end of a X.B scpio Xrun. X.TP X.B \-secure\-links XDo not extract hard links or symbolic links if the link Xname (the target of the link) starts with a slash (/) Xor if /../ is contained in the link name. XSee X.BR star (1) Xfor more information. X.TP X.B \-numeric XUse the numeric user/group fields in the listing rather than the default. XSee X.BR star (1) Xfor more information. X.TP X.B \-time XPrint timing info. XSee X.BR star (1) Xfor more information. X.TP X.B -xfflags XStore and extract extended file flags as found on BSD Xand Linux systems. XSee X.B star -acl Xfor more information. X.TP X.B \-z XRun the input or output through a X.B gzip Xpipe - see option X.B \-bz Xabove. As the X.B \-bz Xthe X.B \-z Xoptions are non standard, it makes sense to omit X.B \-bz Xoptions the inside shell scripts. XIf you are going to extract a compressed archive that is located Xinside a plain file, X.B scpio Xwill auto detect compression and choose the right Xdecompression option to extract. X.TP X.B \-zstd Xrun the input or output through a X.B zstd Xpipe - see option X.B \-z Xabove. X X.SH OPERANDS X.PP XThe following operands are supported: X.TP X.I directory XA pathname of an existing directory to be used as the target Xof X.BR "scpio \-p" . X.TP X.I pattern XExpressions making use of a pattern-matching notation similar Xto that used by the shell for filename pattern matching, and Xsimilar to regular expressions. The following metacharacters Xare defined: X.RS X.TP X.B "*" XMatches any string, including the empty string. X.TP X.B "?" XMatches any single character. X.TP X.B "[...]" XMatches any one of the enclosed characters. A pair of Xcharacters separated by `-' matches any symbol between Xthe pair (inclusive), as defined by the system default Xcollating sequence. If the first character following the Xopening `[' is a `!', the results are unspecified. X.PP XIn X.IR pattern , Xthe special characters "?", "*" and "[" also Xmatch the "/" character. Multiple cases of X.I pattern Xcan be Xspecified and if no X.I pattern Xis specified, the default for X.I pattern Xis "*" (that is, select all files). X.PP XNote that X.B scpio Xdoes not use X.BR fnmatch (3) Xbased pattern matching as documented above, Xit rather uses the pattern matcher documented in X.BR match (1). X.RE X.SH STDIN X.PP XWhen the X.BR \-o " or " \-p Xoptions are used, the standard input is a text Xfile containing a list of pathnames, one per line, to be copied. X.PP XWhen the X.B \-i Xoption is used, the standard input is an archive file Xformatted in any way that is understood by the archive handling Xengine (see X.B "\-H help Xoption for a complete list). X.SH "INPUT FILES X.PP XThe files identified by the pathnames in the standard input are of Xany type. X.PP XWhen the X.B \-r Xoption is used, the file X.B /dev/tty Xis used to write Xprompts and read responses. X.SH "ASYNCHRONOUS EVENTS X.PP XDefault. X.SH STDOUT XWhen the X.B \-o Xoption is used, the standard output is an archive file Xformatted as specified by X.B pax Xwith the X.B "\-x cpio Xoption. For better compatibility with SVR4-based systems that Xdo not implement the X.B cpio Xformat correctly, X.B scpio Xby default limits the length of file names to 256 bytes. XUse X.B "scpio \-H cpio Xto explicitly switch to the full POSIX 1003.1-1988 X.B cpio Xarchive format. X.PP XOtherwise, Xthe standard output contains commentary in an unspecified format Xconcerning the progress of the execution. X.SH STDERR XWhen the X.B \-o Xoption is not used, the standard error contains Xcommentary in an unspecified format concerning the progress of the Xexecution. Otherwise, the standard error is used only for Xdiagnostic messages. X.SH "OUTPUT FILES XOutput files are created, as specified by the archive, when the X.B \-i Xor X.B \-p Xoptions are used. X.SH "EXTENDED DESCRIPTION X.PP XNone. X X.SH "EXIT STATUS X.PP XThe following exit values are returned: X.TP X.B 0 XSuccessful completion. X.TP X.B >0 XAn error occurred. X.SH "CONSEQUENCES OF ERRORS X.PP XIf a file or directory cannot be created or overwritten, X.B scpio Xcontinues with the next file in the archive or file to be added to Xthe archive. X X.SH "APPLICATION USAGE X.PP XArchives created by X.B scpio Xare portable between XSI-conformant Xsystems provided the same procedures are used. X.PP XThe shell metacharacter notation is not fully compatible with that Xused by the shell and the X.B pax Xutility. Not all systems support the Xuse of the negation character [! ...] in X.B cpio Xpatterns. Portable Xapplications must avoid the use of this notation. X.PP XFor portable communication of data between XSI-conformant systems, Xit is recommended that only characters defined in the XISO/IEC 646:1991 standard International Reference Version X(equivalent to ASCII) 7-bit range of characters be used and that Xonly characters defined in the Portable Filename Character Set be Xused for naming files. This recommendation is given because XXSI-conformant systems support diverse codesets and run in various Xgeographical areas and there is no single, well-established Xcodeset that incorporates all of the characters of the languages Xof the various geographical areas. X.PP XThe X.B cpio Xarchive format only supports file sizes up to 8\ gigabytes. X.PP XApplications should migrate to the X.B pax Xarchive format which is the POSIX 1003.1-2001 standard archive format Xand based on an extended X.B tar Xformat. X X.SH "FUTURE DIRECTIONS XNone. X X.SH EXAMPLES X.PP X1. Copy the contents of a directory onto an archive: X.PP X.B ls | scpio -o >../cpio.out X.PP X2. Duplicate a directory hierarchy: X.PP X.B cd olddir X.br X.B find . -depth -print | scpio -pd ../newdir X X.SH ENVIRONMENT X.PP XThe following environment variables may affect the execution of X.BR scpio : X.TP X.B TZ XDetermine the timezone used with date and time strings. X.\".SH FILES X.SH "SEE ALSO" X.BR ar (1), X.BR find (1), X.BR sfind (1), X.BR ls (1), X.BR match (1), X.BR pax (1), X.BR spax (1), X.BR tar (1), X.BR star (1). X.SH DIAGNOSTICS X.SH NOTES X.PP XThe default block size for X.B cpio Xis 512 bytes, this slows down write speed. XUse X.BR \-B ", " \-C ", or " bs= Xto set a different block size. X.PP X.B "Scpio -iu Xis equivalent to X.B "star \-xU \-install \-force\-remove \-remove\-recursive Xand for this reason may remove nonempty directory trees in extrace mode Xwithout printing a warning. X.PP XThe Open Group, Xhave given us permission to reprint portions of their documentation. In Xthe following statement, the phrase ``this text'' refers to portions of Xthe system documentation. X.PP XPortions of this text are reprinted and reproduced in electronic form Xin the X.B scpio Xmanual, Xfrom The Open Group Base Specifications XIssue 5, Copyright (C) 1997 by The Open Group. In the event Xof any discrepancy between these versions and the original Xspecification, the original The Open Group Standard is the Xreferee document. The original Standard can be obtained online at X.BR "http://www.opengroup.org/unix/single_unix_specification_v2" . X.SH BUGS X.SH AUTHOR X.nf XJ\*org Schilling XSeestr. 110 XD\-13353 Berlin XGermany X.fi X.PP XMail bugs and suggestions to: X.PP X.B Xjoerg.schilling@fokus.fraunhofer.de Xor X.B Xjoerg@schily.net END-of-star-1.6/star/scpio.1 echo x - star-1.6/star/scpioman.mk sed 's/^X//' >star-1.6/star/scpioman.mk << 'END-of-star-1.6/star/scpioman.mk' X#ident @(#)scpioman.mk 1.1 04/09/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= scpio XMANSECT= $(MANSECT_CMD) XMANSUFFIX= $(MANSUFF_CMD) XMANFILE= scpio.1 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/star/scpioman.mk echo x - star-1.6/star/spax.1 sed 's/^X//' >star-1.6/star/spax.1 << 'END-of-star-1.6/star/spax.1' X'\" t X. \" @(#)spax.1 1.13 18/05/22 Copyr 2004-2018 J. Schilling X. \" Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. X. \" Manual page for spax X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.\" Header with no indent X.de HD X.ti 0 X.I \\$1 X.. X.\" Ruler line X.de RU X.ti 0 X\l'\n(.lu' X.. X.\" Table caption X.de CA X.ce X.B \\$1 X.. X.TH SPAX 1L "2018/05/22" "J\*org Schilling" "Schily\'s USER COMMANDS" X.SH NAME Xpax \- portable archive interchange X.SH SYNOPSIS X.TP X.B Xspax X\ \ \ \ \ [\fIother\ options\fR] X[\-cdnv] [\-H|\-L] [\-f\ \fIarchive] [\-o\ \fIoptions\fR].\|.\|. X[\-s \fIreplstr].\|.\|. X[\fIpattern\fR\&.\|.\|.\|] X.sp X.TP X.B Xspax X\-r\ \ \ [\fIother\ options\fR] X[\-cdiknuv] [\-H|\-L] [\-f\ \fIarchive] [\-o\ \fIoptions\fR].\|.\|. X[\-p\ \fIstring\fR].\|.\|. X[\-s\ \fIreplstr\fR].\|.\|. X[\fIpattern\&.\|.\|.\|] X.sp X.TP X.B Xspax X\-w\ \ \ [\fIother\ options\fR] X[\-dituvX] [\-H|\-L] [\-b\ \fIblocksize\fR] X[\-a] X[\-f\ \fIarchive] [\-o\ \fIoptions\fR].\|.\|. X[\-s\ \fIreplstr\fR].\|.\|. X[\-x\ \fIformat\fR] X[\fIfile\fR\&.\|.\|.\|] X.sp X.TP X.B Xspax X\-r\ \-w[\fIother\ options\fR] X[\-diklntuvX] [\-H|\-L] [\-o\ \fIoptions\fR].\|.\|. X[\-p\ \fIstring\fR].\|.\|. X[\-s\ \fIreplstr\fR].\|.\|. X[\fIfile\fR\&.\|.\|.\|] X.I directory X.SH DESCRIPTION X.PP XThe X.B pax Xutility shall read, write, and write lists of the members Xof archive files and copy directory hierarchies. A variety of Xarchive formats shall be supported; see the X.B \-x Xformat option. X.PP XThe action to be taken depends on the presence of the X.B \-r Xand X.B \-w Xoptions. The four combinations of X.B \-r Xand X.B \-w Xare referred to as the Xfour modes of operation: X.BR list , X.BR read , X.BR write , Xand X.B copy Xmodes, corresponding respectively to the four forms shown in the SYNOPSIS Xsection. X.TP X.B list XIn X.B list Xmode (when neither X.B \-r Xnor X.B \-w Xare specified), X.B pax Xshall write the names of the members of the archive file read Xfrom the standard input, with pathnames matching the Xspecified X.IR patterns , Xto standard output. If a named file is of Xtype directory, the file hierarchy rooted at that file shall Xbe listed as well. X.TP X.B read XIn X.B read Xmode (when X.B \-r Xis specified, but X.B \-w Xis not), X.B pax Xshall extract the members of the archive file read from the Xstandard input, with pathnames matching the specified X.IR patterns . XIf an extracted file is of type directory, the file Xhierarchy rooted at that file shall be extracted as well. The Xextracted files shall be created performing pathname Xresolution with the directory in which X.B pax Xwas invoked as the Xcurrent working directory. X.sp XIf an attempt is made to extract a directory when the Xdirectory already exists, this shall not be considered an Xerror. If an attempt is made to extract a FIFO when the FIFO Xalready exists, this shall not be considered an error. X.sp XThe ownership, access, and modification times, and file mode Xof the restored files are discussed under the X.B \-p Xoption. X.TP X.B write XIn X.B write Xmode (when X.B \-w Xis specified, but X.B \-r Xis not), X.B pax Xshall write the contents of the file operands to the standard Xoutput in an archive format. If no file operands are Xspecified, a list of files to copy, one per line, shall be Xread from the standard input. A file of type directory shall Xinclude all of the files in the file hierarchy rooted at the Xfile. X.TP X.B copy XIn X.B copy Xmode (when both X.B \-r Xand X.B \-w Xare specified), X.B pax Xshall copy the file operands to the destination directory. X.sp XIf no file operands are specified, a list of files to copy, Xone per line, shall be read from the standard input. A file Xof type directory shall include all of the files in the file Xhierarchy rooted at the file. X.sp XThe effect of the X.B copy Xshall be as if the copied files were Xwritten to an archive file and then subsequently extracted, Xexcept that there may be hard links between the original and Xthe copied files. If the destination directory is a Xsubdirectory of one of the files to be copied, the results Xare unspecified. If the destination directory is a file of a Xtype not defined by the System Interfaces volume of XIEEE Std 1003.1-2001, the results are implementation-defined; Xotherwise, it shall be an error for the file named by the Xdirectory operand not to exist, not be writable by the user, Xor not be a file of type directory. X.PP XIn X.B read Xor X.B copy Xmodes, if intermediate directories are necessary Xto extract an archive member, X.B pax Xshall perform actions equivalent Xto the X.BR mkdir () Xfunction defined in the System Interfaces volume of XIEEE Std 1003.1-2001, called with the following arguments: X.TP X.B \(bu XThe intermediate directory used as the X.B path Xargument. X.TP X.B \(bu XThe value of the bitwise-inclusive X.B OR Xof X.BR S_IRWXU , X.BR S_IRWXG , Xand X.B S_IRWXO Xas the X.I mode Xargument. X.PP XIf any specified X.I pattern Xor X.I file Xoperands are not matched by at Xleast one file or archive member, X.B pax Xshall write a diagnostic Xmessage to standard error for each one that did not match and exit Xwith a non-zero exit status. X.PP XThe archive formats described in the X.B EXTENDED DESCRIPTION Xsection Xshall be automatically detected on input. The default output Xarchive format shall be implementation-defined. X.PP XThe X.B spax Ximplementation defaults to X.BR "\-x ustar" . X.PP XA single archive can span multiple files. The X.B pax Xutility shall Xdetermine, in an implementation-defined manner, what file to read Xor write as the next file. X.PP XIf the selected archive format supports the specification of Xlinked files, it shall be an error if these files cannot be linked Xwhen the archive is extracted, except that if the files to be Xlinked are symbolic links and the system is not capable of making Xhard links to symbolic links, then separate copies of the symbolic Xlink shall be created instead. For archive formats that do not Xstore file contents with each name that causes a hard link, if the Xfile that contains the data is not extracted during this X.B pax Xsession, either the data shall be restored from the original file, Xor a diagnostic message shall be displayed with the name of a file Xthat can be used to extract the data. In traversing directories, X.B pax Xshall detect infinite loops; that is, entering a previously Xvisited directory that is an ancestor of the last file visited. XWhen it detects an infinite loop, X.B pax Xshall write a diagnostic Xmessage to standard error and shall terminate. X X.SH OPTIONS X.PP XThe X.B pax Xutility shall conform to the Base Definitions volume of XIEEE Std 1003.1-2001, Section 12.2, Utility Syntax Guidelines, Xexcept that the order of presentation of the X.BR \-o , X.BR \-p , Xand X.B \-s Xoptions is significant. XSee also the X.B "OTHER OPTIONS" Xsection. X.PP XThe following options shall be supported: X.TP X.B \-r XRead an archive file from standard input. X.TP X.B \-w XWrite files to the standard output in the specified archive Xformat. X.TP X.B \-a XAppend files to the end of the archive. It is Ximplementation-defined which devices on the system support Xappending. Additional file formats unspecified by this volume Xof IEEE Std 1003.1-2001 may impose restrictions on appending. X.TP X.BI \-b " blocksize XBlock the output at a positive decimal integer number of Xbytes per write to the archive file. Devices and archive Xformats may impose restrictions on blocking. Blocking shall Xbe automatically determined on input. Conforming applications Xshall not specify a blocksize value larger than 32256. XDefault blocking when creating archives depends on the Xarchive format. (See the X.B \-x Xoption below.) X.TP X.B \-c XMatch all file or archive members except those specified by Xthe pattern or file operands. X.TP X.B \-d XCause files of type directory being copied or archived or Xarchive members of type directory being extracted or listed Xto match only the file or archive member itself and not the Xfile hierarchy rooted at the file. X.\".....XXX Ab hier noch nicht fertig X.TP X.BI \-f " archive XSpecify the pathname of the input or output archive, Xoverriding the default standard input (in X.B list Xor X.B read Xmodes) Xor standard output X.RB ( write Xmode). X.TP X.B \-H XIf a symbolic link referencing a file of type directory is Xspecified on the command line, X.B pax Xshall archive the file Xhierarchy rooted in the file referenced by the link, using Xthe name of the link as the root of the file hierarchy. XOtherwise, if a symbolic link referencing a file of any other Xfile type which X.B pax Xcan normally archive is specified on the Xcommand line, then X.B pax Xshall archive the file referenced by Xthe link, using the name of the link. The default behavior Xshall be to archive the symbolic link itself. X.TP X.B \-i XInteractively rename files or archive members. For each Xarchive member matching a pattern operand or file matching a Xfile operand, a prompt shall be written to the file /dev/tty. XThe prompt shall contain the name of the file or archive Xmember, but the format is otherwise unspecified. A line shall Xthen be read from /dev/tty. If this line is blank, the file Xor archive member shall be skipped. If this line consists of Xa single period, the file or archive member shall be Xprocessed with no modification to its name. Otherwise, its Xname shall be replaced with the contents of the line. The X.B pax Xutility shall immediately exit with a non-zero exit status if Xend-of-file is encountered when reading a response or if X/dev/tty cannot be opened for reading and writing. X.sp XThe results of extracting a hard link to a file that has been Xrenamed during extraction are unspecified. X.TP X.B \-k XPrevent the overwriting of existing files. X.TP X.B \-l X(The letter ell.) In copy mode, hard links shall be made Xbetween the source and destination file hierarchies whenever Xpossible. If specified in conjunction with X.B \-H Xor X.BR \-L , Xwhen a Xsymbolic link is encountered, the hard link created in the Xdestination file hierarchy shall be to the file referenced by Xthe symbolic link. If specified when neither X.B \-H Xnor X.B \-L Xis Xspecified, when a symbolic link is encountered, the Ximplementation shall create a hard link to the symbolic link Xin the source file hierarchy or copy the symbolic link to the Xdestination. X.TP X.B \-L XIf a symbolic link referencing a file of type directory is Xspecified on the command line or encountered during the Xtraversal of a file hierarchy, X.B pax Xshall archive the file Xhierarchy rooted in the file referenced by the link, using Xthe name of the link as the root of the file hierarchy. XOtherwise, if a symbolic link referencing a file of any other Xfile type which X.B pax Xcan normally archive is specified on the Xcommand line or encountered during the traversal of a file Xhierarchy, X.B pax Xshall archive the file referenced by the link, Xusing the name of the link. The default behavior shall be to Xarchive the symbolic link itself. X.TP X.B \-n XSelect the first archive member that matches each pattern Xoperand. No more than one archive member shall be matched for Xeach pattern (although members of type directory shall still Xmatch the file hierarchy rooted at that file). X.TP X.BI \-o " options XProvide information to the implementation to modify the Xalgorithm for extracting or writing files. The value of Xoptions shall consist of one or more comma-separated keywords Xof the form: X.RS X.PP X.BI keyword[[:]= value ][,keyword[[:]= value ], .\|.\|.\|] X.PP XSome keywords apply only to certain file formats, as Xindicated with each description. Use of keywords that are Xinapplicable to the file format being processed produces Xundefined results. X.PP XKeywords in the options argument shall be a string that would Xbe a valid portable filename as described in the Base XDefinitions volume of IEEE Std 1003.1-2001, Section 3.276, XPortable Filename Character Set. X.TP X.B Note: XKeywords are not expected to be filenames, merely to Xfollow the same character composition rules as portable Xfilenames. X.PP XKeywords can be preceded with white space. The value field Xshall consist of zero or more characters; within value, the Xapplication shall precede any literal comma with a backslash, Xwhich shall be ignored, but preserves the comma as part of Xvalue. A comma as the final character, or a comma followed Xsolely by white space as the final characters, in options Xshall be ignored. Multiple X.B \-o Xoptions can be specified; if Xkeywords given to these multiple X.B \-o Xoptions conflict, the Xkeywords and values appearing later in command line sequence Xshall take precedence and the earlier shall be silently Xignored. The following keyword values of options shall be Xsupported for the file formats as indicated: X.TP X.BI delete= pattern X(Applicable only to the X.B "\-x pax Xformat.) When used in Xwrite or copy mode, X.B pax Xshall omit from extended header Xrecords that it produces any keywords matching the Xstring pattern. When used in read or list mode, X.B pax Xshall ignore any keywords matching the string pattern in Xthe extended header records. In both cases, matching Xshall be performed using the pattern matching notation Xdescribed in Patterns Matching a Single Character and XPatterns Matching Multiple Characters. For example: X.RS X.PP X\fB\-o\ delete=\fIsecurity.*\fR X.PP Xwould suppress security-related information. See X.B pax Extended Header Xfor extended header record keyword Xusage. X.PP XWhen multiple X.BI "\-o delete=" pattern Xoptions are specified, Xthe patterns shall be additive; all keywords matching Xthe specified string patterns shall be omitted from Xextended header records that X.B pax Xproduces. X.RE X.TP X.BI exthdr.name= string X(Applicable only to the X.B "\-x pax Xformat.) This keyword Xallows user control over the name that is written into Xthe ustar header blocks for the extended header produced Xunder the circumstances described in X.BR "pax Header Block". XThe name shall be the contents of string, after the Xfollowing character substitutions have been made: X.RS X.PP X.TS Xcenter box; Xlb|lb Xl|l. Xstring Includes: Replaced By: X_ X%d The directory name of the file, equivalent X to the result of the dirname utility on the X translated pathname. X_ X%f The filename of the file, equivalent to the X result of the basename utility on the X translated pathname. X_ X%p The process ID of the pax process. X_ X%% A '%' character. X.TE X.PP XAny other '%' characters in string produce undefined Xresults. X.PP XIf no \-o exthdr.name= string is specified, X.B pax Xshall use Xthe following default value: X.PP X %d/PaxHeaders.%p/%f X.PP X.RE X.TP X.BI globexthdr.name= string X(Applicable only to the X.B "\-x pax Xformat.) When used in Xwrite or copy mode with the appropriate options, X.B pax Xshall create global extended header records with ustar Xheader blocks that will be treated as regular files by Xprevious versions of X.BR pax . XThis keyword allows user Xcontrol over the name that is written into the ustar Xheader blocks for global extended header records. The Xname shall be the contents of string, after the Xfollowing character substitutions have been made: X.RS X.PP X.TS Xcenter box; Xlb|lb Xl|l. Xstring Includes: Replaced By: X_ X%n An integer that represents the sequence X number of the global extended header record X in the archive, starting at 1. X_ X%p The process ID of the pax process. X_ X%% A '%' character. X.TE X.PP XAny other '%' characters in string produce undefined Xresults. X.PP XIf no X.BI "\-o globexthdr.name=" string Xis specified, X.B pax Xshall Xuse the following default value: X.PP X$TMPDIR/GlobalHead.%p.%n X.PP Xwhere X.B $TMPDIR Xrepresents the value of the X.B TMPDIR Xenvironment variable. If X.B TMPDIR Xis not set, X.B pax Xshall Xuse /tmp. X.RE X.TP X.BI invalid= action X(Applicable only to the X.B "\-x pax Xformat.) This keyword Xallows user control over the action X.B pax Xtakes upon Xencountering values in an extended header record that, Xin read or copy mode, are invalid in the destination Xhierarchy or, in list mode, cannot be written in the Xcodeset and current locale of the implementation. The Xfollowing are invalid values that shall be recognized by X.BR pax : X.RS X.TP X.B + XIn read or copy mode, a filename or link name that Xcontains character encodings invalid in the Xdestination hierarchy. (For example, the name may Xcontain embedded NULs.) X.TP X.B + XIn read or copy mode, a filename or link name that Xis longer than the maximum allowed in the Xdestination hierarchy (for either a pathname Xcomponent or the entire pathname). X.TP X.B + XIn list mode, any character string value (filename, Xlink name, user name, and so on) that cannot be Xwritten in the codeset and current locale of the Ximplementation. X.PP XThe following mutually-exclusive values of the action Xargument are supported: X.TP X.B bypass XIn read or copy mode, X.B pax Xshall bypass the file, Xcausing no change to the destination hierarchy. In Xlist mode, X.B pax Xshall write all requested valid Xvalues for the file, but its method for writing Xinvalid values is unspecified. X.TP X.B rename XIn read or copy mode, X.B pax Xshall act as if the X.B \-i Xoption were in effect for each file with invalid Xfilename or link name values, allowing the user to Xprovide a replacement name interactively. In list Xmode, X.B pax Xshall behave identically to the bypass Xaction. X.TP X.B UTF-8 XWhen used in read, copy, or list mode and a Xfilename, link name, owner name, or any other field Xin an extended header record cannot be translated Xfrom the X.B pax XUTF-8 codeset format to the codeset Xand current locale of the implementation, X.B pax Xshall Xuse the actual UTF-8 encoding for the name. X.TP X.B write XIn read or copy mode, X.B pax Xshall write the file, Xtranslating the name, regardless of whether this Xmay overwrite an existing file with a valid name. XIn list mode, X.B pax Xshall behave identically to the Xbypass action. X.PP XIf no X.BI "\-o invalid=" option Xis specified, X.B pax Xshall act as Xif X.B "\-o invalid= bypass Xwere specified. Any overwriting of Xexisting files that may be allowed by the X.B "\-o invalid= Xactions shall be subject to permission(\fB\-p\fR) and Xmodification time (\fB\-u\fR) restrictions, and shall be Xsuppressed if the X.B \-k Xoption is also specified. X.RE X.TP X.B linkdata X(Applicable only to the X.B "\-x pax Xformat.) In write mode, X.B pax Xshall write the contents of a file to the archive Xeven when that file is merely a hard link to a file Xwhose contents have already been written to the archive. X.TP X.BI listopt= format XThis keyword specifies the output format of the table of Xcontents produced when the X.B \-v Xoption is specified in Xlist mode. See List Mode Format Specifications. To avoid Xambiguity, the listopt= format shall be the only or Xfinal keyword= value pair in a X.BI "\-o " option-argument\fR; Xall characters in the remainder of the option-argument shall Xbe considered part of the format string. When multiple X\-o listopt= format options are specified, the format Xstrings shall be considered a single, concatenated Xstring, evaluated in command line order. X.TP X.B times X(Applicable only to the X.B "\-x pax Xformat.) When used in Xwrite or copy mode, X.B pax Xshall include atime and mtime Xextended header records for each file. See X.BR "pax Extended Header File Times" . X.PP XIn addition to these keywords, if the X.B "\-x pax Xformat is Xspecified, any of the keywords and values defined in X.BR "pax Extended Header" , Xincluding implementation extensions, can be Xused in X.BI \-o " option-arguments\fR, Xin either of two modes: X.TP X.BI keyword= value XWhen used in write or copy mode, these keyword/value Xpairs shall be included at the beginning of the archive Xas typeflag g global extended header records. When used Xin read or list mode, these keyword/value pairs shall Xact as if they had been at the beginning of the archive Xas typeflag g global extended header records. X.TP X.BI keyword:= value XWhen used in write or copy mode, these keyword/value Xpairs shall be included as records at the beginning of a Xtypeflag x extended header for each file. (This shall be Xequivalent to the equal-sign form except that it creates Xno typeflag g global extended header records.) When used Xin read or list mode, these keyword/value pairs shall Xact as if they were included as records at the end of Xeach extended header; thus, they shall override any Xglobal or file-specific extended header record keywords Xof the same names. For example, in the command: X.RS X.PP X\fBpax \-r \-o "gname:=mygroup," s. X.PP XAny non-null character can be used as a delimiter ( '/' shown Xhere). Multiple X.B \-s Xexpressions can be specified; the Xexpressions shall be applied in the order specified, Xterminating with the first successful substitution. The Xoptional trailing 'g' is as defined in the ed utility. The Xoptional trailing 'p' shall cause successful substitutions to Xbe written to standard error. File or archive member names Xthat substitute to the empty string shall be ignored when Xreading and writing archives. X.RE X.TP X.B \-t XWhen reading files from the file system, and if the user has Xthe permissions required by utime() to do so, set the access Xtime of each file read to the access time that it had before Xbeing read by X.BR pax . X.TP X.B \-u XIgnore files that are older (having a less recent file Xmodification time) than a pre-existing file or archive member Xwith the same name. In read mode, an archive member with the Xsame name as a file in the file system shall be extracted if Xthe archive member is newer than the file. In write mode, an Xarchive file member with the same name as a file in the file Xsystem shall be superseded if the file is newer than the Xarchive member. If X.B \-a Xis also specified, this is accomplished Xby appending to the archive; otherwise, it is unspecified Xwhether this is accomplished by actual replacement in the Xarchive or by appending to the archive. In copy mode, the Xfile in the destination hierarchy shall be replaced by the Xfile in the source hierarchy or by a link to the file in the Xsource hierarchy if the file in the source hierarchy is Xnewer. X.TP X.B \-v XIn list mode, produce a verbose table of contents (see the XSTDOUT section). Otherwise, write archive member pathnames to Xstandard error (see the STDERR section). X.TP X.BI \-x " format XSpecify the output archive format. The X.B pax Xutility shall Xsupport the following formats: X.RS X.TP X.B cpio XThe cpio interchange format; see the EXTENDED XDESCRIPTION section. The default blocksize for this Xformat for character special archive files shall be X5120. Implementations shall support all blocksize values Xless than or equal to 32256 that are multiples of 512. X.TP X.B pax XThe X.B pax Xinterchange format; see the X.B EXTENDED DESCRIPTION Xsection. The default blocksize for this format for Xcharacter special archive files shall be 5120. XImplementations shall support all blocksize values less Xthan or equal to 32256 that are multiples of 512. X.TP X.B ustar XThe tar interchange format; see the EXTENDED DESCRIPTION Xsection. The default blocksize for this format for Xcharacter special archive files shall be 10240. XImplementations shall support all blocksize values less Xthan or equal to 32256 that are multiples of 512. X.PP XImplementation-defined formats shall specify a default block Xsize as well as any other block sizes supported for character Xspecial archive files. X.PP XAny attempt to append to an archive file in a format Xdifferent from the existing archive format shall cause X.B pax Xto Xexit immediately with a non-zero exit status. X.PP XIn copy mode, if no X.B \-x Xformat is specified, X.B pax Xshall behave Xas if X.B "\-x pax Xwere specified. X.RE X.TP X.B \-X XWhen traversing the file hierarchy specified by a pathname, X.B pax Xshall not descend into directories that have a different Xdevice ID ( st_dev; see the System Interfaces volume of XIEEE Std 1003.1-2001, stat()). X.PP XSpecifying more than one of the mutually-exclusive options X.B \-H Xand X.B \-L Xshall not be considered an error and the last option specified Xshall determine the behavior of the utility. X.PP XThe options that operate on the names of files or archive members X.RB ( \-c , X.BR \-i , X.BR \-n , X.BR \-s , X.BR \-u , Xand X.BR \-v ) Xshall interact as follows. In read Xmode, the archive members shall be selected based on the Xuser-specified pattern operands as modified by the X.BR \-c , X.BR \-n , Xand X.B \-u Xoptions. Then, any X.B \-s Xand X.B \-i Xoptions shall modify, in that order, Xthe names of the selected files. The X.B \-v Xoption shall write names Xresulting from these modifications. X.PP XIn write mode, the files shall be selected based on the Xuser-specified pathnames as modified by the X.B \-n Xand X.B \-u options. XThen, any X.B \-s Xand X.B \-i Xoptions shall modify, in that order, the names Xof these selected files. The X.B \-v Xoption shall write names resulting Xfrom these modifications. X.PP XIf both the X.B \-u Xand X.B \-n Xoptions are specified, X.B pax Xshall not Xconsider a file selected unless it is newer than the file to which Xit is compared. X X.SS "List Mode Format Specifications X X.PP XThe manual page for X.B spax Xis not yet ready. XThe following text is a quotation from the POSIX.1-2001 standard. X.PP XIn X.B list Xmode with the X.BI "\-o listopt=" format Xoption, the X.I format Xargument shall be applied for each selected file. The X.B pax Xutility Xshall append a to the X.B listopt Xoutput for each selected Xfile. The X.I format Xargument shall be used as the X.I format Xstring Xdescribed in the Base Definitions volume of IEEE Std 1003.1-2001, XChapter 5, File Format Notation, with the exceptions 1. through 5. Xdefined in the EXTENDED DESCRIPTION section of X.BR printf (3), Xplus the following exceptions: X.TP X.B 6. XThe sequence X.RI ( keyword ) Xcan occur before a format conversion Xspecifier. The conversion argument is defined by the value of X.IR keyword . XThe implementation shall support the following X.IR keywords : X.RS X.TP X.B \(bu XAny of the Field Name entries in ustar Header Block and XOctet-Oriented cpio Archive Entry. The implementation Xmay support the X.I cpio Xkeywords without the leading X.B c_ Xin addition to the form required by Values for X.B cpio X.B c_mode XField. X.TP X.B \(bu XAny keyword defined for the extended header in X.BR "pax Extended Header" . X.TP X.B \(bu XAny keyword provided as an implementation-defined Xextension within the extended header defined in X.BR "pax Extended Header" . X.PP XFor example, the sequence "%(charset)s" is the string value Xof the name of the character set in the extended header. X.PP XThe result of the keyword conversion argument shall be the Xvalue from the applicable header field or extended header, Xwithout any trailing NULs. X.PP XAll keyword values used as conversion arguments shall be Xtranslated from the UTF-8 encoding to the character set Xappropriate for the local file system, user database, and so Xon, as applicable. X.RE X.TP X.B 7. XAn additional conversion specifier character, X.BR T , Xshall be Xused to specify time formats. The X.B T Xconversion specifier Xcharacter can be preceded by the sequence X(\fBkeyword=\fIsubformat\fR), Xwhere X.I subformat Xis a date format as defined by Xdate operands. The default X.I keyword Xshall be X.B mtime Xand the default subformat shall be: X.PP X %b %e %H:%M %Y X.PP X.TP X.B 8. XAn additional conversion specifier character, X.BR M , Xshall be Xused to specify the file mode string as defined in X.BR ls (1) XStandard Output. If X.RI ( keyword ) Xis omitted, the X.B mode X.I keyword Xshall be used. For example, X.B %.1M Xwrites the single character Xcorresponding to the X.I "" Xfield of the X.B ls \-l Xcommand. X.TP X.B 9. XAn additional conversion specifier character, X.BR D , Xshall be used to specify the device for block or special files, if Xapplicable, in an implementation-defined format. If not Xapplicable, and X.RI ( keyword ) Xis specified, then this conversion Xshall be equivalent to X.BR "%(keyword)u" . XIf not applicable, and X.RI ( keyword ) Xis omitted, then this conversion shall be equivalent Xto . X.TP X.B 10. XAn additional conversion specifier character, X.BR F , Xshall be used to specify a pathname. The X.B F Xconversion character can be Xpreceded by a sequence of comma-separated keywords: X.PP X (keyword[,keyword] .\|.\|. ) X.RS XThe values for all the keywords that are non-null shall be Xconcatenated together, each separated by a '/'. The default Xshall be X.RB ( path ) Xif the keyword path is defined; otherwise, Xthe default shall be X.RB ( "prefix, name" ). X.RE X.TP X.B 11. XAn additional conversion specifier character, X.BR L , Xshall be used to specify a symbolic line expansion. If the current Xfile is a symbolic link, then X.B %L Xshall expand to: X.PP X "%s\ \->\ %s", , X.PP XOtherwise, the X.B %L Xconversion specification shall be the Xequivalent of X.BR %F . X X.SH OPERANDS X.PP XThe following operands shall be supported: X.TP X.I directory XThe destination directory pathname for copy mode. X.TP X.I file XA pathname of a file to be copied or archived. X.TP X.I pattern XA pattern matching one or more pathnames of archive members. XA pattern must be given in the name-generating notation of Xthe pattern matching notation in Pattern Matching Notation , Xincluding the filename expansion rules in Patterns Used for XFilename Expansion. The default, if no pattern is specified, Xis to select all members in the archive. X X.SH STDIN X.PP XIn X.B write Xmode, the standard input shall be used only if no X.I file Xoperands are specified. It shall be a text file containing a list Xof pathnames, one per line, without leading or trailing s. X.PP XIn X.B list Xand X.B read Xmodes, if X.B \-f Xis not specified, the standard input Xshall be an archive file. X.PP XOtherwise, the standard input shall not be used. X X.SH "INPUT FILES X.PP XThe input file named by the X.I archive Xoption-argument, or standard Xinput when the archive is read from there, shall be a file Xformatted according to one of the specifications in the EXTENDED XDESCRIPTION section or some other implementation-defined format. X.PP XThe file X.B /dev/tty Xshall be used to write prompts and read Xresponses. X X.SH "ENVIRONMENT VARIABLES X.PP XThe following environment variables shall affect the execution of X.BR pax : X.TP X.B LANG XProvide a default value for the internationalization Xvariables that are unset or null. (See the Base Definitions Xvolume of IEEE Std 1003.1-2001, Section 8.2, XInternationalization Variables for the precedence of Xinternationalization variables used to determine the values Xof locale categories.) X.TP X.B LC_ALL XIf set to a non-empty string value, override the values of Xall the other internationalization variables. X.TP X.B LC_COLLATE XDetermine the locale for the behavior of ranges, equivalence Xclasses, and multi-character collating elements used in the Xpattern matching expressions for the pattern operand, the Xbasic regular expression for the X.B \-s Xoption, and the extended Xregular expression defined for the X.B yesexpr Xlocale keyword in Xthe LC_MESSAGES category. X.TP X.B LC_CTYPE XDetermine the locale for the interpretation of sequences of Xbytes of text data as characters (for example, single-byte as Xopposed to multi-byte characters in arguments and input Xfiles), the behavior of character classes used in the Xextended regular expression defined for the X.B yesexpr Xlocale Xkeyword in the LC_MESSAGES category, and pattern matching. X.TP X.B LC_MESSAGES XDetermine the locale for the processing of affirmative Xresponses that should be used to affect the format and Xcontents of diagnostic messages written to standard error. X.TP X.B LC_TIME XDetermine the format and contents of date and time strings Xwhen the X.B \-v Xoption is specified. X.TP X.B NLSPATH X[XSI] [Option Start] Determine the location of message Xcatalogs for the processing of LC_MESSAGES . [Option End] X.TP X.B TMPDIR XDetermine the pathname that provides part of the default Xglobal extended header record file, as described for the X.B \-o globexthdr= Xkeyword in the OPTIONS section. X.TP X.B TZ XDetermine the timezone used to calculate date and time Xstrings when the X.B \-v Xoption is specified. If TZ is unset or Xnull, an unspecified default timezone shall be used. X X.SH "ASYNCHRONOUS EVENTS X.PP XDefault. X X.SH STDOUT X.PP XIn X.B write Xmode, if X.B \-f Xis not specified, the standard output shall Xbe the archive formatted according to one of the specifications in Xthe EXTENDED DESCRIPTION section, or some other Ximplementation-defined format (see X.BI \-x " format" ). X.PP XIn X.B list Xmode, when the X.B \-o listopt= Xformat has been specified, the Xselected archive members shall be written to standard output using Xthe format described under List Mode Format Specifications. In X.B list Xmode without the X.B \-o listopt= Xformat option, the table of Xcontents of the selected archive members shall be written to Xstandard output using the following format: X.PP X "%s\en", X.PP XIf the X.B \-v Xoption is specified in X.B list Xmode, the table of contents Xof the selected archive members shall be written to standard Xoutput using the following formats. X.PP XFor pathnames representing hard links to previous members of the Xarchive: X.PP X.\" "%s[Image]==[Image]%s\en", , X "%s\ ==\ %s\en", , X.PP XFor all other pathnames: X.PP X "%s\en", X.PP Xwhere X.I Xshall be the format specified by the X.BR ls (1) Xutility with the X.B \-l Xoption. When writing pathnames in this format, Xit is unspecified what is written for fields for which the Xunderlying archive format does not have the correct information, Xalthough the correct number of -separated fields shall be Xwritten. X.PP XIn X.B list Xmode, standard output shall not be buffered more than a Xline at a time. X X.SH STDERR X.PP XIf X.B \-v Xis specified in X.BR read , X.BR write , Xor X.B copy Xmodes, X.B pax Xshall write Xthe pathnames it processes to the standard error output using the Xfollowing format: X.PP X "%s\en", X.PP XThese pathnames shall be written as soon as processing is begun on Xthe file or archive member, and shall be flushed to standard Xerror. The trailing , which shall not be buffered, is Xwritten when the file has been read or written. X.PP XIf the X.B \-s Xoption is specified, and the replacement string has a Xtrailing X.BR 'p' , Xsubstitutions shall be written to standard error in Xthe following format: X.PP X.\" "%s[Image]>>[Image]%s\en", , X "%s\ >>\ %s\en", , X.PP XIn all operating modes of X.BR pax , Xoptional messages of unspecified Xformat concerning the input archive format and volume number, the Xnumber of files, blocks, volumes, and media parts as well as other Xdiagnostic messages may be written to standard error. X.PP XIn all formats, for both standard output and standard error, it is Xunspecified how non-printable characters in pathnames or link Xnames are written. X.PP XWhen X.B pax Xis in X.B read Xmode or X.B list Xmode, using the X.B "\-x pax Xarchive Xformat, and a filename, link name, owner name, or any other field Xin an extended header record cannot be translated from the X.B pax XUTF-8 codeset format to the codeset and current locale of the Ximplementation, X.B pax Xshall write a diagnostic message to standard Xerror, shall process the file as described for the X.B \-o invalid= Xoption, and then shall process the next file in the archive. X X.SH "OUTPUT FILES X.PP XIn X.B read Xmode, the extracted output files shall be of the archived Xfile type. In X.B copy Xmode, the copied output files shall be the type Xof the file being copied. In either mode, existing files in the Xdestination hierarchy shall be overwritten only when all Xpermission X.RB ( \-p ), Xmodification time X.RB ( \-u ), Xand invalid-value X.RB ( "\-o invalid=" ) Xtests allow it. X.PP XIn X.B write Xmode, the output file named by the X.B \-f Xoption-argument Xshall be a file formatted according to one of the specifications Xin the EXTENDED DESCRIPTION section, or some other Ximplementation-defined format. X X.SH "EXTENDED DESCRIPTION X.PP X.SS "pax Interchange Format X.PP XA X.B pax Xarchive tape or file produced in the X.B "\-x pax Xformat shall Xcontain a series of blocks. The physical layout of the archive Xshall be identical to the X.B ustar Xformat described in ustar XInterchange Format. Each file archived shall be represented by the Xfollowing sequence: X.RS X.TP X.B \(bu XAn optional header block with extended header records. This Xheader block is of the form described in X.BR "pax Header Block" , Xwith a X.I typeflag Xvalue of X.BR x " or " g . XThe extended header records, Xdescribed in X.BR "pax Extended Header" , Xshall be included as the Xdata for this header block. X.TP X.B \(bu XA header block that describes the file. Any fields in the Xpreceding optional extended header shall override the Xassociated fields in this header block for this file. X.TP X.B \(bu XZero or more blocks that contain the contents of the file. X.RE X.PP XAt the end of the archive file there shall be two 512-byte blocks Xfilled with binary zeros, interpreted as an end-of-archive Xindicator. X.PP XA schematic of an example archive with global extended header Xrecords and two actual files is shown in X.B pax Format Archive XExample. In the example, the second file in the archive has no Xextended header preceding it, presumably because it has no need Xfor extended attributes. X.PP X.ne 30 X.CA "Figure: pax Format Archive Example" X.TS Xcenter box; Xl|c X. Xustar Header [typeflag = 'g'] X_ Global Extended header XGlobal Extended Header Data X_ _ Xustar Header [typeflag = 'x'] X_ XExtended Header Data X_ File 1: Extended Header data is included Xustar Header [typeflag = '0'] X_ XData for File 1 X_ _ Xustar Header [typeflag = '0'] X_ File 2: No Extended Header data is included XData for File 2 X_ _ XBlock of binary Zeroes X_ End of Archive Indicator XBlock of binary Zeroes X.TE X X.SS "pax Header Block X.PP XThe X.B pax Xheader block shall be identical to the X.B ustar Xheader block Xdescribed in X.BR "ustar Interchange Format" , Xexcept that two additional X.I typeflag Xvalues are defined: X.TP X.B x XRepresents extended header records for the following file in Xthe archive (which shall have its own X.B ustar Xheader block). XThe format of these extended header records shall be as Xdescribed in X.BR "pax Extended Header" . X.TP X.B g XRepresents global extended header records for the following Xfiles in the archive. The format of these extended header Xrecords shall be as described in X.BR "pax Extended Header" . XEach Xvalue shall affect all subsequent files that do not override Xthat value in their own extended header record and until Xanother global extended header record is reached that Xprovides another value for the same field. The X.I typeflag X.B g Xglobal headers should not be used with interchange media that Xcould suffer partial data loss in transporting the archive. X.PP XFor both of these types, the size field shall be the size of the Xextended header records in octets. The other fields in the header Xblock are not meaningful to this version of the X.B pax Xutility. XHowever, if this archive is read by a X.B pax Xutility conforming to Xthe ISO POSIX\-2:1993 standard, the header block fields are used to Xcreate a regular file that contains the extended header records as Xdata. Therefore, header block field values should be selected to Xprovide reasonable file access to this regular file. X.PP XA further difference from the X.B ustar Xheader block is that data Xblocks for files of X.I typeflag X.B 1 X(the digit one) (hard link) may be Xincluded, which means that the size field may be greater than Xzero. Archives created by X.B "pax \-o linkdata Xshall include these data Xblocks with the hard links. X X.SS "pax Extended Header X.PP XA X.B pax Xextended header contains values that are inappropriate for Xthe X.B ustar Xheader block because of limitations in that format: Xfields requiring a character encoding other than that described in Xthe ISO/IEC 646:1991 standard, fields representing file attributes Xnot described in the X.B ustar Xheader, and fields whose format or Xlength do not fit the requirements of the X.B ustar Xheader. The values Xin an extended header add attributes to the following file (or Xfiles; see the description of the X.I typeflag X.B g Xheader block) or Xoverride values in the following header block(s), as indicated in Xthe following list of keywords. X.PP XAn extended header shall consist of one or more records, each Xconstructed as follows: X.PP X "%d %s=%s\en", , , X.PP XThe extended header records shall be encoded according to the XISO/IEC 10646\-1:2000 standard (UTF-8). The X.I Xfield, X, equals sign, and shown shall be limited to the Xportable character set, as encoded in UTF-8. The X.I Xand X.I Xfields can be any UTF-8 characters. The X.I Xfield Xshall be the decimal length of the extended header record in Xoctets, including the trailing . X.PP XThe X.I Xfield shall be one of the entries from the following Xlist or a keyword provided as an implementation extension. XKeywords consisting entirely of lowercase letters, digits, and Xperiods are reserved for future standardization. A keyword shall Xnot include an equals sign. (In the following list, the notations X"file(s)" or "block(s)" is used to acknowledge that a keyword Xaffects the following single file after a X.I typeflag X.B x Xextended Xheader, but possibly multiple files after X.I typeflag X.BR g . XAny requirements in the list for X.B pax Xto include a record when in X.B write Xor X.B copy Xmode shall apply only when such a record has not already Xbeen provided through the use of the X.B \-o Xoption. When used in X.B copy Xmode, X.B pax Xshall behave as if an archive had been created with Xapplicable extended header records and then extracted.) X.TP X.B atime XThe file access time for the following file(s), equivalent to Xthe value of the X.I st_atime Xmember of the X.B stat Xstructure for a Xfile, as described by the X.BR stat (2) Xfunction. The access time Xshall be restored if the process has the appropriate Xprivilege required to do so. The format of the X.I Xshall be as described in X.BR "pax Extended Header File Times" . X.TP X.B charset XThe name of the character set used to encode the data in the Xfollowing file(s). The entries in the following table are Xdefined to refer to known standards; additional names may be Xagreed on between the originator and recipient. X.PP X.TS Xcenter box; Xcb|cB Xl|l. X Formal Standard X_ XISO\-IR\ 646\ 1990 ISO/IEC 646:1990 XISO\-IR\ 8859\ 1\ 1998 ISO/IEC 8859\-1:1998 XISO\-IR\ 8859\ 2\ 1999 ISO/IEC 8859\-2:1999 XISO\-IR\ 8859\ 3\ 1999 ISO/IEC 8859\-3:1999 XISO\-IR\ 8859\ 4\ 1998 ISO/IEC 8859\-4:1998 XISO\-IR\ 8859\ 5\ 1999 ISO/IEC 8859\-5:1999 XISO\-IR\ 8859\ 6\ 1999 ISO/IEC 8859\-6:1999 XISO\-IR\ 8859\ 7\ 1987 ISO/IEC 8859\-7:1987 XISO\-IR\ 8859\ 8\ 1999 ISO/IEC 8859\-8:1999 XISO\-IR\ 8859\ 9\ 1999 ISO/IEC 8859\-9:1999 XISO\-IR\ 8859\ 10\ 1998 ISO/IEC 8859\-10:1998 XISO\-IR\ 8859\ 13\ 1998 ISO/IEC 8859\-13:1998 XISO\-IR\ 8859\ 14\ 1998 ISO/IEC 8859\-14:1998 XISO\-IR\ 8859\ 15\ 1999 ISO/IEC 8859\-15:1999 XISO\-IR\ 10646\ 2000 ISO/IEC 10646:2000 XISO\-IR\ 10646\ 2000\ UTF\-8 ISO/IEC 10646, UTF\-8 encoding XBINARY None X.TE X.PP XThe encoding is included in an extended header for Xinformation only; when X.B pax Xis used as described in XIEEE Std 1003.1-2001, it shall not translate the file data Xinto any other encoding. The X.B BINARY Xentry indicates unencoded binary data. X.PP XWhen used in X.B write Xor X.B copy Xmode, it is implementation-defined Xwhether X.B pax Xincludes a charset extended header record for a file. X.TP X.B comment XA series of characters used as a comment. All characters in Xthe X.I Xfield shall be ignored by X.BR pax . X.TP X.B gid XThe group ID of the group that owns the file, expressed as a Xdecimal number using digits from the ISO/IEC 646:1991 Xstandard. This record shall override the X.I gid Xfield in the following header block(s). When used in X.B write Xor X.B copy Xmode, X.B pax Xshall include a gid extended header record for each file Xwhose group ID is greater than 2097151 (octal 7777777). X.TP X.B gname XThe group of the file(s), formatted as a group name in the Xgroup database. This record shall override the X.B gid Xand X.B gname Xfields in the following header block(s), and any X.B gid Xextended Xheader record. When used in X.BR read , X.BR copy , Xor X.B list Xmode, X.B pax Xshall translate the name from the UTF-8 encoding in the Xheader record to the character set appropriate for the group Xdatabase on the receiving system. If any of the UTF-8 Xcharacters cannot be translated, and if the X.BR "\-o invalid=" UTF-8 Xoption is not specified, the results are Ximplementation-defined. When used in X.B write Xor X.B copy Xmode, X.B pax Xshall include a X.B gname Xextended header record for each file Xwhose group name cannot be represented entirely with the Xletters and digits of the portable character set. X.TP X.B linkpath XThe pathname of a link being created to another file, of any Xtype, previously archived. This record shall override the X.I linkname Xfield in the following X.B ustar Xheader block(s). The Xfollowing X.B ustar Xheader block shall determine the type of link Xcreated. If X.I typeflag Xof the following header block is 1, it Xshall be a hard link. If X.I typeflag Xis 2, it shall be a Xsymbolic link and the linkpath value shall be the contents of Xthe symbolic link. The X.B pax Xutility shall translate the name Xof the link (contents of the symbolic link) from the UTF-8 Xencoding to the character set appropriate for the local file Xsystem. When used in X.B write Xor X.B copy Xmode, X.B pax Xshall include a Xlinkpath extended header record for each link whose pathname Xcannot be represented entirely with the members of the Xportable character set other than NUL. X.TP X.B mtime XThe file modification time of the following file(s), Xequivalent to the value of the X.I st_mtime Xmember of the X.B stat Xstructure for a file, as described in the X.BR stat (2) Xfunction. XThis record shall override the X.I mtime Xfield in the following Xheader block(s). The modification time shall be restored if Xthe process has the appropriate privilege required to do so. XThe format of the X.I Xshall be as described in X.BR "pax Extended Header File Times" . X.TP X.B path XThe pathname of the following file(s). This record shall Xoverride the X.I name Xand X.I prefix Xfields in the following header Xblock(s). The X.B pax Xutility shall translate the pathname of the Xfile from the UTF-8 encoding to the character set appropriate Xfor the local file system. X.sp XWhen used in X.B write Xor X.B copy Xmode, X.B pax Xshall include a X.I path Xextended header record for each file whose pathname cannot be Xrepresented entirely with the members of the portable Xcharacter set other than NUL. X.TP X.BI realtime. any XThe keywords prefixed by "realtime." are reserved for future Xstandardization. X.TP X.BI security. any XThe keywords prefixed by "security." are reserved for future Xstandardization. X.TP X.B size XThe size of the file in octets, expressed as a decimal number Xusing digits from the ISO/IEC 646:1991 standard. This record Xshall override the X.I size Xfield in the following header Xblock(s). When used in X.B write Xor X.B copy Xmode, X.B pax Xshall include Xa X.I size Xextended header record for each file with a size value Xgreater than 8589934591 (octal 77777777777). X.TP X.B uid XThe user ID of the file owner, expressed as a decimal number Xusing digits from the ISO/IEC 646:1991 standard. This record Xshall override the X.I uid Xfield in the following header Xblock(s). When used in X.B write Xor X.B copy Xmode, X.B pax Xshall include a X.I uid Xextended header record for each file whose owner ID is Xgreater than 2097151 (octal 7777777). X.TP X.B uname XThe owner of the following file(s), formatted as a user name Xin the user database. This record shall override the X.I uid Xand X.I uname Xfields in the following header block(s), and any X.I uid Xextended header record. When used in X.BR read , X.BR copy ", or" X.B list Xmode, X.B pax Xshall translate the name from the UTF-8 encoding in Xthe header record to the character set appropriate for the Xuser database on the receiving system. If any of the UTF-8 Xcharacters cannot be translated, and if the X.BR "\-o invalid=" UTF-8 Xoption is not specified, the results are Ximplementation-defined. When used in X.B write Xor X.B copy Xmode, X.B pax Xshall include a X.I uname Xextended header record for each file Xwhose user name cannot be represented entirely with the Xletters and digits of the portable character set. X.PP XIf the X.I Xfield is zero length, it shall delete any header Xblock field, previously entered extended header value, or global Xextended header value of the same name. X.PP XIf a keyword in an extended header record (or in a X.B \-o Xoption-argument) overrides or deletes a corresponding field in the X.B ustar Xheader block, X.B pax Xshall ignore the contents of that header block field. X.PP XUnlike the X.B ustar Xheader block fields, NULs shall not delimit X.IR s; Xall characters within the X.I Xfield shall be Xconsidered data for the field. None of the length limitations of Xthe X.B ustar Xheader block fields in X.B "ustar Header Block Xshall apply to the extended header records. X X.SS "pax Extended Header Keyword Precedence X.PP XThis section describes the precedence in which the various header Xrecords and fields and command line options are selected to apply Xto a file in the archive. When X.B pax Xis used in X.B read Xor X.B list Xmodes, it shall determine a file attribute in the following sequence: X.RS X.TP X1. XIf X.BI "\-o delete=" keyword-prefix Xis used, the affected attributes Xshall be determined from step 7., if applicable, or ignored Xotherwise. X.TP X2. XIf X.BI "\-o " keyword:= Xis used, the affected attributes shall be ignored. X.TP X3. XIf X.BI "\-o " keyword:=value Xis used, the affected attribute shall be assigned the value. X.TP X4. XIf there is a X.I typeflag X.B x Xextended header record, the affected Xattribute shall be assigned the X.IR . XWhen extended header Xrecords conflict, the last one given in the header shall take Xprecedence. X.TP X5. XIf X.BI "\-o " keyword=value Xis used, the affected attribute shall Xbe assigned the value. X.TP X6. XIf there is a X.I typeflag X.B g Xglobal extended header record, the Xaffected attribute shall be assigned the X.IR . XWhen global Xextended header records conflict, the last one given in the Xglobal header shall take precedence. X.TP X7. XOtherwise, the attribute shall be determined from the X.B ustar Xheader block. X.RE X X.SS "pax Extended Header File Times X.PP XThe X.B pax Xutility shall write an X.B mtime Xrecord for each file in X.B write Xor X.B copy Xmodes if the file's modification time cannot be Xrepresented exactly in the X.B ustar Xheader logical record described Xin X.BR "ustar Interchange Format" . XThis can occur if the time is out of X.B ustar Xrange, or if the file system of the underlying Ximplementation supports non-integer time granularities and the Xtime is not an integer. All of these time records shall be Xformatted as a decimal representation of the time in seconds since Xthe Epoch. If a period ('.') decimal point character is present, Xthe digits to the right of the point shall represent the units of Xa subsecond timing granularity, where the first digit is tenths of Xa second and each subsequent digit is a tenth of the previous Xdigit. In X.B read Xor X.B copy Xmode, the X.B pax Xutility shall truncate the Xtime of a file to the greatest value that is not greater than the Xinput header file time. In X.B write Xor X.B copy Xmode, the X.B pax Xutility Xshall output a time exactly if it can be represented exactly as a Xdecimal number, and otherwise shall generate only enough digits so Xthat the same time shall be recovered if the file is extracted on Xa system whose underlying implementation supports the same time Xgranularity. X X.SS "ustar Interchange Format XA X.B ustar Xarchive tape or file shall contain a series of logical Xrecords. Each logical record shall be a fixed-size logical record Xof 512 octets (see below). Although this format may be thought of Xas being stored on 9-track industry-standard 12.7 mm (0.5 in) Xmagnetic tape, other types of transportable media are not Xexcluded. Each file archived shall be represented by a header Xlogical record that describes the file, followed by zero or more Xlogical records that give the contents of the file. At the end of Xthe archive file there shall be two 512-octet logical records Xfilled with binary zeros, interpreted as an end-of-archive Xindicator. X.PP XThe logical records may be grouped for physical I/O operations, as Xdescribed under the X.BI \-b " blocksize Xand X.BI \-x " ustar Xoptions. Each group Xof logical records may be written with a single operation Xequivalent to the X.BR write (2) Xfunction. On magnetic tape, the result Xof this write shall be a single tape physical block. The last Xphysical block shall always be the full size, so logical records Xafter the two zero logical records may contain undefined data. X.PP XThe header logical record shall be structured as shown in the Xfollowing table. All lengths and offsets are in decimal. X.PP X.sp X.ne 20 X.CA "Table: ustar Header Block" X.TS Xcenter box; Xcb|cb|cb Xl|n|n. XField Name Octet Offset Length (in Octets) X_ Xname 0 100 Xmode 100 8 Xuid 108 8 Xgid 116 8 Xsize 124 12 Xmtime 136 12 Xchksum 148 8 Xtypeflag 156 1 Xlinkname 157 100 Xmagic 257 6 Xversion 263 2 Xuname 265 32 Xgname 297 32 Xdevmajor 329 8 Xdevminor 337 8 Xprefix 345 155 X.TE X.PP XAll characters in the header logical record shall be represented Xin the coded character set of the ISO/IEC 646:1991 standard. For Xmaximum portability between implementations, names should be Xselected from characters represented by the portable filename Xcharacter set as octets with the most significant bit zero. If an Ximplementation supports the use of characters outside of slash and Xthe portable filename character set in names for files, users, and Xgroups, one or more implementation-defined encodings of these Xcharacters shall be provided for interchange purposes. X.PP XHowever, the X.B pax Xutility shall never create filenames on the local Xsystem that cannot be accessed via the procedures described in XIEEE Std 1003.1-2001. If a filename is found on the medium that Xwould create an invalid filename, it is implementation-defined Xwhether the data from the file is stored on the file hierarchy and Xunder what name it is stored. The X.B pax Xutility may choose to ignore Xthese files as long as it produces an error indicating that the Xfile is being ignored. X.PP XEach field within the header logical record is contiguous; that Xis, there is no padding used. Each character on the archive medium Xshall be stored contiguously. X.PP XThe fields X.IR magic , X.IR uname , Xand X.I gname Xare character strings each Xterminated by a NUL character. The fields X.IR name , X.IR linkname , Xand X.I prefix Xare NUL-terminated character strings except when all Xcharacters in the array contain non-NUL characters including the Xlast character. The X.I version Xfield is two octets containing the Xcharacters "00" (zero-zero). The X.I typeflag Xcontains a single Xcharacter. All other fields are leading zero-filled octal numbers Xusing digits from the ISO/IEC 646:1991 standard IRV. Each numeric Xfield is terminated by one or more or NUL characters. X.PP XThe X.I name Xand the X.I prefix Xfields shall produce the pathname of the Xfile. A new pathname shall be formed, if X.I prefix Xis not an empty Xstring (its first character is not NUL), by concatenating X.I prefix X(up to the first NUL character), a slash character, and X.IR name ; Xotherwise, X.I name Xis used alone. In either case, X.I name Xis terminated Xat the first NUL character. If X.I prefix Xbegins with a NUL character, Xit shall be ignored. In this manner, pathnames of at most 256 Xcharacters can be supported. If a pathname does not fit in the Xspace provided, X.B pax Xshall notify the user of the error, and shall Xnot store any part of the file-header or data-on the medium. X.PP XThe X.I linkname Xfield, described below, shall not use the X.I prefix Xto Xproduce a pathname. As such, a X.I linkname Xis limited to 100 Xcharacters. If the name does not fit in the space provided, X.B pax Xshall notify the user of the error, and shall not attempt to store Xthe link on the medium. X.PP XThe X.I mode Xfield provides 12 bits encoded in the ISO/IEC 646:1991 Xstandard octal digit representation. The encoded bits shall Xrepresent the following values: X.PP X.sp X.ne 25 X.CA "Table: ustar mode Field" X.TS Xcenter box; Xcb|cb|cb Xcb|cb|cb Xl|l|l. XBit IEEE Std Description XValue 1003.1-2001 Bit X_ X04000 S_ISUID Set UID on execution. X02000 S_ISGID Set GID on execution. X01000 Reserved for future standardization. X00400 S_IRUSR Read permission for file owner class. X00200 S_IWUSR Write permission for file owner class. X00100 S_IXUSR Execute/search permission for file owner class. X00040 S_IRGRP Read permission for file group class. X00020 S_IWGRP Write permission for file group class. X00010 S_IXGRP Execute/search permission for file group class. X00004 S_IROTH Read permission for file other class. X00002 S_IWOTH Write permission for file other class. X00001 S_IXOTH Execute/search permission for file other class. X.TE X.PP XWhen appropriate privilege is required to set one of these mode Xbits, and the user restoring the files from the archive does not Xhave the appropriate privilege, the mode bits for which the user Xdoes not have appropriate privilege shall be ignored. Some of the Xmode bits in the archive format are not mentioned elsewhere in Xthis volume of IEEE Std 1003.1-2001. If the implementation does Xnot support those bits, they may be ignored. X.PP XThe X.I uid and X.I gid Xfields are the user and group ID of the owner and Xgroup of the file, respectively. X.PP XThe X.I size Xfield is the size of the file in octets. If the X.I typeflag Xfield is set to specify a file to be of type 1 (a link) or 2 (a Xsymbolic link), the X.I size Xfield shall be specified as zero. If the X.I typeflag Xfield is set to specify a file of type 5 (directory), the Xsize field shall be interpreted as described under the definition Xof that record type. No data logical records are stored for types X1, 2, or 5. If the typeflag field is set to 3 (character special Xfile), 4 (block special file), or 6 (FIFO), the meaning of the X.I size Xfield is unspecified by this volume of IEEE Std 1003.1-2001, Xand no data logical records shall be stored on the medium. XAdditionally, for type 6, the X.I size Xfield shall be ignored when Xreading. If the X.I typeflag Xfield is set to any other value, the Xnumber of logical records written following the header shall be X(size+511)/512, ignoring any fraction in the result of the Xdivision. X.PP XThe X.I mtime Xfield shall be the modification time of the file at the Xtime it was archived. It is the ISO/IEC 646:1991 standard Xrepresentation of the octal value of the modification time Xobtained from the X.BR stat (2) Xfunction. X.PP XThe X.I chksum Xfield shall be the ISO/IEC 646:1991 standard IRV Xrepresentation of the octal value of the simple sum of all octets Xin the header logical record. Each octet in the header shall be Xtreated as an unsigned value. These values shall be added to an Xunsigned integer, initialized to zero, the precision of which is Xnot less than 17 bits. When calculating the checksum, the X.I chksum Xfield is treated as if it were all spaces. X.PP XThe X.I typeflag Xfield specifies the type of file archived. If a Xparticular implementation does not recognize the type, or the user Xdoes not have appropriate privilege to create that type, the file Xshall be extracted as if it were a regular file if the file type Xis defined to have a meaning for the X.I size Xfield that could cause Xdata logical records to be written on the medium (see the previous Xdescription for X.IR size ). XIf conversion to a regular file occurs, the X.B pax Xutility shall produce an error indicating that the conversion Xtook place. All of the X.I typeflag Xfields shall be coded in the XISO/IEC 646:1991 standard IRV: X.TP X.B 0 XRepresents a regular file. For backwards-compatibility, a X.I typeflag Xvalue of binary zero ('\e0') should be recognized Xas meaning a regular file when extracting files from the Xarchive. Archives written with this version of the archive Xfile format create regular files with a X.I typefla Xvalue of the XISO/IEC 646:1991 standard IRV '0'. X.TP X.B 1 XRepresents a file linked to another file, of any type, Xpreviously archived. Such files are identified by having the Xsame device and file serial numbers, and pathnames that refer Xto different directory entries. All such files shall be Xarchived as linked files. The linked-to name is specified in Xthe X.I linkname Xfield with a NUL-character terminator if it is Xless than 100 octets in length. X.TP X.B 2 XRepresents a symbolic link. The contents of the symbolic link Xshall be stored in the X.I linkname Xfield. X.TP X.B 3,4 XRepresent character special files and block special files Xrespectively. In this case the X.I devmajor Xand X.I devminor Xfields Xshall contain information defining the device, the format of Xwhich is unspecified by this volume of IEEE Std 1003.1-2001. XImplementations may map the device specifications to their Xown local specification or may ignore the entry. X.TP X.B 5 XSpecifies a directory or subdirectory. On systems where disk Xallocation is performed on a directory basis, the X.I size Xfield Xshall contain the maximum number of octets (which may be Xrounded to the nearest disk block allocation unit) that the Xdirectory may hold. A X.I size Xfield of zero indicates no such Xlimiting. Systems that do not support limiting in this manner Xshould ignore the X.I size Xfield. X.TP X.B 6 XSpecifies a FIFO special file. Note that the archiving of a XFIFO file archives the existence of this file and not its Xcontents. X.TP X.B 7 XReserved to represent a file to which an implementation has Xassociated some high-performance attribute. Implementations Xwithout such extensions should treat this file as a regular Xfile (type 0). X.TP X.B A\-Z XThe letters 'A' to 'Z', inclusive, are reserved for custom Ximplementations. All other values are reserved for future Xversions of IEEE Std 1003.1-2001. X.PP XIt is unspecified whether files with pathnames that refer to the Xsame directory entry are archived as linked files or as separate Xfiles. If they are archived as linked files, this means that Xattempting to extract both pathnames from the resulting archive Xwill always cause an error (unless the X.B \-u Xoption is used) because Xthe link cannot be created. X.PP XIt is unspecified whether files with the same device and file Xserial numbers being appended to an archive are treated as linked Xfiles to members that were in the archive before the append. X.PP XAttempts to archive a socket using X.B ustar Xinterchange format shall Xproduce a diagnostic message. Handling of other file types is Ximplementation-defined. X.PP XThe X.I magic Xfield is the specification that this archive was output Xin this archive format. If this field contains X.B ustar X(the five Xcharacters from the ISO/IEC 646:1991 standard IRV shown followed Xby NUL), the X.I uname Xand X.I gname Xfields shall contain the XISO/IEC 646:1991 standard IRV representation of the owner and Xgroup of the file, respectively (truncated to fit, if necessary). XWhen the file is restored by a privileged, protection-preserving Xversion of the utility, the user and group databases shall be Xscanned for these names. If found, the user and group IDs Xcontained within these files shall be used rather than the values Xcontained within the X.I uid Xand X.I gid Xfields. X X.SS "cpio Interchange Format X.PP XThe octet-oriented X.B cpio Xarchive format shall be a series of Xentries, each comprising a header that describes the file, the Xname of the file, and then the contents of the file. X.PP XAn archive may be recorded as a series of fixed-size blocks of Xoctets. This blocking shall be used only to make physical I/O more Xefficient. The last group of blocks shall always be at the full Xsize. X.PP XFor the octet-oriented X.B cpio Xarchive format, the individual entry Xinformation shall be in the order indicated and described by the Xfollowing table; see also the X.B Xheader. X.PP X.sp X.ne 25 X.CA "Table: Octet-Oriented cpio Archive Entry" X.TS Xcenter box; Xcb|cb|cb Xl|l|l. XHeader Field Name Length (in Octets) Interpreted as X_ Xc_magic 6 Octal number Xc_dev 6 Octal number Xc_ino 6 Octal number Xc_mode 6 Octal number Xc_uid 6 Octal number Xc_gid 6 Octal number Xc_nlink 6 Octal number Xc_rdev 6 Octal number Xc_mtime 11 Octal number Xc_namesize 6 Octal number Xc_filesize 11 Octal number X X\fBFilename Field Name Length Interpreted as\fP Xc_name c_namesize Pathname string X X\fBFile Data Field Name Length Interpreted as\fP Xc_filedata c_filesize Data X.TE X.PP X.SS "cpio Header X.PP XFor each file in the archive, a header as defined previously shall Xbe written. The information in the header fields is written as Xstreams of the ISO/IEC 646:1991 standard characters interpreted as Xoctal numbers. The octal numbers shall be extended to the Xnecessary length by appending the ISO/IEC 646:1991 standard IRV Xzeros at the most-significant-digit end of the number; the result Xis written to the most-significant digit of the stream of octets Xfirst. The fields shall be interpreted as follows: X.PP X.TP X.B c_magic XIdentify the archive as being a transportable archive by Xcontaining the identifying value "070707". X.TP X.BR c_dev ", " c_ino XContains values that uniquely identify the file within the Xarchive (that is, no files contain the same pair of X.I c_dev Xand X.I c_ino Xvalues unless they are links to the same file). The Xvalues shall be determined in an unspecified manner. X.TP X.B c_mode XContains the file type and access permissions as defined in Xthe following table. X.RS X.PP X.sp X.ne 35 X.CA "Table: Values for cpio c_mode Field" X.TS Xcenter box; Xcb|cb|cb Xl|l|l. XFile Permissions Name Value Indicates X_ XC_IRUSR 000400 Read by owner XC_IWUSR 000200 Write by owner XC_IXUSR 000100 Execute by owner XC_IRGRP 000040 Read by group XC_IWGRP 000020 Write by group XC_IXGRP 000010 Execute by group XC_IROTH 000004 Read by others XC_IWOTH 000002 Write by others XC_IXOTH 000001 Execute by others XC_ISUID 004000 Set uid XC_ISGID 002000 Set gid XC_ISVTX 001000 Reserved X_ X\fBFile Type Name Value Indicates\fP X_ XC_ISDIR 0040000 Directory XC_ISFIFO 0010000 FIFO XC_ISREG 0100000 Regular file XC_ISLNK 0120000 Symbolic link XC_ISBLK 0060000 Block special file XC_ISCHR 0020000 Character special file XC_ISSOCK 0140000 Socket XC_ISCTG 0110000 Reserved X.TE X.PP XDirectories, FIFOs, symbolic links, and regular files shall Xbe supported on a system conforming to this volume of XIEEE Std 1003.1-2001; additional values defined previously Xare reserved for compatibility with existing systems. XAdditional file types may be supported; however, such files Xshould not be written to archives intended to be transported Xto other systems. X.RE X.TP X.B c_uid XContains the user ID of the owner. X.TP X.B c_gid XContains the group ID of the group. X.TP X.B c_nlink XContains a number greater than or equal to the number of Xlinks in the archive referencing the file. If the X.B \-a Xoption Xis used to append to a X.I cpio Xarchive, then the X.B pax Xutility Xneed not account for the files in the existing part of the Xarchive when calculating the X.I c_nlink Xvalues for the appended Xpart of the archive, and need not alter the X.I c_nlink Xvalues in Xthe existing part of the archive if additional files with the Xsame X.I c_dev Xand X.I c_ino Xvalues are appended to the archive. X.TP X.B c_rdev XContains implementation-defined information for character or Xblock special files. X.TP X.B c_mtime XContains the latest time of modification of the file at the Xtime the archive was created. X.TP X.B c_namesize XContains the length of the pathname, including the Xterminating NUL character. X.TP X.B c_filesize XContains the length of the file in octets. This shall be the Xlength of the data section following the header structure. X X.SS "cpio Filename X.PP XThe X.I c_name Xfield shall contain the pathname of the file. The Xlength of this field in octets is the value of X.IR c_namesize . X.PP XIf a filename is found on the medium that would create an invalid Xpathname, it is implementation-defined whether the data from the Xfile is stored on the file hierarchy and under what name it is Xstored. X.PP XAll characters shall be represented in the ISO/IEC 646:1991 Xstandard IRV. For maximum portability between implementations, Xnames should be selected from characters represented by the Xportable filename character set as octets with the most Xsignificant bit zero. If an implementation supports the use of Xcharacters outside the portable filename character set in names Xfor files, users, and groups, one or more implementation-defined Xencodings of these characters shall be provided for interchange Xpurposes. However, the X.B pax Xutility shall never create filenames on Xthe local system that cannot be accessed via the procedures Xdescribed previously in this volume of IEEE Std 1003.1-2001. If a Xfilename is found on the medium that would create an invalid Xfilename, it is implementation-defined whether the data from the Xfile is stored on the local file system and under what name it is Xstored. The X.B pax Xutility may choose to ignore these files as long Xas it produces an error indicating that the file is being ignored. X X.SS cpio File Data X.PP XFollowing X.IR c_name , Xthere shall be X.I c_filesize Xoctets of data. XInterpretation of such data occurs in a manner dependent on the Xfile. If X.I c_filesize Xis zero, no data shall be contained in X.IR c_filedata . X.PP XWhen restoring from an archive: X.TP X.B \(bu XIf the user does not have the appropriate privilege to create Xa file of the specified type, X.B pax Xshall ignore the entry and Xwrite an error message to standard error. X.TP X.B \(bu XOnly regular files have data to be restored. Presuming a Xregular file meets any selection criteria that might be Ximposed on the format-reading utility by the user, such data Xshall be restored. X.TP X.B \(bu XIf a user does not have appropriate privilege to set a Xparticular mode flag, the flag shall be ignored. Some of the Xmode flags in the archive format are not mentioned elsewhere Xin this volume of IEEE Std 1003.1-2001. If the implementation Xdoes not support those flags, they may be ignored. X X.SS "cpio Special Entries X.PP XFIFO special files, directories, and the trailer shall be recorded Xwith X.I c_filesize Xequal to zero. For other special files, X.I c_filesize Xis unspecified by this volume of IEEE Std 1003.1-2001. The header Xfor the next file entry in the archive shall be written directly Xafter the last octet of the file entry preceding it. A header Xdenoting the filename X.B "TRAILER!!!" Xshall indicate the end of the Xarchive; the contents of octets in the last block of the archive Xfollowing such a header are undefined. X X.SH "EXIT STATUS X.PP XThe following exit values shall be returned: X.TP X.B " 0 XAll files were processed successfully. X.TP X.B >0 XAn error occurred. X X.SH "CONSEQUENCES OF ERRORS X.PP XIf X.B pax Xcannot create a file or a link when reading an archive or Xcannot find a file when writing an archive, or cannot preserve the Xuser ID, group ID, or file mode when the X.B \-p Xoption is specified, a Xdiagnostic message shall be written to standard error and a Xnon-zero exit status shall be returned, but processing shall Xcontinue. In the case where X.B pax Xcannot create a link to a file, X.B pax Xshall not, by default, create a second copy of the file. X.PP XIf the extraction of a file from an archive is prematurely Xterminated by a signal or error, X.B pax Xmay have only partially Xextracted the file or (if the X.B \-n Xoption was not specified) may Xhave extracted a file of the same name as that specified by the Xuser, but which is not the file the user wanted. Additionally, the Xfile modes of extracted directories may have additional bits from Xthe S_IRWXU mask set as well as incorrect modification and access Xtimes. X X.ne 5 X.PP X.RU X.HD "The following sections are informative." X X.SH "APPLICATION USAGE X.PP XCaution is advised when using the X.B \-a Xoption to append to a X.I cpio Xformat archive. If any of the files being appended happen to be Xgiven the same X.I c_dev Xand X.I c_ino Xvalues as a file in the existing Xpart of the archive, then they may be treated as links to that Xfile on extraction. Thus, it is risky to use X.B \-a Xwith X.I cpio Xformat Xexcept when it is done on the same system that the original Xarchive was created on, and with the same X.B pax Xutility, and in the Xknowledge that there has been little or no file system activity Xsince the original archive was created that could lead to any of Xthe files appended being given the same X.I c_dev Xand X.I c_ino Xvalues as Xan unrelated file in the existing part of the archive. Also, when X(intentionally) appending additional links to a file in the Xexisting part of the archive, the X.I c_nlink Xvalues in the modified Xarchive can be smaller than the number of links to the file in the Xarchive, which may mean that the links are not preserved on Xextraction. X.PP XThe X.B \-p X(privileges) option was invented to reconcile differences Xbetween historical X.B tar Xand X.B cpio Ximplementations. In particular, Xthe two utilities use X.B \-m Xin diametrically opposed ways. The X.B \-p Xoption also provides a consistent means of extending the ways in Xwhich future file attributes can be addressed, such as for Xenhanced security systems or high-performance files. Although it Xmay seem complex, there are really two modes that are most Xcommonly used: X.TP X.B \-p e X``Preserve everything". This would be used by the historical Xsuperuser, someone with all the appropriate privileges, to Xpreserve all aspects of the files as they are recorded in the Xarchive. The X.B e Xflag is the sum of X.B o Xand X.BR p , Xand other implementation-defined attributes. X.TP X.B \-p p X``Preserve" the file mode bits. This would be used by the Xuser with regular privileges who wished to preserve aspects Xof the file other than the ownership. The file times are Xpreserved by default, but two other flags are offered to Xdisable these and use the time of extraction. X.PP XThe one pathname per line format of standard input precludes Xpathnames containing s. Although such pathnames violate Xthe portable filename guidelines, they may exist and their Xpresence may inhibit usage of X.B pax Xwithin shell scripts. This Xproblem is inherited from historical archive programs. The problem Xcan be avoided by listing filename arguments on the command line Xinstead of on standard input. X.PP XIt is almost certain that appropriate privileges are required for X.B pax Xto accomplish parts of this volume of IEEE Std 1003.1-2001. XSpecifically, creating files of type block special or character Xspecial, restoring file access times unless the files are owned by Xthe user (the X.B \-t Xoption), or preserving file owner, group, and Xmode (the X.B \-p Xoption) all probably require appropriate privileges. X.PP XIn X.B read Xmode, implementations are permitted to overwrite files Xwhen the archive has multiple members with the same name. This may Xfail if permissions on the first version of the file do not permit Xit to be overwritten. X.PP XThe X.B cpio Xand X.B ustar Xformats can only support files up to 8589934592 Xbytes (8 * 2^30) in size. X X.SH EXAMPLES X.PP XThe following command: X.PP X.B X pax \-w \-f /dev/rmt/1m . X.PP Xcopies the contents of the current directory to tape drive 1, Xmedium density (assuming historical System V device naming Xprocedures-the historical BSD device name would be /dev/rmt9). X.PP XThe following commands: X.PP X.B X mkdir newdirpax \-rw olddir newdir X.PP Xcopy the olddir directory hierarchy to newdir. X.PP X.B X pax \-r \-s ',^//*usr//*,,' \-f a.pax X.PP Xreads the archive a.pax, with all files rooted in /usr in the Xarchive extracted relative to the current directory. X.PP XUsing the option: X.PP X.B X \-o listopt="%M %(atime)T %(size)D %(name)s" X.PP Xoverrides the default output description in Standard Output and Xinstead writes: X.PP X.B X \-rw\-rw\-\-\- Jan 12 15:53 1492 /usr/foo/bar X.PP XUsing the options: X.PP X.B X \-o listopt='%L\et%(size)D\en%.7' \e X.br X.B X \-o listopt='(name)s\en%(atime)T\en%T' X.P Xoverrides the default output description in Standard Output and Xinstead writes: X.PP X.B "/usr/foo/bar \-> /tmp 1492 X.br X.B "/usr/fo X.br X.B "Jan 12 1991 X.br X.B "Jan 31 15:53 X X.SH RATIONALE X.PP XThe X.B pax Xutility was new for the ISO POSIX-2:1993 standard. It Xrepresents a peaceful compromise between advocates of the Xhistorical X.B tar Xand X.B cpio Xutilities. X.PP XA fundamental difference between X.B cpio Xand X.B tar Xwas in the way Xdirectories were treated. The X.B cpio Xutility did not treat Xdirectories differently from other files, and to select a Xdirectory and its contents required that each file in the Xhierarchy be explicitly specified. For X.BR tar , Xa directory matched Xevery file in the file hierarchy it rooted. X.PP XThe X.B pax Xutility offers both interfaces; by default, directories Xmap into the file hierarchy they root. The X.B \-d Xoption causes X.B pax Xto Xskip any file not explicitly referenced, as X.I cpio Xhistorically did. XThe X.B tar X- style behavior was chosen as the default because it was Xbelieved that this was the more common usage and because X.B tar Xis Xthe more commonly available interface, as it was historically Xprovided on both System V and BSD implementations. X.PP XThe data interchange format specification in this volume of XIEEE Std 1003.1-2001 requires that processes with "appropriate Xprivileges" shall always restore the ownership and permissions of Xextracted files exactly as archived. If viewed from the historic Xequivalence between superuser and "appropriate privileges", there Xare two problems with this requirement. First, users running as Xsuperusers may unknowingly set dangerous permissions on extracted Xfiles. Second, it is needlessly limiting, in that superusers Xcannot extract files and own them as superuser unless the archive Xwas created by the superuser. (It should be noted that restoration Xof ownerships and permissions for the superuser, by default, is Xhistorical practice in X.IR cpio , Xbut not in X.BR tar .) XIn order to avoid Xthese two problems, the X.I pax Xspecification has an additional X"privilege" mechanism, the X.B \-p Xoption. Only a X.B pax Xinvocation with Xthe privileges needed, and which has the X.B \-p Xoption set using the X.B e Xspecification character, has the "appropriate privilege" to Xrestore full ownership and permission information. X.PP XNote also that this volume of IEEE Std 1003.1-2001 requires that Xthe file ownership and access permissions shall be set, on Xextraction, in the same fashion as the X.BR creat (2) Xfunction when Xprovided with the mode stored in the archive. This means that the Xfile creation mask of the user is applied to the file permissions. X.PP XUsers should note that directories may be created by X.B pax Xwhile Xextracting files with permissions that are different from those Xthat existed at the time the archive was created. When extracting Xsensitive information into a directory hierarchy that no longer Xexists, users are encouraged to set their file creation mask Xappropriately to protect these files during extraction. X.PP XThe table of contents output is written to standard output to Xfacilitate pipeline processing. X.PP XAn early proposal had hard links displaying for all pathnames. XThis was removed because it complicates the output of the case Xwhere X.B \-v Xis not specified and does not match historical X.B cpio Xusage. The hard-link information is available in the X.B \-v Xdisplay. X.PP XThe description of the X.B \-l Xoption allows implementations to make Xhard links to symbolic links. IEEE Std 1003.1-2001 does not Xspecify any way to create a hard link to a symbolic link, but many Ximplementations provide this capability as an extension. If there Xare hard links to symbolic links when an archive is created, the Ximplementation is required to archive the hard link in the archive X(unless X.B \-H Xor X.B \-L Xis specified). When in X.B read Xmode and in X.B copy Xmode, implementations supporting hard links to symbolic links Xshould use them when appropriate. X.PP XThe archive formats inherited from the POSIX.1-1990 standard have Xcertain restrictions that have been brought along from historical Xusage. For example, there are restrictions on the length of Xpathnames stored in the archive. When X.B pax is used in X.BR copy " (" \-rw ) Xmode (copying directory hierarchies), the ability to use Xextensions from the X.BI \-x " pax Xformat overcomes these restrictions. X.PP XThe default blocksize value of 5120 bytes for X.B cpio Xwas selected Xbecause it is one of the standard block-size values for X.BR cpio , Xset Xwhen the X.B \-B Xoption is specified. (The other default block-size Xvalue for X.B cpio Xis 512 bytes, and this was considered to be too Xsmall.) The default block value of 10240 bytes for X.B tar Xwas selected because that is the standard block-size value for BSD X.BR tar . XThe maximum block size of 32256 bytes (2^15-512 bytes) is the Xlargest multiple of 512 bytes that fits into a signed 16-bit tape Xcontroller transfer register. There are known limitations in some Xhistorical systems that would prevent larger blocks from being Xaccepted. Historical values were chosen to improve compatibility Xwith historical scripts using X.BR dd (1) Xor similar utilities to Xmanipulate archives. Also, default block sizes for any file type Xother than character special file has been deleted from this Xvolume of IEEE Std 1003.1-2001 as unimportant and not likely to Xaffect the structure of the resulting archive. X.PP XImplementations are permitted to modify the block-size value based Xon the archive format or the device to which the archive is being Xwritten. This is to provide implementations with the opportunity Xto take advantage of special types of devices, and it should not Xbe used without a great deal of consideration as it almost Xcertainly decreases archive portability. X.PP XThe intended use of the X.B \-n Xoption was to permit extraction of one Xor more files from the archive without processing the entire Xarchive. This was viewed by the standard developers as offering Xsignificant performance advantages over historical Ximplementations. The X.B \-n Xoption in early proposals had three Xeffects; the first was to cause special characters in patterns to Xnot be treated specially. The second was to cause only the first Xfile that matched a pattern to be extracted. The third was to Xcause X.B pax Xto write a diagnostic message to standard error when no Xfile was found matching a specified pattern. Only the second Xbehavior is retained by this volume of IEEE Std 1003.1-2001, for Xmany reasons. First, it is in general not acceptable for a single Xoption to have multiple effects. Second, the ability to make Xpattern matching characters act as normal characters is useful for Xparts of X.B pax Xother than file extraction. Third, a finer degree of Xcontrol over the special characters is useful because users may Xwish to normalize only a single special character in a single Xfilename. Fourth, given a more general escape mechanism, the Xprevious behavior of the X.B \-n Xoption can be easily obtained using Xthe X.B \-s Xoption or a sed script. Finally, writing a diagnostic Xmessage when a pattern specified by the user is unmatched by any Xfile is useful behavior in all cases. X.PP XIn this version, the X.B \-n Xwas removed from the copy mode synopsis of X.BR pax ; Xit is inapplicable because there are no pattern operands Xspecified in this mode. X.PP XThere is another method than X.B pax Xfor copying subtrees in XIEEE Std 1003.1-2001 described as part of the X.BR cp (1) Xutility. Both Xmethods are historical practice: X.BR cp (1) Xprovides a simpler, more Xintuitive interface, while X.B pax Xoffers a finer granularity of Xcontrol. Each provides additional functionality to the other; in Xparticular, X.B pax Xmaintains the hard-link structure of the hierarchy Xwhile X.BR cp (1) Xdoes not. It is the intention of the standard developers Xthat the results be similar (using appropriate option combinations Xin both utilities). The results are not required to be identical; Xthere seemed insufficient gain to applications to balance the Xdifficulty of implementations having to guarantee that the results Xwould be exactly identical. X.PP XA single archive may span more than one file. It is suggested that Ximplementations provide informative messages to the user on Xstandard error whenever the archive file is changed. X.PP XThe X.B \-d Xoption (do not create intermediate directories not listed Xin the archive) found in early proposals was originally provided Xas a complement to the historic X.B \-d Xoption of X.BR cpio . XIt has been deleted. X.PP XThe X.B \-s Xoption in early proposals specified a subset of the Xsubstitution command from the ed utility. As there was no reason Xfor only a subset to be supported, the X.B \-s Xoption is now compatible Xwith the current ed specification. Since the delimiter can be any Xnon-null character, the following usage with single spaces is Xvalid: X.PP X.B X pax \-s " foo bar " .\|.\|. X.PP XThe X.B \-t description is worded so as to note that this may cause the Xaccess time update caused by some other activity (which occurs Xwhile the file is being read) to be overwritten. X.PP XThe default behavior of X.B pax Xwith regard to file modification times Xis the same as historical implementations of X.BR tar . XIt is not the Xhistorical behavior of X.BR cpio . X.PP XBecause the X.B \-i Xoption uses X.BR /dev/tty , Xutilities without a Xcontrolling terminal are not able to use this option. X.PP XThe X.B \-y Xoption, found in early proposals, has been deleted because Xa line containing a single period for the X.B \-i Xoption has equivalent Xfunctionality. The special lines for the X.B \-i Xoption (a single Xperiod and the empty line) are historical practice in X.BR cpio . X.PP XIn early drafts, a X.BI \-e " charmap Xoption was included to increase Xportability of files between systems using different coded Xcharacter sets. This option was omitted because it was apparent Xthat consensus could not be formed for it. In this version, the Xuse of UTF-8 should be an adequate substitute. X.PP XThe X.B \-k Xoption was added to address international concerns about Xthe dangers involved in the character set transformations of X.B \-e X(if the target character set were different from the source, the Xfilenames might be transformed into names matching existing files) Xand also was made more general to protect files transferred Xbetween file systems with different X.I {NAME_MAX} Xvalues (truncating Xa filename on a smaller system might also inadvertently overwrite Xexisting files). As stated, it prevents any overwriting, even if Xthe target file is older than the source. This version adds more Xgranularity of options to solve this problem by introducing the X.BI "\-o invalid=" option X\- specifically the UTF-8 action. (Note that an Xexisting file that is named with a UTF-8 encoding is still subject Xto overwriting in this case. The X.B \-k Xoption closes that loophole.) X.PP XSome of the file characteristics referenced in this volume of XIEEE Std 1003.1-2001 might not be supported by some archive Xformats. For example, neither the X.B tar Xnor X.B cpio Xformats contain the Xfile access time. For this reason, the X.B e Xspecification character Xhas been provided, intended to cause all file characteristics Xspecified in the archive to be retained. X.PP XIt is required that extracted directories, by default, have their Xaccess and modification times and permissions set to the values Xspecified in the archive. This has obvious problems in that the Xdirectories are almost certainly modified after being extracted Xand that directory permissions may not permit file creation. One Xpossible solution is to create directories with the mode specified Xin the archive, as modified by the X.I umask Xof the user, with Xsufficient permissions to allow file creation. After all files Xhave been extracted, X.B pax Xwould then reset the access and Xmodification times and permissions as necessary. X.PP XThe list-mode formatting description borrows heavily from the one Xdefined by the X.BR printf (1) Xutility. However, since there is no separate Xoperand list to get conversion arguments, the format was extended Xto allow specifying the name of the conversion argument as part of Xthe conversion specification. X.PP XThe X.B T Xconversion specifier allows time fields to be displayed in Xany of the date formats. Unlike the X.BR ls (1) Xutility, X.B pax Xdoes not Xadjust the format when the date is less than six months in the Xpast. This makes parsing the output more predictable. X.PP XThe X.B D Xconversion specifier handles the ability to display the Xmajor/minor or file size, as with X.BR ls (1), Xby using %-8(size)D. X.PP XThe X.B L Xconversion specifier handles the ls display for symbolic Xlinks. X.PP XConversion specifiers were added to generate existing known types Xused for X.BR ls (1). X X.SS "pax Interchange Format X.PP XThe new POSIX data interchange format was developed primarily to Xsatisfy international concerns that the X.B ustar Xand X.B cpio Xformats did Xnot provide for file, user, and group names encoded in characters Xoutside a subset of the ISO/IEC 646:1991 standard. The standard Xdevelopers realized that this new POSIX data interchange format Xshould be very extensible because there were other requirements Xthey foresaw in the near future: X.TP X.B \(bu XSupport international character encodings and locale Xinformation X.TP X.B \(bu XSupport security information (ACLs, and so on) X.TP X.B \(bu XSupport future file types, such as realtime or contiguous files X.TP X.B \(bu XInclude data areas for implementation use X.TP X.B \(bu XSupport systems with words larger than 32 bits and timers Xwith subsecond granularity X.PP XThe following were not goals for this format because these are Xbetter handled by separate utilities or are inappropriate for a Xportable format: X.TP X.B \(bu XEncryption X.TP X.B \(bu XCompression X.TP X.B \(bu XData translation between locales and codesets X.TP X.B \(bu Xinode storage X.PP XThe format chosen to support the goals is an extension of the X.B ustar Xformat. Of the two formats previously available, only the X.B ustar Xformat was selected for extensions because: X.TP X.B \(bu XIt was easier to extend in an upwards-compatible way. It Xoffered version flags and header block type fields with room Xfor future standardization. The X.B cpio Xformat, while possessing Xa more flexible file naming methodology, could not be Xextended without breaking some theoretical implementation or Xusing a dummy filename that could be a legitimate filename. X.TP X.B \(bu XIndustry experience since the original "\fBtar\fP\ wars" Xfought in Xdeveloping the ISO POSIX-1 standard has clearly been in favor Xof the X.B ustar Xformat, which is generally the default output Xformat selected for X.B pax Ximplementations on new systems. X.PP XThe new format was designed with one additional goal in mind: Xreasonable behavior when an older X.B tar Xor X.B pax Xutility happened to Xread an archive. Since the POSIX.1-1990 standard mandated that a X"format-reading utility" had to treat unrecognized X.I typeflag Xvalues Xas regular files, this allowed the format to include all the Xextended information in a pseudo-regular file that preceded each Xreal file. An option is given that allows the archive creator to Xset up reasonable names for these files on the older systems. XAlso, the normative text suggests that reasonable file access Xvalues be used for this X.B ustar Xheader block. Making these header Xfiles inaccessible for convenient reading and deleting would not Xbe reasonable. File permissions of 600 or 700 are suggested. X.PP XThe ustar X.I typeflag Xfield was used to accommodate the additional Xfunctionality of the new format rather than X.I magic Xor X.I version Xbecause the POSIX.1-1990 standard (and, by reference, the previous Xversion of X.BR pax ), Xmandated the behavior of the format-reading Xutility when it encountered an unknown X.IR typeflag , Xbut was silent about the other two fields. X.PP XEarly proposals of the first revision to IEEE Std 1003.1-2001 Xcontained a proposed archive format that was based on Xcompatibility with the standard for tape files (ISO 1001, similar Xto the format used historically on many mainframes and Xminicomputers). This format was overly complex and required Xconsiderable overhead in volume and header records. Furthermore, Xthe standard developers felt that it would not be acceptable to Xthe community of POSIX developers, so it was later changed to be a Xformat more closely related to historical practice on POSIX Xsystems. X.PP XThe X.I prefix Xand X.I name Xsplit of pathnames in X.B ustar Xwas replaced by Xthe single path extended header record for simplicity. X.PP XThe concept of a global extended header X.RB "(typeflag" " g" ) Xwas Xcontroversial. If this were applied to an archive being recorded Xon magnetic tape, a few unreadable blocks at the beginning of the Xtape could be a serious problem; a utility attempting to extract Xas many files as possible from a damaged archive could lose a Xlarge percentage of file header information in this case. However, Xif the archive were on a reliable medium, such as a CD-ROM, the Xglobal extended header offers considerable potential size Xreductions by eliminating redundant information. Thus, the text Xwarns against using the global method for unreliable media and Xprovides a method for implanting global information in the Xextended header for each file, rather than in the X.IB typeflag " g Xrecords. X.PP XNo facility for data translation or filtering on a per-file basis Xis included because the standard developers could not invent an Xinterface that would allow this in an efficient manner. If a Xfilter, such as encryption or compression, is to be applied to all Xthe files, it is more efficient to apply the filter to the entire Xarchive as a single file. The standard developers considered Xinterfaces that would invoke a shell script for each file going Xinto or out of the archive, but the system overhead in this Xapproach was considered to be too high. X.PP XOne such approach would be to have X.B filter= Xrecords that give a Xpathname for an executable. When the program is invoked, the file Xand archive would be open for standard input/output and all the Xheader fields would be available as environment variables or Xcommand-line arguments. The standard developers did discuss such Xschemes, but they were omitted from IEEE Std 1003.1-2001 due to Xconcerns about excessive overhead. Also, the program itself would Xneed to be in the archive if it were to be used portably. X.PP XThere is currently no portable means of identifying the character Xset(s) used for a file in the file system. Therefore, X.B pax Xhas not Xbeen given a mechanism to generate charset records automatically. XThe only portable means of doing this is for the user to write the Xarchive using the X.IR "\-o charset=" string Xcommand line option. This Xassumes that all of the files in the archive use the same Xencoding. The "implementation-defined" text is included to allow Xfor a system that can identify the encodings used for each of its Xfiles. X.PP XThe table of standards that accompanies the charset record Xdescription is acknowledged to be very limited. Only a limited Xnumber of character set standards is reasonable for maximal Xinterchange. Any character set is, of course, possible by prior Xagreement. It was suggested that EBCDIC be listed, but it was Xomitted because it is not defined by a formal standard. Formal Xstandards, and then only those with reasonably large followings, Xcan be included here, simply as a matter of practicality. The X.IR s Xrepresent names of officially registered character sets Xin the format required by the ISO 2375:1985 standard. X.PP XThe normal comma or -separated list rules are not followed Xin the case of keyword options to allow ease of argument parsing Xfor X.BR getopts . X.PP XFurther information on character encodings is in X.B pax XArchive X.BR "Character Set Encoding/Decoding" . X.PP XThe standard developers have reserved keyword name space for Xvendor extensions. It is suggested that the format to be used is: X.PP X.BI " VENDOR." keyword X.PP Xwhere X.B VENDOR Xis the name of the vendor or organization in all Xuppercase letters. It is further suggested that the keyword Xfollowing the period be named differently than any of the standard Xkeywords so that it could be used for future standardization, if Xappropriate, by omitting the X.B VENDOR Xprefix. X.PP XThe X.RI < length > Xfield in the extended header record was included to Xmake it simpler to step through the records, even if a record Xcontains an unknown format (to a particular X.BR pax ) Xwith complex Xinteractions of special characters. It also provides a minor Xintegrity checkpoint within the records to aid a program Xattempting to recover files from a damaged archive. X.PP XThere are no extended header versions of the X.I devmajor Xand X.I devminor Xfields because the unspecified format X.B ustar Xheader field should be Xsufficient. If they are not, vendor-specific extended keywords X(such as X.BR VENDOR.devmajor ) Xshould be used. X.PP XDevice and i-number labeling of files was not adopted from X.BR cpio ; Xfiles are interchanged strictly on a symbolic name basis, as in X.BR ustar . X.PP XJust as with the X.B ustar Xformat descriptions, the new format makes Xno special arrangements for multi-volume archives. Each of the X.B pax Xarchive types is assumed to be inside a single POSIX file and Xsplitting that file over multiple volumes (diskettes, tape Xcartridges, and so on), processing their labels, and mounting each Xin the proper sequence are considered to be implementation details Xthat cannot be described portably. X.PP XThe X.B pax Xformat is intended for interchange, not only for backup on Xa single (family of) systems. It is not as densely packed as might Xbe possible for backup: X.TP X.B \(bu XIt contains information as coded characters that could be Xcoded in binary. X.TP X.B \(bu XIt identifies extended records with name fields that could be Xomitted in favor of a fixed-field layout. X.TP X.B \(bu XIt translates names into a portable character set and Xidentifies locale-related information, both of which are Xprobably unnecessary for backup. X.PP XThe requirements on restoring from an archive are slightly Xdifferent from the historical wording, allowing for non-monolithic Xprivilege to bring forward as much as possible. In particular, Xattributes such as "high performance file" might be broadly but Xnot universally granted while set-user-ID or X.BR chown (2) Xmight be much Xmore restricted. There is no implication in IEEE Std 1003.1-2001 Xthat the security information be honored after it is restored to Xthe file hierarchy, in spite of what might be improperly inferred Xby the silence on that topic. That is a topic for another Xstandard. X.PP XLinks are recorded in the fashion described here because a link Xcan be to any file type. It is desirable in general to be able to Xrestore part of an archive selectively and restore all of those Xfiles completely. If the data is not associated with each link, it Xis not possible to do this. However, the data associated with a Xfile can be large, and when selective restoration is not needed, Xthis can be a significant burden. The archive is structured so Xthat files that have no associated data can always be restored by Xthe name of any link name of any link, and the user may choose Xwhether data is recorded with each instance of a file that Xcontains data. The format permits mixing of both types of links in Xa single archive; this can be done for special needs, and X.B pax Xis Xexpected to interpret such archives on input properly, despite the Xfact that there is no X.B pax Xoption that would force this mixed case Xon output. (When X.BI \-o " linkdata Xis used, the output must contain the Xduplicate data, but the implementation is free to include it or Xomit it when X.BI \-o " linkdata Xis not used.) X.PP XThe time values are included as extended header records for those Ximplementations needing more than the eleven octal digits allowed Xby the X.B ustar Xformat. Portable file timestamps cannot be negative. XIf X.B pax Xencounters a file with a negative timestamp in X.B copy Xor X.B write Xmode, it can reject the file, substitute a non-negative Xtimestamp, or generate a non-portable timestamp with a leading X\&'\-'. Even though some implementations can support finer file-time Xgranularities than seconds, the normative text requires support Xonly for seconds since the Epoch because the ISO POSIX-1 standard Xstates them that way. The X.B ustar Xformat includes only X.IR mtime ; Xthe Xnew format adds X.I atime Xand X.I ctime Xfor symmetry. The atime access Xtime restored to the file system will be affected by the X.BI \-p " a Xand X.BI \-p " e Xoptions. The X.I ctime Xcreation time (actually X.I inode Xmodification Xtime) is described with "appropriate privilege" so that it can be Xignored when writing to the file system. POSIX does not provide a Xportable means to change file creation time. Nothing is intended Xto prevent a non-portable implementation of X.B pax Xfrom restoring the Xvalue. X.PP XThe X.IR gid , X.IR size , Xand X.I uid Xextended header records were included to Xallow expansion beyond the sizes specified in the regular X.B tar Xheader. New file system architectures are emerging that will Xexhaust the 12-digit size field. There are probably not many Xsystems requiring more than 8 digits for user and group IDs, but Xthe extended header values were included for completeness, Xallowing overrides for all of the decimal values in the X.B tar Xheader. X.PP XThe standard developers intended to describe the effective results Xof X.B pax Xwith regard to file ownerships and permissions; Ximplementations are not restricted in timing or sequencing the Xrestoration of such, provided the results are as specified. X.PP XMuch of the text describing the extended headers refers to use in X"\fBwrite\fP or \fBcopy\fP modes". The X.B copy Xmode references are due to the Xnormative text: "The effect of the copy shall be as if the copied Xfiles were written to an archive file and then subsequently Xextracted ...". There is certainly no way to test whether X.B pax Xis Xactually generating the extended headers in X.B copy Xmode, but the Xeffects must be as if it had. X X.SS "pax Archive Character Set Encoding/Decoding X.PP XThere is a need to exchange archives of files between systems of Xdifferent native codesets. Filenames, group names, and user names Xmust be preserved to the fullest extent possible when an archive Xis read on the receiving platform. Translation of the contents of Xfiles is not within the scope of the X.B pax Xutility. X.PP XThere will also be the need to represent characters that are not Xavailable on the receiving platform. These unsupported characters Xcannot be automatically folded to the local set of characters due Xto the chance of collisions. This could result in overwriting Xprevious extracted files from the archive or pre-existing files on Xthe system. X.PP XFor these reasons, the codeset used to represent characters within Xthe extended header records of the X.B pax Xarchive must be Xsufficiently rich to handle all commonly used character sets. The Xfields requiring translation include, at a minimum, filenames, Xuser names, group names, and link pathnames. Implementations may Xwish to have localized extended keywords that use non-portable Xcharacters. X.PP XThe standard developers considered the following options: X.TP X.B \(bu XThe archive creator specifies the well-defined name of the Xsource codeset. The receiver must then recognize the codeset Xname and perform the appropriate translations to the Xdestination codeset. X.TP X.B \(bu XThe archive creator includes within the archive the character Xmapping table for the source codeset used to encode extended Xheader records. The receiver must then read the character Xmapping table and perform the appropriate translations to the Xdestination codeset. X.TP X.B \(bu XThe archive creator translates the extended header records in Xthe source codeset into a canonical form. The receiver must Xthen perform the appropriate translations to the destination Xcodeset. X.PP XThe approach that incorporates the name of the source codeset Xposes the problem of codeset name registration, and makes the Xarchive useless to X.B pax Xarchive decoders that do not recognize that Xcodeset. X.PP XBecause parts of an archive may be corrupted, the standard Xdevelopers felt that including the character map of the source Xcodeset was too fragile. The loss of this one key component could Xresult in making the entire archive useless. (The difference Xbetween this and the global extended header decision was that the Xlatter has a workaround-duplicating extended header records on Xunreliable media-but this would be too burdensome for large Xcharacter set maps.) X.PP XBoth of the above approaches also put an undue burden on the X.B pax Xarchive receiver to handle the cross-product of all source and Xdestination codesets. X.PP XTo simplify the translation from the source codeset to the Xcanonical form and from the canonical form to the destination Xcodeset, the standard developers decided that the internal Xrepresentation should be a stateless encoding. A stateless Xencoding is one where each codepoint has the same meaning, without Xregard to the decoder being in a specific state. An example of a Xstateful encoding would be the Japanese Shift-JIS; an example of a Xstateless encoding would be the ISO/IEC 646:1991 standard X(equivalent to 7-bit ASCII). X.PP XFor these reasons, the standard developers decided to adopt a Xcanonical format for the representation of file information Xstrings. The obvious, well-endorsed candidate is the XISO/IEC 10646-1:2000 standard (based in part on Unicode), which Xcan be used to represent the characters of virtually all Xstandardized character sets. The standard developers initially Xagreed upon using UCS2 (16-bit Unicode) as the internal Xrepresentation. This repertoire of characters provides a Xsufficiently rich set to represent all commonly-used codesets. X.PP XHowever, the standard developers found that the 16-bit Unicode Xrepresentation had some problems. It forced the issue of Xstandardizing byte ordering. The 2-byte length of each character Xmade the extended header records twice as long for the case of Xstrings coded entirely from historical 7-bit ASCII. For these Xreasons, the standard developers chose the UTF-8 defined in the XISO/IEC 10646-1:2000 standard. This multi-byte representation Xencodes UCS2 or UCS4 characters reliably and deterministically, Xeliminating the need for a canonical byte ordering. In addition, XNUL octets and other characters possibly confusing to POSIX file Xsystems do not appear, except to represent themselves. It was Xrealized that certain national codesets take up more space after Xthe encoding, due to their placement within the UCS range; it was Xfelt that the usefulness of the encoding of the names outweighs Xthe disadvantage of size increase for file, user, and group names. X.PP X.sp X.ne 10 XThe encoding of UTF-8 is as follows: X.PP X.TS Xlb lb Xl l. XUCS4 Hex Encoding UTF-8 Binary Encoding X00000000-0000007F 0xxxxxxx X00000080-000007FF 110xxxxx 10xxxxxx X00000800-0000FFFF 1110xxxx 10xxxxxx 10xxxxxx X00010000-001FFFFF 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx X00200000-03FFFFFF 111110xx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx X04000000-7FFFFFFF 1111110x 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx 10xxxxxx X.TE X.PP Xwhere each '\fIx\fP' represents a bit value from the character being Xtranslated. X X.SS "ustar Interchange Format X.PP XThe description of the X.B ustar Xformat reflects numerous enhancements Xover pre-1988 versions of the historical X.B tar Xutility. The goal of Xthese changes was not only to provide the functional enhancements Xdesired, but also to retain compatibility between new and old Xversions. This compatibility has been retained. Archives written Xusing the old archive format are compatible with the new format. X.PP XImplementors should be aware that the previous file format did not Xinclude a mechanism to archive directory type files. For this Xreason, the convention of using a filename ending with slash was Xadopted to specify a directory on the archive. X.PP XThe total size of the X.I name Xand X.I prefix Xfields have been set to meet Xthe minimum requirements for X.IR {PATH_MAX} XIf a pathname will fit Xwithin the X.I name Xfield, it is recommended that the pathname be Xstored there without the use of the X.I prefix Xfield. Although the Xname field is known to be too small to contain X.I {PATH_MAX} Xcharacters, the value was not changed in this version of the Xarchive file format to retain backwards-compatibility, and instead Xthe X.I prefix Xwas introduced. Also, because of the earlier version of Xthe format, there is no way to remove the restriction on the X.I linkname Xfield being limited in size to just that of the X.I name Xfield. X.PP XThe X.I size Xfield is required to be meaningful in all implementation Xextensions, although it could be zero. This is required so that Xthe data blocks can always be properly counted. X.PP XIt is suggested that if device special files need to be Xrepresented that cannot be represented in the standard format, Xthat one of the extension types X.RB ( A \- Z ) Xbe used, and that the Xadditional information for the special file be represented as data Xand be reflected in the X.I size Xfield. X.PP XAttempting to restore a special file type, where it is converted Xto ordinary data and conflicts with an existing filename, need not Xbe specially detected by the utility. If run as an ordinary user, X.B pax Xshould not be able to overwrite the entries in, for example, X.B /dev Xin any case (whether the file is converted to another type or Xnot). If run as a privileged user, it should be able to do so, and Xit would be considered a bug if it did not. The same is true of Xordinary data files and similarly named special files; it is Ximpossible to anticipate the needs of the user (who could really Xintend to overwrite the file), so the behavior should be Xpredictable (and thus regular) and rely on the protection system Xas required. X.PP XThe value X.B 7 Xin the X.I typeflag Xfield is intended to define how Xcontiguous files can be stored in a X.B ustar Xarchive. XIEEE Std 1003.1-2001 does not require the contiguous file Xextension, but does define a standard way of archiving such files Xso that all conforming systems can interpret these file types in a Xmeaningful and consistent manner. On a system that does not Xsupport extended file types, the X.B pax Xutility should do the best it Xcan with the file and go on to the next. X.PP XThe file protection modes are those conventionally used by the X.BR ls (1) Xutility. This is extended beyond the usage in the ISO POSIX-2 Xstandard to support the "shared text" or "sticky" bit. It is Xintended that the conformance document should not document Xanything beyond the existence of and support of such a mode. XFurther extensions are expected to these bits, particularly with Xoverloading the set-user-ID and set-group-ID flags. X X.SS "cpio Interchange Format X.PP XThe reference to appropriate privilege in the X.B cpio Xformat refers Xto an error on standard output; the X.B ustar Xformat does not make Xcomparable statements. X.PP XThe model for this format was the historical System V X.B "cpio \-c Xdata Xinterchange format. This model documents the portable version of Xthe X.B cpio Xformat and not the binary version. It has the flexibility Xto transfer data of any type described within XIEEE Std 1003.1-2001, yet is extensible to transfer data types Xspecific to extensions beyond IEEE Std 1003.1-2001 (for example, Xcontiguous files). Because it describes existing practice, there Xis no question of maintaining upwards-compatibility. X X.SS "cpio Header X.PP XThere has been some concern that the size of the X.I c_ino Xfield of Xthe header is too small to handle those systems that have very Xlarge inode numbers. However, the X.I c_ino Xfield in the header is Xused strictly as a hard-link resolution mechanism for archives. It Xis not necessarily the same value as the inode number of the file Xin the location from which that file is extracted. X.PP XThe name X.I c_magic Xis based on historical usage. X X.SS "cpio Filename X.PP XFor most historical implementations of the X.B cpio Xutility, X.I {PATH_MAX} Xoctets can be used to describe the pathname without the Xaddition of any other header fields (the NUL character would be Xincluded in this count). X.I {PATH_MAX} Xis the minimum value for Xpathname size, documented as 256 bytes. However, an implementation Xmay use X.I c_namesize Xto determine the exact length of the pathname. XWith the current description of the X.B Xheader, this pathname Xsize can be as large as a number that is described in six octal Xdigits. X.PP XTwo values are documented under the X.I c_mode Xfield values to provide Xfor extensibility for known file types: X.TP X.B "0110 000 XReserved for contiguous files. The implementation may treat Xthe rest of the information for this archive like a regular Xfile. If this file type is undefined, the implementation may Xcreate the file as a regular file. X.PP XThis provides for extensibility of the X.B cpio Xformat while allowing Xfor the ability to read old archives. Files of an unknown type may Xbe read as "regular files" on some implementations. On a system Xthat does not support extended file types, the X.B pax Xutility should Xdo the best it can with the file and go on to the next. X X.SH "FUTURE DIRECTIONS X.PP XNone. X X.ne 5 X.PP X.HD "End of informative sections." X.RU X X.SH "SEE ALSO X.PP XShell Command Language, X.BR cp (1), X.BR ed (1), X.BR getopts (1), X.BR ls (1), X.BR printf (3), Xthe Base XDefinitions volume of IEEE Std 1003.1-2001, X.BR , Xthe System XInterfaces volume of IEEE Std 1003.1-2001, X.BR chown (2), X.BR creat (2), X.BR mkdir (2), X.BR mkfifo (2), X.BR stat (2), X.BR utime (2), X.BR write (2). X X.SH "CHANGE HISTORY X.PP XFirst released in Issue 4. X X.SS "Issue 5 X.PP XA note is added to the APPLICATION USAGE indicating that the X.B cpio Xand X.B tar Xformats can only support files up to 8 gigabytes in size. X X.SS "Issue 6 X.PP XThe X.B pax Xutility is aligned with the IEEE P1003.2b draft standard: X.TP X.B \(bu XSupport has been added for symbolic links in the options and Xinterchange formats. X.TP X.B \(bu XA new format has been devised, based on extensions to X.BR ustar . X.TP X.B \(bu XReferences to the "extended" X.B tar Xand X.B cpio Xformats derived Xfrom the POSIX.1-1990 standard have been changed to remove Xthe "extended" adjective because this could cause confusion Xwith the extended X.B tar Xheader added in this revision. (All Xreferences to tar are actually to X.BR ustar .) X.PP XThe X.B TZ Xentry is added to the ENVIRONMENT VARIABLES section. X.PP XIEEE PASC Interpretation 1003.2 #168 is applied, clarifying that X.BR mkdir (2) Xand X.BR mkfifo (2) Xcalls can ignore an [EEXIST] error when Xextracting an archive. X.PP XIEEE PASC Interpretation 1003.2 #180 is applied, clarifying how Xextracted files are created when in X.B read Xmode. X.PP XIEEE PASC Interpretation 1003.2 #181 is applied, clarifying the Xdescription of the X.B \-t Xoption. X.PP XIEEE PASC Interpretation 1003.2 #195 is applied. X.PP XIEEE PASC Interpretation 1003.2 #206 is applied, clarifying the Xhandling of links for the X.BR \-H , X.BR \-L , Xand X.B \-l Xoptions. X.PP XIEEE Std 1003.1-2001/Cor 1-2002, item XCU/TC1/D6/35 is applied, Xadding the process ID of the X.B pax Xprocess into certain fields. This Xchange provides a method for the implementation to ensure that Xdifferent instances of X.B pax Xextracting a file named X.B /a/b/foo Xwill Xnot collide when processing the extended header information Xassociated with X.BR foo . X.PP XIEEE Std 1003.1-2001/Cor 1-2002, item XCU/TC1/D6/36 is applied, Xchanging X.B "\-x B Xto X.B "\-x pax Xin the OPTIONS section. X.PP XIEEE Std 1003.1-2001/Cor 2-2004, item XCU/TC2/D6/20 is applied, Xupdating the SYNOPSIS to be consistent with the normative text. X.PP XIEEE Std 1003.1-2001/Cor 2-2004, item XCU/TC2/D6/21 is applied, Xupdating the DESCRIPTION to describe the behavior when files to be Xlinked are symbolic links and the system is not capable of making Xhard links to symbolic links. X.PP XIEEE Std 1003.1-2001/Cor 2-2004, item XCU/TC2/D6/22 is applied, Xupdating the OPTIONS section to describe the behavior for how Xmultiple X.BI \"-o delete=" pattern Xoptions are to be handled. X.PP XIEEE Std 1003.1-2001/Cor 2-2004, item XCU/TC2/D6/23 is applied, Xupdating the X.B write Xoption within the OPTIONS section. X.PP XIEEE Std 1003.1-2001/Cor 2-2004, item XCU/TC2/D6/24 is applied, Xadding a paragraph into the OPTIONS section that states that Xspecifying more than one of the mutually-exclusive options X.RB ( \-H Xand X.BR \-L ) Xis not considered an error and that the last option Xspecified will determine the behavior of the utility. X.PP XIEEE Std 1003.1-2001/Cor 2-2004, item XCU/TC2/D6/25 is applied, Xremoving the X.I ctime Xparagraph within the EXTENDED DESCRIPTION. XThere is a contradiction in the definition of the X.I ctime Xkeyword Xfor the X.B pax Xextended header, in that the X.I st_ctime Xmember of the X.B stat Xstructure does not refer to a file creation time. No field in Xthe standard stat structure from X.B Xincludes a file Xcreation time. X.PP XIEEE Std 1003.1-2001/Cor 2-2004, item XCU/TC2/D6/26 is applied, Xmaking it clear that X.I typeflag X.B 1 XRB ( ustar XInterchange Format) Xapplies not only to files that are hard-linked, but also to files Xthat are aliased via symlinks. X.PP XIEEE Std 1003.1-2001/Cor 2-2004, item XCU/TC2/D6/27 is applied, Xclarifying the X.B cpio X.I c_nlink Xfield. X.PP XEnd of quoted text from the POSIX.1-2001 standard. X. \" .SH RETURNS X. \" .SH ERRORS X.SH "OTHER OPTIONS XThe following X.I "other options Xare implemented as extension to the POSIX standard. XNote that some other Xnon-POSIX options are mentioned in X.I \-help Xand X.I \-xhelp Xoutput - these are also supported in X.BR spax (1) Xand are described in the X.BR star (1) Xmanual page. X.TP X.B \-help XPrints a summary of the most important options for X.BR spax (1) Xand exits. X.TP X.B \-do\-statistics XPrint statistic messages at the end of a X.BR spax (1) Xrun. X.TP X.B \-xhelp XPrints a summary of the less important options for X.BR spax (1) Xand exits. X.TP X.B \-version XPrints the X.B spax Xversion number string and exists. X X.SH EXAMPLES X.SH ENVIRONMENT X.SH FILES X.SH "SEE ALSO" X.SH DIAGNOSTICS X.SH NOTES X.PP XThe Institute of Electrical and Electronics Engineers and The Open Group, Xhave given us permission to reprint portions of their documentation. In Xthe following statement, the phrase ``this text'' refers to portions of Xthe system documentation. X.PP XPortions of this text are reprinted and reproduced in electronic form Xin the X.B sfind Xmanual, Xfrom IEEE Std 1003.1, 2004 Edition, Standard for XInformation Technology -- Portable Operating System Interface (POSIX), XThe Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by Xthe Institute of Electrical and Electronics Engineers, Inc and The Open XGroup. In the event of any discrepancy between these versions and the Xoriginal IEEE and The Open Group Standard, the original IEEE and The XOpen Group Standard is the referee document. The original Standard can Xbe obtained online at X.BR "http://www.opengroup.org/unix/online.html" . X.SH BUGS X.SH AUTHOR X.nf XJ\*org Schilling XSeestr. 110 XD\-13353 Berlin XGermany X.fi X.PP XMail bugs and suggestions to: X.PP X.B Xjoerg.schilling@fokus.fraunhofer.de Xor X.B Xjoerg@schily.net END-of-star-1.6/star/spax.1 echo x - star-1.6/star/spaxman.mk sed 's/^X//' >star-1.6/star/spaxman.mk << 'END-of-star-1.6/star/spaxman.mk' X#ident @(#)spaxman.mk 1.1 04/09/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= spax XMANSECT= $(MANSECT_CMD) XMANSUFFIX= $(MANSUFF_CMD) XMANFILE= spax.1 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/star/spaxman.mk echo x - star-1.6/star/ustar.1 sed 's/^X//' >star-1.6/star/ustar.1 << 'END-of-star-1.6/star/ustar.1' X.so man1/star.1 X.\" "@(#)ustar.1 1.1 10/05/13 " END-of-star-1.6/star/ustar.1 echo x - star-1.6/star/star.4 sed 's/^X//' >star-1.6/star/star.4 << 'END-of-star-1.6/star/star.4' X'\" t X. \" @(#)star.4 1.39 19/03/19 Copyr 2003-2018 J. Schilling X. \" star archive formats X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH STAR 4L "2019/03/19" "J\*org Schilling" "Schily\'s USER COMMANDS" X.SH NAME Xstar \- tape archive file format X.SH DESCRIPTION X.PP X.B Tar XArchives are layered archives. XThe basic structure is defined by the POSIX.1-1988 archive format and Xdocumented in the X.B "BASIC TAR HEADER DESCRIPTION Xsection below. XThe higher level structure is defined by the POSIX.1-2001 extended headers Xand documented in the X.B "EXTENDED TAR (PAX) HEADER STRUCTURE" Xsection below. XPOSIX.1-2001 extended headers are pseudo files that contain an unlimited number Xof extended header keywords and associated values. The header keywords are Xdocumented in the X.B "EXTENDED TAR (PAX) HEADER KEYWORDS Xsection below. X.SH "BASIC TAR STRUCTURE X.PP XA X.B tar Xarchive consists of a series of 512 byte X.RB ( TBLOCK ) Xrecords that are grouped to blocks Xof typically 20 records (10240 bytes). X.LP XA number of TBLOCK sizes records are grouped together to a tape block for physical I/O Xoperations. Each block of X.I n Xrecords is written with a single X.BR write (2) Xoperation. XOn magnetic tapes, this results in a single X.B tape record Xin case the tape drive is in X.BR "variable length record mode" . X.LP XThe block structure is only visible on blocked tapes. XA larger block size results in higher throughput. XTapes that use a block size larger than X.B 63 kB Xhowever may not be readable with any hardware and need to be avoided if Xread compatibility is important. XOlder tar implementations do not support block sizes larger than 10240 bytes. X.LP XFor fast backups, it is recommended to use block sizes of at least X.B 256\ kB Xand to verify throughput and readability on available hardware. X.LP XNote that the terms X.B block Xand X.B record Xare frequently used inconsistently (starting in the historical documentation Xfrom 1979 already) and that the term X.B block Xis typically used for 512 bytes if the tape block size if not relevant in a Xspecific context. X X.SH "BASIC TAR HEADER DESCRIPTION X.PP XPhysically, a POSIX.1-1988 X.B tar Xarchive consists of a series of fixed sized blocks of TBLOCK (512) characters. XIt contains a series of file entries terminated by a logical Xend\-of\-archive marker, which consists of two blocks of 512 bytes of binary zeroes. XEach file entry is represented by a header block that describes the file followed by Xzero or more blocks with the content of the file. The length of each file is rounded up Xto a multiple of 512 bytes. X.PP XThe header block is defined in star.h as follows: X.nf X/* X * POSIX.1-1988 field size values and magic. X */ X#define TBLOCK 512 X#define NAMSIZ 100 X#define PFXSIZ 155 X X#define TMODLEN 8 X#define TUIDLEN 8 X#define TGIDLEN 8 X#define TSIZLEN 12 X#define TMTMLEN 12 X#define TCKSLEN 8 X X#define TMAGIC "ustar" /* ustar magic 6 chars + '\e0' */ X#define TMAGLEN 6 /* "ustar" including '\e0' */ X#define TVERSION "00" X#define TVERSLEN 2 X#define TUNMLEN 32 X#define TGNMLEN 32 X#define TDEVLEN 8 X X/* X * POSIX.1-1988 typeflag values X */ X#define REGTYPE '0' /* Regular File */ X#define AREGTYPE '\e0' /* Regular File (outdated) */ X#define LNKTYPE '1' /* Hard Link */ X#define SYMTYPE '2' /* Symbolic Link */ X#define CHRTYPE '3' /* Character Special */ X#define BLKTYPE '4' /* Block Special */ X#define DIRTYPE '5' /* Directory */ X#define FIFOTYPE '6' /* FIFO (named pipe) */ X#define CONTTYPE '7' /* Contiguous File */ X X/* X * POSIX.1-2001 typeflag extensions. X * POSIX.1-2001 calls the extended USTAR format PAX although it is X * definitely derived from and based on USTAR. The reason may be that X * POSIX.1-2001 calls the tar program outdated and lists the X * pax program as the successor. X */ X#define LF_GHDR 'g' /* POSIX.1-2001 global extended header */ X#define LF_XHDR 'x' /* POSIX.1-2001 extended header */ X.fi X.PP XSee section X.B "EXTENDED TAR (PAX) HEADER KEYWORDS Xfor more information about the structure of a POSIX.1-2001 header. X.PP X.nf X/* X * star/gnu/Sun tar extensions: X * X * Note that the standards committee allows only capital A through X * capital Z for user-defined expansion. This means that defining X * something as, say '8' is a *bad* idea. X */ X X#define LF_ACL 'A' /* Solaris Access Control List */ X#define LF_DUMPDIR 'D' /* GNU dump dir */ X#define LF_EXTATTR 'E' /* Solaris Extended Attribute File */ X#define LF_META 'I' /* Inode (metadata only) no file content */ X#define LF_LONGLINK 'K' /* NEXT file has a long linkname */ X#define LF_LONGNAME 'L' /* NEXT file has a long name */ X#define LF_MULTIVOL 'M' /* Continuation file rest to be skipped */ X#define LF_NAMES 'N' /* OLD GNU for names > 100 characters */ X#define LF_SPARSE 'S' /* This is for sparse files */ X#define LF_VOLHDR 'V' /* tape/volume header Ignore on extraction */ X#define LF_VU_XHDR 'X' /* POSIX.1-2001 xtended (Sun VU version) */ X X/* X * Definitions for the t_mode field X */ X#define TSUID 04000 /* Set UID on execution */ X#define TSGID 02000 /* Set GID on execution */ X#define TSVTX 01000 /* On directories, restricted deletion flag */ X#define TUREAD 00400 /* Read by owner */ X#define TUWRITE 00200 /* Write by owner special */ X#define TUEXEC 00100 /* Execute/search by owner */ X#define TGREAD 00040 /* Read by group */ X#define TGWRITE 00020 /* Write by group */ X#define TGEXEC 00010 /* Execute/search by group */ X#define TOREAD 00004 /* Read by other */ X#define TOWRITE 00002 /* Write by other */ X#define TOEXEC 00001 /* Execute/search by other */ X X#define TALLMODES 07777 /* The low 12 bits */ X X/* X * This is the ustar (Posix 1003.1) header. X */ Xstruct header { X char t_name[NAMSIZ]; /* 0 Filename */ X char t_mode[8]; /* 100 Permissions */ X char t_uid[8]; /* 108 Numerical User ID */ X char t_gid[8]; /* 116 Numerical Group ID */ X char t_size[12]; /* 124 Filesize */ X char t_mtime[12]; /* 136 st_mtime */ X char t_chksum[8]; /* 148 Checksum */ X char t_typeflag; /* 156 Typ of File */ X char t_linkname[NAMSIZ]; /* 157 Target of Links */ X char t_magic[TMAGLEN]; /* 257 "ustar" */ X char t_version[TVERSLEN]; /* 263 Version fixed to 00 */ X char t_uname[TUNMLEN]; /* 265 User Name */ X char t_gname[TGNMLEN]; /* 297 Group Name */ X char t_devmajor[8]; /* 329 Major for devices */ X char t_devminor[8]; /* 337 Minor for devices */ X char t_prefix[PFXSIZ]; /* 345 Prefix for t_name */ X /* 500 End */ X char t_mfill[12]; /* 500 Filler up to 512 */ X}; X X/* X * star header specific definitions X */ X#define STMAGIC "tar" /* star magic */ X#define STMAGLEN 4 /* "tar" including '\e0' */ X X/* X * This is the new (post Posix 1003.1-1988) xstar header X * defined in 1994. X * X * t_prefix[130] is guaranteed to be '\0' to prevent ustar X * compliant implementations from failing. X * t_mfill & t_xmagic need to be zero for a 100% ustar compliant X * implementation, so setting t_xmagic to X * "tar" should be avoided in the future. X * X * A different method to recognize this format is to verify that X * t_prefix[130] is equal to '\0' and X * t_atime[0]/t_ctime[0] is an octal number and X * t_atime[11] is equal to ' ' and X * t_ctime[11] is equal to ' '. X * X * Note that t_atime[11]/t_ctime[11] may be changed in future. X */ Xstruct xstar_header { X char t_name[NAMSIZ]; /* 0 Filename */ X char t_mode[8]; /* 100 Permissions */ X char t_uid[8]; /* 108 Numerical User ID */ X char t_gid[8]; /* 116 Numerical Group ID */ X char t_size[12]; /* 124 Filesize */ X char t_mtime[12]; /* 136 st_mtime */ X char t_chksum[8]; /* 148 Checksum */ X char t_typeflag; /* 156 Typ of File */ X char t_linkname[NAMSIZ]; /* 157 Target of Links */ X char t_magic[TMAGLEN]; /* 257 "ustar" */ X char t_version[TVERSLEN]; /* 263 Version fixed to 00 */ X char t_uname[TUNMLEN]; /* 265 User Name */ X char t_gname[TGNMLEN]; /* 297 Group Name */ X char t_devmajor[8]; /* 329 Major for devices */ X char t_devminor[8]; /* 337 Minor for devices */ X char t_prefix[131]; /* 345 Prefix for t_name */ X char t_atime[12]; /* 476 st_atime */ X char t_ctime[12]; /* 488 st_ctime */ X char t_mfill[8]; /* 500 Filler up to star magic */ X char t_xmagic[4]; /* 508 "tar" */ X}; X Xstruct sparse { X char t_offset[12]; X char t_numbytes[12]; X}; X X#define SPARSE_EXT_HDR 21 X Xstruct xstar_ext_header { X struct sparse t_sp[21]; X char t_isextended; X}; X Xtypedef union hblock { X char dummy[TBLOCK]; X long ldummy[TBLOCK/sizeof (long)]; /* force long alignment */ X struct header dbuf; X struct xstar_header xstar_dbuf; X struct xstar_ext_header xstar_ext_dbuf; X} TCB; X.fi X.PP XFor maximum portability, all fields that contain character strings should be Xlimited to use the low 7 bits of a character. X.PP XThe X.IR name , X.I linkname Xand X.I prefix Xfield contain character strings. The strings are null terminated Xexcept when they use the full space of 100 characters for the X.I name Xor X.I linkname Xfield or 155 characters Xfor the X.I prefix Xfield. X.PP XIf the X.I prefix Xdoes not start with a null character, then X.I prefix Xand X.I name Xneed to be concatenated by using the X.IR prefix , Xfollowed by a slash character followed by the X.I name Xfield. XIf a null character appears in X.I name Xor X.I prefix Xbefore the maximum size is reached, the field in question is terminated. XThis way file names up to 256 characters may be archived. XThe X.I prefix Xis not used together with the X.I linkname Xfield, so the maximum length of a link name is 100 characters. X.PP XThe fields X.IR magic , X.I uname Xand X.I gname Xcontain null terminated character strings. X.PP XThe version field contains the string \fB"00"\fP Xwithout a trailing zero. It cannot be set to different values as POSIX.1-1988 Xdid not specify a way to handle different version strings. X.PP XThe X.I typeflag Xfield contains a single character. X.PP XAll numeric fields contain X.I size-1 Xleading zero-filled numbers using octal digits. XThey are followed by one or more space or null characters. XAll recent implementations only use one space or null character at the end Xof a numerical field to get maximum space for the octal number. X.B Star Xalways uses a space character as terminator. XNumeric fields with 8 characters may hold up to 7 octal digits (7777777) Xwhich results is a maximum value of 2097151. XNumeric fields with 12 characters may hold up to 11 octal digits (77777777777) Xwhich results is a maximum value of 8589934591. X.PP X.B Star Ximplements a vendor specific (and thus non-POSIX) extension to put bigger numbers Xinto the numeric fields. This is done by using a X.B base 256 Xcoding. XThe top bit of the first character in the appropriate 8 character or X12 character field is set to flag non octal coding. XIf X.B base 256 Xcoding is in use, then all remaining characters are used to code Xthe number. This results in 7 X.B base 256 Xdigits in 8 character fields and in 11 X.B base 256 Xdigits in 12 character fields. XAll X.B base 256 Xnumbers are two's complement numbers. A X.B base 256 Xnumber in a X8 character field may hold 56 bits, a X.B base 256 Xnumber in a 12 character Xfield may hold 88 bits. X.sp XThis may be extended to 63 bits for 8 character fields Xand to 95 bits for 12 character fields. For a negative number, the first Xcharacter currently is set to a value of 255 (all 8 bits are set). XFor a positive number, the first character currently is set to 128 (the top Xbit is set and all other bits are cleared). X.sp XThe rightmost character in a 8 or 12 character field contains the least Xsignificant X.B base 256 Xnumber. X.sp XRecent GNU tar and BSD libarchive versions implement the same extension. X.PP XWhile the POSIX standard makes it obvious that the fields X.IR "mode" , " uid" , " gid" , X.IR " size", " chksum" , X.I devmajor Xand X.I devminor Xshould be treated as unsigned numbers, there is no such definition for the X.I time Xfield. X.PP XThe mode field contains 12 bits holding permissions, Xsee above for the definitions for each of the permission bits. X.PP XThe X.I uid Xand X.I gid Xfields contain the numerical user id and group id of the file. XThese fields may use a X.B base 256 Xencoding. X.PP XThe X.I size Xfield contains the size of the file in characters. XIf the X.I tar header Xis followed by file data, then the amount of data that follows is computed by X.IR "(size + 511) / 512" . XThis field may use a X.B base 256 Xencoding. X.PP XThe X.I mtime Xfield contains the number of seconds since Jan 1st 1970 00:00 UTC Xas retrieved via X.BR stat (2) Xin X.IR st_mtime . XIf the X.I mtime Xfield is assumed to be a signed 33 bit number, the latest representable time Xis 2106 Feb 7 06:28:15 GMT. This is because POSIX does not mention whether Xthe time has to be a signed or unsigned number and thus no more than 32 bits Xmay be used for a positive value if applications care about Xportability. XThis field may use a X.B base 256 Xencoding. X.PP XThe X.I chksum Xfield contains a simple checksum over all bytes of the header. XTo compute the value, all characters in the header are treated as Xunsigned integers and the characters in the X.I chksum Xfield are treated as if they were all spaces. When the computation starts, Xthe checksum value is initialized to 0. X.PP XThe X.I typeflag Xfield specifies the type of the file that is archived. If a specific X.B tar Ximplementation does not include support for a specific typeflag value, Xthis implementation will extract the unknown file types as if they were Xplain files. For this reason, the X.I size Xfield for any file type except directories, hard links, symbolic links, Xcharacter special, block specials and FIFOs Xmust always follow the rules for plain files. X.TP X.B '0' REGTYPE XA regular file. XIf the X.I size Xfield is non zero, then file data follows the header. X.TP X.B '\e0' AREGTYPE XFor backwards compatibility with pre POSIX.1-1988 X.B tar Ximplementations, a nul character is also recognized as marker for plain files. XIt is not generated by recent X.B tar Ximplementations. XIf the X.I size Xfield is non zero, then file data follows the header. X.TP X.B '1' LNKTYPE XThe file is a hard link to another file. XThe name of the file that the file is linked to is in the X.I linkname Xpart of the header. XFor X.B tar Xarchives written by pre POSIX.1-1988 implementations, the X.I size Xfield usually contains the size of the file and Xneeds to be ignored as no data may follow this header type. XFor POSIX.1-1988 compliant archives, the X.I size Xfield needs to be 0. XFor POSIX.1-2001 compliant archives, the X.I size Xfield may be non zero, indicating that file data is included in the archive. X.TP X.B '2' SYMTYPE XThe file is a symbolic link to another file. XThe name of the file that the file is linked to is in the X.I linkname Xpart of the header. XThe X.I size Xfield needs to be 0. XNo file data may follow the header. X.TP X.B '3' CHRTYPE XA character special file. XThe fields X.I devmajor Xand X.I devminor Xcontain information that defines the device id of the file. XThe meaning of the X.I size Xfield is unspecified by the POSIX standard. XNo file data may follow the header. X.TP X.B '4' BLKTYPE XA block special file. XThe fields X.I devmajor Xand X.I devminor Xcontain information that defines the device id of the file. XThe meaning of the X.I size Xfield is unspecified by the POSIX standard. XNo file data may follow the header. X.TP X.B '5' DIRTYPE XA directory or sub directory. Old (pre POSIX.1-1988) X.B tar Ximplementations did use the same X.I typeflag Xvalue as for plain files and added a slash to the end of the X.I name Xfield. XIf the X.I size Xfield is non zero then it indicates the maximum size in characters Xthe system may allocate for this directory. If the X.I size Xfield is 0, then Xthe system shall not limit the size of the directory. On operating systems Xwhere the disk allocation is not done on a directory base, the X.I size Xfield is ignored on extraction. XNo file data may follow the header. X.TP X.B '6' FIFOTYPE XA named pipe. XThe meaning of the size field is unspecified by the POSIX standard. XThe X.I size Xfield must be ignored on extraction. XNo file data may follow the header. X.TP X.B '7' CONTTYPE XA contiguous file. XThis is a file that gives special performance attributes. XOperating systems that don't support this file type extract this file type Xas plain files. XIf the X.I size Xfield is non zero, then file data follows the header. X.TP X.B 'g' GLOBAL POSIX.1-2001 HEADER XWith POSIX.1-2001 pax archives, this type defines a global extended header. XThe X.I size Xis always non zero and denotes the sum of the length fields in the extended Xheader data. XThe data that follows the header is in the X.B pax extended header Xformat. XThe extended header records in this header type affect all Xfollowing files in the archive unless they are overwritten by new values. XSee X.B "EXTENDED TAR (PAX) HEADER FORMAT Xsection below. X.TP X.B 'x' EXTENDED POSIX.1-2001 HEADER XWith POSIX.1-2001 pax archives, this type defines an extended header. XThe X.I size Xis always non zero and denotes the sum of the length fields in the extended Xheader data. XThe data that follows the header is in the X.B pax extended header Xformat. XThe extended header records in this header type only affect the Xfollowing file in the archive. XSee X.B "EXTENDED TAR (PAX) HEADER FORMAT Xsection below. X.TP X.B 'A' - 'Z' XReserved for vendor specific implementations. X.TP X.B 'A' XA Solaris ACL entry as used by the X.B tar Ximplementation from Sun. XThe X.I size Xis always non zero and denotes the length of the data that follows the header. X.B Star Xcurrently is not able to handle this header type. XAs the X.B ACL Xdata used by this format dos not include the numerical user and group id's, Xthis format is not recommended for archival. X.TP X.B 'D' XA GNU dump directory. XThis header type is not created by X.B star Xand handled like a POSIX tzpe '5' directory during an extract operation, Xso the data content is ignored by X.BR star . XThe X.I size Xfield denotes the length of the data that follows the header. X.TP X.B 'E' XA Solaris Extended Attribute File that is used to archive X.B NFSv4 Xtype extended attributes. XThe X.I size Xfield denotes the length of the data that follows the header. X.B Star Xcurrently is not able to handle this header type. X.TP X.B 'I' XA X.B inode metadata Xentry. XThis header type is used by X.B star Xto archive inode meta data only. XTo archive more inode meta data than possible with a POSIX-1.1988 X.B tar Xheader, a header with type X.B 'I' Xis usually preceded by a X.B 'x' Xheader. XIt is used with incremental backups. XThe X.I size Xfield holds the length of the file. XNo file data follows this header. X.TP X.B 'K' XA long link name. X.B Star Xis able to read and write this type of header with the X.BR star ", " xstar " and " gnutar Xformats. XWith the X.BR xustar " and " exustar Xformats, X.B star Xprefers to store long link names using the POSIX.1-2001 method. XThe X.I size Xis always non zero and denotes the length of the long link target name Xincluding the trailing null byte. XThe link name is in the data that follows the header. X.TP X.B 'L' XA long file name. X.B Star Xis able to read and write this type of header with the X.BR star ", " xstar " and " gnutar Xformats. XWith the X.BR xustar " and " exustar Xformats, X.B star Xprefers to store long file names using the POSIX.1-2001 method. XThe X.I size Xis always non zero and denotes the length of the long file name including Xthe trailing null byte. The file name is in the data that follows the header. X.TP X.B 'M' XA multi volume continuation entry. XIt is used by X.B star Xto tell the extraction program via the X.I size Xfield when the next regular archive header will follow. XThis allows to start extracting multi volume archives with a volume Xnumber greater than one. XIt is used by GNU tar to verify multi volume continuation volumes. XOther fields in the GNU multi volume continuation header are a result of Xa GNU tar miss conception and cannot be used in a reliable tar implementation. XIf the X.I size Xfield is non zero the data following the header is skipped by X.B star Xif the volume that starts with it is mounted as the first volume. XThis header is ignored if the volume that starts with it is mounted Xas continuation volume. Instead, the following data is used as the continuation Xof the file that is currently extracted. X.TP X.B 'N' XAn outdated linktype used by old GNU tar versions to store long file names. XThis type is unsupported by X.BR star . X.TP X.B 'S' XA sparse file. XThis header type is used by X.B star Xand X.BR "GNU tar" . XA sparse header is used instead of a plain file header to denote a sparse Xfile that follows. Directly after the header, a list of sparse hole descriptors Xfollows followed by the compacted file data. XWith X.I star Xformats, the X.I size Xfield holds a size that represents the sum of the sparse hole descriptors Xplus the size of the compacted file data. This allows other X.B tar Ximplementations to correctly skip to the next X.BR "tar header" . XWith GNU tar, up to 4 sparse hole descriptors fit into the sparse header. XAdditional hole descriptors are not needed if the file has less than 4 holes. XWith GNU tar, the size field breaks general X.I tar Xheader rules in case more than 4 sparse hole descriptors are used Xand is meaningless because the size of the additional sparse hole Xdescriptors used by GNU tar does not count and cannot be determined before Xparsing all sparse hole descriptors. X.TP X.B 'V' XA volume header. XThe X.I name Xfield is is used to hold the volume name. X.B Star Xuses the X.I atime Xfield to hold the volume number in case there is no POSIX.1-2001 extended header. XThis header type is used by X.B star Xand X.BR "GNU tar" . XIf the X.I size Xfield is non zero the data following the header is skipped by X.BR star . X.TP X.B 'X' XA vendor unique variant of the POSIX.1-2001 extended header type. XIt has been implemented by Sun many years before the POSIX.1-2001 Xstandard has been approved and the POSIX.1-2001 tar extensions are Xbased on this Sun tar extension. XSee also the X.I typeflag X\&'x' header type. X.B Star Xis able to read and write this type of header. X.PP XThe X.I devmajor Xand X.I devminor Xfields contain the numerical X.B major() Xand X.B minor() Xinformation that defines the device id of the file from the member X.B st_rdev Xin X.BR "struct stat" . XThese fields may use a X.B base 256 Xencoding. X.br X.ne 10 X.SH "EXTENDED TAR (PAX) HEADER STRUCTURE X.PP X.TS Xtab (/); Xlb cb Xl ci . XBlock type/Description X XUstar Header [typeflag='g']/Global Extended Header XGlobal Extended Data/ XUstar Header [typeflag='x']/Extended Header XExtended Data/ XUstar header [typeflag='0']/File with Extended Header XData for File #1/ XUstar header [typeflag='0']/File without Extended Header XData for File #2/ XBlock of binary zeroes/First EOF Block XBlock of binary zeroes/Second EOF Block X.TE X X.ne 10 X.SH "EXTENDED TAR (PAX) HEADER FORMAT X.PP XThe data block that follows a X.B tar Xarchive header with X.I typeflag X.B "\&'g' Xor X.B "\&'x' Xcontains one or more records in the following format: X.PP X.RS X\&"%d %s=%s\en", X.IR ", " ", " X.RE X.PP XEach record starts with a a decimal length field. The length includes Xthe total size of a record including the length field itself and the trailing Xnew line. X.PP XThe X.I keyword Xmay not include an equal sign. XAll keywords beginning with lower case letters and digits are reserved for Xfuture use by the POSIX standard. X.PP XIf the value field is of zero length, it deletes any header field of the same Xname that is in effect from the same extended header or from a previous global Xheader. X.PP XNull characters do not delimit any value. The data used for X.I value Xis only limited by its Ximplicit length. X.SH "EXTENDED TAR (PAX) HEADER KEYWORDS XPOSIX.1-2001 extended X.B pax Xheader keywords. All numerical values are represented as decimal strings. XAll texts are represented as UTF-8 or an unspecified binary format (see X.B hdrcharset Xkeyword) that is expected to be understood by the receiving system: X.TP X.B atime XThe time from X.B st_atime Xin sub second granularity. X.B Star Xcurrently supports a nanosecond granularity. X.TP X.B charset XThe name of the character set used to encode the data in the following file(s). X.RS X.PP XThe following values are supported for X.BR charset : X.TP 25 X.B "ISO-IR 646 1990 XISO/IEC 646:1990 X.TP X.B "ISO-IR 8859 1 1998 XISO/IEC 8859-1:1998 X.TP X.B "ISO-IR 8859 2 1998 XISO/IEC 8859-2:1998 X.TP X.B "ISO-IR 8859 3 1998 XISO/IEC 8859-3:1998 X.TP X.B "ISO-IR 8859 4 1998 XISO/IEC 8859-4:1998 X.TP X.B "ISO-IR 8859 5 1998 XISO/IEC 8859-5:1998 X.TP X.B "ISO-IR 8859 6 1998 XISO/IEC 8859-6:1998 X.TP X.B "ISO-IR 8859 7 1998 XISO/IEC 8859-7:1998 X.TP X.B "ISO-IR 8859 8 1998 XISO/IEC 8859-8:1998 X.TP X.B "ISO-IR 8859 9 1998 XISO/IEC 8859-9:1998 X.TP X.B "ISO-IR 8859 10 1998 XISO/IEC 8859-10:1998 X.TP X.B "ISO-IR 8859 11 1998 XISO/IEC 8859-11:1998 X.TP X.B "ISO-IR 8859 12 1998 XISO/IEC 8859-12:1998 X.TP X.B "ISO-IR 8859 13 1998 XISO/IEC 8859-13:1998 X.TP X.B "ISO-IR 8859 14 1998 XISO/IEC 8859-14:1998 X.TP X.B "ISO-IR 8859 15 1998 XISO/IEC 8859-15:1998 X.TP X.B "ISO-IR 10646 2000 XISO/IEC 10646:2000 X.TP X.B "ISO-IR 10646 2000 UTF-8" XISO/IEC 10646, UTF-8 encoding X.TP X.B BINARY XNone X.PP XThis keyword is currently ignored by X.BR star . X.RE X.TP X.B comment XAny number of characters that  should be treated as comment. X.B Star Xignores the comment as documented by the POSIX standard. X.TP X.B ctime XThe time from X.B st_ctime Xin sub second granularity. X.B Star Xcurrently supports a nanosecond granularity. X.TP X.B gid XThe group ID of the group that owns the file. XThe argument is a decimal number. XThis field is used if the group ID of a file is greater than 2097151 (octal 7777777). X.TP X.B gname XThe group name keyword for the following file(s) is created if the group name does not Xfit into 32 characters or cannot be expressed in 7-Bit ASCII. XIt is coded in UTF-8 Xor (if the X.B hdrcharset Xkeyword is present) coded to fit the charset value. X.TP X.B hdrcharset XThe name of the character set used to encode the data for the X.BR gname , X.BR linkpath , X.BR path " and X.B uname Xfields in the POSIX.1-2001 extended header records Xand for the X.BR gname , X.B uname Xand X.B path Xparts in the vendor specific extended header records X.BR SCHILY.acl.ace , X.BR SCHILY.acl.access , X.B SCHILY.acl.default Xand X.BR SCHILY.dir . X.RS X.PP XThe following values are supported for X.BR hdrcharset : X.TP 25 X.B "ISO-IR 10646 2000 UTF-8" XISO/IEC 10646, UTF-8 encoding X.TP X.B BINARY XNone X.PP XIf the binary encoding is selected, the encoding is the same as used Xby the creating system and it is assumed that the receiving system is Xable to use the values in that encoding. X.RE X.TP X.B linkpath XThe X.I linkpath Xkeyword is created if the linkpath Xis longer than 100 characters or cannot be expressed in 7-Bit ASCII. XIt is coded in UTF-8 Xor (if the X.B hdrcharset Xkeyword is present) coded to fit the charset value. X.TP X.B mtime XThe time from X.B st_mtime Xin sub second granularity. X.B Star Xcurrently supports a nanosecond granularity. X.TP X.B path XThe X.I path Xkeyword is created if the path Xdoes not fit into 100 characters + 155 characters prefix Xor cannot be expressed in 7-Bit ASCII. XIt is coded in UTF-8 Xor (if the X.B hdrcharset Xkeyword is present) coded to fit the charset value. X.TP X.BI realtime. any XThe keywords prefixed by X.B realtime. Xare reserved for future standardization. X.TP X.BI security. any XThe keywords prefixed by X.B security. Xare reserved for future standardization. X.TP X.B size XThe size of the file as decimal number if the file size is greater than 8589934591 (octal 77777777777). XThe X.B size Xkeyword may not refer to the real file size but is related to the size if the file in the archive. XSee also X.B SCHILY.realsize Xfor more information. X.TP X.B uid XThe uid ID of the group that owns the file. XThe argument is a decimal number. XThis field is used if the uid ID of a file is greater than 2097151 (octal 7777777). X.TP X.B uname XThe user name keyword for the following file(s) is created if the user name does not Xfit into 32 characters or cannot be expressed in 7-Bit ASCII. XIt is coded in UTF-8 Xor (if the X.B hdrcharset Xkeyword is present) coded to fit the charset value. X.TP X.IR VENDOR .keyword XAny keyword that starts with a vendor name in capital letters is reserved Xfor vendor specific extensions Xby the standard. X.B Star Xuses a lot of these vendor specific extension. See below for more informations. X.SH "SCHILY PAX EXTENSION KEYWORDS X.B Star Xuses own vendor specific extensions. The X.B SCHILY Xvendor specific extended X.B pax Xheader keywords are: X.TP X.B SCHILY.acl.ace XThe NFSv4 ACL for a file. X.sp XSince no official backup format for the NFSv4 ACL standard Xhas been defined, X.B star Xuses the vendor defined attributes X.B SCHILY.acl.ace Xfor storing the X.B NFSv4 ACL Xentries. X.sp XPrevious versions of X.B star Xused a format for the ACL text that is Xis the format created by the function X.BR acl_totext () Xfrom X.B libsec Xon Solaris, using the call: X.sp X.nf X.B acl_totext(aclp, \e X.B " ACL_COMPACT_FMT | ACL_APPEND_ID | ACL_SID_FMT); X.fi X.sp XThe flags have the following meaning: X.RS X.br X.ne 4 X.TP X.B ACL_COMPACT_FMT XCreate the compact version of the ACL text representation. X.br X.ne 4 X.TP X.B ACL_APPEND_ID XAppend X.B uid Xor X.B gid Xfor additional user or group entries. X.br X.ne 4 X.TP X.B ACL_SID_FMT XUse the X.B usersid Xor X.B groupsid Xformat for entries related to an ephemeral X.B uid Xor X.BR gid . XThe raw X.B sid Xformat will only be used when the "id" cannot be Xresolved to a windows name. X.PP X.sp X.ne 12 XThis is an example of the format used for X.B SCHILY.acl.ace X(a space has been inserted after the equal sign and lines are broken X[marked with '\e' ] for readability): X.sp X.nf XSCHILY.acl.ace= user:lisa:rwx-----------:-------:allow:502,\ \e X group:toolies:rwx-----------:-------:allow:102,\ \e X owner@:--x-----------:-------:deny,\ \ \e X owner@:rw-p---A-W-Co-:-------:allow,\ \e X group@:-wxp----------:-------:deny,\ \ \e X group@:r-------------:-------:allow,\ \e X everyone@:-wxp---A-W-Co-:-------:deny,\ \ \e X everyone@:r-----a-R-c--s:-------:allow X.fi X.PP XThe numerical user and group identifiers are essential when restoring a Xsystem completely from a backup, as initially the name-to-identifier Xmappings may not be available, and then file ownership restoration Xwould not work. X.PP XNewer versions of star use a highly compact variant of the format Xmentioned above that avoids the X\&'-' characters in the text. XThe example below is using lines broken the same way as in Xthe previous example. X.sp X.nf XSCHILY.acl.ace= user:lisa:rwx::allow:502,\ \e X group:toolies:rwx::allow:102,\ \e X owner@:x::deny,\ \ \ \ \ \ \ \ \e X owner@:rwpAWCo::allow,\ \e X group@:wxp::deny,\ \ \ \ \ \ \e X group@:r::allow,\ \ \ \ \ \ \ \e X everyone@:wxpAWCo::deny,\ \ \e X everyone@:raRcs::allow X.fi X.PP XThis highly compact format is understood by X.B acl_fromtext() Xin X.B libsec Xfrom Solaris and by the corresponding code from FreeBSD. XIt is created by removing the X.B '-' Xcharacters from the normal compact format. X.PP XThe advantage of th highly compact format is that it typically avoids the Xneed to make the extended header data larger than 512 bytes. X.PP XIn addition to the documented entry formats, a compatible implementation Xneeds to be able to understand the long X.B ace Xformat, if it appears in extended tar headers. XThe long format for the ACL text is the format created by the function X.BR acl_totext () Xfrom X.B libsec Xon Solaris, using the call: X.sp X.nf X.B acl_totext(aclp, ACL_APPEND_ID | ACL_SID_FMT); X.fi X.sp X.PP XAs the archive format that is used for backing up access control lists is Xcompatible with the X.B pax Xarchive format, archives created that way can be restored by X.B star Xor a POSIX.1-2001 compliant X.BR pax . XNote that programs that do not implement compatibility to the X.B star Xextensions will ignore the ACL information. X.RE X.sp X.TP X.B SCHILY.acl.access XThe withdrawn POSIX draft ACL for a file. X.sp XSince no official backup format for the withdrawn POSIX draft Xaccess control lists has been defined, X.B star Xuses the vendor defined attributes X.B SCHILY.acl.access Xand X.B SCHILY.acl.default Xfor storing the X.B ACL Xand X.B "Default ACL Xof a file, respectively. XThe access control lists are stored in the short text form as defined in Xthe withdrawn X.BR "POSIX 1003.1e draft standard 17" . X.sp XNote that the POSIX 1003.1e draft has been withdrawn in 1997 but some Xoperating systems still support it with some filesystems. X.sp XTo each named user X.B ACL Xentry a fourth colon separated field, containing the X.I "user identifier (UID) Xof the associated user, is appended. XTo each named group entry a fourth colon separated field containing the X.I "group identifier (GID) Xof the associated group is appended. X(POSIX 1003.1e draft standard 17 allows to add fields to ACL entries.) X.sp XIf the X.B user name Xor X.B group name Xfield is numeric because the related user has no entry in the X.BR passwd / "group database Xat the time the archive is created, Xthe additional numeric field may be omitted. X.sp X.ne 7 XThis is an example of the format used for X.B SCHILY.acl.access X(a space has been inserted after the equal sign and lines are broken X[marked with '\e' ] for readability, additional fields in bold): X.sp X.nf XSCHILY.acl.access= user::rwx,user:lisa:r\-x:\fB502\fP,\ \e X group::r\-x,group:toolies:rwx:\fB102\fP,\ \e X mask::rwx,other::r\-\-x X.fi X.sp XIf and only if the X.B user ID 502 Xand X.B group ID 102 Xhave no passwd/group entry, our example acl entry looks this way: X.sp X.nf XSCHILY.acl.access= user::rwx,user:502:r\-x,\ \e X group::r\-x,group:102:rwx:,\ \e X mask::rwx,other::r\-\-x X.fi X.sp XThe added numerical user and group identifiers are essential when Xrestoring a system completely from a backup, Xas initially the name-to-identifier mappings may not be available, Xand then file ownership restoration would not work. X.sp XWhen the archive is unpacked and the X.B ACL Xentries for the files are restored, first the additional numeric fields Xare removed and an attempt is made to restore the resulting X.B ACL Xdata. XIf that fails, the numeric fields are extracted and the related X.B user name Xand X.B group name Xfields are replaced by the numeric fields, before the X.B ACL Xrestore is retried. X.sp XAs the archive format that is used for backing up access control lists is compatible Xwith the X.B pax Xarchive format, archives created that way can be restored by X.B star Xor a POSIX.1-2001 compliant X.BR pax . XNote that programs other than X.B star Xwill ignore the ACL information. X.TP X.B SCHILY.acl.default XThe default ACL for a file. See X.B SCHILY.acl.access Xfor more information. X.sp XThis is an example of the format used for X.B SCHILY.acl.default X(a space has been inserted after the equal sign and lines are broken X[marked with '\e' ] for readability, additional fields in bold): X.sp X.nf XSCHILY.acl.default= user::rwx,user:lisa:r-x:\fB502\fP,\ \e X group::r-x,mask::r-x,other::r-x X.fi X.br X.ne 7 X.TP X.B SCHILY.acl.type XThe ACL type used for coding access control lists. X.sp X.ne 5 XThe following ACL types are possible: X.RS X.br X.ne 5 X.TP X.B "POSIX\ draft" XACLs as defined in the withdrawn X.BR "POSIX 1003.1e draft standard 17" . X.br X.ne 5 X.TP X.B NFSv4 XACLs as used by X.BR NFSv4 , X.B NTFS Xand X.BR ZFS . X.LP XNote that the X.B SCHILY.acl.type Xkeyword is currently not generated by X.BR star . XStar however accepts this keyword if it appears in extended tar headers. XThe ACL type is determined from the existence of the keyword type that holds Xthe ACL text. X.RE X.TP X.B SCHILY.ddev XThe device ids for names used is the X.B SCHILY.dir Xdump directory list from X.B st_dev Xof the file as decimal number. XThe X.B SCHILY.ddev Xkeyword is followed by a space separated list of device id numbers. Each corresponds Xexactly to a name in the list found in X.BR SCHILY.dir . XIf a specific device id number is repeated, a comma (,) without a following space may be Xuse to denote that the current device id number is identical to the previous number. XThis keyword is used in X.B dump Xmode. XThis keyword is not yet implemented. XIt will be implemented in case that X.B star Xwill support incremental dumps that span more than one filesystem. X.sp XThe value is a signed int. XAn implementation should be able to handle at least 64 bit values. XNote that the value is signed because POSIX does not specify Xmore than the type should be an int. X.TP X.B SCHILY.dev XThe device id from X.B st_dev Xof the file as decimal number. XThis keyword is used in X.B dump Xmode. X.sp XThe value is a signed int. XAn implementation should be able to handle at least 64 bit values. XNote that the value is signed because POSIX does not specify Xmore than the type should be an int. X.TP X.B SCHILY.devmajor XThe device major number of the file (from X.BR st_rdev ) Xif it is a character or block special file. XThe argument is a decimal number. XThis field is used if the device major of the file is greater than 2097151 (octal 7777777). X.sp XThe value is a signed int. XAn implementation should be able to handle at least 64 bit values. XNote that the value is signed because POSIX does not specify Xmore than the type should be an int. X.TP X.B SCHILY.devminor XThe device minor number of the file (from X.BR st_rdev ) Xif it is a character or block special file. XThe argument is a decimal number. XThis field is used if the device minor of the file is greater than 2097151 (octal 7777777). X.sp XThe value is a signed int. XAn implementation should be able to handle at least 64 bit values. XNote that the value is signed because POSIX does not specify Xmore than the type should be an int. X.TP X.B SCHILY.devminorbits XThe number of minorbits used in the device id from X.B st_dev Xas decimal number. X.sp XThe value is mainly needed for SunOS where the number of minor bits in st_dev Xdepends on whether a program is run in 32 or 64 bit mode. There is no support Xfor platforms that do not have the minor part of the device id in a contiguous Xset of bits (like e.g. FreeBSD). X.TP X.B SCHILY.dino XThe inode numbers for names used is the X.B SCHILY.dir Xdump directory list from X.B st_ino Xof the file as decimal number. XThe X.B SCHILY.dino Xkeyword is followed by a space separated list of inode numbers. Each corresponds Xexactly to a name in the list found in X.BR SCHILY.dir . XThis keyword is used in X.B dump Xmode. X.sp XThe values are unsigned int. XAn implementation should be able to handle at least 64 bit unsigned values. X.TP X.B SCHILY.dir XA list of filenames (the content) for the current directory. XThe names are coded in UTF-8. XEach file name is prefixed by a single character that is used as a flag. XEach file name is limited by a null character. XThe null character is directly followed Xby he flag character for the next file name in case the list is not terminated Xby the current file name. XThe flag character must not be a null character. XBy default, a ^A (octal 001) is used. XThe following flags are defined: X.RS X.TP 10 X.B \e000 XThis is the list terminator character - the second null byte, see below. X.TP X.BR \e001 " (" ^A ) XThe default flag that is used in case the X.B "dump dir Xfeatures have not been active or in case that the file type is unknown. X.TP X.BR \e002 " (" ^B ) XThe related file is a X.B FIFO Xspecial (named pipe). X.TP X.BR \e003 " (" ^C ) XThe related file is a X.BR "character special" . X.TP X.BR \e004 " (" ^D ) XReserved, used e.g. by XENIX X.BR "multiplexed character special" . X.TP X.BR \e005 " (" ^E ) XThe related file is a X.BR directory . X.TP X.BR \e006 " (" ^F ) XReserved, used e.g. by XENIX X.BR "named file" . X.TP X.BR \e007 " (" ^G ) XThe related file is a X.BR "block special" . X.TP X.BR \e010 " (" ^H ) XReserved, used e.g. by XENIX X.BR "multiplexed block special" . X.TP X.BR \e011 " (" ^I ) XThe related file is a X.BR "regular file" . X.TP X.BR \e012 " (" ^J ) XThe related file is a X.BR "contiguous file" . X.TP X.BR \e013 " (" ^K ) XThe related file is a X.BR "symbolic link" . X.TP X.BR \e014 " (" ^L ) XReserved, used e.g. by Solaris X.BR "shadow inode" . X.TP X.BR \e015 " (" ^M ) XThe related file is a X.BR socket . X.TP X.BR \e016 " (" ^N ) XThe related file is a Solaris X.BR DOOR . X.TP X.BR \e017 " (" ^O ) XThe related file is a BSD X.BR "whiteout entry" . X.TP X.BR \e020 " (" ^P ) XReserved, used e.g. by UNOS X.BR eventcount . X.TP X.B Y XA non directory file that is in the current (incremental) dump. X.TP X.B N XA non directory file that is not in the current (incremental) dump. X.TP X.B D XA directory that is in the current (incremental) dump. X.TP X.B d XA directory that is not in the current (incremental) dump. X.PP XThe list is terminated by two successive null bytes. XThe first is the null byte for the last file name. XThe second null byte is at the position where a flag character Xwould be expected, it acts ad a list terminator. The length Xtag for the X.B SCHILY.dir Xdata includes both null bytes. X.PP XIf a dump mode has been selected that writes Xcompact complete directory information to the beginning of Xthe archive, the flag character may contain values different Xfrom ^A. X.B Star Ximplementations at least up to X.B star-1.5.1 Xdo not use the feature to tag entries and use the default Xentry \e001 (^A) for all files. XTar implementations that like to read archives that use the X.B SCHILY.dir Xkeyword, shall not rely on values other than \e000 (^@) or \e001 (^A). X.PP XIn 2016, with X.B star-1.5.3 Xthe values from \e002 to \e020 have been introduced as a result of a X.B libfind Xupdate that uses struct dirent member X.B d_type Xwhere available. X.PP XThis keyword is used in X.B dump Xmode. X.RE X.TP X.B SCHILY.fflags XA textual version of the BSD or Linux extended file flags. X.sp XThe following flags are defined by star, the bold names are the names Xthat are generated and the other names are accepted on input as well: X.RS X.TP 15 X.B arch Xset the X.B archived Xflag (super-user only). X.TP Xarchived XAlias for X.BR arch . X.TP X.B compressed Xset the X.B compressed Xflag (Mac OS only). X.TP Xucompressed XAlias for X.BR compressed . X.TP X.B hidden XSet the X.B file is hidden Xflag. X.TP Xuhidden XAlias for X.BR hidden . X.TP X.B nodump Xset the nodump flag (owner or super-user). X.TP X.B offline XSet the X.B file is offline Xflag. X.TP Xuoffline XAlias for X.BR offline . X.TP X.B opaque Xset the opaque flag (owner or super-user). X.TP X.B rdonly XSet the X.B readonly Xflag. X.TP Xurdonly XAlias for X.BR rdonly . X.TP Xreadonly XAlias for X.BR rdonly . X.TP X.B reparse XSet the X.B reparse Xflag. X.TP Xureparse XAlias for X.BR reparse . X.TP X.B sappnd Xset the system append-only flag (super-user only). X.TP Xsappend XAlias for X.BR sappnd . X.TP X.B schg Xset the system immutable flag (super-user only). X.TP Xschange XAlias for X.BR schg . X.TP Xsimmutable XAlias for X.BR schg . X.TP X.B sparse XSet the X.B sparse Xflag. X.TP Xusparse XAlias for X.BR sparse . X.TP X.B sunlnk Xset the system undeletable flag (super-user only). X.TP Xsunlink XAlias for X.BR sunlnk . X.TP X.B system XSet the X.B system Xflag. X.TP Xusystem XAlias for X.BR system . X.TP X.B uappnd Xset the user append-only flag (owner or super-user). X.TP Xuappend XAlias for X.BR uappnd . X.TP X.B uchg Xset the user immutable flag (owner or super-user). X.TP Xuchange XAlias for X.BR uchg . X.TP Xuimmutable XAlias for X.BR uchg . X.TP X.B uunlnk Xset the user undeletable flag (owner or super-user). X.TP Xuunlink XAlias for X.BR uunlnk . X.br X.ne 4 X.LP XThe following flags are only available on Linux: X.TP 15 X.B compress XSet the Linux X.B compress Xflag (owner or super-user). X.TP X.B dirsync XSet the Linux X.B dirsync Xflag (owner or super-user) Xthat causes synchronous writes for directories. X.TP X.B journal-data XSet the Linux X.B journal data Xflag (super-user only). X.TP X.B noatime XSet the Linux X.B no access time Xflag (owner or super-user). X.TP X.B nocow XSet the Linux X.B no copy on write Xflag (owner or super-user). X.TP X.B notail XSet the Linux X.B no tail merging Xflag (owner or super-user). X.TP X.B projinherit XSet the Linux X.B project inherit Xflag (owner or super-user). X.TP X.B secdel XSet the Linux X.B secure deletion X(purge before delete) flag (owner or super-user). X.TP X.B sync XSet the Linux X.B sync Xflag (owner or super-user). X.TP X.B topdir XSet the Linux X.B top of directory hierarchies Xflag (owner or super-user). X.TP X.B undel XSet the Linux X.B "allow unrm" Xflag (owner or super-user). X.RE X.TP X.B SCHILY.filetype XA textual version of the real file type of the file. XThe following names are used: X.RS X.TP 24 X.B unallocated XAn unknown file type that may be a result of a X.BR unlink (2) Xoperation. XThis should never happen. X.TP X.B regular XA regular file. X.TP X.B contiguous XA contiguous file. On operating systems or file systems that don't support Xthis file type, it is handled like a regular file. X.TP X.B symlink XA symbolic link to any file type. X.TP X.B directory XA directory. X.TP X.B "character special" XA character special file. X.TP X.B "block special" XA block special file. X.TP X.B fifo XA named pipe. X.TP X.B socket XA UNIX domain socket. X.TP X.B "mpx character special" XA multiplexed character special file. X.TP X.B "mpx block special" XA multiplexed block special file. X.TP X.B "XENIX nsem" XA XENIX named semaphore. X.TP X.B "XENIX nshd" XXENIX shared data. X.TP X.B door XA Solaris door. X.TP X.B eventcount XA UNOS event count. X.TP X.B whiteout XA BSD whiteout directory entry. X.TP X.B sparse XA sparse regular file. X.TP X.B volheader XA volume header. X.TP X.B "unknown/bad" XAny other unknown file type. XThis should never happen. X X.RE X.TP X.B SCHILY.ino XThe inode number from X.B st_ino Xof the file as decimal number. XThis keyword is used in X.B dump Xmode. X.sp XThe value is an unsigned int. XAn implementation should be able to handle at least 64 bit unsigned values. X.TP X.B SCHILY.nlink XThe link count of the file as decimal number. XThis keyword is used in X.B dump Xmode. X.sp XThe value is an unsigned int. XAn implementation should be able to handle at least 32 bit unsigned values. X.TP X.B SCHILY.offset XThe X.B offset Xvalue for a multi volume continuation header. XThis keyword is used with multi volume continuation headers. XMulti volume continuation headers are used to allow to start reading Xa multi volume archive past the first volume. X.sp X.B SCHILY.offset Xspecifies the byte offset within a file that was split across volumes Xas a result of a multi volume media change operation. X.sp XThe value is an unsigned int. XAn implementation should be able to handle at least 64 bit unsigned values. X.TP X.B SCHILY.realsize XThe real size of the file as decimal number. XThis keyword is used if the real size of the file differs from the Xvisible size of the file in the archive. XThe real file size differs from the size in the archive if the Xfile type is X.B sparse Xor if the file is a continuation file on a multi volume archive. XIn case the X.B SCHILY.realsize Xkeyword is needed, it must be past any X.B size Xkeyword in case a X.B size Xkeyword is also present. X.sp XAs sparse files allocate less space on tape than a regular file and as a Xcontinued file that started on a previous volume only holds parts of the Xfile, the X.B SCHILY.realsize Xkeyword holds a bigger number than the X.B size Xkeyword. X.sp XThe value is an unsigned int. XAn implementation should be able to handle at least 64 bit unsigned values. X.TP X.B SCHILY.tarfiletype XThe following additional file types are used in X.BR SCHILY.tarfiletype : X.RS X.TP X.B hardlink XA hard link to any file type. X.TP X.B dumpdir XA directory with dump entries X.TP X.B "multivol continuation" XA multi volume continuation for any file type. X.TP X.B meta XA meta entry (inode meta data only) for any file type. X.RE X.TP X.BI SCHILY.xattr. attr XA POSIX.1-2001 coded version of the Linux extended file attributes. XLinux extended file attributes are name/value pairs. Every Xattribute X.I name Xresults in a X.BI SCHILY.xattr. name Xtag and the value of the extended attribute is used as the value of the XPOSIX.1-2001 header tag. XNote that this way of coding is not portable across platforms, Xeven though it is compatible with the implementation on X.BR "Mac OS X" . XA version for BSD may be created but X.B NFSv4 Xincludes far more Xfeatures with extended attribute files than Linux does. X.sp XA future version of X.B star Xwill implement a similar method as the X.B tar Xprogram on Solaris currently uses. When this implementation is ready, Xthe X.BI SCHILY.xattr. name Xfeature may be removed in favor of a truly portable implementation Xthat supports Solaris also. X X.SH "SCHILY 'G'LOBAL PAX EXTENSION KEYWORDS XThe following X.B star Xvendor unique extensions may only appear in X.B "'g'lobal Xextended X.B pax Xheaders: X.TP X.B SCHILY.archtype XThe textual version of the archive type used. XThe textual values used for X.B SCHILY.archtype Xare the same names that are used in the X.B star Xcommand line options to set up a specific archive type. X.sp XThe following values may currently appear in a global extended header: X.RS X.TP 15 X.B xustar X\&'xstar' format without "tar" signature at header offset 508. X.TP X.B exustar X\&'xustar' format variant that always includes x-headers and g-headers. X.LP XA complete tar implementation must be prepared to handle all archives names Xas documented in X.BR star (1). X.LP XIn order to allow archive type recognition from this keyword, Xthe minimum tape block size must be 2x512 bytes (1024 bytes) Xand the X.B SCHILY.archtype Xkeyword needs to be in the first 512 bytes of the content of the Xfirst X.B "'g'lobal pax Xheader. Then the first tape block may be scanned to recognize Xthe archive type. X.RE X.TP X.B SCHILY.release XThe textual version of the X.B star Xversion string and the platform name where this X.B star Xhas been compiled. XThe same text appears when calling X.IR "star -version" . X.sp XOther implementations may use a version string that does not start with Xthe text X.BR star . X.TP X.B SCHILY.volhdr.blockoff XThis keyword is used for multi volume archives. XIt represents the offset within the whole archive expressed Xin 512 byte units. X.sp XThe value is an unsigned int with a valid range between 1 and Xinfinity. An implementation should be able to handle at least 64 bit Xunsigned values. X.TP X.B SCHILY.volhdr.blocksize XThe tape blocksize expressed in 512 byte units that was used Xwhen writing the archive. X.sp XThe value is an unsigned int with a valid range between 1 and Xinfinity. An implementation should be able to handle at least 31 bit Xunsigned values. X.TP X.B SCHILY.volhdr.cwd XThis keyword is used in dump mode. XIt is only emitted in case the X.B "fs\-name= Xoption of star was used to overwrite the X.B SCHILY.volhdr.filesys Xvalue. XIf X.B SCHILY.volhdr.cwd Xis present, it contains the real backup working directory. X.sp XOverwriting X.B SCHILY.volhdr.filesys Xis needed when backups are run on file system snapshots rather Xthan on the real file system. X.TP X.B SCHILY.volhdr.device XThis keyword is used in dump mode. XIt represents the name of the device that holds the file system Xdata. For disk based file systems, this is the device name of the Xmounted device. X.sp XThis keyword is optional. It helps to correctly identify the Xfile system from which this dump has been made. X.TP X.B SCHILY.volhdr.dumpdate XThis keyword is used in dump mode. XIt represents the time the current dump did start. X.TP X.B SCHILY.volhdr.dumplevel XThis keyword is used in dump mode. XIt represents the level of the current dump. XDump levels are small numbers, the lowest possible number is 0. XDump level 0 represents a full backup. XDump level 1 represents a backup that contains all changes that Xdid occur since the last level 0 dump. XDump level 2 represents a backup that contains all changes that Xdid occur since the last level 1 dump. X.B Star Xdoes not specify a maximum allowed dump level but you should try Xto keep the numbers less than 100. X.sp XThe value is an unsigned int with a valid range between 0 and at least 100. X.TP X.B SCHILY.volhdr.dumptype XThis keyword is used in dump mode. XIf the dump is a complete dump of a file system X(i.e. no files are excluded via command line), then the argument Xis the text X.BR full , Xelse the argument is the text X.BR partial . X.TP X.B SCHILY.volhdr.filesys XThis keyword is used in dump mode. XIt represents the top level directory for the file system from Xwhich this dump has been made. XIf the dump represents a dump that has an associated level, then Xthe this directory needs to be identical to the root directory Xof this file system which is the mount point. X.TP X.B SCHILY.volhdr.hostname XThis keyword is used in dump mode. XThe value is retrieved from X.B gethostname(3) Xor X.BR uname(2) . X.TP X.B SCHILY.volhdr.label XThe textual volume label. XThe volume label must be identical within a set of Xmulti volume archives. X.TP X.B SCHILY.volhdr.refdate XThis keyword is used in dump mode if the current dump is an Xincremental dump with a level > 0. XIt represents the time the related dump did start. X.TP X.B SCHILY.volhdr.reflevel XThis keyword is used in dump mode if the current dump is an Xincremental dump with a level > 0. XIt represents the level of the related dump. XThe related dump is the last dump with a level that is lower Xthat the level of this dump. XIf a dump with the level of the current dump \-1 exists, then Xthis is the related dump level. Otherwise, the dump level is Xdecremented until a valid dump level could be found in the Xdump database. X.sp XThe value is an unsigned int with a valid range between 0 and at least 100. X.TP X.B SCHILY.volhdr.tapesize XThis keyword is used for multi volume archives and may be used Xto verify the volume size on read back. XIt represents the tape size expressed in 512 byte units. XThis keyword is set in multi volume mode if the size of the tape Xwas not autodetected but set from a command line option. X.sp XThe value is an unsigned int with a valid range between 1 and Xinfinity. An implementation should be able to handle at least 64 bit Xunsigned values. X.TP X.B SCHILY.volhdr.volume XThis keyword is used for multi volume archives. XIt represents the volume number within a volume set. XThe number used for the first volume is 1. X.sp XThe value is an unsigned int with a valid range between 1 and Xinfinity. An implementation should be able to handle at least 31 bit Xunsigned values. X.SH "MULTI VOLUME ARCHIVE HANDLING X.PP XMulti volume archives always use volume headers. Starting with the second Xvolume, there is a multi volume header that helps to skip the rest of the Xfile that was split at the end of the previous volume. X.LP X.B Star Xis able to work with arbitrary unknown volume sizes by detecting the end of Xthe current media via a X.BR write () Xcall that returns X.BR 0 . XA fixed media size is used, when the option X.BI tsize= # Xhas been specified. X.LP XSince X.B star Xuses a X.B fifo Xfor optimizing the I/O, Xexcept when called with the option X.BR \-no\-fifo , Xit is not possible to know the name of the file that is split at a volume limit Xnor to know the offset in that file. XUnless X.B POSIX.1-2001 Xextensions are used, X.B star Xdoes not verify whether a follow up volume is the right follow up volume. XFor this reason, it is recommended to create multi volume archives only Xwith archive formats that support X.B POSIX.1-2001 Xextensions. X.LP XThe following X.B POSIX.1-2001 Xextensions are used together with multi volume archives: X.TP X.B SCHILY.volhdr.label Xthe volume lavel is used to help to identify a set of volumes. X.TP X.B SCHILY.volhdr.dumpdate XThe start of the dump with nanosecond precision is used to identify Xthe correct follow up volume. X.TP X.B SCHILY.volhdr.volno XThe volume number counts starting with 1 and is used to identify Xthe correct follow up volume. X.TP X.B SCHILY.volhdr.blockoff XThe number of blocks read with all previous volumes. X.TP X.B SCHILY.volhdr.tapesize XThe tape size in case that the X.BI tsize= # Xoption was used. X X.SH "SEE ALSO" X.BR spax (1), X.BR suntar (1), X.BR scpio (1), X.BR tar (1), X.BR cpio (1), X.BR pax (1), X.BR star_sym (1), X.BR tartest (1), X.BR star (1) X.SH NOTES X.SH BUGS X.SH HISTORY XA X.B tar Xcommand appeared in Seventh Edition Unix, which was released in XJanuary, 1979. It replaced the X.B tp Xprogram from Fourth Edition Unix which replaced the X.B tap Xprogram from First Edition Unix. X.LP X.B Star Xwas first created in 1982 to extract tapes on a UNIX clone X.RB ( UNOS ) Xthat had no X.B tar Xcommand. XIn 1985 the first fully functional version has been released as X.B mtar. X.PP XWhen the old X.B star Xformat extensions have been introduced in 1985, it was renamed to X.B star X(Schily tar). XIn 1994, Posix 1003.1\-1988 extensions were added and X.B star Xwas renamed to X.B star X(Standard tar). X X.SH AUTHOR X.nf XJ\*org Schilling XSeestr. 110 XD\-13353 Berlin XGermany X.fi X.PP XMail bugs and suggestions to: X.PP X.B Xjoerg.schilling@fokus.fraunhofer.de Xor X.B Xjoerg@schily.net X END-of-star-1.6/star/star.4 echo x - star-1.6/star/star.dfl sed 's/^X//' >star-1.6/star/star.dfl << 'END-of-star-1.6/star/star.dfl' X# @(#)star.dfl 1.4 18/07/10 Copyright 2003-2018 J. Schilling X# X# This file is /etc/default/star X# X X# X# Uncomment this to set star's default FIFO size (e.g. the value that is used X# when no fs= option is present on the star command line). X# X#STAR_FIFOSIZE= 32m X X# X# Uncomment this to set star's MAX FIFO size. X# This tag may be used to limit the FIFO size used by star to a certain value X# even if the fs= option on the command line would request for more FIFO. X# This makes sense if you like to have a unique backup script that requests X# e.g. 256 MB if FIFO but one of the backup client machines only has 128 MB X# of RAM. X# X#STAR_FIFOSIZE_MAX= 100m X X# X# In former times, enabling fsync() for each extracted file was only a problem X# on platforms with extremely inefficient filesystem buffer cache (e.g. Linux). X# With UFS on Solaris, enabling fsync() for each extracted file makes tar X# extraction approx. 10% slower. With ext4 on Linux, this makes tar extraction X# approx. 400% slower and with btrfs on Linux it makes tar extraction approx. X# 2000% slower. X# X# Now on Solaris, we have ZFS and ZFS implements transactional filesystem X# safety, but as a result of it's copy on write concepts, it is very expensive X# if we request a specific state of the filesystem at a given time. With ZFS X# on Solaris, enabling fsync() for each extracted file makes tar extraction X# approx. 400% slower. X# X# If you are on a platform with a fair filesystem buffer performance X# (e.g. Solaris) and do not use ZFS, you should comment out the next statement X# that switches off fsync() by default. Only by enabling fsync() for each X# extracted file, star may tell whether a file extraction has been successful. X# XSTAR_FSYNC=N X X# X# Compatibility entries for Sun's tar. There are up to four entries per line: X# X# 1) The device name X# 2) The blocking factor in units of 512 bytes X# 3) The max media size in 1024 byte units X# 0 means unlimited (no multi volume handling) X# 4) Whether this is a tape or not ('n' or 'N' means no tape). X# X# device block size istape Xarchive0=/dev/rmt/0 20 0 Xarchive1=/dev/rmt/0n 20 0 Xarchive2=/dev/rmt/1 20 0 Xarchive3=/dev/rmt/1n 20 0 Xarchive4=/dev/rmt/0 126 0 Xarchive5=/dev/rmt/0n 126 0 Xarchive6=/dev/rmt/1 126 0 Xarchive7=/dev/rmt/1n 126 0 END-of-star-1.6/star/star.dfl echo x - star-1.6/star/star.h sed 's/^X//' >star-1.6/star/star.h << 'END-of-star-1.6/star/star.h' X/* @(#)star.h 1.147 19/03/26 Copyright 1985, 1995-2019 J. Schilling */ X/* X * Copyright (c) 1985, 1995-2019 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _STAR_H X#define _STAR_H X X#include X#include X#include X#include X#include "pathname.h" X X#ifdef __cplusplus Xextern "C" { X#endif X X/* X * Be careful not to overflow off_t when computing tarblocks() X */ X#define tarblocks(s) (((s) / TBLOCK) + (((s)%TBLOCK)?1:0)) X#define tarsize(s) (tarblocks(s) * TBLOCK) X X/* X * Defines for header type recognition X * N.B. these must kept in sync with hdrtxt[] in header.c X */ X#define H_SWAPPED(t) ((-1)*(t)) X#define H_ISSWAPPED(t) ((t) < H_UNDEF) X#define H_TYPE(t) ((int)(H_ISSWAPPED(t) ? ((-1)*(t)):(t))) X#define H_UNDEF 0 X#define H_TARMIN 1 /* Lowest TAR type # */ X#define H_TAR 1 /* tar unbekanntes format */ X#define H_V7TAR 2 /* UNIX V7 format (1978 ???) */ X#define H_OTAR 3 /* tar altes BSD format (1978 ???) */ X#define H_STAR 4 /* altes star format (1985) */ X#define H_GNUTAR 5 /* gnu tar format (1989) */ X#define H_USTAR 6 /* ieee 1003.1-1988 format (1987 ff.) */ X#define H_XSTAR 7 /* extended 1003.1-1988 format (1994) */ X#define H_XUSTAR 8 /* ext 1003.1-1988 fmt w/o "tar" sign. (1998) */ X#define H_EXUSTAR 9 /* ext 1003.1-2001 fmt w/o "tar" sign. (2001) */ X#define H_PAX 10 /* ieee 1003.1-2001 ext. ustar format (PAX) */ X#define H_EPAX 11 /* ieee 1003.1-2001 ext. ustar format + xhdr */ X#define H_SUNTAR 12 /* Sun's tar implementaion from Solaris 7/8/9 */ X#define H_TARMAX 12 /* Highest TAR type # */ X#define H_RES13 13 /* Reserved */ X#define H_RES14 14 /* Reserved */ X#define H_BAR 15 /* SUN bar format */ X#define H_CPIO_BASE 16 /* cpio Basis */ X#define H_CPIO_BIN 16 /* cpio Binär */ X#define H_CPIO_CHR 17 /* cpio -Hodc POSIX format */ X#define H_CPIO_ODC 18 /* cpio -Hodc POSIX format 256 char filename */ X#define H_CPIO_NBIN 19 /* cpio neu Binär */ X#define H_CPIO_CRC 20 /* cpio crc Binär */ X#define H_CPIO_ASC 21 /* cpio -c ascii expanded maj/min */ X#define H_CPIO_ACRC 22 /* cpio -Hcrc ascii expanded maj/min */ X#define H_CPIO_MAX 22 /* cpio Ende */ X#define H_MAX_ARCH 22 /* Highest possible # */ X X/* X * Interface types X */ X#define I_TAR 1 /* tar, ustar, star */ X#define I_PAX 2 /* pax, spax */ X#define I_CPIO 3 /* cpio */ X X/* X * Program types X */ X#define P_STAR 1 /* star, ustar */ X#define P_SUNTAR 2 /* suntar */ X#define P_GNUTAR 3 /* gnutar */ X#define P_PAX 10 /* pax, spax */ X#define P_CPIO 20 /* cpio, scpio */ X X/* X * Return codes from compression type checker. X */ X#define C_NONE 0 /* Not compressed or unknown compression */ X#define C_PACK 1 /* Compr. with 'pack', unpack with 'gzip' */ X#define C_GZIP 2 /* Compr. with 'gzip', unpack with 'gzip' */ X#define C_LZW 3 /* Compr. with 'lzw', unpack with 'gzip' */ X#define C_FREEZE 4 /* Compr. with 'freeze', unpack with 'gzip' */ X#define C_LZH 5 /* Compr. with 'SCO LZH', unpack with 'gzip' */ X#define C_PKZIP 6 /* Compr. with 'pkzip', unpack with 'gzip' */ X#define C_BZIP2 7 /* Compr. with 'bzip2', unpack with 'bzip2' */ X#define C_LZO 8 /* Compr. with 'lzop', unpack with 'lzop' */ X#define C_7Z 9 /* Compr. with 'p7zip', unpack with 'p7zip' */ X#define C_XZ 10 /* Compr. with 'xz', unpack with 'xz' */ X#define C_LZIP 11 /* Compr. with 'lzip', unpack with 'lzip' */ X#define C_ZSTD 12 /* Compr. with 'zstd', unpack with 'zstd' */ X#define C_LZMA 13 /* Compr. with 'lzma', unpack with 'lzma' */ X#define C_FREEZE2 14 /* Compr. with 'freeze2', unpack w. 'freeze' */ X#define C_MAX 14 X X/* X * Transfer direction types for utf8_init() X */ X#define S_CREATE 1 X#define S_EXTRACT 2 X X/* X * Header size values X */ X#define TAR_HDRSZ TBLOCK /* TAR header size */ X#define BAR_HDRSZ TBLOCK /* Sun bar header size */ X#define CPIOBIN_HDRSZ 26 /* cpio Binär (default) CPIO header size */ X#define CPIOODC_HDRSZ 76 /* cpio -Hodc POSIX format header size */ X#define CPIOCRC_HDRSZ 110 /* cpio -c ascii / cpio -Hcrc header size */ X X/* X * POSIX.1-1988 field size values and magic. X */ X#define TBLOCK 512 X#define NAMSIZ 100 X#define PFXSIZ 155 X X#define TMODLEN 8 X#define TUIDLEN 8 X#define TGIDLEN 8 X#define TSIZLEN 12 X#define TMTMLEN 12 X#define TCKSLEN 8 X X#define TMAGIC "ustar" /* ustar magic */ X#define TMAGLEN 6 /* "ustar" including NULL byte */ X#define TVERSION "00" X#define TVERSLEN 2 X#define TUNMLEN 32 X#define TGNMLEN 32 X#define TDEVLEN 8 X X/* X * The maximum number that we may handle with a 32 bit int X */ X#define MAXINT32 0x7FFFFFFFL X X/* X * Large file summit: max size of a non-large file (2 GB - 2 Bytes) X */ X#define MAXNONLARGEFILE (MAXINT32 - 1) X X/* X * Max POSIX.1-1988 limit for numeric 12 byte fields such as size/mtime X */ X#ifdef USE_LONGLONG X#define MAXOCTAL11 077777777777ULL X#else X#define MAXOCTAL11 MAXINT32 X#endif X X/* X * Max POSIX.1-1988 limit for numeric 8 byte fields such as uid/gid/dev X */ X#define MAXOCTAL7 07777777 X X/* X * Pre POSIX.1-1988 limit for numeric 8 byte fields such as uid/gid/dev X */ X#define MAXOCTAL6 0777777 X X/* X * Non POSIX.1-1988 limit used by HP-UX tar for 8 byte devmajor/devminor X */ X#define MAXOCTAL8 077777777 X X X/* X * POSIX.1-1988 typeflag values X */ X#define REGTYPE '0' X#define AREGTYPE '\0' X#define LNKTYPE '1' X#define SYMTYPE '2' X#define CHRTYPE '3' X#define BLKTYPE '4' X#define DIRTYPE '5' X#define FIFOTYPE '6' X#define CONTTYPE '7' X X/* X * POSIX.1-2001 typeflag extensions. X * POSIX.1-2001 calls the extended USTAR format PAX although it is definitely X * derived from and based on USTAR. The reason may be that POSIX.1-2001 X * calls the tar program outdated and lists the pax program as the successor. X */ X#define LF_GHDR 'g' /* POSIX.1-2001 global extended header */ X#define LF_XHDR 'x' /* POSIX.1-2001 extended header */ X X/* X * star/gnu/Sun tar extensions: X */ X/* X * Note that the standards committee allows only capital A through X * capital Z for user-defined expansion. This means that defining something X * as, say '8' is a *bad* idea. X */ X X#define LF_ACL 'A' /* Solaris Access Control List */ X#define LF_DUMPDIR 'D' /* This is a dir entry that contains */ X /* the names of files that were in */ X /* the dir at the time the dump was made */ X X#define LF_EXTATTR 'E' /* Solaris Extended Attribute File */ X#define LF_META 'I' /* Inode (metadata only) no file content */ X#define LF_LONGLINK 'K' /* Identifies the NEXT file on the tape */ X /* as having a long linkname */ X X#define LF_LONGNAME 'L' /* Identifies the NEXT file on the tape */ X /* as having a long name. */ X X#define LF_MULTIVOL 'M' /* This is the continuation */ X /* of a file that began on another volume */ X X#define LF_NAMES 'N' /* For storing filenames that didn't */ X /* fit in 100 characters */ X X#define LF_SPARSE 'S' /* This is for sparse files */ X#define LF_VOLHDR 'V' /* This file is a tape/volume header */ X /* Ignore it on extraction */ X#define LF_VU_XHDR 'X' /* POSIX.1-2001 xtended (VU version) */ X X/* X * Definitions for the t_mode field X */ X#define TSUID 04000 /* Set UID on execution */ X#define TSGID 02000 /* Set GID on execution */ X#define TSVTX 01000 /* On directories, restricted deletion flag */ X#define TUREAD 00400 /* Read by owner */ X#define TUWRITE 00200 /* Write by owner special */ X#define TUEXEC 00100 /* Execute/search by owner */ X#define TGREAD 00040 /* Read by group */ X#define TGWRITE 00020 /* Write by group */ X#define TGEXEC 00010 /* Execute/search by group */ X#define TOREAD 00004 /* Read by other */ X#define TOWRITE 00002 /* Write by other */ X#define TOEXEC 00001 /* Execute/search by other */ X X#define TALLMODES 07777 /* The low 12 bits mentioned in the standard */ X X#define S_IRWALL (S_IRUSR|S_IWUSR | S_IRGRP|S_IWGRP | S_IROTH|S_IWOTH) X X/* X * This is the ustar (Posix 1003.1) header. X */ Xstruct header { X char t_name[NAMSIZ]; /* 0 Dateiname */ X char t_mode[8]; /* 100 Zugriffsrechte */ X char t_uid[8]; /* 108 Benutzernummer */ X char t_gid[8]; /* 116 Benutzergruppe */ X char t_size[12]; /* 124 Dateigroesze */ X char t_mtime[12]; /* 136 Zeit d. letzten Aenderung */ X char t_chksum[8]; /* 148 Checksumme */ X Uchar t_typeflag; /* 156 Typ der Datei */ X char t_linkname[NAMSIZ]; /* 157 Zielname des Links */ X char t_magic[TMAGLEN]; /* 257 "ustar" */ X char t_version[TVERSLEN]; /* 263 Version v. star */ X char t_uname[TUNMLEN]; /* 265 Benutzername */ X char t_gname[TGNMLEN]; /* 297 Gruppenname */ X char t_devmajor[8]; /* 329 Major bei Geraeten */ X char t_devminor[8]; /* 337 Minor bei Geraeten */ X char t_prefix[PFXSIZ]; /* 345 Prefix fuer t_name */ X /* 500 Ende */ X char t_mfill[12]; /* 500 Filler bis 512 */ X}; X X/* X * This is the ustar (Posix 1003.1) header with extended name arrays. X * Extended name arrays are needed to avoid compiler warnings for the code X * that deals with 100/155 byte names that are not null terminated. X */ Xstruct name_header { X char t_name[NAMSIZ+1]; /* 0 Dateiname */ X char t_res1[7]; /* 101 Reserved: t_mode Rest */ X char t_uid[8]; /* 108 Benutzernummer */ X char t_gid[8]; /* 116 Benutzergruppe */ X char t_size[12]; /* 124 Dateigroesze */ X char t_mtime[12]; /* 136 Zeit d. letzten Aenderung */ X char t_chksum[8]; /* 148 Checksumme */ X Uchar t_typeflag; /* 156 Typ der Datei */ X char t_linkname[NAMSIZ+1]; /* 157 Zielname des Links */ X char t_res2[TMAGLEN-1]; /* 258 Reserved: t_magic Rest */ X char t_version[TVERSLEN]; /* 263 Version v. star */ X char t_uname[TUNMLEN]; /* 265 Benutzername */ X char t_gname[TGNMLEN]; /* 297 Gruppenname */ X char t_devmajor[8]; /* 329 Major bei Geraeten */ X char t_devminor[8]; /* 337 Minor bei Geraeten */ X char t_prefix[PFXSIZ+1]; /* 345 Prefix fuer t_name */ X /* 501 Ende */ X char t_res3[11]; /* 501 Filler bis 512 */ X}; X X/* X * star header specific definitions X */ X#define STMAGIC "tar" /* star magic */ X#define STMAGLEN 4 /* "tar" including NULL byte */ X#define STVERSION '1' /* current star version */ X X#define STUNMLEN 16 /* star user name length */ X#define STGNMLEN 15 /* star group name length */ X X/* X * This is the old (pre Posix 1003.1-1988) star header defined in 1985. X */ Xstruct star_header { X char t_name[NAMSIZ]; /* 0 Dateiname */ X char t_mode[8]; /* 100 Zugriffsrechte */ X char t_uid[8]; /* 108 Benutzernummer */ X char t_gid[8]; /* 116 Benutzergruppe */ X char t_size[12]; /* 124 Dateigroesze */ X char t_mtime[12]; /* 136 Zeit d. letzten Aenderung */ X char t_chksum[8]; /* 148 Checksumme */ X Uchar t_linkflag; /* 156 Linktyp der Datei */ X char t_linkname[NAMSIZ]; /* 157 Zielname des Links */ X /* --- Ende historisches TAR */ X /* --- Anfang star Erweiterungen */ X char t_vers; /* 257 Version v. star */ X char t_filetype[8]; /* 258 Interner Dateityp */ X char t_type[12]; /* 266 Dateityp (UNIX) */ X#ifdef no_minor_bits_in_rdev X char t_rdev[12]; /* 278 Major/Minor bei Geraeten */ X#else X char t_rdev[11]; /* 278 Major/Minor bei Geraeten */ X char t_devminorbits; /* 298 Anzahl d. Minor Bits in t_rdev */ X#endif X char t_atime[12]; /* 290 Zeit d. letzten Zugriffs */ X char t_ctime[12]; /* 302 Zeit d. letzten Statusaend. */ X char t_uname[STUNMLEN]; /* 314 Benutzername */ X char t_gname[STGNMLEN]; /* 330 Gruppenname */ X char t_prefix[PFXSIZ]; /* 345 Prefix fuer t_name */ X char t_mfill[8]; /* 500 Filler bis magic */ X char t_magic[4]; /* 508 "tar" */ X}; X X/* X * This is the new (post Posix 1003.1-1988) xstar header defined in 1994. X * X * t_prefix[130] is garanteed to be '\0' to prevent ustar compliant X * implementations from failing. X * t_mfill & t_xmagic need to be zero for a 100% ustar compliant X * implementation, so setting t_xmagic to "tar" should X * be avoided in the future. X * X * A different method to recognise this format is to verify that X * t_prefix[130] is equal to '\0' and X * t_atime[0]/t_ctime[0] is an octal number and X * t_atime[11] is equal to ' ' and X * t_ctime[11] is equal to ' '. X * X * Note that t_atime[11]/t_ctime[11] may be changed in future. X */ Xstruct xstar_header { X char t_name[NAMSIZ]; /* 0 Dateiname */ X char t_mode[8]; /* 100 Zugriffsrechte */ X char t_uid[8]; /* 108 Benutzernummer */ X char t_gid[8]; /* 116 Benutzergruppe */ X char t_size[12]; /* 124 Dateigroesze */ X char t_mtime[12]; /* 136 Zeit d. letzten Aenderung */ X char t_chksum[8]; /* 148 Checksumme */ X Uchar t_typeflag; /* 156 Typ der Datei */ X char t_linkname[NAMSIZ]; /* 157 Zielname des Links */ X char t_magic[TMAGLEN]; /* 257 "ustar" */ X char t_version[TVERSLEN]; /* 263 Version v. star */ X char t_uname[TUNMLEN]; /* 265 Benutzername */ X char t_gname[TGNMLEN]; /* 297 Gruppenname */ X char t_devmajor[8]; /* 329 Major bei Geraeten */ X char t_devminor[8]; /* 337 Minor bei Geraeten */ X char t_prefix[131]; /* 345 Prefix fuer t_name */ X char t_atime[12]; /* 476 Zeit d. letzten Zugriffs */ X char t_ctime[12]; /* 488 Zeit d. letzten Statusaend. */ X char t_mfill[8]; /* 500 Filler bis magic */ X char t_xmagic[4]; /* 508 "tar" */ X}; X Xstruct sparse { X char t_offset[12]; X char t_numbytes[12]; X}; X X#define SPARSE_EXT_HDR 21 X#define SPARSE_IN_HDR 4 X#define SIH SPARSE_IN_HDR X#define SEH SPARSE_EXT_HDR X Xstruct xstar_in_header { X char t_fill[345]; /* 0 Everything before t_prefix */ X char t_prefix[1]; /* 345 Prefix fuer t_name */ X char t_fill2; /* 346 */ X char t_fill3[8]; /* 347 */ X char t_isextended; /* 355 */ X struct sparse t_sp[SIH]; /* 356 8 x 12 */ X char t_realsize[12]; /* 452 Echte Größe bei sparse Dateien */ X char t_offset[12]; /* 464 Offset für Multivol cont. Dateien */ X char t_atime[12]; /* 476 Zeit d. letzten Zugriffs */ X char t_ctime[12]; /* 488 Zeit d. letzten Statusaend. */ X char t_mfill[8]; /* 500 Filler bis magic */ X char t_xmagic[4]; /* 508 "tar" */ X}; X Xstruct xstar_ext_header { X struct sparse t_sp[SEH]; X char t_isextended; X}; X Xtypedef struct { X off_t sp_offset; X off_t sp_numbytes; X} sp_t; X X/* X * gnu tar header specific definitions X */ X X#define GMAGIC "ustar " /* gnu tar magic */ X#define GMAGLEN 8 /* "ustar" two blanks and a NULL */ X X/* X * This is the GNUtar header defined in 1989. X * X * The nonstandard stuff could not be found in in the first pubslished versions X * of the program. The first version I am aware of, is a program called SUGtar X * published at the Sun User Group meeting in december 1987, a different X * publishing of the same program which has been originally written by X * John Gilmore was called PDtar. In 1987 PDtar/SUGtar was implementing a true X * subset of the 1987 POSIX-1003 draft (missing only the long name splitting). X * X * FSF people then later added t_atime... making GNU tar non POSIX compliant. X * When FSF added the sparse file handling stuff, this was done in a way that X * even violates any tar document available since the late 1970's. X * X * GNU tar is not tar... X */ Xstruct gnu_header { X char t_name[NAMSIZ]; /* 0 Dateiname */ X char t_mode[8]; /* 100 Zugriffsrechte */ X char t_uid[8]; /* 108 Benutzernummer */ X char t_gid[8]; /* 116 Benutzergruppe */ X char t_size[12]; /* 124 Dateigroesze */ X char t_mtime[12]; /* 136 Zeit d. letzten Aenderung */ X char t_chksum[8]; /* 148 Checksumme */ X Uchar t_linkflag; /* 156 Typ der Datei */ X char t_linkname[NAMSIZ]; /* 157 Zielname des Links */ X char t_magic[8]; /* 257 "ustar" */ X char t_uname[TUNMLEN]; /* 265 Benutzername */ X char t_gname[TGNMLEN]; /* 297 Gruppenname */ X char t_devmajor[8]; /* 329 Major bei Geraeten */ X char t_devminor[8]; /* 337 Minor bei Geraeten */ X X /* X * Jay Fenlason (hack@ai.mit.edu) X * these following fields were added by JF for gnu X * and are NOT standard X */ X char t_atime[12]; /* 345 */ X char t_ctime[12]; /* 357 */ X char t_offset[12]; /* 369 */ X char t_longnames[4]; /* 381 */ X /* X * for the rest see struct gnu_in_header X */ X}; X Xstruct gnu_in_header { X char t_fill[386]; X struct sparse t_sp[SIH]; /* 386 4 sparse structures (2 x 12 bytes) */ X char t_isextended; /* 482 an extended header follows */ X char t_realsize[12]; /* 483 true size of the sparse file */ X}; X Xstruct gnu_extended_header { X struct sparse t_sp[SEH]; /* 0 21 sparse structures (2 x 12 bytes) */ X char t_isextended; /* 504 another extended header follows */ X}; X X#undef SIH X#undef SEH X X/* X * This is the Sun tar header used on SunOS-5.x. X */ Xstruct suntar_header { X char t_name[NAMSIZ]; /* 0 Dateiname */ X char t_mode[8]; /* 100 Zugriffsrechte */ X char t_uid[8]; /* 108 Benutzernummer */ X char t_gid[8]; /* 116 Benutzergruppe */ X char t_size[12]; /* 124 Dateigroesze */ X char t_mtime[12]; /* 136 Zeit d. letzten Aenderung */ X char t_chksum[8]; /* 148 Checksumme */ X Uchar t_typeflag; /* 156 Typ der Datei */ X char t_linkname[NAMSIZ]; /* 157 Zielname des Links */ X char t_magic[TMAGLEN]; /* 257 "ustar" */ X char t_version[TVERSLEN]; /* 263 Version v. star */ X char t_uname[TUNMLEN]; /* 265 Benutzername */ X char t_gname[TGNMLEN]; /* 297 Gruppenname */ X char t_devmajor[8]; /* 329 Major bei Geraeten */ X char t_devminor[8]; /* 337 Minor bei Geraeten */ X char t_prefix[PFXSIZ]; /* 345 Prefix fuer t_name */ X X /* Sun Erweiterungen: */ X char t_extno; /* 500 extent #, null if not split */ X char t_extotal; /* 501 total # of extents */ X char t_efsize[10]; /* 502 size of entire file */ X}; X X X#define BAR_UNSPEC '\0' /* XXX Volheader ??? */ X#define BAR_REGTYPE '0' X#define BAR_LNKTYPE '1' X#define BAR_SYMTYPE '2' X#define BAR_SPECIAL '3' X X#define BAR_VOLHEAD "V" /* The BAR Volume "magic" */ X X/* X * The Sun BAR header format as introduced with the Roadrunner Intel machines X * X * All header parts marked with "*VH" are set only in the volheader X * and zero on any other headers. X */ Xstruct bar_header { X char mode[8]; /* 0 file type and mode (top bit masked) */ X char uid[8]; /* 8 Benutzernummer */ X char gid[8]; /* 16 Benutzergruppe */ X char size[12]; /* 24 Dateigroesze */ X char mtime[12]; /* 36 Zeit d. letzten Aenderung */ X char t_chksum[8]; /* 48 Checksumme */ X char rdev[8]; /* 56 Major/Minor bei Geraeten */ X Uchar linkflag; /* 64 Linktyp der Datei */ X char bar_magic[2]; /* 65 *VH xxx */ X char volume_num[4]; /* 67 *VH Volume Nummer */ X char compressed; /* 71 *VH Compress Flag */ X char date[12]; /* 72 *VH Aktuelles Datum YYMMDDhhmm */ X char start_of_name[1]; /* 84 Dateiname */ X}; X Xtypedef union hblock { X char dummy[TBLOCK]; X long ldummy[TBLOCK/sizeof (long)]; /* force long alignement */ X struct star_header dbuf; X struct star_header star_dbuf; X struct xstar_header xstar_dbuf; X struct xstar_in_header xstar_in_dbuf; X struct xstar_ext_header xstar_ext_dbuf; X struct header ustar_dbuf; X struct name_header ndbuf; X struct gnu_header gnu_dbuf; X struct gnu_in_header gnu_in_dbuf; X struct gnu_extended_header gnu_ext_dbuf; X struct suntar_header suntar_dbuf; X struct bar_header bar_dbuf; X} TCB; X X/* X * Used for internal extended file attribute processing X */ Xtypedef struct star_xattr { X char *name; /* The name of the attribute */ X void *value; /* The asociated value */ X size_t value_len; /* The size of the attribute value */ X} star_xattr_t; X X/* X * Our internal OS independant structure to hold file metadata. X * X * Some remarks to the different file type structure members: X * X * f_xftype The new tar general (x-tended) file type. X * This includes values XT_LINK XT_SPARSE XT_LONGNAME ... X * X * f_rxftype The 'real' general file type. X * Doesn't include XT_LINK XT_SPARSE XT_LONGNAME ... X * This is the 'real' file type and close to what has been X * set up in getinfo(). X * X * f_filetype The coarse file type classification (star 1985 header) X * X * f_typeflag The file type flag used in the POSIX.1-1988 TAR header X * X * f_type The OS specific file type (e.g. UNIX st_mode & S_IFMT) X */ Xtypedef struct { X TCB *f_tcb; X char *f_sname; /* Zeiger auf den kurzen stat Dateinamen */ X char *f_name; /* Zeiger auf den langen Dateinamen */ X Ulong f_namelen; /* Länge des Dateinamens */ X char *f_lname; /* Zeiger auf den langen Linknamen */ X Ulong f_lnamelen; /* Länge des Linknamens */ X char *f_uname; /* User name oder NULL Pointer */ X Ulong f_umaxlen; /* Maximale Länge des Usernamens */ X char *f_gname; /* Group name oder NULL Pointer */ X Ulong f_gmaxlen; /* Maximale Länge des Gruppennamens */ X char *f_dir; /* Directory Inhalt */ X ino_t *f_dirinos; /* Inode Liste fuer Directory Inhalt */ X int f_dirlen; /* Extended strlen(f_dir)+1 */ X int f_dirents; /* # der Directory Eintraege */ X dev_t f_dev; /* Geraet auf dem sich d. Datei befindet */ X major_t f_devmaj; /* Major von f_dev */ X minor_t f_devmin; /* Minor bei f_dev */ X int f_devminorbits; /* Anzahl d. Minor Bits in f_dev */ X ino_t f_ino; /* Dateinummer */ X nlink_t f_nlink; /* Anzahl der Links */ X mode_t f_mode; /* Zugriffsrechte (TAR Bit Werte) */ X uid_t f_uid; /* Benutzernummer */ X gid_t f_gid; /* Benutzergruppe */ X off_t f_size; /* Dateigroesze */ X off_t f_rsize; /* Dateigroesze auf Band */ X off_t f_contoffset; /* Offset für Multivol cont. Dateien */ X Ullong f_llsize; /* Dateigroesze wenn off_t zu kein */ X Ulong f_flags; /* Bearbeitungshinweise */ X Ulong f_xflags; /* Flags für x-header */ X Ulong f_xftype; /* Header Dateityp (neu generell) */ X Ulong f_rxftype; /* Echter Dateityp (neu generell) */ X Ulong f_filetype; /* Typ der Datei (star alt) */ X Uchar f_typeflag; /* Kopie aus TAR Header */ X mode_t f_type; /* Dateityp aus UNIX struct stat */ X#ifdef NEW_RDEV X dev_t f_rdev; /* Major/Minor bei Geraeten */ X major_t f_rdevmaj; /* Major bei Geraeten */ X minor_t f_rdevmin; /* Minor bei Geraeten */ X#else X Ulong f_rdev; /* Major/Minor bei Geraeten */ X Ulong f_rdevmaj; /* Major bei Geraeten */ X Ulong f_rdevmin; /* Minor bei Geraeten */ X#endif X time_t f_atime; /* Zeit d. letzten Zugriffs */ X long f_ansec; /* nsec Teil " */ X time_t f_mtime; /* Zeit d. letzten Aenderung */ X long f_mnsec; /* nsec Teil " */ X time_t f_ctime; /* Zeit d. letzten Statusaend. */ X long f_cnsec; /* nsec Teil " */ X long f_timeres; /* Time stamp resolution */ X Ulong f_fflags; /* File flags */ X#ifdef USE_ACL X#ifdef HAVE_ST_ACLCNT X int f_aclcnt; X#endif X char *f_acl_access; /* POSIX Draft Access Control List */ X char *f_acl_default; /* POSIX Draft Default ACL */ X char *f_acl_ace; /* NFSv4 Access Control List */ X#endif X#ifdef USE_XATTR X star_xattr_t *f_xattr; /* Extended File Attributes */ X#endif X /* X * These two members must be last, so we are able to copy everything X * before, e.g. for the options -newest and -newest-file. X */ X pathstore_t f_pname; /* Verwaltung für f_name */ X pathstore_t f_plname; /* Verwaltung für f_lname */ X X} FINFO; X X/* X * We use offsetof(FINFO, f_pname) to compute the size of the first part X * of FINFO that may be copied without breaking things. This is needed for X * e.g. the options -newest and -newest-file. X */ X#ifndef offsetof X#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) X#endif X X#define init_finfo(fip) (fip)->f_flags = 0, (fip)->f_xflags = 0 X X/* X * Used with f_flags X */ X#define F_LONGNAME 0x01 /* Langer Name passt nicht in Header */ X#define F_LONGLINK 0x02 /* Langer Linkname passt nicht in Header */ X#define F_SPLIT_NAME 0x04 /* Langer Name wurde gesplitted */ X#define F_HAS_NAME 0x08 /* Langer Name in f_name/f_lname soll bl. */ X#define F_SPARSE 0x10 /* Datei enthält Löcher */ X#define F_TCB_BUF 0x20 /* TCB ist/war vom Buffer alloziert */ X#define F_ADDSLASH 0x40 /* Langer Name benötigt Slash am Ende */ X#define F_NSECS 0x80 /* stat() liefert Nanosekunden */ X#define F_NODUMP 0x100 /* Datei hat OS spezifisches NODUMP flag */ X#define F_EXTRACT 0x200 /* Bearbeitung im 'extract' Modus */ X#define F_CRC 0x400 /* CPIO CRC für Datei berechnen */ X#define F_BAD_SIZE 0x1000 /* Bad size data detected */ X#define F_BAD_META 0x2000 /* Bad meta data detected */ X#define F_BAD_UID 0x4000 /* Bad uid value detected */ X#define F_BAD_GID 0x8000 /* Bad gid value detected */ X#define F_SP_EXTENDED 0x10000 /* Extended sparse area found */ X#define F_SP_SKIPPED 0x20000 /* Extended sparse area already skipped */ X#define F_FORCE_ADD 0x40000 /* Force take_file() to add the file */ X#define F_SAME 0x80000 /* Same symlink of special found */ X#define F_DATA_SKIPPED 0x100000 /* The data part of the file was skipped */ X#define F_BAD_ACL 0x200000 /* Unsupported ACL encoding type */ X#define F_ALL_HOLE 0x400000 /* File is sparse, one hole with no data */ X X/* X * Used with f_xflags X */ X#define XF_ATIME 0x0001 /* Zeit d. letzten Zugriffs */ X#define XF_CTIME 0x0002 /* Zeit d. letzten Statusaend. */ X#define XF_MTIME 0x0004 /* Zeit d. letzten Aenderung */ X#define XF_COMMENT 0x0008 /* Beliebiger Kommentar */ X#define XF_UID 0x0010 /* Benutzernummer */ X#define XF_UNAME 0x0020 /* Langer Benutzername */ X#define XF_GID 0x0040 /* Benutzergruppe */ X#define XF_GNAME 0x0080 /* Langer Benutzergruppenname */ X#define XF_PATH 0x0100 /* Langer Name */ X#define XF_LINKPATH 0x0200 /* Langer Link Name */ X /* Dateigröße auf Band (f_rsize) */ X#define XF_SIZE 0x0400 /* Dateigröße wenn > 8 GB */ X#define XF_CHARSET 0x0800 /* Zeichensatz für Dateiinhalte */ X X#define XF_DEVMAJOR 0x1000 /* Major bei Geräten */ X#define XF_DEVMINOR 0x2000 /* Major bei Geräten */ X X#define XF_ACL_ACCESS 0x04000 /* POSIX Draft Access Control List */ X#define XF_ACL_DEFAULT 0x08000 /* POSIX Draft Default ACL */ X#define XF_ACL_ACE 0x10000 /* NFSv4 Access Control List */ X X#define XF_FFLAGS 0x20000 /* File flags */ X /* Echte Dateigröße (f_size) */ X#define XF_REALSIZE 0x40000 /* Dateigröße wenn > 8 GB */ X#define XF_OFFSET 0x80000 /* Multi Volume Offset */ X#define XF_XATTR 0x100000 /* Extended Attributes */ X X#define XF_NOTIME 0x10000000 /* Keine extended Zeiten */ X#define XF_BINARY 0x20000000 /* Binary path/usr/group in x-header */ X X/* X * All Extended header tags that are covered by POSIX.1-2001 X */ X#define XF_POSIX (XF_ATIME|XF_CTIME|XF_MTIME|XF_COMMENT|\ X XF_UID|XF_UNAME|XF_GID|XF_GNAME|\ X XF_PATH|XF_LINKPATH|XF_SIZE|XF_CHARSET) X X/* X * Used with f_filetype X * X * This is optimised for the old star (1986) extensions that were the first X * tar extensions which allowed to archive files different from regular files, X * directories and symbolic links. X */ X#define F_SPEC 0 /* Anything not mentioned below */ X#define F_FILE 1 /* A reguar file */ X#define F_SLINK 2 /* A symbolic link */ X#define F_DIR 3 /* A directory */ X X#define is_special(i) ((i)->f_filetype == F_SPEC) X#define is_file(i) ((i)->f_filetype == F_FILE) X#define is_symlink(i) ((i)->f_filetype == F_SLINK) X#define is_dir(i) ((i)->f_filetype == F_DIR) X X#define is_cont(i) ((i)->f_xftype == XT_CONT) X#define is_bdev(i) ((i)->f_xftype == XT_BLK) X#define is_cdev(i) ((i)->f_xftype == XT_CHR) X#define is_dev(i) (is_bdev(i) || is_cdev(i)) X#define is_fifo(i) ((i)->f_xftype == XT_FIFO) X#define is_door(i) ((i)->f_xftype == XT_DOOR) X#define is_link(i) ((i)->f_xftype == XT_LINK) X#define fis_link(i) ((i)->f_rxftype == XT_LINK) /* Filetype unknown */ X#define is_volhdr(i) ((i)->f_xftype == XT_VOLHDR) X#define is_sparse(i) ((i)->f_xftype == XT_SPARSE) X#define is_multivol(i) ((i)->f_xftype == XT_MULTIVOL) X#define is_whiteout(i) ((i)->f_xftype == XT_WHT) X#define is_meta(i) ((i)->f_xftype == XT_META) X#define fis_meta(i) ((i)->f_rxftype == XT_META) /* Really "regular" */ X X#define is_a_file(i) (is_file(i) || is_cont(i)) X/* X * Defines for bad stat.st_mode, stat.st_uid and stat.st_gid X */ X#define _BAD_MODE ((mode_t)-1) X#define _BAD_UID ((gid_t)-1) X#define _BAD_GID ((gid_t)-1) X X/* X * The global info structure holds volume header related information X */ Xtypedef struct { X char *label; /* Volume label */ X char *hostname; /* Hostname where the dump is from */ X char *filesys; /* Mount point of the dump */ X char *cwd; /* Working directory if != filesys */ X char *device; /* Device for mount point */ X char *release; /* Release string from creating tar */ X int archtype; /* Archive type from 'g'lobal header */ X int dumptype; /* Dump type see below */ X int dumplevel; /* Level of this dump */ X int reflevel; /* Level this dump refers to */ X struct timespec dumpdate; /* Date of this dump */ X struct timespec refdate; /* Date this dump refers to */ X int volno; /* Volume number starting with 1 */ X Ullong tapesize; /* Tape size in 512 byte units */ X Ullong blockoff; /* 512 byte based offset within all */ X int blocksize; /* Block size in 512 byte units */ X Int32_t gflags; X} GINFO; X X/* X * Defines for dumptype X */ X#define DT_UNKN -1 /* DT_UNKNOWN used in BSD */ X#define DT_NONE 0 X#define DT_PARTIAL 1 X#define DT_FULL 2 X X/* X * Defines for gflags X */ X#define GF_LABEL 0x0001 X#define GF_HOSTNAME 0x0002 X#define GF_FILESYS 0x0004 X#define GF_CWD 0x0008 X#define GF_DEVICE 0x0010 X#define GF_RELEASE 0x0020 X#define GF_ARCHTYPE 0x0040 X#define GF_DUMPTYPE 0x0080 X#define GF_DUMPLEVEL 0x0100 X#define GF_REFLEVEL 0x0200 X#define GF_DUMPDATE 0x0400 X#define GF_REFDATE 0x0800 X#define GF_VOLNO 0x1000 X#define GF_BLOCKOFF 0x2000 X#define GF_BLOCKSIZE 0x4000 X#define GF_TAPESIZE 0x8000 X#define GF_MINIT 0x10000000 /* Structure initialized from media */ X#define GF_NOALLOC 0x20000000 /* Strings in struct not allocated */ X X X#ifdef isdigit X#undef isdigit /* Needed for HP-UX */ X#endif X#define isdigit(c) ((c) >= '0' && (c) <= '9') X#define isoctal(c) ((c) >= '0' && (c) <= '7') X#ifdef isupper X#undef isupper /* Needed for HP-UX */ X#endif X#define isupper(c) ((c) >= 'A' && (c) <= 'Z') X#define toupper(c) (isupper(c) ? (c) : (c) - ('a' - 'A')) X/* X * Needed for QNX X */ X#ifdef max X#undef max X#endif X#ifdef min X#undef min X#endif X#define max(a, b) ((a) < (b) ? (b) : (a)) X#define min(a, b) ((a) < (b) ? (a) : (b)) X X Xstruct star_stats { X int s_staterrs; /* Could not stat(2) file */ X#ifdef USE_ACL X int s_getaclerrs; /* Could not get ACL for file */ X#endif X int s_openerrs; /* Open/Create error for file */ X int s_rwerrs; /* Read/Write error from file */ X int s_sizeerrs; /* File changed size */ X int s_misslinks; /* Missing links to file */ X int s_toolong; /* File name too long */ X int s_toobig; /* File does not fit on one tape */ X int s_isspecial; /* File is special - not dumped */ X#ifdef USE_XATTR X int s_getxattr; /* get xattr for file failed */ X#endif X int s_chdir; /* chdir() failed */ X int s_iconv; /* iconv() failed */ X int s_id; /* uid/gid range error */ X int s_time; /* time range error */ X /* X * Extract only.... X */ X int s_settime; /* utimes() on file failed */ X int s_setmodes; /* chmod() on file failed */ X int s_security; /* skipped for security reasons */ X int s_lsecurity; /* link skipped for security reasons */ X int s_samefile; /* skipped from/to are identical */ X#ifdef USE_ACL X int s_badacl; /* ACL could not be converted */ X int s_setacl; /* set ACL for file failed */ X#endif X#ifdef USE_XATTR X int s_setxattr; /* set xattr for file failed */ X#endif X int s_restore; /* other incremental restore specific */ X int s_compress; /* compress specific failures */ X int s_hardeof; /* Hard EOF on input */ X int s_substerrs; /* Problems while executing -s/from/to/ */ X int s_selinuxerrs; /* Problems setting SEL security context */ X}; X Xextern struct star_stats xstats; X X X#include X X#if !defined(PATH_MAX) && defined(MAXPATHLEN) X#define PATH_MAX MAXPATHLEN X#endif X X#ifndef PATH_MAX X#define PATH_MAX 1024 X#endif X X/* X * Make sure that regardless what the OS defines, star reserves X * space for 1024 chars in filenames. X */ X#if PATH_MAX < 1024 X#undef PATH_MAX X#define PATH_MAX 1024 X#endif X X/* X * Hack to do debugging with larger values of PATH_MAX. X */ X#if MY_PATH_MAX > PATH_MAX X#undef PATH_MAX X#define PATH_MAX MY_PATH_MAX X#endif X X#ifdef HAVE_LARGEFILES X/* X * XXX Hack until fseeko()/ftello() are available everywhere or until X * XXX we know a secure way to let autoconf ckeck for fseeko()/ftello() X * XXX without defining FILE_OFFSETBITS to 64 in confdefs.h X */ X#define fseek fseeko X#define ftell ftello X#endif X X#if !(defined(USE_XATTR) && \ X defined(HAVE_LISTXATTR) && defined(HAVE_GETXATTR)) X#undef USE_SELINUX X#endif X#if !defined(HAVE_SELINUX_SELINUX_H) || !defined(HAVE_IS_SELINUX_ENABLED) X#undef USE_SELINUX X#endif X#ifdef USE_SELINUX X#include X#endif X X X#ifdef __cplusplus X} X#endif X X#endif /* _STAR_H */ END-of-star-1.6/star/star.h echo x - star-1.6/star/star_unix.c sed 's/^X//' >star-1.6/star/star_unix.c << 'END-of-star-1.6/star/star_unix.c' X/* @(#)star_unix.c 1.118 19/03/11 Copyright 1985, 1995, 2001-2019 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)star_unix.c 1.118 19/03/11 Copyright 1985, 1995, 2001-2019 J. Schilling"; X#endif X/* X * Stat / mode / owner routines for unix like X * operating systems X * X * Copyright (c) 1985, 1995, 2001-2019 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#ifndef HAVE_UTIMES X#define utimes __nothing__ /* BeOS has no utimes() but wrong prototype */ X#endif X#include X#include X#include "star.h" X#include "props.h" X#include "table.h" X#include X#include X#include X#include /* For AT_FDCWD */ X#include X#include /* For DEV_BSIZE */ X#include X#include X#define GT_COMERR /* #define comerr gtcomerr */ X#define GT_ERROR /* #define error gterror */ X#include X#include "dirtime.h" X#include "xutimes.h" X#ifndef HAVE_UTIMES X#undef utimes X#endif X#include "starsubs.h" X#include "checkerr.h" X X#ifndef HAVE_LSTAT X#define lstat stat X#undef AT_SYMLINK_NOFOLLOW X#define AT_SYMLINK_NOFOLLOW 0 X#endif X#ifndef HAVE_LCHOWN X#define lchown chown X#endif X X#if S_ISUID == TSUID && S_ISGID == TSGID && S_ISVTX == TSVTX && \ X S_IRUSR == TUREAD && S_IWUSR == TUWRITE && S_IXUSR == TUEXEC && \ X S_IRGRP == TGREAD && S_IWGRP == TGWRITE && S_IXGRP == TGEXEC && \ X S_IROTH == TOREAD && S_IWOTH == TOWRITE && S_IXOTH == TOEXEC X X#define HAVE_POSIX_MODE_BITS /* st_mode bits are equal to TAR mode bits */ X#endif X X#define ROOT_UID 0 X Xextern uid_t my_uid; Xextern dev_t curfs; Xextern BOOL noatime; Xextern BOOL nomtime; Xextern BOOL nochown; Xextern BOOL pflag; Xextern BOOL follow; Xextern BOOL paxfollow; Xextern BOOL nodump; Xextern BOOL doacl; Xextern BOOL doxattr; Xextern BOOL dolxattr; Xextern BOOL dofflags; X XEXPORT BOOL _getinfo __PR((char *name, FINFO *info)); XEXPORT BOOL _lgetinfo __PR((char *name, FINFO *info)); XEXPORT BOOL getinfo __PR((char *name, FINFO *info)); X#ifdef HAVE_FSTATAT XEXPORT BOOL getinfoat __PR((int fd, char *name, FINFO *info)); X#endif XEXPORT BOOL stat_to_info __PR((int fd, struct stat *sp, FINFO *info)); XLOCAL void print_badnsec __PR((FINFO *info, char *name, long val)); XEXPORT void checkarch __PR((FILE *f)); XEXPORT BOOL archisnull __PR((const char *name)); XEXPORT BOOL samefile __PR((FILE *fp1, FILE *fp2)); XEXPORT void setmodes __PR((FINFO *info)); XLOCAL int sutimes __PR((char *name, FINFO *info, BOOL asymlink)); XEXPORT int snulltimes __PR((char *name, FINFO *info)); XEXPORT int sxsymlink __PR((char *name, FINFO *info)); XEXPORT int rs_acctime __PR((int fd, FINFO *info)); XEXPORT void setdirmodes __PR((char *name, mode_t mode)); XEXPORT mode_t osmode __PR((mode_t tarmode)); X#ifdef HAVE_POSIX_MODE_BITS /* st_mode bits are equal to TAR mode bits */ X#else XLOCAL int dolchmodat __PR((char *name, mode_t tarmode, int flag)); X#endif X X#ifdef HAVE_POSIX_MODE_BITS /* st_mode bits are equal to TAR mode bits */ X#else X#define lchmodat dolchmodat X#endif X X#ifdef USE_ACL X X#ifdef OWN_ACLTEXT X#if defined(UNIXWARE) && defined(HAVE_ACL) X#define HAVE_SUN_ACL X#define HAVE_ANY_ACL X#endif X#endif X/* X * HAVE_ANY_ACL currently includes HAVE_POSIX_ACL and HAVE_SUN_ACL. X * This definition must be in sync with the definition in acl_unix.c X * As USE_ACL is used in star.h, we are not allowed to change the X * value of USE_ACL before we did include star.h or we may not include X * star.h at all. X * HAVE_HP_ACL is currently not included in HAVE_ANY_ACL. X */ X#ifndef HAVE_ANY_ACL X#undef USE_ACL /* Do not try to get or set ACLs */ X#endif X#endif X X/* X * Simple getinfo() variant. X */ XEXPORT BOOL X_getinfo(name, info) X char *name; X register FINFO *info; X{ X BOOL ret; X BOOL odoacl = doacl; X BOOL odoxattr = doxattr; X BOOL odolxattr = dolxattr; X X doacl = FALSE; X doxattr = FALSE; X ret = getinfo(name, info); X doacl = odoacl; X doxattr = odoxattr; X dolxattr = odolxattr; X X return (ret); X} X X/* X * Simple getinfo() variant using lstat() X */ XEXPORT BOOL X_lgetinfo(name, info) X char *name; X register FINFO *info; X{ X BOOL ret; X BOOL ofollow = follow; X BOOL opaxfollow = paxfollow; X X /* X * Always use lstat() X */ X follow = FALSE; X paxfollow = FALSE; X ret = _getinfo(name, info); X follow = ofollow; X paxfollow = opaxfollow; X X return (ret); X} X XEXPORT BOOL Xgetinfo(name, info) X char *name; X register FINFO *info; X{ X struct stat stbuf; X X info->f_filetype = -1; /* Will be overwritten if stat() works */ Xnewstat: X if (paxfollow) { X if (lstatat(name, &stbuf, 0 /* stat */) < 0) { X if (geterrno() == EINTR) X goto newstat; X if (geterrno() != ENOENT) X return (FALSE); X X while (lstatat(name, &stbuf, AT_SYMLINK_NOFOLLOW) < 0) { X if (geterrno() != EINTR) X return (FALSE); X } X } X } else if (lstatat(name, &stbuf, follow?0:AT_SYMLINK_NOFOLLOW) < 0) { X if (geterrno() == EINTR) X goto newstat; X return (FALSE); X } X info->f_sname = info->f_name = name; X return (stat_to_info(AT_FDCWD, &stbuf, info)); X} X X#ifdef HAVE_FSTATAT XEXPORT BOOL Xgetinfoat(fd, name, info) X int fd; X char *name; X register FINFO *info; X{ X struct stat stbuf; X X info->f_filetype = -1; /* Will be overwritten if stat() works */ Xnewstat: X if (paxfollow) { X if (fstatat(fd, name, &stbuf, 0 /* stat */) < 0) { X if (geterrno() == EINTR) X goto newstat; X if (geterrno() != ENOENT) X return (FALSE); X X while (fstatat(fd, name, &stbuf, AT_SYMLINK_NOFOLLOW) < 0) { X if (geterrno() != EINTR) X return (FALSE); X } X } X } else if (fstatat(fd, name, &stbuf, follow?0:AT_SYMLINK_NOFOLLOW) < 0) { X if (geterrno() == EINTR) X goto newstat; X return (FALSE); X } X info->f_sname = info->f_name = name; X return (stat_to_info(fd, &stbuf, info)); X} X#endif X XEXPORT BOOL Xstat_to_info(fd, sp, info) X int fd; X struct stat *sp; X FINFO *info; X{ X BOOL first = TRUE; X Xagain: X info->f_uname = info->f_gname = NULL; X info->f_umaxlen = info->f_gmaxlen = 0L; X info->f_dev = sp->st_dev; X if (curfs == NODEV) X curfs = info->f_dev; X info->f_ino = sp->st_ino; X info->f_nlink = sp->st_nlink; X#ifdef HAVE_POSIX_MODE_BITS /* st_mode bits are equal to TAR mode bits */ X info->f_mode = sp->st_mode & 07777; X#else X /* X * The unexpected case when the S_I* OS mode bits do not match X * the T* mode bits from tar. X */ X { register mode_t m = sp->st_mode; X X info->f_mode = ((m & S_ISUID ? TSUID : 0) X | (m & S_ISGID ? TSGID : 0) X | (m & S_ISVTX ? TSVTX : 0) X | (m & S_IRUSR ? TUREAD : 0) X | (m & S_IWUSR ? TUWRITE : 0) X | (m & S_IXUSR ? TUEXEC : 0) X | (m & S_IRGRP ? TGREAD : 0) X | (m & S_IWGRP ? TGWRITE : 0) X | (m & S_IXGRP ? TGEXEC : 0) X | (m & S_IROTH ? TOREAD : 0) X | (m & S_IWOTH ? TOWRITE : 0) X | (m & S_IXOTH ? TOEXEC : 0)); X } X#endif X info->f_uid = sp->st_uid; X info->f_gid = sp->st_gid; X info->f_size = (off_t)0; /* Size of file */ X info->f_rsize = (off_t)0; /* Size on tape */ X info->f_flags = 0L; X info->f_xflags = props.pr_xhdflags; X info->f_typeflag = 0; X info->f_type = sp->st_mode & ~07777; X X if (sizeof (sp->st_rdev) == sizeof (short)) { X info->f_rdev = (Ushort) sp->st_rdev; X } else if ((sizeof (int) != sizeof (long)) && X (sizeof (sp->st_rdev) == sizeof (int))) { X info->f_rdev = (Uint) sp->st_rdev; X } else { X info->f_rdev = (Ulong) sp->st_rdev; X } X info->f_rdevmaj = major(info->f_rdev); X info->f_rdevmin = minor(info->f_rdev); X info->f_atime = sp->st_atime; X info->f_mtime = sp->st_mtime; X info->f_ctime = sp->st_ctime; X X info->f_ansec = stat_ansecs(sp); X info->f_mnsec = stat_mnsecs(sp); X info->f_cnsec = stat_cnsecs(sp); X X info->f_timeres = 1; X X#if defined(_FOUND_STAT_NSECS_) X info->f_flags |= F_NSECS; X#ifdef HAVE_ST_FSTYPE X if (sp->st_fstype[0] == 'p' && streql(sp->st_fstype, "pcfs")) X info->f_flags &= ~F_NSECS; X if (sp->st_fstype[0] == 'u' && X sp->st_fstype[1] == 'f' && X sp->st_fstype[2] == 's') X info->f_timeres = 1000; X#endif X#endif X X if (info->f_ansec < 0 || info->f_ansec >= 1000000000L) { X print_badnsec(info, "atime", info->f_ansec); X info->f_ansec = 0; X } X if (info->f_mnsec < 0 || info->f_mnsec >= 1000000000L) { X print_badnsec(info, "mtime", info->f_mnsec); X info->f_mnsec = 0; X } X if (info->f_cnsec < 0 || info->f_cnsec >= 1000000000L) { X print_badnsec(info, "ctime", info->f_cnsec); X info->f_cnsec = 0; X } X X#ifdef HAVE_ST_FLAGS X /* X * The *BSD based method is easy to handle. X */ X if (dofflags) X info->f_fflags = sp->st_flags; X else X info->f_fflags = 0L; X if (info->f_fflags != 0) X info->f_xflags |= XF_FFLAGS; X#ifdef UF_NODUMP /* The *BSD 'nodump' flag */ X if ((sp->st_flags & UF_NODUMP) != 0) X info->f_flags |= F_NODUMP; /* Convert it to star flag */ X#endif X#else /* !HAVE_ST_FLAGS */ X /* X * The non *BSD case... X */ X#ifdef USE_FFLAGS X if ((nodump || dofflags) && !S_ISLNK(sp->st_mode)) { X get_fflags(info); X if (!dofflags) X info->f_xflags &= ~XF_FFLAGS; X } else { X info->f_fflags = 0L; X } X#else X info->f_fflags = 0L; X#endif X#endif X X#ifdef HAVE_ST_ACLCNT X info->f_aclcnt = sp->st_aclcnt; X#endif X X switch ((int)(sp->st_mode & S_IFMT)) { X X case S_IFREG: /* regular file */ X info->f_filetype = F_FILE; X info->f_xftype = XT_FILE; X info->f_rsize = info->f_size = sp->st_size; X info->f_rdev = 0; X info->f_rdevmaj = 0; X info->f_rdevmin = 0; X break; X#ifdef S_IFCTG X case S_IFCTG: /* contiguous file */ X info->f_filetype = F_FILE; X info->f_xftype = XT_CONT; X info->f_rsize = info->f_size = sp->st_size; X info->f_rdev = 0; X info->f_rdevmaj = 0; X info->f_rdevmin = 0; X break; X#endif X case S_IFDIR: /* directory */ X info->f_filetype = F_DIR; X info->f_xftype = XT_DIR; X info->f_rdev = 0; X info->f_rdevmaj = 0; X info->f_rdevmin = 0; X info->f_dir = NULL; /* No directory content known */ X info->f_dirinos = NULL; /* No inode list known */ X info->f_dirlen = 0; X info->f_dirents = 0; X break; X#ifdef S_IFLNK X case S_IFLNK: /* symbolic link */ X info->f_filetype = F_SLINK; X info->f_xftype = XT_SLINK; X info->f_rdev = 0; X info->f_rdevmaj = 0; X info->f_rdevmin = 0; X break; X#endif X#ifdef S_IFCHR X case S_IFCHR: /* character special */ X info->f_filetype = F_SPEC; X info->f_xftype = XT_CHR; X break; X#endif X#ifdef S_IFBLK X case S_IFBLK: /* block special */ X info->f_filetype = F_SPEC; X info->f_xftype = XT_BLK; X break; X#endif X#ifdef S_IFIFO X case S_IFIFO: /* fifo */ X info->f_filetype = F_SPEC; X info->f_xftype = XT_FIFO; X info->f_rdev = 0; X info->f_rdevmaj = 0; X info->f_rdevmin = 0; X break; X#endif X#ifdef S_IFSOCK X case S_IFSOCK: /* socket */ X info->f_filetype = F_SPEC; X info->f_xftype = XT_SOCK; X break; X#endif X#ifdef S_IFNAM X case S_IFNAM: /* Xenix named file */ X info->f_filetype = F_SPEC; X X /* X * 'st_rdev' field is really the subtype X * As S_INSEM & S_INSHD we may safely cast X * sp->st_rdev to int. X */ X switch ((int)sp->st_rdev) { X case S_INSEM: X info->f_xftype = XT_NSEM; X break; X case S_INSHD: X info->f_xftype = XT_NSHD; X break; X default: X info->f_xftype = XT_BAD; X break; X } X break; X#endif X#ifdef S_IFMPC X case S_IFMPC: /* multiplexed character special */ X info->f_filetype = F_SPEC; X info->f_xftype = XT_MPC; X break; X#endif X#ifdef S_IFMPB X case S_IFMPB: /* multiplexed block special */ X info->f_filetype = F_SPEC; X info->f_xftype = XT_MPB; X break; X#endif X#ifdef S_IFDOOR X case S_IFDOOR: /* door */ X info->f_filetype = F_SPEC; X info->f_xftype = XT_DOOR; X break; X#endif X#ifdef S_IFWHT X case S_IFWHT: /* whiteout */ X info->f_filetype = F_SPEC; X info->f_xftype = XT_WHT; X break; X#endif X X default: /* any other unknown file type */ X if ((sp->st_mode & S_IFMT) == 0) { X /* X * If we come here, we either did not yet X * realize that somebody created a new file X * type with a value of 0 or the system did X * return an "unallocated file" with lstat(). X * The latter happens if we are on old Solaris X * systems that did not yet add SOCKETS again. X * if somebody mounted a filesystem that X * has been written with a *BSD system like X * SunOS 4.x and this FS holds a socket we get X * a pseudo unallocated file... X */ X info->f_filetype = F_SPEC; /* ??? */ X info->f_xftype = XT_NONE; X } else { X /* X * We don't know this file type! X */ X info->f_filetype = F_SPEC; X info->f_xftype = XT_BAD; X } X } X info->f_rxftype = info->f_xftype; X X if (first && pr_unsuptype(info)) { X first = FALSE; X if (fd == AT_FDCWD) { X /* X * Cannot use fstatat() as this may be a very long X * path name. X */ X if (lstatat(info->f_sname, sp, AT_SYMLINK_NOFOLLOW) < 0) X return (FALSE); X } else { X if (fstatat(fd, info->f_sname, sp, AT_SYMLINK_NOFOLLOW) < 0) X return (FALSE); X } X goto again; X } X X#ifdef HAVE_ST_BLOCKS X/* X * The blocking factor for st_blocks is DEV_BSIZE fro sys/param.h X */ X#if defined(hpux) || defined(__hpux) X if (info->f_size > (sp->st_blocks * 1024 + 1024)) { X#else X if (info->f_size > (sp->st_blocks * 512 + 512)) { X#endif X info->f_flags |= F_SPARSE; X X#ifdef __no_longer__ X /* X * Some filesystems do not allocate disk space for files that X * consist of one hole and no written data. X * If we are on a platform that does not support to read hole X * lists for sparse files, this allows to avoid wasting time X * reading through the whole file. X * X * In October 2013, it turned out that at least NetAPP stores X * files up to 64 bytes in the inode and then returns X * sp->st_blocks == 0 for a non sparse file. We only come here X * if the file size is > DEV_BSIZE in hope that noone will X * implement a filesystem that hides larger amount of data X * without supporting SEEK_HOLE. X * X * Update: There seems to be a major problem in btrfs: X * There was a report that btrfs reports sp->st_blocks == 0 X * for a file with an 8 GB hole followed by 512 bytes of 'A'. X * While this is most likely a btrfs bug, in theory a X * filesystem could compress the data past the hole and hold X * the compressed data inside the inode. As a result, we needed X * to disable the F_ALL_HOLE check. X */ X if ((info->f_size > 0) && (sp->st_blocks == 0)) X info->f_flags |= F_ALL_HOLE; X#endif X } X#endif X X /* X * Only look for ACL's and other properties that go into the POSIX X * extended heaer if extended headers are allowed with the current X * archive format. Also don't include ACL's and other properties if X * we are creating a Sun vendor unique variant of the extended headers. X * Sun's tar will not grok access control lists and other extensions. X */ X if ((props.pr_flags & PR_XHDR) == 0 || (props.pr_xc != 'x')) X return (TRUE); X#ifdef USE_ACL X /* X * If we return (FALSE) here, the file would not be archived at all. X * This is not what we want, so ignore return code from get_acls(). X */ X X /* X * Note: ACL check/fetch has been moved to create.c::take_file() X * for performance reasons. X */ X#endif /* USE_ACL */ X X#ifdef USE_XATTR X if (dolxattr) X (void) get_xattr(info); X#endif X X return (TRUE); X} X XLOCAL void Xprint_badnsec(info, name, val) X FINFO *info; X char *name; X long val; X{ X errmsgno(EX_BAD, "Bad '%s' nanosecond value %ld for '%s'.\n", X name, val, info->f_name); X} X X XEXPORT void Xcheckarch(f) X FILE *f; X{ X struct stat stbuf; X extern dev_t tape_dev; X extern ino_t tape_ino; X extern BOOL tape_isreg; X X tape_isreg = FALSE; X tape_dev = (dev_t)0; X tape_ino = (ino_t)0; X X if (fstat(fdown(f), &stbuf) < 0) X return; X X if (S_ISREG(stbuf.st_mode)) { X tape_dev = stbuf.st_dev; X tape_ino = stbuf.st_ino; X tape_isreg = TRUE; X } else if (((stbuf.st_mode & S_IFMT) == 0) || X S_ISFIFO(stbuf.st_mode) || X S_ISSOCK(stbuf.st_mode)) { X /* X * This is a pipe or similar on different UNIX implementations. X * (stbuf.st_mode & S_IFMT) == 0 may happen in stange cases. X */ X tape_dev = NODEV; X tape_ino = (ino_t)-1; X } X} X XEXPORT BOOL Xarchisnull(name) X const char *name; X{ X struct stat stbuf; X struct stat stnull; X X if (name == NULL) X return (FALSE); X X if (streql(name, "-")) { X if (fstat(fdown(stdout), &stbuf) < 0) X return (FALSE); X } else { X if (stat(name, &stbuf) < 0) X return (FALSE); X } X if (stat("/dev/null", &stnull) < 0) X return (FALSE); X X if (stbuf.st_dev == stnull.st_dev && X stbuf.st_ino == stnull.st_ino) X return (TRUE); X return (FALSE); X} X XEXPORT BOOL Xsamefile(fp1, fp2) X FILE *fp1; X FILE *fp2; X{ X struct stat stbuf1; X struct stat stbuf2; X X if (fp1 == NULL || fp2 == NULL) X return (FALSE); X X if (fstat(fdown(fp1), &stbuf1) < 0) X return (FALSE); X X if (fstat(fdown(fp2), &stbuf2) < 0) X return (FALSE); X X if (stbuf1.st_dev == stbuf2.st_dev && X stbuf1.st_ino == stbuf2.st_ino) X return (TRUE); X return (FALSE); X} X XEXPORT void Xsetmodes(info) X register FINFO *info; X{ X BOOL didutimes = FALSE; X BOOL asymlink = is_symlink(info); X X /* X * If it does not seem to be a symbolic link, we need to check whether X * this is an archive format that does not store the real file type. X * We need to avoid to set time stamps or modes for hard links on X * symbolic links. X */ X if (!asymlink && X fis_link(info)) { /* Real file type unknown */ X FINFO finfo; X X if (_getinfo(info->f_name, &finfo) && is_symlink(&finfo)) X asymlink = TRUE; X } X X if (!nomtime && !asymlink) { X /* X * With Cygwin32, X * DOS will not allow us to set file times on read-only files. X * We set the time before we change the access modes to X * overcode this problem. X * XXX This will no longer work with the new -p flag handling X * XXX as the files may be read only from the creation. X */ X if (!is_dir(info)) { X didutimes = TRUE; X if (sutimes(info->f_name, info, asymlink) < 0) { X if (!errhidden(E_SETTIME, info->f_name)) { X if (!errwarnonly(E_SETTIME, info->f_name)) X xstats.s_settime++; X (void) errabort(E_SETTIME, X info->f_name, TRUE); X } X } X } X } X X if (pflag && !asymlink) { X mode_t mode = info->f_mode; X X if (is_dir(info)) X mode |= TUWRITE; X if (lchmodat(info->f_name, mode, 0 /* chmod */) < 0) { X if (!errhidden(E_SETMODE, info->f_name)) { X if (!errwarnonly(E_SETMODE, info->f_name)) X xstats.s_setmodes++; X (void) errabort(E_SETMODE, info->f_name, TRUE); X } X } X#ifdef USE_ACL X /* X * If there are no additional ACLs, set_acls() will X * simply do a fast return. X */ X if (doacl) X set_acls(info); X#endif X } X#ifdef USE_FFLAGS X if (dofflags && !asymlink) X set_fflags(info); X#endif X X if (!nochown && my_uid == ROOT_UID) { X X#if defined(HAVE_CHOWN) || defined(HAVE_LCHOWN) X /* X * Star will not allow non root users to give away files. X */ X lchownat(info->f_name, (int)info->f_uid, (int)info->f_gid, X AT_SYMLINK_NOFOLLOW); X#endif X X if (pflag && !asymlink && X (info->f_mode & (TSUID | TSGID | TSVTX)) != 0) { X mode_t mode = info->f_mode; X X if (is_dir(info)) X mode |= TUWRITE; X /* X * On a few systems, seeting the owner of a file X * destroys the suid and sgid bits. X * We repeat the chmod() in this case. X */ X if (lchmodat(info->f_name, mode, 0 /* chmod */) < 0) { X /* X * Do not increment chmod() errors here, X * it did already fail above. X */ X /* EMPTY */ X ; X } X } X } X X#ifdef USE_XATTR X if (dolxattr) X set_xattr(info); X#endif X X /* X * utimensat() is able to set the time stamps on symlinks, if called X * with the AT_SYMLINK_NOFOLLOW flag, so we include symlinks in the X * list of file types that cause sutimes() to be called. X */ X if (!nomtime && !is_dir(info)) { X if (sutimes(info->f_name, info, asymlink) < 0 && !didutimes) X if (!errhidden(E_SETTIME, info->f_name)) { X if (!errwarnonly(E_SETTIME, info->f_name)) X xstats.s_settime++; X (void) errabort(E_SETTIME, info->f_name, TRUE); X } X } X if (is_dir(info)) { X sdirtimes(info->f_name, info, !nomtime, pflag); X } X} X XEXPORT int xutimes __PR((char *name, struct timespec *tp, X BOOL asymlink)); X XLOCAL int Xsutimes(name, info, asymlink) X char *name; X FINFO *info; X BOOL asymlink; X{ X struct timespec curtime; X struct timespec tp[3]; X X if (noatime) { X getnstimeofday(&curtime); X tp[0].tv_sec = curtime.tv_sec; X tp[0].tv_nsec = curtime.tv_nsec; X } else { X tp[0].tv_sec = info->f_atime; X tp[0].tv_nsec = info->f_ansec; X } X X tp[1].tv_sec = info->f_mtime; X tp[1].tv_nsec = info->f_mnsec; X#ifdef SET_CTIME X tp[2].tv_sec = info->f_ctime; X tp[2].tv_nsec = info->f_cnsec; X#else X tp[2].tv_sec = 0; X tp[2].tv_nsec = 0; X#endif X return (xutimes(name, tp, asymlink)); X} X XEXPORT int Xsnulltimes(name, info) X char *name; X FINFO *info; X{ X struct timespec tp[3]; X X fillbytes((char *)tp, sizeof (tp), '\0'); X return (xutimes(name, tp, is_symlink(info))); X} X X/* X * Extended utimes function. X * This is what we use in star as the default. X */ XEXPORT int Xxutimes(name, tp, asymlink) X char *name; X struct timespec tp[3]; X BOOL asymlink; X{ X struct timespec curtime; X struct timespec pasttime; X extern int Ctime; X int ret = 0; X int errsav; X X#ifndef HAVE_SETTIMEOFDAY X#undef SET_CTIME X#endif X X#ifdef SET_CTIME X if (Ctime) { X getnstimeofday(&curtime); X setnstimeofday(&tp[2]); X } X#endif X#if !defined(HAVE_UTIMENSAT) && \ X !defined(HAVE_LUTIMENS) && \ X !defined(HAVE_LUTIMES) X /* X * AT_SYMLINK_NOFOLLOW not in emulation X */ X if (!asymlink) X#endif X ret = lutimensat(name, tp, AT_SYMLINK_NOFOLLOW); X errsav = geterrno(); X X#ifdef SET_CTIME X if (Ctime) { X getnstimeofday(&pasttime); X timespecsub(&pasttime, &tp[2]); X timespecadd(&curtime, &pasttime); X setnstimeofday(&curtime); X#ifdef SET_CTIME_DEBUG X error("pasttime: %d.%9.9d\n", pasttime.tv_sec, pasttime.tv_nsec); X#endif X } X#endif X seterrno(errsav); X return (ret); X} X XEXPORT int Xsxsymlink(name, info) X char *name; X FINFO *info; X{ X#ifdef HAVE_SYMLINK X struct timespec tp[3]; X struct timespec curtime; X struct timespec pasttime; X char *linkname; X extern int Ctime; X int ret; X int errsav; X#ifdef HAVE_POSIX_MODE_BITS /* st_mode bits are equal to TAR mode bits */ X mode_t omask; X#endif X X tp[0].tv_sec = info->f_atime; X tp[0].tv_nsec = info->f_ansec; X X tp[1].tv_sec = info->f_mtime; X tp[1].tv_nsec = info->f_mnsec; X#ifdef SET_CTIME X tp[2].tv_sec = info->f_ctime; X tp[2].tv_nsec = info->f_cnsec; X#endif X linkname = info->f_lname; X X#ifdef SET_CTIME X if (Ctime) { X getnstimeofday(&curtime); X setnstimeofday(&tp[2]); X } X#endif X X#ifdef HAVE_POSIX_MODE_BITS /* st_mode bits are equal to TAR mode bits */ X /* X * At least HP-UX-11.x seems to honour the mask when creating symlinks. X * If we like to copy them correctly, we need to set the mask before. X * As umask(2) is a cheap syscall and symlinks are not very frequent X * this does not seem a real problem. X */ X omask = umask((mode_t)0); X umask(info->f_mode ^ 07777); X#endif X X ret = lsymlink(linkname, name); X errsav = geterrno(); X X#ifdef HAVE_POSIX_MODE_BITS /* st_mode bits are equal to TAR mode bits */ X umask(omask); X#endif X X#ifdef SET_CTIME X if (Ctime) { X getnstimeofday(&pasttime); X timespecsub(&pasttime, &tp[2]); X timespecadd(&curtime, &pasttime); X setnstimeofday(&curtime); X#ifdef SET_CTIME_DEBUG X error("pasttime: %d.%9.9d\n", pasttime.tv_sec, pasttime.tv_nsec); X#endif X } X#endif X seterrno(errsav); X return (ret); X#else X seterrno(EINVAL); X return (-1); X#endif X} X X#ifdef HAVE_SYS_FILIO_H X#include X#endif X XEXPORT int Xrs_acctime(fd, info) X int fd; X register FINFO *info; X{ X#ifdef _FIOSATIME X struct timeval atv; X#endif X X if (is_symlink(info)) X return (0); X X#ifdef _FIOSATIME X /* X * On Solaris 2.x root may reset accesstime without changing ctime. X */ X if (my_uid == ROOT_UID) { X atv.tv_sec = info->f_atime; X atv.tv_usec = info->f_ansec/1000; X return (ioctl(fd, _FIOSATIME, &atv)); X } X#endif X return (sutimes(info->f_name, info, FALSE)); X} X X#ifdef HAVE_POSIX_MODE_BITS /* st_mode bits are equal to TAR mode bits */ X#define OSMODE(tarmode) (tarmode) X#else X#define OSMODE(tarmode) ((tarmode & TSUID ? S_ISUID : 0) \ X | (tarmode & TSGID ? S_ISGID : 0) \ X | (tarmode & TSVTX ? S_ISVTX : 0) \ X | (tarmode & TUREAD ? S_IRUSR : 0) \ X | (tarmode & TUWRITE ? S_IWUSR : 0) \ X | (tarmode & TUEXEC ? S_IXUSR : 0) \ X | (tarmode & TGREAD ? S_IRGRP : 0) \ X | (tarmode & TGWRITE ? S_IWGRP : 0) \ X | (tarmode & TGEXEC ? S_IXGRP : 0) \ X | (tarmode & TOREAD ? S_IROTH : 0) \ X | (tarmode & TOWRITE ? S_IWOTH : 0) \ X | (tarmode & TOEXEC ? S_IXOTH : 0)) X#endif X XEXPORT void X#ifdef PROTOTYPES Xsetdirmodes(char *name, mode_t tarmode) X#else Xsetdirmodes(name, tarmode) X char *name; X mode_t tarmode; X#endif X{ X register mode_t _osmode; X X _osmode = OSMODE(tarmode); X if (lchmodat(name, _osmode, 0 /* chmod */) < 0) { /* OK for dir */ X if (!errhidden(E_SETMODE, name)) { X if (!errwarnonly(E_SETMODE, name)) X xstats.s_setmodes++; X errmsg("Can't set permission for '%s'.\n", name); X (void) errabort(E_SETMODE, name, TRUE); X } X } X} X X XEXPORT mode_t X#ifdef PROTOTYPES Xosmode(register mode_t tarmode) X#else Xosmode(tarmode) X register mode_t tarmode; X#endif X{ X register mode_t _osmode; X X _osmode = OSMODE(tarmode); X return (_osmode); X} X X#ifdef HAVE_POSIX_MODE_BITS /* st_mode bits are equal to TAR mode bits */ X#else X#undef lchmodat XLOCAL int X#ifdef PROTOTYPES Xdolchmodat(register char *name, register mode_t tarmode, int flag) X#else Xdolchmodat(name, tarmode, flag) X register char *name; X register mode_t tarmode; X int flag; X#endif X{ X register mode_t _osmode; X X _osmode = OSMODE(tarmode); X return (lchmodat(name, _osmode, flag)); X} X#endif END-of-star-1.6/star/star_unix.c echo x - star-1.6/star/starformatman.mk sed 's/^X//' >star-1.6/star/starformatman.mk << 'END-of-star-1.6/star/starformatman.mk' X#ident @(#)starformatman.mk 1.1 05/08/28 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= star XMANSECT= $(MANSECT_FILEFORM) XMANSUFFIX= $(MANSUFF_FILEFORM) XMANFILE= star.4 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/star/starformatman.mk echo x - star-1.6/star/starvsgnutar.mk sed 's/^X//' >star-1.6/star/starvsgnutar.mk << 'END-of-star-1.6/star/starvsgnutar.mk' X#ident %W% %E% %Q% X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= share/doc/star XTARGET= STARvsGNUTAR X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### END-of-star-1.6/star/starvsgnutar.mk echo x - star-1.6/star/subst.c sed 's/^X//' >star-1.6/star/subst.c << 'END-of-star-1.6/star/subst.c' X/* @(#)subst.c 1.24 18/10/23 Copyright 1986,2003-2018 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)subst.c 1.24 18/10/23 Copyright 1986,2003-2018 J. Schilling"; X#endif X/* X * Substitution commands X * X * Copyright (c) 1986,2003-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X#define GT_COMERR /* #define comerr gtcomerr */ X#define GT_ERROR /* #define error gterror */ X#include X X#include X X#include "star.h" X#include "starsubs.h" X#include "pathname.h" X XEXPORT int parsesubst __PR((char *cmd, BOOL *arg)); XEXPORT BOOL subst __PR((FINFO *info)); XLOCAL char *substitute __PR((char *from, long fromlen, int idx, char *to, long tolen)); XLOCAL BOOL simpleto __PR((char *s, long len)); XLOCAL int catsub __PR((char *here, char *old, long oldlen, char *to, long tolen, char *limit)); XEXPORT BOOL ia_change __PR((TCB *ptb, FINFO *info)); XLOCAL BOOL pax_change __PR((TCB *ptb, FINFO *info)); XLOCAL void s_enomem __PR((void)); XEXPORT int fpgetstr __PR((FILE *, pathstore_t *)); X X#define NPAT 100 XLOCAL int npat; /* Number of defined patterns */ XLOCAL Uchar *pat[NPAT]; /* Saved list of defined 'from' patterns */ XLOCAL int patlen[NPAT]; /* Length of the 'from' pattern */ XLOCAL int maxplen; /* Maximum length of 'from' pattern */ XLOCAL char *substpat[NPAT]; /* Saved list of defined 'to' patterns */ XLOCAL int substlen[NPAT]; /* Length of the 'to' pattern */ XLOCAL int *aux[NPAT]; /* Aux array (compiled pattern) */ XLOCAL int alt[NPAT]; /* List of results from patcompile() */ XLOCAL int *state; /* State array used by patmatch() */ XLOCAL Int32_t substcnt[NPAT]; /* Subst. count or MAXINT32 for 'g', < 0: 'v' */ X Xextern FILE *tty; Xextern FILE *vpr; Xextern int verbose; Xextern BOOL xflag; Xextern BOOL nflag; Xextern BOOL debug; Xextern BOOL paxinteract; X X/* X * This is the command line parser for tar/pax substitution commands. X * Syntax is: -s '/old/new/v' X */ XEXPORT int Xparsesubst(cmd, arg) X char *cmd; X BOOL *arg; X{ X register char *from; X register char *to; X register char *cp; X register char *endp; X register char c = '/'; X register char dc; /* Delimiting character */ X long fromlen; X long tolen; X int cmdlen; X char *subopts = NULL; X BOOL printsubst = FALSE; X Int32_t count = 1; X X if (debug) { X error("Add subst pattern: '%s'", cmd); X } X X cmdlen = strlen(cmd); X from = cmd; X endp = &cmd[cmdlen]; X X dc = c = *from; X to = ++from; X while (to < endp) { X c = *to; X if (c != dc) X to++; X else X break; X } X if (to >= endp || c != dc) X comerrno(EX_BAD, "Missing '%c' delimiter after 'from' substitute string.\n", dc); X X fromlen = to-from; X *to++ = '\0'; X cp = to; X while (cp < endp) { X c = *cp; X if (c != dc) X cp++; X else X break; X } X if (to >= endp || c != dc) X comerrno(EX_BAD, "Missing '%c' delimiter after 'to' substitute string.\n", dc); X X tolen = cp-to; X *cp = '\0'; X if (++cp < endp) X subopts = cp; X X while (cp < endp) { X c = *cp++; X if (c == 'p') { X printsubst = TRUE; X } else if (c == 'g') { X count = MAXINT32; X } else { X comerrno(EX_BAD, "Bad substitute option '%c'.\n", c); X } X } X X if (debug) { X error(" '%s'%s'(%ld,%ld) opts '%s' simpleto: %d\n", X from, to, fromlen, tolen, X subopts, simpleto(to, tolen)); X } X X if (npat >= NPAT) X comerrno(EX_BAD, "Too many substitute patterns (max is %d).\n", NPAT); X X pat[npat] = (Uchar *)___savestr(from); X patlen[npat] = fromlen; X substpat[npat] = ___savestr(to); X substlen[npat] = tolen; X X X if (fromlen > maxplen) X maxplen = fromlen; X X aux[npat] = ___malloc(fromlen*sizeof (int), "compiled subst pattern"); X if ((alt[npat] = patcompile(pat[npat], patlen[npat], aux[npat])) == 0) { X comerrno(EX_BAD, "Bad pattern: '%s'.\n", pat[npat]); X return (-2); X } X X if (printsubst) X count *= -1; X substcnt[npat] = count; X *arg = TRUE; X npat++; X return (1); X} X X XEXPORT BOOL Xsubst(info) X FINFO *info; X{ X char *to = NULL; X register int i; X X if (!state) { X state = ___malloc((maxplen+1)*sizeof (int), "pattern state"); X } X X info->f_namelen = strlen(info->f_name); X /* X * Loop over all match & Subst Patterns. X * Stop after the first match has been seen. X */ X for (i = 0; i < npat; i++) { X to = substitute(info->f_name, info->f_namelen, i, substpat[i], substlen[i]); X if (to) X break; X } X if (to) { X if (substcnt[i] < 0) X error("%s >> %s\n", info->f_name, to); X info->f_namelen = strlen(to); X info->f_name = to; X return (TRUE); X } X X return (FALSE); X} X X XLOCAL pathstore_t new; X/* X * This is the 'real' substitution routine. X * It gets called with pre-parsed strings. X * X * Returns NULL on no-match and on error. X */ XLOCAL char * Xsubstitute(from, fromlen, idx, to, tolen) X char *from; /* The original string to modify */ X long fromlen; /* strlen(from) */ X int idx; /* The index in the pat[] array */ X char *to; /* The substitution */ X long tolen; /* strlen(to) */ X{ X char old[PATH_MAX+1]; X char *oldp = old; X long oldlen = 0; X BOOL tosimple; X Int32_t n = substcnt[idx]; X char *end; X char *string; X size_t soff; X int slen; X BOOL didmatch = FALSE; X#define limit (new.ps_path + new.ps_size) X X if (fromlen == 0) X return (NULL); X if (new.ps_size == 0 && init_pspace(PS_EXIT, &new) < 0) X return (NULL); X X tosimple = simpleto(to, tolen); X X string = from; X slen = strlen(string); X end = string; X /* X * We simply ignore the 'p'rint statement here as the printing happens X * in the subst() function. X */ X if (n < 0) X n *= -1; X while (n-- > 0) { X X /* X * Search the next occurence of the pattern in the 'from' string. X */ X while (*string != '\0') { X /* X * Loop over the from string for a possible match X */ X if ((end = (char *)patmatch(pat[idx], aux[idx], X (Uchar *)string, 0, slen, alt[idx], X state)) == NULL) { X X string++; X slen--; X continue; X } X if (!didmatch) { X /* X * We had a first match. Copy the 'from' string X * into our result storage. X */ X didmatch = TRUE; X strcpy_pspace(PS_EXIT, &new, from); X X /* X * Let 'string' and 'end' have the same offset X * in 'new' as they had in 'from' before. X */ X string = new.ps_path + (string - from); X end = new.ps_path + (end - from); X X if (!tosimple) { X /* X * We need to remember the old 'from' X * string before, since the replacement X * refers to the old 'from' string. X */ X oldlen = end - string; X if (strlcpy(old, string, oldlen+1) >= X oldlen) { X oldp = strndup(string, oldlen); X if (oldp == NULL) { X s_enomem(); X return (NULL); X } X } else { X oldp = old; X } X } X X } X break; X } X if (*string == '\0') X break; X X /* X * Now delete the old string in the buffer X * and insert substitution X */ X if (tosimple) { X char xold[PATH_MAX+1]; X char *xoldp; X X /* X * Remember the old string after the matching part. X */ X if (strlcpy(xold, end, sizeof (xold)) >= X sizeof (xold)) { X xoldp = strdup(end); X if (xoldp == NULL) { X s_enomem(); X return (NULL); X } X } else { X xoldp = xold; X } X X X if ((string+tolen) >= limit) { X soff = string - new.ps_path; X if (incr_pspace(PS_STDERR, &new, X 1 + (string+tolen) - limit) < 0) { X s_enomem(); X if (xoldp != xold) X free(xoldp); X goto over; X } X string = new.ps_path + soff; X } X strlcpy((char *)string, (char *)to, tolen+1); /* insert */ X X /* X * Append non-maching old tail. X */ X if ((&string[tolen] + strlen(xoldp)) >= limit) { X soff = string - new.ps_path; X if (incr_pspace(PS_STDERR, &new, X 1 + (string+tolen) - limit) < 0) { X s_enomem(); X if (xoldp != xold) X free(xoldp); X goto over; X } X string = new.ps_path + soff; X } X strcpy((char *)&string[tolen], xoldp); X if (xoldp != xold) X free(xoldp); X } else { X soff = string - new.ps_path; X tolen = catsub(string, old, oldlen, to, tolen, limit); X string = new.ps_path + soff; X if (oldp != old) X free(oldp); X if (tolen < 0) { X if (new.ps_path) X new.ps_path[0] = '\0'; X return (new.ps_path); X } X } X string = &string[tolen]; X slen = strlen(string); X } X if (didmatch) X return (new.ps_path); X return (NULL); Xover: X errmsgno(EX_BAD, "Substitution path overflow.\n"); X if (new.ps_path) X new.ps_path[0] = '\0'; X return (new.ps_path); X} X#undef limit X X/* X * Check is this is a 'simple' 'to'-substitution string X * that does not require to be expanded via 'catsub()'. X */ XLOCAL BOOL Xsimpleto(s, len) X register char *s; X register long len; X{ X register char c; X X if (len <= 0) X return (TRUE); X while (--len >= 0) { X c = *s++; X if (c == '\\' || c == '&') X return (FALSE); X } X return (TRUE); X} X X/* X * Insert the substitution string. X * The '&' character in the to string is substituted with the old from string. X */ XLOCAL int Xcatsub(here, old, oldlen, to, tolen, limit) X register char *here; X register char *old; X register long oldlen; X register char *to; X register long tolen; X register char *limit; X{ X char xold[PATH_MAX+1]; X char *xoldp; X char *p = here; X size_t len; X size_t hoff; X X if (tolen <= 0) X return (0); X X /* X * Remember the old string after the matching part. X */ X if (strlcpy(xold, &here[oldlen], sizeof (xold)) >= sizeof (xold)) { X xoldp = strdup(&here[oldlen]); X if (xoldp == NULL) { X s_enomem(); X return (-1); X } X } else { X xoldp = xold; X } X X while (--tolen >= 0) { X if (here >= limit) { X hoff = here - new.ps_path; X if (incr_pspace(PS_STDERR, &new, X 1 + here - limit) < 0) { X s_enomem(); X goto over; X } X here = new.ps_path + hoff; X } X if (*to == '\\') { X if (--tolen >= 0) X *here++ = *++to; X } else if (*to == '&') { X if ((here+oldlen) >= limit) { X hoff = here - new.ps_path; X if (incr_pspace(PS_STDERR, &new, X 1 + (here+oldlen) - limit) < 0) { X s_enomem(); X goto over; X } X here = new.ps_path + hoff; X } X strlcpy(here, old, oldlen+1); X here += oldlen; X } else { X *here++ = *to; X } X to++; X } X len = strlen(xoldp); X if ((here+len) >= limit) { X hoff = here - new.ps_path; X if (incr_pspace(PS_STDERR, &new, X 1 + (here+len) - limit) < 0) { X s_enomem(); X goto over; X } X here = new.ps_path + hoff; X } X strcpy(here, xoldp); X if (xoldp != xold) X free(xoldp); X return (here - p); Xover: X errmsgno(EX_BAD, "& Substitution path overflow.\n"); X if (xoldp != xold) X free(xoldp); X return (-1); X} X X/* ARGSUSED */ XEXPORT BOOL Xia_change(ptb, info) X TCB *ptb; X FINFO *info; X{ X FINFO cinfo; X char ans; X char abuf[3]; X int len; X X if (paxinteract) X return (pax_change(ptb, info)); X X if (verbose) X list_file(info); X else X vprint(info); X if (nflag) X return (FALSE); X fgtprintf(vpr, "get/put ? Y(es)/N(o)/C(hange name) :"); fflush(vpr); X abuf[0] = '\0'; X len = fgetstr(tty, abuf, sizeof (abuf)); X if (len > 0 && abuf[len-1] != '\n') { X while (getc(tty) != '\n') { X if (feof(tty) || ferror(tty)) X break; X } X } X if ((ans = toupper(abuf[0])) == 'Y') X return (TRUE); X else if (ans == 'C') { X for (;;) { X fgtprintf(vpr, "Enter new name:"); X fflush(vpr); X len = fpgetstr(tty, &new); X if (len < 0) X comexit(-2); X else if (len > 0) X break; X } X info->f_name = new.ps_path; X if (xflag) { X if (newer(info, &cinfo)) X return (FALSE); X if (is_symlink(info) && same_symlink(info)) X return (FALSE); X } X return (TRUE); X } X return (FALSE); X} X X/* ARGSUSED */ XLOCAL BOOL Xpax_change(ptb, info) X TCB *ptb; X FINFO *info; X{ X FINFO cinfo; X int len; X X if (verbose) X list_file(info); X else X vprint(info); X if (nflag) X return (FALSE); X X for (;;) { X fgtprintf(vpr, "%s change?", info->f_name); X fflush(vpr); X len = fpgetstr(tty, &new); X if (len < 0) X comexit(-2); X else X break; X } X if (new.ps_path[0] == '\0') /* Skip file */ X return (FALSE); X if (new.ps_path[0] == '.' && X new.ps_path[1] == '\0') /* Leave name as is */ X return (TRUE); X X info->f_name = new.ps_path; X if (xflag && newer(info, &cinfo)) X return (FALSE); X return (TRUE); X} X XLOCAL void Xs_enomem() X{ X errmsgno(EX_BAD, "No memory for substitution.\n"); X xstats.s_substerrs++; X} X X/* X * Read a line of unspecified and arbitrary length from FILE * X * and place the result in a pathstore_t object. X */ XEXPORT int Xfpgetstr(f, p) X register FILE *f; X pathstore_t *p; X{ X int ret = getdelim(&p->ps_path, &p->ps_size, '\n', f); X X if (ret <= 0) X return (ret); X X if (p->ps_path[ret-1] == '\n') X p->ps_path[--ret] = '\0'; X return (ret); X} END-of-star-1.6/star/subst.c echo x - star-1.6/star/suntar.1 sed 's/^X//' >star-1.6/star/suntar.1 << 'END-of-star-1.6/star/suntar.1' X. \" @(#)suntar.1 1.14 19/01/05 Copyr 2004-2019 J. Schilling X. \" Manual Seite fuer suntar X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.75n'U X.if t .ds s \\(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH STUNAR 1 "2019/01/05" "J\*org Schilling" "Schily\'s USER COMMANDS" X.SH NAME Xsuntar \- create tape archives and add or extract files X.SH SYNOPSIS X.B "suntar\ " X.I command X[ X.I options X] X.I file1 .\|.\|. filen X.SH DESCRIPTION X.PP XThis manual page documents an emulation of the Sun version of X.BR tar . XIt has been implemented on top of the X.B star Xprogram. X.PP XFor a description of the Sun tar program check the Sun tar manual page. X.SH OPTIONS X.B Star Xsupports the Sun tar options. X X.SH "EXTENDED OPTIONS X.PP XThe extended options are options taken from X.BR star . X.TP X.B \-\-help XPrints a summary of the most important options for X.BR suntar (1) Xand exits. X.TP X.B \-\-xhelp XPrints a summary of the less important options for X.BR suntar (1) Xand exits. X.TP X.B \-\-version XPrints the X.B suntar Xversion number string and exists. X.TP X.B \-\-debug Xprint additional debug messages X.TP X.BI xdebug= # X.TP X.BI xd= # Xset extended debug level X.TP X.BI artype= headertype XGenerate a tape archive in X.I headertype Xformat. XFor more information, see X.BR star (1) . X.TP X.B \-/ Xdon't strip leading '/'s from file names X.TP X.B \-\-.. Xdon't skip filenames that contain '..' in non-interactive extract X.TP X.B \-\-7z Xrun the input or output through a X.B p7zip Xpipe - see option X.B \-z Xbelow. X.sp XNote that the X.B p7zip Xprogram currently does not operate on a pipe but on a X/tmp file copy and thus limits the maximum archive size. X.TP X.B \-\-secure\-links Xdon't extract links that start with '/' or contain '..' X.TP X.B \-\-no\-secure\-links Xextract links that start with '/' or contain '..' X.TP X.B \-\-acl Xhandle access control lists X.TP X.B \-\-xfflags Xhandle extended file flags X.TP X.BI bs= # Xset (output) block size to # X.TP X.BI fs= # Xset fifo size to # X.TP X.B \-\-no\-fsync Xdo not call fsync() for each extracted file (may be dangerous). X.TP X.B \-\-do\-fsync Xcall fsync() for each extracted file. X.TP X.B \-\-time X print timing info X.TP X.B \-\-no\-statistics Xdo not print statistics X.TP X.B \-\-do\-statistics Xrint statistics X.TP X.B \-\-fifostats Xprint fifo statistics X.TP X.B \-\-no\-fifo Xdon't use a fifo to optimize data flow from/to tape X.TP X.B \-\-numeric Xdon't use user/group name from tape X.TP X.B \-\-lzo Xpipe input/output through X.BR lzop , Xdoes not work on tapes X.TP X.B \-\-lzip Xpipe input/output through X.BR lzip , Xdoes not work on tapes X.TP X.B \-z Xpipe input/output through X.BR gzip , Xdoes not work on tapes X.TP X.B \-\-bz Xpipe input/output through X.BR bzip2 , Xdoes not work on tapes X.TP X.B \-\-zstd Xpipe input/output through X.BR zstd , Xdoes not work on tapes X.PP XThe options above are not defined by Sun tar. X.PP XFor a complete documentation of the X.B star Xbased options check X.BR star (1). X X.SH EXAMPLES X.SH ENVIRONMENT X.SH FILES X.SH "SEE ALSO" X.BR spax (1), X.BR suntar (1), X.BR scpio (1), X.BR tar (1), X.BR cpio (1), X.BR pax (1), X.BR rcp (1), X.BR mt (1), X.BR rmt (1), X.BR match (1), X.BR dd (1), X.BR sdd (1), X.BR rsh (1), X.BR ssh (1), X.BR star (1), X.BR star (4), X.BR rcmd (3), X.BR fssnap (1m) X.SH DIAGNOSTICS X.SH NOTES X.PP XThis X.B suntar Ximplementation is based on the X.B star Ximplementation and does not implement all features of the original Sun tar Xprogram. X.PP X.B "Suntar \-x Xis equivalent to X.B "star \-xU \-force\-remove \-remove\-first \-keep\-nonempty\-dirs X.SH BUGS X.SH AUTHOR X.nf XJ\*org Schilling XSeestr. 110 XD\-13353 Berlin XGermany X.fi X.PP XMail bugs and suggestions to: X.PP X.B Xjoerg.schilling@fokus.fraunhofer.de Xor X.B Xjoerg@schily.net END-of-star-1.6/star/suntar.1 echo x - star-1.6/star/suntar.c sed 's/^X//' >star-1.6/star/suntar.c << 'END-of-star-1.6/star/suntar.c' X/* @(#)suntar.c 1.43 19/03/27 Copyright 1989, 2003-2019 J. Schilling */ X#include X#ifndef lint Xstatic const char _s_sccsid[] = X "@(#)suntar.c 1.43 19/03/27 Copyright 1989, 2003-2019 J. Schilling"; X#endif X/* X * Solaris TAR specific routines for star main program. X * X * Copyright (c) 1989, 2003-2019 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X/* X * The options -C & -I are not supported without '-' with suntar. X */ Xstatic char *sun_copt = "crtuxbBDeEfFhiklmnopPqTvwX@01234567"; X X#ifdef STAR_MAIN X/* X * We have been included from star.c X */ X#define opts suntar_opts X#define _opts _suntar_opts X#define gargs suntar_gargs X#define susage suntar_susage X#define usage suntar_usage X#define xusage suntar_xusage X#define DFLT_FILE "/etc/default/tar" X#else X#define NO_STAR_MAIN X#define SUNTAR_MAIN X#define PTYPE_DEFAULT P_SUNTAR X#define DFLT_FILE "/etc/default/tar" X X#include "star.c" X#endif X X#define SUN_TAR X XLOCAL void gargs __PR((int ac, char *const *av)); XLOCAL void susage __PR((int ret)); XLOCAL void usage __PR((int ret)); XLOCAL void xusage __PR((int ret)); X#ifdef STAR_MAIN XLOCAL void suntar_setopts __PR((char *o)); X#endif X X/* X * tar {crtux}[bBDeEfFhiklmnopPqvwX@[0-7]] [-k size] [blocksize] [tapefile] [exclude-file] [-I include-file] files ... X * X * -I fehlt noch X */ X X X/* X * Solaris TAR related options X */ X/* BEGIN CSTYLED */ Xchar _opts[] = "C*,help,xhelp,version,debug,xdebug#,xd#,time,no-statistics,do-statistics,fifostats,numeric,no-fifo,no-fsync,do-fsync%0,sattr,bs&,fs&,/,..,secure-links,no-secure-links%0,acl,xfflags,copy,diff,artype&,O,z,bz,lzo,7z,xz,lzip,zstd,c,r,t,u,x,b&,B,D,e,E,f&,F,h,I*,i,k&,l,m,n,o,p,P,q,v+,w,X&,@,T,?"; X/* END CSTYLED */ Xchar *opts = _opts; X#ifdef NO_STAR_MAIN Xstruct ga_props gaprops; X#endif X XLOCAL void suntar_info __PR((void)); X XLOCAL void Xgargs(ac, av) X int ac; X char *const *av; X{ X int files = 0; X int minfiles = 1; X BOOL help = FALSE; X BOOL xhelp = FALSE; X BOOL prvers = FALSE; X BOOL no_fifo = FALSE; X BOOL oldtar = FALSE; X BOOL sunDflag = FALSE; X BOOL sunEflag = FALSE; X BOOL sunpflag = FALSE; X BOOL sunqflag = FALSE; X char *sunI = NULL; X BOOL sunxattr = FALSE; X BOOL sunTflag = FALSE; X BOOL do_stats = FALSE; X BOOL do_sattr = FALSE; Xsigned char archive = -1; /* On IRIX, we have unsigned chars by default */ X X /* X * Current default archive format in all other cases is USTAR. X * We may change this to PAX in the future. X */ X hdrtype = H_USTAR; X#ifdef STAR_MAIN X suntar_setopts(opts); X#endif X getarginit(&gaprops, GAF_DEFAULT); /* Set default behavior */ X X iftype = I_TAR; /* command line interface */ X ptype = P_SUNTAR; /* program interface type */ X bsdchdir = TRUE; X uncond = TRUE; /* tar -x is star -xU ... */ X force_remove = TRUE; /* and -force-remove ... */ X remove_first = TRUE; /* and -remove-first ... */ X keep_nonempty_dirs = TRUE; /* and -keep-nonempty-dirs */ X no_fsync = TRUE; /* and -no-fsync */ X no_stats = TRUE; /* and -no-statitstics */ X /* X * NOTE: star by default writes into existing files if possible. X * If we like to emulate the Sun tar behavior, we need to call X * star -xU -force-remove -remove-first -keep-nonempty-dirs X * The only remaining difference to Sun tar is that Sun tar does X * not try to remove non-empty directories in case that a X * directory of the name name is to be made next. X * One problem with -remove-first is that it slows down extraction X */ X X if (pname) { /* cli=xxx seen as argv[1] */ X --ac, av++; X } X --ac, ++av; X files = getfilecount(ac, av, opts); X if (getlallargs(&ac, &av, &gaprops, opts, X &dir_flags, X &help, &xhelp, &prvers, &debug, &xdebug, &xdebug, X#ifndef __old__lint X &showtime, &no_stats, &do_stats, &do_fifostats, X &numeric, &no_fifo, &no_fsync, &no_fsync, X &do_sattr, /* --sattr */ X getenum, &bs, X getenum, &fs, X &abs_path, &allow_dotdot, X &secure_links, &secure_links, X &doacl, &dofflags, X ©flag, &diff_flag, X gethdr, &chdrtype, X &oldtar, X &zflag, &bzflag, &lzoflag, X &p7zflag, &xzflag, &lzipflag, &zstdflag, X X &cflag, X &rflag, X &tflag, X &uflag, X &xflag, X X getenum, &bs, /* -b blocks */ X &multblk, /* -B */ X &sunDflag, /* -D */ X &errflag, /* -e */ X &sunEflag, /* -E */ X addtarfile, NULL, /* -f archive */ X &Fflag, /* -F */ X &paxfollow, /* -h */ X &sunI, /* -I */ X &ignoreerr, /* -i */ X getknum, &tsize, /* -k size */ X &nolinkerr, /* -l */ X &nomtime, /* -m */ X ¬_tape, /* -n */ X &nochown, /* -o */ X &sunpflag, /* -p */ X &no_dirslash, /* -P */ X &sunqflag, /* -q */ X &verbose, /* -v */ X &interactive, /* -w */ X getexclude, NULL, /* -X */ X &sunxattr, /* -@ */ X &sunTflag, /* -T */ X#endif /* __old__lint */ X &archive) < 0) { X errmsgno(EX_BAD, "Bad Option: %s.\n", av[0]); X susage(EX_BAD); X } X if (archive != -1 && !(archive >= '0' && archive <= '7')) { X errmsgno(EX_BAD, "Bad Option: -%c.\n", archive); X susage(EX_BAD); X } X star_helpvers("suntar", help, xhelp, prvers); X X if (sunDflag) X errconfig("WARN|GROW|SHRINK *"); X X if (sunEflag) { X chdrtype = H_SUNTAR; X no_dirslash = TRUE; X if (cflag || rflag || uflag) { X errmsgno(EX_BAD, "The -E option creates a deprecated archive type.\n"); X errmsgno(EX_BAD, "Use artype=exustar to create a POSIX extended archive.\n"); X if (sunpflag) { X errmsgno(EX_BAD, "Switching to artype=exustar to support ACLs.\n"); X chdrtype = H_EXUSTAR; X } X } X } X if (sunI) { X errmsgno(EX_BAD, "The -I option is not yet implemented.\n"); X susage(EX_BAD); X } X if (tsize) { X#ifdef NO_SPLIT X errmsgno(EX_BAD, "The -k option currently does not split files.\n"); X#else X multivol = TRUE; X#endif X } X if (not_tape) { X errmsgno(EX_BAD, "The -n option is not yet implemented.\n"); X } X if (sunpflag) { X pflag = TRUE; X doacl = TRUE; X } X if (sunqflag) { X errmsgno(EX_BAD, "The -q option is not yet implemented (as in Sun tar).\n"); X susage(EX_BAD); X } X if (sunxattr) { X errmsgno(EX_BAD, "The -@ option is not yet implemented.\n"); X susage(EX_BAD); X } X if (do_sattr) { X errmsgno(EX_BAD, "The --sattr option is not yet implemented.\n"); X susage(EX_BAD); X } X if (sunTflag) { X errmsgno(EX_BAD, "The -T option is not yet implemented.\n"); X susage(EX_BAD); X } X if (do_stats) X no_stats = FALSE; X X star_checkopts(oldtar, /* dodesc */ FALSE, /* usetape */ TRUE, X archive, no_fifo, X /* paxopts */ NULL, X /* llbs */ 0); X star_nfiles(files, minfiles); X X /* X * Also check for Sun defaults X */ X star_defaults(&fs, &no_fsync, DFLT_FILE); X} X XLOCAL void Xsuntar_info() X{ X const char *n = pname ? pname : get_progname(); X X error("\nFor a more complete user interface use the tar type command interface.\n"); X error("See 'man star'. The %s command is more or less limited to the\n", n); X error("Solaris tar command line interface.\n"); X} X X/* X * Short usage X */ XLOCAL void Xsusage(ret) X int ret; X{ X const char *n = pname ? pname : get_progname(); X X error("Usage:\t%s cmd [options] file1 ... filen\n", n); X error("\nUse\t%s --help\n", n); X error("and\t%s --xhelp\n", n); X error("to get a list of valid cmds and options.\n"); X suntar_info(); X exit(ret); X /* NOTREACHED */ X} X XLOCAL void Xusage(ret) X int ret; X{ X const char *n = pname ? pname : get_progname(); X X error("Usage:\t%s cmd [options] file1 ... filen\n", n); X error("Cmd:\n"); X error("\t-c/-u/-r\tcreate/update/replace archive with named files to tape\n"); X error("\t-x/-t\t\textract/list named files from tape\n"); X error("\t--copy\t\t(*) copy named files to destination directory\n"); X error("\t--diff\t\t(*) diff archive against file system (see -xhelp)\n"); X error("\tartype=header\t(*) generate 'header' type archive (see artype=help)\n"); X error("Options:\n"); X error("\t--help\t\t(*) print this help\n"); X error("\t--xhelp\t\t(*) print extended help\n"); X error("\t--version\t(*) print version information and exit\n"); X error("\t-b #\t\tset blocking factor to #x512 Bytes (default 20)\n"); X error("\t-B\t\tperform multiple reads (needed on pipes)\n"); X error("\t-D\t\ttreat data change errors as warnings only\n"); X error("\t-e\t\texit immediately if unexpeted errors ocur\n"); X error("\t-E\t\tWrite a tarfile with extended headers\n"); X error("\t-f nm\t\tuse 'nm' as tape instead of stdin/stdout\n"); X error("\t-F,-FF,-FFF,...\tdo not store/create SCCS/RCS, core and object files\n"); X error("\t-h\t\tfollow symbolic links as if they were files\n"); X error("\t-I yy\t\tXXX Not implemented\n"); X error("\t-i\t\tignore checksum errors\n"); X error("\t-k yy\t\tset tape volume size to yy (default multiplier is 512)\n"); X error("\t-l\t\tprint a message if not all links are dumped\n"); X error("\t-m\t\tdo not restore access and modification time\n"); X error("\t-n\t\tXXX Not implemented\n"); X error("\t-o\t\tdo not restore owner and group\n"); X error("\t-O\t\t(*)be compatible to old tar (except for checksum bug)\n"); X error("\t-p\t\trestore filemodes of directories\n"); X error("\t-P\t\tdo not add a trailing '/' on directory archive entries\n"); X error("\t-q\t\tXXX Not implemented\n"); X error("\t-v\t\tincrement verbose level\n"); X error("\t-w\t\tdo interactive creation/extraction/renaming\n"); X error("\t-X yy\t\tExclude files from file yy containing a list of path names\n"); X error("\t-@\t\tXXX Not implemented\n"); X error("\t--sattr\t\tXXX Not implemented\n"); X error("\t-T\t\tXXX Not implemented\n"); X error("\t-[0-7]\t\tSelect an alternative tape drive\n"); X error("\t-z\t\t(*) pipe input/output through gzip, does not work on tapes\n"); X error("\t--bz\t\t(*) pipe input/output through bzip2, does not work on tapes\n"); X error("\t--lzo\t\t(*) pipe input/output through lzop, does not work on tapes\n"); X error("\t--7z\t\t(*) pipe input/output through p7zip, does not work on tapes\n"); X error("\t--xz\t\t(*) pipe input/output through xz, does not work on tapes\n"); X error("\t--lzip\t\t(*) pipe input/output through lzip, does not work on tapes\n"); X error("\t--zstd\t\t(*) pipe input/output through zstd, does not work on tapes\n"); X#ifdef FIFO X error("\t--no-fifo\t(*) don't use a fifo to optimize data flow from/to tape\n"); X#endif X error("\nAll options marked with (*) are not defined by Solaris tar.\n"); X suntar_info(); X exit(ret); X /* NOTREACHED */ X} X XLOCAL void Xxusage(ret) X int ret; X{ X const char *n = pname ? pname : get_progname(); X X error("Usage:\t%s cmd [options] file1 ... filen\n", n); X error("Extended options:\n"); X error("\t--debug\t\tprint additional debug messages\n"); X error("\txdebug=#,xd=#\tset extended debug level\n"); X error("\t-/\t\tdon't strip leading '/'s from file names\n"); X error("\t--..\t\tdon't skip filenames that contain '..' in non-interactive extract\n"); X error("\t--no-secure-links\textract links that start with '/' or contain '..'\n"); X error("\t--acl\t\thandle access control lists\n"); X error("\t--xfflags\thandle extended file flags\n"); X error("\tbs=#\t\tset (output) block size to #\n"); X#ifdef FIFO X error("\tfs=#\t\tset fifo size to #\n"); X#endif X error("\t--no-fsync\tdo not call fsync() for each extracted file (may be dangerous)\n"); X error("\t--do-fsync\tcall fsync() for each extracted file\n"); X error("\t--time\t\tprint timing info\n"); X error("\t--no-statistics\tdo not print statistics\n"); X error("\t--do-statistics\tprint statistics\n"); X#ifdef FIFO X error("\t--fifostats\tprint fifo statistics\n"); X#endif X error("\t--numeric\tdon't use user/group name from tape\n"); X error("\nAll options above are not defined by Solaris tar.\n"); X exit(ret); X /* NOTREACHED */ X} X X#ifdef STAR_MAIN X#undef opts X#undef _opts X#undef gargs X#undef susage X#undef usage X#undef xusage X XLOCAL void Xsuntar_setopts(o) X char *o; X{ Xextern char *opts; X opts = o; X} X#endif END-of-star-1.6/star/suntar.c echo x - star-1.6/star/suntarman.mk sed 's/^X//' >star-1.6/star/suntarman.mk << 'END-of-star-1.6/star/suntarman.mk' X#ident @(#)suntarman.mk 1.1 04/09/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= suntar XMANSECT= $(MANSECT_CMD) XMANSUFFIX= $(MANSUFF_CMD) XMANFILE= suntar.1 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/star/suntarman.mk echo x - star-1.6/star/table.c sed 's/^X//' >star-1.6/star/table.c << 'END-of-star-1.6/star/table.c' X/* @(#)table.c 1.30 17/02/08 Copyright 1994-96 2000-2017 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)table.c 1.30 17/02/08 Copyright 1994-96 2000-2017 J. Schilling"; X#endif X/* X * Conversion tables for efficient conversion X * of different file type representations X * X * Copyright (c) 1994-96 2000-2017 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include "star.h" X#include "table.h" X#include X X#ifndef S_IFIFO /* If system knows no fifo's */ X#define S_IFIFO S_IFREG /* Map fifo's to regular files */ X#endif X#ifndef S_IFCHR /* If system knows no character special */ X#define S_IFCHR S_IFREG /* Map character spec. to regular files */ X#endif X#ifndef S_IFMPC /* If system knows no multiplexed c */ X#define S_IFMPC S_IFREG /* Map multiplexed c to regular files */ X#endif X#ifndef S_IFNAM /* If system knows no named files */ X#define S_IFNAM S_IFREG /* Map named files to regular files */ X#endif X#ifndef S_IFBLK /* If system knows no block special */ X#define S_IFBLK S_IFREG /* Map block spec. to regular files */ X#endif X#ifndef S_IFMPB /* If system knows no multiplexed b */ X#define S_IFMPB S_IFREG /* Map multiplexed b to regular files */ X#endif X#ifndef S_IFCTG /* If system knows no contiguous files */ X#define S_IFCTG S_IFREG /* Map contiguous file to regular files */ X#endif X#ifndef S_IFLNK /* If system knows no symbolic links */ X#define S_IFLNK S_IFREG /* Map symbolic links to regular files */ X#endif X#ifndef S_IFSOCK /* If system knows no fifo's */ X#define S_IFSOCK S_IFREG /* Map fifo's to regular files */ X#endif X#ifndef S_IFDOOR /* If system knows no door's */ X#define S_IFDOOR S_IFREG /* Map door's to regular files */ X#endif X#ifndef S_IFWHT /* If system knows no whiteout's */ X#define S_IFWHT S_IFREG /* Map whiteout's to regular files */ X#endif X#ifndef S_IFEVC /* If system knows no eventcount's */ X#define S_IFEVC S_IFREG /* Map eventcount's to regular files */ X#endif X#define S_IFBAD S_IFMT /* XXX Have to use another val if someone */ X /* XXX starts to use S_IFMT for a */ X /* XXX useful file type */ X#define XT_NAM XT_BAD /* XXX JS has not seen it yet */ X /* XXX if we use it, we have to change */ X /* XXX table.h and some of the tables below */ X X/* X * UNIX File type to XT_ table X * X * Maps the 16 UNIX (S_XXX >> 12) filetypes to star's internal XT_ types. X * Note that this only works if all S_XXX defines are the same on all X * UNIX versions. Fortunately, this is currently the case and there is no X * big chance that somebody will do it differently. X * X * XXX If really somebody creates a different OS we will need to change this X * XXX table and the associated macros or make this table dynamically X * XXX created at startup of star. X * X * UNIX file types (see table.h): X * 0 Unallocated 1 FIFO 2 Chr special 3 MPX chr X * 4 Directory 5 NAM special 6 BLK special 7 MPX blk X * 8 Regular File 9 Contig File 10 Symlink 11 Sol Shadow ino X * 12 Socket 13 DOOR special 14 Whiteout 15 UNOS event count X * X * No bound checking in hope that S_IFMT will never hold more than 4 bits. X */ X/* BEGIN CSTYLED */ XUInt8_t iftoxt_tab[] = { X /* 0 */ XT_NONE, XT_FIFO, XT_CHR, XT_MPC, X /* 4 */ XT_DIR, XT_NAM, XT_BLK, XT_MPB, X /* 8 */ XT_FILE, XT_CONT, XT_SLINK, XT_BAD, X /*12 */ XT_SOCK, XT_DOOR, XT_WHT, XT_BAD, X }; X/* END CSTYLED */ X X/* X * Ustar File type to XT_ table X * X * Maps the ustar 0..7 filetypes to star's internal XT_ types. X * Bound checking is done via ustoxt(). X */ XUInt8_t ustoxt_tab[] = { X /* 0 */ XT_FILE, XT_LINK, XT_SLINK, XT_CHR, X /* 4 */ XT_BLK, XT_DIR, XT_FIFO, XT_CONT, X /* 8 */ XT_BAD, XT_BAD, X}; X X/* X * Vendor unique File type to XT_ table X * X * Maps the filetypes 'A'..'Z' to star's internal XT_ types. X * Fortunately, the different vendor unique extensions are disjunct. X * External code does bound checking. X */ X/* BEGIN CSTYLED */ XUInt8_t vttoxt_tab[] = { X /* A */ XT_NONE, XT_NONE, XT_NONE, XT_DUMPDIR, X /* E */ XT_NONE, XT_NONE, XT_NONE, XT_NONE, X /* I */ XT_META, XT_NONE, XT_LONGLINK, XT_LONGNAME, X /* M */ XT_MULTIVOL, XT_NAMES, XT_NONE, XT_NONE, X /* Q */ XT_NONE, XT_NONE, XT_SPARSE, XT_NONE, X /* U */ XT_NONE, XT_VOLHDR, XT_NONE, XT_NONE, X /* Y */ XT_NONE, XT_NONE, X}; X/* END CSTYLED */ X X/* X * XT_* codes used (see table.h): X * 0..16 Real file types and hard links X * 20..26 Speudo file types (POSIX 'A' .. 'Z' X * 31 XT_BAD (illegal file type) X */ X X/* X * XT_ to UNIX File type table X * X * XT_SPARSE and XT_META are just other (tar specific) views of regular files. X */ X/* BEGIN CSTYLED */ Xmode_t xttoif_tab[] = { X /* 0 */ 0, S_IFREG, S_IFCTG, S_IFREG, X /* 4 */ S_IFLNK, S_IFDIR, S_IFCHR, S_IFBLK, X /* 8 */ S_IFIFO, S_IFSOCK, S_IFMPC, S_IFMPB, X /*12 */ S_IFNAM, S_IFNAM, S_IFDOOR, S_IFEVC, X /*16 */ S_IFWHT, S_IFBAD, S_IFBAD, S_IFBAD, X /*20 */ S_IFDIR, S_IFBAD, S_IFBAD, S_IFBAD, X /*24 */ S_IFBAD, S_IFREG, S_IFBAD, S_IFREG, X /*28 */ S_IFBAD, S_IFBAD, S_IFBAD, S_IFBAD, X}; X/* END CSTYLED */ X X/* X * XT_ to Star-1985 File type table X */ X/* BEGIN CSTYLED */ XUInt8_t xttost_tab[] = { X /* 0 */ 0, F_FILE, F_FILE, F_FILE, X /* 4 */ F_SLINK, F_DIR, F_SPEC, F_SPEC, X /* 8 */ F_SPEC, F_SPEC, F_SPEC, F_SPEC, X /*12 */ F_SPEC, F_SPEC, F_SPEC, F_SPEC, X /*16 */ F_SPEC, F_SPEC, F_SPEC, F_SPEC, X /*20 */ F_DIR, F_FILE, F_FILE, F_FILE, X /*24 */ F_FILE, F_FILE, F_SPEC, F_FILE, X /*28 */ F_SPEC, F_SPEC, F_SPEC, F_SPEC, X}; X/* END CSTYLED */ X X/* X * XT_ Old UNIX V7 tar supported File type table X */ X/* BEGIN CSTYLED */ XUInt8_t xtv7tar_tab[] = { X /* 0 */ 0, 1, 1, 1, X /* 4 */ 0, 0, 0, 0, X /* 8 */ 0, 0, 0, 0, X /*12 */ 0, 0, 0, 0, X /*16 */ 0, 0, 0, 0, X /*20 */ 0, 0, 0, 0, X /*24 */ 0, 0, 0, 0, X /*28 */ 0, 0, 0, 0, X}; X/* END CSTYLED */ X X/* X * XT_ Old BSD tar supported File type table X */ X/* BEGIN CSTYLED */ XUInt8_t xttar_tab[] = { X /* 0 */ 0, 1, 1, 1, X /* 4 */ 1, 1, 0, 0, X /* 8 */ 0, 0, 0, 0, X /*12 */ 0, 0, 0, 0, X /*16 */ 0, 0, 0, 0, X /*20 */ 0, 0, 0, 0, X /*24 */ 0, 0, 0, 0, X /*28 */ 0, 0, 0, 0, X }; X/* END CSTYLED */ X X/* X * XT_ Star-1985 supported File type table X */ X/* BEGIN CSTYLED */ XUInt8_t xtstar_tab[] = { X /* 0 */ 0, 1, 1, 1, X /* 4 */ 1, 1, 1, 1, X /* 8 */ 1, 1, 1, 1, X /*12 */ 1, 1, 1, 0, X /*16 */ 0, 0, 0, 0, X /*20 */ 0, 0, 0, 0, X /*24 */ 0, 1, 0, 1, X /*28 */ 0, 0, 0, 0, X}; X/* END CSTYLED */ X X/* X * XT_ Ustar-1988 supported File type table X */ X/* BEGIN CSTYLED */ XUInt8_t xtustar_tab[] = { X /* 0 */ 0, 1, 1, 1, X /* 4 */ 1, 1, 1, 1, X /* 8 */ 1, 0, 0, 0, X /*12 */ 0, 0, 0, 0, X /*16 */ 0, 0, 0, 0, X /*20 */ 0, 0, 0, 0, X /*24 */ 0, 0, 0, 0, X /*28 */ 0, 0, 0, 0, X }; X/* END CSTYLED */ X X/* X * XT_ Extended PAX-2001 'exustar' supported File type table X */ X/* BEGIN CSTYLED */ XUInt8_t xtexustar_tab[] = { X /* 0 */ 0, 1, 1, 1, X /* 4 */ 1, 1, 1, 1, X /* 8 */ 1, 1, 0, 0, X /*12 */ 0, 0, 1, 0, X /*16 */ 0, 0, 0, 0, X /*20 */ 0, 0, 0, 0, X /*24 */ 0, 1, 0, 1, X /*28 */ 0, 0, 0, 0, X}; X/* END CSTYLED */ X X/* X * XT_ CPIO-1988 supported File type table X */ X/* BEGIN CSTYLED */ XUInt8_t xtcpio_tab[] = { X /* 0 */ 0, 1, 1, 1, X /* 4 */ 1, 1, 1, 1, X /* 8 */ 1, 1, 0, 0, X /*12 */ 0, 0, 0, 0, X /*16 */ 0, 0, 0, 0, X /*20 */ 0, 0, 0, 0, X /*24 */ 0, 0, 0, 0, X /*28 */ 0, 0, 0, 0, X}; X/* END CSTYLED */ X X/* X * XT_ to Ustar (including Vendor Unique extensions) File type table X * X * sockets cannot be handled in ansi tar, they are handled as regular files :-( X */ X/* BEGIN CSTYLED */ XUInt8_t xttous_tab[] = { X /* 0 */ 0, REGTYPE, CONTTYPE, LNKTYPE, X /* 4 */ SYMTYPE, DIRTYPE, CHRTYPE, BLKTYPE, X /* 8 */ FIFOTYPE,REGTYPE/* socket */, 0/* bad */, 0/* bad */, X /*12 */ 0, 0, 0, 0, X /*16 */ 0, 0, 0, 0, X /*20 */ LF_DUMPDIR, LF_LONGLINK, LF_LONGNAME, LF_MULTIVOL, X /*24 */ LF_NAMES, LF_SPARSE, LF_VOLHDR, LF_META, X /*28 */ 0, 0, 0, 0, X}; X/* END CSTYLED */ X X/* X * XT_ to String table X */ X/* BEGIN CSTYLED */ Xchar *xttostr_tab[] = { X#define XT_DEBUG X#ifdef XT_DEBUG X /* 0 */ "U", "-", "C", "H", X#else X /* 0 */ "-", "-", "-", "-", X#endif X /* 4 */ "l", "d", "c", "b", X /* 8 */ "p", "s", "~", "~", X /*12 */ "~", "~", "D", "~", X /*16 */ "%", "~", "~", "~", X X /*20 */ "D", "K", "L", "M", X#ifdef XT_DEBUG X /*24 */ "N", "S", "V", "m", X#else X /*24 */ "N", "-", "V", "-", X#endif X X /*28 */ "~", "~", "~", "~", X}; X/* END CSTYLED */ X X/* X * XT_ to named file type text X */ X/* BEGIN CSTYLED */ Xchar *xttoname_tab[] = { X /* 0 */ "unallocated", "regular", "contiguous", "hardlink", X /* 4 */ "symlink", "directory", "character special", "block special", X /* 8 */ "fifo", "socket", "mpx character special", "mpx block special", X /*12 */ "XENIX nsem", "XENIX nshd", "door", "eventcount", X /*16 */ "whiteout", "reserved", "reserved", "reserved", X /*20 */ "dumpdir", "longlink", "longname", "multivol continuation", X /*24 */ "names", "sparse", "volheader", "meta", X /*28 */ "reserved", "reserved", "reserved", "unknown/bad", X}; X/* END CSTYLED */ X X/* X * String lengths for above table X */ XUInt8_t xtnamelen_tab[] = { X /* 0 */ 11, 7, 10, 8, X /* 4 */ 7, 9, 17, 13, X /* 8 */ 4, 6, 21, 17, X /* 12 */ 10, 10, 4, 10, X /* 16 */ 8, 8, 8, 8, X /* 20 */ 7, 8, 8, 21, X /* 24 */ 5, 6, 9, 4, X /* 28 */ 8, 8, 8, 11, X}; END-of-star-1.6/star/table.c echo x - star-1.6/star/table.h sed 's/^X//' >star-1.6/star/table.h << 'END-of-star-1.6/star/table.h' X/* @(#)table.h 1.18 17/02/12 Copyright 1994, 1996, 2000-2017 J. Schilling */ X/* X * Conversion table definitions for efficient conversion X * of different file type representations X * X * Copyright (c) 1994, 1996, 2000-2017 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _TABLE_H X#define _TABLE_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X#ifndef _SCHILY_UTYPES_H X#include X#endif X X/* X * Unix uses the following file types X */ X#ifdef comment X 0000000 /* Unallocated */ XS_IFIFO 0010000 FIFO /* Named pipe */ XS_IFCHR 0020000 CHR /* Character special */ XS_IFMPC 0030000 /* UNUSED multiplexed c */ XS_IFDIR 0040000 DIR /* Directory */ XS_IFNAM 0050000 NAM /* Named file (XENIX) */ XS_IFBLK 0060000 BLK /* Block special */ XS_IFMPB 0070000 /* UNUSED multiplexed b */ XS_IFREG 0100000 REG /* Regular file */ XS_IFCTG 0110000 CTG /* Contiguous file */ XS_IFLNK 0120000 SLNK /* Symbolic link */ XS_IFSHAD 0130000 /* Solaris shadow inode */ XS_IFSOCK 0140000 SOCK /* UNIX domain socket */ XS_IFDOOR 0150000 /* Solaris DOOR */ XS_IFWHT 0160000 /* BSD whiteout */ X 0160200 /* Solaris cpio acl */ X 0170000 /* UNUSED on UNIX */ XS_IFEVC 0170000 /* UNOS event count */ X /* UNOS/UNIX compat only */ X#endif X X/* X * Internal table of file types. X * X * N.B. The order in this table is not important, X * new real file types may be added before XT_DUMPDIR, X * new symbolic file types may be added before XT_BAD. X */ X#define XT_NONE 0 /* unallocated file */ X#define XT_FILE 1 /* regular file */ X#define XT_CONT 2 /* contiguous file */ X#define XT_LINK 3 /* hard link (needed for internal use) */ X#define XT_SLINK 4 /* symbolic link */ X#define XT_DIR 5 /* directory */ X#define XT_CHR 6 /* character special */ X#define XT_BLK 7 /* block special */ X#define XT_FIFO 8 /* fifo (named pipe) */ X#define XT_SOCK 9 /* unix domain socket */ X#define XT_MPC 10 /* multiplexed character special */ X#define XT_MPB 11 /* multiplexed block special */ X#define XT_NSEM 12 /* XENIX named semaphore */ X#define XT_NSHD 13 /* XENIX named shared data */ X#define XT_DOOR 14 /* Solaris DOOR */ X#define XT_EVENT 15 /* UNOS Event Count */ X#define XT_WHT 16 /* BSD whiteout */ X /* ... Reserved ... */ X#define XT_DUMPDIR 20 /* Dir entry containing filenames */ X#define XT_LONGLINK 21 /* Next file on tape has a long link */ X#define XT_LONGNAME 22 /* Next file on tape has a long name */ X#define XT_MULTIVOL 23 /* Continuation of a file from another tape */ X#define XT_NAMES 24 /* OLD */ X#define XT_SPARSE 25 /* for files with holes in it */ X#define XT_VOLHDR 26 /* Tape Volume header */ X#define XT_META 27 /* Inode meta data only */ X#define XT_BAD 31 /* illegal file type */ X Xextern UInt8_t iftoxt_tab[]; Xextern UInt8_t ustoxt_tab[]; Xextern UInt8_t vttoxt_tab[]; X Xextern mode_t xttoif_tab[]; Xextern UInt8_t xttost_tab[]; Xextern UInt8_t xttous_tab[]; X Xextern UInt8_t xtv7tar_tab[]; Xextern UInt8_t xttar_tab[]; Xextern UInt8_t xtstar_tab[]; Xextern UInt8_t xtustar_tab[]; Xextern UInt8_t xtexustar_tab[]; X Xextern UInt8_t xtcpio_tab[]; X Xextern char *xttostr_tab[]; Xextern char *xttoname_tab[]; Xextern UInt8_t xtnamelen_tab[]; X X#define IFTOXT(t) (iftoxt_tab[((t)&S_IFMT)>>12]) /* UNIX to XT */ X#define USTOXT(t) (ustoxt(t)) /* ustar to XT */ X#define _USTOXT(t) (ustoxt_tab[(t)-REGTYPE]) /* ustar to XT */ X#define _VTTOXT(t) (vttoxt_tab[(t)-'A']) /* vendor to XT */ X X#define XTTOIF(t) (xttoif_tab[(t)]) /* XT to UNIX */ X#define XTTOST(t) (xttost_tab[(t)]) /* XT to star */ X#define XTTOUS(t) (xttous_tab[(t)]) /* XT to ustar */ X#define XTTOSTR(t) (xttostr_tab[(t)]) /* XT to string */ X#define XTTONAME(t) (xttoname_tab[(t)]) /* XT to name */ X X#endif /* _TABLE_H */ END-of-star-1.6/star/table.h echo x - star-1.6/star/testscripts.mk sed 's/^X//' >star-1.6/star/testscripts.mk << 'END-of-star-1.6/star/testscripts.mk' X#ident @(#)testscripts.mk 1.3 17/06/28 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X Xinstall: X rm -rf $(DEST_DIR)$(INSBASE)/share/doc/star/testscripts X mkdir -p $(DEST_DIR)$(INSBASE)/share/doc/star/testscripts X chmod 755 $(DEST_DIR)$(INSBASE)/share/doc/star/testscripts X cp -p testscripts/* $(DEST_DIR)$(INSBASE)/share/doc/star/testscripts || true X Xuninstall: X $(RM) $(RM_FORCE) $(DEST_DIR)$(INSBASE)/share/doc/star/testscripts/* X X#INSDIR= share/doc/cdrecord X#TARGET= README.copy X##XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.pkg X#include $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### END-of-star-1.6/star/testscripts.mk echo x - star-1.6/star/unicode.c sed 's/^X//' >star-1.6/star/unicode.c << 'END-of-star-1.6/star/unicode.c' X/* @(#)unicode.c 1.18 19/03/23 Copyright 2001-2019 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)unicode.c 1.18 19/03/23 Copyright 2001-2019 J. Schilling"; X#endif X/* X * Routines to convert from/to UNICODE X * X * This is currently a very simple implementation that only X * handles ISO-8859-1 coding. There should be a better solution X * in the future. X * X * Copyright (c) 2001-2019 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#define GT_COMERR /* #define comerr gtcomerr */ X#define GT_ERROR /* #define error gterror */ X#include X#ifdef __STAR__ X#include "star.h" X#include "starsubs.h" X#include "checkerr.h" X#else X#include "header.h" X#endif X XEXPORT void utf8_init __PR((int type)); XEXPORT void utf8_fini __PR((void)); XEXPORT int to_utf8 __PR((Uchar *to, int tolen, X Uchar *from, int len)); XLOCAL int _to_utf8 __PR((Uchar *to, int tolen, X Uchar *from, int len)); X#ifdef USE_ICONV XLOCAL int _to_iconv __PR((Uchar *to, int tolen, X Uchar *from, int len)); X#endif XLOCAL int _to_none __PR((Uchar *to, int tolen, X Uchar *from, int len)); XEXPORT BOOL from_utf8 __PR((Uchar *to, int tolen, X Uchar *from, int *len)); XLOCAL BOOL _from_utf8 __PR((Uchar *to, int tolen, X Uchar *from, int *len)); X#ifdef USE_ICONV XLOCAL BOOL _from_iconv __PR((Uchar *to, int tolen, X Uchar *from, int *len)); X#endif XLOCAL BOOL _from_none __PR((Uchar *to, int tolen, X Uchar *from, int *len)); X XLOCAL int (*p_to_utf8) __PR((Uchar *to, int tolen, X Uchar *from, int len)) = _to_utf8; XLOCAL BOOL (*p_from_utf8) __PR((Uchar *to, int tolen, X Uchar *from, int *len)) = _from_utf8; X XLOCAL iconv_t ic_from = (iconv_t)-1; XLOCAL iconv_t ic_to = (iconv_t)-1; X X#ifdef __STAR__ Xextern char *codeset; X#else XLOCAL const char *codeset; X XEXPORT void Xutf8_codeset(code_set) X const char *code_set; X{ X codeset = code_set; X} X#endif X X XEXPORT void Xutf8_init(type) X int type; X{ X if (codeset == NULL) X codeset = "ISO8859-1"; X#ifndef ICONV_DEBUG X if (streql(codeset, "ISO8859-1") || X streql(codeset, "ISO-8859-1") || X streql(codeset, "ISO8859_1") || X streql(codeset, "ISO_8859_1") || X streql(codeset, "8859-1") || X streql(codeset, "8859_1")) { X p_to_utf8 = _to_utf8; X p_from_utf8 = _from_utf8; X return; X } X if (streql(codeset, "UTF-8") || X streql(codeset, "UTF8") || X streql(codeset, "UTF_8")) { X p_to_utf8 = _to_none; X p_from_utf8 = _from_none; X return; X } X#endif X if (type & S_CREATE) { X#ifdef USE_ICONV X if (ic_to != (iconv_t)-1) { X iconv_close(ic_to); X } X ic_to = iconv_open("UTF-8", codeset); X#ifdef ICONV_DEBUG X fprintf(stderr, "ic_to %p\n", ic_to); X#endif X if (ic_to != (iconv_t)-1) X p_to_utf8 = _to_iconv; X else X#endif X p_to_utf8 = _to_utf8; X } X if (type & S_EXTRACT) { X#ifdef USE_ICONV X if (ic_from != (iconv_t)-1) { X iconv_close(ic_from); X } X ic_from = iconv_open(codeset, "UTF-8"); X#ifdef ICONV_DEBUG X fprintf(stderr, "ic_from %p\n", ic_from); X#endif X if (ic_from != (iconv_t)-1) X p_from_utf8 = _from_iconv; X else X#endif X p_from_utf8 = _from_utf8; X } X} X XEXPORT void Xutf8_fini() X{ X#ifdef USE_ICONV X if (ic_to != (iconv_t)-1) { X iconv_close(ic_to); X ic_to = (iconv_t)-1; X } X if (ic_from != (iconv_t)-1) { X iconv_close(ic_from); X ic_from = (iconv_t)-1; X } X#endif X} X XEXPORT int Xto_utf8(to, tolen, from, len) X register Uchar *to; X int tolen; X register Uchar *from; X register int len; X{ X return (p_to_utf8(to, tolen, from, len)); X} X X/* X * First copy len bytes from the source, convert it to UTF-8 assuming that it X * is in ISO-8859-1 encoding. Then add a final null byte. Return the number of X * characters written to the destination excluding the final null byte X * (strlen(to)). X */ XLOCAL int X_to_utf8(to, tolen, from, len) X register Uchar *to; X int tolen; X register Uchar *from; X register int len; X{ X register Uchar *oto = to; X register Uchar c; X X while (--len >= 0) { X c = *from++; X if (c <= 0x7F) { X *to++ = c; X } else if (c <= 0xBF) { X *to++ = 0xC2; X *to++ = c; X } else { /* c <= 0xFF */ X *to++ = 0xC3; X *to++ = c & 0xBF; X } X /* X * XXX We have plenty of space in "to" when weare called. X * XXX Should we check wether we did hit "tolen"? X */ X } X *to = '\0'; X return (to - oto); X} X X#ifdef USE_ICONV XLOCAL int X_to_iconv(to, tolen, from, len) X Uchar *to; X int tolen; X Uchar *from; X int len; X{ X#ifdef HAVE_ICONV_CONST X const char *fp = (char *)from; X#else X char *fp = (char *)from; X#endif X char *tp = (char *)to; X size_t frl = len; X size_t tol = tolen; X size_t ret; X X seterrno(0); X ret = iconv(ic_to, &fp, &frl, &tp, &tol); X if (tol > 0) X *tp = '\0'; X if (ret != 0) { /* Error (-1) or nonidentical translations (>0) */ X#ifdef __STAR__ X if (!errhidden(E_ICONV, (char *)from)) { X if (!errwarnonly(E_ICONV, (char *)from)) X xstats.s_iconv++; X#endif X errmsg("Cannot convert '%s' to UTF-8.\n", from); X#ifdef __STAR__ X (void) errabort(E_ICONV, (char *)from, TRUE); X } X#endif X } X /* X * Reset shift state X */ X (void) iconv(ic_to, NULL, NULL, NULL, NULL); X return (tolen - tol); X} X#endif X XLOCAL int X_to_none(to, tolen, from, len) X Uchar *to; X int tolen; X Uchar *from; X int len; X{ X *movebytes(from, to, len) = '\0'; X return (len); X} X XEXPORT BOOL Xfrom_utf8(to, tolen, from, lenp) X Uchar *to; X int tolen; X Uchar *from; X int *lenp; X{ X return (p_from_utf8(to, tolen, from, lenp)); X} X X/* X * First copy len bytes from the source and convert it from UTF-8 assuming X * ISO-8859-1 encoding. Then add a final null byte. Set *lenp to the number of X * bytes written to the destination excluding the final null byte (strlen(to)). X * Return FALSE in case that an illegal ISO-8859-1 character was seen in the X * UTF-8 stream. X */ XLOCAL BOOL X_from_utf8(to, tolen, from, lenp) X register Uchar *to; X int tolen; X register Uchar *from; X int *lenp; X{ X register Uchar *oto = to; X register Uchar c; X register BOOL ret = TRUE; X register int len = *lenp; X Uchar *endp = to + tolen; X X while (--len >= 0) { X c = *from++; X if (c <= 0x7F) { X *to++ = c; X } else if (c == 0xC0) { X *to++ = *from++ & 0x7F; X len--; X } else if (c == 0xC1) { X *to++ = (*from++ | 0x40) & 0x7F; X len--; X } else if (c == 0xC2) { X *to++ = *from++; X len--; X } else if (c == 0xC3) { X *to++ = *from++ | 0x40; X len--; X } else { X ret = FALSE; /* unknown/illegal UTF-8 char */ X *to++ = '_'; /* use default character */ X if (c < 0xE0) { X from++; /* 2 bytes in total */ X len--; X } else if (c < 0xF0) { X from += 2; /* 3 bytes in total */ X len -= 2; X } else if (c < 0xF8) { X from += 3; /* 4 bytes in total */ X len -= 3; X } else if (c < 0xFC) { X from += 4; /* 5 bytes in total */ X len -= 4; X } else if (c < 0xFE) { X from += 5; /* 6 bytes in total */ X len -= 5; X } else { X while (len > 0) { X c = *from; X /* X * Test for 7 bit ASCII + non prefix X */ X if (c <= 0xBF) X break; X from++; X len--; X } X } X } X /* X * It is easy to check, since the result is always only one X * character. We need to stop here since the new path handling X * may need to grow the result in case of an overflow. X */ X if (to >= endp) X break; X } X if (to < endp) X *to = '\0'; X *lenp = (to - oto); X return (ret); X} X X#ifdef USE_ICONV XLOCAL BOOL X_from_iconv(to, tolen, from, len) X Uchar *to; X int tolen; X Uchar *from; X int *len; X{ X#ifdef HAVE_ICONV_CONST X const char *fp = (char *)from; X#else X char *fp = (char *)from; X#endif X char *tp = (char *)to; X size_t frl = *len; X size_t tol = tolen; X size_t ret; X BOOL rc = TRUE; X X seterrno(0); X ret = iconv(ic_from, &fp, &frl, &tp, &tol); X if (tol > 0) X *tp = '\0'; X *len = tolen - tol; X if (ret == -1 && geterrno() == E2BIG) { X /* X * in case of an overflow signal this via *len, X * note that "tol" may be 0 in such a case. X */ X *len = tolen; X rc = FALSE; X } else if (ret != 0) { /* -1 or # of nonidentical translations (>0) */ X#ifdef __STAR__ X if (!errhidden(E_ICONV, (char *)from)) { X if (!errwarnonly(E_ICONV, (char *)from)) X xstats.s_iconv++; X#endif X errmsg("Cannot convert '%s' to local charset.\n", from); X#ifdef __STAR__ X (void) errabort(E_ICONV, (char *)from, TRUE); X } X#endif X rc = FALSE; X } X /* X * Reset shift state X */ X (void) iconv(ic_from, NULL, NULL, NULL, NULL); X return (rc); X} X#endif X XLOCAL BOOL X_from_none(to, tolen, from, len) X Uchar *to; X int tolen; X Uchar *from; X int *len; X{ X *movebytes(from, to, *len) = '\0'; X return (TRUE); X} END-of-star-1.6/star/unicode.c echo x - star-1.6/star/volhdr.c sed 's/^X//' >star-1.6/star/volhdr.c << 'END-of-star-1.6/star/volhdr.c' X/* @(#)volhdr.c 1.45 19/03/09 Copyright 1994, 2003-2019 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)volhdr.c 1.45 19/03/09 Copyright 1994, 2003-2019 J. Schilling"; X#endif X/* X * Volume header related routines. X * X * Copyright (c) 1994, 2003-2019 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X X#include X#include X#include X#include X#include "star.h" X#include "props.h" X#include "table.h" X#include X#include X#define __XDEV__ /* Needed to activate _dev_major()/_dev_minor() */ X#include X#define GT_COMERR /* #define comerr gtcomerr */ X#define GT_ERROR /* #define error gterror */ X#include X#include X#include "starsubs.h" X#include "dumpdate.h" X#include "xtab.h" X#include "fifo.h" X Xextern FILE *vpr; Xextern BOOL multivol; Xextern BOOL binflag; Xextern long chdrtype; Xextern char *vers; Xextern int verbose; Xextern Ullong tsize; Xextern BOOL ghdr; X Xextern struct timespec ddate; /* The current dump date */ X Xextern m_stats *stats; X Xextern GINFO *gip; /* Global information pointer */ Xextern GINFO *grip; /* Global read info pointer */ X XEXPORT void ginit __PR((void)); XEXPORT void grinit __PR((void)); XLOCAL int xstrcpy __PR((char **newp, char *old, char *p, int len)); XEXPORT void gipsetup __PR((GINFO *gp)); XEXPORT void griprint __PR((GINFO *gp)); XEXPORT BOOL verifyvol __PR((char *buf, int amt, int volno, int *skipp)); XLOCAL BOOL vrfy_gvolhdr __PR((char *buf, int amt, int volno, int *skipp)); XEXPORT char *dt_name __PR((int type)); XEXPORT int dt_type __PR((char *name)); XEXPORT void put_release __PR((void)); XEXPORT void put_archtype __PR((void)); XEXPORT void put_gvolhdr __PR((char *name)); XEXPORT void put_volhdr __PR((char *name, BOOL putv)); XEXPORT void put_svolhdr __PR((char *name)); XEXPORT void put_multhdr __PR((off_t size, off_t off)); XEXPORT BOOL get_volhdr __PR((FINFO *info, char *vhname)); XLOCAL void get_label __PR((FINFO *info, char *keyword, int klen, char *arg, int len)); XLOCAL void get_hostname __PR((FINFO *info, char *keyword, int klen, char *arg, int len)); XLOCAL void get_filesys __PR((FINFO *info, char *keyword, int klen, char *arg, int len)); XLOCAL void get_cwd __PR((FINFO *info, char *keyword, int klen, char *arg, int len)); XLOCAL void get_device __PR((FINFO *info, char *keyword, int klen, char *arg, int len)); XLOCAL void get_dumptype __PR((FINFO *info, char *keyword, int klen, char *arg, int len)); XLOCAL void get_dumplevel __PR((FINFO *info, char *keyword, int klen, char *arg, int len)); XLOCAL void get_reflevel __PR((FINFO *info, char *keyword, int klen, char *arg, int len)); XLOCAL void get_dumpdate __PR((FINFO *info, char *keyword, int klen, char *arg, int len)); XLOCAL void get_refdate __PR((FINFO *info, char *keyword, int klen, char *arg, int len)); XLOCAL void get_volno __PR((FINFO *info, char *keyword, int klen, char *arg, int len)); XLOCAL void get_blockoff __PR((FINFO *info, char *keyword, int klen, char *arg, int len)); XLOCAL void get_blocksize __PR((FINFO *info, char *keyword, int klen, char *arg, int len)); XLOCAL void get_tapesize __PR((FINFO *info, char *keyword, int klen, char *arg, int len)); X X/* X * Important for the correctness of gen_number(): As long as we stay <= 55 X * chars for the keyword, a 128 bit number entry will fit into 100 chars. X */ XEXPORT xtab_t volhtab[] = { X { "SCHILY.volhdr.label", 19, get_label, 0 }, X { "SCHILY.volhdr.hostname", 22, get_hostname, 0 }, X { "SCHILY.volhdr.filesys", 21, get_filesys, 0 }, X { "SCHILY.volhdr.cwd", 17, get_cwd, 0 }, X { "SCHILY.volhdr.device", 20, get_device, 0 }, X { "SCHILY.volhdr.dumptype", 22, get_dumptype, 0 }, X { "SCHILY.volhdr.dumplevel", 23, get_dumplevel, 0 }, X { "SCHILY.volhdr.reflevel", 22, get_reflevel, 0 }, X { "SCHILY.volhdr.dumpdate", 22, get_dumpdate, 0 }, X { "SCHILY.volhdr.refdate", 21, get_refdate, 0 }, X { "SCHILY.volhdr.volno", 19, get_volno, 0 }, X { "SCHILY.volhdr.blockoff", 22, get_blockoff, 0 }, X { "SCHILY.volhdr.blocksize", 23, get_blocksize, 0 }, X { "SCHILY.volhdr.tapesize", 22, get_tapesize, 0 }, X X { NULL, 0, NULL, 0 }}; X XEXPORT void Xginit() X{ Xextern int dumplevel; Xextern int nblocks; X X gip->label = NULL; X gip->hostname = NULL; X gip->filesys = NULL; X gip->cwd = NULL; X gip->device = NULL; X gip->release = vers; X gip->archtype = chdrtype; X gip->dumptype = 0; X gip->dumplevel = dumplevel; X gip->reflevel = -1; X gip->dumpdate = ddate; X gip->refdate.tv_sec = 0; X gip->refdate.tv_nsec = 0; X gip->volno = 1; X gip->tapesize = tsize; X gip->blockoff = 0; X gip->blocksize = nblocks; X gip->gflags = GF_RELEASE|GF_DUMPLEVEL|GF_REFLEVEL|GF_DUMPDATE| X GF_VOLNO|GF_TAPESIZE|GF_BLOCKOFF|GF_BLOCKSIZE; X} X XEXPORT void Xgrinit() X{ X if (grip->label) { X if ((grip->gflags & GF_NOALLOC) == 0) X free(grip->label); X grip->label = NULL; X } X if (grip->hostname) { X if ((grip->gflags & GF_NOALLOC) == 0) X free(grip->hostname); X grip->hostname = NULL; X } X if (grip->filesys) { X if ((grip->gflags & GF_NOALLOC) == 0) X free(grip->filesys); X grip->filesys = NULL; X } X if (grip->cwd) { X if ((grip->gflags & GF_NOALLOC) == 0) X free(grip->cwd); X grip->cwd = NULL; X } X if (grip->device) { X if ((grip->gflags & GF_NOALLOC) == 0) X free(grip->device); X grip->device = NULL; X } X if (grip->release) { X if ((grip->gflags & GF_NOALLOC) == 0) X free(grip->release); X grip->release = NULL; X } X grip->archtype = H_UNDEF; X grip->dumptype = 0; X grip->dumplevel = 0; X grip->reflevel = 0; X grip->dumpdate.tv_sec = 0; X grip->dumpdate.tv_nsec = 0; X grip->refdate.tv_sec = 0; X grip->refdate.tv_nsec = 0; X grip->volno = 0; X grip->tapesize = 0; X grip->blockoff = 0; X grip->blocksize = 0; X grip->gflags = 0; X} X X/* X * A special string copy that is used copy strings into the limited space X * in the shared memory. X */ XLOCAL int Xxstrcpy(newp, old, p, len) X char **newp; X char *old; X char *p; X int len; X{ X int slen; X X if (old == NULL) X return (0); X X slen = strlen(old) + 1; X if (slen > len) X return (0); X *newp = p; X strncpy(p, old, len); X p[len-1] = '\0'; X X return (slen); X} X X/* X * Set up the global GINFO *gip structure from a structure that just X * has been read from the information on the current medium. X * This structure is inside the shared memory if we are using the fifo. X */ XEXPORT void Xgipsetup(gp) X GINFO *gp; X{ X#ifdef FIFO Xextern m_head *mp; Xextern BOOL use_fifo; X#endif X if (gip->gflags & GF_MINIT) { X return; X } X *gip = *gp; X gip->label = NULL; X gip->hostname = NULL; X gip->filesys = NULL; X gip->cwd = NULL; X gip->device = NULL; X gip->release = NULL; X X#ifdef FIFO X if (use_fifo) { X char *p = (char *)&gip[1]; X int len = mp->rsize; X int slen; X X slen = xstrcpy(&gip->label, gp->label, p, len); X p += slen; X len -= slen; X slen = xstrcpy(&gip->filesys, gp->filesys, p, len); X p += slen; X len -= slen; X slen = xstrcpy(&gip->cwd, gp->cwd, p, len); X p += slen; X len -= slen; X slen = xstrcpy(&gip->hostname, gp->hostname, p, len); X p += slen; X len -= slen; X slen = xstrcpy(&gip->release, gp->release, p, len); X p += slen; X len -= slen; X slen = xstrcpy(&gip->device, gp->device, p, len); X p += slen; X len -= slen; X gip->gflags |= GF_NOALLOC; X } else X#endif X { X if (gp->label) { X if (gip->label) X free(gip->label); X gip->label = ___savestr(gp->label); X } X if (gp->filesys) { X if (gip->filesys) X free(gip->filesys); X gip->filesys = ___savestr(gp->filesys); X } X if (gp->cwd) { X if (gip->cwd) X free(gip->cwd); X gip->cwd = ___savestr(gp->cwd); X } X if (gp->hostname) { X if (gip->hostname) X free(gip->hostname); X gip->hostname = ___savestr(gp->hostname); X } X if (gp->release) { X if (gip->release) X free(gip->release); X gip->release = ___savestr(gp->release); X } X if (gp->device) { X if (gip->device) X free(gip->device); X gip->device = ___savestr(gp->device); X } X } X if (gp->volno > 1) /* Allow to start with vol # != 1 */ X stats->volno = gp->volno; X gip->gflags |= GF_MINIT; X} X XEXPORT void Xgriprint(gp) X GINFO *gp; X{ X register FILE *f = vpr; X X if (verbose <= 0) X return; X X if (gp->label) X fgtprintf(f, "Label %s\n", gp->label); X X if (gp->hostname) X fgtprintf(f, "Host name %s\n", gp->hostname); X X if (gp->filesys) X fgtprintf(f, "File system %s\n", gp->filesys); X X if (gp->cwd) X fgtprintf(f, "Working dir %s\n", gp->cwd); X X if (gp->device) X fgtprintf(f, "Device %s\n", gp->device); X X if (gp->release) X fgtprintf(f, "Release %s\n", gp->release); X X if (gp->archtype != H_UNDEF) X fgtprintf(f, "Archtype %s\n", hdr_name(gp->archtype)); X X if (gp->gflags & GF_DUMPTYPE) X fgtprintf(f, "Dumptype %s\n", dt_name(gp->dumptype)); X X if (gp->gflags & GF_DUMPLEVEL) X fgtprintf(f, "Dumplevel %d\n", gp->dumplevel); X X if (gp->gflags & GF_REFLEVEL) X fgtprintf(f, "Reflevel %d\n", gp->reflevel); X X if (gp->gflags & GF_DUMPDATE) { X fgtprintf(f, "Dumpdate %lld.%9.9lld (%s)\n", X (Llong)gp->dumpdate.tv_sec, X (Llong)gp->dumpdate.tv_nsec, X dumpdate(&gp->dumpdate)); X } X if (gp->gflags & GF_REFDATE) { X fgtprintf(f, "Refdate %lld.%9.9lld (%s)\n", X (Llong)gp->refdate.tv_sec, X (Llong)gp->refdate.tv_nsec, X dumpdate(&gp->refdate)); X } X if (gp->gflags & GF_VOLNO) X fgtprintf(f, "Volno %d\n", gp->volno); X if (gp->gflags & GF_BLOCKOFF) X fgtprintf(f, "Blockoff %llu records\n", gp->blockoff); X if (gp->gflags & GF_BLOCKSIZE) X fprintf(f, "Blocksize %d records\n", gp->blocksize); X if (gp->gflags & GF_TAPESIZE) X fgtprintf(f, "Tapesize %llu records\n", gp->tapesize); X} X XEXPORT BOOL Xverifyvol(buf, amt, volno, skipp) X char *buf; X int amt; X int volno; X int *skipp; X{ X TCB *ptb = (TCB *)buf; X X *skipp = 0; X X /* X * Minimale Blockgroesse ist 2,5k X * 'g' Header, 512 Byte Content and a 'V' header X */ X if (ptb->ustar_dbuf.t_typeflag == 'g') { X if (pr_validtype(ptb->ustar_dbuf.t_typeflag) && X tarsum_ok(ptb)) X return (vrfy_gvolhdr(buf, amt, volno, skipp)); X } X if (ptb->ustar_dbuf.t_typeflag == 'x') { X if (pr_validtype(ptb->ustar_dbuf.t_typeflag) && X tarsum_ok(ptb)) { X Ullong ull; X int xlen; X X stolli(ptb->dbuf.t_size, &ull); X xlen = ull; X xlen = 1 + tarblocks(xlen); X *skipp += xlen; X ptb = (TCB *)&((char *)ptb)[*skipp * TBLOCK]; X } X } X X if (ptb->ustar_dbuf.t_typeflag == 'V' || X ptb->ustar_dbuf.t_typeflag == 'M') { X if (pr_validtype(ptb->ustar_dbuf.t_typeflag) && X tarsum_ok(ptb)) { X *skipp += 1; X ptb = (TCB *)&buf[*skipp * TBLOCK]; X } X } X return (TRUE); X} X XLOCAL BOOL Xvrfy_gvolhdr(buf, amt, volno, skipp) X char *buf; X int amt; X int volno; X int *skipp; X{ X TCB *ptb = (TCB *)buf; X FINFO finfo; X Ullong ull; X int xlen = amt - TBLOCK - 1; X char *p = &buf[TBLOCK]; X char *ep; X char ec; X Llong bytes; X Llong blockoff; X BOOL ret = FALSE; X X fillbytes((char *)&finfo, sizeof (finfo), '\0'); X finfo.f_tcb = ptb; X X if (init_pspace(PS_STDERR, &finfo.f_pname) < 0) X return (FALSE); X if (init_pspace(PS_STDERR, &finfo.f_plname) < 0) X return (FALSE); X X finfo.f_name = finfo.f_pname.ps_path; X finfo.f_lname = finfo.f_plname.ps_path; X X /* X * File size is strlen of extended header X */ X stolli(ptb->dbuf.t_size, &ull); X if (xlen > ull) X xlen = ull; X X grinit(); /* Clear/initialize current GINFO read struct */ X ep = p+xlen; X ec = *ep; X *ep = '\0'; X xhparse(&finfo, p, p+xlen); X *ep = ec; X griprint(grip); X X /* X * Return TRUE (no skip) if this was not a volume continuation header. X */ X if ((grip->gflags & GF_VOLNO) == 0) { X ret = TRUE; X goto out; X } X X if ((gip->dumpdate.tv_sec != grip->dumpdate.tv_sec) || X (gip->dumpdate.tv_nsec != grip->dumpdate.tv_nsec)) { X errmsgno(EX_BAD, X "Dump date %s does not match expected", X dumpdate(&grip->dumpdate)); X error(" %s\n", dumpdate(&gip->dumpdate)); X ret = FALSE; X goto out; X } X if (volno != grip->volno) { X errmsgno(EX_BAD, X "Volume number %d does not match expected %d\n", X grip->volno, volno); X ret = FALSE; X goto out; X } X bytes = stats->Tblocks * (Llong)stats->blocksize + stats->Tparts; X blockoff = bytes / TBLOCK; X /* X * In case we did start past Volume #1, we need to add X * the offset of the first volume we did see. X */ X blockoff += gip->blockoff; X X if (grip->blockoff != 0 && X blockoff != grip->blockoff) { X comerrno(EX_BAD, X "Volume offset %lld does not match expected %lld\n", X grip->blockoff, blockoff); X /* NOTREACHED */ X } X X *skipp += 1 + tarblocks(xlen); X X /* X * Hier muß noch ein 'V' Header hin, sonst ist das Archiv nicht X * konform zum POSIX Standard. X * Alternativ kann aber auch ein 'M'ultivol continuation Header stehen. X */ X ptb = (TCB *)&buf[(1 + tarblocks(xlen)) * TBLOCK]; X X if (ptb->ustar_dbuf.t_typeflag == 'x') { X if (pr_validtype(ptb->ustar_dbuf.t_typeflag) && X tarsum_ok(ptb)) { X stolli(ptb->dbuf.t_size, &ull); X xlen = ull; X xlen = 1 + tarblocks(xlen); X *skipp += xlen; X ptb = (TCB *)&((char *)ptb)[xlen * TBLOCK]; X } X } X X if (ptb->ustar_dbuf.t_typeflag == 'V' || X ptb->ustar_dbuf.t_typeflag == 'M') { X if (pr_validtype(ptb->ustar_dbuf.t_typeflag) && X tarsum_ok(ptb)) { X *skipp += 1; X } X } X ret = TRUE; X Xout: X free_pspace(&finfo.f_pname); X free_pspace(&finfo.f_plname); X return (ret); X} X XEXPORT char * Xdt_name(type) X int type; X{ X switch (type) { X X case DT_NONE: return ("none"); X case DT_FULL: return ("full"); X case DT_PARTIAL: return ("partial"); X default: return ("unknown"); X } X} X XEXPORT int Xdt_type(name) X char *name; X{ X if (streql(name, "none")) { X return (DT_NONE); X } else if (streql(name, "full")) { X return (DT_FULL); X } else if (streql(name, "partial")) { X return (DT_PARTIAL); X } else { X return (DT_UNKN); X } X} X X XEXPORT void Xput_release() X{ X if ((props.pr_flags & PR_VU_XHDR) == 0 || props.pr_xc != 'x') X return; X X /* X * We may change this in future when more tar implementations X * implement POSIX.1-2001 X */ X if (H_TYPE(chdrtype) == H_XUSTAR) X return; X X gen_text("SCHILY.release", vers, -1, 0); X X ghdr = TRUE; X} X XEXPORT void Xput_archtype() X{ X if ((props.pr_flags & PR_VU_XHDR) == 0 || props.pr_xc != 'x') X return; X X /* X * We may change this in future when more tar implementations X * implement POSIX.1-2001 X */ X if (H_TYPE(chdrtype) == H_XUSTAR) X return; X X gen_text("SCHILY.archtype", hdr_name(chdrtype), -1, 0); X X ghdr = TRUE; X} X XEXPORT void Xput_gvolhdr(name) X char *name; X{ X char nbuf[1024]; X X if ((props.pr_flags & PR_VU_XHDR) == 0 || props.pr_xc != 'x') X return; X X /* X * We may change this in future when more tar implementations X * implement POSIX.1-2001 X */ X if (H_TYPE(chdrtype) == H_XUSTAR) X return; X X#ifndef DEV_MINOR_NONCONTIG X gen_unumber("SCHILY.devminorbits", minorbits); X#endif X X gip->label = name; X if (gip->dumplevel >= 0) { X nbuf[0] = '\0'; X gethostname(nbuf, sizeof (nbuf)); X gip->hostname = ___savestr(nbuf); X } X X if (gip->label) X gen_text("SCHILY.volhdr.label", gip->label, -1, 0); X if (gip->hostname) X gen_text("SCHILY.volhdr.hostname", gip->hostname, -1, 0); X if (gip->filesys) X gen_text("SCHILY.volhdr.filesys", gip->filesys, -1, 0); X if (gip->cwd) X gen_text("SCHILY.volhdr.cwd", gip->cwd, -1, 0); X if (gip->device) X gen_text("SCHILY.volhdr.device", gip->device, -1, 0); X X if (gip->dumptype > 0) X gen_text("SCHILY.volhdr.dumptype", dt_name(gip->dumptype), -1, 0); X if (gip->dumplevel >= 0) X gen_number("SCHILY.volhdr.dumplevel", gip->dumplevel); X if (gip->reflevel >= 0) X gen_number("SCHILY.volhdr.reflevel", gip->reflevel); X X gen_xtime("SCHILY.volhdr.dumpdate", gip->dumpdate.tv_sec, gip->dumpdate.tv_nsec); X if (gip->refdate.tv_sec) X gen_xtime("SCHILY.volhdr.refdate", gip->refdate.tv_sec, gip->refdate.tv_nsec); X X if (gip->volno > 0) X gen_number("SCHILY.volhdr.volno", gip->volno); X if (gip->blockoff > 0) X gen_number("SCHILY.volhdr.blockoff", gip->blockoff); X if (gip->blocksize > 0) X gen_number("SCHILY.volhdr.blocksize", gip->blocksize); X if (gip->tapesize > 0) X gen_number("SCHILY.volhdr.tapesize", gip->tapesize); X X if (binflag) X gen_text("hdrcharset", "BINARY", -1, 0); X X if ((xhsize() + 2 * TBLOCK) > (gip->blocksize * TBLOCK)) { X errmsgno(EX_BAD, "Panic: Tape record size too small.\n"); X comerrno(EX_BAD, "Panic: Shorten label or increase tape block size.\n"); X } X ghdr = TRUE; X} X XEXPORT void Xput_volhdr(name, putv) X char *name; X BOOL putv; X{ Xextern Ullong tsize; X X if ((multivol || tsize > 0) && name == 0) X name = ""; X X put_gvolhdr(name); X X if (name == 0) X return; X X if (!putv) X return; /* Only a 'g' header is needed */ X X put_svolhdr(name); X} X XEXPORT void Xput_svolhdr(name) X char *name; X{ X FINFO finfo; X TCB tb; X X if ((props.pr_flags & PR_VOLHDR) == 0) X return; X X if (name == 0 || *name == '\0') X name = ""; X X fillbytes((char *)&finfo, sizeof (FINFO), '\0'); X filltcb(&tb); X finfo.f_name = name; X finfo.f_namelen = strlen(name); X finfo.f_xftype = XT_VOLHDR; X finfo.f_rxftype = XT_VOLHDR; X finfo.f_mtime = ddate.tv_sec; X finfo.f_mnsec = ddate.tv_nsec; X finfo.f_atime = gip->volno; X finfo.f_ansec = 0; X finfo.f_tcb = &tb; X finfo.f_xflags = XF_NOTIME; X X if (!name_to_tcb(&finfo, &tb)) /* Name too long */ X return; X X info_to_tcb(&finfo, &tb); X put_tcb(&tb, &finfo); X vprint(&finfo); X} X XEXPORT void Xput_multhdr(size, off) X off_t size; X off_t off; X{ Xextern BOOL dodump; X FINFO finfo; X TCB tb; X TCB *mptb; X BOOL ododump = dodump; X X fillbytes((char *)&finfo, sizeof (finfo), '\0'); X X if ((mptb = (TCB *)get_block(TBLOCK)) == NULL) X mptb = &tb; X else X finfo.f_flags |= F_TCB_BUF; X filltcb(mptb); X strcpy(mptb->dbuf.t_name, "././@MultHeader"); X finfo.f_mode = TUREAD|TUWRITE; X finfo.f_size = size; X finfo.f_rsize = size - off; X finfo.f_contoffset = off; X finfo.f_xftype = XT_MULTIVOL; X finfo.f_rxftype = XT_MULTIVOL; X if (props.pr_flags & PR_XHDR) X finfo.f_xflags |= XF_NOTIME|XF_REALSIZE|XF_OFFSET; X X info_to_tcb(&finfo, mptb); X X dodump = FALSE; X put_tcb(mptb, &finfo); X dodump = ododump; X} X XEXPORT BOOL Xget_volhdr(info, vhname) X FINFO *info; X char *vhname; X{ X error("Volhdr: %s\n", info->f_name); X X if (vhname) { X if (!streql(info->f_name, vhname)) X return (FALSE); X } X X return (TRUE); X} X X/* ARGSUSED */ XLOCAL void Xget_label(info, keyword, klen, arg, len) X FINFO *info; X char *keyword; X int klen; X char *arg; X int len; X{ X grip->gflags |= GF_LABEL; X grip->label = ___savestr(arg); X} X X/* ARGSUSED */ XLOCAL void Xget_hostname(info, keyword, klen, arg, len) X FINFO *info; X char *keyword; X int klen; X char *arg; X int len; X{ X grip->gflags |= GF_HOSTNAME; X grip->hostname = ___savestr(arg); X} X X/* ARGSUSED */ XLOCAL void Xget_filesys(info, keyword, klen, arg, len) X FINFO *info; X char *keyword; X int klen; X char *arg; X int len; X{ X grip->gflags |= GF_FILESYS; X grip->filesys = ___savestr(arg); X} X X/* ARGSUSED */ XLOCAL void Xget_cwd(info, keyword, klen, arg, len) X FINFO *info; X char *keyword; X int klen; X char *arg; X int len; X{ X grip->gflags |= GF_CWD; X grip->cwd = ___savestr(arg); X} X X/* ARGSUSED */ XLOCAL void Xget_device(info, keyword, klen, arg, len) X FINFO *info; X char *keyword; X int klen; X char *arg; X int len; X{ X grip->gflags |= GF_DEVICE; X grip->device = ___savestr(arg); X} X X/* ARGSUSED */ XLOCAL void Xget_dumptype(info, keyword, klen, arg, len) X FINFO *info; X char *keyword; X int klen; X char *arg; X int len; X{ X if (len == 0) { X grip->gflags &= ~GF_DUMPTYPE; X grip->dumptype = 0; X return; X } X grip->dumptype = dt_type(arg); X if (grip->dumptype == DT_UNKN) X errmsgno(EX_BAD, "Unknown dump type '%s'\n", arg); X else X grip->gflags |= GF_DUMPTYPE; X} X X/* ARGSUSED */ XLOCAL void Xget_dumplevel(info, keyword, klen, arg, len) X FINFO *info; X char *keyword; X int klen; X char *arg; X int len; X{ X Ullong ull; X X if (len == 0) { X grip->gflags &= ~GF_DUMPLEVEL; X grip->dumplevel = 0; X return; X } X if (get_unumber(keyword, arg, &ull, 1000)) { X grip->gflags |= GF_DUMPLEVEL; X grip->dumplevel = ull; X if (grip->dumplevel != ull) { X xh_rangeerr(keyword, arg, len); X grip->dumplevel = 0; X } X } X} X X/* ARGSUSED */ XLOCAL void Xget_reflevel(info, keyword, klen, arg, len) X FINFO *info; X char *keyword; X int klen; X char *arg; X int len; X{ X Ullong ull; X X if (len == 0) { X grip->gflags &= ~GF_REFLEVEL; X grip->reflevel = 0; X return; X } X if (get_unumber(keyword, arg, &ull, 1000)) { X grip->gflags |= GF_REFLEVEL; X grip->reflevel = ull; X if (grip->reflevel != ull) { X xh_rangeerr(keyword, arg, len); X grip->reflevel = 0; X } X } X} X X/* ARGSUSED */ XLOCAL void Xget_dumpdate(info, keyword, klen, arg, len) X FINFO *info; X char *keyword; X int klen; X char *arg; X int len; X{ X long nsec; X time_t t; /* FreeBSD/MacOS X have broken tv_sec/time_t */ X X if (len == 0) { X grip->gflags &= ~GF_DUMPDATE; X grip->dumpdate.tv_sec = 0; X grip->dumpdate.tv_nsec = 0; X return; X } X if (get_xtime(keyword, arg, len, &t, &nsec)) { X grip->gflags |= GF_DUMPDATE; X grip->dumpdate.tv_sec = t; X grip->dumpdate.tv_nsec = nsec; X } X} X X/* ARGSUSED */ XLOCAL void Xget_refdate(info, keyword, klen, arg, len) X FINFO *info; X char *keyword; X int klen; X char *arg; X int len; X{ X long nsec; X time_t t; /* FreeBSD/MacOS X have broken tv_sec/time_t */ X X if (len == 0) { X grip->gflags &= ~GF_REFDATE; X grip->refdate.tv_sec = 0; X grip->refdate.tv_nsec = 0; X return; X } X if (get_xtime(keyword, arg, len, &t, &nsec)) { X grip->gflags |= GF_REFDATE; X grip->refdate.tv_sec = t; X grip->refdate.tv_nsec = nsec; X } X} X X/* ARGSUSED */ XLOCAL void Xget_volno(info, keyword, klen, arg, len) X FINFO *info; X char *keyword; X int klen; X char *arg; X int len; X{ X Ullong ull; X X if (len == 0) { X grip->gflags &= ~GF_VOLNO; X grip->volno = 0; X return; X } X if (get_unumber(keyword, arg, &ull, INT_MAX)) { X grip->gflags |= GF_VOLNO; X grip->volno = ull; X if (grip->volno != ull) { X xh_rangeerr(keyword, arg, len); X grip->volno = 0; X } X } X} X X/* ARGSUSED */ XLOCAL void Xget_blockoff(info, keyword, klen, arg, len) X FINFO *info; X char *keyword; X int klen; X char *arg; X int len; X{ X Ullong ull; X X if (len == 0) { X grip->gflags &= ~GF_BLOCKOFF; X grip->blockoff = 0; X return; X } X if (get_unumber(keyword, arg, &ull, ULLONG_MAX)) { X grip->gflags |= GF_BLOCKOFF; X grip->blockoff = ull; X if (grip->blockoff != ull) { X xh_rangeerr(keyword, arg, len); X grip->blockoff = 0; X } X } X} X X/* ARGSUSED */ XLOCAL void Xget_blocksize(info, keyword, klen, arg, len) X FINFO *info; X char *keyword; X int klen; X char *arg; X int len; X{ X Ullong ull; X X if (len == 0) { X grip->gflags &= ~GF_BLOCKSIZE; X grip->blocksize = 0; X return; X } X if (get_unumber(keyword, arg, &ull, INT_MAX)) { X grip->gflags |= GF_BLOCKSIZE; X grip->blocksize = ull; X if (grip->blocksize != ull) { X xh_rangeerr(keyword, arg, len); X grip->blocksize = 0; X } X } X} X X/* ARGSUSED */ XLOCAL void Xget_tapesize(info, keyword, klen, arg, len) X FINFO *info; X char *keyword; X int klen; X char *arg; X int len; X{ X Ullong ull; X X if (len == 0) { X grip->gflags &= ~GF_TAPESIZE; X grip->tapesize = 0; X return; X } X if (get_unumber(keyword, arg, &ull, ULLONG_MAX)) { X grip->gflags |= GF_TAPESIZE; X grip->tapesize = ull; X if (grip->tapesize != ull) { X xh_rangeerr(keyword, arg, len); X grip->tapesize = 0; X } X } X} END-of-star-1.6/star/volhdr.c echo x - star-1.6/star/xattr.c sed 's/^X//' >star-1.6/star/xattr.c << 'END-of-star-1.6/star/xattr.c' X/* @(#)xattr.c 1.22 18/08/06 Copyright 2003-2018 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)xattr.c 1.22 18/08/06 Copyright 2003-2018 J. Schilling"; X#endif X/* X * Handle Extended File Attributes on Linux X * X * Copyright (c) 2003-2018 J. Schilling X * Thanks to Anreas Grünbacher for the X * first implemenation. X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#if defined(HAVE_SYS_XATTR_H) X#include X#else X#if defined(HAVE_ATTR_XATTR_H) X#include X#endif /* HAVE_ATTR_XATTR_H */ X#endif /* HAVE_SYS_XATTR_H */ X#include "star.h" X#include X#include X#define GT_COMERR /* #define comerr gtcomerr */ X#define GT_ERROR /* #define error gterror */ X#include X#include "starsubs.h" X#include "checkerr.h" X X#if defined(USE_XATTR) && defined(HAVE_LISTXATTR) && defined(HAVE_GETXATTR) X/* X * Use a global list of extended attributes -- FINFO structs have no X * constructors and destructors. X */ X/* X * It bad to see new global variables while we are working on a star library. X */ XLOCAL star_xattr_t *static_xattr; X#endif X X#ifdef USE_SELINUX Xextern BOOL selinux_enabled; X#endif X X#ifdef XATTR_NOFOLLOW /* Max OS X has incompatible prototypes */ X X/* X * This works since we currently only use lgetxattr()/lsetxattr()/llistxattr() X * but not getxattr()/setxattr()/listxattr(). If we ever need the latter, X * we would need to use a different macro names to be able to abstract from X * the differences between Linux and Mac OS X. X */ X#define lgetxattr(p, n, v, s) getxattr(p, n, v, s, 0, XATTR_NOFOLLOW) X#define lsetxattr(p, n, v, s, f) setxattr(p, n, v, s, 0, (f)|XATTR_NOFOLLOW) X#define llistxattr(p, nb, s) listxattr(p, nb, s, XATTR_NOFOLLOW) X X#else /* !XATTR_NOFOLLOW */ X/* X * This is for Linux X */ X#if defined(HAVE_GETXATTR) && !defined(HAVE_LGETXATTR) X#define lgetxattr getxattr X#endif X#if defined(HAVE_SETXATTR) && !defined(HAVE_LSETXATTR) X#define lsetxattr setxattr X#endif X#if defined(HAVE_LISTXATTR) && !defined(HAVE_LLISTXATTR) X#define llistxattr listxattr X#endif X#endif /* !XATTR_NOFOLLOW */ X XEXPORT void Xopt_xattr() X{ X#if defined(USE_XATTR) && \ X (defined(HAVE_LISTXATTR) || defined(HAVE_LLISTXATTR)) && \ X (defined(HAVE_GETXATTR) || defined(HAVE_LGETXATTR)) X#if defined(HAVE_SETXATTR) || defined(HAVE_LSETXATTR) X printf(" Linux-xattr"); X#endif X#endif X} X XEXPORT void Xopt_selinux() X{ X#ifdef USE_SELINUX X printf(" SELinux"); X#endif X} X X/* ARGSUSED */ XEXPORT BOOL Xget_xattr(info) X register FINFO *info; X{ X#if defined(USE_XATTR) && \ X (defined(HAVE_LISTXATTR) || defined(HAVE_LLISTXATTR)) && \ X (defined(HAVE_GETXATTR) || defined(HAVE_LGETXATTR)) X ssize_t list_len; X size_t size; X char *alist; X char *lp; X int count; X int i; X X free_xattr(&static_xattr); X info->f_xflags &= ~XF_XATTR; X info->f_xattr = NULL; X X list_len = llistxattr(info->f_sname, NULL, 0); X if (list_len < 0) { X if (!errhidden(E_GETXATTR, info->f_name)) { X if (!errwarnonly(E_GETXATTR, info->f_name)) X xstats.s_getxattr++; X errmsg("Cannot listxattr for '%s'.\n", info->f_name); X (void) errabort(E_GETXATTR, info->f_name, TRUE); X } X return (FALSE); X } else if (list_len == 0) { X return (FALSE); X } X alist = ___malloc(list_len+2, "extended attribute"); X list_len = llistxattr(info->f_sname, alist, list_len); X if (list_len < 0) { X if (!errhidden(E_GETXATTR, info->f_name)) { X if (!errwarnonly(E_GETXATTR, info->f_name)) X xstats.s_getxattr++; X errmsg("Cannot listxattr for '%s'.\n", info->f_name); X (void) errabort(E_GETXATTR, info->f_name, TRUE); X } X goto fail; X } X alist[list_len] = alist[list_len+1] = '\0'; X X /* X * Count the number of attributes X */ X for (lp = alist, count = 0; lp - alist < list_len; X lp = strchr(lp, '\0')+1) { X if (*lp == '\0' || X strncmp(lp, "system.", 7) == 0 || X strncmp(lp, "xfsroot.", 8) == 0) X continue; X count++; X } X X if (count == 0) X goto fail; /* not really a failure, but... */ X X size = (count+1) * sizeof (star_xattr_t); X static_xattr = ___malloc(size, "extended attribute"); X fillbytes(static_xattr, size, '\0'); X X for (lp = alist, i = 0; lp - alist < list_len; X lp = strchr(lp, '\0')+1) { X ssize_t len; X X if (*lp == '\0' || X strncmp(lp, "system.", 7) == 0 || X strncmp(lp, "xfsroot.", 8) == 0) X continue; X X static_xattr[i].name = ___malloc(strlen(lp)+1, X "extended attribute"); X static_xattr[i].value = NULL; X strcpy(static_xattr[i].name, lp); X X len = lgetxattr(info->f_sname, lp, NULL, 0); X if (len < 0) { X if (!errhidden(E_GETXATTR, info->f_name)) { X if (!errwarnonly(E_GETXATTR, info->f_name)) X xstats.s_getxattr++; X errmsg("Cannot getxattr for '%s'.\n", X info->f_name); X (void) errabort(E_GETXATTR, info->f_name, X TRUE); X } X goto fail2; X } X static_xattr[i].value_len = len; X static_xattr[i].value = ___malloc(len, "extended attribute"); X len = lgetxattr(info->f_sname, lp, static_xattr[i].value, len); X if (len < 0) { X if (!errhidden(E_GETXATTR, info->f_name)) { X if (!errwarnonly(E_GETXATTR, info->f_name)) X xstats.s_getxattr++; X errmsg("Cannot getxattr for '%s'.\n", X info->f_name); X (void) errabort(E_GETXATTR, info->f_name, X TRUE); X } X goto fail2; X } X i++; X } X X free(alist); X info->f_xflags |= XF_XATTR; X info->f_xattr = static_xattr; X return (TRUE); X Xfail2: X for (; i >= 0; i--) { X free(static_xattr[i].name); X if (static_xattr[i].value != NULL) X free(static_xattr[i].value); X } X free(static_xattr); X static_xattr = NULL; Xfail: X free(alist); X return (FALSE); X#else /* USE_XATTR */ X return (TRUE); X#endif /* USE_XATTR */ X} X X/* ARGSUSED */ XEXPORT BOOL Xset_xattr(info) X register FINFO *info; X{ X#if defined(USE_XATTR) && \ X (defined(HAVE_SETXATTR) || defined(HAVE_LSETXATTR)) X star_xattr_t *xap; X X if (info->f_xattr == NULL || (info->f_xflags & XF_XATTR) == 0) X return (TRUE); X X for (xap = info->f_xattr; xap->name != NULL; xap++) { X#ifdef USE_SELINUX X if (selinux_enabled && X (strcmp(xap->name, "security.selinux") == 0)) X continue; X#endif X if (lsetxattr(info->f_name, xap->name, xap->value, X xap->value_len, 0) != 0) { X if (!errhidden(E_SETXATTR, info->f_name)) { X if (!errwarnonly(E_SETXATTR, info->f_name)) X xstats.s_setxattr++; X errmsg("Cannot setxattr for '%s'.\n", X info->f_name); X (void) errabort(E_SETXATTR, info->f_name, X TRUE); X } X return (FALSE); X } X } X#endif /* USE_XATTR */ X return (TRUE); X} X X#ifdef USE_SELINUX XEXPORT BOOL Xsetselinux(info) X register FINFO *info; X{ X star_xattr_t *xap; X X if (info->f_xattr == NULL || (info->f_xflags & XF_XATTR) == 0) { X if (setfscreatecon(NULL) < 0) X goto err; X return (TRUE); X } X X for (xap = info->f_xattr; xap->name != NULL; xap++) { X if (strcmp(xap->name, "security.selinux") == 0) { X if (setfscreatecon(xap->value) < 0) X goto err; X return (TRUE); X } X } X /* X * There was no "security.selinux" label, so we need to clear X * the context. X */ X if (setfscreatecon(NULL) < 0) X goto err; X return (TRUE); Xerr: X errmsg("Cannot setup security context for '%s'.\n", info->f_name); X return (FALSE); X} X#endif /* USE_SELINUX */ X XEXPORT void Xfree_xattr(xattr) X star_xattr_t **xattr; X{ X#ifdef USE_XATTR X star_xattr_t *xap; X X if (*xattr == NULL) X return; X X for (xap = *xattr; xap->name != NULL; xap++) { X free(xap->name); X free(xap->value); X } X free(*xattr); X *xattr = NULL; X X#endif /* USE_XATTR */ X} END-of-star-1.6/star/xattr.c echo x - star-1.6/star/xtab.h sed 's/^X//' >star-1.6/star/xtab.h << 'END-of-star-1.6/star/xtab.h' X/* @(#)xtab.h 1.4 06/10/31 Copyright 2001-2006 J. Schilling */ X/* X * Copyright (c) 2001-2006 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _XTAB_H X#define _XTAB_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif Xtypedef void (*xt_function) __PR((FINFO *, char *, int, char *, int)); X Xtypedef struct { X char *x_name; X int x_namelen; X xt_function x_func; X int x_flag; X} xtab_t; X X#endif /* _XTAB_H */ END-of-star-1.6/star/xtab.h echo x - star-1.6/star/xutimes.h sed 's/^X//' >star-1.6/star/xutimes.h << 'END-of-star-1.6/star/xutimes.h' X/* @(#)xutimes.h 1.5 18/10/21 Copyright 1996, 2013-2018 J. Schilling */ X/* X * Prototypes for xutimes users X * X * Copyright (c) 1996, 2013-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X/* X * star_unix.c X */ Xextern int xutimes __PR((char *name, struct timespec *tp, X BOOL asymlink)); END-of-star-1.6/star/xutimes.h echo x - star-1.6/star/ustarman.mk sed 's/^X//' >star-1.6/star/ustarman.mk << 'END-of-star-1.6/star/ustarman.mk' X#ident "@(#)ustarman.mk 1.1 10/05/13 " X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= ustar XMANSECT= $(MANSECT_CMD) XMANSUFFIX= $(MANSUFF_CMD) XMANFILE= ustar.1 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/star/ustarman.mk echo x - star-1.6/star/pathname.c sed 's/^X//' >star-1.6/star/pathname.c << 'END-of-star-1.6/star/pathname.c' X/* @(#)pathname.c 1.10 19/01/07 Copyright 2004-2019 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)pathname.c 1.10 19/01/07 Copyright 2004-2019 J. Schilling"; X#endif X/* X * Copyright (c) 2004-2019 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X#include X X#include "pathname.h" X XEXPORT int strlcpy_pspace __PR((FILE *f, pathstore_t *pathp, X const char *nm, size_t nlen)); XEXPORT int strcpy_pspace __PR((FILE *f, pathstore_t *pathp, X const char *nm)); XEXPORT int init_pspace __PR((FILE *f, pathstore_t *pathp)); XEXPORT void free_pspace __PR((pathstore_t *pathp)); XEXPORT ssize_t incr_pspace __PR((FILE *f, pathstore_t *pathp, X size_t amt)); XEXPORT ssize_t grow_pspace __PR((FILE *f, pathstore_t *pathp, X size_t amt)); XEXPORT ssize_t set_pspace __PR((FILE *f, pathstore_t *pathp, X size_t amt)); X X/* X * Copy string "nm" with size "nlen" into pathstore_t. X * Grow pathstore_t object if needed. X */ XEXPORT int Xstrlcpy_pspace(f, pathp, nm, nlen) X FILE *f; X pathstore_t *pathp; X const char *nm; X size_t nlen; X{ X BOOL with_len = TRUE; X X if (pathp->ps_path == NULL) X pathp->ps_size = 0; X X /* X * If ps_path space is not sufficient, expand it. X */ X if (nlen == (size_t)-1) { X with_len = FALSE; X nlen = strlen(nm); X } X if (pathp->ps_size < (nlen + 2)) { X if (grow_pspace(f, pathp, (nlen + 2)) < 0) X return (-1); X } X if (with_len) X strlcpy(pathp->ps_path, nm, nlen+1); X else X strcpy(pathp->ps_path, nm); X pathp->ps_tail = nlen; X return (0); X} X X/* X * Copy string "nm" into pathstore_t. X * Grow pathstore_t object if needed. X */ XEXPORT int Xstrcpy_pspace(f, pathp, nm) X FILE *f; X pathstore_t *pathp; X const char *nm; X{ X return (strlcpy_pspace(f, pathp, nm, (size_t)-1)); X} X X/* X * Initialize pathstore_t object. X * Set initial size to PS_INCR. X */ XEXPORT void Xclear_pspace(pathp) X pathstore_t *pathp; X{ X pathp->ps_path = NULL; X pathp->ps_size = 0; X pathp->ps_tail = 0; X} X X/* X * Initialize pathstore_t object. X * Set initial size to PS_INCR. X */ XEXPORT int Xinit_pspace(f, pathp) X FILE *f; X pathstore_t *pathp; X{ X sigjmps_t *jmp = JM_RETURN; X X if (f == PS_EXIT) { X f = stderr; X jmp = JM_EXIT; X } else if (f == PS_STDERR) { X f = stderr; X } X pathp->ps_tail = 0; X pathp->ps_size = PS_INCR; X pathp->ps_path = __fjmalloc(f, PS_INCR, "path buffer", jmp); X if (pathp->ps_path == NULL) { X pathp->ps_size = 0; X return (-1); X } X pathp->ps_path[0] = '\0'; X return (0); X} X X/* X * Re-adjust the size of a pathstore_t object to the new size in "amt". X * This may shrink or grow the object. X */ XEXPORT ssize_t Xset_pspace(f, pathp, amt) X FILE *f; X pathstore_t *pathp; X size_t amt; X{ X size_t nsize; X char *new; X sigjmps_t *jmp = JM_RETURN; X X if (f == PS_EXIT) { X f = stderr; X jmp = JM_EXIT; X } else if (f == PS_STDERR) { X f = stderr; X } X X nsize = (amt + PS_INCR - 1) / PS_INCR * PS_INCR; X new = __fjrealloc(f, pathp->ps_path, nsize, "path buffer", jmp); X if (new == NULL) { X if (nsize == 0) X goto ok; X /* X * We could not get new memory, but the old memory X * is still intact. X */ X return (-1); X } X if (nsize == 0) X pathp->ps_path = NULL; X else if (nsize < pathp->ps_size) /* If it shrinks */ X new[nsize-1] = '\0'; /* Null terminate */ Xok: X pathp->ps_path = new; X pathp->ps_size = nsize; X if (pathp->ps_size <= pathp->ps_tail) X pathp->ps_tail = 0; X return (nsize); X} X X/* X * Re-adjust the size of a pathstore_t object by an increment in "amt". X * This may shrink or grow the object. X */ XEXPORT ssize_t Xincr_pspace(f, pathp, amt) X FILE *f; X pathstore_t *pathp; X size_t amt; X{ X return (set_pspace(f, pathp, pathp->ps_size + amt)); X} X X/* X * Re-adjust the size of a pathstore_t object if "amt" is > than current size. X * This may only grow the object. X */ XEXPORT ssize_t Xgrow_pspace(f, pathp, amt) X FILE *f; X pathstore_t *pathp; X size_t amt; X{ X if (pathp->ps_size >= amt) X return (pathp->ps_size); X return (set_pspace(f, pathp, amt)); X} X X/* X * Destroy a pathstore_t object. X */ XEXPORT void Xfree_pspace(pathp) X pathstore_t *pathp; X{ X if (pathp->ps_path) X free(pathp->ps_path); X X pathp->ps_path = NULL; X pathp->ps_size = 0; X pathp->ps_tail = 0; X} END-of-star-1.6/star/pathname.c echo x - star-1.6/star/pathname.h sed 's/^X//' >star-1.6/star/pathname.h << 'END-of-star-1.6/star/pathname.h' X/* @(#)pathname.h 1.6 18/07/22 Copyright 2004-2018 J. Schilling */ X/* X * Copyright (c) 2004-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _PATHNAME_H X#define _PATHNAME_H X X#ifndef _SCHILY_TYPES_H X#include X#endif X X#ifdef __cplusplus Xextern "C" { X#endif X X#ifdef EOF X#define PS_F FILE /* stdio.h included */ X#else X#define PS_F void /* stdio.h not included */ X#endif X X#define PS_INCR 1024 /* How to increment ps_path size */ X#define PS_SILENT (PS_F *)0 /* No messages */ X#define PS_STDERR (PS_F *)1 /* Messages to stderr */ X#define PS_EXIT (PS_F *)2 /* Messages to stderr + exit */ X Xtypedef struct pathstore { X char *ps_path; /* The current path name */ X size_t ps_tail; /* Where to append to path name */ X size_t ps_size; /* Current size of 'ps_path' */ X} pathstore_t; X Xextern void clear_pspace __PR((pathstore_t *pathp)); Xextern int init_pspace __PR((PS_F *f, pathstore_t *pathp)); Xextern ssize_t incr_pspace __PR((PS_F *f, pathstore_t *pathp, X size_t amt)); Xextern ssize_t set_pspace __PR((PS_F *f, pathstore_t *pathp, X size_t amt)); Xextern ssize_t grow_pspace __PR((PS_F *f, pathstore_t *pathp, X size_t amt)); Xextern void free_pspace __PR((pathstore_t *pathp)); Xextern int strlcpy_pspace __PR((PS_F *f, pathstore_t *pathp, X const char *nm, size_t nlen)); Xextern int strcpy_pspace __PR((PS_F *f, pathstore_t *pathp, X const char *nm)); X X#ifdef __cplusplus X} X#endif X X#endif /* _PATHNAME_H */ END-of-star-1.6/star/pathname.h echo x - star-1.6/star/paxopts.c sed 's/^X//' >star-1.6/star/paxopts.c << 'END-of-star-1.6/star/paxopts.c' X/* @(#)paxopts.c 1.1 18/05/21 Copyright 2018 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)paxopts.c 1.1 18/05/21 Copyright 2018 J. Schilling"; X#endif X/* X * Copyright (c) 2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X X#include "starsubs.h" X XEXPORT int ppaxopts __PR((const char *opts)); X Xextern BOOL binflag; X XEXPORT BOOL Xppaxopts(opts) X const char *opts; X{ X if (opts == NULL) X return (FALSE); X if (streql(opts, "binary")) { X binflag = TRUE; X return (TRUE); X } X return (FALSE); X} END-of-star-1.6/star/paxopts.c echo x - star-1.6/star/lpath_unix.c sed 's/^X//' >star-1.6/star/lpath_unix.c << 'END-of-star-1.6/star/lpath_unix.c' X/* @(#)lpath_unix.c 1.13 19/01/14 Copyright 2018-2019 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)lpath_unix.c 1.13 19/01/14 Copyright 2018-2019 J. Schilling"; X#endif X/* X * Routines for long path names on unix like operating systems X * X * Copyright (c) 2018-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include "star.h" X#include X#include X#include X#include /* For AT_FDCWD */ X#include X#include /* For DEV_BSIZE */ X#include X#define GT_COMERR /* #define comerr gtcomerr */ X#define GT_ERROR /* #define error gterror */ X#include X#include "starsubs.h" X XEXPORT int lchdir __PR((char *name)); X#if defined(IS_SUN) && defined(__SVR4) && defined(DO_CHDIR_LONG) XLOCAL void sunos5_cwdfix __PR((void)); X#endif XEXPORT char *lgetcwd __PR((void)); XEXPORT int lmkdir __PR((char *name, mode_t mode)); XEXPORT int laccess __PR((char *name, int amode)); XEXPORT int lstatat __PR((char *name, struct stat *buf, int flag)); XEXPORT int lchmodat __PR((char *name, mode_t mode, int flag)); XEXPORT int lutimensat __PR((char *name, struct timespec *ts, int flag)); XEXPORT int lreadlink __PR((char *name, char *buf, size_t bufsize)); XEXPORT int lsymlink __PR((char *name, char *name2)); XEXPORT int llink __PR((char *name, char *name2)); XEXPORT int lrename __PR((char *name, char *name2)); XEXPORT int lmknod __PR((char *name, mode_t mode, dev_t dev)); XEXPORT int lmkfifo __PR((char *name, mode_t mode)); XEXPORT int lchownat __PR((char *name, uid_t uid, gid_t gid, int flag)); XEXPORT int lunlinkat __PR((char *name, int flag)); XEXPORT char *lmktemp __PR((char *name)); XEXPORT FILE *lfilemopen __PR((char *name, char *mode, mode_t cmode)); XLOCAL int _fileopenat __PR((int fd, char *name, char *mode)); XEXPORT int _lfileopen __PR((char *name, char *mode)); XEXPORT DIR *lopendir __PR((char *name)); XLOCAL int hop_dirs __PR((char *name, char **np)); X X/* X * A chdir() implementation that is able to deal with ENAMETOOLONG. X */ XEXPORT int Xlchdir(path) X char *path; X{ X int ret = chdir(path); X char *p; X char *p2; X X if (ret >= 0 || geterrno() != ENAMETOOLONG) X return (ret); X X p = path; X if (*p == '/') { X if ((ret = chdir("/")) < 0) X return (ret); X while (*p == '/') X p++; X } X while (*p) { X if ((p2 = strchr(p, '/')) != NULL) X *p2 = '\0'; X if ((ret = chdir(p)) < 0) { X if (p2) X *p2 = '/'; X break; X } X if (p2 == NULL) X break; X *p2++ = '/'; X while (*p2 == '/') X p2++; X p = p2; X } X return (ret); X} X X#if defined(IS_SUN) && defined(__SVR4) && defined(DO_CHDIR_LONG) X/* X * Workaround a Solaris getcwd() bug that hits on newer Solaris releases with X * getcwd() being a system call. Once a successful getcwd() call that returns X * more than PATH_MAX did succeed, future calls to getcwd() always fail with X * ERANGE until a successfull new chdir() call has been issued. X */ XLOCAL void Xsunos5_cwdfix() X{ X int f = open(".", O_SEARCH|O_DIRECTORY|O_NDELAY); X X if (f >= 0) { X chdir("/"); X fchdir(f); X close(f); X } X} X#endif X X/* X * A getcwd() implementation that is able to deal with more than PATH_MAX. X */ XEXPORT char * Xlgetcwd() X{ X char *dir = NULL; X char *r; X size_t len = PATH_MAX; X#define LWD_RETRY_MAX 8 /* stops at 128 * PATH_MAX */ X int i = 0; X X#if defined(IS_SUN) && defined(__SVR4) && defined(DO_CHDIR_LONG) Xretry: X#endif X do { X dir = ___realloc(dir, len, "working dir"); X *dir = '\0'; X X r = getcwd(dir, len); X if (++i >= LWD_RETRY_MAX) /* stops at 128 * PATH_MAX */ X break; X len *= 2; X } while (r == NULL && errno == ERANGE); X X#if defined(IS_SUN) && defined(__SVR4) && defined(DO_CHDIR_LONG) X if (r == NULL && errno == ERANGE && i == LWD_RETRY_MAX) { X /* X * Work around a Solaris kernel bug. X */ X sunos5_cwdfix(); X goto retry; X } X#endif X return (r); X} X XEXPORT int X#ifdef PROTOTYPES Xlmkdir(char *name, mode_t mode) X#else Xlmkdir(name, mode) X char *name; X mode_t mode; X#endif X{ X#ifdef HAVE_FCHDIR X char *p; X int fd; X int err; X#endif X int ret; X X if ((ret = mkdir(name, mode)) < 0 && X geterrno() != ENAMETOOLONG) { X return (ret); X } X X#ifdef HAVE_FCHDIR X if (ret >= 0) X return (ret); X X fd = hop_dirs(name, &p); X ret = mkdirat(fd, p, mode); X err = geterrno(); X close(fd); X seterrno(err); X#endif X return (ret); X} X XEXPORT int Xlaccess(name, amode) X char *name; X int amode; X{ X#ifdef HAVE_FCHDIR X char *p; X int fd; X int err; X#endif X int ret; X X if ((ret = access(name, amode)) < 0 && X geterrno() != ENAMETOOLONG) { X return (ret); X } X X#ifdef HAVE_FCHDIR X if (ret >= 0) X return (ret); X X fd = hop_dirs(name, &p); X ret = faccessat(fd, p, amode, 0); X err = geterrno(); X close(fd); X seterrno(err); X#endif X return (ret); X} X XEXPORT int Xlstatat(name, buf, flag) X char *name; X struct stat *buf; X int flag; X{ X#ifdef HAVE_FCHDIR X char *p; X int fd; X int err; X#endif X int ret; X X if ((ret = fstatat(AT_FDCWD, name, buf, flag)) < 0 && X geterrno() != ENAMETOOLONG) { X return (ret); X } X X#ifdef HAVE_FCHDIR X if (ret >= 0) X return (ret); X X fd = hop_dirs(name, &p); X ret = fstatat(fd, p, buf, flag); X err = geterrno(); X close(fd); X seterrno(err); X#endif X return (ret); X} X X XEXPORT int X#ifdef PROTOTYPES Xlchmodat(char *name, mode_t mode, int flag) X#else Xlchmodat(name, mode, flag) X char *name; X mode_t mode; X int flag; X#endif X{ X#ifdef HAVE_FCHDIR X char *p; X int fd; X int err; X#endif X int ret; X X if ((ret = fchmodat(AT_FDCWD, name, mode, flag)) < 0 && X geterrno() != ENAMETOOLONG) { X return (ret); X } X X#ifdef HAVE_FCHDIR X if (ret >= 0) X return (ret); X X fd = hop_dirs(name, &p); X ret = fchmodat(fd, p, mode, flag); X err = geterrno(); X close(fd); X seterrno(err); X#endif X return (ret); X} X X XEXPORT int Xlutimensat(name, ts, flag) X char *name; X struct timespec *ts; X int flag; X{ X#ifdef HAVE_FCHDIR X char *p; X int fd; X int err; X#endif X int ret; X X if ((ret = utimensat(AT_FDCWD, name, ts, flag)) < 0 && X geterrno() != ENAMETOOLONG) { X return (ret); X } X X#ifdef HAVE_FCHDIR X if (ret >= 0) X return (ret); X X fd = hop_dirs(name, &p); X ret = utimensat(fd, p, ts, flag); X err = geterrno(); X close(fd); X seterrno(err); X#endif X return (ret); X} X X#ifdef HAVE_READLINK XEXPORT int Xlreadlink(name, buf, bufsize) X char *name; X char *buf; X size_t bufsize; X{ X#ifdef HAVE_FCHDIR X char *p; X int fd; X int err; X#endif X int ret; X X if ((ret = readlink(name, buf, bufsize)) < 0 && X geterrno() != ENAMETOOLONG) { X return (ret); X } X X#ifdef HAVE_FCHDIR X if (ret >= 0) X return (ret); X X fd = hop_dirs(name, &p); X ret = readlinkat(fd, p, buf, bufsize); X err = geterrno(); X close(fd); X seterrno(err); X#endif X return (ret); X} X XEXPORT int Xlsymlink(name, name2) X char *name; X char *name2; X{ X#ifdef HAVE_FCHDIR X char *p; X int fd; X int err; X#endif X int ret; X X if ((ret = symlink(name, name2)) < 0 && X geterrno() != ENAMETOOLONG) { X return (ret); X } X X#ifdef HAVE_FCHDIR X if (ret >= 0) X return (ret); X X fd = hop_dirs(name2, &p); X ret = symlinkat(name, fd, p); X err = geterrno(); X close(fd); X seterrno(err); X#endif X return (ret); X} X#endif X X#ifdef HAVE_LINK XEXPORT int Xllink(name, name2) X char *name; X char *name2; X{ X#ifdef HAVE_FCHDIR X char *p; X char *p2; X int fd; X int fd2; X int err; X#endif X int ret; X X if ((ret = link(name, name2)) < 0 && X geterrno() != ENAMETOOLONG) { X return (ret); X } X X#ifdef HAVE_FCHDIR X if (ret >= 0) X return (ret); X X fd = hop_dirs(name, &p); X fd2 = hop_dirs(name2, &p2); X ret = linkat(fd, p, fd2, p2, 0); /* SYMLINK_FOLLOW not in emulation */ X err = geterrno(); X close(fd); X close(fd2); X seterrno(err); X#endif X return (ret); X} X#endif X XEXPORT int Xlrename(name, name2) X char *name; X char *name2; X{ X#ifdef HAVE_FCHDIR X char *p; X char *p2; X int fd; X int fd2; X int err; X#endif X int ret; X X if ((ret = rename(name, name2)) < 0 && X geterrno() != ENAMETOOLONG) { X return (ret); X } X X#ifdef HAVE_FCHDIR X if (ret >= 0) X return (ret); X X fd = hop_dirs(name, &p); X fd2 = hop_dirs(name2, &p2); X ret = renameat(fd, p, fd2, p2); X err = geterrno(); X close(fd); X close(fd2); X seterrno(err); X#endif X return (ret); X} X X#ifdef HAVE_MKNOD XEXPORT int X#ifdef PROTOTYPES Xlmknod(char *name, mode_t mode, dev_t dev) X#else Xlmknod(name, mode, dev) X char *name; X mode_t mode; X dev_t dev; X#endif X{ X#ifdef HAVE_FCHDIR X char *p; X int fd; X int err; X#endif X int ret; X X if ((ret = mknod(name, mode, dev)) < 0 && X geterrno() != ENAMETOOLONG) { X return (ret); X } X X#ifdef HAVE_FCHDIR X if (ret >= 0) X return (ret); X X fd = hop_dirs(name, &p); X ret = mknodat(fd, p, mode, dev); X err = geterrno(); X close(fd); X seterrno(err); X#endif X return (ret); X} X#endif X X#ifdef HAVE_MKFIFO XEXPORT int X#ifdef PROTOTYPES Xlmkfifo(char *name, mode_t mode) X#else Xlmkfifo(name, mode) X char *name; X mode_t mode; X#endif X{ X#ifdef HAVE_FCHDIR X char *p; X int fd; X int err; X#endif X int ret; X X if ((ret = mkfifo(name, mode)) < 0 && X geterrno() != ENAMETOOLONG) { X return (ret); X } X X#ifdef HAVE_FCHDIR X if (ret >= 0) X return (ret); X X fd = hop_dirs(name, &p); X ret = mkfifoat(fd, p, mode); X err = geterrno(); X close(fd); X seterrno(err); X#endif X return (ret); X} X#endif X XEXPORT int X#ifdef PROTOTYPES Xlchownat(char *name, uid_t uid, gid_t gid, int flag) X#else Xlchownat(name, uid, gid, flag) X char *name; X uid_t uid; X gid_t gid; X int flag; X#endif X{ X#ifdef HAVE_FCHDIR X char *p; X int fd; X int err; X#endif X int ret; X X if ((ret = fchownat(AT_FDCWD, name, uid, gid, flag)) < 0 && X geterrno() != ENAMETOOLONG) { X return (ret); X } X X#ifdef HAVE_FCHDIR X if (ret >= 0) X return (ret); X X fd = hop_dirs(name, &p); X ret = fchownat(fd, p, uid, gid, flag); X err = geterrno(); X close(fd); X seterrno(err); X#endif X return (ret); X} X XEXPORT int Xlunlinkat(name, flag) X char *name; X int flag; X{ X#ifdef HAVE_FCHDIR X char *p; X int fd; X int err; X#endif X int ret; X X if ((ret = unlinkat(AT_FDCWD, name, flag)) < 0 && X geterrno() != ENAMETOOLONG) { X return (ret); X } X X#ifdef HAVE_FCHDIR X if (ret >= 0) X return (ret); X X fd = hop_dirs(name, &p); X ret = unlinkat(fd, p, flag); X err = geterrno(); X close(fd); X seterrno(err); X#endif X return (ret); X} X XEXPORT char * Xlmktemp(name) X char *name; X{ X#ifdef HAVE_FCHDIR X char *p; X int fd; X int fdh; X int err = 0; X char spath[PATH_MAX+1]; X char *oname = spath; X#endif X char *ret; X X if (name == NULL) X return (name); X X#ifdef HAVE_FCHDIR X /* X * mktemp() is destructive, so we need to save the name before X * as we always fail first with long path names. X */ X if (strlen(name) < PATH_MAX) { X strcpy(oname, name); X } else { X oname = strdup(name); X if (oname == NULL) { X name[0] = '\0'; X return (name); X } X } X#endif X ret = mktemp(name); X if (ret[0] == '\0' && X geterrno() != ENAMETOOLONG) { X#ifdef HAVE_FCHDIR X if (oname != spath) X free(oname); X#endif X return (ret); X } X X#ifdef HAVE_FCHDIR X if (ret[0] != '\0') { X if (oname != spath) X free(oname); X return (ret); X } X X strcpy(name, oname); X if (oname != spath) X free(oname); X fd = hop_dirs(name, &p); X if (fd >= 0) { X fdh = open(".", O_SEARCH|O_DIRECTORY|O_NDELAY); X if (fdh >= 0) { X fchdir(fd); X ret = mktemp(p); X err = geterrno(); X fchdir(fdh); X close(fdh); X } X close(fd); X } X if (err) X seterrno(err); X#endif X return (ret); X} X XEXPORT FILE * X#ifdef PROTOTYPES Xlfilemopen(char *name, char *mode, mode_t cmode) X#else Xlfilemopen(name, mode, cmode) X char *name; X char *mode; X mode_t cmode; X#endif X{ X#ifdef HAVE_FCHDIR X char *p; X char *p2; X int fd; X int fdf; X int err; X char lmode[10]; X#endif X FILE *fp; X int omode = 0; X int flag = 0; X X if ((fp = filemopen(name, mode, cmode)) == NULL && X geterrno() != ENAMETOOLONG) { X return (fp); X } X X#ifdef HAVE_FCHDIR X if (fp != NULL) X return (fp); X X fd = hop_dirs(name, &p); X _cvmod(mode, &omode, &flag); X fdf = openat(fd, p, omode, cmode); X p = mode; X p2 = lmode; X while (*p) { X if (*p == 'c' || *p == 't' || *p == 'e') { X p++; X continue; X } X *p2++ = *p++; X } X *p2 = '\0'; X if (fdf >= 0 && (fp = fileluopen(fdf, lmode)) == NULL) X close(fdf); X err = geterrno(); X close(fd); X seterrno(err); X#endif X return (fp); X} X XLOCAL int X_fileopenat(fd, name, smode) X int fd; X char *name; X char *smode; X{ X int ret; X int omode = 0; X int flag = 0; X X if (!_cvmod(smode, &omode, &flag)) X return (-1); X Xretry: X if ((ret = openat(fd, name, omode, S_IRWALL)) < 0) { X if (geterrno() == EINTR) X goto retry; X return (-1); X } X X return (ret); X} X XEXPORT int X_lfileopen(name, smode) X char *name; X char *smode; X{ X#ifdef HAVE_FCHDIR X char *p; X int fd; X int err; X#endif X int fdf; X X if ((fdf = _fileopenat(AT_FDCWD, name, smode)) < 0 && X geterrno() != ENAMETOOLONG) { X return (fdf); X } X X#ifdef HAVE_FCHDIR X if (fdf >= 0) X return (fdf); X X fd = hop_dirs(name, &p); X fdf = _fileopenat(fd, p, smode); X err = geterrno(); X close(fd); X seterrno(err); X#endif X return (fdf); X} X XEXPORT DIR * Xlopendir(name) X char *name; X{ X#ifdef HAVE_FCHDIR X char *p; X int fd; X int dfd; X#endif X DIR *ret = NULL; X X if ((ret = opendir(name)) == NULL && geterrno() != ENAMETOOLONG) X return ((DIR *)NULL); X X#ifdef HAVE_FCHDIR X if (ret) X return (ret); X X fd = hop_dirs(name, &p); X if ((dfd = openat(fd, p, O_RDONLY|O_DIRECTORY|O_NDELAY)) < 0) { X close(fd); X return ((DIR *)NULL); X } X close(fd); X ret = fdopendir(dfd); X#endif X return (ret); X} X X#ifdef HAVE_FCHDIR XLOCAL int Xhop_dirs(name, np) X char *name; X char **np; X{ X char *p; X char *p2; X int fd; X int dfd; X int err; X X p = name; X fd = AT_FDCWD; X if (*p == '/') { X fd = openat(fd, "/", O_SEARCH|O_DIRECTORY|O_NDELAY); X while (*p == '/') X p++; X } X while (*p) { X if ((p2 = strchr(p, '/')) != NULL) { X if (p2[1] == '\0') X break; X *p2 = '\0'; X } else { X break; /* No slash remains, return the prefix fd */ X } X if ((dfd = openat(fd, p, O_SEARCH|O_DIRECTORY|O_NDELAY)) < 0) { X err = geterrno(); X X close(fd); X if (err == EMFILE) X seterrno(err); X else X seterrno(ENAMETOOLONG); X *p2 = '/'; X return (dfd); X } X close(fd); /* Don't care about AT_FDCWD, it is negative */ X fd = dfd; X *p2++ = '/'; /* p2 is always != NULL here */ X while (*p2 == '/') X p2++; X p = p2; X } X *np = p; X return (fd); X} X#endif END-of-star-1.6/star/lpath_unix.c echo x - star-1.6/star/version.c sed 's/^X//' >star-1.6/star/version.c << 'END-of-star-1.6/star/version.c' X/* @(#)version.c 1.8 19/04/01 Copyright 2018-2019 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)version.c 1.8 19/04/01 Copyright 2018-2019 J. Schilling"; X#endif X/* X * Copyright (c) 2018-2019 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X Xchar strvers[] = "1.6"; /* The pure version string */ Xchar dvers[] = "2019/04/01"; /* Version date */ END-of-star-1.6/star/version.c echo c - star-1.6/libs mkdir -p star-1.6/libs > /dev/null 2>&1 echo x - star-1.6/Makefile sed 's/^X//' >star-1.6/Makefile << 'END-of-star-1.6/Makefile' X#ident %W% %E% %Q% X########################################################################### X# Sample makefile for the source root X########################################################################### XSRCROOT= . XDIRNAME= SRCROOT XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X X# X# include Targetdirs no longer needed, we use SSPM X#include Targetdirs X X########################################################################### X# Due to a bug in SunPRO make we need special rules for the root makefile X# Xinclude $(SRCROOT)/$(RULESDIR)/rules.rdi X########################################################################### END-of-star-1.6/Makefile echo c - star-1.6/lib mkdir -p star-1.6/lib > /dev/null 2>&1 echo c - star-1.6/RULES mkdir -p star-1.6/RULES > /dev/null 2>&1 echo x - star-1.6/RULES/cc-sgi64.rul sed 's/^X//' >star-1.6/RULES/cc-sgi64.rul << 'END-of-star-1.6/RULES/cc-sgi64.rul' X#ident "@(#)cc-sgi64.rul 1.17 18/08/16 " X########################################################################### X# Written 1996-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for Silicon Graphics cc X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X XCPP_FLAGS= -DSCHILY_BUILD $(CPPOPTS) $(CPPOPTX) $(OSINCDIRS:%=-I%) $(OSDEFS) $(OSDEFSX) XC_FLAGS= $(COPTS) $(CWARNOPTS) $(COPTOPT) $(SGICOPTOPT) $(COPTX) XC++FLAGS= $(C++OPTS) $(C++WARNOPTS) $(C++OPTOPT) $(SGIC++OPTOPT) $(C++OPTX) X XCPPOPTS= -I$(ARCHDIR) -I$(OINCSDIR) $(INCDIRS:%=-I%) $(INCDIRSX:%=-I%) XCOPTS= -64 XCWOPTS= -fullwarn XCOPTOPT= -O XCOPTDYN= -Kpic XCOPTGPROF= -p1 XC++OPTS= -64 XC++WOPTS= X#C++OPTOPT= -O X#C++OPTDYN= -Kpic X#C++OPTGPROF= -xpg X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR) X XLIB_C= -lc X XLIBS_PATH= -L$(OLIBSDIR) XLIBS_PATH_STATIC= -L$(OLIBSDIR_STATIC) X XLDFLAGS= $(LDOPTS) $(LDOPTX) XLDLIBS= $(LIBS) $(LIBX) X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH) XLDOPTS= $(LIBS_PATH) $(LDPATH) $(LARGEFILE_OPT) X#LDOPTDYN= -dy -G -ztext -h $(TARGET) -ldl XLNDYNLIB= @ X XFLOAT_OPTIONS= X X__CC_COM= $(_UNIQ)$(CC) X___CC_COM= $(__CC_COM:$(_UNIQ)=$(CC_COM_DEF)) XCC_COM= $(___CC_COM:$(_UNIQ)%=%) X X__CC++_COM= $(_UNIQ)$(CCC) X___CC++_COM= $(__CC++_COM:$(_UNIQ)=$(CC++_COM_DEF)) XCC++_COM= $(___CC++_COM:$(_UNIQ)%=%) X XCC_COM_DEF= cc XCC++_COM_DEF= CC XCC= $(CC_COM_DEF) XCCC= $(CC++_COM_DEF) X XCCCC= @echo " ==> COMPILING \"$@\""; $(CC_COM) -64 XLDCC= @echo " ==> LINKING \"$@\""; $(CC_COM) -64 XDYNLD= @echo " ==> LINKING dynamic library \"$@\""; $(CC_COM) -64 XRANLIB= @echo " ==> RANDOMIZING ARCHIVE \"$@\""; true X XRMDEP= : XMKDEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); $(CC_COM) -64 -M XMKDEP_OUT= X XCC++ = @echo " ==> COMPILING \"$@\""; $(CC++_COM) -64 XLDCC++ = @echo " ==> LINKING \"$@\""; $(CC++_COM) -64 XDYNLDC++ = @echo " ==> LINKING dynamic library \"$@\""; $(CC++_COM) -64 XMKC++DEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); $(CC++_COM) -64 -M XMKC++DEP_OUT= END-of-star-1.6/RULES/cc-sgi64.rul echo x - star-1.6/RULES/powerpc-os400-cc.rul sed 's/^X//' >star-1.6/RULES/powerpc-os400-cc.rul << 'END-of-star-1.6/RULES/powerpc-os400-cc.rul' X#ident "@(#)00210002307w-os400-cc.rul 1.2 18/09/24 " X########################################################################### X# Written 1996-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for OS400 X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-$(C_ARCH:cc%=ibm%).rul X X# X# Make 64 bit the default X# XIBMCC_OPT= -q64 X XAIX_ARCH= $(IBMCC_OPTXX:-q%=-X%) X XOSDEFS += -DPROTOTYTPES X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_SOCKET= XLIB_MATH= -lm X#LIB_KVM= -lkvm X XRANLIB= @echo " ==> RANDOMIZING ARCHIVE \"$@\""; ranlib X XLORDER= lorder $(AIX_ARCH) XAR= @echo " ==> ARCHIVING \"$@\""; ar $(AIX_ARCH) END-of-star-1.6/RULES/powerpc-os400-cc.rul echo x - star-1.6/RULES/powerpc-os400-gcc.rul sed 's/^X//' >star-1.6/RULES/powerpc-os400-gcc.rul << 'END-of-star-1.6/RULES/powerpc-os400-gcc.rul' X#ident "@(#)powerpc-os400-gcc.rul 1.6 18/10/14 " X########################################################################### X# Written 1997-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for OS400 X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-$(C_ARCH).rul X X# X# Make 64 bit the default X# XGCC_OPT= -maix64 XGCC_OPT32= -maix32 XGCC_OPT64= -maix64 XAIX_ARCH= $(GCC_OPTXX:-maix%=-X%) X XOSDEFS += -DPROTOTYTPES X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%) XLDOPTS= $(LIBS_PATH) $(LDPATH) XLDOPTDYN= -shared XLNDYNLIB= @ X XRANLIB= @echo " ==> RANDOMIZING ARCHIVE \"$@\""; ranlib X XLORDER= lorder $(AIX_ARCH) XAR= @echo " ==> ARCHIVING \"$@\""; ar $(AIX_ARCH) END-of-star-1.6/RULES/powerpc-os400-gcc.rul echo x - star-1.6/RULES/os-os400.id sed 's/^X//' >star-1.6/RULES/os-os400.id << 'END-of-star-1.6/RULES/os-os400.id' X#ident "@(#)os-os400.id 1.2 18/10/03 " X########################################################################### X# Written 2018 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for OS400 X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= os400 X-O_ARCH= -$(O_ARCH) XK_ARCH= powerpc XP_ARCH= powerpc END-of-star-1.6/RULES/os-os400.id echo x - star-1.6/RULES/x86_64-linux-pcc.rul sed 's/^X//' >star-1.6/RULES/x86_64-linux-pcc.rul << 'END-of-star-1.6/RULES/x86_64-linux-pcc.rul' X#ident "@(#)x86_64-linux-pcc.rul 1.3 18/11/07 " X########################################################################### X# Written 1996-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for Linux X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-$(C_ARCH).rul X X# X# LINUX_SRC_INCLUDE is defined in DEFAULTS/Defaults.linux X# XINCDIRSX += $(LINUX_SRC_INCLUDE) XOSDEFS += X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X X# X# Sunpro C/C++ run on Solaris and Linux and both have linkers X# that support mapfiles X# XMAPVERS= $(_MAPVERS) # This enables to use mapfiles X# X# The GNU linker is buggy and does not like the official order in linker map X# files for symbol versioning. The following command reverses the order of X# the version names in the linker map file. X# XMAPFILE_POST= | sed 's/^SCHILY/+SCHILY/' | tr '\012' '@' | tr '+' '\012' | sort -V | tr '@' '\012' X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%) X# X# Uncomment the next line in case you are on an old Linux version that X# does not support the -R linker flag. X# X#LDOPTS= $(LIBS_PATH) $(LDPATH) XLDOPTMAP= $(PMAPVERS:%=-Wl,--version-script=%) XLDOPTDYN= -shared -Wl,-soname,$(TARGET) $(LDOPTMAP) X XLORDER= echo XTSORT= cat END-of-star-1.6/RULES/x86_64-linux-pcc.rul echo x - star-1.6/RULES/i586-linux-gcc.rul sed 's/^X//' >star-1.6/RULES/i586-linux-gcc.rul << 'END-of-star-1.6/RULES/i586-linux-gcc.rul' X#ident "@(#)i586-linux-gcc.rul 1.18 18/11/07 " X########################################################################### X# Written 1996-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for Linux X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-$(C_ARCH).rul X X# X# LINUX_SRC_INCLUDE is defined in DEFAULTS/Defaults.linux X# XINCDIRSX += $(LINUX_SRC_INCLUDE) XOSDEFS += X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X X# X# Sunpro C/C++ run on Solaris and Linux and both have linkers X# that support mapfiles X# XMAPVERS= $(_MAPVERS) # This enables to use mapfiles X# X# The GNU linker is buggy and does not like the official order in linker map X# files for symbol versioning. The following command reverses the order of X# the version names in the linker map file. X# XMAPFILE_POST= | sed 's/^SCHILY/+SCHILY/' | tr '\012' '@' | tr '+' '\012' | sort -V | tr '@' '\012' X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%) X# X# Uncomment the next line in case you are on an old Linux version that X# does not support the -R linker flag. X# X#LDOPTS= $(LIBS_PATH) $(LDPATH) XLDOPTMAP= $(PMAPVERS:%=-Wl,--version-script=%) XLDOPTDYN= -shared -Wl,-soname,$(TARGET) $(LDOPTMAP) X XLORDER= echo XTSORT= cat END-of-star-1.6/RULES/i586-linux-gcc.rul echo x - star-1.6/RULES/i386-netbsd-clang.rul sed 's/^X//' >star-1.6/RULES/i386-netbsd-clang.rul << 'END-of-star-1.6/RULES/i386-netbsd-clang.rul' X#ident "@(#)i386-netbsd-clang.rul 1.1 18/11/15 " X########################################################################### X# Written 1997-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for NetBSD X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-$(C_ARCH).rul X XOSDEFS += X#OSDEFS += -DIS_UNIX X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X X# X# Sunpro C/C++ run on Solaris and Linux and both have linkers X# that support mapfiles X# XMAPVERS= $(_MAPVERS) # This enables to use mapfiles X# X# The GNU linker is buggy and does not like the official order in linker map X# files for symbol versioning. The following command reverses the order of X# the version names in the linker map file. X# XMAPFILE_POST= | sed 's/^SCHILY/+SCHILY/' | tr '\012' '@' | tr '+' '\012' | tail -r | tr '@' '\012' X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%) X#LDOPTS= $(LIBS_PATH) $(LDPATH) XLDOPTMAP= $(PMAPVERS:%=-Wl,--version-script=%) XLDOPTDYN= -shared -Wl,-soname,$(TARGET) $(LDOPTMAP) X XRANLIB= @echo " ==> RANDOMIZING ARCHIVE \"$@\""; ranlib END-of-star-1.6/RULES/i386-netbsd-clang.rul echo x - star-1.6/RULES/os-mingw32_nt-6.0.id sed 's/^X//' >star-1.6/RULES/os-mingw32_nt-6.0.id << 'END-of-star-1.6/RULES/os-mingw32_nt-6.0.id' X#ident "@(#)os-mingw32_nt-6.0.id 1.1 15/12/09 " X########################################################################### X# X# OS specific MACRO definitions for Win32/Mingw32 X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= mingw32_nt X-O_ARCH= -$(O_ARCH) END-of-star-1.6/RULES/os-mingw32_nt-6.0.id echo x - star-1.6/RULES/os-sunos5.def sed 's/^X//' >star-1.6/RULES/os-sunos5.def << 'END-of-star-1.6/RULES/os-sunos5.def' X#ident "@(#)os-sunos5.def 1.3 06/05/14 " X########################################################################### X# Written 1997 by J. Schilling X########################################################################### X# X# Global os definitions for Solaris X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XMANSTYLE= sysv END-of-star-1.6/RULES/os-sunos5.def echo x - star-1.6/RULES/os-unix_sv.id sed 's/^X//' >star-1.6/RULES/os-unix_sv.id << 'END-of-star-1.6/RULES/os-unix_sv.id' X#ident "@(#)os-unix_sv.id 1.2 06/05/14 " X########################################################################### X# Written 1999 by J. Schilling/Santa Cruz Operation X########################################################################### X# X# OS specific MACRO definitions for UnixWare 2 X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= unixware X-O_ARCH= -$(O_ARCH) END-of-star-1.6/RULES/os-unix_sv.id echo x - star-1.6/RULES/os-unixware.def sed 's/^X//' >star-1.6/RULES/os-unixware.def << 'END-of-star-1.6/RULES/os-unixware.def' X#ident "@(#)os-unixware.def 1.2 06/05/14 " X########################################################################### X# Written 2000 by J. Schilling/Santa Cruz Operation X########################################################################### X# X# Global os definitions for UnixWare 7 X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XMANSTYLE= sysv END-of-star-1.6/RULES/os-unixware.def echo x - star-1.6/RULES/os-unixware.id sed 's/^X//' >star-1.6/RULES/os-unixware.id << 'END-of-star-1.6/RULES/os-unixware.id' X#ident "@(#)os-unixware.id 1.2 06/05/14 " X########################################################################### X# Written 2000 by J. Schilling/Santa Cruz Operation X########################################################################### X# X# OS specific MACRO definitions for UnixWare 7 X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= unixware X-O_ARCH= -$(O_ARCH) END-of-star-1.6/RULES/os-unixware.id echo x - star-1.6/RULES/pci-qnx-cc.rul sed 's/^X//' >star-1.6/RULES/pci-qnx-cc.rul << 'END-of-star-1.6/RULES/pci-qnx-cc.rul' X#ident "@(#)pci-qnx-cc.rul 1.7 07/05/08 " X########################################################################### X# Written 1997 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for unknown systems systems with dumb cc X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-dumb.rul X XOSDEFS += X XKDEFINES= -DKERNEL -D_KERNEL X X#LIB_SOCKET= -lsocket -lnsl -ldl XLIB_SOCKET= XLIB_MATH= -lm X#LIB_KVM= -lkvm XLIB_KVM= X X# Set Stack size to 256k XLDOPTS= $(LIBS_PATH) $(LDPATH) -N 256k X XLORDER= echo XTSORT= cat END-of-star-1.6/RULES/pci-qnx-cc.rul echo x - star-1.6/RULES/rules.ins sed 's/^X//' >star-1.6/RULES/rules.ins << 'END-of-star-1.6/RULES/rules.ins' X#ident @(#)rules.ins 1.29 18/05/03 X########################################################################### X# Written 1996-2018 by J. Schilling X########################################################################### X# X# Rules for target installation X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X$(DEST_DIR)$(INSBASE)/$(PREINSDIR)$(INSDIR)$(SUBINSDIR)$(SUBINS): X $(INSMKDIR) -p $@ X$(SRCROOT)/bins/$(OARCH): X $(MKDIR) -p $@ X X$(DEST_DIR)$(INSBASE)/$(PREINSDIR)$(INSDIR)$(SUBINSDIR)$(SUBINS)/$(TARGET)$(_EXEEXT): $(PTARGET) X $(INSTALL) $(INSFLAGS) $(INSOPTX) $(PTARGET) $@ X X# X# gmake only. Other make implementations use a no-xxx/ prefix. X# gmake calls prerequisites the the right of | order-only-prerequisites X# and does not evaluate the time stamp from such prerequisites. X# X$(GMAKE_ONLY)$(DEST_DIR)$(INSBASE)/$(PREINSDIR)$(INSDIR)$(SUBINSDIR)$(SUBINS)/$(TARGET)$(_EXEEXT): | \ X $(DEST_DIR)$(INSBASE)/$(PREINSDIR)$(INSDIR)$(SUBINSDIR)$(SUBINS) X X$(SRCROOT)/bins/$(OARCH)/$(TARGET)$(_EXEEXT): $(PTARGET) X $(INSTALL) $(INSFLAGS) $(INSOPTX) $(PTARGET) $@ X XPHARDLINKS= $(HARDLINKS:%=$(DEST_DIR)$(INSBASE)/$(PREINSDIR)$(INSDIR)$(SUBINSDIR)$(SUBINS)/%$(_EXEEXT)) Xhardlinks: finstall $(PHARDLINKS) X XPSYMLINKS= $(SYMLINKS:%=$(DEST_DIR)$(INSBASE)/$(PREINSDIR)$(INSDIR)$(SUBINSDIR)$(SUBINS)/%$(_EXEEXT)) Xsymlinks: finstall $(PSYMLINKS) X X_INSMODEINS= $(_UNIQ)$(INSMODEI) X__INSMODEINS= $(_INSMODEINS:$(_UNIQ)=$(INSMODEX)) XINSMODEINS= $(__INSMODEINS:$(_UNIQ)%=%) X Xdummy $(PHARDLINKS): $(DEST_DIR)$(INSBASE)/$(PREINSDIR)$(INSDIR)$(SUBINSDIR)$(SUBINS)/$(TARGET)$(_EXEEXT) X @echo " ==> INSTALLING link \"$@\""; $(RM) $(RM_FORCE) $@; [ ! -d "$(@D)" ] && sh $(SRCROOT)/conf/mkdir-sh -p "$(@D)"; $(LN) $(DEST_DIR)$(INSBASE)/$(PREINSDIR)$(INSDIR)$(SUBINSDIR)$(SUBINS)/$(TARGET)$(_EXEEXT) $@ X Xsymdummy $(PSYMLINKS): $(DEST_DIR)$(INSBASE)/$(PREINSDIR)$(INSDIR)$(SUBINSDIR)$(SUBINS)/$(TARGET)$(_EXEEXT) X @echo " ==> INSTALLING symlink \"$@\""; $(RM) $(RM_FORCE) $@; [ ! -d "$(@D)" ] && sh $(SRCROOT)/conf/mkdir-sh -p "$(@D)"; $(SYMLINK) $(TARGET)$(_EXEEXT) $@ X Xxinstall: finstall X @if [ ".$(XMK_FILE)" != . ] ; then \ X for XMK_F in $(XMK_FILE) XxZzY-- ; do \ X ( \ X if [ -r ./$$XMK_F ] ; then \ X echo " ==> MAKING \"install\" ON SUBCOMPONENT \"$(CURDIR)/$$XMK_F\""; \ X "$(MAKE)" -f $$XMK_F $(MAKEMACS) XARCH=$(XARCH) install; \ X else \ X if [ $$XMK_F != XxZzY-- ]; then \ X echo "NOTICE: Partial source ($(DIRNAME)/$$XMK_F) missing";\ X fi \ X fi \ X ); \ X done \ X fi X Xxuninstall: X @if [ ".$(XMK_FILE)" != . ] ; then \ X for XMK_F in $(XMK_FILE) XxZzY-- ; do \ X ( \ X if [ -r ./$$XMK_F ] ; then \ X echo " ==> MAKING \"uninstall\" ON SUBCOMPONENT \"$(CURDIR)/$$XMK_F\""; \ X "$(MAKE)" -f $$XMK_F $(MAKEMACS) XARCH=$(XARCH) uninstall; \ X else \ X if [ $$XMK_F != XxZzY-- ]; then \ X echo "NOTICE: Partial source ($(DIRNAME)/$$XMK_F) missing";\ X fi \ X fi \ X ); \ X done \ X fi X Xman installman: X @if [ ".$(XMK_FILE)" != . ] ; then \ X for XMK_F in $(XMK_FILE) XxZzY-- ; do \ X ( \ X if [ -r ./$$XMK_F ] ; then \ X echo " ==> MAKING \"$@\" ON SUBCOMPONENT \"$(CURDIR)/$$XMK_F\""; \ X "$(MAKE)" -f $$XMK_F $(MAKEMACS) XARCH=$(XARCH) $@; \ X else \ X if [ $$XMK_F != XxZzY-- ]; then \ X echo "NOTICE: Partial source ($(DIRNAME)/$$XMK_F) missing";\ X fi \ X fi \ X ); \ X done \ X fi X Xfinstall: $(DEST_DIR)$(INSBASE)/$(PREINSDIR)$(INSDIR)$(SUBINSDIR)$(SUBINS) \ X $(WAIT) \ X $(DEST_DIR)$(INSBASE)/$(PREINSDIR)$(INSDIR)$(SUBINSDIR)$(SUBINS)/$(TARGET)$(_EXEEXT) X Xinstall: all finstall \ X hardlinks symlinks \ X xinstall X Xuninstall: xuninstall X $(RM) $(RM_FORCE) $(PSYMLINKS) $(PHARDLINKS) \ X $(DEST_DIR)$(INSBASE)/$(PREINSDIR)$(INSDIR)$(SUBINSDIR)$(SUBINS)/$(TARGET)$(_EXEEXT) X Xibins: all $(SRCROOT)/bins/$(OARCH) \ X $(SRCROOT)/bins/$(OARCH)/$(TARGET)$(_EXEEXT) END-of-star-1.6/RULES/rules.ins echo x - star-1.6/RULES/rules.aux sed 's/^X//' >star-1.6/RULES/rules.aux << 'END-of-star-1.6/RULES/rules.aux' X#ident "@(#)rules.aux 1.9 10/05/14 " X########################################################################### X# Written 1997 by J. Schilling X########################################################################### X# X# Rules for installing auxiliary files X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XPTARGET= $(TARGET)$(AUXSRCEXT) XSRCFILE= $(TARGET)$(AUXSRCEXT) X########################################################################### X X_INSMODEI= $(_UNIQ)$(INSMODE) X__INSMODEI= $(_INSMODEI:$(_UNIQ)=$(INSMODEF)) XINSMODEI= $(__INSMODEI:$(_UNIQ)%=%) X Xall: $(SRCFILE) X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/sub.htm Xinclude $(SRCROOT)/$(RULESDIR)/rules.clr Xinclude $(SRCROOT)/$(RULESDIR)/rules.ins Xinclude $(SRCROOT)/$(RULESDIR)/rules.tag Xinclude $(SRCROOT)/$(RULESDIR)/rules.hlp Xinclude $(SRCROOT)/$(RULESDIR)/dummy.dep X########################################################################### END-of-star-1.6/RULES/rules.aux echo x - star-1.6/RULES/i686-mingw32_nt-gcc.rul sed 's/^X//' >star-1.6/RULES/i686-mingw32_nt-gcc.rul << 'END-of-star-1.6/RULES/i686-mingw32_nt-gcc.rul' X#ident "@(#)i686-mingw32_nt-gcc.rul 1.13 18/04/11 " X########################################################################### X# X# Platform dependent MACROS for Win32/Mingw32 X# X########################################################################### X# Copyright (c) 2004-2018 J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-gcc.rul X XOSDEFS += XCPPOPTS= -I/MinGW/Include -I$(ARCHDIR) -I$(OINCSDIR) $(INCDIRS:%=-I%) $(INCDIRSX:%=-I%) X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X XWIN_LIBS= $(WIN32_LIBS) X XLDLIBS= $(LIBS) $(LIBX) $(WIN_LIBS) -lmingw32 X XLDOPTS= $(LIBS_PATH) $(LDPATH) X XLORDER= echo XTSORT= cat X X_MKDIR= $(_MKDIR_SH) XMKDIR= $(MKDIR_SH) XINSMKDIR= $(INSMKDIR_SH) END-of-star-1.6/RULES/i686-mingw32_nt-gcc.rul echo x - star-1.6/RULES/powerpc-beos-gcc.rul sed 's/^X//' >star-1.6/RULES/powerpc-beos-gcc.rul << 'END-of-star-1.6/RULES/powerpc-beos-gcc.rul' X#ident "@(#)powerpc-beos-gcc.rul 1.8 07/05/09 " X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for BeOS X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-gcc.rul X X# X# XXX Old BeOS needs libroot.so to get [efg]cvt() X# XXX New BeOS seems to have this in libc and in addition we include X# XXX strtod.c for floating point conversion on OS without such code. X# XXX For this reason, -DNO_FLOATINGPOINT -DUSE_FLOATINGARGS has been X# XXX removed and printing floating numbers will work with old/new BeOS X# X#OSDEFS += -DNO_FLOATINGPOINT -DUSE_FLOATINGARGS XOSDEFS += X XKDEFINES= -DKERNEL -D_KERNEL X X#CONFFLAGS= X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so X XLIB_SOCKET= XLIB_MATH= XLIB_KVM= X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%) XLDOPTS= $(LIBS_PATH) $(LDPATH) X XLORDER= echo XTSORT= cat END-of-star-1.6/RULES/powerpc-beos-gcc.rul echo x - star-1.6/RULES/r-gmake.tag sed 's/^X//' >star-1.6/RULES/r-gmake.tag << 'END-of-star-1.6/RULES/r-gmake.tag' X#ident "@(#)r-gmake.tag 1.3 07/12/01 " X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# Tag building rules for gmake X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XTAGS: $(CFILES) $(CFILES_TAG) $(HFILES) $(HFILES_TAG) X $(ETAGS) $+ X Xtags: $(CFILES) $(CFILES_TAG) $(HFILES) $(HFILES_TAG) X $(CTAGS) -t $+ END-of-star-1.6/RULES/r-gmake.tag echo x - star-1.6/RULES/rules.csw sed 's/^X//' >star-1.6/RULES/rules.csw << 'END-of-star-1.6/RULES/rules.csw' X#ident "@(#)rules.csw 1.6 11/09/28 " X########################################################################### X# Written 2005 by J. Schilling X########################################################################### X# X# Rules for creating Blastwave SVr4 packages X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X XPKG :sh= sed -n 's/^PKG=//p' pkginfo X#VERSION :sh= sed -n 's/^VERSION=//p' pkginfo XVERSION :sh= sed -n 's/^VERSION=\([^,]*\).*/\1/p' pkginfo XNAME :sh= sed -n 's/^NAME=//p' pkginfo|awk '{print $1}' XOS_NAME :sh= uname -s XDATE :sh= date '+REV=%Y.%m.%d' X XVENDOR= -CSW XPROTOTYPE= prototype X X$(SRCROOT)/packages/$(OARCH): X $(MKDIR) -p $@ X Xall: $(SRCROOT)/packages/$(OARCH) X if [ .$(PKG_RELOC) = .no ]; then \ X pkgmk -o -r `pwd`/$(SRCROOT)/$(PROTODIR)$(PKGROOTX) -d $(SRCROOT)/packages/$(OARCH) \ X -a $(P_ARCH) \ X -v $(VERSION),$(DATE) -f $(PROTOTYPE)_r \ X $(EMAIL:%=EMAIL=%) $(HOTLINE:%=HOTLINE=%) \ X pkgbase=`pwd` \ X $(PKGOPTX); \ X else \ X pkgmk -o -b `pwd`/$(SRCROOT)/$(PROTODIR)/$(INSBASE) -d $(SRCROOT)/packages/$(OARCH) \ X -a $(P_ARCH) \ X -v $(VERSION),$(DATE) -f $(PROTOTYPE) BASEDIR=$(INSBASE) \ X $(EMAIL:%=EMAIL=%) $(HOTLINE:%=HOTLINE=%) \ X pkgbase=`pwd` \ X $(PKGOPTX); \ X fi X pkgtrans -s $(SRCROOT)/packages/$(OARCH) $(NAME)-$(VERSION),$(DATE)-$(OS_NAME)$(OSREL)-$(P_ARCH)$(VENDOR).pkg $(PKG) X gzip -9f $(SRCROOT)/packages/$(OARCH)/$(NAME)-$(VERSION),$(DATE)-$(OS_NAME)$(OSREL)-$(P_ARCH)$(VENDOR).pkg END-of-star-1.6/RULES/rules.csw echo x - star-1.6/RULES/rules1.dir sed 's/^X//' >star-1.6/RULES/rules1.dir << 'END-of-star-1.6/RULES/rules1.dir' X#ident @(#)rules1.dir 1.16 11/04/14 X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# DIRS contains the names of all directories where sub make should take place X# X# The code that is shared between rules.dir and rules.rdi X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X X$(ALLTARGETS): X @list="$(DIRS)"; \ X if [ -d TARGETS -a -f TARGETS/__slot ]; then \ X list=`echo TARGETS/[0123456789][0123456789]* | \ X sed -e 's;TARGETS/[0123456789][0123456789];;g' | sed -e 's;!@!;/;g'`;\ X fi; \ X for DIR in $${list} ; \ X do \ X ( \ X echo " ==> MAKING \"$@\" ON SUBDIRECTORY \"$(CURDIR)/$$DIR\"";\ X if [ -d ./$$DIR -a -r ./$$DIR/Makefile ] ; then \ X cd ./$$DIR && "$(MAKE)" $(MAKEMACS) XARCH=$(XARCH) DIRNAME=$(CURDIR)/$$DIR $@; \ X else \ X echo "NOTICE: Partial source ($(CURDIR)/$$DIR) missing";\ X fi \ X ); \ X done X Xtinfo: X @[ -d TARGETS -a -f TARGETS/__slot ] && list=`echo TARGETS/[0123456789][0123456789]*`;\ X for i in $${list}; \ X do \ X (read line < $$i; \ X name=`echo $$i | sed -e 's;TARGETS/[0123456789][0123456789];;' | sed -e 's;!@!;/;g'`; \ X echo "$$name - $${line}"; \ X ); \ X done X X########################################################################### END-of-star-1.6/RULES/rules1.dir echo x - star-1.6/RULES/profiled.lnk sed 's/^X//' >star-1.6/RULES/profiled.lnk << 'END-of-star-1.6/RULES/profiled.lnk' X#ident "@(#)profiled.lnk 1.1 07/06/29 " X########################################################################### X# Written 2006 by J. Schilling X########################################################################### X# X# Rules for commands that are links statically against internal libs X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XSHLDIR= /profiled XNO_SHL= no END-of-star-1.6/RULES/profiled.lnk echo x - star-1.6/RULES/rules.inc sed 's/^X//' >star-1.6/RULES/rules.inc << 'END-of-star-1.6/RULES/rules.inc' X#ident @(#)rules.inc 1.11 18/08/13 X########################################################################### X# Written 1999 by J. Schilling X########################################################################### X# X# Rules for creating include files (usually found in .../incs/machdir) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X#_EXEEXT= $(EXEEXT) # Do not install as xxx.h.exe X_XEXEEXT= $(XEXEEXT) X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.obj X########################################################################### X XPTARGET= $(OINCSDIR)/$(TARGET) XPTARGETC= $(ARCHDIR)/$(TARGETC) XPTARGETCX= $(ARCHDIR)/$(TARGETC)$(_EXEEXT) X X_INSMODEI= $(_UNIQ)$(INSMODE) X__INSMODEI= $(_INSMODEI:$(_UNIQ)=$(INSMODEF)) XINSMODEI= $(__INSMODEI:$(_UNIQ)%=%) X X__LD_OUTPUT_OPTION= $(_UNIQ)$(LD_OUTPUT_OPTION) X___LD_OUTPUT_OPTION= $(__LD_OUTPUT_OPTION:$(_UNIQ)=-o $@) X_LD_OUTPUT_OPTION= $(___LD_OUTPUT_OPTION:$(_UNIQ)%=%) X XLIBS_PATH += $(LIBS_PATH_STATIC) X Xall: $(PTARGETCX) $(PTARGET) X X$(PTARGETCX): $(OFILES) $(SRCLIBS) X $(LDCC) $(_LD_OUTPUT_OPTION) $(POFILES) $(LDFLAGS) $(LDLIBS) X# X# If calling "$(PTARGETC)$(_XEXEEXT)" fails, this may be a cross compilation, X# so retry to run the command under control of "$(CONFIG_RMTCALL)". X# X# We previously had; X# $(PTARGET): $(OINCSDIR) $(PTARGETCX) X# but that caused $(PTARGET) not only to depend on the existence but also X# on the time stamp of the directory $(OINCSDIR), that could change. X# Since rules.top contains a rule to create $(OINCSDIR), we may safely assume X# that $(OINCSDIR) exists before we create $(PTARGET) X# X$(PTARGET): $(PTARGETCX) X @echo " ==> GENERATING include file \"$@\""; \ X $(PTARGETC)$(_XEXEEXT) > $@ || \ X $(CONFIG_RMTCALL) $(PTARGETC)$(_XEXEEXT) > $@ X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/sub.htm Xinclude $(SRCROOT)/$(RULESDIR)/rules.clr Xinclude $(SRCROOT)/$(RULESDIR)/rules.ins Xinclude $(SRCROOT)/$(RULESDIR)/rules.tag Xinclude $(SRCROOT)/$(RULESDIR)/rules.hlp Xinclude $(SRCROOT)/$(RULESDIR)/rules.dep X########################################################################### END-of-star-1.6/RULES/rules.inc echo x - star-1.6/RULES/README sed 's/^X//' >star-1.6/RULES/README << 'END-of-star-1.6/RULES/README' XPATH setzen XLD_RUN_PATH loeschen XLD_LIBRARY_PATH Loeschen Xumask setzen X Xsymlink libxxx.so -> libxxx.so.x.y Xbei install setzen X Xhighlevel rules: X Xrules.aux Xrules.cmd Xrules.dir Xrules.drv Xrules.lib Xrules.loc Xrules.mks Xrules.mod Xrules.rdi Xrules.shl X Xsollten umbenannt werden z.B. in xrules.* X XSunPRo -mt GCC -D_REENTRANT -lthread X XDESTDIR fuer GNU autoconf Kompatibilitaet? X END-of-star-1.6/RULES/README echo x - star-1.6/RULES/power-macintosh-darwin-cc.rul sed 's/^X//' >star-1.6/RULES/power-macintosh-darwin-cc.rul << 'END-of-star-1.6/RULES/power-macintosh-darwin-cc.rul' X#ident "@(#)power-macintosh-darwin-cc.rul 1.21 14/04/02 " X########################################################################### X# Written 1996-2014 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for Darwin-1.2 ff. (Apple MacOS X) PPC (GCC) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-$(C_ARCH:cc%=gcc%).rul XCC_COM_DEF= cc X XOSDEFS += X XKDEFINES= -DKERNEL -D_KERNEL X XCOPTDYN= -fPIC XC++OPTDYN= -fPIC X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .dylib X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%) XLDFRAMEWORKS= -framework IOKit -framework CoreFoundation XLDOPTS= $(LIBS_PATH) $(LDPATH) $(LDFRAMEWORKS) XLDOPTDYN= -install_name $(INSBASE)/lib/$(TARGET) XLDLIBDYN= -lgcc_s.1 XLNDYNLIB= @ X XDYNLD= @echo " ==> LINKING dynamic library \"$@\""; libtool -dynamic XDYNLDC++ = @echo " ==> LINKING dynamic library \"$@\""; libtool -dynamic XRANLIB= @echo " ==> RANDOMIZING ARCHIVE \"$@\""; ranlib X X# X# lorder seems not to work on some versions because Apple installed X# a broken /bin/sh that is not POSIX cimpliant an will not X# be able to run the /usr/bin/lorder script. The error messages are: X# type: not found X# type: not found X# lorder: nm: not found X# ... disable it X# XLORDER= echo XTSORT= cat END-of-star-1.6/RULES/power-macintosh-darwin-cc.rul echo x - star-1.6/RULES/power-macintosh-darwin-gcc.rul sed 's/^X//' >star-1.6/RULES/power-macintosh-darwin-gcc.rul << 'END-of-star-1.6/RULES/power-macintosh-darwin-gcc.rul' X#ident "@(#)power-macintosh-darwin-gcc.rul 1.19 14/04/02 " X########################################################################### X# Written 1996-2014 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for Darwin-1.2 ff. (Apple MacOS X) PPC (GCC) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-$(C_ARCH).rul X XOSDEFS += X XKDEFINES= -DKERNEL -D_KERNEL X XCOPTDYN= -fPIC XC++OPTDYN= -fPIC X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .dylib X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%) XLDFRAMEWORKS= -framework IOKit -framework CoreFoundation XLDOPTS= $(LIBS_PATH) $(LDPATH) $(LDFRAMEWORKS) XLDOPTDYN= -install_name $(INSBASE)/lib/$(TARGET) XLDLIBDYN= -lgcc_s.1 XLNDYNLIB= @ X XDYNLD= @echo " ==> LINKING dynamic library \"$@\""; libtool -dynamic XDYNLDC++ = @echo " ==> LINKING dynamic library \"$@\""; libtool -dynamic XRANLIB= @echo " ==> RANDOMIZING ARCHIVE \"$@\""; ranlib X X# X# lorder seems not to work on some versions because Apple installed X# a broken /bin/sh that is not POSIX cimpliant an will not X# be able to run the /usr/bin/lorder script. The error messages are: X# type: not found X# type: not found X# lorder: nm: not found X# ... disable it X# XLORDER= echo XTSORT= cat END-of-star-1.6/RULES/power-macintosh-darwin-gcc.rul echo x - star-1.6/RULES/rules.dep sed 's/^X//' >star-1.6/RULES/rules.dep << 'END-of-star-1.6/RULES/rules.dep' X#ident "@(#)rules.dep 1.2 06/05/14 " X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# Dependency building rules ... use MAKEPROG specific version X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/r-$(MAKEPROG).dep END-of-star-1.6/RULES/rules.dep echo x - star-1.6/RULES/sub.htm sed 's/^X//' >star-1.6/RULES/sub.htm << 'END-of-star-1.6/RULES/sub.htm' X#ident "@(#)sub.htm 1.5 11/09/18 " X########################################################################### X# Written 2007 by J. Schilling X########################################################################### X# X# Manual page to html converting rules X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X Xhtml htmlx htmlxn: X @if [ ".$(XMK_FILE)" != . ] ; then \ X for XMK_F in $(XMK_FILE) XxZzY-- ; do \ X ( \ X if [ -r ./$$XMK_F ] ; then \ X echo " ==> MAKING \"install\" ON SUBCOMPONENT \"$(CURDIR)/$$XMK_F\""; \ X "$(MAKE)" -f $$XMK_F $(MAKEMACS) XARCH=$(XARCH) $@; \ X else \ X if [ $$XMK_F != XxZzY-- ]; then \ X echo "NOTICE: Partial source ($(DIRNAME)/$$XMK_F) missing";\ X fi \ X fi \ X ); \ X done \ X fi END-of-star-1.6/RULES/sub.htm echo x - star-1.6/RULES/aviion-dgux3-cc.rul sed 's/^X//' >star-1.6/RULES/aviion-dgux3-cc.rul << 'END-of-star-1.6/RULES/aviion-dgux3-cc.rul' X#ident "@(#)aviion-dgux3-cc.rul 1.8 07/05/08 " X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for DGUX 3.x on mc88100 X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-dg.rul X XOSDEFS += -D__SVR4 -DSVR4 X XKDEFINES= -DKERNEL -D_KERNEL X X#LIB_SOCKET= -lsocket -lnsl -ldl XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= -lkvm -lelf X XARFLAGS= crs END-of-star-1.6/RULES/aviion-dgux3-cc.rul echo x - star-1.6/RULES/alpha-osf1-gcc.rul sed 's/^X//' >star-1.6/RULES/alpha-osf1-gcc.rul << 'END-of-star-1.6/RULES/alpha-osf1-gcc.rul' X#ident "@(#)alpha-osf1-gcc.rul 1.9 18/04/11 " X########################################################################### X# Written 1998-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for Digital UNIX (OSF1) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-gcc.rul X XOSDEFS += X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X XLIBS_PATH= -L$(OLIBSDIR) -L/usr/ccs/lib X XLDLIBS= $(LIBS) $(LIBX) -lrt X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%) XLDOPTS= $(LIBS_PATH) $(LDPATH) X XLORDER= echo XTSORT= cat END-of-star-1.6/RULES/alpha-osf1-gcc.rul echo x - star-1.6/RULES/hppa-nextstep-gcc.rul sed 's/^X//' >star-1.6/RULES/hppa-nextstep-gcc.rul << 'END-of-star-1.6/RULES/hppa-nextstep-gcc.rul' X#ident "@(#)hppa-nextstep-gcc.rul 1.13 18/04/11 " X########################################################################### X# Written 1996-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for NeXT Step on hppa (GCC) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-gcc.rul X XOSDEFS += X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%) XLDOPTS= $(LIBS_PATH) $(LDPATH) XLDOPTDYN= XLNDYNLIB= @ X XDYNLD= @echo " ==> LINKING dynamic library \"$@\""; ld XRANLIB= @echo " ==> RANDOMIZING ARCHIVE \"$@\""; ranlib X X_MKDIR= $(_MKDIR_SH) XMKDIR= $(MKDIR_SH) XINSMKDIR= $(INSMKDIR_SH) END-of-star-1.6/RULES/hppa-nextstep-gcc.rul echo x - star-1.6/RULES/bemac-beos-mwcc.rul sed 's/^X//' >star-1.6/RULES/bemac-beos-mwcc.rul << 'END-of-star-1.6/RULES/bemac-beos-mwcc.rul' X#ident @(#)bemac-beos-mwcc.rul 1.10 13/11/04 X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for BeOS X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-bemwcc.rul X XOSDEFS += X XCPPOPTS= -relax_pointers -opt all -sym on -g -i- -I$(ARCHDIR) -I$(OINCSDIR) $(INCDIRS:%=-I%) $(INCDIRSX:%=-I%) X XKDEFINES= -DKERNEL -D_KERNEL X X#LIB_SOCKET= -lsocket -lnsl -ldl XLIB_SOCKET= X#LIB_MATH= -lm X#LIB_KVM= -lkvm XLIB_KVM= X XLORDER= echo XTSORT= cat X XLN= /bin/ln -s END-of-star-1.6/RULES/bemac-beos-mwcc.rul echo x - star-1.6/RULES/bepc-beos-cc.rul sed 's/^X//' >star-1.6/RULES/bepc-beos-cc.rul << 'END-of-star-1.6/RULES/bepc-beos-cc.rul' X#ident @(#)bepc-beos-cc.rul 1.10 07/05/09 X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for BeOS X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-gcc.rul X X# X# XXX Old BeOS needs libroot.so to get [efg]cvt() X# XXX New BeOS seems to have this in libc and in addition we include X# XXX strtod.c for floating point conversion on OS without such code. X# XXX For this reason, -DNO_FLOATINGPOINT -DUSE_FLOATINGARGS has been X# XXX removed and printing floating numbers will work with old/new BeOS X# X#OSDEFS += -DNO_FLOATINGPOINT -DUSE_FLOATINGARGS XOSDEFS += X XKDEFINES= -DKERNEL -D_KERNEL X X#CONFFLAGS= i586 X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so X XLIB_SOCKET= -lsocket -lbind XLIB_MATH= XLIB_KVM= X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%) XLDOPTS= $(LIBS_PATH) $(LDPATH) X XLORDER= echo XTSORT= cat X XLN= /bin/ln -s END-of-star-1.6/RULES/bepc-beos-cc.rul echo x - star-1.6/RULES/i386-at386-gnu-cc.rul sed 's/^X//' >star-1.6/RULES/i386-at386-gnu-cc.rul << 'END-of-star-1.6/RULES/i386-at386-gnu-cc.rul' X#ident "@(#)i386-at386-gnu-cc.rul 1.8 18/04/11 " X########################################################################### X# Written 1996-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for GNU (hurd) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-gcc.rul X XOSDEFS += X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%) XLDOPTS= $(LIBS_PATH) $(LDPATH) X XLORDER= echo XTSORT= cat END-of-star-1.6/RULES/i386-at386-gnu-cc.rul echo x - star-1.6/RULES/rules.dir sed 's/^X//' >star-1.6/RULES/rules.dir << 'END-of-star-1.6/RULES/rules.dir' X#ident @(#)rules.dir 1.8 06/05/14 X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# DIRS contains the names of all directories where sub make should take place X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X Xinclude $(SRCROOT)/$(RULESDIR)/rules1.dir X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.hlp X########################################################################### END-of-star-1.6/RULES/rules.dir echo x - star-1.6/RULES/rules.drv sed 's/^X//' >star-1.6/RULES/rules.drv << 'END-of-star-1.6/RULES/rules.drv' X#ident @(#)rules.drv 1.8 08/12/27 X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# Rules for loadable drivers X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.obj X########################################################################### X X_INSMODEI= $(_UNIQ)$(INSMODE) X__INSMODEI= $(_INSMODEI:$(_UNIQ)=$(INSMODEX)) XINSMODEI= $(__INSMODEI:$(_UNIQ)%=%) X Xall: $(PTARGET) X X$(PTARGET): $(OFILES) $(SRCLIBS) X $(LD) -r -o $@ $(POFILES) $(SRCLIBS) $(LIBS) X XINSBASE= $(INS_KBASE:%/=%) XCPPOPTS += $(KDEFINES) X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/sub.htm Xinclude $(SRCROOT)/$(RULESDIR)/rules.clr Xinclude $(SRCROOT)/$(RULESDIR)/rules.ins Xinclude $(SRCROOT)/$(RULESDIR)/rules.tag Xinclude $(SRCROOT)/$(RULESDIR)/rules.hlp Xinclude $(SRCROOT)/$(RULESDIR)/rules.dep X########################################################################### END-of-star-1.6/RULES/rules.drv echo x - star-1.6/RULES/i386-freebsd-gcc.rul sed 's/^X//' >star-1.6/RULES/i386-freebsd-gcc.rul << 'END-of-star-1.6/RULES/i386-freebsd-gcc.rul' X#ident "@(#)i386-freebsd-gcc.rul 1.9 18/04/11 " X########################################################################### X# Written 1997-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for FreeBSD X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-gcc.rul X XOSDEFS += X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X XLDOPTS= $(LIBS_PATH) $(LDPATH) X XRANLIB= @echo " ==> RANDOMIZING ARCHIVE \"$@\""; ranlib END-of-star-1.6/RULES/i386-freebsd-gcc.rul echo x - star-1.6/RULES/cc-hp.rul sed 's/^X//' >star-1.6/RULES/cc-hp.rul << 'END-of-star-1.6/RULES/cc-hp.rul' X#ident "@(#)cc-hp.rul 1.19 18/08/16 " X########################################################################### X# Written 1996-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for HP/UC cc X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X XCPP_FLAGS= -DSCHILY_BUILD $(CPPOPTS) $(CPPOPTX) $(OSINCDIRS:%=-I%) $(OSDEFS) $(OSDEFSX) XC_FLAGS= $(COPTS) $(CWARNOPTS) $(COPTOPT) $(HPCOPTOPT) $(COPTX) XC++FLAGS= $(C++OPTS) $(C++WARNOPTS) $(C++OPTOPT) $(HPC++OPTOPT) $(C++OPTX) X XCPPOPTS= -I$(ARCHDIR) -I$(OINCSDIR) $(INCDIRS:%=-I%) $(INCDIRSX:%=-I%) X# X# -Ae -> ANSI C (non-bundled C only - bundled C ignores -Ae) X# +DAportable -> Create Parisc-1.1 code X# XHP_CC_ANSI_OPT= -Ae # May be overwritten later from $(OINCSDIR)/rules.cnf XHP_CC_OPT_OPT= -O # May be overwritten later from $(OINCSDIR)/rules.cnf XHP_CC_GPROF_OPT= -G # May be overwritten later from $(OINCSDIR)/rules.cnf X XCOPTS= $(HP_CC_ANSI_OPT) +DAportable XCWOPTS= XCOPTOPT= $(HP_CC_OPT_OPT) XCOPTDYN= +z XCOPTGPROF= $(HP_CC_GPROF_OPT) XC++OPTS= XC++WOPTS= X#C++OPTOPT= -O X#C++OPTDYN= -Kpic X#C++OPTGPROF= -xpg X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .sl.$(DYNMAJOR) X XLIB_C= -lc X XLIBS_PATH= -L$(OLIBSDIR) XLIBS_PATH_STATIC= -L$(OLIBSDIR_STATIC) X XLDFLAGS= $(LDOPTS) $(LDOPTX) XLDLIBS= $(LIBS) $(LIBX) X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH) XLDOPTS= $(LIBS_PATH) $(LDPATH) X#LDOPTDYN= -Wl,-soname,$(TARGET) XLDOPTDYN= -b XLNDYNLIB= @$(RM) $(RM_FORCE) $(PTARGET_BASE).sl; $(SYMLINK) $(TARGET) $(PTARGET_BASE).sl X XFLOAT_OPTIONS= X X__CC_COM= $(_UNIQ)$(CC) X___CC_COM= $(__CC_COM:$(_UNIQ)=$(CC_COM_DEF)) XCC_COM= $(___CC_COM:$(_UNIQ)%=%) X X__CC++_COM= $(_UNIQ)$(CCC) X___CC++_COM= $(__CC++_COM:$(_UNIQ)=$(CC++_COM_DEF)) XCC++_COM= $(___CC++_COM:$(_UNIQ)%=%) X XCC_COM_DEF= cc XCC++_COM_DEF= echo "C++ not yet supported"; exit -1; : X# X# Use to comment out C++ projects X# XC++BUILD= $(NUMBER_SIGN) X XCC= $(CC_COM_DEF) XCCC= $(CC++_COM_DEF) X XCCCC= @echo " ==> COMPILING \"$@\""; $(CC_COM) XLDCC= @echo " ==> LINKING \"$@\""; $(CC_COM) X#DYNLD= @echo " ==> LINKING dynamic library \"$@\""; $(CC_COM) XDYNLD= @echo " ==> LINKING dynamic library \"$@\""; ld X XRMDEP= : XMKDEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); $(SRCROOT)/conf/mkdep-hpux.sh XMKDEP_OUT= X XCC++ = @echo " ==> COMPILING \"$@\""; $(CC++_COM) XLDCC++ = @echo " ==> LINKING \"$@\""; $(CC++_COM) X#DYNLDC++ = @echo " ==> LINKING dynamic library \"$@\""; $(CC++_COM) XDYNLDC++ = @echo " ==> LINKING dynamic library \"$@\""; ld XMKC++DEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); $(CC++_COM); echo "Cannot do -M with unknown CC"; : XMKC++DEP_OUT= END-of-star-1.6/RULES/cc-hp.rul echo x - star-1.6/RULES/cc-ibm.rul sed 's/^X//' >star-1.6/RULES/cc-ibm.rul << 'END-of-star-1.6/RULES/cc-ibm.rul' X#ident "@(#)cc-ibm.rul 1.19 18/08/16 " X########################################################################### X# Written 1996-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for IBM AIX cc X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X XIBMCC_OPT= XIBMCC_OPT32= -q32 XIBMCC_OPT64= -q64 XIBMCC_OPTXX= $(IBMCC_OPT$(C_ARCH:cc%=%)) X XIBMLD_OPT= XIBMLD_OPT32= -b32 XIBMLD_OPT64= -b64 XIBMLC_OPTXX= $(IBMLD_OPT$(C_ARCH:cc%=%)) X XCPP_FLAGS= -DSCHILY_BUILD $(CPPOPTS) $(CPPOPTX) $(OSINCDIRS:%=-I%) $(OSDEFS) $(OSDEFSX) XC_FLAGS= $(COPTS) $(CWARNOPTS) $(COPTOPT) $(IBMCOPTOPT) $(COPTX) XC++FLAGS= $(C++OPTS) $(C++WARNOPTS) $(C++OPTOPT) $(IBMC++OPTOPT) $(C++OPTX) X XCPPOPTS= -I$(ARCHDIR) -I$(OINCSDIR) $(INCDIRS:%=-I%) $(INCDIRSX:%=-I%) XCOPTS= $(IBMCC_OPTXX) XCWOPTS= XCOPTOPT= -O XCOPTDYN= -pic XCOPTGPROF= -pg XC++OPTS= $(IBMCC_OPTXX) XC++WOPTS= X#C++OPTOPT= -O X#C++OPTDYN= -Kpic X#C++OPTGPROF= -xpg X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_C= -lc X XLIBS_PATH= -L$(OLIBSDIR) XLIBS_PATH_STATIC= -L$(OLIBSDIR_STATIC) X XLDFLAGS= $(LDOPTS) $(LDOPTX) XLDLIBS= $(LIBS) $(LIBX) X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH) XLDOPTS= $(LIBS_PATH) $(LDPATH) XLDOPTDYN= XLNDYNLIB= @ X XFLOAT_OPTIONS= X X__CC_COM= $(_UNIQ)$(CC) X___CC_COM= $(__CC_COM:$(_UNIQ)=$(CC_COM_DEF)) XCC_COM= $(___CC_COM:$(_UNIQ)%=%) X X__CC++_COM= $(_UNIQ)$(CCC) X___CC++_COM= $(__CC++_COM:$(_UNIQ)=$(CC++_COM_DEF)) XCC++_COM= $(___CC++_COM:$(_UNIQ)%=%) X XCC_COM_DEF= cc XCC++_COM_DEF= echo "C++ not yet supported"; exit -1; : X# X# Use to comment out C++ projects X# XC++BUILD= $(NUMBER_SIGN) X XCC= $(CC_COM_DEF) XCCC= $(CC++_COM_DEF) X XCCCC= @echo " ==> COMPILING \"$@\""; $(CC_COM) $(IBMCC_OPTXX) XLDCC= @echo " ==> LINKING \"$@\""; $(CC_COM) $(IBMCC_OPTXX) XDYNLD= @echo " ==> LINKING dynamic library \"$@\""; ld X XRMDEP= : XMKDEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); $(SRCROOT)/conf/mkdep-aix.sh $(IBMCC_OPTXX) XMKDEP_OUT= X X#$RMDEP= : X#$#MKDEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); $(CC_COM) -M X#$MKDEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); echo "Cannot do -M with IBM'cc"; : X#$MKDEP_OUT= X XCC++ = @echo " ==> COMPILING \"$@\""; $(CC++_COM) $(IBMCC_OPTXX) XLDCC++ = @echo " ==> LINKING \"$@\""; $(CC++_COM) $(IBMCC_OPTXX) XDYNLDC++ = @echo " ==> LINKING dynamic library \"$@\""; $(CC++_COM) $(IBMCC_OPTXX) XMKC++DEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); $(CC++_COM); # mkdep-aix.sh? XMKC++DEP_OUT= END-of-star-1.6/RULES/cc-ibm.rul echo x - star-1.6/RULES/cc-hp64.rul sed 's/^X//' >star-1.6/RULES/cc-hp64.rul << 'END-of-star-1.6/RULES/cc-hp64.rul' X#ident "@(#)cc-hp64.rul 1.20 18/08/16 " X########################################################################### X# Written 1996-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for HP/UC cc X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X XCPP_FLAGS= -DSCHILY_BUILD $(CPPOPTS) $(CPPOPTX) $(OSINCDIRS:%=-I%) $(OSDEFS) $(OSDEFSX) XC_FLAGS= $(COPTS) $(CWARNOPTS) $(COPTOPT) $(HPCOPTOPT) $(COPTX) XC++FLAGS= $(C++OPTS) $(C++WARNOPTS) $(C++OPTOPT) $(HPC++OPTOPT) $(C++OPTX) X XCPPOPTS= -I$(ARCHDIR) -I$(OINCSDIR) $(INCDIRS:%=-I%) $(INCDIRSX:%=-I%) X# X# -Ae -> ANSI C (non-bundled C only - bundled C ignores -Ae) X# +DAportable -> Create Parisc-1.1 code X# XHP_CC_ANSI_OPT= -Ae # May be overwritten later from $(OINCSDIR)/rules.cnf XHP_CC_OPT_OPT= -O # May be overwritten later from $(OINCSDIR)/rules.cnf XHP_CC_GPROF_OPT= -G # May be overwritten later from $(OINCSDIR)/rules.cnf X XCOPTS= $(HP_CC_ANSI_OPT) +DD64 X#COPTS= $(HP_CC_ANSI_OPT) +DAportable +DD64 XCWOPTS= XCOPTOPT= $(HP_CC_OPT_OPT) XCOPTDYN= +z XCOPTGPROF= $(HP_CC_GPROF_OPT) XC++OPTS= +DD64 XC++WOPTS= X#C++OPTOPT= -O X#C++OPTDYN= -Kpic X#C++OPTGPROF= -xpg X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .sl.$(DYNMAJOR) X XLIB_C= -lc X XLIBS_PATH= -L$(OLIBSDIR) XLIBS_PATH_STATIC= -L$(OLIBSDIR_STATIC) X XLDFLAGS= $(LDOPTS) $(LDOPTX) XLDLIBS= $(LIBS) $(LIBX) X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH) XLDOPTS= $(LIBS_PATH) $(LDPATH) XLDOPTDYN= -Wl,-soname,$(TARGET) XLNDYNLIB= @$(RM) $(RM_FORCE) $(PTARGET_BASE).sl; $(SYMLINK) $(TARGET) $(PTARGET_BASE).sl X XFLOAT_OPTIONS= X X__CC_COM= $(_UNIQ)$(CC) X___CC_COM= $(__CC_COM:$(_UNIQ)=$(CC_COM_DEF)) XCC_COM= $(___CC_COM:$(_UNIQ)%=%) X X__CC++_COM= $(_UNIQ)$(CCC) X___CC++_COM= $(__CC++_COM:$(_UNIQ)=$(CC++_COM_DEF)) XCC++_COM= $(___CC++_COM:$(_UNIQ)%=%) X XCC_COM_DEF= cc XCC++_COM_DEF= echo "C++ not yet supported"; exit -1; : X# X# Use to comment out C++ projects X# XC++BUILD= $(NUMBER_SIGN) X XCC= $(CC_COM_DEF) XCCC= $(CC++_COM_DEF) X XCCCC= @echo " ==> COMPILING \"$@\""; $(CC_COM) +DD64 XLDCC= @echo " ==> LINKING \"$@\""; $(CC_COM) +DD64 XDYNLD= @echo " ==> LINKING dynamic library \"$@\""; $(CC_COM) +DD64 X XRMDEP= : XMKDEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); $(SRCROOT)/conf/mkdep-hpux.sh XMKDEP_OUT= X XCC++ = @echo " ==> COMPILING \"$@\""; $(CC++_COM) XLDCC++ = @echo " ==> LINKING \"$@\""; $(CC++_COM) XDYNLDC++ = @echo " ==> LINKING dynamic library \"$@\""; $(CC++_COM) XMKC++DEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); $(CC++_COM); echo "Cannot do -M with unknown CC"; : XMKC++DEP_OUT= END-of-star-1.6/RULES/cc-hp64.rul echo x - star-1.6/RULES/os-beos.def sed 's/^X//' >star-1.6/RULES/os-beos.def << 'END-of-star-1.6/RULES/os-beos.def' X#ident @(#)os-beos.def 1.2 06/05/14 X########################################################################### X# Written 1997 by J. Schilling X########################################################################### X# X# Global os definitions for BeOS X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XMANSTYLE= bsd END-of-star-1.6/RULES/os-beos.def echo x - star-1.6/RULES/i386-openbsd-gcc.rul sed 's/^X//' >star-1.6/RULES/i386-openbsd-gcc.rul << 'END-of-star-1.6/RULES/i386-openbsd-gcc.rul' X#ident "@(#)i386-openbsd-gcc.rul 1.11 18/04/11 " X########################################################################### X# Written 1997-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for OpenBSD X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-gcc.rul X XOSDEFS += X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%) XLDOPTS= $(LIBS_PATH) $(LDPATH) X XRANLIB= @echo " ==> RANDOMIZING ARCHIVE \"$@\""; ranlib END-of-star-1.6/RULES/i386-openbsd-gcc.rul echo x - star-1.6/RULES/ldummy.cnf sed 's/^X//' >star-1.6/RULES/ldummy.cnf << 'END-of-star-1.6/RULES/ldummy.cnf' X#ident @(#)ldummy.cnf 1.2 06/05/14 X########################################################################### X# Written 1998 by J. Schilling X########################################################################### X# X# Dummy Make Rules for local dynamic configuration X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### END-of-star-1.6/RULES/ldummy.cnf echo x - star-1.6/RULES/os-os400.def sed 's/^X//' >star-1.6/RULES/os-os400.def << 'END-of-star-1.6/RULES/os-os400.def' X#ident "@(#)os-os400.def 1.1 18/09/19 " X########################################################################### X# Written 2018 by J. Schilling X########################################################################### X# X# Global os definitions for OS400 X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XMANSTYLE= sysv END-of-star-1.6/RULES/os-os400.def echo x - star-1.6/RULES/rules.top sed 's/^X//' >star-1.6/RULES/rules.top << 'END-of-star-1.6/RULES/rules.top' X#ident "@(#)rules.top 1.24 18/09/25 " X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# Rules that should be included at top of every Makefile X# This is the general purpose C-language version X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X# X# Make sure this becomes the default target X# X########################################################################### Xall: X X########################################################################### X# X# First make sure that all symlinks in $(SRCROOT)/$(RULESDIR)/ are present X# X# $(DUMMY_LNK) is needed to work around a Sun make bug that has been X# fixed with Solaris 11 but that is present for all old Solaris versions. X# X########################################################################### X_DUMMY_LNK= $(SRCROOT)/$(RULESDIR)/ldummy.lnk XDUMMY_LNK= $(_DUMMY_LNK:./%=%) X X$(DUMMY_LNK): X @echo " ==> MAKING SYMLINKS in $(SRCROOT)/$(RULESDIR)/" && \ X cd $(SRCROOT)/$(RULESDIR) && sh ./MKLINKS X @echo " ==> MAKING SYMLINKS in $(SRCROOT)/TEMPLATES/" && \ X cd $(SRCROOT)/TEMPLATES && sh ./MKLINKS X Xinclude $(DUMMY_LNK) X X########################################################################### X# X# SunPro make and gmake both include a COMPILE.c in the built in rules. X# Clear this here, to avoid trouble. We are still able to use COMPILE.c= X# command line macros to overwrite this. X# X########################################################################### XCOMPILE.c= X X########################################################################### X# X# SunPro make and gmake both include a COMPILE.cc in the built in rules. X# Clear this here, to avoid trouble. We are still able to use COMPILE.cc= X# command line macros to overwrite this. X# X########################################################################### XCOMPILE.cc= X X########################################################################### X# X# Various flags may be set in the default rules from various make programs X# Clear this here, to avoid trouble. We are still able to use make command X# line macros to overwrite this. X# X########################################################################### XARFLAGS= XASFLAGS= XCFLAGS= XCPPFLAGS= XLDFLAGS= XLFLAGS= XYFLAGS= X X########################################################################### X# X# Include global language independent macros X# X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules1.top X X########################################################################### X# X# Workaround for GNU make design bug (include does not trigger rule evaluation) X# A correctly working "make" did create the symlinks already while X# including "ldummy.lnk" above. X# X########################################################################### X$(SRCROOT)/$(RULESDIR)/$(XARCH).rul: $(SRCROOT)/$(RULESDIR)/ldummy.lnk X X########################################################################### X# X# Include platform dependent macros for C-language here. X# X# If a project needs other languages too, additional rules may be defined. X# These additional rules should be placed in a file that uses a hierarchy X# similar to rules.top and mey be called e.g. yacc.top. X# X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/$(XARCH).rul X X########################################################################### X# X# Include global autofonfiguration rules X# X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.cnf END-of-star-1.6/RULES/rules.top echo x - star-1.6/RULES/os-amigaos.id sed 's/^X//' >star-1.6/RULES/os-amigaos.id << 'END-of-star-1.6/RULES/os-amigaos.id' X#ident "@(#)os-amigaos.id 1.2 06/05/14 " X########################################################################### X# Written 2001 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for AmigaOS X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= amigaos X-O_ARCH= -$(O_ARCH) END-of-star-1.6/RULES/os-amigaos.id echo x - star-1.6/RULES/i386-unixware-gcc.rul sed 's/^X//' >star-1.6/RULES/i386-unixware-gcc.rul << 'END-of-star-1.6/RULES/i386-unixware-gcc.rul' X#ident "@(#)i386-unixware-gcc.rul 1.7 18/04/11 " X########################################################################### X# Written 1999-2018 by J. Schilling/Santa Cruz Operation X########################################################################### X# X# Platform dependent MACROS for SCO UnixWare 2.x / 7.x using gcc X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-gcc.rul X XOSDEFS += -DUNIXWARE -DSVR4 X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_SOCKET= -lsocket -lnsl -ldl XLIB_MATH= -lm XLIB_KVM= X XLDOPTS= $(LIBS_PATH) $(LDPATH) XLDOPTDYN= -dy -G $(TARGET) X XLORDER= echo XTSORT= cat END-of-star-1.6/RULES/i386-unixware-gcc.rul echo x - star-1.6/RULES/os-gnu-kfreebsd.def sed 's/^X//' >star-1.6/RULES/os-gnu-kfreebsd.def << 'END-of-star-1.6/RULES/os-gnu-kfreebsd.def' X#ident "@(#)os-gnu-kfreebsd.def 1.1 12/08/14 " X########################################################################### X# Written 1997 by J. Schilling X########################################################################### X# X# Global os definitions for Debian with FreeBSD kernel X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XMANSTYLE= bsd END-of-star-1.6/RULES/os-gnu-kfreebsd.def echo x - star-1.6/RULES/i486-cygwin32_nt-cc.rul sed 's/^X//' >star-1.6/RULES/i486-cygwin32_nt-cc.rul << 'END-of-star-1.6/RULES/i486-cygwin32_nt-cc.rul' X#ident "@(#)i486-cygwin32_nt-cc.rul 1.12 17/07/06 " X########################################################################### X# Written 1998 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for CYGWIN32_NT X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-$(C_ARCH:cc%=gcc%).rul X XOSDEFS += -mwin32 X XKDEFINES= X#COPTDYN= -fpic XCOPTDYN= X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .dll X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%) XLDOPTS= $(LIBS_PATH) $(LDPATH) X#LDOPTDYN= -shared -Wl,-soname,$(TARGET) X#LNDYNLIB= @$(RM) $(RM_FORCE) $(PTARGET_BASE).so; $(SYMLINK) $(TARGET) $(PTARGET_BASE).so XLNDYNLIB= X XLORDER= echo XTSORT= cat END-of-star-1.6/RULES/i486-cygwin32_nt-cc.rul echo x - star-1.6/RULES/i486-cygwin32_nt-gcc.rul sed 's/^X//' >star-1.6/RULES/i486-cygwin32_nt-gcc.rul << 'END-of-star-1.6/RULES/i486-cygwin32_nt-gcc.rul' X#ident "@(#)i486-cygwin32_nt-gcc.rul 1.12 17/07/06 " X########################################################################### X# Written 1998 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for CYGWIN32_NT X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-$(C_ARCH).rul X XOSDEFS += -mwin32 X XKDEFINES= X#COPTDYN= -fpic XCOPTDYN= X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .dll X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%) XLDOPTS= $(LIBS_PATH) $(LDPATH) X#LDOPTDYN= -shared -Wl,-soname,$(TARGET) X#LNDYNLIB= @$(RM) $(RM_FORCE) $(PTARGET_BASE).so; $(SYMLINK) $(TARGET) $(PTARGET_BASE).so XLNDYNLIB= X XLORDER= echo XTSORT= cat END-of-star-1.6/RULES/i486-cygwin32_nt-gcc.rul echo x - star-1.6/RULES/os-gnu-kfreebsd.id sed 's/^X//' >star-1.6/RULES/os-gnu-kfreebsd.id << 'END-of-star-1.6/RULES/os-gnu-kfreebsd.id' X#ident "@(#)os-gnu-kfreebsd.id 1.1 12/08/14 " X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for Debian with FreeBSD kernel X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= gnu-kfreebsd X-O_ARCH= -$(O_ARCH) END-of-star-1.6/RULES/os-gnu-kfreebsd.id echo x - star-1.6/RULES/i586-pyro-cc.rul sed 's/^X//' >star-1.6/RULES/i586-pyro-cc.rul << 'END-of-star-1.6/RULES/i586-pyro-cc.rul' X#ident "@(#)i586-pyro-cc.rul 1.2 18/04/11 " X########################################################################### X# Written 1996-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for Pyro X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-gcc.rul X XOSDEFS += X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%) X# X# Uncomment the next line in case you are on an old Linker version that X# does not support the -R linker flag. X# X#LDOPTS= $(LIBS_PATH) $(LDPATH) X XLORDER= echo XTSORT= cat X X# X# The current developement system has these files in /boot/NIX/coreutils/bin X# XLN= /boot/NIX/coreutils/bin/ln XSYMLINK= /boot/NIX/coreutils/bin/ln -s XRM= /boot/NIX/coreutils/bin/rm XMV= /boot/NIX/coreutils/bin/mv END-of-star-1.6/RULES/i586-pyro-cc.rul echo x - star-1.6/RULES/i586-pyro-gcc.rul sed 's/^X//' >star-1.6/RULES/i586-pyro-gcc.rul << 'END-of-star-1.6/RULES/i586-pyro-gcc.rul' X#ident "@(#)i586-pyro-gcc.rul 1.2 18/04/11 " X########################################################################### X# Written 1996-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for Pyro X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-gcc.rul X XOSDEFS += X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%) X# X# Uncomment the next line in case you are on an old Linker version that X# does not support the -R linker flag. X# X#LDOPTS= $(LIBS_PATH) $(LDPATH) X XLORDER= echo XTSORT= cat X X# X# The current developement system has these files in /boot/NIX/coreutils/bin X# XLN= /boot/NIX/coreutils/bin/ln XSYMLINK= /boot/NIX/coreutils/bin/ln -s XRM= /boot/NIX/coreutils/bin/rm XMV= /boot/NIX/coreutils/bin/mv END-of-star-1.6/RULES/i586-pyro-gcc.rul echo x - star-1.6/RULES/cc-clang.rul sed 's/^X//' >star-1.6/RULES/cc-clang.rul << 'END-of-star-1.6/RULES/cc-clang.rul' X#ident "@(#)cc-clang.rul 1.5 18/08/16 " X########################################################################### X# Written 1996-2018 by J. Schilling X########################################################################### X# X# Platform independent MACROS for Clang X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X XCLANG_OPT= XCLANG_OPT32= -m32 XCLANG_OPT64= -m64 XCLANG_OPTXX= $(CLANG_OPT$(C_ARCH:clang%=%)) X XCPP_FLAGS= -DSCHILY_BUILD $(CPPOPTS) $(CPPOPTX) $(OSINCDIRS:%=-I%) $(OSDEFS) $(OSDEFSX) XC_FLAGS= $(COPTS) $(CWARNOPTS) $(COPTOPT) $(CLANGOPTOPT) $(COPTX) XC++FLAGS= $(C++OPTS) $(C++WARNOPTS) $(C++OPTOPT) $(G++OPTOPT) $(C++OPTX) X XCPPOPTS= -I$(ARCHDIR) -I$(OINCSDIR) $(INCDIRS:%=-I%) $(INCDIRSX:%=-I%) XCOPTS= $(CLANG_OPTXX) X# -Wtraditional now causes more pain than it helps XCWOPTS= -Wall -Wtraditional XCWOPTS= -Wall -Wno-unknown-pragmas \ X -Wshadow -Wmissing-prototypes -Wstrict-prototypes XCOPTOPT= -O XCOPTDYN= -fpic XCOPTGPROF= -pg XC++OPTS= $(CLANG_OPTXX) XC++WOPTS= $(CWOPTS) XC++OPTOPT= $(COPTOPT) XC++OPTDYN= -fpic XC++OPTGPROF= -pg X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR) X XLIB_C= -lc X XLIBS_PATH= -L$(OLIBSDIR) XLIBS_PATH_STATIC= -L$(OLIBSDIR_STATIC) X XLDFLAGS= $(LDOPTS) $(LDOPTX) XLDLIBS= $(LIBS) $(LIBX) X XLDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%) XLDOPTDYN= -shared -Wl,-soname,$(TARGET) XLNDYNLIB= @$(RM) $(RM_FORCE) $(PTARGET_BASE).so; $(SYMLINK) $(TARGET) $(PTARGET_BASE).so X XFLOAT_OPTIONS= X X__CC_COM= $(_UNIQ)$(CC) X___CC_COM= $(__CC_COM:$(_UNIQ)=$(CC_COM_DEF)) XCC_COM= $(___CC_COM:$(_UNIQ)%=%) X X__CC++_COM= $(_UNIQ)$(CCC) X___CC++_COM= $(__CC++_COM:$(_UNIQ)=$(CC++_COM_DEF)) XCC++_COM= $(___CC++_COM:$(_UNIQ)%=%) X XCC_COM_DEF= clang XCC++_COM_DEF= clang++ XCC= $(CC_COM_DEF) XCCC= $(CC++_COM_DEF) X XCCCC= @echo " ==> COMPILING \"$@\""; $(CC_COM) $(CLANG_OPTXX) XCC++ = @echo " ==> COMPILING \"$@\""; $(CC++_COM) $(CLANG_OPTXX) XLDCC= @echo " ==> LINKING \"$@\""; $(CC_COM) $(CLANG_OPTXX) XLDCC++ = @echo " ==> LINKING \"$@\""; $(CC++_COM) $(CLANG_OPTXX) XDYNLD= @echo " ==> LINKING dynamic library \"$@\""; $(CC_COM) $(CLANG_OPTXX) XDYNLDC++ = @echo " ==> LINKING dynamic library \"$@\""; $(CC++_COM) $(CLANG_OPTXX) X XRMDEP= : XMKDEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); $(CC_COM) $(CLANG_OPTXX) -M XMKDEP_OUT= XMKC++DEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); $(CC++_COM) $(CLANG_OPTXX) -M XMKC++DEP_OUT= END-of-star-1.6/RULES/cc-clang.rul echo x - star-1.6/RULES/i386-darwin-clang.rul sed 's/^X//' >star-1.6/RULES/i386-darwin-clang.rul << 'END-of-star-1.6/RULES/i386-darwin-clang.rul' X#ident "@(#)i386-darwin-clang.rul 1.2 14/04/02 " X########################################################################### X# Written 1996-2014 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for Darwin-1.2 ff. (Apple MacOS X) x86 (CLANG) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-$(C_ARCH).rul X XOSDEFS += X XKDEFINES= -DKERNEL -D_KERNEL X XCOPTDYN= -fPIC XC++OPTDYN= -fPIC X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .dylib X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%) XLDFRAMEWORKS= -framework IOKit -framework CoreFoundation XLDOPTS= $(LIBS_PATH) $(LDPATH) $(LDFRAMEWORKS) XLDOPTDYN= -install_name $(INSBASE)/lib/$(TARGET) XLNDYNLIB= @ X XDYNLD= @echo " ==> LINKING dynamic library \"$@\""; libtool -dynamic XDYNLDC++ = @echo " ==> LINKING dynamic library \"$@\""; libtool -dynamic XRANLIB= @echo " ==> RANDOMIZING ARCHIVE \"$@\""; ranlib X X# X# lorder seems not to work on some versions because Apple installed X# a broken /bin/sh that is not POSIX cimpliant an will not X# be able to run the /usr/bin/lorder script. The error messages are: X# type: not found X# type: not found X# lorder: nm: not found X# ... disable it X# XLORDER= echo XTSORT= cat END-of-star-1.6/RULES/i386-darwin-clang.rul echo x - star-1.6/RULES/os-beos.id sed 's/^X//' >star-1.6/RULES/os-beos.id << 'END-of-star-1.6/RULES/os-beos.id' X#ident @(#)os-beos.id 1.2 06/05/14 X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for BeOS X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= beos X-O_ARCH= -$(O_ARCH) END-of-star-1.6/RULES/os-beos.id echo x - star-1.6/RULES/os-cygwin_98-4.10.id sed 's/^X//' >star-1.6/RULES/os-cygwin_98-4.10.id << 'END-of-star-1.6/RULES/os-cygwin_98-4.10.id' X#ident "@(#)os-cygwin_98-4.10.id 1.2 07/05/08 " X########################################################################### X# Written 2006 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for Cygnus GCC for MS Windows 4.10 (WIN-98) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/os-cygwin32_nt.id X XOSDEFS += -D_WIN32_WINDOWS=0x0410 END-of-star-1.6/RULES/os-cygwin_98-4.10.id echo x - star-1.6/RULES/ip22-irix-cc.rul sed 's/^X//' >star-1.6/RULES/ip22-irix-cc.rul << 'END-of-star-1.6/RULES/ip22-irix-cc.rul' X#ident "@(#)ip22-irix-cc.rul 1.10 14/04/01 " X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for Silicon Graphics IRIX X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-$(C_ARCH:cc%=sgi%).rul X XOSDEFS += -D__SVR4 -DSVR4 $(LARGEFILE_OPT) X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X XARFLAGS= crs X# X# lorder seems not to work on some machines, disable it X# XLORDER= echo XTSORT= cat END-of-star-1.6/RULES/ip22-irix-cc.rul echo x - star-1.6/RULES/ip22-irix-gcc.rul sed 's/^X//' >star-1.6/RULES/ip22-irix-gcc.rul << 'END-of-star-1.6/RULES/ip22-irix-gcc.rul' X#ident "@(#)ip22-irix-gcc.rul 1.13 15/11/30 " X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for Silicon Graphics IRIX X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-$(C_ARCH).rul XGCC_OPT64= -mabi=64 X XOSDEFS += -D__SVR4 -DSVR4 X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%) XLDOPTS= $(LIBS_PATH) $(LDPATH) XLDOPTDYN= XLNDYNLIB= @ X XFLOAT_OPTIONS= X XARFLAGS= crs X# X# lorder seems not to work on some machines, disable it X# XLORDER= echo XTSORT= cat END-of-star-1.6/RULES/ip22-irix-gcc.rul echo x - star-1.6/RULES/m68k-amigaos-gcc.rul sed 's/^X//' >star-1.6/RULES/m68k-amigaos-gcc.rul << 'END-of-star-1.6/RULES/m68k-amigaos-gcc.rul' X#ident "@(#)m68k-amigaos-gcc.rul 1.8 18/04/11 " X########################################################################### X# Written 1997,2001-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for AmigaOS GCC systems X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-gcc.rul X XOSDEFS += X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%) XLDOPTS= $(LIBS_PATH) $(LDPATH) X XRANLIB= @echo " ==> RANDOMIZING ARCHIVE \"$@\""; ranlib XLORDER= echo XTSORT= cat END-of-star-1.6/RULES/m68k-amigaos-gcc.rul echo x - star-1.6/RULES/sun4-sunos5-gcc.rul sed 's/^X//' >star-1.6/RULES/sun4-sunos5-gcc.rul << 'END-of-star-1.6/RULES/sun4-sunos5-gcc.rul' X#ident "@(#)sun4-sunos5-gcc.rul 1.15 14/04/01 " X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for SunOS 5.x on sparc X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-$(C_ARCH).rul X XOSDEFS += -D__SVR4 -DSVR4 X XKDEFINES= -DKERNEL -D_KERNEL X X XLIB_SOCKET= -lsocket -lnsl -ldl XLIB_MATH= -lm XLIB_KVM= -lkvm -lelf XLIB_VOLMGT= -lvolmgt X X# X# Solaris comes with a linker that supports mapfiles X# XMAPVERS= $(_MAPVERS) # This enables to use mapfiles X X# X# We should use -Wl,-ztext here, but gcc does not create fully compliant X# object files. X# XLDOPTDYN= -dy -G -h $(TARGET) $(PMAPVERS:%=-Wl,-M%) -ldl X XARFLAGS= crs END-of-star-1.6/RULES/sun4-sunos5-gcc.rul echo x - star-1.6/RULES/i386-freebsd-clang.rul sed 's/^X//' >star-1.6/RULES/i386-freebsd-clang.rul << 'END-of-star-1.6/RULES/i386-freebsd-clang.rul' X#ident "@(#)i386-freebsd-clang.rul 1.2 18/04/11 " X########################################################################### X# Written 1997-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for FreeBSD using Clang X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-$(C_ARCH).rul X XOSDEFS += X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X XLDOPTS= $(LIBS_PATH) $(LDPATH) X XRANLIB= @echo " ==> RANDOMIZING ARCHIVE \"$@\""; ranlib END-of-star-1.6/RULES/i386-freebsd-clang.rul echo x - star-1.6/RULES/i386-freebsd-cc.rul sed 's/^X//' >star-1.6/RULES/i386-freebsd-cc.rul << 'END-of-star-1.6/RULES/i386-freebsd-cc.rul' X#ident "@(#)i386-freebsd-cc.rul 1.9 18/04/11 " X########################################################################### X# Written 1997-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for FreeBSD X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-gcc.rul X XOSDEFS += X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X XLDOPTS= $(LIBS_PATH) $(LDPATH) X XRANLIB= @echo " ==> RANDOMIZING ARCHIVE \"$@\""; ranlib END-of-star-1.6/RULES/i386-freebsd-cc.rul echo x - star-1.6/RULES/os-bsd-os.def sed 's/^X//' >star-1.6/RULES/os-bsd-os.def << 'END-of-star-1.6/RULES/os-bsd-os.def' X#ident "@(#)os-bsd-os.def 1.2 06/05/14 " X########################################################################### X# Written 1998 by J. Schilling X########################################################################### X# X# Global os definitions for BSD/OS X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XMANSTYLE= bsd END-of-star-1.6/RULES/os-bsd-os.def echo x - star-1.6/RULES/os-bsd-os.id sed 's/^X//' >star-1.6/RULES/os-bsd-os.id << 'END-of-star-1.6/RULES/os-bsd-os.id' X#ident "@(#)os-bsd-os.id 1.3 06/05/14 " X########################################################################### X# Written 1998 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for BSD/OS X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X_O_ARCH= $(OSREL:3.%=bsd-os3) XO_ARCH= $(_O_ARCH:4.%=bsd-os) X-O_ARCH= -$(O_ARCH) END-of-star-1.6/RULES/os-bsd-os.id echo x - star-1.6/RULES/os-bsd-os3.def sed 's/^X//' >star-1.6/RULES/os-bsd-os3.def << 'END-of-star-1.6/RULES/os-bsd-os3.def' X#ident "@(#)os-bsd-os3.def 1.2 06/05/14 " X########################################################################### X# Written 1998 by J. Schilling X########################################################################### X# X# Global os definitions for BSD/OS X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XMANSTYLE= bsd END-of-star-1.6/RULES/os-bsd-os3.def echo x - star-1.6/RULES/os-cygwin32_nt.def sed 's/^X//' >star-1.6/RULES/os-cygwin32_nt.def << 'END-of-star-1.6/RULES/os-cygwin32_nt.def' X#ident "@(#)os-cygwin32_nt.def 1.2 06/05/14 " X########################################################################### X# Written 1997 by J. Schilling X########################################################################### X# X# Global os definitions for CYGWIN32_NT X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XMANSTYLE= bsd X END-of-star-1.6/RULES/os-cygwin32_nt.def echo x - star-1.6/RULES/os-cygwin32_nt.id sed 's/^X//' >star-1.6/RULES/os-cygwin32_nt.id << 'END-of-star-1.6/RULES/os-cygwin32_nt.id' X#ident "@(#)os-cygwin32_nt.id 1.5 07/05/29 " X########################################################################### X# Written 1997 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for Cygnus GCC for MS Windows NT X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= cygwin32_nt X-O_ARCH= -$(O_ARCH) X XWINNTDEFS += -D_WIN32_WINNT=0x0400 END-of-star-1.6/RULES/os-cygwin32_nt.id echo x - star-1.6/RULES/os-cygwin_95-4.0.id sed 's/^X//' >star-1.6/RULES/os-cygwin_95-4.0.id << 'END-of-star-1.6/RULES/os-cygwin_95-4.0.id' X#ident "@(#)os-cygwin_95-4.0.id 1.2 07/05/08 " X########################################################################### X# Written 2006 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for Cygnus GCC for MS Windows 4.0 (WIN-95) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/os-cygwin32_nt.id X XOSDEFS += -D_WIN32_WINDOWS=0x0400 END-of-star-1.6/RULES/os-cygwin_95-4.0.id echo x - star-1.6/RULES/cc-apollo.rul sed 's/^X//' >star-1.6/RULES/cc-apollo.rul << 'END-of-star-1.6/RULES/cc-apollo.rul' X#ident "@(#)cc-apollo.rul 1.21 18/08/16 " X########################################################################### X# Written 2001-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for DomainOS (sys5.3, 10.4.1) cc X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X XCPP_FLAGS= -DSCHILY_BUILD $(CPPOPTS) $(CPPOPTX) $(OSINCDIRS:%=-I%) $(OSDEFS) $(OSDEFSX) XC_FLAGS= $(COPTS) $(CWARNOPTS) $(COPTOPT) $(APOLLOCOPTOPT) $(COPTX) XC++FLAGS= $(C++OPTS) $(C++WARNOPTS) $(C++OPTOPT) $(APOLLOC++OPTOPT) $(C++OPTX) X XCPPOPTS= -I$(ARCHDIR) -I$(OINCSDIR) $(INCDIRS:%=-I%) $(INCDIRSX:%=-I%) XCOPTS= XCWOPTS= -W0,-info,4 XCOPTOPT= -O XCOPTDYN= -fpic XCOPTGPROF= -pg XC++OPTS= XC++WOPTS= X#C++OPTOPT= -O X#C++OPTDYN= -Kpic X#C++OPTGPROF= -xpg X X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_C= -lc X XLIBS_PATH= -L$(OLIBSDIR) XLIBS_PATH_STATIC= -L$(OLIBSDIR_STATIC) X XLDFLAGS= $(LDOPTS) $(LDOPTX) XLDLIBS= $(LIBS) $(LIBX) X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH) XLDOPTS= $(LIBS_PATH) $(LDPATH) XLDOPTDYN= -shared -Wl,-soname,$(TARGET) XLNDYNLIB= @$(RM) $(RM_FORCE) $(PTARGET_BASE).so; $(SYMLINK) $(TARGET) $(PTARGET_BASE).so X XFLOAT_OPTIONS= X X__CC_COM= $(_UNIQ)$(CC) X___CC_COM= $(__CC_COM:$(_UNIQ)=$(CC_COM_DEF)) XCC_COM= $(___CC_COM:$(_UNIQ)%=%) X X__CC++_COM= $(_UNIQ)$(CCC) X___CC++_COM= $(__CC++_COM:$(_UNIQ)=$(CC++_COM_DEF)) XCC++_COM= $(___CC++_COM:$(_UNIQ)%=%) X X#CC_COM= cc -A systype,bsd4.3 XCC_COM_DEF= /bsd4.3/bin/cc XCC++_COM_DEF= echo "C++ not yet supported"; exit -1; : X# X# Use to comment out C++ projects X# XC++BUILD= $(NUMBER_SIGN) X XCC= $(CC_COM_DEF) XCCC= $(CC++_COM_DEF) X XCCCC= @echo " ==> COMPILING \"$@\""; $(CC_COM) XLDCC= @echo " ==> LINKING \"$@\""; $(CC_COM) XDYNLD= @echo " ==> LINKING dynamic library \"$@\""; $(CC_COM) XRANLIB= @echo " ==> RANDOMIZING ARCHIVE \"$@\""; true X XRMDEP= : X#MKDEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); cc -M XMKDEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); /user/local/com/makedepend XMKDEP_OUT= X_MKDIR= $(_MKDIR_SH) XMKDIR= $(MKDIR_SH) XINSMKDIR= $(INSMKDIR_SH) X XCC++ = @echo " ==> COMPILING \"$@\""; $(CC++_COM) XLDCC++ = @echo " ==> LINKING \"$@\""; $(CC++_COM) XDYNLDC++ = @echo " ==> LINKING dynamic library \"$@\""; $(CC++_COM) XMKC++DEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); $(CC++_COM) # makedepend? XMKC++DEP_OUT= END-of-star-1.6/RULES/cc-apollo.rul echo x - star-1.6/RULES/os-freebsd.def sed 's/^X//' >star-1.6/RULES/os-freebsd.def << 'END-of-star-1.6/RULES/os-freebsd.def' X#ident "@(#)os-freebsd.def 1.2 06/05/14 " X########################################################################### X# Written 1997 by J. Schilling X########################################################################### X# X# Global os definitions for FreeBSD X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XMANSTYLE= bsd END-of-star-1.6/RULES/os-freebsd.def echo x - star-1.6/RULES/os-freebsd.id sed 's/^X//' >star-1.6/RULES/os-freebsd.id << 'END-of-star-1.6/RULES/os-freebsd.id' X#ident "@(#)os-freebsd.id 1.2 06/05/14 " X########################################################################### X# Written 1997 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for FreeBSD X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= freebsd X-O_ARCH= -$(O_ARCH) END-of-star-1.6/RULES/os-freebsd.id echo x - star-1.6/RULES/os-gnu.id sed 's/^X//' >star-1.6/RULES/os-gnu.id << 'END-of-star-1.6/RULES/os-gnu.id' X#ident "@(#)os-gnu.id 1.2 06/05/14 " X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for GNU (hurd) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= gnu X-O_ARCH= -$(O_ARCH) END-of-star-1.6/RULES/os-gnu.id echo x - star-1.6/RULES/os-haiku.id sed 's/^X//' >star-1.6/RULES/os-haiku.id << 'END-of-star-1.6/RULES/os-haiku.id' X#ident "@(#)os-haiku.id 1.1 09/02/03 " X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for Haiku, a BeOS like OS X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= haiku X-O_ARCH= -$(O_ARCH) END-of-star-1.6/RULES/os-haiku.id echo x - star-1.6/RULES/os-hp-ux.def sed 's/^X//' >star-1.6/RULES/os-hp-ux.def << 'END-of-star-1.6/RULES/os-hp-ux.def' X#ident "@(#)os-hp-ux.def 1.3 06/05/14 " X########################################################################### X# Written 1997 by J. Schilling X########################################################################### X# X# Global os definitions for HP-UX X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XMANSTYLE= sysv END-of-star-1.6/RULES/os-hp-ux.def echo x - star-1.6/RULES/os-hp-ux.id sed 's/^X//' >star-1.6/RULES/os-hp-ux.id << 'END-of-star-1.6/RULES/os-hp-ux.id' X#ident "@(#)os-hp-ux.id 1.2 06/05/14 " X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for HP/UX X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= hp-ux X-O_ARCH= -$(O_ARCH) END-of-star-1.6/RULES/os-hp-ux.id echo x - star-1.6/RULES/os-irix.def sed 's/^X//' >star-1.6/RULES/os-irix.def << 'END-of-star-1.6/RULES/os-irix.def' X#ident "@(#)os-irix.def 1.3 06/05/14 " X########################################################################### X# Written 1997 by J. Schilling X########################################################################### X# X# Global os definitions for IRIX X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XMANSTYLE= bsd END-of-star-1.6/RULES/os-irix.def echo x - star-1.6/RULES/os-irix.id sed 's/^X//' >star-1.6/RULES/os-irix.id << 'END-of-star-1.6/RULES/os-irix.id' X#ident "@(#)os-irix.id 1.2 06/05/14 " X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for Silicon Graphics IRIX X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= irix X-O_ARCH= -$(O_ARCH) END-of-star-1.6/RULES/os-irix.id echo x - star-1.6/RULES/os-linux.def sed 's/^X//' >star-1.6/RULES/os-linux.def << 'END-of-star-1.6/RULES/os-linux.def' X#ident "@(#)os-linux.def 1.3 06/05/14 " X########################################################################### X# Written 1997 by J. Schilling X########################################################################### X# X# Global os definitions for Linux X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XMANSTYLE= bsd END-of-star-1.6/RULES/os-linux.def echo x - star-1.6/RULES/os-mingw32_nt-5.2.id sed 's/^X//' >star-1.6/RULES/os-mingw32_nt-5.2.id << 'END-of-star-1.6/RULES/os-mingw32_nt-5.2.id' X#ident "@(#)os-mingw32_nt-5.2.id 1.2 06/05/14 " X########################################################################### X# X# OS specific MACRO definitions for Win32/Mingw32 X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= mingw32_nt X-O_ARCH= -$(O_ARCH) END-of-star-1.6/RULES/os-mingw32_nt-5.2.id echo x - star-1.6/RULES/os-mingw32_nt.def sed 's/^X//' >star-1.6/RULES/os-mingw32_nt.def << 'END-of-star-1.6/RULES/os-mingw32_nt.def' X#ident "@(#)os-mingw32_nt.def 1.3 11/08/04 " X########################################################################### X# X# Global os definitions for Win32/Mingw32 X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XMANSTYLE= bsd X X# X# Tell MKLINKS to run "test -h xxzzy.345 || symlink=cp X# XMKLINKS_TEST= test Xexport MKLINKS_TEST END-of-star-1.6/RULES/os-mingw32_nt.def echo x - star-1.6/RULES/os-mingw32_nt.id sed 's/^X//' >star-1.6/RULES/os-mingw32_nt.id << 'END-of-star-1.6/RULES/os-mingw32_nt.id' X#ident "@(#)os-mingw32_nt.id 1.2 06/05/14 " X########################################################################### X# X# OS specific MACRO definitions for Win32/Mingw32 X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= mingw32_nt X-O_ARCH= -$(O_ARCH) END-of-star-1.6/RULES/os-mingw32_nt.id echo x - star-1.6/RULES/os-rhapsody.def sed 's/^X//' >star-1.6/RULES/os-rhapsody.def << 'END-of-star-1.6/RULES/os-rhapsody.def' X#ident "@(#)os-rhapsody.def 1.2 06/05/14 " X########################################################################### X# Written 1997 by J. Schilling X########################################################################### X# X# Global definitions for NeXT Step (Apple Rhapsody) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XMANSTYLE= bsd END-of-star-1.6/RULES/os-rhapsody.def echo x - star-1.6/RULES/os-rhapsody.id sed 's/^X//' >star-1.6/RULES/os-rhapsody.id << 'END-of-star-1.6/RULES/os-rhapsody.id' X#ident "@(#)os-rhapsody.id 1.2 06/05/14 " X########################################################################### X# Written 1997 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for NeXT Step (Apple Rhapsody) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= rhapsody X-O_ARCH= -$(O_ARCH) END-of-star-1.6/RULES/os-rhapsody.id echo x - star-1.6/RULES/os-sco_sv.id sed 's/^X//' >star-1.6/RULES/os-sco_sv.id << 'END-of-star-1.6/RULES/os-sco_sv.id' X#ident "@(#)os-sco_sv.id 1.3 07/05/03 " X########################################################################### X# Written 1999 by J. Schilling/Santa Cruz Operation X########################################################################### X# X# OS specific MACRO definitions for SCO OpenServer 5 Systems X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= openserver X X_O_ARCH= $(OSVERSION:5.%=openserver) XO_ARCH= $(_O_ARCH:6.%=unixware) X-O_ARCH= -$(O_ARCH) END-of-star-1.6/RULES/os-sco_sv.id echo x - star-1.6/RULES/os-sunos.id sed 's/^X//' >star-1.6/RULES/os-sunos.id << 'END-of-star-1.6/RULES/os-sunos.id' X#ident "@(#)os-sunos.id 1.2 06/05/14 " X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for SunOS X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X_O_ARCH= $(OSREL:4.%=sunos4) XO_ARCH= $(_O_ARCH:5.%=sunos5) X-O_ARCH= -$(O_ARCH) END-of-star-1.6/RULES/os-sunos.id echo x - star-1.6/RULES/os-sunos4.def sed 's/^X//' >star-1.6/RULES/os-sunos4.def << 'END-of-star-1.6/RULES/os-sunos4.def' X#ident "@(#)os-sunos4.def 1.3 06/05/14 " X########################################################################### X# Written 1997 by J. Schilling X########################################################################### X# X# Global os definitions for SunOS X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XMANSTYLE= bsd END-of-star-1.6/RULES/os-sunos4.def echo x - star-1.6/RULES/sun4-sunos5-cc.rul sed 's/^X//' >star-1.6/RULES/sun4-sunos5-cc.rul << 'END-of-star-1.6/RULES/sun4-sunos5-cc.rul' X#ident "@(#)sun4-sunos5-cc.rul 1.13 14/04/01 " X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for SunOS 5.x on sparc X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-$(C_ARCH:cc%=sunpro%).rul X XOSDEFS += -D__SVR4 -DSVR4 X XKDEFINES= -DKERNEL -D_KERNEL X X XLIB_SOCKET= -lsocket -lnsl -ldl XLIB_MATH= -lm XLIB_KVM= -lkvm -lelf XLIB_VOLMGT= -lvolmgt X XARFLAGS= crs END-of-star-1.6/RULES/sun4-sunos5-cc.rul echo x - star-1.6/RULES/version sed 's/^X//' >star-1.6/RULES/version << 'END-of-star-1.6/RULES/version' X#ident "@(#)version 1.4 07/11/02 " X########################################################################### X# Written 2005 by J. Schilling X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X XMAKEFILES_VERSION=1.5a05 END-of-star-1.6/RULES/version echo x - star-1.6/RULES/x86-interix-cc.rul sed 's/^X//' >star-1.6/RULES/x86-interix-cc.rul << 'END-of-star-1.6/RULES/x86-interix-cc.rul' X#ident @(#)x86-interix-cc.rul 1.1 07/05/08 X########################################################################### X# Written 2007 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for CYGWIN32_NT using MSVC X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### X_PLATFORM= interix Xinclude $(SRCROOT)/$(RULESDIR)/cc-msposix.rul X X# X# Supress useless cl warnings like: X# warning C4996: 'strerror' wurde als veraltet deklariert X# Consider using strerror_s instead. X# X#OSDEFS += -D_CRT_SECURE_NO_DEPRECATE X XKDEFINES= X X#LIB_SOCKET= Ws2_32.lib XLIB_MATH= XLIB_KVM= X XLORDER= echo XTSORT= cat X XMKDEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); sh $(SRCROOT)/conf/mkdep-msc-interix.sh XMKDEP_OUT= XMKC++DEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); sh $(SRCROOT)/conf/mkdep-msc-interix.sh XMKC++DEP_OUT= X END-of-star-1.6/RULES/x86-interix-cc.rul echo x - star-1.6/RULES/x86-interix-cl.rul sed 's/^X//' >star-1.6/RULES/x86-interix-cl.rul << 'END-of-star-1.6/RULES/x86-interix-cl.rul' X#ident "@(#)x86-interix-cl.rul 1.5 09/05/21 " X########################################################################### X# Written 2006 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for CYGWIN32_NT using MSVC X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### X_PLATFORM= interix Xinclude $(SRCROOT)/$(RULESDIR)/cc-msc.rul X X# X# Supress useless cl warnings like: X# warning C4996: 'strerror' wurde als veraltet deklariert X# Consider using strerror_s instead. X# XOSDEFS += -D_CRT_SECURE_NO_DEPRECATE X X# X# Supress useless cl warnings like: X# warning C4996: 'fdopen' wurde als veraltet deklariert X# The POSIX name for this item is deprecated. Instead, use X# the ISO C++ conformant name: _fdopen. X# XOSDEFS += -D_CRT_NONSTDC_NO_DEPRECATE X XKDEFINES= X XLIB_SOCKET= Ws2_32.lib XLIB_MATH= XLIB_KVM= X XLORDER= echo XTSORT= cat X XMKDEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); sh $(SRCROOT)/conf/mkdep-msc-interix.sh XMKDEP_OUT= XMKC++DEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); sh $(SRCROOT)/conf/mkdep-msc-interix.sh XMKC++DEP_OUT= X END-of-star-1.6/RULES/x86-interix-cl.rul echo x - star-1.6/RULES/rules.env sed 's/^X//' >star-1.6/RULES/rules.env << 'END-of-star-1.6/RULES/rules.env' X#ident "@(#)rules.env 1.2 09/08/15 " X########################################################################### X# Written 2009 by J. Schilling X########################################################################### X# X# Rules for setting the locale environment to the default "C" X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X# X# acgeneral.m4 claims that SCO Unix may have problems with setting LANG=C X# so we are careful not to set LANG unless it was already set by someone else X# X########################################################################### X X_LANG= $(_UNIQ)$(LANG) X__LANG= $(_LANG:$(_UNIQ)=NO_LANG) X___LANG= $(__LANG:$(_UNIQ)%=LANG) X X$(___LANG)=C XLC_ALL=C XLC_COLLATE=C XLC_CTYPE=C XLC_MESSAGES=C XLC_MONETARY=C XLC_NUMERIC=C XLC_TIME=C X Xexport $(___LANG) Xexport LC_ALL Xexport LC_COLLATE Xexport LC_CTYPE Xexport LC_MESSAGES Xexport LC_MONETARY Xexport LC_NUMERIC Xexport LC_TIME END-of-star-1.6/RULES/rules.env echo x - star-1.6/RULES/rules.lnt sed 's/^X//' >star-1.6/RULES/rules.lnt << 'END-of-star-1.6/RULES/rules.lnt' X#ident @(#)rules.lnt 1.4 18/08/16 X########################################################################### X# Written 2001 by J. Schilling X########################################################################### X# X# Rules for lint X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X Xlint: $(CFILES) X lint $(LINTFLAGS) $(CPP_FLAGS) $(CPPFLAGS) $^ X X########################################################################### END-of-star-1.6/RULES/rules.lnt echo x - star-1.6/RULES/rules.nul sed 's/^X//' >star-1.6/RULES/rules.nul << 'END-of-star-1.6/RULES/rules.nul' X#ident "@(#)rules.nul 1.1 09/08/12 " X########################################################################### X# Written 2009 by J. Schilling X########################################################################### X# X# NUL dummy rule X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### END-of-star-1.6/RULES/rules.nul echo x - star-1.6/RULES/power-macintosh-rhapsody-cc.rul sed 's/^X//' >star-1.6/RULES/power-macintosh-rhapsody-cc.rul << 'END-of-star-1.6/RULES/power-macintosh-rhapsody-cc.rul' X#ident "@(#)power-macintosh-rhapsody-cc.rul 1.14 18/04/11 " X########################################################################### X# Written 1996-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for NeXT Step 4.x (Apple Rhapsody) PPC (GCC) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-gcc.rul XCC_COM_DEF= cc X XOSDEFS += X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%) XLDOPTS= $(LIBS_PATH) $(LDPATH) XLDOPTDYN= XLNDYNLIB= @ X XDYNLD= @echo " ==> LINKING dynamic library \"$@\""; ld XRANLIB= @echo " ==> RANDOMIZING ARCHIVE \"$@\""; ranlib X X# X# lorder seems not to work on some versions because Apple installed X# a broken /bin/sh that is not POSIX cimpliant an will not X# be able to run the /usr/bin/lorder script. The error messages are: X# type: not found X# type: not found X# lorder: nm: not found X# ... disable it X# XLORDER= echo XTSORT= cat END-of-star-1.6/RULES/power-macintosh-rhapsody-cc.rul echo x - star-1.6/RULES/r-smake.obj sed 's/^X//' >star-1.6/RULES/r-smake.obj << 'END-of-star-1.6/RULES/r-smake.obj' X#ident @(#)r-smake.obj 2.2 18/08/16 X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# Object building rules for smake X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X# This defines a rule that compiles source files from current directory and X# puts the resultant objects directly into $(ARCHDIR), X# to allow concurrent compilation on different platforms. X# Object file names are constructed from $(CFILES) and $(C++FILES). X########################################################################### XARCHDIRX= $(ARCHDIR)/ X___C++OFILES= $(C++FILES:%.C=$(ARCHDIR)/%.$o) X__C++OFILES= $(___C++OFILES:%.cc=$(ARCHDIR)/%.$o) X_C++OFILES= $(__C++OFILES:%.cpp=$(ARCHDIR)/%.$o) XC++OFILES= $(_C++OFILES:%.cxx=$(ARCHDIR)/%.$o) XC++POFILES= $(C++OFILES) XOFILES= $(CFILES:%.c=$(ARCHDIR)/%.$o) $(C++OFILES) XPOFILES= $(CFILES:%.c=$(ARCHDIR)/%.$o) $(C++POFILES) X X.OBJDIR: $(ARCHDIR) X########################################################################### X__COMPILE.c= $(_UNIQ)$(COMPILE.c) X___COMPILE.c= $(__COMPILE.c:$(_UNIQ)=$(CCCC) $(C_FLAGS) $(CFLAGS) $(CPP_FLAGS) $(CPPFLAGS) -c) X_COMPILE.c= $(___COMPILE.c:$(_UNIQ)%=%) X X__COMPILE.cc= $(_UNIQ)$(COMPILE.cc) X___COMPILE.cc= $(__COMPILE.cc:$(_UNIQ)=$(CC++) $(C++FLAGS) $(CCFLAGS) $(CPP_FLAGS) $(CPPFLAGS) -c) X_COMPILE.cc= $(___COMPILE.cc:$(_UNIQ)%=%) X X__OUTPUT_OPTION= $(_UNIQ)$(OUTPUT_OPTION) X___OUTPUT_OPTION= $(__OUTPUT_OPTION:$(_UNIQ)=-o $@) X_OUTPUT_OPTION= $(___OUTPUT_OPTION:$(_UNIQ)%=%) X########################################################################### X X$(ARCHDIR)/%.$o: %.c X $(_COMPILE.c) $(_OUTPUT_OPTION) $< $(CC_OUTPUT_FILTER) X$(ARCHDIR)/%.$o: %.C X $(_COMPILE.cc) $(_OUTPUT_OPTION) $< $(CC_OUTPUT_FILTER) X$(ARCHDIR)/%.$o: %.cc X $(_COMPILE.cc) $(_OUTPUT_OPTION) $< $(CC_OUTPUT_FILTER) X$(ARCHDIR)/%.$o: %.cpp X $(_COMPILE.cc) $(_OUTPUT_OPTION) $< $(CC_OUTPUT_FILTER) X$(ARCHDIR)/%.$o: %.cxx X $(_COMPILE.cc) $(_OUTPUT_OPTION) $< $(CC_OUTPUT_FILTER) X X#$(ARCHDIR)/%.$o: %.c X# $(CCCC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $(*F).c X X########################################################################### END-of-star-1.6/RULES/r-smake.obj echo x - star-1.6/RULES/power-macintosh-rhapsody-gcc.rul sed 's/^X//' >star-1.6/RULES/power-macintosh-rhapsody-gcc.rul << 'END-of-star-1.6/RULES/power-macintosh-rhapsody-gcc.rul' X#ident "@(#)power-macintosh-rhapsody-gcc.rul 1.12 18/04/11 " X########################################################################### X# Written 1996-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for NeXT Step 4.x (Apple Rhapsody) PPC (GCC) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-gcc.rul X XOSDEFS += X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%) XLDOPTS= $(LIBS_PATH) $(LDPATH) XLDOPTDYN= XLNDYNLIB= @ X XDYNLD= @echo " ==> LINKING dynamic library \"$@\""; ld XRANLIB= @echo " ==> RANDOMIZING ARCHIVE \"$@\""; ranlib X X# X# lorder seems not to work on some versions because Apple installed X# a broken /bin/sh that is not POSIX cimpliant an will not X# be able to run the /usr/bin/lorder script. The error messages are: X# type: not found X# type: not found X# lorder: nm: not found X# ... disable it X# XLORDER= echo XTSORT= cat END-of-star-1.6/RULES/power-macintosh-rhapsody-gcc.rul echo x - star-1.6/RULES/man-bsd.def sed 's/^X//' >star-1.6/RULES/man-bsd.def << 'END-of-star-1.6/RULES/man-bsd.def' X#ident @(#)man-bsd.def 1.2 06/05/14 X########################################################################### X# Written 1997 by J. Schilling X########################################################################### X# X# Definition for manual sections on BSD based systems X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X XMANSECT_CMD= man1 XMANSECT_SYSCALL= man2 XMANSECT_LIB= man3 XMANSECT_FILEFORM= man5 XMANSECT_HDR= man7 XMANSECT_TABLES= man7 XMANSECT_MACROS= man7 XMANSECT_GAMES= man6 XMANSECT_DEMOS= man6 XMANSECT_DEVICE= man4 XMANSECT_NETWORK= man4 XMANSECT_ADMIN= man8 XMANSECT_DRIVER= man4 X XMANSUFF_CMD= 1 XMANSUFF_SYSCALL= 2 XMANSUFF_LIB= 3 XMANSUFF_FILEFORM= 5 XMANSUFF_HDR= 7 XMANSUFF_TABLES= 7 XMANSUFF_MACROS= 7 XMANSUFF_GAMES= 6 XMANSUFF_DEMOS= 6 XMANSUFF_DEVICE= 4 XMANSUFF_NETWORK= 4 XMANSUFF_ADMIN= 8 XMANSUFF_DRIVER= 4 END-of-star-1.6/RULES/man-bsd.def echo x - star-1.6/RULES/r-make.obj sed 's/^X//' >star-1.6/RULES/r-make.obj << 'END-of-star-1.6/RULES/r-make.obj' X#ident @(#)r-make.obj 1.10 18/08/16 X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# Object building rules for gmake X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X# This defines a rule that compiles source files from current directory and X# puts the resultant objects directly into $(ARCHDIR), X# to allow concurrent compilation on different platforms. X# Object file names are constructed from $(CFILES) and $(C++FILES). X########################################################################### XARCHDIRX= $(ARCHDIR)/ X___C++OFILES= $(C++FILES:%.C=$(ARCHDIR)/%.$o) X__C++OFILES= $(___C++OFILES:%.cc=$(ARCHDIR)/%.$o) X_C++OFILES= $(__C++OFILES:%.cpp=$(ARCHDIR)/%.$o) XC++OFILES= $(_C++OFILES:%.cxx=$(ARCHDIR)/%.$o) XC++POFILES= $(C++OFILES) XOFILES= $(CFILES:%.c=$(ARCHDIR)/%.$o) $(C++OFILES) XPOFILES= $(CFILES:%.c=$(ARCHDIR)/%.$o) $(C++POFILES) X########################################################################### X__COMPILE.c= $(_UNIQ)$(COMPILE.c) X___COMPILE.c= $(__COMPILE.c:$(_UNIQ)=$(CCCC) $(C_FLAGS) $(CFLAGS) $(CPP_FLAGS) $(CPPFLAGS) -c) X_COMPILE.c= $(___COMPILE.c:$(_UNIQ)%=%) X X__COMPILE.cc= $(_UNIQ)$(COMPILE.cc) X___COMPILE.cc= $(__COMPILE.cc:$(_UNIQ)=$(CC++) $(C++FLAGS) $(CCFLAGS) $(CPP_FLAGS) $(CPPFLAGS) -c) X_COMPILE.cc= $(___COMPILE.cc:$(_UNIQ)%=%) X X__OUTPUT_OPTION= $(_UNIQ)$(OUTPUT_OPTION) X___OUTPUT_OPTION= $(__OUTPUT_OPTION:$(_UNIQ)=-o $@) X_OUTPUT_OPTION= $(___OUTPUT_OPTION:$(_UNIQ)%=%) X########################################################################### X X$(ARCHDIR)/%.$o: %.c X $(_COMPILE.c) $(_OUTPUT_OPTION) $< $(CC_OUTPUT_FILTER) X$(ARCHDIR)/%.$o: %.C X $(_COMPILE.cc) $(_OUTPUT_OPTION) $< $(CC_OUTPUT_FILTER) X$(ARCHDIR)/%.$o: %.cc X $(_COMPILE.cc) $(_OUTPUT_OPTION) $< $(CC_OUTPUT_FILTER) X$(ARCHDIR)/%.$o: %.cpp X $(_COMPILE.cc) $(_OUTPUT_OPTION) $< $(CC_OUTPUT_FILTER) X$(ARCHDIR)/%.$o: %.cxx X $(_COMPILE.cc) $(_OUTPUT_OPTION) $< $(CC_OUTPUT_FILTER) X########################################################################### END-of-star-1.6/RULES/r-make.obj echo x - star-1.6/RULES/r-make.tag sed 's/^X//' >star-1.6/RULES/r-make.tag << 'END-of-star-1.6/RULES/r-make.tag' X#ident "@(#)r-make.tag 1.3 07/12/01 " X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# Tag building rules for make X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XTAGS: $(CFILES) $(CFILES_TAG) $(HFILES) $(HFILES_TAG) X $(ETAGS) $(CFILES) $(CFILES_TAG) $(HFILES) $(HFILES_TAG) X Xtags: $(CFILES) $(CFILES_TAG) $(HFILES) $(HFILES_TAG) X $(CTAGS) -t $(CFILES) $(CFILES_TAG) $(HFILES) $(HFILES_TAG) END-of-star-1.6/RULES/r-make.tag echo x - star-1.6/RULES/rules.clr sed 's/^X//' >star-1.6/RULES/rules.clr << 'END-of-star-1.6/RULES/rules.clr' X#ident @(#)rules.clr 1.7 10/10/02 X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# Rules to make source tree clean X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X# Do not remove target if it is in the current directory X########################################################################### XRMTARGET= $(PTARGET:$(TARGET)%=%) X########################################################################### Xclean: X $(RM) $(RM_FORCE) $(CLEAN_FILES) $(POFILES) \ X $(PTARGETC) \ X $(PMAPVERS) \ X $(CLEAN_FILEX) \ X $(PYOFILES) $(PLOFILES) X Xclobber: clean X $(RM) $(RM_FORCE) $(RMTARGET) $(PALLDEP_FILE) \ X $(PTARGETC) \ X $(CLOBBER_FILEX) X $(RM) $(RM_FORCE) $(ARCHDIR)/Dnull X Xdistclean: X $(RM) $(RM_RF) $(CLEAN_FILES) \ X .EDTMP *.bak OBJ/* \ X $(SRCROOT)/libs/* $(SRCROOT)/incs/* X Xrmtarget: X $(RM) $(RM_FORCE) $(RMTARGET) X Xrelink: rmtarget all END-of-star-1.6/RULES/rules.clr echo x - star-1.6/RULES/r-smake.tag sed 's/^X//' >star-1.6/RULES/r-smake.tag << 'END-of-star-1.6/RULES/r-smake.tag' X#ident "@(#)r-smake.tag 1.4 07/12/01 " X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# Tag building rules for smake X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XTAGS: $(CFILES) $(CFILES_TAG) $(HFILES) $(HFILES_TAG) X $(ETAGS) $r1 X Xtags: $(CFILES) $(CFILES_TAG) $(HFILES) $(HFILES_TAG) X $(CTAGS) -t $r1 END-of-star-1.6/RULES/r-smake.tag echo x - star-1.6/RULES/rs6000-aix-cc.rul sed 's/^X//' >star-1.6/RULES/rs6000-aix-cc.rul << 'END-of-star-1.6/RULES/rs6000-aix-cc.rul' X#ident "@(#)rs6000-aix-cc.rul 1.11 15/12/01 " X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for AIX on RS6000 X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-$(C_ARCH:cc%=ibm%).rul X XAIX_ARCH= $(IBMCC_OPTXX:-q%=-X%) X XOSDEFS += -DPROTOTYTPES X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_SOCKET= XLIB_MATH= -lm X#LIB_KVM= -lkvm X XRANLIB= @echo " ==> RANDOMIZING ARCHIVE \"$@\""; ranlib X XLORDER= lorder $(AIX_ARCH) XAR= @echo " ==> ARCHIVING \"$@\""; ar $(AIX_ARCH) END-of-star-1.6/RULES/rs6000-aix-cc.rul echo x - star-1.6/RULES/rs6000-aix-gcc.rul sed 's/^X//' >star-1.6/RULES/rs6000-aix-gcc.rul << 'END-of-star-1.6/RULES/rs6000-aix-gcc.rul' X#ident "@(#)rs6000-aix-gcc.rul 1.12 18/04/11 " X########################################################################### X# Written 1997-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for AIX on RS6000 X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-$(C_ARCH).rul XGCC_OPT32= -maix32 XGCC_OPT64= -maix64 XAIX_ARCH= $(GCC_OPTXX:-maix%=-X%) X XOSDEFS += -DPROTOTYTPES X XKDEFINES= -DKERNEL -D_KERNEL X XCOPTDYN= -pic X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%) XLDOPTS= $(LIBS_PATH) $(LDPATH) XLDOPTDYN= XLNDYNLIB= @ X XDYNLD= @echo " ==> LINKING dynamic library \"$@\""; ld X XRANLIB= @echo " ==> RANDOMIZING ARCHIVE \"$@\""; ranlib X XLORDER= lorder $(AIX_ARCH) XAR= @echo " ==> ARCHIVING \"$@\""; ar $(AIX_ARCH) END-of-star-1.6/RULES/rs6000-aix-gcc.rul echo x - star-1.6/RULES/rules.shl sed 's/^X//' >star-1.6/RULES/rules.shl << 'END-of-star-1.6/RULES/rules.shl' X#ident "@(#)rules.shl 1.22 18/08/16 " X########################################################################### X# Written 1996-2018 by J. Schilling X########################################################################### X# X# Rules for shared (dynamic) libraries X# X# SUBARCHDIR must be before any other definitions X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X XSUBARCHDIR= /pic XCOPTS += $(COPTDYN) XC++OPTS += $(C++OPTDYN) XLDOPTS += $(LDOPTDYN) XLDLIBS += $(LDLIBDYN) X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.obj X########################################################################### X X########################################################################### X# This must be before first use of $(SHL_SUFFIX) X########################################################################### X_DYNMAJOR= $(_UNIQ)$(SHL_MAJOR) X__DYNMAJOR= $(_DYNMAJOR:$(_UNIQ)=1) XDYNMAJOR= $(__DYNMAJOR:$(_UNIQ)%=%) X X_DYNMINOR= $(_UNIQ)$(SHL_MINOR) X__DYNMINOR= $(_DYNMINOR:$(_UNIQ)=0) XDYNMINOR= $(__DYNMINOR:$(_UNIQ)%=%) X XTARGET= $(LIB_PREFIX)$(TARGETLIB)$(SHL_SUFFIX) XTARGET_BASE= $(LIB_PREFIX)$(TARGETLIB) XTARGET_PATH= $(OLIBSDIR) XPTARGET= $(OLIBSDIR)/$(TARGET) XPTARGET_BASE= $(OLIBSDIR)/$(TARGET_BASE) X X_MAPVERS= lib$(TARGETLIB)-mapvers X#MAPVERS= $(_MAPVERS) # Use this in *-os-*cc*.rul to enable mapfiles XPMAPVERS= $(MAPVERS:%=$(ARCHDIR)/$(MAPVERS)) X X$(PTARGET): $(PMAPVERS) X X# X# $(PMAPVERS) may be empty and POSIX does not permit empty target lists. X# We add an impossible target to make sure there is no empty target. X# X$(PMAPVERS) No/TaR/GeT: $(MAPVERS) X @echo " ==> LOCALIZING mapfile \"$@\""; \ X $(CPPX) $(CPP_FLAGS) $(CPPFLAGS) $(CPPX_IN) $^ | \ X tr -d '"' $(MAPFILE_POST) > $@ || $(RM) $(RM_FORCE) $@ X X_INSMODEI= $(_UNIQ)$(INSMODE) X__INSMODEI= $(_INSMODEI:$(_UNIQ)=$(INSMODEF)) XINSMODEI= $(__INSMODEI:$(_UNIQ)%=%) X X__DYNLD.o= $(_UNIQ)$(DYNLD.o) X___DYNLD.o= $(__DYNLD.o:$(_UNIQ)=$(DYNLD) -o $@ $(LDFLAGS) `$(LORDER) $(POFILES) | $(TSORT)` $(LDLIBS)) X_DYNLD.o= $(___DYNLD.o:$(_UNIQ)%=%) X Xall: $(TARGET_PATH) $(PTARGET) X X$(TARGET_PATH): X $(MKDIR) -p $@ X X$(PTARGET): $(OFILES) X $(_DYNLD.o) X -$(LNDYNLIB) X XSYMLINKS += $(TARGET_BASE).so X X# @$(RM) $(RM_FORCE) $(PTARGET_BASE).so; $(SYMLINK) $(TARGET) $(PTARGET_BASE).so X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/sub.htm Xinclude $(SRCROOT)/$(RULESDIR)/rules.clr Xinclude $(SRCROOT)/$(RULESDIR)/rules.ins Xinclude $(SRCROOT)/$(RULESDIR)/rules.tag Xinclude $(SRCROOT)/$(RULESDIR)/rules.hlp Xinclude $(SRCROOT)/$(RULESDIR)/rules.dep X########################################################################### END-of-star-1.6/RULES/rules.shl echo x - star-1.6/RULES/rules.cst sed 's/^X//' >star-1.6/RULES/rules.cst << 'END-of-star-1.6/RULES/rules.cst' X#ident @(#)rules.cst 1.1 16/08/10 X########################################################################### X# Written 2016 by J. Schilling X########################################################################### X# X# Rules for "cstyle" X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X XCSTYLE= cstyle XCSTYLEOPTS_DEF= -K X X_CSTYLEOPTS= $(_UNIQ)$(CSTYLEOPTS) X__CSTYLEOPTS= $(_CSTYLEOPTS:$(_UNIQ)=$(CSTYLEOPTS_DEF)) XCSTYLE_OPTS= $(__CSTYLEOPTS:$(_UNIQ)%=%) X X Xcstyle: $(CFILES) $(HFILES) X $(CSTYLE) $(CSTYLE_OPTS) $(CSTYLEOPTX) $^ END-of-star-1.6/RULES/rules.cst echo x - star-1.6/RULES/rules.rdi sed 's/^X//' >star-1.6/RULES/rules.rdi << 'END-of-star-1.6/RULES/rules.rdi' X#ident @(#)rules.rdi 1.10 11/04/14 X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# DIRS contains the names of all directories where sub make should take place X# This is a modified version for the project's root directory X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X Xinclude $(SRCROOT)/$(RULESDIR)/rules1.dir X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.hlp X########################################################################### X X# The need for this special variant of rules has been removed by introducing X# the SRCROOTSL macro in RULES/rules1.top X########################################################################### X# Due to a serious bug in SunPRO make we cannot include the configuration X# rules. SunPRO make inconsistsently shortens rules that start with "./" X# and thus wil not find existing rules for a file to be included. X# Due to a bug in GNU make dynamic configuration must have been run before X# C-compiler generated dependency rules are loaded. This is done by running X# make in the 'conf' directory before any other target is made. X# X# include $(SRCROOT)/$(RULESDIR)/rules.cnf X########################################################################### X#config: conf_warn X X#conf_warn: X# @echo "$@: cannot make due to a SunPRO make bug" END-of-star-1.6/RULES/rules.rdi echo x - star-1.6/RULES/os-qnx.id sed 's/^X//' >star-1.6/RULES/os-qnx.id << 'END-of-star-1.6/RULES/os-qnx.id' X#ident "@(#)os-qnx.id 1.2 06/05/14 " X########################################################################### X# Written 1998 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for QNX X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= qnx X-O_ARCH= -$(O_ARCH) END-of-star-1.6/RULES/os-qnx.id echo x - star-1.6/RULES/rules.mkd sed 's/^X//' >star-1.6/RULES/rules.mkd << 'END-of-star-1.6/RULES/rules.mkd' X#ident "%W% %E% %Q%" X########################################################################### X# Written 1997 by J. Schilling X########################################################################### X# X# make complete path to the architecture subdirectory. X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X$(ARCHDIR): X $(MKDIR) -p $@ X END-of-star-1.6/RULES/rules.mkd echo x - star-1.6/RULES/rules.mks sed 's/^X//' >star-1.6/RULES/rules.mks << 'END-of-star-1.6/RULES/rules.mks' X#ident "@(#)rules.mks 1.13 08/04/19 " X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# Rules for multiple Makefiles (*.mk) in one subdirectory X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X X$(ALLTARGETS): X @ for MK in $(MK_FILES) ; \ X do \ X ( \ X if [ -r ./$$MK ] ; then \ X echo " ==> MAKING \"$@\" ON SUBCOMPONENT \"$(CURDIR)/$$MK\""; "$(MAKE)" -f $$MK $(MAKEMACS) XARCH=$(XARCH) $@;\ X else \ X echo "NOTICE: Partial source ($(CURDIR)/$$MK) missing";\ X fi \ X ); \ X done X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.dyn Xinclude $(SRCROOT)/$(RULESDIR)/rules.hlp X########################################################################### END-of-star-1.6/RULES/rules.mks echo x - star-1.6/RULES/rules.mod sed 's/^X//' >star-1.6/RULES/rules.mod << 'END-of-star-1.6/RULES/rules.mod' X#ident @(#)rules.mod 1.7 07/05/06 X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# Rules for loadable streams modules X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.obj X########################################################################### X X_INSMODEI= $(_UNIQ)$(INSMODE) X__INSMODEI= $(_INSMODEI:$(_UNIQ)=$(INSMODEX)) XINSMODEI= $(__INSMODEI:$(_UNIQ)%=%) X Xall: $(PTARGET) X X$(PTARGET): $(OFILES) $(SRCLIBS) X $(LD) -r -o $@ $(OFILES) $(SRCLIBS) $(LIBS) X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/sub.htm Xinclude $(SRCROOT)/$(RULESDIR)/rules.clr Xinclude $(SRCROOT)/$(RULESDIR)/rules.ins Xinclude $(SRCROOT)/$(RULESDIR)/rules.tag Xinclude $(SRCROOT)/$(RULESDIR)/rules.hlp Xinclude $(SRCROOT)/$(RULESDIR)/rules.dep X########################################################################### END-of-star-1.6/RULES/rules.mod echo x - star-1.6/RULES/rules.obj sed 's/^X//' >star-1.6/RULES/rules.obj << 'END-of-star-1.6/RULES/rules.obj' X#ident @(#)rules.obj 1.4 06/05/14 X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# Object building rules ... use MAKEPROG specific version X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XPTARGET= $(ARCHDIR)/$(TARGET)$(_EXEEXT) X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/r-$(MAKEPROG).obj END-of-star-1.6/RULES/rules.obj echo x - star-1.6/RULES/i386-mingw32_nt-gcc.rul sed 's/^X//' >star-1.6/RULES/i386-mingw32_nt-gcc.rul << 'END-of-star-1.6/RULES/i386-mingw32_nt-gcc.rul' X#ident "@(#)i386-mingw32_nt-gcc.rul 1.14 18/04/11 " X########################################################################### X# X# Platform dependent MACROS for Win32/Mingw32 X# X########################################################################### X# Copyright (c) 2004-2018 J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-gcc.rul X XOSDEFS += XCPPOPTS= -I/MinGW/Include -I$(ARCHDIR) -I$(OINCSDIR) $(INCDIRS:%=-I%) $(INCDIRSX:%=-I%) X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X XWIN_LIBS= $(WIN32_LIBS) X XLDLIBS= $(LIBS) $(LIBX) $(WIN_LIBS) -lmingw32 X XLDOPTS= $(LIBS_PATH) $(LDPATH) X XLORDER= echo XTSORT= cat X X_MKDIR= $(_MKDIR_SH) XMKDIR= $(MKDIR_SH) XINSMKDIR= $(INSMKDIR_SH) END-of-star-1.6/RULES/i386-mingw32_nt-gcc.rul echo x - star-1.6/RULES/i386-netbsd-cc.rul sed 's/^X//' >star-1.6/RULES/i386-netbsd-cc.rul << 'END-of-star-1.6/RULES/i386-netbsd-cc.rul' X#ident "@(#)i386-netbsd-cc.rul 1.13 18/11/15 " X########################################################################### X# Written 1997-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for NetBSD X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-g$(C_ARCH).rul X XOSDEFS += X#OSDEFS += -DIS_UNIX X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X X# X# Sunpro C/C++ run on Solaris and Linux and both have linkers X# that support mapfiles X# XMAPVERS= $(_MAPVERS) # This enables to use mapfiles X# X# The GNU linker is buggy and does not like the official order in linker map X# files for symbol versioning. The following command reverses the order of X# the version names in the linker map file. X# XMAPFILE_POST= | sed 's/^SCHILY/+SCHILY/' | tr '\012' '@' | tr '+' '\012' | tail -r | tr '@' '\012' X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%) X#LDOPTS= $(LIBS_PATH) $(LDPATH) XLDOPTMAP= $(PMAPVERS:%=-Wl,--version-script=%) XLDOPTDYN= -shared -Wl,-soname,$(TARGET) $(LDOPTMAP) X XRANLIB= @echo " ==> RANDOMIZING ARCHIVE \"$@\""; ranlib END-of-star-1.6/RULES/i386-netbsd-cc.rul echo x - star-1.6/RULES/rules.scr sed 's/^X//' >star-1.6/RULES/rules.scr << 'END-of-star-1.6/RULES/rules.scr' X#ident "@(#)rules.scr 1.2 06/05/14 " X########################################################################### X# Written 1997 by J. Schilling X########################################################################### X# X# Shell script building rules X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XSRCFILE= $(SCRFILE) X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.loc X########################################################################### END-of-star-1.6/RULES/rules.scr echo x - star-1.6/RULES/rules.htm sed 's/^X//' >star-1.6/RULES/rules.htm << 'END-of-star-1.6/RULES/rules.htm' X#ident "@(#)rules.htm 1.7 18/12/10 " X########################################################################### X# Written 2007 by J. Schilling X########################################################################### X# X# Manual page to html converting rules X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X Xhtml: $(MANFILE) X soelim $(MANFILE) | tbl | nroff -rh1 -u1 -Tlp -man - | col -x | \ X man2html -cgiurl '$$title.$$section.html' -compress -nodepage \ X > $(MANFILE).html X Xhtmlxn: $(MANFILE).html X X# X# -rh1 sets number register 'h' to 1 to signal that we use man2html and X# thus cannot reduce indentation in order to prevent man2html to make X# related test big and bold as it thinks this are headlines. X# X$(MANFILE).html: $(MANFILE) X soelim $(MANFILE) | tbl | nroff -rh1 -u1 -Tlp -man - | col -x | \ X (sed -e 's/XXX/$(MANFILE)/g' $(SRCROOT)/conf/pre.html; \ X man2html -cgiurl '../man$$section$$subsection/$$title.$$section$$subsection.html' -compress -nodepage; \ X cat $(SRCROOT)/conf/post.html) | \ X egrep -v 'HTML|BODY'> $(MANFILE).html X X$(MANFILE).dhtml: $(MANFILE) X soelim $(MANFILE) | tbl | nroff -rh1 -u1 -Tlp -mdoc - | col -x | \ X (sed -e 's/XXX/$(MANFILE)/g' $(SRCROOT)/conf/pre.html; \ X man2html -cgiurl '../man$$section$$subsection/$$title.$$section$$subsection.html' -compress -nodepage; \ X cat $(SRCROOT)/conf/post.html) | \ X egrep -v 'HTML|BODY'> $(MANFILE).html X Xhtmlx: $(MANFILE) X soelim $(MANFILE) | tbl | nroff -rh1 -u1 -Tlp -man - | col -x | \ X (sed -e 's/XXX/$(MANFILE)/g' $(SRCROOT)/conf/pre.html; \ X man2html -cgiurl '$$title.$$section.html' -compress -nodepage; \ X cat $(SRCROOT)/conf/post.html) | \ X egrep -v 'HTML|BODY'> $(MANFILE).html END-of-star-1.6/RULES/rules.htm echo x - star-1.6/RULES/rules.tag sed 's/^X//' >star-1.6/RULES/rules.tag << 'END-of-star-1.6/RULES/rules.tag' X#ident "@(#)rules.tag 1.2 06/05/14 " X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# Tag building rules ... use MAKEPROG specific version X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/r-$(MAKEPROG).tag END-of-star-1.6/RULES/rules.tag echo x - star-1.6/RULES/os-qnx.def sed 's/^X//' >star-1.6/RULES/os-qnx.def << 'END-of-star-1.6/RULES/os-qnx.def' X#ident "@(#)os-qnx.def 1.2 06/05/14 " X########################################################################### X# Written 1997 by J. Schilling X########################################################################### X# X# Global os definitions for QNX X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XMANSTYLE= sysv END-of-star-1.6/RULES/os-qnx.def echo x - star-1.6/RULES/cc-msc64.rul sed 's/^X//' >star-1.6/RULES/cc-msc64.rul << 'END-of-star-1.6/RULES/cc-msc64.rul' X#ident "@(#)cc-msc64.rul 1.18 09/05/17 " X########################################################################### X# Written 2009 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for CYGWIN32_NT using MSVC X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X Xinclude $(SRCROOT)/$(RULESDIR)/cc-msc.rul X XMSCOPT64= -machine:X64 X XVC=7_64 END-of-star-1.6/RULES/cc-msc64.rul echo x - star-1.6/RULES/9000-725-hp-ux-cc.rul sed 's/^X//' >star-1.6/RULES/9000-725-hp-ux-cc.rul << 'END-of-star-1.6/RULES/9000-725-hp-ux-cc.rul' X#ident "@(#)9000-725-hp-ux-cc.rul 1.14 14/04/01 " X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for HP/UX X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-$(C_ARCH:cc%=hp%).rul X XOSDEFS += X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X XLORDER= echo XTSORT= cat END-of-star-1.6/RULES/9000-725-hp-ux-cc.rul echo x - star-1.6/RULES/os-pyro.def sed 's/^X//' >star-1.6/RULES/os-pyro.def << 'END-of-star-1.6/RULES/os-pyro.def' X#ident "@(#)os-pyro.def 1.1 12/12/02 " X########################################################################### X# Written 2009 by J. Schilling X########################################################################### X# X# Global os definitions for Pyro X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XMANSTYLE= bsd END-of-star-1.6/RULES/os-pyro.def echo x - star-1.6/RULES/os-pyro.id sed 's/^X//' >star-1.6/RULES/os-pyro.id << 'END-of-star-1.6/RULES/os-pyro.id' X#ident "@(#)os-pyro.id 1.1 12/12/02 " X########################################################################### X# Written 2009 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for Pyro X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= pyro X-O_ARCH= -$(O_ARCH) END-of-star-1.6/RULES/os-pyro.id echo x - star-1.6/RULES/sun3-sunos4-cc.rul sed 's/^X//' >star-1.6/RULES/sun3-sunos4-cc.rul << 'END-of-star-1.6/RULES/sun3-sunos4-cc.rul' X#ident "@(#)sun3-sunos4-cc.rul 1.8 07/05/08 " X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for SunOS 4.x on Motorola mc 680x0 X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-sun.rul X XOSDEFS += X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= -lkvm X XRANLIB= @echo " ==> RANDOMIZING ARCHIVE \"$@\""; ranlib X END-of-star-1.6/RULES/sun3-sunos4-cc.rul echo x - star-1.6/RULES/sun4-sunos4-cc.rul sed 's/^X//' >star-1.6/RULES/sun4-sunos4-cc.rul << 'END-of-star-1.6/RULES/sun4-sunos4-cc.rul' X#ident "@(#)sun4-sunos4-cc.rul 1.8 07/05/08 " X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for SunOS 4.x on sparc X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-sun.rul X XOSDEFS += X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= -lkvm X XRANLIB= @echo " ==> RANDOMIZING ARCHIVE \"$@\""; ranlib X END-of-star-1.6/RULES/sun4-sunos4-cc.rul echo x - star-1.6/RULES/sun3-sunos4-gcc.rul sed 's/^X//' >star-1.6/RULES/sun3-sunos4-gcc.rul << 'END-of-star-1.6/RULES/sun3-sunos4-gcc.rul' X#ident "@(#)sun3-sunos4-gcc.rul 1.12 18/04/11 " X########################################################################### X# Written 1996-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for SunOS 4.x on Motorola mc 680x0 (GCC) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-gcc.rul XCWOPTS= -Wall -Wshadow -Wmissing-prototypes -Wstrict-prototypes X XOSDEFS += X XCOPTOPT= -O2 XKDEFINES= -DKERNEL -D_KERNEL X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= -lkvm X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%) XLDOPTS= $(LIBS_PATH) $(LDPATH) XLDOPTDYN= XLNDYNLIB= @ X XDYNLD= @echo " ==> LINKING dynamic library \"$@\""; ld XRANLIB= @echo " ==> RANDOMIZING ARCHIVE \"$@\""; ranlib X END-of-star-1.6/RULES/sun3-sunos4-gcc.rul echo x - star-1.6/RULES/sun4-sunos4-gcc.rul sed 's/^X//' >star-1.6/RULES/sun4-sunos4-gcc.rul << 'END-of-star-1.6/RULES/sun4-sunos4-gcc.rul' X#ident "@(#)sun4-sunos4-gcc.rul 1.9 18/04/11 " X########################################################################### X# Written 1996-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for SunOS 4.x on sparc (GCC) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-gcc.rul X XOSDEFS += X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= -lkvm X XLDOPTDYN= XLNDYNLIB= @ X XDYNLD= @echo " ==> LINKING dynamic library \"$@\""; ld XRANLIB= @echo " ==> RANDOMIZING ARCHIVE \"$@\""; ranlib END-of-star-1.6/RULES/sun4-sunos4-gcc.rul echo x - star-1.6/RULES/i386-netbsd-gcc.rul sed 's/^X//' >star-1.6/RULES/i386-netbsd-gcc.rul << 'END-of-star-1.6/RULES/i386-netbsd-gcc.rul' X#ident "@(#)i386-netbsd-gcc.rul 1.13 18/11/15 " X########################################################################### X# Written 1997-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for NetBSD X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-$(C_ARCH).rul X XOSDEFS += X#OSDEFS += -DIS_UNIX X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X X# X# Sunpro C/C++ run on Solaris and Linux and both have linkers X# that support mapfiles X# XMAPVERS= $(_MAPVERS) # This enables to use mapfiles X# X# The GNU linker is buggy and does not like the official order in linker map X# files for symbol versioning. The following command reverses the order of X# the version names in the linker map file. X# XMAPFILE_POST= | sed 's/^SCHILY/+SCHILY/' | tr '\012' '@' | tr '+' '\012' | tail -r | tr '@' '\012' X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%) X#LDOPTS= $(LIBS_PATH) $(LDPATH) XLDOPTMAP= $(PMAPVERS:%=-Wl,--version-script=%) XLDOPTDYN= -shared -Wl,-soname,$(TARGET) $(LDOPTMAP) X XRANLIB= @echo " ==> RANDOMIZING ARCHIVE \"$@\""; ranlib END-of-star-1.6/RULES/i386-netbsd-gcc.rul echo x - star-1.6/RULES/i386-openbsd-cc.rul sed 's/^X//' >star-1.6/RULES/i386-openbsd-cc.rul << 'END-of-star-1.6/RULES/i386-openbsd-cc.rul' X#ident "@(#)i386-openbsd-cc.rul 1.11 18/04/11 " X########################################################################### X# Written 1997-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for OpenBSD X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-gcc.rul X XOSDEFS += X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%) XLDOPTS= $(LIBS_PATH) $(LDPATH) X XRANLIB= @echo " ==> RANDOMIZING ARCHIVE \"$@\""; ranlib END-of-star-1.6/RULES/i386-openbsd-cc.rul echo x - star-1.6/RULES/i386-bsd-os3-gcc.rul sed 's/^X//' >star-1.6/RULES/i386-bsd-os3-gcc.rul << 'END-of-star-1.6/RULES/i386-bsd-os3-gcc.rul' X#ident "@(#)i386-bsd-os3-gcc.rul 1.13 13/11/04 " X########################################################################### X# Written 1998 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for BSD/OS X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-gcc.rul X XOSDEFS += XCPPOPTS= -I$(ARCHDIR) -I$(OINCSDIR) $(INCDIRS:%=-I%) -I/sys $(INCDIRSX:%=-I%) X XKDEFINES= -DKERNEL -D_KERNEL X X#COPTDYN= -fpic XCOPTDYN= X XLIB_PREFIX= lib XLIB_SUFFIX= .a X#SHL_SUFFIX= .so.1.0 XSHL_SUFFIX= X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%) XLDOPTS= $(LIBS_PATH) $(LDPATH) X#LDOPTDYN= -shared -Wl,-soname,$(TARGET) X#LNDYNLIB= @$(RM) $(RM_FORCE) $(PTARGET_BASE).so; $(SYMLINK) $(TARGET) $(PTARGET_BASE).so XLDOPTDYN= XLNDYNLIB= X X# shlicc2 is not present oln older or newer systems X#LDCC= @echo " ==> LINKING \"$@\""; shlicc2 XLDCC= @echo " ==> LINKING \"$@\""; shlicc X#DYNLD= @echo " ==> LINKING dynamic library \"$@\""; gcc XDYNLD= XRANLIB= @echo " ==> RANDOMIZING ARCHIVE \"$@\""; ranlib END-of-star-1.6/RULES/i386-bsd-os3-gcc.rul echo x - star-1.6/RULES/local.cnf sed 's/^X//' >star-1.6/RULES/local.cnf << 'END-of-star-1.6/RULES/local.cnf' X#ident @(#)local.cnf 1.13 18/08/16 X########################################################################### X# Written 1998-2014 by J. Schilling X########################################################################### X# X# Make Rules for local dynamic configuration X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X Xconfigure: autoconf.m4 acgeneral.m4 acspecific.m4 acoldnames.m4 aclocal.m4 \ X local.cnf.in lconfig.h.in X @echo " ==> AUTOCONFIGURING LOCAL \"$@\""; sh ./autoconf X X#config: $(ARCHDIR)/local.cnf X X$(ARCHDIR)/Inull: X $(MKDIR) -p $(ARCHDIR) X @echo > $@ X X$(ARCHDIR)/local.cnf $(ARCHDIR)/lconfig.h: $(LCONFIG_DEP) $(ARCHDIR)/Inull \ X configure local.cnf.in lconfig.h.in X $(RUL_LCONF) X X########################################################################### XRUL_LCONF= @echo " ==> CONFIGURING LOCAL RULES \"$@\""; \ X $(RM_F) $(ARCHDIR)/local.cnf $(ARCHDIR)/lconfig.h; \ X cd $(ARCHDIR); \ X CONFIG_NOFAIL=TRUE CC="$(XCC_COM)" CFLAGS="$(C_FLAGS) $(CFLAGS)" \ X CXXFLAGS="$(C++FLAGS)" CPPFLAGS="$(OS_DEFS) $(CPPFLAGS)" \ X LDFLAGS="$(LDOPTS)" sh $(INVERSE_SUBARCHDIR)../../configure $(CONFFLAGS) X########################################################################### Xinclude $(ARCHDIR)/Inull Xinclude $(ARCHDIR)/local.cnf X########################################################################### END-of-star-1.6/RULES/local.cnf echo x - star-1.6/RULES/powerpc-beos-mwcc.rul sed 's/^X//' >star-1.6/RULES/powerpc-beos-mwcc.rul << 'END-of-star-1.6/RULES/powerpc-beos-mwcc.rul' X#ident "@(#)powerpc-beos-mwcc.rul 1.11 13/11/04 " X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for BeOS X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-bemwcc.rul X XOSDEFS += X XCPPOPTS= -relax_pointers -opt global -sym on -g -i- -I$(ARCHDIR) -I$(OINCSDIR) $(INCDIRS:%=-I%) $(INCDIRSX:%=-I%) X XKDEFINES= -DKERNEL -D_KERNEL X X#LIB_SOCKET= -lsocket -lnsl -ldl XLIB_SOCKET= X#LIB_MATH= -lm X#LIB_KVM= -lkvm XLIB_KVM= X XLDOPTS= -multidefs -sym on -g $(LIBS_PATH) $(LDPATH) X XLORDER= echo XTSORT= cat X XLN= /bin/ln -s END-of-star-1.6/RULES/powerpc-beos-mwcc.rul echo x - star-1.6/RULES/os-mingw32_nt-6.2.id sed 's/^X//' >star-1.6/RULES/os-mingw32_nt-6.2.id << 'END-of-star-1.6/RULES/os-mingw32_nt-6.2.id' X#ident "@(#)os-mingw32_nt-6.2.id 1.1 15/12/09 " X########################################################################### X# X# OS specific MACRO definitions for Win32/Mingw32 X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= mingw32_nt X-O_ARCH= -$(O_ARCH) END-of-star-1.6/RULES/os-mingw32_nt-6.2.id echo x - star-1.6/RULES/os-mingw32_nt-6.3.id sed 's/^X//' >star-1.6/RULES/os-mingw32_nt-6.3.id << 'END-of-star-1.6/RULES/os-mingw32_nt-6.3.id' X#ident "@(#)os-mingw32_nt-6.3.id 1.1 15/12/09 " X########################################################################### X# X# OS specific MACRO definitions for Win32/Mingw32 X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= mingw32_nt X-O_ARCH= -$(O_ARCH) END-of-star-1.6/RULES/os-mingw32_nt-6.3.id echo x - star-1.6/RULES/os-mingw32_nt-6.4.id sed 's/^X//' >star-1.6/RULES/os-mingw32_nt-6.4.id << 'END-of-star-1.6/RULES/os-mingw32_nt-6.4.id' X#ident "@(#)os-mingw32_nt-6.4.id 1.1 15/12/09 " X########################################################################### X# X# OS specific MACRO definitions for Win32/Mingw32 X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= mingw32_nt X-O_ARCH= -$(O_ARCH) END-of-star-1.6/RULES/os-mingw32_nt-6.4.id echo x - star-1.6/RULES/r-sunpro.dep sed 's/^X//' >star-1.6/RULES/r-sunpro.dep << 'END-of-star-1.6/RULES/r-sunpro.dep' X#ident "@(#)r-sunpro.dep 1.18 18/08/16 " X########################################################################### X# Written 1996-2017 by J. Schilling X########################################################################### X# X# Dependency building rules for SunPro Make (Schilytools version) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XDEP_SUFFIX= .d XRMDEP= $(RM) $(RM_FORCE) $@ X___C++DEP_FILES= $(C++FILES:%.C=%.d) X__C++DEP_FILES= $(___C++DEP_FILES:%.cc=%.d) X_C++DEP_FILES= $(__C++DEP_FILES:%.cpp=%.d) XC++DEP_FILES= $(_C++DEP_FILES:%.cxx=%.d) XC++PDEP_FILES= $(C++DEP_FILES:%=$(ARCHDIR)/%) XDEP_FILE= $(CFILES:%.c=%.d) $(C++DEP_FILES) XPDEP_FILE= $(CFILES:%.c=$(ARCHDIR)/%.d) $(C++PDEP_FILES) XPALLDEP_FILE= $(CFILES:%.c=$(ARCHDIR)/%.d) $(C++PDEP_FILES) $(ARCHDIR)/$(TARGET).dep XDEP_DEP= $(ARCHDIR)/Dnull X########################################################################### Xdepend: rmdep $(DEP_FILE) X Xrmdep: X $(RM) $(RM_FORCE) $(PALLDEP_FILE) X X########################################################################### X# X# Make the complete path to the architecture subdirectory. X# Make $(ARCHDIR)/man as well here to avoid this directory to become root X# owned when root later calls "make install". X# X########################################################################### X$(ARCHDIR) $(ARCHDIR)/man: X $(MKDIR) -p $@ X X########################################################################### X# X# Generate dependency file(s). X# This rules is checked when the dependency file(s) are included. X# X# Modify the the path for .o files to reflect that they are placed in X# $(ARCHDIR). Add the dependency file itself to each line so that X# the dependencies will be rebuilt if a source is newer that the X# appropriate dependency file. X# X########################################################################### X$(ARCHDIR)/%.d: %.c X $(MKDEP) $(CPP_FLAGS) $(CPPFLAGS) $(MKDEP_OUT) $< \ X | sed -e 's;^\(.*\)\.$o[ ]*:;$(ARCHDIR)/\1.$o $(ARCHDIR)/\1.d:;' > $@ X X$(ARCHDIR)/%.d: %.C X $(MKC++DEP) $(CPP_FLAGS) $(CPPFLAGS) $(MKC++DEP_OUT) $< \ X | sed -e 's;^\(.*\)\.$o[ ]*:;$(ARCHDIR)/\1.$o $(ARCHDIR)/\1.d:;' > $@ X$(ARCHDIR)/%.d: %.cc X $(MKC++DEP) $(CPP_FLAGS) $(CPPFLAGS) $(MKC++DEP_OUT) $< \ X | sed -e 's;^\(.*\)\.$o[ ]*:;$(ARCHDIR)/\1.$o $(ARCHDIR)/\1.d:;' > $@ X$(ARCHDIR)/%.d: %.cpp X $(MKC++DEP) $(CPP_FLAGS) $(CPPFLAGS) $(MKC++DEP_OUT) $< \ X | sed -e 's;^\(.*\)\.$o[ ]*:;$(ARCHDIR)/\1.$o $(ARCHDIR)/\1.d:;' > $@ X$(ARCHDIR)/%.d: %.cxx X $(MKC++DEP) $(CPP_FLAGS) $(CPPFLAGS) $(MKC++DEP_OUT) $< \ X | sed -e 's;^\(.*\)\.$o[ ]*:;$(ARCHDIR)/\1.$o $(ARCHDIR)/\1.d:;' > $@ X X$(PDEP_FILE): $(DEP_DEP) X X$(DEP_DEP): X @if [ ! -f $@ ]; then \ X echo " ==> MAKING DIRECTORY \"$(ARCHDIR)\""; \ X $(_MKDIR) -p $(ARCHDIR); \ X echo " ==> MAKING DIRECTORY \"$(ARCHDIR)/man\""; \ X $(_MKDIR) -p $(ARCHDIR)/man; \ X echo > $@; \ X fi X X########################################################################### X# X# Include the dependency file(s) generated from the rules above. X# X########################################################################### Xinclude $(PDEP_FILE) END-of-star-1.6/RULES/r-sunpro.dep echo x - star-1.6/RULES/cc-gcc.rul sed 's/^X//' >star-1.6/RULES/cc-gcc.rul << 'END-of-star-1.6/RULES/cc-gcc.rul' X#ident "@(#)cc-gcc.rul 1.20 18/08/16 " X########################################################################### X# Written 1996-2018 by J. Schilling X########################################################################### X# X# Platform independent MACROS for GCC X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X XGCC_OPT= XGCC_OPT32= -m32 XGCC_OPT64= -m64 XGCC_OPTXX= $(GCC_OPT$(C_ARCH:gcc%=%)) X XCPP_FLAGS= -DSCHILY_BUILD $(CPPOPTS) $(CPPOPTX) $(OSINCDIRS:%=-I%) $(OSDEFS) $(OSDEFSX) XC_FLAGS= $(COPTS) $(CWARNOPTS) $(COPTOPT) $(GCCOPTOPT) $(COPTX) XC++FLAGS= $(C++OPTS) $(C++WARNOPTS) $(C++OPTOPT) $(G++OPTOPT) $(C++OPTX) X XCPPOPTS= -I$(ARCHDIR) -I$(OINCSDIR) $(INCDIRS:%=-I%) $(INCDIRSX:%=-I%) XCOPTS= $(GCC_OPTXX) X# -Wtraditional now causes more pain than it helps XCWOPTS= -Wall -Wtraditional XCWOPTS= -Wall -Wno-unknown-pragmas \ X -Wshadow -Wmissing-prototypes -Wstrict-prototypes XCOPTOPT= -O XCOPTDYN= -fpic XCOPTGPROF= -pg XC++OPTS= $(GCC_OPTXX) XC++WOPTS= $(CWOPTS) XC++OPTOPT= $(COPTOPT) XC++OPTDYN= -fpic XC++OPTGPROF= -pg X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR) X XLIB_C= -lc X XLIBS_PATH= -L$(OLIBSDIR) XLIBS_PATH_STATIC= -L$(OLIBSDIR_STATIC) X XLDFLAGS= $(LDOPTS) $(LDOPTX) XLDLIBS= $(LIBS) $(LIBX) X XLDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%) XLDOPTDYN= -shared -Wl,-soname,$(TARGET) XLNDYNLIB= @$(RM) $(RM_FORCE) $(PTARGET_BASE).so; $(SYMLINK) $(TARGET) $(PTARGET_BASE).so X XFLOAT_OPTIONS= X X__CC_COM= $(_UNIQ)$(CC) X___CC_COM= $(__CC_COM:$(_UNIQ)=$(CC_COM_DEF)) XCC_COM= $(___CC_COM:$(_UNIQ)%=%) X X__CC++_COM= $(_UNIQ)$(CCC) X___CC++_COM= $(__CC++_COM:$(_UNIQ)=$(CC++_COM_DEF)) XCC++_COM= $(___CC++_COM:$(_UNIQ)%=%) X XCC_COM_DEF= gcc XCC++_COM_DEF= g++ XCC= $(CC_COM_DEF) XCCC= $(CC++_COM_DEF) X XCCCC= @echo " ==> COMPILING \"$@\""; $(CC_COM) $(GCC_OPTXX) XCC++ = @echo " ==> COMPILING \"$@\""; $(CC++_COM) $(GCC_OPTXX) XLDCC= @echo " ==> LINKING \"$@\""; $(CC_COM) $(GCC_OPTXX) XLDCC++ = @echo " ==> LINKING \"$@\""; $(CC++_COM) $(GCC_OPTXX) XDYNLD= @echo " ==> LINKING dynamic library \"$@\""; $(CC_COM) $(GCC_OPTXX) XDYNLDC++ = @echo " ==> LINKING dynamic library \"$@\""; $(CC++_COM) $(GCC_OPTXX) X XRMDEP= : XMKDEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); $(CC_COM) $(GCC_OPTXX) -M XMKDEP_OUT= XMKC++DEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); $(CC++_COM) $(GCC_OPTXX) -M XMKC++DEP_OUT= END-of-star-1.6/RULES/cc-gcc.rul echo x - star-1.6/RULES/i386-openserver-gcc.rul sed 's/^X//' >star-1.6/RULES/i386-openserver-gcc.rul << 'END-of-star-1.6/RULES/i386-openserver-gcc.rul' X#ident "@(#)i386-openserver-gcc.rul 1.10 18/04/11 " X########################################################################### X# Written 1999-2018 by J. Schilling/Santa Cruz Operation X########################################################################### X# X# Platform dependent MACROS for SCO OpenServer 5 using gcc X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-gcc.rul X XOSDEFS += -DSCO -DOPENSERVER XCOPTS= -melf X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_SOCKET= -lsocket -lnsl -ldl XLIB_MATH= -lm XLIB_KVM= X XLDOPTS= $(LIBS_PATH) $(LDPATH) XLDOPTDYN= -dy -G $(TARGET) X XLORDER= echo XTSORT= cat X X_MKDIR= $(_MKDIR_SH) XMKDIR= $(MKDIR_SH) XINSMKDIR= $(INSMKDIR_SH) END-of-star-1.6/RULES/i386-openserver-gcc.rul echo x - star-1.6/RULES/i386-bsd-os-gcc.rul sed 's/^X//' >star-1.6/RULES/i386-bsd-os-gcc.rul << 'END-of-star-1.6/RULES/i386-bsd-os-gcc.rul' X#ident "@(#)i386-bsd-os-gcc.rul 1.15 13/11/04 " X########################################################################### X# Written 1998 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for BSD/OS X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-gcc.rul X XOSDEFS += XCPPOPTS= -I$(ARCHDIR) -I$(OINCSDIR) $(INCDIRS:%=-I%) -I/sys $(INCDIRSX:%=-I%) X XKDEFINES= -DKERNEL -D_KERNEL X X#COPTDYN= -fpic XCOPTDYN= X XLIB_PREFIX= lib XLIB_SUFFIX= .a X#SHL_SUFFIX= .so.1.0 XSHL_SUFFIX= X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%) XLDOPTS= $(LIBS_PATH) $(LDPATH) X#LDOPTDYN= -shared -Wl,-soname,$(TARGET) X#LNDYNLIB= @$(RM) $(RM_FORCE) $(PTARGET_BASE).so; $(SYMLINK) $(TARGET) $(PTARGET_BASE).so XLDOPTDYN= XLNDYNLIB= X XRANLIB= @echo " ==> RANDOMIZING ARCHIVE \"$@\""; ranlib END-of-star-1.6/RULES/i386-bsd-os-gcc.rul echo x - star-1.6/RULES/i386-bsd-os3-cc.rul sed 's/^X//' >star-1.6/RULES/i386-bsd-os3-cc.rul << 'END-of-star-1.6/RULES/i386-bsd-os3-cc.rul' X#ident "@(#)i386-bsd-os3-cc.rul 1.13 13/11/04 " X########################################################################### X# Written 1998 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for BSD/OS X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-gcc.rul X XOSDEFS += XCPPOPTS= -I$(ARCHDIR) -I$(OINCSDIR) $(INCDIRS:%=-I%) -I/sys $(INCDIRSX:%=-I%) X XKDEFINES= -DKERNEL -D_KERNEL X X#COPTDYN= -fpic XCOPTDYN= X XLIB_PREFIX= lib XLIB_SUFFIX= .a X#SHL_SUFFIX= .so.1.0 XSHL_SUFFIX= X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%) XLDOPTS= $(LIBS_PATH) $(LDPATH) X#LDOPTDYN= -shared -Wl,-soname,$(TARGET) X#LNDYNLIB= @$(RM) $(RM_FORCE) $(PTARGET_BASE).so; $(SYMLINK) $(TARGET) $(PTARGET_BASE).so XLDOPTDYN= XLNDYNLIB= X X# shlicc2 is not present oln older or newer systems X#LDCC= @echo " ==> LINKING \"$@\""; shlicc2 XLDCC= @echo " ==> LINKING \"$@\""; shlicc X#DYNLD= @echo " ==> LINKING dynamic library \"$@\""; gcc XDYNLD= XRANLIB= @echo " ==> RANDOMIZING ARCHIVE \"$@\""; ranlib END-of-star-1.6/RULES/i386-bsd-os3-cc.rul echo x - star-1.6/RULES/os-cygwin_nt-6.3-wow64.id sed 's/^X//' >star-1.6/RULES/os-cygwin_nt-6.3-wow64.id << 'END-of-star-1.6/RULES/os-cygwin_nt-6.3-wow64.id' X#ident "@(#)os-cygwin_nt-6.3-wow64.id 1.1 13/09/16 " X########################################################################### X# Written 2013 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for Cygnus GCC for MS Windows NT-6.3 (Win 8.1) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/os-cygwin32_wow64.id X XWINNTDEFS += -D_WIN32_WINNT=0x0603 END-of-star-1.6/RULES/os-cygwin_nt-6.3-wow64.id echo x - star-1.6/RULES/os-cygwin_nt-6.3.id sed 's/^X//' >star-1.6/RULES/os-cygwin_nt-6.3.id << 'END-of-star-1.6/RULES/os-cygwin_nt-6.3.id' X#ident "@(#)os-cygwin_nt-6.3.id 1.1 13/09/16 " X########################################################################### X# Written 2013 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for Cygnus GCC for MS Windows NT-6.3 (Win 8.1) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/os-cygwin32_nt.id X XWINNTDEFS += -D_WIN32_WINNT=0x0603 END-of-star-1.6/RULES/os-cygwin_nt-6.3.id echo x - star-1.6/RULES/mk-sunpro.id sed 's/^X//' >star-1.6/RULES/mk-sunpro.id << 'END-of-star-1.6/RULES/mk-sunpro.id' X#ident "@(#)mk-sunpro.id 1.22 18/04/15 " X########################################################################### X# Written 1996-2018 by J. Schilling X########################################################################### X# X# Name of make program (make/gmake/smake) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X X_GETENV= $(_UNIQ)$(ARCH_DONE) X__GETENV= $(_GETENV:$(_UNIQ)=rules.oes) X___GETENV= $(__GETENV:$(_UNIQ)TRUE=rules.nul) XGET_ENV= $(___GETENV:$(_UNIQ)%=%) X Xinclude $(SRCROOT)/$(RULESDIR)/$(GET_ENV) X X_SETENV= $(_UNIQ)$(SETENV) X__SETENV= $(_SETENV:$(_UNIQ)=rules.env) X___SETENV= $(__SETENV:$(_UNIQ)none=rules.nul) XSET_ENV= $(___SETENV:$(_UNIQ)%=%) X Xinclude $(SRCROOT)/$(RULESDIR)/$(SET_ENV) X XMAKEPROG= $(MAKE_NAME) # Use the new ID from the Schilytools version XWAIT= .WAIT # Sun make notation to wait for parallel targets X XSPACE= $(_UNIQ:$(_UNIQ)%= ) XPRE_NUMBER= pre\# XNUMBER_SIGN= $(PRE_NUMBER:pre\%=%) X X########################################################################### X# X# standard (automatic) machine identification X# X########################################################################### X# X# XP_ARCH = uname -p = mach # Processor (sparc/mc68020) X# XK_ARCH = uname -m = arch -k # Kernel (sun3/sun4c/sun4m) X# XM_ARCH = arch ~ arch -k # Machine (sun3/sun4) X# X########################################################################### X X########################################################################### X# X# Set up the values for XP_ARCH/XK_ARCH/XM_ARCH/... X# X########################################################################### X_ARS= $(_UNIQ)$(ARCH_DONE) X__ARS= $(_ARS:$(_UNIQ)=rules.ars) X___ARS= $(__ARS:$(_UNIQ)TRUE=rules.nul) XARS= $(___ARS:$(_UNIQ)%=%) X Xinclude $(SRCROOT)/$(RULESDIR)/$(ARS) X########################################################################### X XP_ARCH= $(XP_ARCH) XK_ARCH= $(XK_ARCH) XM_ARCH= $(XM_ARCH) X X_XP_ARCH= $(XP_ARCH:unknown=$(K_ARCH)) X X_P_ARCH= $(_UNIQ)$(_XP_ARCH) X__P_ARCH= $(_P_ARCH:$(_UNIQ)=$(K_ARCH)) XP_ARCH= $(__P_ARCH:$(_UNIQ)%=%) X X_M_ARCH= $(_UNIQ)$(XM_ARCH) X__M_ARCH= $(_M_ARCH:$(_UNIQ)=$(K_ARCH)) XM_ARCH= $(__M_ARCH:$(_UNIQ)%=%) X X# X# Turn off the X# --> # jobs X# --> Job output X# messages. X# You may turn them on again by calling: dmake DMAKE_OUTPUT_MODE=TXT1 X# XDMAKE_OUTPUT_MODE=TXT2 END-of-star-1.6/RULES/mk-sunpro.id echo x - star-1.6/RULES/i486-cygwin32_nt-cl.rul sed 's/^X//' >star-1.6/RULES/i486-cygwin32_nt-cl.rul << 'END-of-star-1.6/RULES/i486-cygwin32_nt-cl.rul' X#ident "@(#)i486-cygwin32_nt-cl.rul 1.8 09/05/21 " X########################################################################### X# Written 2006 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for CYGWIN32_NT using MSVC X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### X_PLATFORM= cygwin Xinclude $(SRCROOT)/$(RULESDIR)/cc-msc.rul X X# X# Supress useless cl warnings like: X# warning C4996: 'strerror' wurde als veraltet deklariert X# Consider using strerror_s instead. X# XOSDEFS += -D_CRT_SECURE_NO_DEPRECATE X X# X# Supress useless cl warnings like: X# warning C4996: 'fdopen' wurde als veraltet deklariert X# The POSIX name for this item is deprecated. Instead, use X# the ISO C++ conformant name: _fdopen. X# XOSDEFS += -D_CRT_NONSTDC_NO_DEPRECATE X XKDEFINES= X XLIB_SOCKET= Ws2_32.lib XLIB_MATH= XLIB_KVM= X XLORDER= echo XTSORT= cat END-of-star-1.6/RULES/i486-cygwin32_nt-cl.rul echo x - star-1.6/RULES/man-sysv.def sed 's/^X//' >star-1.6/RULES/man-sysv.def << 'END-of-star-1.6/RULES/man-sysv.def' X#ident @(#)man-sysv.def 1.2 06/05/14 X########################################################################### X# Written 1997 by J. Schilling X########################################################################### X# X# Definition for manual sections on SYSV based systems X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X XMANSECT_CMD= man1 XMANSECT_SYSCALL= man2 XMANSECT_LIB= man3 XMANSECT_FILEFORM= man4 XMANSECT_HDR= man5 XMANSECT_TABLES= man5 XMANSECT_MACROS= man5 XMANSECT_GAMES= man6 XMANSECT_DEMOS= man6 XMANSECT_DEVICE= man7 XMANSECT_NETWORK= man7 XMANSECT_ADMIN= man8 XMANSECT_DRIVER= man9 X XMANSUFF_CMD= 1 XMANSUFF_SYSCALL= 2 XMANSUFF_LIB= 3 XMANSUFF_FILEFORM= 4 XMANSUFF_HDR= 5 XMANSUFF_TABLES= 5 XMANSUFF_MACROS= 5 XMANSUFF_GAMES= 6 XMANSUFF_DEMOS= 6 XMANSUFF_DEVICE= 7 XMANSUFF_NETWORK= 7 XMANSUFF_ADMIN= 8 XMANSUFF_DRIVER= 9 END-of-star-1.6/RULES/man-sysv.def echo x - star-1.6/RULES/news4000-newsos6-cc.rul sed 's/^X//' >star-1.6/RULES/news4000-newsos6-cc.rul << 'END-of-star-1.6/RULES/news4000-newsos6-cc.rul' X#ident @(#)news4000-newsos6-cc.rul 1.6 07/05/08 X########################################################################### X# X# Platform dependent MACROS for Sony NEWS-OS 6.x X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-sony.rul X X# X# From objectx@polyphony.scei.co.jp XXX is -D__STDC__=0 correct ??? X# XOSDEFS += -D__SVR4 -DSVR4 -D__STDC__=0 X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_SOCKET= -lsocket XLIB_MATH= -lm XLIB_KVM= X XARFLAGS= crs X# X# lorder seems not to work on some machines, disable it X# XLORDER= echo XTSORT= cat END-of-star-1.6/RULES/news4000-newsos6-cc.rul echo x - star-1.6/RULES/os-aix.def sed 's/^X//' >star-1.6/RULES/os-aix.def << 'END-of-star-1.6/RULES/os-aix.def' X#ident "@(#)os-aix.def 1.3 06/05/14 " X########################################################################### X# Written 1997 by J. Schilling X########################################################################### X# X# Global os definitions for AIX X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XMANSTYLE= sysv END-of-star-1.6/RULES/os-aix.def echo x - star-1.6/RULES/os-aix.id sed 's/^X//' >star-1.6/RULES/os-aix.id << 'END-of-star-1.6/RULES/os-aix.id' X#ident "@(#)os-aix.id 1.2 06/05/14 " X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for AIX X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= aix X-O_ARCH= -$(O_ARCH) XK_ARCH= rs6000 XP_ARCH= rs6000 END-of-star-1.6/RULES/os-aix.id echo x - star-1.6/RULES/os-amigaos.def sed 's/^X//' >star-1.6/RULES/os-amigaos.def << 'END-of-star-1.6/RULES/os-amigaos.def' X#ident "@(#)os-amigaos.def 1.2 06/05/14 " X########################################################################### X# Written 2001 by J. Schilling X########################################################################### X# X# Global os definitions for AmigaOS X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XMANSTYLE= bsd END-of-star-1.6/RULES/os-amigaos.def echo x - star-1.6/RULES/os-interix.def sed 's/^X//' >star-1.6/RULES/os-interix.def << 'END-of-star-1.6/RULES/os-interix.def' X#ident "@(#)os-interix.def 1.1 06/06/29 " X########################################################################### X# Written 2006 by J. Schilling X########################################################################### X# X# Global os definitions for Interix Systems (WIN-NT with SFU) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XMANSTYLE= sysv END-of-star-1.6/RULES/os-interix.def echo x - star-1.6/RULES/os-interix.id sed 's/^X//' >star-1.6/RULES/os-interix.id << 'END-of-star-1.6/RULES/os-interix.id' X#ident "@(#)os-interix.id 1.4 07/05/29 " X########################################################################### X# Written 2006 by J. Schilling X########################################################################### X# X# Global os definitions for Interix Systems (WIN-NT with SFU) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= interix X-O_ARCH= -$(O_ARCH) X X########################################################################### X# X# In case we are unable to get the MS-WIN version that X# runs under Interix, we define NT-4.0 Service Pack 3 X# and use it as a fall-back definition. X# X########################################################################### XWINNTDEFS += -D_WIN32_WINNT=0x0403 X X########################################################################### X# X# $(MAKE_HOST_OSREL) is only defined in smake. If the macro in undefined X# -include allows to fail the "include" and use the fall-back above. X# X########################################################################### X-include $(SRCROOT)/$(RULESDIR)/os-interix-nt-$(MAKE_HOST_OSREL).id X END-of-star-1.6/RULES/os-interix.id echo x - star-1.6/RULES/x86-interix-gcc.rul sed 's/^X//' >star-1.6/RULES/x86-interix-gcc.rul << 'END-of-star-1.6/RULES/x86-interix-gcc.rul' X#ident "@(#)x86-interix-gcc.rul 1.6 18/04/11 " X########################################################################### X# Written 2006-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for Interix Systems (WIN-NT with SFU) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-gcc.rul X XOSDEFS += -D_ALL_SOURCE X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%) XLDOPTS= $(LIBS_PATH) $(LDPATH) X XLORDER= echo XTSORT= cat END-of-star-1.6/RULES/x86-interix-gcc.rul echo x - star-1.6/RULES/x86pc-qnx-gcc.rul sed 's/^X//' >star-1.6/RULES/x86pc-qnx-gcc.rul << 'END-of-star-1.6/RULES/x86pc-qnx-gcc.rul' X########################################################################### X#ident "@(#)x86pc-qnx-gcc.rul 1.8 18/04/11 " X########################################################################### X# Written 2001-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for QNX Neutrino X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-gcc.rul X XOSDEFS += X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_SOCKET= -lsocks -lrpc XLIB_MATH= -lm XLIB_KVM= X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%) XLDOPTS= $(LIBS_PATH) $(LDPATH) X XLORDER= echo XTSORT= cat END-of-star-1.6/RULES/x86pc-qnx-gcc.rul echo x - star-1.6/RULES/rules.oes sed 's/^X//' >star-1.6/RULES/rules.oes << 'END-of-star-1.6/RULES/rules.oes' X#ident "@(#)rules.oes 1.1 18/04/15 " X########################################################################### X# Written 2009-2018 by J. Schilling X########################################################################### X# X# Rules for getting the original locale environment for SunPro Make X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X# X# acgeneral.m4 claims that SCO Unix may have problems with setting LANG=C X# so we are careful not to set LANG unless it was already set by someone else X# X########################################################################### X X_LANG= $(_UNIQ)$(LANG) X__LANG= $(_LANG:$(_UNIQ)=NO_LANG) X___LANG= $(__LANG:$(_UNIQ)%=LANG) X XOLD_$(___LANG) :sh= echo $LANG XOLD_LC_ALL :sh= echo $LC_ALL XOLD_LC_COLLATE :sh= echo $LC_COLLATE XOLD_LC_CTYPE :sh= echo $LC_CTYPE XOLD_LC_MESSAGES :sh= echo $LC_MESSAGES XOLD_LC_MONETARY :sh= echo $LC_MONETARY XOLD_LC_NUMERIC :sh= echo $LC_NUMERIC XOLD_LC_TIME :sh= echo $LC_TIME X Xexport OLD_$(___LANG) Xexport OLD_LC_ALL Xexport OLD_LC_COLLATE Xexport OLD_LC_CTYPE Xexport OLD_LC_MESSAGES Xexport OLD_LC_MONETARY Xexport OLD_LC_NUMERIC Xexport OLD_LC_TIME END-of-star-1.6/RULES/rules.oes echo x - star-1.6/RULES/rules.oev sed 's/^X//' >star-1.6/RULES/rules.oev << 'END-of-star-1.6/RULES/rules.oev' X#ident "@(#)rules.oev 1.1 18/04/15 " X########################################################################### X# Written 2009-2018 by J. Schilling X########################################################################### X# X# Rules for getting the original locale environment for smake and gmake X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X# X# acgeneral.m4 claims that SCO Unix may have problems with setting LANG=C X# so we are careful not to set LANG unless it was already set by someone else X# X########################################################################### X X_LANG= $(_UNIQ)$(LANG) X__LANG= $(_LANG:$(_UNIQ)=NO_LANG) X___LANG= $(__LANG:$(_UNIQ)%=LANG) X XOLD_$(___LANG) :=$(LANG) XOLD_LC_ALL := $(LC_ALL) XOLD_LC_COLLATE := $(LC_COLLATE) XOLD_LC_CTYPE := $(LC_CTYPE) XOLD_LC_MESSAGES := $(LC_MESSAGES) XOLD_LC_MONETARY := $(LC_MONETARY) XOLD_LC_NUMERIC := $(LC_NUMERIC) XOLD_LC_TIME := $(LC_TIME) X Xexport OLD_$(___LANG) Xexport OLD_LC_ALL Xexport OLD_LC_COLLATE Xexport OLD_LC_CTYPE Xexport OLD_LC_MESSAGES Xexport OLD_LC_MONETARY Xexport OLD_LC_NUMERIC Xexport OLD_LC_TIME END-of-star-1.6/RULES/rules.oev echo x - star-1.6/RULES/i586-linux-cc.rul sed 's/^X//' >star-1.6/RULES/i586-linux-cc.rul << 'END-of-star-1.6/RULES/i586-linux-cc.rul' X#ident "@(#)i586-linux-cc.rul 1.18 18/11/07 " X########################################################################### X# Written 1996-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for Linux X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-g$(C_ARCH).rul X X# X# LINUX_SRC_INCLUDE is defined in DEFAULTS/Defaults.linux X# XINCDIRSX += $(LINUX_SRC_INCLUDE) XOSDEFS += X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X X# X# Sunpro C/C++ run on Solaris and Linux and both have linkers X# that support mapfiles X# XMAPVERS= $(_MAPVERS) # This enables to use mapfiles X# X# The GNU linker is buggy and does not like the official order in linker map X# files for symbol versioning. The following command reverses the order of X# the version names in the linker map file. X# XMAPFILE_POST= | sed 's/^SCHILY/+SCHILY/' | tr '\012' '@' | tr '+' '\012' | sort -V | tr '@' '\012' X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%) X# X# Uncomment the next line in case you are on an old Linux version that X# does not support the -R linker flag. X# X#LDOPTS= $(LIBS_PATH) $(LDPATH) XLDOPTMAP= $(PMAPVERS:%=-Wl,--version-script=%) XLDOPTDYN= -shared -Wl,-soname,$(TARGET) $(LDOPTMAP) X XLORDER= echo XTSORT= cat END-of-star-1.6/RULES/i586-linux-cc.rul echo x - star-1.6/RULES/alpha-openvms-cc.rul sed 's/^X//' >star-1.6/RULES/alpha-openvms-cc.rul << 'END-of-star-1.6/RULES/alpha-openvms-cc.rul' X#ident "@(#)alpha-openvms-cc.rul 1.1 09/10/31 " X########################################################################### X# Written 2009 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for OpenVMS using GNV X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-openvms.rul X XOSDEFS += X XKDEFINES= -DKERNEL -D_KERNEL X X#LIB_SOCKET= -lsocket -lnsl -ldl XLIB_SOCKET= XLIB_MATH= -lm X#LIB_KVM= -lkvm XLIB_KVM= X XLORDER= echo XTSORT= cat END-of-star-1.6/RULES/alpha-openvms-cc.rul echo x - star-1.6/RULES/alpha-osf1-cc.rul sed 's/^X//' >star-1.6/RULES/alpha-osf1-cc.rul << 'END-of-star-1.6/RULES/alpha-osf1-cc.rul' X#ident "@(#)alpha-osf1-cc.rul 1.7 07/05/08 " X########################################################################### X# Written 1998 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for Digital UNIX (OSF1) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-dec.rul X XOSDEFS += X XKDEFINES= -DKERNEL -D_KERNEL X X#LIB_SOCKET= -lsocket -lnsl -ldl XLIB_SOCKET= XLIB_MATH= -lm X#LIB_KVM= -lkvm XLIB_KVM= X XLORDER= echo XTSORT= cat END-of-star-1.6/RULES/alpha-osf1-cc.rul echo x - star-1.6/RULES/os-interix-nt-6.1.id sed 's/^X//' >star-1.6/RULES/os-interix-nt-6.1.id << 'END-of-star-1.6/RULES/os-interix-nt-6.1.id' X#ident "@(#)os-interix-nt-6.1.id 1.1 13/08/11 " X########################################################################### X# Written 2013 by J. Schilling X########################################################################### X# X# Global os definitions for Interix Systems (SFU) MS Windows NT-6.1 (Win 7) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XWINNTDEFS += -D_WIN32_WINNT=0x0601 END-of-star-1.6/RULES/os-interix-nt-6.1.id echo x - star-1.6/RULES/os-cygwin_nt-6.2-wow64.id sed 's/^X//' >star-1.6/RULES/os-cygwin_nt-6.2-wow64.id << 'END-of-star-1.6/RULES/os-cygwin_nt-6.2-wow64.id' X#ident "@(#)os-cygwin_nt-6.2-wow64.id 1.1 13/09/16 " X########################################################################### X# Written 2013 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for Cygnus GCC for MS Windows NT-6.2 (Win 8) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/os-cygwin32_wow64.id X XWINNTDEFS += -D_WIN32_WINNT=0x0602 END-of-star-1.6/RULES/os-cygwin_nt-6.2-wow64.id echo x - star-1.6/RULES/os-cygwin_nt-6.2.id sed 's/^X//' >star-1.6/RULES/os-cygwin_nt-6.2.id << 'END-of-star-1.6/RULES/os-cygwin_nt-6.2.id' X#ident "@(#)os-cygwin_nt-6.2.id 1.1 13/09/16 " X########################################################################### X# Written 2013 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for Cygnus GCC for MS Windows NT-6.2 (Win 8) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/os-cygwin32_nt.id X XWINNTDEFS += -D_WIN32_WINNT=0x0602 END-of-star-1.6/RULES/os-cygwin_nt-6.2.id echo x - star-1.6/RULES/os-mingw32_nt-6.1.id sed 's/^X//' >star-1.6/RULES/os-mingw32_nt-6.1.id << 'END-of-star-1.6/RULES/os-mingw32_nt-6.1.id' X#ident "@(#)os-mingw32_nt-6.1.id 1.1 15/12/09 " X########################################################################### X# X# OS specific MACRO definitions for Win32/Mingw32 X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= mingw32_nt X-O_ARCH= -$(O_ARCH) END-of-star-1.6/RULES/os-mingw32_nt-6.1.id echo x - star-1.6/RULES/rules.lib sed 's/^X//' >star-1.6/RULES/rules.lib << 'END-of-star-1.6/RULES/rules.lib' X#ident "@(#)rules.lib 1.13 18/08/14 " X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# Rules for traditional libraries (libxxx.a) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.obj X########################################################################### XTARGET= $(LIB_PREFIX)$(TARGETLIB)$(LIB_SUFFIX) XTARGET_PATH= $(OLIBSDIR) XPTARGET= $(OLIBSDIR)/$(TARGET) X X_INSMODEI= $(_UNIQ)$(INSMODE) X__INSMODEI= $(_INSMODEI:$(_UNIQ)=$(INSMODEF)) XINSMODEI= $(__INSMODEI:$(_UNIQ)%=%) X X__AR.o= $(_UNIQ)$(AR.o) X___AR.o= $(__AR.o:$(_UNIQ)=$(AR) $(ARFLAGS) $@) X_AR.o= $(___AR.o:$(_UNIQ)%=%) X Xall: $(TARGET_PATH) $(PTARGET) $(MAN) X X$(TARGET_PATH): X $(MKDIR) -p $@ X X$(PTARGET): $(OFILES) X $(_AR.o) `$(LORDER) $(POFILES) | $(TSORT)` X $(RANLIB) $@ X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/sub.htm Xinclude $(SRCROOT)/$(RULESDIR)/rules.lnt Xinclude $(SRCROOT)/$(RULESDIR)/rules.clr Xinclude $(SRCROOT)/$(RULESDIR)/rules.ins Xinclude $(SRCROOT)/$(RULESDIR)/rules.tag Xinclude $(SRCROOT)/$(RULESDIR)/rules.hlp Xinclude $(SRCROOT)/$(RULESDIR)/rules.dep Xinclude $(SRCROOT)/$(RULESDIR)/rules.cst X########################################################################### END-of-star-1.6/RULES/rules.lib echo x - star-1.6/RULES/dynamic.lnk sed 's/^X//' >star-1.6/RULES/dynamic.lnk << 'END-of-star-1.6/RULES/dynamic.lnk' X#ident @(#)dynamic.lnk 1.1 06/07/20 X########################################################################### X# Written 2006 by J. Schilling X########################################################################### X# X# Rules for commands that are links dynamically against internal libs X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XSHLDIR= /pic XNO_SHL= END-of-star-1.6/RULES/dynamic.lnk echo x - star-1.6/RULES/static.lnk sed 's/^X//' >star-1.6/RULES/static.lnk << 'END-of-star-1.6/RULES/static.lnk' X#ident @(#)static.lnk 1.1 06/07/20 X########################################################################### X# Written 2006 by J. Schilling X########################################################################### X# X# Rules for commands that are links statically against internal libs X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XSHLDIR= XNO_SHL= no END-of-star-1.6/RULES/static.lnk echo x - star-1.6/RULES/rules.dyn sed 's/^X//' >star-1.6/RULES/rules.dyn << 'END-of-star-1.6/RULES/rules.dyn' X#ident @(#)rules.dyn 1.1 06/07/20 X########################################################################### X# Written 2006 by J. Schilling X########################################################################### X# X# Rules for dynamic vs. static linking against internal libs X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X_DEFLNKMODE= $(_UNIQ)$(DEFLINKMODE) X__DEFLNKMODE= $(_DEFLNKMODE:$(_UNIQ)=static) XDEFLNKMODE= $(__DEFLNKMODE:$(_UNIQ)%=%) X_LNKMODE= $(_UNIQ)$(LINKMODE) X__LNKMODE= $(_LNKMODE:$(_UNIQ)=$(DEFLNKMODE)) XLNKMODE= $(__LNKMODE:$(_UNIQ)%=%) X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/$(LNKMODE).lnk END-of-star-1.6/RULES/rules.dyn echo x - star-1.6/RULES/rules.cpl sed 's/^X//' >star-1.6/RULES/rules.cpl << 'END-of-star-1.6/RULES/rules.cpl' X#ident "@(#)rules.cpl 1.1 06/07/21 " X########################################################################### X# Written 2006 by J. Schilling X########################################################################### X# X# Rules for C++ projects X# X# Cannot use the file name rules.c++ on some OS. X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XLDCC= $(LDCC++) XDYNLD= $(DYNLDC++) END-of-star-1.6/RULES/rules.cpl echo x - star-1.6/RULES/os-cygwin_nt-5.2.id sed 's/^X//' >star-1.6/RULES/os-cygwin_nt-5.2.id << 'END-of-star-1.6/RULES/os-cygwin_nt-5.2.id' X#ident "@(#)os-cygwin_nt-5.2.id 1.4 07/05/29 " X########################################################################### X# Written 2006 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for Cygnus GCC for MS Windows NT-5.2 (Server 2003) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/os-cygwin32_nt.id X XWINNTDEFS += -D_WIN32_WINNT=0x0502 END-of-star-1.6/RULES/os-cygwin_nt-5.2.id echo x - star-1.6/RULES/os-interix-nt-4.0.id sed 's/^X//' >star-1.6/RULES/os-interix-nt-4.0.id << 'END-of-star-1.6/RULES/os-interix-nt-4.0.id' X#ident "@(#)os-interix-nt-4.0.id 1.3 07/05/29 " X########################################################################### X# Written 2007 by J. Schilling X########################################################################### X# X# Global os definitions for Interix Systems (SFU) MS Windows NT-4.0 (NT-4.0) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XWINNTDEFS += -D_WIN32_WINNT=0x0400 END-of-star-1.6/RULES/os-interix-nt-4.0.id echo x - star-1.6/RULES/os-interix-nt-5.0.id sed 's/^X//' >star-1.6/RULES/os-interix-nt-5.0.id << 'END-of-star-1.6/RULES/os-interix-nt-5.0.id' X#ident "@(#)os-interix-nt-5.0.id 1.3 07/05/29 " X########################################################################### X# Written 2007 by J. Schilling X########################################################################### X# X# Global os definitions for Interix Systems (SFU) MS Windows NT-5.0 (WIN2000) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XWINNTDEFS += -D_WIN32_WINNT=0x0500 END-of-star-1.6/RULES/os-interix-nt-5.0.id echo x - star-1.6/RULES/os-interix-nt-5.1.id sed 's/^X//' >star-1.6/RULES/os-interix-nt-5.1.id << 'END-of-star-1.6/RULES/os-interix-nt-5.1.id' X#ident "@(#)os-interix-nt-5.1.id 1.3 07/05/29 " X########################################################################### X# Written 2007 by J. Schilling X########################################################################### X# X# Global os definitions for Interix Systems (SFU) MS Windows NT-5.1 (XP) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XWINNTDEFS += -D_WIN32_WINNT=0x0501 END-of-star-1.6/RULES/os-interix-nt-5.1.id echo x - star-1.6/RULES/os-interix-nt-5.2.id sed 's/^X//' >star-1.6/RULES/os-interix-nt-5.2.id << 'END-of-star-1.6/RULES/os-interix-nt-5.2.id' X#ident "@(#)os-interix-nt-5.2.id 1.3 07/05/29 " X########################################################################### X# Written 2007 by J. Schilling X########################################################################### X# X# Global os definitions for Interix Systems (SFU) MS Windows NT-5.2 (Server 2003) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XWINNTDEFS += -D_WIN32_WINNT=0x0502 END-of-star-1.6/RULES/os-interix-nt-5.2.id echo x - star-1.6/RULES/i586-linux-suncc.rul sed 's/^X//' >star-1.6/RULES/i586-linux-suncc.rul << 'END-of-star-1.6/RULES/i586-linux-suncc.rul' X#ident "@(#)i586-linux-suncc.rul 1.7 18/04/11 " X########################################################################### X# Written 2007-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for Linux using Sun Studio X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-$(C_ARCH:cc%=sunpro%).rul XCC_COM_DEF= suncc XCC++_COM_DEF= sunCC X X# X# LINUX_SRC_INCLUDE is defined in DEFAULTS/Defaults.linux X# XINCDIRSX += $(LINUX_SRC_INCLUDE) XOSDEFS += X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%) X# X# Uncomment the next line in case you are on an old Linux version that X# does not support the -R linker flag. X# X#LDOPTS= $(LIBS_PATH) $(LDPATH) X XLDOPTDYN= -dy -G -Wl,-shared -Wl,-soname,$(TARGET) X XLORDER= echo XTSORT= cat END-of-star-1.6/RULES/i586-linux-suncc.rul echo x - star-1.6/RULES/i86pc-sunos5-pcc.rul sed 's/^X//' >star-1.6/RULES/i86pc-sunos5-pcc.rul << 'END-of-star-1.6/RULES/i86pc-sunos5-pcc.rul' X#ident "@(#)i86pc-sunos5-pcc.rul 1.3 13/01/09 " X########################################################################### X# Written 2010-2013 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for SunOS 5.x for PC X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-pcc.rul X XOSDEFS += -D__SVR4 -DSVR4 XKDEFINES= -DKERNEL -D_KERNEL X XLIB_SOCKET= -lsocket -lnsl -ldl XLIB_MATH= -lm XLIB_KVM= -lkvm -lelf XLIB_VOLMGT= -lvolmgt X X# X# Solaris comes with a linker that supports mapfiles X# XMAPVERS= $(_MAPVERS) # This enables to use mapfiles X XLDOPTDYN= -dy -G -Wl,-ztext -h $(TARGET) $(PMAPVERS:%=-Wl,-M%) -ldl X XARFLAGS= crs END-of-star-1.6/RULES/i86pc-sunos5-pcc.rul echo x - star-1.6/RULES/i486-mingw32_nt-gcc.rul sed 's/^X//' >star-1.6/RULES/i486-mingw32_nt-gcc.rul << 'END-of-star-1.6/RULES/i486-mingw32_nt-gcc.rul' X#ident "@(#)i486-mingw32_nt-gcc.rul 1.13 18/04/11 " X########################################################################### X# X# Platform dependent MACROS for Win32/Mingw32 X# X########################################################################### X# Copyright (c) 2004-2018 J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-gcc.rul X XOSDEFS += XCPPOPTS= -I/MinGW/Include -I$(ARCHDIR) -I$(OINCSDIR) $(INCDIRS:%=-I%) $(INCDIRSX:%=-I%) X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X XWIN_LIBS= $(WIN32_LIBS) X XLDLIBS= $(LIBS) $(LIBX) $(WIN_LIBS) -lmingw32 X XLDOPTS= $(LIBS_PATH) $(LDPATH) X XLORDER= echo XTSORT= cat X X_MKDIR= $(_MKDIR_SH) XMKDIR= $(MKDIR_SH) XINSMKDIR= $(INSMKDIR_SH) END-of-star-1.6/RULES/i486-mingw32_nt-gcc.rul echo x - star-1.6/RULES/rules.pkg sed 's/^X//' >star-1.6/RULES/rules.pkg << 'END-of-star-1.6/RULES/rules.pkg' X#ident "@(#)rules.pkg 1.6 17/08/04 " X########################################################################### X# Written 2005 by J. Schilling X########################################################################### X# X# Rules for creating binary tar packages X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X X########################################################################### X# If we are included before rules.dir, this will stop to propagate X# the targets "pkg1" & "pkg" to sub makes but handle packaging at this X# directory bundling level. X########################################################################### XPKGTARGETS= X XPROTODIR= proto/$(OARCH) X$(PROTODIR): X $(MKDIR) -p $@ X X_TARGETAR= $(TARGET_AR:%=$(OTARSDIR)/%) X__TARGETAR= $(_UNIQ)$(_TARGETAR) X___TARGETAR= $(__TARGETAR:$(_UNIQ)=$(PROTODIR)) XTARGETAR= $(___TARGETAR:$(_UNIQ)%=%) X X_MCS_PROJECT= $(_UNIQ)$(PROJECTNAME) X__MCS_PROJECT= $(_MCS_PROJECT:$(_UNIQ)=SPS-Generic) XMCS_PROJECTNAME= $(__MCS_PROJECT:$(_UNIQ)%=%) X Xta: X echo "'$(TARGETAR)'" X echo "'$(TARGETAR).tar'" X Xpkg: $(PROTODIR) pkg1 package X Xpkg1: X rm -rf $(PROTODIR) X mkdir -p $(PROTODIR) $(PROTODIR)/$(INSBASE)/bin $(PROTODIR)/$(INSBASE)/sbin $(PROTODIR)/$(INSBASE)/etc \ X $(PROTODIR)/$(INSBASE)/lib $(PROTODIR)/$(INSBASE)/share/man X ln -s share/man $(PROTODIR)/$(INSBASE)/man X if [ ."$(PRE_INST_CMDS)" != . ]; then cd $(PROTODIR) && eval "$(PRE_INST_CMDS)" ; fi X "$(MAKE)" $(MAKE_FILE) DESTDIR=`pwd`/$(PROTODIR) install X if [ ."$(POST_INST_CMDS)" != . ]; then cd $(PROTODIR) && eval "$(POST_INST_CMDS)" ; fi X -if [ ."$(STRIPLIST)" != . ]; then chmod u+w $(STRIPLIST:%=$(PROTODIR)/%); strip $(STRIPLIST:%=$(PROTODIR)/%); fi X -if [ ."$(STRIPXLIST)" != . ]; then chmod u+w $(STRIPXLIST:%=$(PROTODIR)/%); strip -x $(STRIPXLIST:%=$(PROTODIR)/%); fi X -if [ ."$(MCSLIST)" != . ]; then chmod u+w $(MCSLIST:%=$(PROTODIR)/%); mcs -d -a "$(MCS_PROJECTNAME)" $(MCSLIST:%=$(PROTODIR)/%); fi X if [ ."$(POST_STRIP_CMDS)" != . ]; then cd $(PROTODIR) && eval "$(POST_STRIP_CMDS)" ; fi X ##find $(PROTODIR) -print | sort > /tmp/so.$$; diff filelist /tmp/so.$$; rm -f /tmp/so.$$ X #echo 'i pkginfo' > SV-pkglist X #echo 'i depend' >> SV-pkglist X #echo 'i copyright' >> SV-pkglist X X #cd $(PROTODIR); find . -print | sort | pkgproto | sed 's/joerg bs/root bin/' >> ../../SV-pkglist X X_PKGDEF_DIR= $(_UNIQ)$(PKGTYPE) X__PKGDEF_DIR= $(_PKGDEF_DIR:$(_UNIQ)=default) XPKGDEF_DIR= $(__PKGDEF_DIR:$(_UNIQ)%=%) X Xpackage: X echo PKGDEF_DIR $(PKGDEF_DIR) X echo DIRNAME: $(DIRNAME) CURDIR: $(CURDIR) X #pkgmk -o -b `pwd`/$(PROTODIR)/ -d `pwd`/PKGS -f SV-pkglist X #star -C $(PROTODIR)/ pkglist=pkglist -cP > $(TARGETAR).tar X #bzip2 -9f $(TARGETAR).tar X #rm -rf $(PROTODIR) X X @list=""; \ X if [ -d $(SRCROOT)/pkgdefs/$(PKGDEF_DIR) ]; then \ X list=`echo $(SRCROOT)/pkgdefs/$(PKGDEF_DIR)/*` ; \ X fi; \ X for DIR in $${list} ; \ X do \ X ( \ X echo " ==> MAKING \"$@\" ON SUBDIRECTORY \"$(CURDIR)/$$DIR\"";\ X if [ -d ./$$DIR -a -r ./$$DIR/Makefile ] ; then \ X cd ./$$DIR && "$(MAKE)" $(MAKEMACS) XARCH=$(XARCH) DIRNAME=$(CURDIR)/$$DIR all; \ X else \ X echo "NOTICE: Partial source ($(CURDIR)/$$DIR) missing";\ X fi \ X ); \ X done END-of-star-1.6/RULES/rules.pkg echo x - star-1.6/RULES/rules.tpk sed 's/^X//' >star-1.6/RULES/rules.tpk << 'END-of-star-1.6/RULES/rules.tpk' X#ident "@(#)rules.tpk 1.8 17/08/04 " X########################################################################### X# Written 2005 by J. Schilling X########################################################################### X# X# Rules for creating binary tar packages X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X X########################################################################### X# If we are included before rules.dir, this will stop to propagate X# the targets tarpkg1 & tarpkg to sub makes but handle packaging at this X# directory bundling level. X########################################################################### XPKGTARGETS= X XOTARSDIR= $(SRCROOTSL)tars/$(OARCH) X$(OTARSDIR): X $(MKDIR) -p $@ X X X_TARGETAR= $(TARGET_AR:%=$(OTARSDIR)/%) X__TARGETAR= $(_UNIQ)$(_TARGETAR) X___TARGETAR= $(__TARGETAR:$(_UNIQ)=tarpkg) XTARGETAR= $(___TARGETAR:$(_UNIQ)%=%) X X_MCS_PROJECT= $(_UNIQ)$(PROJECTNAME) X__MCS_PROJECT= $(_MCS_PROJECT:$(_UNIQ)=SPS-Generic) XMCS_PROJECTNAME= $(__MCS_PROJECT:$(_UNIQ)%=%) X Xta: X echo "'$(TARGETAR)'" X echo "'$(TARGETAR).tar'" X Xtarpkg: $(OTARSDIR) tarpkg0 tarpkg1 tarpkg2 X Xtarpkg0: X rm -rf tarpkg X Xtarpkg1: X mkdir -p tarpkg tarpkg/$(INSBASE)/bin tarpkg/$(INSBASE)/sbin tarpkg/$(INSBASE)/etc \ X tarpkg/$(INSBASE)/lib tarpkg/$(INSBASE)/share/man X ln -s share/man tarpkg/$(INSBASE)/man X if [ ."$(PRE_INST_CMDS)" != . ]; then cd tarpkg && eval "$(PRE_INST_CMDS)" ; fi X "$(MAKE)" $(MAKE_FILE) $(MAKEMACS) DESTDIR=`pwd`/tarpkg install X if [ ."$(POST_INST_CMDS)" != . ]; then cd tarpkg && eval "$(POST_INST_CMDS)" ; fi X -if [ ."$(STRIPLIST)" != . ]; then chmod u+w $(STRIPLIST:%=tarpkg/%); strip $(STRIPLIST:%=tarpkg/%); fi X -if [ ."$(STRIPXLIST)" != . ]; then chmod u+w $(STRIPXLIST:%=tarpkg/%); strip -x $(STRIPXLIST:%=tarpkg/%); fi X -if [ ."$(MCSLIST)" != . ]; then chmod u+w $(MCSLIST:%=tarpkg/%); mcs -d -a "$(MCS_PROJECTNAME)" $(MCSLIST:%=tarpkg/%); fi X if [ ."$(POST_STRIP_CMDS)" != . ]; then cd tarpkg && eval "$(POST_STRIP_CMDS)" ; fi X find tarpkg -print | sort > /tmp/so.$$$$; diff filelist /tmp/so.$$$$; rm -f /tmp/so.$$$$ X Xtarpkg2: X star -C tarpkg/ pkglist=pkglist -cP > $(TARGETAR).tar X bzip2 -9f $(TARGETAR).tar X rm -rf tarpkg END-of-star-1.6/RULES/rules.tpk echo x - star-1.6/RULES/os-osf1.def sed 's/^X//' >star-1.6/RULES/os-osf1.def << 'END-of-star-1.6/RULES/os-osf1.def' X#ident "@(#)os-osf1.def 1.2 06/05/14 " X########################################################################### X# Written 1998 by J. Schilling X########################################################################### X# X# Global os definitions for Digital UNIX (OSF1) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XMANSTYLE= bsd END-of-star-1.6/RULES/os-osf1.def echo x - star-1.6/RULES/i386-at386-gnu-gcc.rul sed 's/^X//' >star-1.6/RULES/i386-at386-gnu-gcc.rul << 'END-of-star-1.6/RULES/i386-at386-gnu-gcc.rul' X#ident "@(#)i386-at386-gnu-gcc.rul 1.8 18/04/11 " X########################################################################### X# Written 1996-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for GNU (hurd) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-gcc.rul X XOSDEFS += X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%) XLDOPTS= $(LIBS_PATH) $(LDPATH) X XLORDER= echo XTSORT= cat END-of-star-1.6/RULES/i386-at386-gnu-gcc.rul echo x - star-1.6/RULES/os-osf1.id sed 's/^X//' >star-1.6/RULES/os-osf1.id << 'END-of-star-1.6/RULES/os-osf1.id' X#ident "@(#)os-osf1.id 1.2 06/05/14 " X########################################################################### X# Written 1998 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for Digital UNIX (OSF1) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= osf1 X-O_ARCH= -$(O_ARCH) END-of-star-1.6/RULES/os-osf1.id echo x - star-1.6/RULES/i586-mingw32_nt-gcc.rul sed 's/^X//' >star-1.6/RULES/i586-mingw32_nt-gcc.rul << 'END-of-star-1.6/RULES/i586-mingw32_nt-gcc.rul' X#ident "@(#)i586-mingw32_nt-gcc.rul 1.13 18/04/11 " X########################################################################### X# X# Platform dependent MACROS for Win32/Mingw32 X# X########################################################################### X# Copyright (c) 2004-2018 J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-gcc.rul X XOSDEFS += XCPPOPTS= -I/MinGW/Include -I$(ARCHDIR) -I$(OINCSDIR) $(INCDIRS:%=-I%) $(INCDIRSX:%=-I%) X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X XWIN_LIBS= $(WIN32_LIBS) X XLDLIBS= $(LIBS) $(LIBX) $(WIN_LIBS) -lmingw32 X XLDOPTS= $(LIBS_PATH) $(LDPATH) X XLORDER= echo XTSORT= cat X X_MKDIR= $(_MKDIR_SH) XMKDIR= $(MKDIR_SH) XINSMKDIR= $(INSMKDIR_SH) END-of-star-1.6/RULES/i586-mingw32_nt-gcc.rul echo x - star-1.6/RULES/cc-openvms.rul sed 's/^X//' >star-1.6/RULES/cc-openvms.rul << 'END-of-star-1.6/RULES/cc-openvms.rul' X#ident "@(#)cc-openvms.rul 1.15 18/08/16 " X########################################################################### X# Written 1998-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for GNV OpenVMS cc X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X XCPP_FLAGS= -DSCHILY_BUILD $(CPPOPTS) $(CPPOPTX) $(OSINCDIRS:%=-I%) $(OSDEFS) $(OSDEFSX) XC_FLAGS= $(COPTS) $(CWARNOPTS) $(COPTOPT) $(DECCOPTOPT) $(COPTX) XC++FLAGS= $(C++OPTS) $(C++WARNOPTS) $(C++OPTOPT) $(DECC++OPTOPT) $(C++OPTX) X XCPPOPTS= -I$(ARCHDIR) -I$(OINCSDIR) $(INCDIRS:%=-I%) $(INCDIRSX:%=-I%) XCOPTS= XCWOPTS= -verbose XCOPTOPT= -O XCOPTDYN= -fpic XCOPTGPROF= -pg XC++OPTS= XC++WOPTS= X#C++OPTOPT= -O X#C++OPTDYN= -Kpic X#C++OPTGPROF= -xpg X XLIB_PREFIX= XLIB_SUFFIX= .olb XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_C= -lc X XLIBS_PATH= -L$(OLIBSDIR) -L/usr/ccs/lib XLIBS_PATH_STATIC= -L$(OLIBSDIR_STATIC) X XLDFLAGS= $(LDOPTS) $(LDOPTX) XLDLIBS= $(LIBS) $(LIBX) X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH) XLDOPTS= $(LIBS_PATH) $(LDPATH) XLDOPTDYN= -shared -Wl,-soname,$(TARGET) XLNDYNLIB= @$(RM) $(RM_FORCE) $(PTARGET_BASE).so; $(SYMLINK) $(TARGET) $(PTARGET_BASE).so X XFLOAT_OPTIONS= X X__CC_COM= $(_UNIQ)$(CC) X___CC_COM= $(__CC_COM:$(_UNIQ)=$(CC_COM_DEF)) XCC_COM= $(___CC_COM:$(_UNIQ)%=%) X X__CC++_COM= $(_UNIQ)$(CCC) X___CC++_COM= $(__CC++_COM:$(_UNIQ)=$(CC++_COM_DEF)) XCC++_COM= $(___CC++_COM:$(_UNIQ)%=%) X XCC_COM_DEF= cc XCC++_COM_DEF= echo "C++ not yet supported"; exit -1; : X# X# Use to comment out C++ projects X# XC++BUILD= $(NUMBER_SIGN) X XCC= $(CC_COM_DEF) XCCC= $(CC++_COM_DEF) X XCCCC= @echo " ==> COMPILING \"$@\""; $(CC_COM) XLDCC= @echo " ==> LINKING \"$@\""; $(CC_COM) XDYNLD= @echo " ==> LINKING dynamic library \"$@\""; $(CC_COM) X XRMDEP= : X# cc -M t.c creates a file t.mms wich t.obj : /EISNER$DRA3/decuserve_user/schilling/t.c lines X#MKDEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); $(CC_COM) -M XMKDEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); echo "Cannot yet do -M with OpenVMS cc"; : XMKDEP_OUT= X XCC++ = @echo " ==> COMPILING \"$@\""; $(CC++_COM) XLDCC++ = @echo " ==> LINKING \"$@\""; $(CC++_COM) XDYNLDC++ = @echo " ==> LINKING dynamic library \"$@\""; $(CC++_COM) X#MKC++DEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); $(CC++_COM) -M XMKC++DEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); $(CC++_COM); echo "Cannot yet do -M with OpenVMS CC"; : XMKC++DEP_OUT= END-of-star-1.6/RULES/cc-openvms.rul echo x - star-1.6/RULES/cc-pcc.rul sed 's/^X//' >star-1.6/RULES/cc-pcc.rul << 'END-of-star-1.6/RULES/cc-pcc.rul' X#ident "@(#)cc-pcc.rul 1.11 18/08/16 " X########################################################################### X# Written 2010-2018 by J. Schilling X########################################################################### X# X# Platform independent MACROS for PCC X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X XCPP_FLAGS= -DSCHILY_BUILD $(CPPOPTS) $(CPPOPTX) $(OSINCDIRS:%=-I%) $(OSDEFS) $(OSDEFSX) XC_FLAGS= $(COPTS) $(CWARNOPTS) $(COPTOPT) $(GCCOPTOPT) $(COPTX) XC++FLAGS= $(C++OPTS) $(C++WARNOPTS) $(C++OPTOPT) $(G++OPTOPT) $(C++OPTX) X XCPPOPTS= -I$(ARCHDIR) -I$(OINCSDIR) $(INCDIRS:%=-I%) $(INCDIRSX:%=-I%) XCOPTS= X# -Wtraditional now causes more pain than it helps X#*CWOPTS= -Wall -Wtraditional X#*CWOPTS= -Wall -Wno-unknown-pragmas \ X#* -Wshadow -Wmissing-prototypes -Wstrict-prototypes XCOPTOPT= -O XCOPTDYN= -fpic XCOPTGPROF= -pg XC++OPTS= XC++WOPTS= $(CWOPTS) XC++OPTOPT= $(COPTOPT) XC++OPTDYN= -fpic XC++OPTGPROF= -pg X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR) X XLIB_C= -lc X XLIBS_PATH= -L$(OLIBSDIR) XLIBS_PATH_STATIC= -L$(OLIBSDIR_STATIC) X XLDFLAGS= $(LDOPTS) $(LDOPTX) XLDLIBS= $(LIBS) $(LIBX) X XLDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%) XLDOPTDYN= -shared -Wl,-soname,$(TARGET) XLNDYNLIB= @$(RM) $(RM_FORCE) $(PTARGET_BASE).so; $(SYMLINK) $(TARGET) $(PTARGET_BASE).so X XFLOAT_OPTIONS= X X__CC_COM= $(_UNIQ)$(CC) X___CC_COM= $(__CC_COM:$(_UNIQ)=$(CC_COM_DEF)) XCC_COM= $(___CC_COM:$(_UNIQ)%=%) X X__CC++_COM= $(_UNIQ)$(CCC) X___CC++_COM= $(__CC++_COM:$(_UNIQ)=$(CC++_COM_DEF)) XCC++_COM= $(___CC++_COM:$(_UNIQ)%=%) X XCC_COM_DEF= pcc XCC++_COM_DEF= p++ XCC= $(CC_COM_DEF) XCCC= $(CC++_COM_DEF) X XCCCC= @echo " ==> COMPILING \"$@\""; $(CC_COM) XCC++ = @echo " ==> COMPILING \"$@\""; $(CC++_COM) XLDCC= @echo " ==> LINKING \"$@\""; $(CC_COM) XLDCC++ = @echo " ==> LINKING \"$@\""; $(CC++_COM) XDYNLD= @echo " ==> LINKING dynamic library \"$@\""; $(CC_COM) XDYNLDC++ = @echo " ==> LINKING dynamic library \"$@\""; $(CC++_COM) X XRMDEP= : XMKDEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); $(CC_COM) -M XMKDEP_OUT= XMKC++DEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); $(CC++_COM) -M XMKC++DEP_OUT= END-of-star-1.6/RULES/cc-pcc.rul echo x - star-1.6/RULES/atarist-freemint-gcc.rul sed 's/^X//' >star-1.6/RULES/atarist-freemint-gcc.rul << 'END-of-star-1.6/RULES/atarist-freemint-gcc.rul' X#ident @(#)atarist-freemint-gcc.rul 1.4 08/11/14 X########################################################################### X# Written 2008 by Y. Doyeux X########################################################################### X# X# Platform dependent MACROS for FreeMiNT on ATARI computers X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-gcc.rul X XOSDEFS += -DNO_USER_XCVT X XKDEFINES= -DKERNEL -D_KERNEL X X#COPTDYN= -fpic XCOPTDYN= X XLIB_PREFIX= lib XLIB_SUFFIX= .a X#SHL_SUFFIX= .so.1.0 XSHL_SUFFIX= X XLIB_SOCKET= -lsocket XLIB_MATH= -lm XLIB_KVM= X X_STACKSIZE= $(_UNIQ)$(STACKSIZE) X__STACKSIZE= $(_STACKSIZE:$(_UNIQ)=0x10000) # Default stack size 64kB XSTACK_SIZE= $(__STACKSIZE:$(_UNIQ)%=%) X XLDLIBS= $(LIBS) $(LIBX) && stack -S $(STACK_SIZE) $@ # Hack to set stack size X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%) XLDOPTS= $(LIBS_PATH) $(LDPATH) X#LDOPTDYN= -shared -Wl,-soname,$(TARGET) X#LNDYNLIB= @$(RM) $(RM_FORCE) $(PTARGET_BASE).so; $(SYMLINK) $(TARGET) $(PTARGET_BASE).so XLDOPTDYN= XLNDYNLIB= X X# X# ranlib does not work and is not needed X# X#RANLIB= @echo " ==> RANDOMIZING ARCHIVE \"$@\""; ranlib X XLORDER= echo END-of-star-1.6/RULES/atarist-freemint-gcc.rul echo x - star-1.6/RULES/i586-syllable-cc.rul sed 's/^X//' >star-1.6/RULES/i586-syllable-cc.rul << 'END-of-star-1.6/RULES/i586-syllable-cc.rul' X#ident "@(#)i586-syllable-cc.rul 1.4 18/04/11 " X########################################################################### X# Written 1996-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for Syllable X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-gcc.rul X XOSDEFS += X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%) X# X# Uncomment the next line in case you are on an old Linker version that X# does not support the -R linker flag. X# X#LDOPTS= $(LIBS_PATH) $(LDPATH) X XLORDER= echo XTSORT= cat X X# X# The current developement system has these files in /bin X# X#LN= /usr/indexes/bin/ln X#SYMLINK= /usr/indexes/bin/ln -s X#RM= /usr/indexes/bin/rm X#MV= /usr/indexes/bin/mv END-of-star-1.6/RULES/i586-syllable-cc.rul echo x - star-1.6/RULES/i586-syllable-gcc.rul sed 's/^X//' >star-1.6/RULES/i586-syllable-gcc.rul << 'END-of-star-1.6/RULES/i586-syllable-gcc.rul' X#ident "@(#)i586-syllable-gcc.rul 1.4 18/04/11 " X########################################################################### X# Written 1996-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for Syllable X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-gcc.rul X XOSDEFS += X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%) X# X# Uncomment the next line in case you are on an old Linker version that X# does not support the -R linker flag. X# X#LDOPTS= $(LIBS_PATH) $(LDPATH) X XLORDER= echo XTSORT= cat X X# X# The current developement system has these files in /bin X# X#LN= /usr/indexes/bin/ln X#SYMLINK= /usr/indexes/bin/ln -s X#RM= /usr/indexes/bin/rm X#MV= /usr/indexes/bin/mv END-of-star-1.6/RULES/i586-syllable-gcc.rul echo x - star-1.6/RULES/os-syllable.def sed 's/^X//' >star-1.6/RULES/os-syllable.def << 'END-of-star-1.6/RULES/os-syllable.def' X#ident "@(#)os-syllable.def 1.1 09/02/01 " X########################################################################### X# Written 2009 by J. Schilling X########################################################################### X# X# Global os definitions for Syllable X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XMANSTYLE= bsd END-of-star-1.6/RULES/os-syllable.def echo x - star-1.6/RULES/os-syllable.id sed 's/^X//' >star-1.6/RULES/os-syllable.id << 'END-of-star-1.6/RULES/os-syllable.id' X#ident "@(#)os-syllable.id 1.1 09/02/01 " X########################################################################### X# Written 2009 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for Syllable X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= syllable X-O_ARCH= -$(O_ARCH) END-of-star-1.6/RULES/os-syllable.id echo x - star-1.6/RULES/os-linux.id sed 's/^X//' >star-1.6/RULES/os-linux.id << 'END-of-star-1.6/RULES/os-linux.id' X#ident "@(#)os-linux.id 1.2 06/05/14 " X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for Linux X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= linux X-O_ARCH= -$(O_ARCH) END-of-star-1.6/RULES/os-linux.id echo x - star-1.6/RULES/bepc-haiku-cc.rul sed 's/^X//' >star-1.6/RULES/bepc-haiku-cc.rul << 'END-of-star-1.6/RULES/bepc-haiku-cc.rul' X#ident "@(#)bepc-haiku-cc.rul 1.7 18/04/11 " X########################################################################### X# Written 1996-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for Haiku, a BeOS like OS X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-g$(C_ARCH).rul X X# X# XXX Old BeOS needs libroot.so to get [efg]cvt() X# XXX New BeOS seems to have this in libc and in addition we include X# XXX strtod.c for floating point conversion on OS without such code. X# XXX For this reason, -DNO_FLOATINGPOINT -DUSE_FLOATINGARGS has been X# XXX removed and printing floating numbers will work with old/new BeOS X# X#OSDEFS += -DNO_FLOATINGPOINT -DUSE_FLOATINGARGS XOSDEFS += X XKDEFINES= -DKERNEL -D_KERNEL X X#CONFFLAGS= i586 X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_C= X X#LIB_SOCKET= -lsocket -lbind XLIB_SOCKET= -lnetwork XLIB_MATH= XLIB_KVM= X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%) XLDOPTS= $(LIBS_PATH) $(LDPATH) X XLORDER= echo XTSORT= cat X XLN= /bin/ln -s END-of-star-1.6/RULES/bepc-haiku-cc.rul echo x - star-1.6/RULES/bepc-haiku-gcc.rul sed 's/^X//' >star-1.6/RULES/bepc-haiku-gcc.rul << 'END-of-star-1.6/RULES/bepc-haiku-gcc.rul' X#ident "@(#)bepc-haiku-gcc.rul 1.7 18/04/11 " X########################################################################### X# Written 1996-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for Haiku, a BeOS like OS X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-$(C_ARCH).rul X X# X# XXX Old BeOS needs libroot.so to get [efg]cvt() X# XXX New BeOS seems to have this in libc and in addition we include X# XXX strtod.c for floating point conversion on OS without such code. X# XXX For this reason, -DNO_FLOATINGPOINT -DUSE_FLOATINGARGS has been X# XXX removed and printing floating numbers will work with old/new BeOS X# X#OSDEFS += -DNO_FLOATINGPOINT -DUSE_FLOATINGARGS XOSDEFS += X XKDEFINES= -DKERNEL -D_KERNEL X X#CONFFLAGS= i586 X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_C= X X#LIB_SOCKET= -lsocket -lbind XLIB_SOCKET= -lnetwork XLIB_MATH= XLIB_KVM= X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%) XLDOPTS= $(LIBS_PATH) $(LDPATH) X XLORDER= echo XTSORT= cat X XLN= /bin/ln -s END-of-star-1.6/RULES/bepc-haiku-gcc.rul echo x - star-1.6/RULES/os-haiku.def sed 's/^X//' >star-1.6/RULES/os-haiku.def << 'END-of-star-1.6/RULES/os-haiku.def' X#ident "@(#)os-haiku.def 1.1 09/02/03 " X########################################################################### X# Written 1997 by J. Schilling X########################################################################### X# X# Global os definitions for Haiku, a BeOS like OS X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XMANSTYLE= bsd END-of-star-1.6/RULES/os-haiku.def echo x - star-1.6/RULES/rules1.top sed 's/^X//' >star-1.6/RULES/rules1.top << 'END-of-star-1.6/RULES/rules1.top' X#ident "@(#)rules1.top 1.58 19/03/14 " X########################################################################### X# Written 1996-2018 by J. Schilling X########################################################################### X# X# Rules that should be included at top of every Makefile X# Do not include this file directly; this is the language independent X# version that may be included in special purpose versions. X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X# X# Global definitions: X# X# Define magic unique cookie X# X########################################################################### X_UNIQ= .XxZzy- X X########################################################################### X# X# Make sure this becomes the default target X# X########################################################################### Xall: X X########################################################################### X# X# Build a macro $(SRCROOTSL) that allows to use file name X# $(SRCROOTSL)incs/Dcc.$(PARCH)$(-O_ARCH) instead of using X# the file name $(SRCROOT)/incs/Dcc.$(PARCH)$(-O_ARCH) X# X# This is needed because of a serious bug in SunPRO make. We need to do some X# tricks in order to make code working that depends on including files where X# the file name is a macro and the file may be built as a result of a make X# rule. X# X# SunPRO make inconsistsently shortens rules that start with "./" X# and thus will not find existing rules for a file to be included. X# We use pattern matching macro expansions to consistently shorten the X# name if it starts with "./". This allows to use the same textual X# string for both the rule and the include statement. X# X# Note that Thus bug has been reported to Sun in 1998 but Sun seems not X# interested to fix the bug. X# X########################################################################### X_SRCROOTSL= $(SRCROOT)/ XSRCROOTSL= $(_SRCROOTSL:./%=%) X X########################################################################### X# X# Global handler for failed inludes X# X########################################################################### X.INCLUDE_FAILED: X @echo " ==> AUTOMAKING \"$^\""; sh $(SRCROOTSL)conf/makeinc $^ X X########################################################################### X# X# Legacy support for old smake programs ... X# X########################################################################### X.INCLUDEFAILED: X @echo " ==> AUTOMAKING \"$^\""; sh $(SRCROOTSL)conf/makeinc $^ X X########################################################################### X# X# Some global constants or pre-definitions X# X########################################################################### X_LCONFIG= $(_UNIQ)$(LCONFIG) X__LCONFIG= $(_LCONFIG:$(_UNIQ)=ldummy.cnf) XLOCAL_CNF= $(__LCONFIG:$(_UNIQ)%=%) X########################################################################### X X########################################################################### X# X# Standard (automatic) makeprog identification X# X# Each make program should define a macro: MAKE_NAME for identification. X# MAKE_NAME in this case is a built in macro like MAKE or MAKEFLAGS. X# Currently only 'smake' implements this feature. X# X########################################################################### X_MAKEPROG= $(_UNIQ)$(MAKE_NAME) X__MAKEPROG= $(_MAKEPROG:$(_UNIQ)=$(MAKEPROG)) X_XMAKEPROG= $(__MAKEPROG:$(_UNIQ)%=%) X X# gmake defines a macro MAKE_COMMAND. If neither MAKE_NAME is defined by X# the make program, nor MAKEPROG is set, try this to recognize gmake. X# X_MAKE_COMMAND= $(MAKE_COMMAND:%make=gmake) X X__XMAKEPROG= $(_UNIQ)$(_XMAKEPROG) X___XMAKEPROG= $(__XMAKEPROG:$(_UNIQ)=$(_MAKE_COMMAND)) XXMAKEPROG= $(___XMAKEPROG:$(_UNIQ)%=%) X Xinclude $(SRCROOT)/$(RULESDIR)/mk-$(XMAKEPROG).id X X########################################################################### X# X# $(GMAKE_ONLY) is empty for gmake and contains no-$(MAKEPROG)/ for X# other make programs. X# X########################################################################### X_GMAKE_ONLY= $(_UNIQ)$(MAKEPROG) X__GMAKE_ONLY= $(_GMAKE_ONLY:$(_UNIQ)gmake=) XGMAKE_ONLY= $(__GMAKE_ONLY:$(_UNIQ)%=no-%/) X X########################################################################### X# X# Standard (automatic) os identification X# X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/os-$(OSNAME).id X X########################################################################### X# X# Global os definitions X# X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/os-$(O_ARCH).def X X########################################################################### X# X# Some global project definitions that may be overwritten in 'Defaults' X# X########################################################################### XCWARNOPTS= $(CWOPTS) X X########################################################################### X# X# Global project definitions X# X########################################################################### XDEF_ROOT= $(SRCROOT) XDEF_DIR= DEFAULTS X X_DEFAULTSROOT= $(_UNIQ)$(DEFAULTSROOT) X__DEFAULTSROOT= $(_DEFAULTSROOT:$(_UNIQ)=$(DEF_ROOT)) XDEFLTSROOT= $(__DEFAULTSROOT:$(_UNIQ)%=%) X X_DEFAULTSDIR= $(_UNIQ)$(DEFAULTSDIR) X__DEFAULTSDIR= $(_DEFAULTSDIR:$(_UNIQ)=$(DEF_DIR)) XDEFLTSDIR= $(__DEFAULTSDIR:$(_UNIQ)%=%) X Xinclude $(DEFLTSROOT)/$(DEFLTSDIR)/Defaults X X########################################################################### X# X# Set DEST_DIR X# We use "DESTDIR" as external visible name to be compatible to other sw. X# X########################################################################### XDEST_DIR= $(DESTDIR:%/=%) X X########################################################################### X# X# Set INSBASE X# X########################################################################### XINSBASE= $(INS_BASE:%/=%) X X########################################################################### X# X# Standard default man install base X# X########################################################################### XDEFMANBASE_DEF= share X X_MANBASE= $(_UNIQ)$(DEFMANBASE) X__MANBASE= $(_MANBASE:$(_UNIQ)=$(DEFMANBASE_DEF)) XMANBASE= $(__MANBASE:$(_UNIQ)%=%) X X########################################################################### X# X# Get curent directory name X# X########################################################################### X_DIRNAME= $(_UNIQ)$(DIRNAME) X__DIRNAME= $(_DIRNAME:$(_UNIQ)=...) XCURDIR= $(__DIRNAME:$(_UNIQ)%=%) X X########################################################################### X# X# Standard UNIX compiler name for use as architecture name. X# X# (this is not necessarily the name the compiler is called by) X# This is now defined in $(DEFAULTSROOT)/Defaults X# If not ... use 'cc' X# X########################################################################### XDEFCCOM_DEF= cc X X_DEFCCOM= $(_UNIQ)$(DEFCCOM) X__DEFCCOM= $(_DEFCCOM:$(_UNIQ)=$(DEFCCOM_DEF)) XCCOM_DEF= $(__DEFCCOM:$(_UNIQ)%=%) X X_CCOM= $(_UNIQ)$(CCOM) X__CCOM= $(_CCOM:$(_UNIQ)=$(CCOM_DEF)) XC_ARCH= $(__CCOM:$(_UNIQ)%=%) X X########################################################################### X# X# Standard default include directories X# X########################################################################### XDEFINCDIRS_DEF= $(SRCROOT)/include X X_INCDIRS= $(_UNIQ)$(DEFINCDIRS) X__INCDIRS= $(_INCDIRS:$(_UNIQ)=$(DEFINCDIRS_DEF)) XINCDIRS= $(__INCDIRS:$(_UNIQ)%=%) X XDEFOSINCDIRS_DEF= # X X_OSINCDIRS= $(_UNIQ)$(DEFOSINCDIRS) X__OSINCDIRS= $(_OSINCDIRS:$(_UNIQ)=$(DEFOSINCDIRS_DEF)) XOSINCDIRS= $(__OSINCDIRS:$(_UNIQ)%=%) X X########################################################################### X# X# Prepare come macros needed to build $(ARCHDIR) X# X# Build macros for: X# - processor type X# - operating system X# - compiler identification X# X########################################################################### XKARCH_DEF= $(K_ARCH) XMARCH_DEF= $(M_ARCH) XPARCH_DEF= $(P_ARCH) X XKARCH= K_ARCH X X_MARCH= $(_UNIQ)$(ARCH) X__MARCH= $(_MARCH:$(_UNIQ)=$(MARCH_DEF)) XMARCH= $(__MARCH:$(_UNIQ)%=%) X X_PARCH= $(_UNIQ)$(ARCH) X__PARCH= $(_PARCH:$(_UNIQ)=$(PARCH_DEF)) XPARCH= $(__PARCH:$(_UNIQ)%=%) X X########################################################################### X# X# Now include the file $(SRCROOT)/incs/Dcc.$(PARCH)$(-O_ARCH) X# which is needed if the C-complier from the manual default configutration X# is not present on the current system. We try to use GCC as fallback X# in this case. X# X# Due to a serious bug in SunPRO make we need to do some tricks to make X# the following code working. X# X# See notes about $(SRCROOT)/ vs. $(SRCROOTSL) above. X# X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X X$(SRCROOTSL)incs: X $(MKDIR_SH) -p $@ X X$(SRCROOTSL)incs/Dnull: $(SRCROOTSL)incs X @if [ ! -f $@ ]; then \ X echo > $@; \ X fi X Xinclude $(SRCROOTSL)incs/Dnull X X_DCC= $(SRCROOTSL)incs/Dcc.$(PARCH)$(-O_ARCH) X X$(_DCC): X sh $(SRCROOTSL)conf/cc-config.sh $(C_ARCH:%64=%) $(CCOM_DEF) $@ X Xinclude $(_DCC) X X########################################################################### X# X# Build $(ARCHDIR) which occupies a central role in the whole X# make file system. ARCHDIR is used as a sub directory name to keep X# platform dependent files on different places. X# X# It is built from: X# - processor type X# - operating system X# - compiler identification X# X# A possible name could be: X# mc68020-sunos4-cc X# X########################################################################### X#OARCH= $(MARCH)$(-O_ARCH)-$(C_ARCH) XOARCH= $(PARCH)$(-O_ARCH)-$(C_ARCH) XXARCH= $(K_ARCH)$(-O_ARCH)-$(C_ARCH) X.print: X echo $(XP_ARCH) $(P_ARCH) $(OARCH) $(XARCH) X X########################################################################### X# X# All generated files are placed directly into this subdirectory. X# This includes e.g. yacc output (.c & .h files). X# SUBARCH is used if a object is conditional compiled in multiple ways. X# X########################################################################### XOARCHDIR= OBJ/$(OARCH) XARCHDIR= OBJ/$(OARCH)$(SUBARCHDIR)$(SUBARCH) X X########################################################################### X# X# See notes about $(SRCROOT)/ vs. $(SRCROOTSL) above. X# X########################################################################### XOLIBSDIR= $(SRCROOTSL)libs/$(OARCH)$(SUBARCHDIR)$(SUBARCH)$(SHLDIR) XOLIBSDIR_STATIC=$(SRCROOTSL)libs/$(OARCH)$(SUBARCHDIR)$(SUBARCH) XOINCSDIR= $(SRCROOTSL)incs/$(OARCH) X X########################################################################### X# Location for targets: X# X# - all : see appropriate rules X# - man installman : rules.man X# - lint : rules.lnt X# - clean, clobber, distclean, relink, rmtarget : rules.clr X# - rel : rules.rel X# - install, ibins, uninstall : rules.ins X# - html, htmlx, htmlxn : rules.htm & sub.htm X# - tarpkg tarpkg1 tarpkg2 : rules.sps X# - depend, rmdep : rules.dep X# - config : rules.cnf X# - tags, TAGS : rules.tag X# - .help : rules.hlp X# - .version : rules.hlp X# - tests : rules.tst X# - tinfo : rules.dir/rules.rdi X# - cstyle : rules.cst X# X# We do not put '.help', '.version' and 'tinfo' into 'ALLTARGETS' because: X# X# .help is not recursive X# .version is not recursive X# tinfo is handeled separately in rules1.dir X# X# If we would add .help and tinfo, we would get multiple defined target X# messages. X# X# Use ALLTARGETS=$(ALLTARGETS_NT) if there should be no directory descend X# for e.g. the "test" target. X########################################################################### XALLTARGETS= all man lint clean clobber cstyle distclean ibins depend rmdep \ X localize config TAGS tags tests rmtarget relink rel \ X $(INSTALLTARGETS) $(UNINSTALLTARGETS) $(MANTARGETS) $(PKGTARGETS) X XALLTARGETS_NT= all man lint clean clobber cstyle distclean ibins depend rmdep \ X localize config TAGS tags rmtarget relink rel \ X $(INSTALLTARGETS) $(UNINSTALLTARGETS) $(MANTARGETS) $(PKGTARGETS) X XINSTALLTARGETS= install installman XUNINSTALLTARGETS= uninstall uninstallman XMANTARGETS= html htmlx htmlxn XPKGTARGETS= tarpkg tarpkg1 tarpkg2 XMAN= man X X.PHONY: $(ALLTARGETS) .help tinfo shell X X########################################################################### X# Historic SunPro Make does not understand .PHONY: - use FRC X# SunPro Make from Schilytools supports .PHONY: and sets MAKE_NAME=sunpro X# $(MAKEPROG) is derived from $(SRCROOT)/$(RULESDIR)/mk-$(XMAKEPROG).id X# X# Make $(FRC) empty for all make programs (that usually support .PHONY) X# except for the unfixed old SunPro Make from Sun. X########################################################################### X_FRC= $(_UNIQ)$(MAKEPROG) X__FRC= $(_FRC:$(_UNIQ)make=FRC) XFRC= $(__FRC:$(_UNIQ)%=) X X$(ALLTARGETS) .help tinfo shell: $(FRC) X XFRC: X X########################################################################### X# Allow to call "make tests" even for commands that do not provide tests X########################################################################### Xtests: all X X########################################################################### X# Allow to start a shell in order to check the environment X########################################################################### Xshell: X $(SHELL) X X########################################################################### X# Include a target definition for all official targets so calling X# 'make' with a target that is not defined in the current makefiles X# will cause the target to be ignored. X########################################################################### X$(ALLTARGETS): X Xinclude $(SRCROOT)/$(RULESDIR)/version END-of-star-1.6/RULES/rules1.top echo x - star-1.6/RULES/rules.prg sed 's/^X//' >star-1.6/RULES/rules.prg << 'END-of-star-1.6/RULES/rules.prg' X#ident "@(#)rules.prg 1.23 17/04/16 " X########################################################################### X# Written 1996-2017 by J. Schilling X########################################################################### X# X# Generic rules for program names X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X# X# This file holds definitions that are common to all architectures. X# It should be included first and then partially overwritten, X# if the current architecture requires some changes. X# X########################################################################### X# X# Use the object file extension from the autoconf run for '$o' (.o). X# It may be overwritten my the compiler configuration rules cc-*.rul X# X########################################################################### Xo= $(OBJEXT) X XCLEAN_FILES= core err X X# X# Setting $(SHELL) inside a makefile is a really bad idea. X# Since we allow "smake" to default SHELL to /bin/bosh in X# case that /bin/sh is broken but /bin/bosh exists, this X# must not be defined anymore. X# X#SHELL= /bin/sh X XLN= /bin/ln XSYMLINK= /bin/ln -s XRM= /bin/rm XMV= /bin/mv XLORDER= $(LORDER_PROG) XTSORT= $(TSORT_PROG) XCTAGS= vctags XETAGS= etags XUMASK= umask $(UMASK_VAL) XUMASK_DEF= 002 XINSUMASK= umask $(INSUMASK_VAL) XINSUMASK_DEF= 022 X XRM_FORCE= -f XRM_RECURS= -r XRM_RF= $(RM_RECURS) $(RM_FORCE) X XRM_F= $(RM) $(RM_FORCE) X XINSMODEF_DEF= 444 XINSMODED_DEF= 755 XINSMODEX_DEF= 755 XINSUSR_DEF= root XINSGRP_DEF= bin X X_DEFINSUMASK= $(_UNIQ)$(DEFINSUMASK) X__DEFINSUMASK= $(_DEFINSUMASK:$(_UNIQ)=$(INSUMASK_DEF)) XINSUMASK_VAL= $(__DEFINSUMASK:$(_UNIQ)%=%) X X_DEFUMASK= $(_UNIQ)$(DEFUMASK) X__DEFUMASK= $(_DEFUMASK:$(_UNIQ)=$(UMASK_DEF)) XUMASK_VAL= $(__DEFUMASK:$(_UNIQ)%=%) X X_DEFINSMODEF= $(_UNIQ)$(DEFINSMODEF) X__DEFINSMODEF= $(_DEFINSMODEF:$(_UNIQ)=$(INSMODEF_DEF)) XINSMODEF= $(__DEFINSMODEF:$(_UNIQ)%=%) X X_DEFINSMODED= $(_UNIQ)$(DEFINSMODED) X__DEFINSMODED= $(_DEFINSMODED:$(_UNIQ)=$(INSMODED_DEF)) XINSMODED= $(__DEFINSMODED:$(_UNIQ)%=%) X X_DEFINSMODEX= $(_UNIQ)$(DEFINSMODEX) X__DEFINSMODEX= $(_DEFINSMODEX:$(_UNIQ)=$(INSMODEX_DEF)) XINSMODEX= $(__DEFINSMODEX:$(_UNIQ)%=%) X X_DEFINSUSR= $(_UNIQ)$(DEFINSUSR) X__DEFINSUSR= $(_DEFINSUSR:$(_UNIQ)=$(INSUSR_DEF)) XINSUSR= $(__DEFINSUSR:$(_UNIQ)%=%) X X_DEFINSGRP= $(_UNIQ)$(DEFINSGRP) X__DEFINSGRP= $(_DEFINSGRP:$(_UNIQ)=$(INSGRP_DEF)) XINSGRP= $(__DEFINSGRP:$(_UNIQ)%=%) X X XLD= @echo " ==> LINKING \"$@\""; ld XLOCALIZE= @echo " ==> LOCALIZING \"$@\""; $(RM_F) $@; cp XINSTALL= @echo " ==> INSTALLING \"$@\""; sh $(SRCROOT)/conf/install-sh -c -m $(INSMODEINS) -o $(INSUSR) -g $(INSGRP) XCHMOD= @echo " ==> SETTING PERMISSIONS ON \"$@\""; chmod XCHOWN= @echo " ==> SETTING OWNER ON \"$@\""; chown XCHGRP= @echo " ==> SETTING GROUP ON \"$@\""; chgrp XAR= @echo " ==> ARCHIVING \"$@\""; ar XARFLAGS= cr X#YACC= @echo " ==> YACCING \"$@\""; yacc X#LEX= @echo " ==> LEXING \"$@\""; lex X#AWK= @echo " ==> AWKING \"$@\""; awk XRANLIB= @echo " ==> RANDOMIZING ARCHIVE \"$@\""; true XMKDEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; makedepend XMKDEP_OUT= -f - X_MKDIR= $(UMASK); mkdir XMKDIR= @echo " ==> MAKING DIRECTORY \"$@\""; $(UMASK); mkdir X_MKDIR_SH= $(UMASK); sh $(SRCROOT)/conf/mkdir-sh XMKDIR_SH= @echo " ==> MAKING DIRECTORY \"$@\""; $(UMASK); sh $(SRCROOT)/conf/mkdir-sh XINSMKDIR= @echo " ==> MAKING DIRECTORY \"$@\""; $(INSUMASK); mkdir XINSMKDIR_SH= @echo " ==> MAKING DIRECTORY \"$@\""; $(INSUMASK); sh $(SRCROOT)/conf/mkdir-sh END-of-star-1.6/RULES/rules.prg echo x - star-1.6/RULES/os-interix-nt-6.0.id sed 's/^X//' >star-1.6/RULES/os-interix-nt-6.0.id << 'END-of-star-1.6/RULES/os-interix-nt-6.0.id' X#ident "@(#)os-interix-nt-6.0.id 1.1 13/08/11 " X########################################################################### X# Written 2013 by J. Schilling X########################################################################### X# X# Global os definitions for Interix Systems (SFU) MS Windows NT-6.0 (Win Vista) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XWINNTDEFS += -D_WIN32_WINNT=0x0600 END-of-star-1.6/RULES/os-interix-nt-6.0.id echo x - star-1.6/RULES/os-cygwin_nt-6.0.id sed 's/^X//' >star-1.6/RULES/os-cygwin_nt-6.0.id << 'END-of-star-1.6/RULES/os-cygwin_nt-6.0.id' X#ident "@(#)os-cygwin_nt-6.0.id 1.5 09/04/08 " X########################################################################### X# Written 2009 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for Cygnus GCC for MS Windows NT-6.0 (Win Vista) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/os-cygwin32_nt.id X XWINNTDEFS += -D_WIN32_WINNT=0x0600 END-of-star-1.6/RULES/os-cygwin_nt-6.0.id echo x - star-1.6/RULES/os-cygwin_nt-6.1-wow64.id sed 's/^X//' >star-1.6/RULES/os-cygwin_nt-6.1-wow64.id << 'END-of-star-1.6/RULES/os-cygwin_nt-6.1-wow64.id' X#ident "@(#)os-cygwin_nt-6.1-wow64.id 1.1 09/07/26 " X########################################################################### X# Written 2006 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for Cygnus GCC for MS Windows NT-6.1 (Win 7) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/os-cygwin32_wow64.id X XWINNTDEFS += -D_WIN32_WINNT=0x0601 END-of-star-1.6/RULES/os-cygwin_nt-6.1-wow64.id echo x - star-1.6/RULES/os-cygwin_nt-6.1.id sed 's/^X//' >star-1.6/RULES/os-cygwin_nt-6.1.id << 'END-of-star-1.6/RULES/os-cygwin_nt-6.1.id' X#ident "@(#)os-cygwin_nt-6.1.id 1.5 09/04/08 " X########################################################################### X# Written 2009 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for Cygnus GCC for MS Windows NT-6.1 (Win 7) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/os-cygwin32_nt.id X XWINNTDEFS += -D_WIN32_WINNT=0x0601 END-of-star-1.6/RULES/os-cygwin_nt-6.1.id echo x - star-1.6/RULES/os-dgux4.def sed 's/^X//' >star-1.6/RULES/os-dgux4.def << 'END-of-star-1.6/RULES/os-dgux4.def' X#ident "@(#)os-dgux4.def 1.3 06/05/14 " X########################################################################### X# Written 1997 by J. Schilling X########################################################################### X# X# Global os definitions for DGUX X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XMANSTYLE= sysv END-of-star-1.6/RULES/os-dgux4.def echo x - star-1.6/RULES/os-domainos.def sed 's/^X//' >star-1.6/RULES/os-domainos.def << 'END-of-star-1.6/RULES/os-domainos.def' X#ident "@(#)os-domainos.def 1.2 06/05/14 " X########################################################################### X# Written 2001 by J. Schilling X########################################################################### X# X# Global os definitions for Apollo Domain/OS X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X# Domain/OS uses it's own style, so let's use SVSv. X########################################################################### XMANSTYLE= sysv END-of-star-1.6/RULES/os-domainos.def echo x - star-1.6/RULES/os-cygwin32_wow64.def sed 's/^X//' >star-1.6/RULES/os-cygwin32_wow64.def << 'END-of-star-1.6/RULES/os-cygwin32_wow64.def' X#ident "@(#)os-cygwin32_wow64.def 1.3 09/04/11 " X########################################################################### X# Written 1997 by J. Schilling X########################################################################### X# X# Global os definitions for CYGWIN32_WOW64 X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XMANSTYLE= bsd X END-of-star-1.6/RULES/os-cygwin32_wow64.def echo x - star-1.6/RULES/os-cygwin32_wow64.id sed 's/^X//' >star-1.6/RULES/os-cygwin32_wow64.id << 'END-of-star-1.6/RULES/os-cygwin32_wow64.id' X#ident "@(#)os-cygwin32_wow64.id 1.6 09/04/11 " X########################################################################### X# Written 1997 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for Cygnus GCC for MS Windows NT X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= cygwin32_wow64 X-O_ARCH= -$(O_ARCH) X X#WINNTDEFS += -D_WIN32_WINNT=0x0400 END-of-star-1.6/RULES/os-cygwin32_wow64.id echo x - star-1.6/RULES/os-cygwin_nt-5.2-wow64.id sed 's/^X//' >star-1.6/RULES/os-cygwin_nt-5.2-wow64.id << 'END-of-star-1.6/RULES/os-cygwin_nt-5.2-wow64.id' X#ident "@(#)os-cygwin_nt-5.2-wow64.id 1.5 09/04/11 " X########################################################################### X# Written 2006 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for Cygnus GCC for MS Windows NT-5.2 (Server 2003) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/os-cygwin32_wow64.id X XWINNTDEFS += -D_WIN32_WINNT=0x0502 END-of-star-1.6/RULES/os-cygwin_nt-5.2-wow64.id echo x - star-1.6/RULES/i686-cygwin32_wow64-cl64.rul sed 's/^X//' >star-1.6/RULES/i686-cygwin32_wow64-cl64.rul << 'END-of-star-1.6/RULES/i686-cygwin32_wow64-cl64.rul' X#ident "@(#)i686-cygwin32_wow64-cl64.rul 1.8 09/05/17 " X########################################################################### X# Written 2006 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for CYGWIN32_WOW64 using MSVC X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### X_PLATFORM= cygwin Xinclude $(SRCROOT)/$(RULESDIR)/cc-msc64.rul X X# X# Supress useless cl warnings like: X# warning C4996: 'strerror' wurde als veraltet deklariert X# Consider using strerror_s instead. X# XOSDEFS += -D_CRT_SECURE_NO_DEPRECATE X XKDEFINES= X XLIB_SOCKET= Ws2_32.lib XLIB_MATH= XLIB_KVM= X XLORDER= echo XTSORT= cat END-of-star-1.6/RULES/i686-cygwin32_wow64-cl64.rul echo x - star-1.6/RULES/rules.cnf sed 's/^X//' >star-1.6/RULES/rules.cnf << 'END-of-star-1.6/RULES/rules.cnf' X#ident @(#)rules.cnf 1.18 18/08/16 X########################################################################### X# Written 1998-2013 by J. Schilling X########################################################################### X# X# Make Rules for global dynamic configuration X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X X$(SRCROOT)/autoconf/configure: $(SRCROOT)/autoconf/autoconf.m4 \ X $(SRCROOT)/autoconf/acgeneral.m4 \ X $(SRCROOT)/autoconf/acspecific.m4 \ X $(SRCROOT)/autoconf/acoldnames.m4 \ X $(SRCROOT)/autoconf/aclocal.m4 \ X $(SRCROOT)/autoconf/rules.cnf.in \ X $(SRCROOT)/autoconf/xconfig.h.in X @echo " ==> AUTOCONFIGURING GLOBAL \"$@\""; \ X cd $(SRCROOT)/autoconf && sh ./autoconf X Xconfig: $(OINCSDIR)/rules.cnf X X$(OINCSDIR)/Inull: X $(MKDIR) -p $(OINCSDIR) X @echo > $@ X X$(OINCSDIR): X $(MKDIR) -p $@ X X# X# Hack until the --*cc.rul files are updated X# X_HCC_COM= $(OARCH:%-gcc=gcc) XHCC_COM= $(_HCC_COM:%-cc=cc) X X_XCC_COM= $(_UNIQ)$(CC_COM) X__XCC_COM= $(_XCC_COM:$(_UNIQ)=$(HCC_COM)) XXCC_COM= $(__XCC_COM:$(_UNIQ)%=%) X X#CONFFLAGS += -cc=$(XCC_COM) X X$(OINCSDIR)/rules.cnf $(OINCSDIR)/xconfig.h: $(OINCSDIR)/Inull \ X $(SRCROOT)/autoconf/configure \ X $(SRCROOT)/autoconf/rules.cnf.in \ X $(SRCROOT)/autoconf/xconfig.h.in X $(RUL_CONF) X X########################################################################### XOS_DEFS= $(OSINCDIRS:%=-I%) $(OSDEFS) $(OSDEFSX) XRUL_CONF= @echo " ==> CONFIGURING RULES \"$@\""; \ X $(RM_F) $(OINCSDIR)/rules.cnf $(OINCSDIR)/xconfig.h; \ X cd $(OINCSDIR); \ X CONFIG_NOFAIL=TRUE CC="$(XCC_COM)" CFLAGS="$(C_FLAGS) $(CFLAGS)" \ X CXXFLAGS="$(C++FLAGS)" CPPFLAGS="$(OS_DEFS) $(CPPFLAGS)" \ X LDFLAGS="$(LDOPTS)" sh ../../autoconf/configure $(CONFFLAGS) X########################################################################### Xinclude $(OINCSDIR)/Inull Xinclude $(OINCSDIR)/rules.cnf X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/$(LOCAL_CNF) END-of-star-1.6/RULES/rules.cnf echo x - star-1.6/RULES/i386-minix-clang.rul sed 's/^X//' >star-1.6/RULES/i386-minix-clang.rul << 'END-of-star-1.6/RULES/i386-minix-clang.rul' X#ident "@(#)i386-minix-clang.rul 1.3 18/04/11 " X########################################################################### X# Written 2015-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for Minix 3 using Clang X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-$(C_ARCH).rul X XOSDEFS += X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X XLDOPTS= $(LIBS_PATH) $(LDPATH) X XRANLIB= @echo " ==> RANDOMIZING ARCHIVE \"$@\""; ranlib END-of-star-1.6/RULES/i386-minix-clang.rul echo x - star-1.6/RULES/os-os-2.id sed 's/^X//' >star-1.6/RULES/os-os-2.id << 'END-of-star-1.6/RULES/os-os-2.id' X#ident "@(#)os-os-2.id 1.2 06/05/14 " X########################################################################### X# Written 1999 by C. Wohlgemuth X########################################################################### X# X# OS specific MACRO definitions for OS/2 X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= os2 X-O_ARCH= -$(O_ARCH) END-of-star-1.6/RULES/os-os-2.id echo x - star-1.6/RULES/os-os2.def sed 's/^X//' >star-1.6/RULES/os-os2.def << 'END-of-star-1.6/RULES/os-os2.def' X#ident "@(#)os-os2.def 1.2 06/05/14 " X########################################################################### X# Written 1998 by C. Wohlgemuth X########################################################################### X# X# Global os definitions for OS/2 X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XMANSTYLE= bsd END-of-star-1.6/RULES/os-os2.def echo x - star-1.6/RULES/cc-msc.rul sed 's/^X//' >star-1.6/RULES/cc-msc.rul << 'END-of-star-1.6/RULES/cc-msc.rul' X#ident "@(#)cc-msc.rul 1.28 18/08/16 " X########################################################################### X# Written 2006-2014 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for CYGWIN32_NT using MSVC X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X XCPP_FLAGS= -DSCHILY_BUILD $(CPPOPTS) $(CPPOPTX) $(OSINCDIRS:%=-I%) $(OSDEFS) $(OSDEFSX) XC_FLAGS= $(COPTS) $(CWARNOPTS) $(COPTOPT) $(MSCOPTOPT) $(COPTX) XC++FLAGS= $(C++OPTS) $(C++WARNOPTS) $(C++OPTOPT) $(MSC++OPTOPT) $(C++OPTX) X XCPPOPTS= -I$(ARCHDIR) -I$(OINCSDIR) $(INCDIRS:%=-I%) $(INCDIRSX:%=-I%) XCOPTS= XCWOPTS= -W3 XCOPTOPT= -O2 XCOPTDYN= X#COPTGPROF= -pg X# X# /EHs C++-EH aktivieren (ohne SEH-Ausnahmen) X# /EHa C++-EH aktivieren (mit SEH-Ausnahmen) X# /EHc nothrow als Standard fr externes "C" X# MS seems to need -EHsc in order to create useful code with exceptions X# XC++OPTS= -EHsc XC++WOPTS= -W3 XC++OPTOPT= -O2 XC++OPTDYN= X#C++OPTGPROF= -pg X X XLIB_PREFIX= XLIB_SUFFIX= .lib XSHL_SUFFIX= .dll X XLIB_C= -lc X X#LIBS_PATH= -libpath:$(OLIBSDIR) X#LIBS_PATH_STATIC= -libpath:$(OLIBSDIR_STATIC) XLIBS_PATH= -L$(OLIBSDIR) XLIBS_PATH_STATIC= -L$(OLIBSDIR_STATIC) X XWIN_LIBS= $(WIN32_LIBS) X XLDFLAGS= $(LDOPTS) $(LDOPTX) XLDLIBS= $(LIBS:-l%=%.lib) $(LIBX:-l%=%.lib) $(WIN_LIBS:-l%=%.lib) X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH) X#LDOPTS= -link $(LIBS_PATH) $(LDPATH) XLDOPTS= -link $(LIBS_PATH:-L%=-libpath:%) $(LDPATH:-L%=-libpath:%) X#LDOPTDYN= -shared -Wl,-soname,$(TARGET) XLDOPTDYN= -dll -def:$(TARGETLIB).def XLNDYNLIB= @ X XFLOAT_OPTIONS= X X__CC_COM= $(_UNIQ)$(CC) X___CC_COM= $(__CC_COM:$(_UNIQ)=$(CC_COM_DEF)) XCC_COM= $(___CC_COM:$(_UNIQ)%=%) X X__CC++_COM= $(_UNIQ)$(CCC) X___CC++_COM= $(__CC++_COM:$(_UNIQ)=$(CC++_COM_DEF)) XCC++_COM= $(___CC++_COM:$(_UNIQ)%=%) X XCC_COM_DEF= cl.exe XCC++_COM_DEF= $(CC_COM_DEF) XCC= $(CC_COM_DEF) XCCC= $(CC++_COM_DEF) X XCCCC= @echo " ==> COMPILING \"$@\""; $(CC_COM) -nologo XCC++ = @echo " ==> COMPILING \"$@\""; $(CC++_COM) -nologo XOUTPUT_OPTION= -Fo$(O:%=%/)$@ XCC_OUTPUT_FILTER= | tail -n +2 # Filter cl.exe filename echo XLD_OUTPUT_OPTION= -Fe$@ XLDCC= @echo " ==> LINKING \"$@\""; $(CC_COM) -nologo XLDCC++ = @echo " ==> LINKING \"$@\""; $(CC++_COM) -nologo XDYNLD= @echo " ==> LINKING dynamic library \"$@\""; $(CC_COM) -nologo XDYNLDC++ = @echo " ==> LINKING dynamic library \"$@\""; $(CC++_COM) -nologo XDYNLD.o= $(DYNLD) `$(LORDER) $(POFILES) | $(TSORT)` $(LDFLAGS) -out:$@ $(LDLIBS) X XRANLIB= @echo " ==> RANDOMIZING ARCHIVE \"$@\""; true XAR= @echo " ==> ARCHIVING \"$@\""; lib.exe -nologo XARFLAGS= XAR.o= $(AR) $(ARFLAGS) -out:$@ X XRMDEP= : XMKDEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); sh $(SRCROOT)/conf/mkdep-msc.sh XMKDEP_OUT= XMKC++DEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); sh $(SRCROOT)/conf/mkdep-msc.sh XMKC++DEP_OUT= X XVC=7 X X_VC_SETUP= $(_UNIQ)$(VC_SETUP) X__VC_SETUP= $(_VC_SETUP:$(_UNIQ)=vc$(VC)$(_PLATFORM:%=-%)-setup) XVCSETUP= $(__VC_SETUP:$(_UNIQ)%=%) X X########################################################################### X# IMPORTANT Note: X# We also include $(DEFLTSROOT)/$(DEFLTSDIR)/$(VCSETUP) from Defaults.* X# in order to be able to test for the existence of "cl.exe" early. X########################################################################### Xinclude $(DEFLTSROOT)/$(DEFLTSDIR)/$(VCSETUP) X XOSDEFS += $(WINNTDEFS) X X# X# Tell MKLINKS to copy files instead of linking them X# XMKLINKS_COPY= true Xexport MKLINKS_COPY END-of-star-1.6/RULES/cc-msc.rul echo x - star-1.6/RULES/cc-sun.rul sed 's/^X//' >star-1.6/RULES/cc-sun.rul << 'END-of-star-1.6/RULES/cc-sun.rul' X#ident "@(#)cc-sun.rul 1.18 18/08/16 " X########################################################################### X# Written 1996-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for Sun cc (SunOS 4.x) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X XCPP_FLAGS= -DSCHILY_BUILD $(CPPOPTS) $(CPPOPTX) $(OSINCDIRS:%=-I%) $(OSDEFS) $(OSDEFSX) XC_FLAGS= $(COPTS) $(CWARNOPTS) $(COPTOPT) $(SUNCOPTOPT) $(COPTX) XC++FLAGS= $(C++OPTS) $(C++WARNOPTS) $(C++OPTOPT) $(SUNC++OPTOPT) $(C++OPTX) X XCPPOPTS= -I$(ARCHDIR) -I$(OINCSDIR) $(INCDIRS:%=-I%) $(INCDIRSX:%=-I%) XCOPTS= XCWOPTS= XCOPTOPT= -O XCOPTDYN= -pic XCOPTGPROF= -pg XC++OPTS= XC++WOPTS= X#C++OPTOPT= -O X#C++OPTDYN= -Kpic X#C++OPTGPROF= -xpg X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_C= -lc X XLIBS_PATH= -L$(OLIBSDIR) XLIBS_PATH_STATIC= -L$(OLIBSDIR_STATIC) X XLDFLAGS= $(LDOPTS) $(LDOPTX) XLDLIBS= $(LIBS) $(LIBX) X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH) XLDOPTS= $(LIBS_PATH) $(LDPATH) XLDOPTDYN= XLNDYNLIB= @ X XFLOAT_OPTIONS= X X__CC_COM= $(_UNIQ)$(CC) X___CC_COM= $(__CC_COM:$(_UNIQ)=$(CC_COM_DEF)) XCC_COM= $(___CC_COM:$(_UNIQ)%=%) X X__CC++_COM= $(_UNIQ)$(CCC) X___CC++_COM= $(__CC++_COM:$(_UNIQ)=$(CC++_COM_DEF)) XCC++_COM= $(___CC++_COM:$(_UNIQ)%=%) X XCC_COM_DEF= cc XCC++_COM_DEF= echo "C++ not yet supported"; exit -1; : X# X# Use to comment out C++ projects X# XC++BUILD= $(NUMBER_SIGN) X XCC= $(CC_COM_DEF) XCCC= $(CC++_COM_DEF) X XCCCC= @echo " ==> COMPILING \"$@\""; $(CC_COM) XLDCC= @echo " ==> LINKING \"$@\""; $(CC_COM) XDYNLD= @echo " ==> LINKING dynamic library \"$@\""; ld XRANLIB= @echo " ==> RANDOMIZING ARCHIVE \"$@\""; ranlib X XRMDEP= : XMKDEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); $(CC_COM) -M XMKDEP_OUT= X XCC++ = @echo " ==> COMPILING \"$@\""; $(CC++_COM) XLDCC++ = @echo " ==> LINKING \"$@\""; $(CC++_COM) XDYNLDC++ = @echo " ==> LINKING dynamic library \"$@\""; $(CC++_COM) XMKC++DEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); $(CC++_COM) -M XMKC++DEP_OUT= END-of-star-1.6/RULES/cc-sun.rul echo x - star-1.6/RULES/os-minix.id sed 's/^X//' >star-1.6/RULES/os-minix.id << 'END-of-star-1.6/RULES/os-minix.id' X#ident "@(#)os-minix.id 1.1 15/11/08 " X########################################################################### X# Written 2015 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for Minix X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= minix X-O_ARCH= -$(O_ARCH) END-of-star-1.6/RULES/os-minix.id echo x - star-1.6/RULES/os-openvms.id sed 's/^X//' >star-1.6/RULES/os-openvms.id << 'END-of-star-1.6/RULES/os-openvms.id' X#ident "@(#)os-openvms.id 1.1 09/10/29 " X########################################################################### X# Written 2009 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for OpenVMS X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= openvms X-O_ARCH= -$(O_ARCH) END-of-star-1.6/RULES/os-openvms.id echo x - star-1.6/RULES/MKLINKS sed 's/^X//' >star-1.6/RULES/MKLINKS << 'END-of-star-1.6/RULES/MKLINKS' X#!/bin/sh X########################################################################### X#ident "@(#)MKLINKS 1.131 18/11/15 " X########################################################################### X# Written 1996-2015 by J. Schilling X########################################################################### X# Copyright (c) 1996-2015 J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xif [ -r ldummy.lnk ]; then X if [ $# -le 0 ]; then X exit 0 X fi Xfi X########################################################################### Xsymlink="ln -s" XMKLINKS_TEST=${MKLINKS_TEST-:} Xif [ ".$MKLINKS_COPY" = '.' ]; then X rm -f xxzzy.123 xxzzy.345 X echo test > xxzzy.123 X $symlink xxzzy.123 xxzzy.345 X test $? = 0 || symlink=cp X test -r xxzzy.345 || symlink=cp X ${MKLINKS_TEST} -h xxzzy.345 || symlink=cp X rm -f xxzzy.123 xxzzy.345 Xelse X symlink=cp Xfi X########################################################################### X X$symlink ldummy.cnf ldummy.lnk X$symlink mk-.id mk-make.id X# X$symlink mk-smake.id mk-build.id X$symlink r-smake.dep r-build.dep X$symlink r-smake.obj r-build.obj X$symlink r-smake.tag r-build.tag X$symlink r-make.obj r-gmake.obj X$symlink r-make.obj r-sunpro.obj X$symlink r-make.tag r-sunpro.tag X X$symlink cc-clang.rul cc-clang32.rul X$symlink cc-clang.rul cc-clang64.rul X$symlink cc-gcc.rul cc-gcc32.rul X$symlink cc-gcc.rul cc-gcc64.rul X$symlink cc-sunpro.rul cc-sunpro32.rul X$symlink cc-sunpro.rul cc-sunpro64.rul X$symlink cc-ibm.rul cc-ibm32.rul X$symlink cc-ibm.rul cc-ibm64.rul X Xif [ -r r-make.c4x ]; then X $symlink r-make.c4x r-gmake.c4x X $symlink r-make.c4x-dep r-gmake.c4x-dep X $symlink r-smake.c4x r-build.c4x X $symlink r-smake.c4x-dep r-build.c4x-dep Xfi X X$symlink 9000-725-hp-ux-cc.rul 9000-725-hp-ux-cc64.rul X$symlink 9000-725-hp-ux-cc.rul 9000-710-hp-ux-cc.rul X$symlink 9000-725-hp-ux-cc.rul 9000-712-hp-ux-cc.rul X$symlink 9000-725-hp-ux-cc.rul 9000-715-hp-ux-cc.rul X$symlink 9000-725-hp-ux-cc.rul 9000-735-hp-ux-cc.rul X$symlink 9000-725-hp-ux-cc.rul 9000-743-hp-ux-cc.rul X$symlink 9000-725-hp-ux-cc.rul 9000-755-hp-ux-cc.rul X$symlink 9000-725-hp-ux-cc.rul 9000-777-hp-ux-cc.rul X$symlink 9000-725-hp-ux-cc.rul 9000-778-hp-ux-cc.rul X$symlink 9000-725-hp-ux-cc.rul 9000-780-hp-ux-cc.rul X$symlink 9000-725-hp-ux-cc.rul 9000-782-hp-ux-cc.rul X$symlink 9000-725-hp-ux-cc.rul 9000-785-hp-ux-cc.rul X$symlink 9000-725-hp-ux-cc.rul 9000-800-hp-ux-cc.rul X$symlink 9000-725-hp-ux-cc.rul 9000-820-hp-ux-cc.rul X$symlink 9000-725-hp-ux-cc.rul 9000-831-hp-ux-cc.rul X$symlink 9000-725-hp-ux-cc.rul 9000-899-hp-ux-cc.rul X$symlink 9000-725-hp-ux-cc.rul ia64-hp-ux-cc.rul X$symlink 9000-725-hp-ux-cc64.rul 9000-710-hp-ux-cc64.rul X$symlink 9000-725-hp-ux-cc64.rul 9000-712-hp-ux-cc64.rul X$symlink 9000-725-hp-ux-cc64.rul 9000-715-hp-ux-cc64.rul X$symlink 9000-725-hp-ux-cc64.rul 9000-735-hp-ux-cc64.rul X$symlink 9000-725-hp-ux-cc64.rul 9000-743-hp-ux-cc64.rul X$symlink 9000-725-hp-ux-cc64.rul 9000-755-hp-ux-cc64.rul X$symlink 9000-725-hp-ux-cc64.rul 9000-777-hp-ux-cc64.rul X$symlink 9000-725-hp-ux-cc64.rul 9000-778-hp-ux-cc64.rul X$symlink 9000-725-hp-ux-cc64.rul 9000-780-hp-ux-cc64.rul X$symlink 9000-725-hp-ux-cc64.rul 9000-782-hp-ux-cc64.rul X$symlink 9000-725-hp-ux-cc64.rul 9000-785-hp-ux-cc64.rul X$symlink 9000-725-hp-ux-cc64.rul 9000-800-hp-ux-cc64.rul X$symlink 9000-725-hp-ux-cc64.rul 9000-820-hp-ux-cc64.rul X$symlink 9000-725-hp-ux-cc64.rul 9000-831-hp-ux-cc64.rul X$symlink 9000-725-hp-ux-cc64.rul 9000-899-hp-ux-cc64.rul X$symlink 9000-725-hp-ux-cc64.rul ia64-hp-ux-cc64.rul X$symlink 9000-725-hp-ux-gcc.rul 9000-710-hp-ux-gcc.rul X$symlink 9000-725-hp-ux-gcc.rul 9000-712-hp-ux-gcc.rul X$symlink 9000-725-hp-ux-gcc.rul 9000-715-hp-ux-gcc.rul X$symlink 9000-725-hp-ux-gcc.rul 9000-735-hp-ux-gcc.rul X$symlink 9000-725-hp-ux-gcc.rul 9000-743-hp-ux-gcc.rul X$symlink 9000-725-hp-ux-gcc.rul 9000-755-hp-ux-gcc.rul X$symlink 9000-725-hp-ux-gcc.rul 9000-777-hp-ux-gcc.rul X$symlink 9000-725-hp-ux-gcc.rul 9000-778-hp-ux-gcc.rul X$symlink 9000-725-hp-ux-gcc.rul 9000-780-hp-ux-gcc.rul X$symlink 9000-725-hp-ux-gcc.rul 9000-782-hp-ux-gcc.rul X$symlink 9000-725-hp-ux-gcc.rul 9000-785-hp-ux-gcc.rul X$symlink 9000-725-hp-ux-gcc.rul 9000-800-hp-ux-gcc.rul X$symlink 9000-725-hp-ux-gcc.rul 9000-820-hp-ux-gcc.rul X$symlink 9000-725-hp-ux-gcc.rul 9000-831-hp-ux-gcc.rul X$symlink 9000-725-hp-ux-gcc.rul 9000-899-hp-ux-gcc.rul X$symlink 9000-725-hp-ux-gcc.rul ia64-hp-ux-gcc.rul X$symlink hppa-nextstep-cc.rul i386-nextstep-cc.rul X$symlink hppa-nextstep-cc.rul m68k-nextstep-cc.rul X$symlink hppa-nextstep-cc.rul sparc-nextstep-cc.rul X$symlink hppa-nextstep-cc.rul i386-nextstep-gcc.rul X$symlink hppa-nextstep-cc.rul m68k-nextstep-gcc.rul X$symlink hppa-nextstep-cc.rul sparc-nextstep-gcc.rul X$symlink os-irix.id os-irix64.id X$symlink ip22-irix-cc.rul ip22-irix-cc64.rul X# it is not clear whether the next entry works: X# comment was: does not work because of GCC_OPT64= -mabi=64 X$symlink ip22-irix-gcc.rul ip22-irix-gcc64.rul X$symlink ip22-irix-cc.rul ip17-irix-cc.rul X$symlink ip22-irix-cc.rul ip20-irix-cc.rul X$symlink ip22-irix-cc.rul ip27-irix-cc.rul X$symlink ip22-irix-cc.rul ip28-irix-cc.rul X$symlink ip22-irix-cc.rul ip30-irix-cc.rul X$symlink ip22-irix-cc.rul ip32-irix-cc.rul X$symlink ip22-irix-cc.rul ip35-irix-cc.rul X$symlink ip22-irix-gcc.rul ip17-irix-gcc.rul X$symlink ip22-irix-gcc.rul ip20-irix-gcc.rul X$symlink ip22-irix-gcc.rul ip27-irix-gcc.rul X$symlink ip22-irix-gcc.rul ip28-irix-gcc.rul X$symlink ip22-irix-gcc.rul ip30-irix-gcc.rul X$symlink ip22-irix-gcc.rul ip32-irix-gcc.rul X$symlink ip22-irix-gcc.rul ip35-irix-gcc.rul X$symlink ip22-irix-cc64.rul ip17-irix-cc64.rul X$symlink ip22-irix-cc64.rul ip20-irix-cc64.rul X$symlink ip22-irix-cc64.rul ip27-irix-cc64.rul X$symlink ip22-irix-cc64.rul ip28-irix-cc64.rul X$symlink ip22-irix-cc64.rul ip30-irix-cc64.rul X$symlink ip22-irix-cc64.rul ip32-irix-cc64.rul X$symlink ip22-irix-cc64.rul ip35-irix-cc64.rul X$symlink ip22-irix-gcc64.rul ip17-irix-gcc64.rul X$symlink ip22-irix-gcc64.rul ip20-irix-gcc64.rul X$symlink ip22-irix-gcc64.rul ip27-irix-gcc64.rul X$symlink ip22-irix-gcc64.rul ip28-irix-gcc64.rul X$symlink ip22-irix-gcc64.rul ip30-irix-gcc64.rul X$symlink ip22-irix-gcc64.rul ip32-irix-gcc64.rul X$symlink ip22-irix-gcc64.rul ip35-irix-gcc64.rul X$symlink i386-at386-gnu-cc.rul i686-at386-gnu-cc.rul X$symlink i386-at386-gnu-gcc.rul i686-at386-gnu-gcc.rul X$symlink i386-freebsd-cc.rul sparc64-freebsd-cc.rul X$symlink i386-freebsd-clang.rul i386-freebsd-clang32.rul X$symlink i386-freebsd-clang.rul i386-freebsd-clang64.rul X$symlink i386-freebsd-clang.rul amd64-freebsd-clang.rul X$symlink i386-freebsd-clang.rul amd64-freebsd-clang32.rul X$symlink i386-freebsd-clang.rul amd64-freebsd-clang64.rul X$symlink i386-freebsd-clang.rul arm64-freebsd-clang.rul X$symlink i386-freebsd-clang.rul arm64-freebsd-clang32.rul X$symlink i386-freebsd-clang.rul arm64-freebsd-clang64.rul X$symlink i386-freebsd-gcc.rul sparc64-freebsd-gcc.rul X$symlink i386-freebsd-cc.rul amd64-freebsd-cc.rul X$symlink i386-freebsd-gcc.rul amd64-freebsd-gcc.rul X$symlink i386-freebsd-cc.rul i386-dragonfly-cc.rul X$symlink i386-freebsd-gcc.rul i386-dragonfly-gcc.rul X$symlink i386-freebsd-cc.rul x86_64-dragonfly-cc.rul X$symlink i386-freebsd-gcc.rul x86_64-dragonfly-gcc.rul X X$symlink i386-netbsd-cc.rul amd64-netbsd-cc.rul X$symlink i386-netbsd-cc.rul amd64-netbsd-cc32.rul X$symlink i386-netbsd-cc.rul amd64-netbsd-cc64.rul X$symlink i386-netbsd-gcc.rul amd64-netbsd-gcc.rul X$symlink i386-netbsd-gcc.rul amd64-netbsd-gcc32.rul X$symlink i386-netbsd-gcc.rul amd64-netbsd-gcc64.rul X$symlink i386-netbsd-cc.rul alpha-netbsd-cc.rul X$symlink i386-netbsd-cc.rul alpha-netbsd-cc32.rul X$symlink i386-netbsd-cc.rul alpha-netbsd-cc64.rul X$symlink i386-netbsd-gcc.rul alpha-netbsd-gcc.rul X$symlink i386-netbsd-gcc.rul alpha-netbsd-gcc32.rul X$symlink i386-netbsd-gcc.rul alpha-netbsd-gcc64.rul X$symlink i386-netbsd-cc.rul sparc-netbsd-cc.rul X$symlink i386-netbsd-cc.rul sparc-netbsd-cc32.rul X$symlink i386-netbsd-cc.rul sparc-netbsd-cc64.rul X$symlink i386-netbsd-gcc.rul sparc-netbsd-gcc.rul X$symlink i386-netbsd-gcc.rul sparc-netbsd-gcc32.rul X$symlink i386-netbsd-gcc.rul sparc-netbsd-gcc64.rul X$symlink i386-netbsd-cc.rul mac68k-netbsd-cc.rul X$symlink i386-netbsd-gcc.rul mac68k-netbsd-gcc.rul X$symlink i386-netbsd-cc.rul amiga-netbsd-cc.rul X$symlink i386-netbsd-gcc.rul amiga-netbsd-gcc.rul X$symlink i386-netbsd-cc.rul macppc-netbsd-cc.rul X$symlink i386-netbsd-gcc.rul macppc-netbsd-gcc.rul X$symlink i386-netbsd-clang.rul amd64-netbsd-clang.rul X$symlink i386-netbsd-clang.rul amd64-netbsd-clang32.rul X$symlink i386-netbsd-clang.rul amd64-netbsd-clang64.rul X$symlink i386-netbsd-clang.rul alpha-netbsd-clang.rul X$symlink i386-netbsd-clang.rul alpha-netbsd-clang32.rul X$symlink i386-netbsd-clang.rul alpha-netbsd-clang64.rul X$symlink i386-netbsd-clang.rul sparc-netbsd-clang.rul X$symlink i386-netbsd-clang.rul sparc-netbsd-clang32.rul X$symlink i386-netbsd-clang.rul sparc-netbsd-clang64.rul X$symlink i386-openbsd-cc.rul amd64-openbsd-cc.rul X$symlink i386-openbsd-gcc.rul amd64-openbsd-gcc.rul X$symlink amd64-bitrig-clang.rul amd64-bitrig-clang32.rul X$symlink amd64-bitrig-clang.rul amd64-bitrig-clang64.rul X$symlink amd64-bitrig-clang.rul i386-bitrig-clang.rul X$symlink i386-bsd-os-cc.rul sparc-bsd-os-cc.rul X$symlink i386-bsd-os-gcc.rul sparc-bsd-os-gcc.rul X$symlink i386-bsd-os3-cc.rul sparc-bsd-os3-cc.rul X$symlink i386-bsd-os3-gcc.rul sparc-bsd-os3-gcc.rul X$symlink i586-linux-cc.rul i586-linux-cc64.rul X$symlink i586-linux-cc.rul i386-linux-cc.rul X$symlink i586-linux-clang.rul i586-linux-clang32.rul X$symlink i586-linux-clang.rul i586-linux-clang64.rul X$symlink i586-linux-cc.rul i486-linux-cc.rul X$symlink i586-linux-cc.rul i686-linux-cc.rul X$symlink i586-linux-gcc.rul i586-linux-gcc32.rul X$symlink i586-linux-gcc.rul i586-linux-gcc64.rul X$symlink i586-linux-gcc.rul i386-linux-gcc.rul X$symlink i586-linux-gcc.rul i486-linux-gcc.rul X$symlink i586-linux-gcc.rul i686-linux-gcc.rul X$symlink i586-linux-cc.rul sparc-linux-cc.rul X$symlink i586-linux-gcc.rul sparc-linux-gcc.rul X$symlink i586-linux-cc.rul sparc64-linux-cc.rul X$symlink i586-linux-gcc.rul sparc64-linux-gcc.rul X$symlink i586-linux-cc.rul alpha-linux-cc.rul X$symlink i586-linux-gcc.rul alpha-linux-gcc.rul X$symlink i586-linux-cc.rul ppc-linux-cc.rul X$symlink i586-linux-gcc.rul ppc-linux-gcc.rul X$symlink i586-linux-cc.rul ppc64-linux-cc.rul X$symlink i586-linux-gcc.rul ppc64-linux-gcc.rul X$symlink i586-linux-cc.rul ppc64le-linux-cc.rul X$symlink i586-linux-gcc.rul ppc64le-linux-gcc.rul X$symlink i586-linux-cc.rul m68k-linux-cc.rul X$symlink i586-linux-gcc.rul m68k-linux-gcc.rul X$symlink i586-linux-cc.rul armv4l-linux-cc.rul X$symlink i586-linux-gcc.rul armv4l-linux-gcc.rul X$symlink i586-linux-cc.rul armv4tl-linux-cc.rul X$symlink i586-linux-gcc.rul armv4tl-linux-gcc.rul X$symlink i586-linux-cc.rul mips-linux-cc.rul X$symlink i586-linux-gcc.rul mips-linux-gcc.rul X$symlink i586-linux-cc.rul mipsel-linux-cc.rul X$symlink i586-linux-gcc.rul mipsel-linux-gcc.rul X$symlink i586-linux-cc.rul mips64-linux-cc.rul X$symlink i586-linux-gcc.rul mips64-linux-gcc.rul X$symlink i586-linux-cc.rul s390-linux-cc.rul X$symlink i586-linux-gcc.rul s390-linux-gcc.rul X$symlink i586-linux-cc.rul s390x-linux-cc.rul X$symlink i586-linux-gcc.rul s390x-linux-gcc.rul X$symlink i586-linux-cc.rul parisc-linux-cc.rul X$symlink i586-linux-gcc.rul parisc-linux-gcc.rul X$symlink i586-linux-cc.rul parisc64-linux-cc.rul X$symlink i586-linux-gcc.rul parisc64-linux-gcc.rul X$symlink i586-linux-cc.rul ia64-linux-cc.rul X$symlink i586-linux-gcc.rul ia64-linux-gcc.rul X$symlink i586-linux-cc.rul x86_64-linux-cc.rul X$symlink i586-linux-clang.rul x86_64-linux-clang.rul X$symlink i586-linux-clang32.rul x86_64-linux-clang32.rul X$symlink i586-linux-clang64.rul x86_64-linux-clang64.rul X$symlink i586-linux-gcc.rul x86_64-linux-gcc.rul X$symlink i586-linux-cc.rul armv5l-linux-cc.rul X$symlink i586-linux-gcc.rul armv5l-linux-gcc.rul X$symlink i586-linux-cc.rul armv5teb-linux-cc.rul X$symlink i586-linux-gcc.rul armv5teb-linux-gcc.rul X$symlink i586-linux-cc.rul armv5tejl-linux-cc.rul X$symlink i586-linux-gcc.rul armv5tejl-linux-gcc.rul X$symlink i586-linux-cc.rul armv5tel-linux-cc.rul X$symlink i586-linux-gcc.rul armv5tel-linux-gcc.rul X$symlink i586-linux-cc.rul armv6l-linux-cc.rul X$symlink i586-linux-gcc.rul armv6l-linux-gcc.rul X$symlink i586-linux-cc.rul armv7l-linux-cc.rul X$symlink i586-linux-gcc.rul armv7l-linux-gcc.rul X$symlink i586-linux-cc.rul aarch64-linux-cc.rul X$symlink i586-linux-clang.rul aarch64-linux-clang.rul X$symlink i586-linux-clang32.rul aarch64-linux-clang32.rul X$symlink i586-linux-clang64.rul aarch64-linux-clang64.rul X$symlink i586-linux-gcc.rul aarch64-linux-gcc.rul X$symlink i586-linux-gcc32.rul aarch64-linux-gcc32.rul X$symlink i586-linux-gcc64.rul aarch64-linux-gcc64.rul X$symlink i586-linux-cc.rul sh3-linux-cc.rul X$symlink i586-linux-gcc.rul sh3-linux-gcc.rul X$symlink i586-linux-cc.rul sh4-linux-cc.rul X$symlink i586-linux-gcc.rul sh4-linux-gcc.rul X$symlink i586-linux-cc.rul sh4a-linux-cc.rul X$symlink i586-linux-gcc.rul sh4a-linux-gcc.rul X$symlink i586-linux-gcc32.rul x86_64-linux-gcc32.rul X$symlink i586-linux-gcc.rul x86_64-linux-gcc64.rul X$symlink i586-linux-gcc32.rul sparc64-linux-gcc32.rul X$symlink i586-linux-gcc.rul sparc64-linux-gcc64.rul X$symlink i586-linux-gcc32.rul mips64-linux-gcc32.rul X$symlink i586-linux-gcc32.rul parisc64-linux-gcc32.rul X$symlink i586-linux-suncc.rul i586-linux-suncc32.rul X$symlink i586-linux-suncc.rul i586-linux-suncc64.rul X$symlink i586-linux-suncc.rul i686-linux-suncc.rul X$symlink i586-linux-suncc.rul i486-linux-suncc.rul X$symlink i586-linux-suncc.rul i386-linux-suncc.rul X$symlink i586-linux-suncc.rul x86_64-linux-suncc.rul X$symlink i586-linux-suncc64.rul i686-linux-suncc64.rul X$symlink i586-linux-suncc64.rul x86_64-linux-suncc64.rul X$symlink i586-linux-cc.rul i386-gnu-kfreebsd-cc.rul X$symlink i586-linux-gcc.rul i386-gnu-kfreebsd-gcc.rul X$symlink i586-linux-cc.rul i486-gnu-kfreebsd-cc.rul X$symlink i586-linux-gcc.rul i486-gnu-kfreebsd-gcc.rul X$symlink i586-linux-cc.rul i586-gnu-kfreebsd-cc.rul X$symlink i586-linux-gcc.rul i586-gnu-kfreebsd-gcc.rul X$symlink i586-linux-cc.rul i686-gnu-kfreebsd-cc.rul X$symlink i586-linux-gcc.rul i686-gnu-kfreebsd-gcc.rul X$symlink i586-linux-cc.rul amd64-gnu-kfreebsd-cc.rul X$symlink i586-linux-gcc.rul amd64-gnu-kfreebsd-gcc.rul X$symlink i586-linux-gcc32.rul amd64-gnu-kfreebsd-gcc32.rul X$symlink i586-linux-cc.rul x86_64-gnu-kfreebsd-cc.rul X$symlink i586-linux-gcc.rul x86_64-gnu-kfreebsd-gcc.rul X$symlink i586-linux-gcc32.rul x86_64-gnu-kfreebsd-gcc32.rul X#$symlink os-cygwin32_nt.id os-cygwin_95-4.0.id X#$symlink os-cygwin32_nt.id os-cygwin_98-4.0.id X#$symlink os-cygwin32_nt.id os-cygwin_98-4.10.id X#$symlink os-cygwin32_nt.id os-cygwin_me-4.90.id X#$symlink os-cygwin32_nt.id os-cygwin_nt-4.0.id X#$symlink os-cygwin32_nt.id os-cygwin_nt-5.0.id X#$symlink os-cygwin32_nt.id os-cygwin_nt-5.1.id X$symlink os-cygwin_95-4.0.id os-cygwin_98-4.0.id X$symlink os-unixware.id os-openunix.id X$symlink i486-cygwin32_nt-cc.rul i486-cygwin32_nt-cc32.rul X$symlink i486-cygwin32_nt-cc.rul i486-cygwin32_nt-cc64.rul X$symlink i486-cygwin32_nt-gcc.rul i486-cygwin32_nt-gcc32.rul X$symlink i486-cygwin32_nt-gcc.rul i486-cygwin32_nt-gcc64.rul X$symlink i486-cygwin32_nt-cc.rul i386-cygwin32_nt-cc.rul X$symlink i486-cygwin32_nt-cc.rul i586-cygwin32_nt-cc.rul X$symlink i486-cygwin32_nt-cc.rul i686-cygwin32_nt-cc.rul X$symlink i486-cygwin32_nt-cc.rul i786-cygwin32_nt-cc.rul X$symlink i486-cygwin32_nt-cc.rul i686-cygwin32_wow-cc.rul X$symlink i486-cygwin32_nt-cc.rul i786-cygwin32_wow-cc.rul X$symlink i486-cygwin32_nt-cc.rul i686-cygwin32_wow64-cc.rul X$symlink i486-cygwin32_nt-cc.rul i786-cygwin32_wow64-cc.rul X$symlink i486-cygwin32_nt-cc64.rul i686-cygwin32_wow-cc64.rul X$symlink i486-cygwin32_nt-cc64.rul i786-cygwin32_wow-cc64.rul X$symlink i486-cygwin32_nt-cc64.rul i686-cygwin32_wow64-cc64.rul X$symlink i486-cygwin32_nt-cc64.rul i786-cygwin32_wow64-cc64.rul X$symlink i486-cygwin32_nt-cl.rul i386-cygwin32_nt-cl.rul X$symlink i486-cygwin32_nt-cl.rul i586-cygwin32_nt-cl.rul X$symlink i486-cygwin32_nt-cl.rul i686-cygwin32_nt-cl.rul X$symlink i486-cygwin32_nt-cl.rul i786-cygwin32_nt-cl.rul X$symlink i486-cygwin32_nt-cl.rul i686-cygwin32_wow-cl.rul X$symlink i486-cygwin32_nt-cl.rul i786-cygwin32_wow-cl.rul X$symlink i486-cygwin32_nt-cl.rul i686-cygwin32_wow64-cl.rul X$symlink i486-cygwin32_nt-cl.rul i786-cygwin32_wow64-cl.rul X$symlink i686-cygwin32_wow64-cl64.rul i686-cygwin32_nt-cl64.rul X$symlink i686-cygwin32_wow64-cl64.rul i786-cygwin32_nt-cl64.rul X$symlink i686-cygwin32_wow64-cl64.rul i686-cygwin32_wow-cl64.rul X$symlink i686-cygwin32_wow64-cl64.rul i786-cygwin32_wow-cl64.rul X$symlink i486-cygwin32_nt-gcc.rul i386-cygwin32_nt-gcc.rul X$symlink i486-cygwin32_nt-gcc.rul i586-cygwin32_nt-gcc.rul X$symlink i486-cygwin32_nt-gcc.rul i686-cygwin32_nt-gcc.rul X$symlink i486-cygwin32_nt-gcc.rul i786-cygwin32_nt-gcc.rul X$symlink i486-cygwin32_nt-gcc.rul i686-cygwin32_wow-gcc.rul X$symlink i486-cygwin32_nt-gcc.rul i786-cygwin32_wow-gcc.rul X$symlink i486-cygwin32_nt-gcc.rul i686-cygwin32_wow64-gcc.rul X$symlink i486-cygwin32_nt-gcc.rul i786-cygwin32_wow64-gcc.rul X$symlink i486-cygwin32_nt-gcc64.rul i686-cygwin32_wow-gcc64.rul X$symlink i486-cygwin32_nt-gcc64.rul i786-cygwin32_wow-gcc64.rul X$symlink i486-cygwin32_nt-gcc64.rul i686-cygwin32_wow64-gcc64.rul X$symlink i486-cygwin32_nt-gcc64.rul i786-cygwin32_wow64-gcc64.rul X$symlink i486-cygwin32_nt-gcc.rul x86_64-cygwin32_nt-gcc.rul X$symlink i486-cygwin32_nt-gcc32.rul x86_64-cygwin32_nt-gcc32.rul X$symlink i486-cygwin32_nt-gcc64.rul x86_64-cygwin32_nt-gcc64.rul X$symlink power-macintosh-rhapsody-cc.rul power-macintosh-mac-os10-cc.rul X$symlink power-macintosh-rhapsody-gcc.rul power-macintosh-mac-os10-gcc.rul X$symlink power-macintosh-darwin-cc.rul power-macintosh-darwin-cc32.rul X$symlink power-macintosh-darwin-cc.rul power-macintosh-darwin-cc64.rul X$symlink power-macintosh-darwin-gcc.rul power-macintosh-darwin-gcc32.rul X$symlink power-macintosh-darwin-gcc.rul power-macintosh-darwin-gcc64.rul X$symlink power-macintosh-darwin-cc.rul i386-darwin-cc.rul X$symlink power-macintosh-darwin-gcc.rul i386-darwin-gcc.rul X$symlink power-macintosh-darwin-cc64.rul i386-darwin-cc64.rul X$symlink power-macintosh-darwin-gcc64.rul i386-darwin-gcc64.rul X$symlink power-macintosh-darwin-cc32.rul i386-darwin-cc32.rul X$symlink power-macintosh-darwin-gcc32.rul i386-darwin-gcc32.rul X$symlink power-macintosh-darwin-cc.rul x86_64-darwin-cc.rul X$symlink power-macintosh-darwin-gcc.rul x86_64-darwin-gcc.rul X$symlink power-macintosh-darwin-cc64.rul x86_64-darwin-cc64.rul X$symlink power-macintosh-darwin-gcc64.rul x86_64-darwin-gcc64.rul X$symlink power-macintosh-darwin-cc32.rul x86_64-darwin-cc32.rul X$symlink power-macintosh-darwin-gcc32.rul x86_64-darwin-gcc32.rul X$symlink i386-darwin-clang.rul i386-darwin-clang32.rul X$symlink i386-darwin-clang.rul i386-darwin-clang64.rul X$symlink i386-darwin-clang.rul x86_64-darwin-clang.rul X$symlink i386-darwin-clang32.rul x86_64-darwin-clang32.rul X$symlink i386-darwin-clang64.rul x86_64-darwin-clang64.rul X$symlink i86pc-sunos5-cc.rul i86pc-sunos5-cc32.rul X$symlink i86pc-sunos5-cc.rul i86pc-sunos5-cc64.rul X$symlink i86pc-sunos5-clang.rul i86pc-sunos5-clang32.rul X$symlink i86pc-sunos5-clang.rul i86pc-sunos5-clang64.rul X$symlink i86pc-sunos5-gcc.rul i86pc-sunos5-gcc32.rul X$symlink i86pc-sunos5-gcc.rul i86pc-sunos5-gcc64.rul X$symlink sun4-sunos5-gcc.rul aarch64-sunos5-gcc.rul X$symlink sun4-sunos5-gcc.rul aarch64-sunos5-gcc32.rul X$symlink sun4-sunos5-gcc.rul aarch64-sunos5-gcc64.rul X$symlink sun4-sunos5-clang.rul aarch64-sunos5-clang.rul X$symlink sun4-sunos5-clang.rul aarch64-sunos5-clang32.rul X$symlink sun4-sunos5-clang.rul aarch64-sunos5-clang64.rul X$symlink sun4-sunos5-cc.rul sun4-sunos5-cc32.rul X$symlink sun4-sunos5-cc.rul sun4-sunos5-cc64.rul X$symlink sun4-sunos5-clang.rul sun4-sunos5-clang32.rul X$symlink sun4-sunos5-clang.rul sun4-sunos5-clang64.rul X$symlink sun4-sunos5-gcc.rul sun4-sunos5-gcc32.rul X$symlink sun4-sunos5-gcc.rul sun4-sunos5-gcc64.rul X$symlink sun4-sunos4-cc.rul sun4c-sunos4-cc.rul X$symlink sun4-sunos4-gcc.rul sun4c-sunos4-gcc.rul X$symlink sun4-sunos5-cc.rul sun4c-sunos5-cc.rul X$symlink sun4-sunos5-gcc.rul sun4c-sunos5-gcc.rul X$symlink sun4-sunos4-cc.rul sun4m-sunos4-cc.rul X$symlink sun4-sunos4-gcc.rul sun4m-sunos4-gcc.rul X$symlink sun4-sunos5-cc.rul sun4m-sunos5-cc.rul X$symlink sun4-sunos5-gcc.rul sun4m-sunos5-gcc.rul X$symlink sun4-sunos5-cc.rul sun4d-sunos5-cc.rul X$symlink sun4-sunos5-gcc.rul sun4d-sunos5-gcc.rul X$symlink sun4-sunos5-cc.rul sun4e-sunos5-cc.rul X$symlink sun4-sunos5-gcc.rul sun4e-sunos5-gcc.rul X$symlink sun4-sunos5-cc.rul sun4L-sunos5-cc.rul X$symlink sun4-sunos5-gcc.rul sun4L-sunos5-gcc.rul X$symlink sun4-sunos5-cc.rul sun4u-sunos5-cc.rul X$symlink sun4-sunos5-gcc.rul sun4u-sunos5-gcc.rul X$symlink sun4-sunos5-cc64.rul sun4u-sunos5-cc64.rul X$symlink sun4-sunos5-gcc64.rul sun4u-sunos5-gcc64.rul X$symlink sun4-sunos5-cc.rul sun4us-sunos5-cc.rul X$symlink sun4-sunos5-gcc.rul sun4us-sunos5-gcc.rul X$symlink sun4-sunos5-cc64.rul sun4us-sunos5-cc64.rul X$symlink sun4-sunos5-gcc64.rul sun4us-sunos5-gcc64.rul X$symlink sun4-sunos5-cc.rul sun4v-sunos5-cc.rul X$symlink sun4-sunos5-gcc.rul sun4v-sunos5-gcc.rul X$symlink sun4-sunos5-cc64.rul sun4v-sunos5-cc64.rul X$symlink sun4-sunos5-gcc64.rul sun4v-sunos5-gcc64.rul X$symlink i386-unixware-cc.rul i486-unixware-cc.rul X$symlink i386-unixware-gcc.rul i486-unixware-gcc.rul X$symlink i386-unixware-cc.rul i586-unixware-cc.rul X$symlink i386-unixware-gcc.rul i586-unixware-gcc.rul X$symlink i386-unixware-cc.rul pentium-iii-unixware-cc.rul X$symlink i386-unixware-gcc.rul pentium-iii-unixware-gcc.rul X$symlink i386-unixware-cc.rul pentium-pro-unixware-cc.rul X$symlink i386-unixware-gcc.rul pentium-pro-unixware-gcc.rul X$symlink i386-unixware-cc.rul pentium-4-unixware-cc.rul X$symlink i386-unixware-gcc.rul pentium-4-unixware-gcc.rul X$symlink i386-ms-dos-gcc.rul i486-ms-dos-gcc.rul X$symlink i386-ms-dos-gcc.rul i586-ms-dos-gcc.rul X$symlink i386-ms-dos-gcc.rul i686-ms-dos-gcc.rul X$symlink i386-ms-dos-gcc.rul i786-ms-dos-gcc.rul X$symlink atarist-freemint-gcc.rul atariclone-freemint-gcc.rul X$symlink atarist-freemint-gcc.rul atariste-freemint-gcc.rul X$symlink atarist-freemint-gcc.rul ataritt-freemint-gcc.rul X$symlink atarist-freemint-gcc.rul falcon-freemint-gcc.rul X$symlink atarist-freemint-gcc.rul milan-freemint-gcc.rul X$symlink atarist-freemint-gcc.rul hades-freemint-gcc.rul X$symlink atarist-freemint-gcc.rul aranym-freemint-gcc.rul X$symlink bepc-beos-gcc.rul bemac-beos-gcc.rul X$symlink bepc-haiku-cc.rul bemac-haiku-cc.rul X$symlink bepc-haiku-gcc.rul bemac-haiku-gcc.rul X$symlink bepc-haiku-cc.rul x86_64-haiku-cc.rul X$symlink bepc-haiku-gcc.rul x86_64-haiku-gcc.rul X$symlink alpha-openvms-cc.rul alphaserver_ds20_500_mhz-openvms-cc.rul X$symlink rs6000-aix-cc.rul rs6000-aix-cc32.rul X$symlink rs6000-aix-cc.rul rs6000-aix-cc64.rul X$symlink rs6000-aix-gcc.rul rs6000-aix-gcc32.rul X$symlink rs6000-aix-gcc.rul rs6000-aix-gcc64.rul END-of-star-1.6/RULES/MKLINKS echo x - star-1.6/RULES/hppa-nextstep-cc.rul sed 's/^X//' >star-1.6/RULES/hppa-nextstep-cc.rul << 'END-of-star-1.6/RULES/hppa-nextstep-cc.rul' X#ident "@(#)hppa-nextstep-cc.rul 1.15 18/04/11 " X########################################################################### X# Written 1996-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for NeXT Step on hppa (GCC) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-gcc.rul XCC_COM_DEF= cc X XOSDEFS += X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%) XLDOPTS= $(LIBS_PATH) $(LDPATH) XLDOPTDYN= XLNDYNLIB= @ X XDYNLD= @echo " ==> LINKING dynamic library \"$@\""; ld XRANLIB= @echo " ==> RANDOMIZING ARCHIVE \"$@\""; ranlib X X_MKDIR= $(_MKDIR_SH) XMKDIR= $(MKDIR_SH) XINSMKDIR= $(INSMKDIR_SH) END-of-star-1.6/RULES/hppa-nextstep-cc.rul echo x - star-1.6/RULES/i386-openserver-cc.rul sed 's/^X//' >star-1.6/RULES/i386-openserver-cc.rul << 'END-of-star-1.6/RULES/i386-openserver-cc.rul' X#ident "@(#)i386-openserver-cc.rul 1.5 13/07/21 " X########################################################################### X# Written 1999 by J. Schilling/Santa Cruz Operation X########################################################################### X# X# Platform dependent MACROS for SCO OpenServer 5 using cc X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-sco_os.rul X XOSDEFS += -DSCO -DOPENSERVER X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_SOCKET= -lsocket -lnsl -ldl XLIB_MATH= -lm XLIB_KVM= X XLORDER= echo XTSORT= cat X END-of-star-1.6/RULES/i386-openserver-cc.rul echo x - star-1.6/RULES/rules.cmd sed 's/^X//' >star-1.6/RULES/rules.cmd << 'END-of-star-1.6/RULES/rules.cmd' X#ident @(#)rules.cmd 1.17 18/08/14 X########################################################################### X# Written 1996-2013 by J. Schilling X########################################################################### X# X# Rules for user level commands (usually found in .../bin) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X_EXEEXT= $(EXEEXT) X_XEXEEXT= $(XEXEEXT) X########################################################################### XINSFLAGS += $(STRIPFLAGS) X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.obj Xinclude $(SRCROOT)/$(RULESDIR)/rules.dyn X########################################################################### X X_INSMODEI= $(_UNIQ)$(INSMODE) X__INSMODEI= $(_INSMODEI:$(_UNIQ)=$(INSMODEX)) XINSMODEI= $(__INSMODEI:$(_UNIQ)%=%) X X__LD_OUTPUT_OPTION= $(_UNIQ)$(LD_OUTPUT_OPTION) X___LD_OUTPUT_OPTION= $(__LD_OUTPUT_OPTION:$(_UNIQ)=-o $@) X_LD_OUTPUT_OPTION= $(___LD_OUTPUT_OPTION:$(_UNIQ)%=%) X XLIBS_PATH += $(LIBS_PATH_STATIC) X Xall: $(PTARGET) $(MAN) X X$(PTARGET): $(OFILES) $(SRCLIBS) X $(LDCC) $(_LD_OUTPUT_OPTION) $(POFILES) $(LDFLAGS) $(LDLIBS) X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/sub.htm Xinclude $(SRCROOT)/$(RULESDIR)/rules.lnt Xinclude $(SRCROOT)/$(RULESDIR)/rules.clr Xinclude $(SRCROOT)/$(RULESDIR)/rules.ins Xinclude $(SRCROOT)/$(RULESDIR)/rules.tag Xinclude $(SRCROOT)/$(RULESDIR)/rules.hlp Xinclude $(SRCROOT)/$(RULESDIR)/rules.dep Xinclude $(SRCROOT)/$(RULESDIR)/rules.cst X########################################################################### END-of-star-1.6/RULES/rules.cmd echo x - star-1.6/RULES/rules.sps sed 's/^X//' >star-1.6/RULES/rules.sps << 'END-of-star-1.6/RULES/rules.sps' X#ident "@(#)rules.sps 1.16 18/08/16 " X########################################################################### X# Written 2005-2013 by J. Schilling X########################################################################### X# X# Rules for wrapping around other make systems X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XPTARGET= $(TARGET) XSRCFILE= $(TARGET) X########################################################################### X X_INSMODEI= $(_UNIQ)$(INSMODE) X__INSMODEI= $(_INSMODEI:$(_UNIQ)=$(INSMODEF)) XINSMODEI= $(__INSMODEI:$(_UNIQ)%=%) X X#all: $(SRCFILE) X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/sub.htm Xinclude $(SRCROOT)/$(RULESDIR)/rules.clr X#include $(SRCROOT)/$(RULESDIR)/rules.ins Xinclude $(SRCROOT)/$(RULESDIR)/rules.tag Xinclude $(SRCROOT)/$(RULESDIR)/rules.hlp Xinclude $(SRCROOT)/$(RULESDIR)/dummy.dep Xinclude $(SRCROOT)/$(RULESDIR)/rules.tpk X########################################################################### X Xall: $(ARCHDIR)/config.status $(POSTCONFIG) X cd $(ARCHDIR)/; "$(MAKE)" $(MAKEMACS) $(MAKEOPTS) $@ X Xinstall: all X cd $(ARCHDIR)/; DESTDIR=$(DEST_DIR) "$(MAKE)" $(MAKEMACS) $(MAKEOPTS) DESTDIR=$(DEST_DIR) $@ X X# X# Hack until the --*cc.rul files are updated X# X_HCC_COM= $(OARCH:%-gcc=gcc) XHCC_COM= $(_HCC_COM:%-cc=cc) X X_XCC_COM= $(_UNIQ)$(CC_COM) X__XCC_COM= $(_XCC_COM:$(_UNIQ)=$(HCC_COM)) XXCC_COM= $(__XCC_COM:$(_UNIQ)%=%) X X_CONF_SCRIPT= $(_UNIQ)$(CONF_SCRIPT) X__CONF_SCRIPT= $(_CONF_SCRIPT:$(_UNIQ)=configure) XCONFSCRIPT= $(__CONF_SCRIPT:$(_UNIQ)%=%) X X# X# Note: $(___CONF_SCR:$(_UNIQ)=:) is not accepted by Sun make X# because of a parser bug. We thus use "true". X# XCOLON=: X_CONF_SCR= $(CONFSCRIPT:none=) X__CONF_SCR= $(_CONF_SCR:%=../../$(SRC_DIR)/%) X___CONF_SCR= $(_UNIQ)$(__CONF_SCR) X____CONF_SCR= $(___CONF_SCR:$(_UNIQ)=true) XPCONFSCRIPT= $(____CONF_SCR:$(_UNIQ)%=%) X X_LNDIR_PRG= $(_UNIQ)$(LNDIR_PRG) X__LNDIR_PRG= $(_LNDIR_PRG:$(_UNIQ)=:) XLNDIRPRG= $(__LNDIR_PRG:$(_UNIQ)%=%) X X#$(ARCHDIR)/config.status: $(SRC_DIR)/$(CONFSCRIPT) X X # Expands to: $(SRC_DIR)/$(CONFSCRIPT) is non-empty X$(ARCHDIR)/config.status: $(_CONF_SCR:%=$(SRC_DIR)/%) X mkdir -p $(ARCHDIR)/; cd $(ARCHDIR)/; \ X $(LNDIRPRG) ../../$(SRC_DIR)/; \ X CC="$(XCC_COM)" CFLAGS="$(C_FLAGS) $(CFLAGS)" MAKE="$(MAKE)" $(MAKEMACS) $(PCONFSCRIPT) $(CONF_OPTS) && \ X ( [ ! -f config.status ] && touch config.status || : ) END-of-star-1.6/RULES/rules.sps echo x - star-1.6/RULES/os-minix.def sed 's/^X//' >star-1.6/RULES/os-minix.def << 'END-of-star-1.6/RULES/os-minix.def' X#ident "@(#)os-minix.def 1.1 15/11/08 " X########################################################################### X# Written 2015 by J. Schilling X########################################################################### X# X# Global os definitions for Minix X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XMANSTYLE= bsd END-of-star-1.6/RULES/os-minix.def echo x - star-1.6/RULES/os-news-os.id sed 's/^X//' >star-1.6/RULES/os-news-os.id << 'END-of-star-1.6/RULES/os-news-os.id' X#ident @(#)os-news-os.id 1.2 06/05/14 X########################################################################### X# X# OS specific MACRO definitions for Sony NEWS-OS 6.x X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X_O_ARCH= $(OSREL:5.%=newsos5) XO_ARCH= $(_O_ARCH:6.%=newsos6) X-O_ARCH= -$(O_ARCH) END-of-star-1.6/RULES/os-news-os.id echo x - star-1.6/RULES/os-newsos6.def sed 's/^X//' >star-1.6/RULES/os-newsos6.def << 'END-of-star-1.6/RULES/os-newsos6.def' X#ident @(#)os-newsos6.def 1.2 06/05/14 X########################################################################### X# X# Global os definitions for Sony NEWS-OS 6.x X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XMANSTYLE= sysv END-of-star-1.6/RULES/os-newsos6.def echo x - star-1.6/RULES/os-nextstep.def sed 's/^X//' >star-1.6/RULES/os-nextstep.def << 'END-of-star-1.6/RULES/os-nextstep.def' X#ident "@(#)os-nextstep.def 1.2 06/05/14 " X########################################################################### X# Written 1997 by J. Schilling X########################################################################### X# X# Global os definitions for NeXT Step X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XMANSTYLE= bsd END-of-star-1.6/RULES/os-nextstep.def echo x - star-1.6/RULES/os-nextstep.id sed 's/^X//' >star-1.6/RULES/os-nextstep.id << 'END-of-star-1.6/RULES/os-nextstep.id' X#ident "@(#)os-nextstep.id 1.2 06/05/14 " X########################################################################### X# Written 1997 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for NeXT Step X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= nextstep X-O_ARCH= -$(O_ARCH) END-of-star-1.6/RULES/os-nextstep.id echo x - star-1.6/RULES/os-openbsd.def sed 's/^X//' >star-1.6/RULES/os-openbsd.def << 'END-of-star-1.6/RULES/os-openbsd.def' X#ident "@(#)os-openbsd.def 1.3 06/05/14 " X########################################################################### X# Written 1997 by J. Schilling X########################################################################### X# X# Global os definitions for OpenBSD X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XMANSTYLE= bsd END-of-star-1.6/RULES/os-openbsd.def echo x - star-1.6/RULES/os-openbsd.id sed 's/^X//' >star-1.6/RULES/os-openbsd.id << 'END-of-star-1.6/RULES/os-openbsd.id' X#ident "@(#)os-openbsd.id 1.3 06/05/14 " X########################################################################### X# Written 1997 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for OpenBSD X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= openbsd X-O_ARCH= -$(O_ARCH) END-of-star-1.6/RULES/os-openbsd.id echo x - star-1.6/RULES/os-openserver.def sed 's/^X//' >star-1.6/RULES/os-openserver.def << 'END-of-star-1.6/RULES/os-openserver.def' X#ident "@(#)os-openserver.def 1.2 06/05/14 " X########################################################################### X# Written 1999 by J. Schilling/Santa Cruz Operation X########################################################################### X# X# Global os definitions for SCO OpenServer 5 Systems X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XMANSTYLE= sysv END-of-star-1.6/RULES/os-openserver.def echo x - star-1.6/RULES/os-openvms.def sed 's/^X//' >star-1.6/RULES/os-openvms.def << 'END-of-star-1.6/RULES/os-openvms.def' X#ident "@(#)os-openvms.def 1.1 09/10/29 " X########################################################################### X# Written 2009 by J. Schilling X########################################################################### X# X# Global definitions for OpenVMS X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XMANSTYLE= bsd END-of-star-1.6/RULES/os-openvms.def echo x - star-1.6/RULES/r-smake.dep sed 's/^X//' >star-1.6/RULES/r-smake.dep << 'END-of-star-1.6/RULES/r-smake.dep' X#ident "@(#)r-smake.dep 2.2 18/08/16 " X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# Dependency building rules for smake X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XDEP_SUFFIX= .d XRMDEP= $(RM) $(RM_FORCE) $@ X___C++DEP_FILES= $(C++FILES:%.C=%.d) X__C++DEP_FILES= $(___C++DEP_FILES:%.cc=%.d) X_C++DEP_FILES= $(__C++DEP_FILES:%.cpp=%.d) XC++DEP_FILES= $(_C++DEP_FILES:%.cxx=%.d) XC++PDEP_FILES= $(C++DEP_FILES:%=$(ARCHDIR)/%) XDEP_FILE= $(CFILES:%.c=%.d) $(C++DEP_FILES) XPDEP_FILE= $(CFILES:%.c=$(ARCHDIR)/%.d) $(C++PDEP_FILES) XPALLDEP_FILE= $(CFILES:%.c=$(ARCHDIR)/%.d) $(C++PDEP_FILES) $(ARCHDIR)/$(TARGET).dep XDEP_DEP= $(ARCHDIR)/Dnull X########################################################################### Xdepend: rmdep $(DEP_FILE) X Xrmdep: X $(RM) $(RM_FORCE) $(PALLDEP_FILE) X X########################################################################### X# X# Make the complete path to the architecture subdirectory. X# Make $(ARCHDIR)/man as well here to avoid this directory to become root X# owned when root later calls "make install". X# X########################################################################### X$(ARCHDIR) $(ARCHDIR)/man: X $(MKDIR) -p $@ X X########################################################################### X# X# Generate dependency file(s). X# This rules is checked when the dependency file(s) are included. X# X# Modify the the path for .o files to reflect that they are placed in X# $(ARCHDIR). Add the dependency file itself to each line so that X# the dependencies will be rebuilt if a source is newer that the X# appropriate dependency file. X# X########################################################################### X X# Do not define Simple Suffix Rules anymore X#.d: .c X# $(MKDEP) $(CPP_FLAGS) $(CPPFLAGS) $(MKDEP_OUT) $< \ X# | sed -e 's;^\(.*\)\.$o[ ]*:;\1.$o \1.d:;' > $(ARCHDIR)/$@ X X$(ARCHDIR)/%.d: %.c X $(MKDEP) $(CPP_FLAGS) $(CPPFLAGS) $(MKDEP_OUT) $< \ X | sed -e 's;^\(.*\)\.$o[ ]*:;$(ARCHDIR)/\1.$o $(ARCHDIR)/\1.d:;' > $@ X X$(ARCHDIR)/%.d: %.C X $(MKC++DEP) $(CPP_FLAGS) $(CPPFLAGS) $(MKC++DEP_OUT) $< \ X | sed -e 's;^\(.*\)\.$o[ ]*:;$(ARCHDIR)/\1.$o $(ARCHDIR)/\1.d:;' > $@ X$(ARCHDIR)/%.d: %.cc X $(MKC++DEP) $(CPP_FLAGS) $(CPPFLAGS) $(MKC++DEP_OUT) $< \ X | sed -e 's;^\(.*\)\.$o[ ]*:;$(ARCHDIR)/\1.$o $(ARCHDIR)/\1.d:;' > $@ X$(ARCHDIR)/%.d: %.cpp X $(MKC++DEP) $(CPP_FLAGS) $(CPPFLAGS) $(MKC++DEP_OUT) $< \ X | sed -e 's;^\(.*\)\.$o[ ]*:;$(ARCHDIR)/\1.$o $(ARCHDIR)/\1.d:;' > $@ X$(ARCHDIR)/%.d: %.cxx X $(MKC++DEP) $(CPP_FLAGS) $(CPPFLAGS) $(MKC++DEP_OUT) $< \ X | sed -e 's;^\(.*\)\.$o[ ]*:;$(ARCHDIR)/\1.$o $(ARCHDIR)/\1.d:;' > $@ X X$(PDEP_FILE): $(DEP_DEP) X X$(DEP_DEP): X @if [ ! -f $@ ]; then \ X echo " ==> MAKING DIRECTORY \"$(ARCHDIR)\""; \ X $(_MKDIR) -p $(ARCHDIR); \ X echo " ==> MAKING DIRECTORY \"$(ARCHDIR)/man\""; \ X $(_MKDIR) -p $(ARCHDIR)/man; \ X echo > $@; \ X fi X X#$(DEP_FILE): X# $(MKDEP) $(CPP_FLAGS) $(CPPFLAGS) -f - $(CFILES) \ X# | sed -e 's;^\(.*\.$o[ ]*:\);$(ARCHDIR)/\1;' > $@ X X########################################################################### X# X# Include the dependency file(s) generated from the rules above. X# X########################################################################### Xinclude $(PDEP_FILE) END-of-star-1.6/RULES/r-smake.dep echo x - star-1.6/RULES/cc-msposix.rul sed 's/^X//' >star-1.6/RULES/cc-msposix.rul << 'END-of-star-1.6/RULES/cc-msposix.rul' X#ident "@(#)cc-msposix.rul 1.25 18/08/16 " X########################################################################### X# Written 2006-2013 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for INTERIX using MSVC in POSIX c89 mode X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X XCPP_FLAGS= -DSCHILY_BUILD $(CPPOPTS) $(CPPOPTX) $(OSINCDIRS:%=-I%) $(OSDEFS) $(OSDEFSX) XC_FLAGS= $(COPTS) $(CWARNOPTS) $(COPTOPT) $(MSCOPTOPT) $(COPTX) XC++FLAGS= $(C++OPTS) $(C++WARNOPTS) $(C++OPTOPT) $(MSC++OPTOPT) $(C++OPTX) X XCPPOPTS= -I$(ARCHDIR) -I$(OINCSDIR) $(INCDIRS:%=-I%) $(INCDIRSX:%=-I%) XCOPTS= XCWOPTS= XCOPTOPT= -O2 XCOPTDYN= X#COPTGPROF= -pg X# X# /EHs C++-EH aktivieren (ohne SEH-Ausnahmen) X# /EHa C++-EH aktivieren (mit SEH-Ausnahmen) X# /EHc nothrow als Standard fr externes "C" X# MS seems to need -EHsc in order to create useful code with exceptions X# XC++OPTS= -EHsc XC++WOPTS= -W3 XC++OPTOPT= -O2 XC++OPTDYN= X#C++OPTGPROF= -pg X X XLIB_PREFIX= XLIB_SUFFIX= .lib XSHL_SUFFIX= .dll X XLIB_C= -lc X XLIBS_PATH= -L$(OLIBSDIR) XLIBS_PATH_STATIC= -L$(OLIBSDIR_STATIC) X XLDFLAGS= $(LDOPTS) $(LDOPTX) XLDLIBS= $(LIBS:-l%=%.lib) $(LIBX:-l%=%.lib) X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH) XLDOPTS= $(LIBS_PATH) $(LDPATH) X#LDOPTDYN= -shared -Wl,-soname,$(TARGET) XLDOPTDYN= -dll -def:$(TARGETLIB).def XLNDYNLIB= @ X XFLOAT_OPTIONS= X X__CC_COM= $(_UNIQ)$(CC) X___CC_COM= $(__CC_COM:$(_UNIQ)=$(CC_COM_DEF)) XCC_COM= $(___CC_COM:$(_UNIQ)%=%) X X__CC++_COM= $(_UNIQ)$(CCC) X___CC++_COM= $(__CC++_COM:$(_UNIQ)=$(CC++_COM_DEF)) XCC++_COM= $(___CC++_COM:$(_UNIQ)%=%) X XCC_COM_DEF= cc XCC++_COM_DEF= $(CC_COM_DEF) XCC= $(CC_COM_DEF) XCCC= $(CC++_COM_DEF) X XCCCC= @echo " ==> COMPILING \"$@\""; $(CC_COM) XCC++ = @echo " ==> COMPILING \"$@\""; $(CC_COM) X#OUTPUT_OPTION= -Fo$(O:%=%/)$@ X#LD_OUTPUT_OPTION= -Fe$@ XLDCC= @echo " ==> LINKING \"$@\""; $(CC_COM) XLDCC++ = @echo " ==> LINKING \"$@\""; $(CC_COM) XDYNLD= @echo " ==> LINKING dynamic library \"$@\""; $(CC_COM) XDYNLDC++ = @echo " ==> LINKING dynamic library \"$@\""; $(CC_COM) -nologo XDYNLD.o= $(DYNLD) `$(LORDER) $(POFILES) | $(TSORT)` $(LDFLAGS) -out:$@ $(LDLIBS) X XRANLIB= @echo " ==> RANDOMIZING ARCHIVE \"$@\""; true XAR= @echo " ==> ARCHIVING \"$@\""; lib.exe -nologo XARFLAGS= XAR.o= $(AR) $(ARFLAGS) -out:$@ X XRMDEP= : XMKDEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); sh $(SRCROOT)/conf/mkdep-msc.sh XMKDEP_OUT= XMKC++DEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); sh $(SRCROOT)/conf/mkdep-msc.sh XMKC++DEP_OUT= X XVC=7 X X_VC_SETUP= $(_UNIQ)$(VC_SETUP) X__VC_SETUP= $(_VC_SETUP:$(_UNIQ)=vc$(VC)$(_PLATFORM:%=-%)-setup) XVCSETUP= $(__VC_SETUP:$(_UNIQ)%=%) X X########################################################################### X# IMPORTANT Note: X# We also include $(DEFLTSROOT)/$(DEFLTSDIR)/$(VCSETUP) from Defaults.* X# in order to be able to test for the existence of "/bin/cc" early. X########################################################################### Xinclude $(DEFLTSROOT)/$(DEFLTSDIR)/$(VCSETUP) END-of-star-1.6/RULES/cc-msposix.rul echo x - star-1.6/RULES/rules.ars sed 's/^X//' >star-1.6/RULES/rules.ars << 'END-of-star-1.6/RULES/rules.ars' X#ident "@(#)rules.ars 1.1 18/01/16 " X########################################################################### X# Written 1996-2018 by J. Schilling X########################################################################### X# X# Name of make program Schily SunPro Make X# X# This code does not work for the Sun/Oracle original program as there X# is no support for the "export" directive. X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X X########################################################################### X# X# standard (automatic) machine identification X# X########################################################################### X# X# XP_ARCH = uname -p = mach # Processor (sparc/mc68020) X# XK_ARCH = uname -m = arch -k # Kernel (sun3/sun4c/sun4m) X# XM_ARCH = arch ~ arch -k # Machine (sun3/sun4) X# X########################################################################### X# X# Due to a bug in /usr/xpg*/bin/tr on Solaris, we cannot directly translit X# many different chars to '-' using e.g. tr ', /\\()"' ',------' X# X# This is why we use sed 'y%ABC\\%abc-%'. Note that this will not work on *BSD X# X########################################################################### X XXP_ARCH:sh= (mach || uname -p || true)2>/dev/null | sed 'y%ABCDEFGHIJKLMNOPQRSTUVWXYZ, /\\()"%abcdefghijklmnopqrstuvwxyz,------%' XXK_ARCH:sh= uname -m | sed 'y%ABCDEFGHIJKLMNOPQRSTUVWXYZ, /\\()"%abcdefghijklmnopqrstuvwxyz,------%' XXM_ARCH:sh= (arch || /usr/ucb/arch || true)2>/dev/null | sed 'y%ABCDEFGHIJKLMNOPQRSTUVWXYZ, /\\()"%abcdefghijklmnopqrstuvwxyz,------%' X XOSNAME:sh= uname -s | sed 'y%ABCDEFGHIJKLMNOPQRSTUVWXYZ, /\\()"%abcdefghijklmnopqrstuvwxyz,------%' XOSREL:sh= uname -r | sed 'y%ABCDEFGHIJKLMNOPQRSTUVWXYZ, /\\()"%abcdefghijklmnopqrstuvwxyz,------%' XOSVERSION:sh= uname -v | sed 'y%ABCDEFGHIJKLMNOPQRSTUVWXYZ, /\\()"%abcdefghijklmnopqrstuvwxyz,------%' X XARCH_DONE= TRUE X Xexport XP_ARCH Xexport XK_ARCH Xexport XM_ARCH Xexport OSNAME Xexport OSREL Xexport OSVERSION X Xexport ARCH_DONE END-of-star-1.6/RULES/rules.ars echo x - star-1.6/RULES/cc-sony.rul sed 's/^X//' >star-1.6/RULES/cc-sony.rul << 'END-of-star-1.6/RULES/cc-sony.rul' X#ident @(#)cc-sony.rul 1.18 18/08/16 X########################################################################### X# Written 1996-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for Sony cc X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X XCPP_FLAGS= -DSCHILY_BUILD $(CPPOPTS) $(CPPOPTX) $(OSINCDIRS:%=-I%) $(OSDEFS) $(OSDEFSX) XC_FLAGS= $(COPTS) $(CWARNOPTS) $(COPTOPT) $(SONYCOPTOPT) $(COPTX) XC++FLAGS= $(C++OPTS) $(C++WARNOPTS) $(C++OPTOPT) $(SONYC++OPTOPT) $(C++OPTX) X XCPPOPTS= -I$(ARCHDIR) -I$(OINCSDIR) $(INCDIRS:%=-I%) $(INCDIRSX:%=-I%) XCOPTS= XCWOPTS= -fullwarn XCOPTOPT= -O XCOPTDYN= -Kpic XCOPTGPROF= -p1 XC++OPTS= XC++WOPTS= X#C++OPTOPT= -O X#C++OPTDYN= -Kpic X#C++OPTGPROF= -xpg X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR) X XLIB_C= -lc X XLIBS_PATH= -L$(OLIBSDIR) XLIBS_PATH_STATIC= -L$(OLIBSDIR_STATIC) X XLDFLAGS= $(LDOPTS) $(LDOPTX) XLDLIBS= $(LIBS) $(LIBX) X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH) XLDOPTS= $(LIBS_PATH) $(LDPATH) X#LDOPTDYN= -dy -G -ztext -h $(TARGET) -ldl XLNDYNLIB= @ X XFLOAT_OPTIONS= X X__CC_COM= $(_UNIQ)$(CC) X___CC_COM= $(__CC_COM:$(_UNIQ)=$(CC_COM_DEF)) XCC_COM= $(___CC_COM:$(_UNIQ)%=%) X X__CC++_COM= $(_UNIQ)$(CCC) X___CC++_COM= $(__CC++_COM:$(_UNIQ)=$(CC++_COM_DEF)) XCC++_COM= $(___CC++_COM:$(_UNIQ)%=%) X XCC_COM_DEF= cc XCC++_COM_DEF= echo "C++ not yet supported"; exit -1; : X# X# Use to comment out C++ projects X# XC++BUILD= $(NUMBER_SIGN) X XCC= $(CC_COM_DEF) XCCC= $(CC++_COM_DEF) X XCCCC= @echo " ==> COMPILING \"$@\""; $(CC_COM) XLDCC= @echo " ==> LINKING \"$@\""; $(CC_COM) XDYNLD= @echo " ==> LINKING dynamic library \"$@\""; $(CC_COM) XRANLIB= @echo " ==> RANDOMIZING ARCHIVE \"$@\""; true X XRMDEP= : XMKDEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); $(CC_COM) -M XMKDEP_OUT= X XCC++ = @echo " ==> COMPILING \"$@\""; $(CC++_COM) XLDCC++ = @echo " ==> LINKING \"$@\""; $(CC++_COM) XDYNLDC++ = @echo " ==> LINKING dynamic library \"$@\""; $(CC++_COM) XMKC++DEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); $(CC++_COM) -M XMKC++DEP_OUT= END-of-star-1.6/RULES/cc-sony.rul echo x - star-1.6/RULES/cc-sunpro.rul sed 's/^X//' >star-1.6/RULES/cc-sunpro.rul << 'END-of-star-1.6/RULES/cc-sunpro.rul' X#ident "@(#)cc-sunpro.rul 1.20 18/08/16 " X########################################################################### X# Written 1996-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for SunPro (Studio) cc X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X XCPP_FLAGS= -DSCHILY_BUILD $(CPPOPTS) $(CPPOPTX) $(OSINCDIRS:%=-I%) $(OSDEFS) $(OSDEFSX) XC_FLAGS= $(COPTS) $(CWARNOPTS) $(COPTOPT) $(SUNPROCOPTOPT) $(COPTX) XC++FLAGS= $(C++OPTS) $(C++WARNOPTS) $(C++OPTOPT) $(SUNPROC++OPTOPT) $(C++OPTX) X XLINTFLAGS= -Nlevel=4 X X_SUNPROCOPT= $(_UNIQ)$(XARCH_GEN_) X__SUNPROCOPT= $(_SUNPROCOPT:$(_UNIQ)=-xarch=generic) XSUNPROCOPT= $(__SUNPROCOPT:$(_UNIQ)%=%) X XSUN_CC32_OPT= $(SUN_CC64_OPT:-m64=-m32) X X_SUNPROCOPT32= $(_UNIQ)$(SUN_CC32_OPT) X__SUNPROCOPT32= $(_SUNPROCOPT32:$(_UNIQ)=-xarch=generic) XSUNPROCOPT32= $(__SUNPROCOPT32:$(_UNIQ)%=%) X X_SUNPROCOPT64= $(_UNIQ)$(SUN_CC64_OPT) X__SUNPROCOPT64= $(_SUNPROCOPT64:$(_UNIQ)=-xarch=generic64) XSUNPROCOPT64= $(__SUNPROCOPT64:$(_UNIQ)%=%) X XC_ARCH_= $(C_ARCH:suncc%=%) XSUNPROCOPTXX= $(SUNPROCOPT$(C_ARCH_:cc%=%)) XXARCH_GEN= $(SUNPROCOPTXX) X XCPPOPTS= -I$(ARCHDIR) -I$(OINCSDIR) $(INCDIRS:%=-I%) $(INCDIRSX:%=-I%) XCOPTS= -Xa $(SUNPROCOPTXX) XCWOPTS= -v XCOPTOPT= -O XCOPTDYN= -Kpic XCOPTGPROF= -xpg XC++OPTS= $(SUNPROCOPTXX) XC++WOPTS= XC++OPTOPT= -O XC++OPTDYN= -Kpic XC++OPTGPROF= -xpg X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR) X XLIB_C= -lc X XLIBS_PATH= -L$(OLIBSDIR) XLIBS_PATH_STATIC= -L$(OLIBSDIR_STATIC) X XLDFLAGS= $(LDOPTS) $(LDOPTX) XLDLIBS= $(LIBS) $(LIBX) X X# X# Sunpro C/C++ run on Solaris and Linux and both have linkers X# that support mapfiles X# XMAPVERS= $(_MAPVERS) # This enables to use mapfiles X XLDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH) XLDOPTDYN= -dy -G -ztext -h $(TARGET) $(PMAPVERS:%=-M%) -ldl XLNDYNLIB= @$(RM) $(RM_FORCE) $(PTARGET_BASE).so; $(SYMLINK) $(TARGET) $(PTARGET_BASE).so X XFLOAT_OPTIONS= X X__CC_COM= $(_UNIQ)$(CC) X___CC_COM= $(__CC_COM:$(_UNIQ)=$(CC_COM_DEF)) XCC_COM= $(___CC_COM:$(_UNIQ)%=%) X X__CC++_COM= $(_UNIQ)$(CCC) X___CC++_COM= $(__CC++_COM:$(_UNIQ)=$(CC++_COM_DEF)) XCC++_COM= $(___CC++_COM:$(_UNIQ)%=%) X XCC_COM_DEF= cc XCC++_COM_DEF= CC XCC= $(CC_COM_DEF) XCCC= $(CC++_COM_DEF) X XCCCC= @echo " ==> COMPILING \"$@\""; $(CC_COM) $(SUNPROCOPTXX) XCC++ = @echo " ==> COMPILING \"$@\""; $(CC++_COM) $(SUNPROCOPTXX) XLDCC= @echo " ==> LINKING \"$@\""; $(CC_COM) $(SUNPROCOPTXX) XLDCC++ = @echo " ==> LINKING \"$@\""; $(CC++_COM) $(SUNPROCOPTXX) XDYNLD= @echo " ==> LINKING dynamic library \"$@\""; $(CC_COM) $(SUNPROCOPTXX) XDYNLDC++ = @echo " ==> LINKING dynamic library \"$@\""; $(CC++_COM) $(SUNPROCOPTXX) X XRMDEP= : XMKDEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); $(CC_COM) -xM $(SUNPROCOPTXX) XMKDEP_OUT= XMKC++DEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); $(CC++_COM) -xM $(SUNPROCOPTXX) XMKC++DEP_OUT= END-of-star-1.6/RULES/cc-sunpro.rul echo x - star-1.6/RULES/rules.rel sed 's/^X//' >star-1.6/RULES/rules.rel << 'END-of-star-1.6/RULES/rules.rel' X#ident @(#)rules.rel 1.10 15/08/22 X########################################################################### X# Written 2001 by J. Schilling X########################################################################### X# X# Release building rules X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X XMAKE_LICENSE=MKGNU2 XREL_SRC_MATCH=cat XREL_MAKEFILE_MATCH=cat X XDRELFILES= $(CFILES:%=release/%) $(HFILES:%=release/%) $(XRELFILES:%=release/%) X X_RELFILES= $(_UNIQ)$(RELFILES) X__RELFILES= $(_RELFILES:$(_UNIQ)=$(DRELFILES)) XRELFILES_= $(__RELFILES:$(_UNIQ)%=%) X Xrel: release/ $(RELDIRS) $(RELFILES_) X Xrelease/: X $(MKDIR) -p $@ X Xrelease/%.c: %.c X rm -f $@ X -unifdef $(IFDEF) $< | $(REL_SRC_MATCH) >$@ X -chmod 444 $@ X -cpmodes $< $@ X cptime $< $@ X $(MAKE_LICENSE) $@ X rm -f $@.bak X Xrelease/%.h: %.h X rm -f $@ X -unifdef $(IFDEF) $< | $(REL_SRC_MATCH) >$@ X -chmod 444 $@ X -cpmodes $< $@ X cptime $< $@ X $(MAKE_LICENSE) $@ X rm -f $@.bak X Xrelease/Makefile%: Makefile% X rm -f $@ X -sed -e '/IFDEF=/,$$d' $< | $(REL_MAKEFILE_MATCH) >$@ X -chmod 444 $@ X -cpmodes $< $@ X cptime $< $@ X $(MAKE_LICENSE) $@ X rm -f $@.bak X Xrelease/%.mk: %.mk X rm -f $@ X -sed -e '/IFDEF=/,$$d' $< >$@ X -chmod 444 $@ X -cpmodes $< $@ X cptime $< $@ X $(MAKE_LICENSE) $@ X rm -f $@.bak X Xrelease/%: % X rm -f $@ X# -unifdef $(IFDEF) $< >$@ X -cat $< >$@ X -chmod 444 $@ X -cpmodes $< $@ X cptime $< $@ X $(MAKE_LICENSE) $@ X rm -f $@.bak END-of-star-1.6/RULES/rules.rel echo x - star-1.6/RULES/cc-sco_uw.rul sed 's/^X//' >star-1.6/RULES/cc-sco_uw.rul << 'END-of-star-1.6/RULES/cc-sco_uw.rul' X#ident "@(#)cc-sco_uw.rul 1.19 18/08/16 " X########################################################################### X# Written 1999-2018 by J. Schilling/Santa Cruz Operation X########################################################################### X# X# Platform dependent MACROS for SCO UnixWare 2.x / 7.x cc X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X XCPP_FLAGS= -DSCHILY_BUILD $(CPPOPTS) $(CPPOPTX) $(OSINCDIRS:%=-I%) $(OSDEFS) $(OSDEFSX) XC_FLAGS= $(COPTS) $(CWARNOPTS) $(COPTOPT) $(SCO_UWCOPTOPT) $(COPTX) XC++FLAGS= $(C++OPTS) $(C++WARNOPTS) $(C++OPTOPT) $(SCO_UWC++OPTOPT) $(C++OPTX) X XCPPOPTS= -I$(ARCHDIR) -I$(OINCSDIR) $(INCDIRS:%=-I%) $(INCDIRSX:%=-I%) XCOPTS= XCWOPTS= -v XCOPTOPT= -O XCOPTDYN= -KPIC X#COPTGPROF= -pg XCOPTGPROF= -p XC++OPTS= XC++WOPTS= X#C++OPTOPT= -O X#C++OPTDYN= -Kpic X#C++OPTGPROF= -xpg X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_C= -lc X XLIBS_PATH= -L$(OLIBSDIR) XLIBS_PATH_STATIC= -L$(OLIBSDIR_STATIC) X XLDFLAGS= $(LDOPTS) $(LDOPTX) XLDLIBS= $(LIBS) $(LIBX) X XLDOPTS= $(LIBS_PATH) $(LDPATH) XLDOPTDYN= -dy -G $(TARGET) XLNDYNLIB= @$(RM) $(RM_FORCE) $(PTARGET_BASE).so; $(SYMLINK) $(TARGET) $(PTARGET_BASE).so X XFLOAT_OPTIONS= X X__CC_COM= $(_UNIQ)$(CC) X___CC_COM= $(__CC_COM:$(_UNIQ)=$(CC_COM_DEF)) XCC_COM= $(___CC_COM:$(_UNIQ)%=%) X X__CC++_COM= $(_UNIQ)$(CCC) X___CC++_COM= $(__CC++_COM:$(_UNIQ)=$(CC++_COM_DEF)) XCC++_COM= $(___CC++_COM:$(_UNIQ)%=%) X XCC_COM_DEF= cc XCC++_COM_DEF= echo "C++ not yet supported"; exit -1; : X# X# Use to comment out C++ projects X# XC++BUILD= $(NUMBER_SIGN) X XCC= $(CC_COM_DEF) XCCC= $(CC++_COM_DEF) X XCCCC= @echo " ==> COMPILING \"$@\""; $(CC_COM) XLDCC= @echo " ==> LINKING \"$@\""; $(CC_COM) XDYNLD= @echo " ==> LINKING dynamic library \"$@\""; $(CC_COM) XRANLIB= @echo " ==> RANDOMIZING ARCHIVE \"$@\""; true X XRMDEP= : XMKDEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); sh $(SRCROOT)/conf/mkdep-sco.sh XMKDEP_OUT= X XCC++ = @echo " ==> COMPILING \"$@\""; $(CC++_COM) XLDCC++ = @echo " ==> LINKING \"$@\""; $(CC++_COM) XDYNLDC++ = @echo " ==> LINKING dynamic library \"$@\""; $(CC++_COM) XMKC++DEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); $(CC++_COM) # mkdep-sco.sh? XMKC++DEP_OUT= END-of-star-1.6/RULES/cc-sco_uw.rul echo x - star-1.6/RULES/cc-sgi.rul sed 's/^X//' >star-1.6/RULES/cc-sgi.rul << 'END-of-star-1.6/RULES/cc-sgi.rul' X#ident "@(#)cc-sgi.rul 1.17 18/08/16 " X########################################################################### X# Written 1996-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for Silicon Graphics cc X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X XCPP_FLAGS= -DSCHILY_BUILD $(CPPOPTS) $(CPPOPTX) $(OSINCDIRS:%=-I%) $(OSDEFS) $(OSDEFSX) XC_FLAGS= $(COPTS) $(CWARNOPTS) $(COPTOPT) $(SGICOPTOPT) $(COPTX) XC++FLAGS= $(C++OPTS) $(C++WARNOPTS) $(C++OPTOPT) $(SGIC++OPTOPT) $(C++OPTX) X XCPPOPTS= -I$(ARCHDIR) -I$(OINCSDIR) $(INCDIRS:%=-I%) $(INCDIRSX:%=-I%) XCOPTS= XCWOPTS= -fullwarn XCOPTOPT= -O XCOPTDYN= -Kpic XCOPTGPROF= -p1 XC++OPTS= XC++WOPTS= X#C++OPTOPT= -O X#C++OPTDYN= -Kpic X#C++OPTGPROF= -xpg X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR) X XLIB_C= -lc X XLIBS_PATH= -L$(OLIBSDIR) XLIBS_PATH_STATIC= -L$(OLIBSDIR_STATIC) X XLDFLAGS= $(LDOPTS) $(LDOPTX) XLDLIBS= $(LIBS) $(LIBX) X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH) XLDOPTS= $(LIBS_PATH) $(LDPATH) $(LARGEFILE_OPT) X#LDOPTDYN= -dy -G -ztext -h $(TARGET) -ldl XLNDYNLIB= @ X XFLOAT_OPTIONS= X X__CC_COM= $(_UNIQ)$(CC) X___CC_COM= $(__CC_COM:$(_UNIQ)=$(CC_COM_DEF)) XCC_COM= $(___CC_COM:$(_UNIQ)%=%) X X__CC++_COM= $(_UNIQ)$(CCC) X___CC++_COM= $(__CC++_COM:$(_UNIQ)=$(CC++_COM_DEF)) XCC++_COM= $(___CC++_COM:$(_UNIQ)%=%) X XCC_COM_DEF= cc XCC++_COM_DEF= CC XCC= $(CC_COM_DEF) XCCC= $(CC++_COM_DEF) X XCCCC= @echo " ==> COMPILING \"$@\""; $(CC_COM) XLDCC= @echo " ==> LINKING \"$@\""; $(CC_COM) XDYNLD= @echo " ==> LINKING dynamic library \"$@\""; $(CC_COM) XRANLIB= @echo " ==> RANDOMIZING ARCHIVE \"$@\""; true X XRMDEP= : XMKDEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); $(CC_COM) -M XMKDEP_OUT= X XCC++ = @echo " ==> COMPILING \"$@\""; $(CC++_COM) XLDCC++ = @echo " ==> LINKING \"$@\""; $(CC++_COM) XDYNLDC++ = @echo " ==> LINKING dynamic library \"$@\""; $(CC++_COM) XMKC++DEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); $(CC++_COM) -M XMKC++DEP_OUT= END-of-star-1.6/RULES/cc-sgi.rul echo x - star-1.6/RULES/os-netbsd.id sed 's/^X//' >star-1.6/RULES/os-netbsd.id << 'END-of-star-1.6/RULES/os-netbsd.id' X#ident "@(#)os-netbsd.id 1.2 06/05/14 " X########################################################################### X# Written 1997 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for NetBSD X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= netbsd X-O_ARCH= -$(O_ARCH) END-of-star-1.6/RULES/os-netbsd.id echo x - star-1.6/RULES/r-make.dep sed 's/^X//' >star-1.6/RULES/r-make.dep << 'END-of-star-1.6/RULES/r-make.dep' X#ident "@(#)r-make.dep 1.11 18/08/16 " X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# Dependency building rules for make X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X# Note that we currently do not support C++ with Sun make as Sun make X# only allows one file to folllow a include directive X# XDEP_SUFFIX= .dep XRMDEP= $(RM) $(RM_FORCE) $@ X___C++DEP_FILES= $(C++FILES:%.C=$(ARCHDIR)/%.d) X__C++DEP_FILES= $(___C++DEP_FILES:%.cc=$(ARCHDIR)/%.d) X_C++DEP_FILES= $(__C++DEP_FILES:%.cpp=$(ARCHDIR)/%.d) XC++DEP_FILES= $(_C++DEP_FILES:%.cxx=$(ARCHDIR)/%.d) XC++PDEP_FILES= $(C++DEP_FILES) XDEP_FILE= $(ARCHDIR)/$(TARGET).dep XPDEP_FILE= $(ARCHDIR)/$(TARGET).dep XPALLDEP_FILE= $(CFILES:%.c=$(ARCHDIR)/%.d) $(C++PDEP_FILES) $(ARCHDIR)/$(TARGET).dep XDEP_DEP= $(ARCHDIR)/Dnull X########################################################################### Xdepend: rmdep $(DEP_FILE) X Xrmdep: X $(RM) $(RM_FORCE) $(PALLDEP_FILE) X X########################################################################### X# X# Make the complete path to the architecture subdirectory. X# Make $(ARCHDIR)/man as well here to avoid this directory to become root X# owned when root later calls "make install". X# X########################################################################### X$(ARCHDIR) $(ARCHDIR)/man: X $(MKDIR) -p $@ X X########################################################################### X# X# Generate dependency file(s). X# This rules is checked when the dependency file(s) are included. X# X# Modify the the path for .o files to reflect that they are placed in X# $(ARCHDIR). Add the dependency file itself to each line so that X# the dependencies will be rebuilt if a source is newer that the X# appropriate dependency file. X# X########################################################################### X$(ARCHDIR)/%.dep: %.c X $(MKDEP) $(CPP_FLAGS) $(CPPFLAGS) $(MKDEP_OUT) $< \ X | sed -e 's;^\(.*\)\.$o[ ]*:;$(ARCHDIR)/\1.$o $(DEP_FILE):;' > $@ X X$(DEP_FILE): $(DEP_DEP) $(CFILES) X $(MKDEP) $(CPP_FLAGS) $(CPPFLAGS) $(MKDEP_OUT) $(CFILES) \ X | sed -e 's;^\(.*\)\.$o[ ]*:;$(ARCHDIR)/\1.$o $(DEP_FILE):;' > $@ X X$(DEP_DEP): X @if [ ! -f $@ ]; then \ X echo " ==> MAKING DIRECTORY \"$(ARCHDIR)\""; \ X $(_MKDIR) -p $(ARCHDIR); \ X echo " ==> MAKING DIRECTORY \"$(ARCHDIR)/man\""; \ X $(_MKDIR) -p $(ARCHDIR)/man; \ X echo > $@; \ X fi X X########################################################################### X# X# Include the dependency file(s) generated from the rules above. X# X########################################################################### Xinclude $(DEP_FILE) END-of-star-1.6/RULES/r-make.dep echo x - star-1.6/RULES/cc-sco_os.rul sed 's/^X//' >star-1.6/RULES/cc-sco_os.rul << 'END-of-star-1.6/RULES/cc-sco_os.rul' X#ident "@(#)cc-sco_os.rul 1.22 18/08/16 " X########################################################################### X# Written 1999-2018 by J. Schilling/Santa Cruz Operation X########################################################################### X# X# Platform dependent MACROS for SCO OpenServer 5 cc X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X XCPP_FLAGS= -DSCHILY_BUILD $(CPPOPTS) $(CPPOPTX) $(OSINCDIRS:%=-I%) $(OSDEFS) $(OSDEFSX) XC_FLAGS= $(COPTS) $(CWARNOPTS) $(COPTOPT) $(SCO_OSCOPTOPT) $(COPTX) XC++FLAGS= $(C++OPTS) $(C++WARNOPTS) $(C++OPTOPT) $(SCO_OSC++OPTOPT) $(C++OPTX) X XCPPOPTS= -I$(ARCHDIR) -I$(OINCSDIR) $(INCDIRS:%=-I%) $(INCDIRSX:%=-I%) XCOPTS= -belf XCWOPTS= -w3 XCOPTOPT= -O XCOPTDYN= -KPIC XCOPTGPROF= -pg XC++OPTS= XC++WOPTS= X#C++OPTOPT= -O X#C++OPTDYN= -Kpic X#C++OPTGPROF= -xpg X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_C= -lc X XLIBS_PATH= -L$(OLIBSDIR) XLIBS_PATH_STATIC= -L$(OLIBSDIR_STATIC) X XLDFLAGS= $(LDOPTS) $(LDOPTX) XLDLIBS= $(LIBS) $(LIBX) X XLDOPTS= $(LIBS_PATH) $(LDPATH) XLDOPTDYN= -dy -G $(TARGET) XLNDYNLIB= @$(RM) $(RM_FORCE) $(PTARGET_BASE).so; $(SYMLINK) $(TARGET) $(PTARGET_BASE).so X XFLOAT_OPTIONS= X X__CC_COM= $(_UNIQ)$(CC) X___CC_COM= $(__CC_COM:$(_UNIQ)=$(CC_COM_DEF)) XCC_COM= $(___CC_COM:$(_UNIQ)%=%) X X__CC++_COM= $(_UNIQ)$(CCC) X___CC++_COM= $(__CC++_COM:$(_UNIQ)=$(CC++_COM_DEF)) XCC++_COM= $(___CC++_COM:$(_UNIQ)%=%) X XCC_COM_DEF= cc XCC++_COM_DEF= echo "C++ not yet supported"; exit -1; : X# X# Use to comment out C++ projects X# XC++BUILD= $(NUMBER_SIGN) X XCC= $(CC_COM_DEF) XCCC= $(CC++_COM_DEF) X XCCCC= @echo " ==> COMPILING \"$@\""; $(CC_COM) XLDCC= @echo " ==> LINKING \"$@\""; $(CC_COM) XDYNLD= @echo " ==> LINKING dynamic library \"$@\""; $(CC_COM) XRANLIB= @echo " ==> RANDOMIZING ARCHIVE \"$@\""; true X XRMDEP= : XMKDEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); sh $(SRCROOT)/conf/mkdep-sco.sh XMKDEP_OUT= X_MKDIR= $(_MKDIR_SH) XMKDIR= $(MKDIR_SH) XINSMKDIR= $(INSMKDIR_SH) X XCC++ = @echo " ==> COMPILING \"$@\""; $(CC++_COM) XLDCC++ = @echo " ==> LINKING \"$@\""; $(CC++_COM) XDYNLDC++ = @echo " ==> LINKING dynamic library \"$@\""; $(CC++_COM) XMKC++DEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); $(CC++_COM) # mkdep-sco.sh? XMKC++DEP_OUT= END-of-star-1.6/RULES/cc-sco_os.rul echo x - star-1.6/RULES/os-cygwin_nt-6.3-wow.id sed 's/^X//' >star-1.6/RULES/os-cygwin_nt-6.3-wow.id << 'END-of-star-1.6/RULES/os-cygwin_nt-6.3-wow.id' X#ident "@(#)os-cygwin_nt-6.3-wow.id 1.1 15/06/29 " X########################################################################### X# Written 2013 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for Cygnus GCC for MS Windows NT-6.3 (Win 8.1) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/os-cygwin32_wow.id X XWINNTDEFS += -D_WIN32_WINNT=0x0603 END-of-star-1.6/RULES/os-cygwin_nt-6.3-wow.id echo x - star-1.6/RULES/cc-dg.rul sed 's/^X//' >star-1.6/RULES/cc-dg.rul << 'END-of-star-1.6/RULES/cc-dg.rul' X#ident "@(#)cc-dg.rul 1.19 18/08/16 " X########################################################################### X# Written 1996-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for DGUX cc X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X XCPP_FLAGS= -DSCHILY_BUILD $(CPPOPTS) $(CPPOPTX) $(OSINCDIRS:%=-I%) $(OSDEFS) $(OSDEFSX) XC_FLAGS= $(COPTS) $(CWARNOPTS) $(COPTOPT) $(DGCOPTOPT) $(COPTX) XC++FLAGS= $(C++OPTS) $(C++WARNOPTS) $(C++OPTOPT) $(DGC++OPTOPT) $(C++OPTX) X XCPPOPTS= -I$(ARCHDIR) -I$(OINCSDIR) $(INCDIRS:%=-I%) $(INCDIRSX:%=-I%) XCOPTS= -Xa XCWOPTS= -v XCOPTOPT= -O XCOPTDYN= -Kpic XCOPTGPROF= -xpg XC++OPTS= XC++WOPTS= X#C++OPTOPT= -O X#C++OPTDYN= -Kpic X#C++OPTGPROF= -xpg X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR) X XLIB_C= -lc X XLIBS_PATH= -L$(OLIBSDIR) XLIBS_PATH_STATIC= -L$(OLIBSDIR_STATIC) X XLDFLAGS= $(LDOPTS) $(LDOPTX) XLDLIBS= $(LIBS) $(LIBX) X XLDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH) XLDOPTDYN= -dy -G -ztext -h $(TARGET) -ldl XLNDYNLIB= @$(RM) $(RM_FORCE) $(PTARGET_BASE).so; $(SYMLINK) $(TARGET) $(PTARGET_BASE).so X XFLOAT_OPTIONS= X X__CC_COM= $(_UNIQ)$(CC) X___CC_COM= $(__CC_COM:$(_UNIQ)=$(CC_COM_DEF)) XCC_COM= $(___CC_COM:$(_UNIQ)%=%) X X__CC++_COM= $(_UNIQ)$(CCC) X___CC++_COM= $(__CC++_COM:$(_UNIQ)=$(CC++_COM_DEF)) XCC++_COM= $(___CC++_COM:$(_UNIQ)%=%) X XCC_COM_DEF= cc XCC++_COM_DEF= echo "C++ not yet supported"; exit -1; : X# X# Use to comment out C++ projects X# XC++BUILD= $(NUMBER_SIGN) X XCC= $(CC_COM_DEF) XCCC= $(CC++_COM_DEF) X XCCCC= @echo " ==> COMPILING \"$@\""; $(CC_COM) XLDCC= @echo " ==> LINKING \"$@\""; $(CC_COM) XDYNLD= @echo " ==> LINKING dynamic library \"$@\""; $(CC_COM) XRANLIB= @echo " ==> RANDOMIZING ARCHIVE \"$@\""; true X XRMDEP= : XMKDEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); $(CC_COM) -xM XMKDEP_OUT= X XCC++ = @echo " ==> COMPILING \"$@\""; $(CC++_COM) XLDCC++ = @echo " ==> LINKING \"$@\""; $(CC++_COM) XDYNLDC++ = @echo " ==> LINKING dynamic library \"$@\""; $(CC++_COM) XMKC++DEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); $(CC++_COM) -xM XMKC++DEP_OUT= END-of-star-1.6/RULES/cc-dg.rul echo x - star-1.6/RULES/cc-dumb.rul sed 's/^X//' >star-1.6/RULES/cc-dumb.rul << 'END-of-star-1.6/RULES/cc-dumb.rul' X#ident "@(#)cc-dumb.rul 1.19 18/08/16 " X########################################################################### X# Written 1997-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for unknown systems systems with dumb cc X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X XCPP_FLAGS= -DSCHILY_BUILD $(CPPOPTS) $(CPPOPTX) $(OSINCDIRS:%=-I%) $(OSDEFS) $(OSDEFSX) XC_FLAGS= $(COPTS) $(CWARNOPTS) $(COPTOPT) $(DUMBCOPTOPT) $(COPTX) XC++FLAGS= $(C++OPTS) $(C++WARNOPTS) $(C++OPTOPT) $(DUMBC++OPTOPT) $(C++OPTX) X XCPPOPTS= -I$(ARCHDIR) -I$(OINCSDIR) $(INCDIRS:%=-I%) $(INCDIRSX:%=-I%) XCOPTS= XCWOPTS= X# X# Switch optimizing on if your compiler supports it X#COPTOPT= -O XCOPTOPT= XCOPTDYN= -fpic XCOPTGPROF= -pg XC++OPTS= XC++WOPTS= X#C++OPTOPT= -O X#C++OPTDYN= -Kpic X#C++OPTGPROF= -xpg X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_C= -lc X XLIBS_PATH= -L$(OLIBSDIR) XLIBS_PATH_STATIC= -L$(OLIBSDIR_STATIC) X XLDFLAGS= $(LDOPTS) $(LDOPTX) XLDLIBS= $(LIBS) $(LIBX) X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH) XLDOPTS= $(LIBS_PATH) $(LDPATH) XLDOPTDYN= -shared -Wl,-soname,$(TARGET) XLNDYNLIB= @$(RM) $(RM_FORCE) $(PTARGET_BASE).so; $(SYMLINK) $(TARGET) $(PTARGET_BASE).so X XFLOAT_OPTIONS= X X__CC_COM= $(_UNIQ)$(CC) X___CC_COM= $(__CC_COM:$(_UNIQ)=$(CC_COM_DEF)) XCC_COM= $(___CC_COM:$(_UNIQ)%=%) X X__CC++_COM= $(_UNIQ)$(CCC) X___CC++_COM= $(__CC++_COM:$(_UNIQ)=$(CC++_COM_DEF)) XCC++_COM= $(___CC++_COM:$(_UNIQ)%=%) X XCC_COM_DEF= cc XCC++_COM_DEF= echo "C++ not yet supported"; exit -1; : X# X# Use to comment out C++ projects X# XC++BUILD= $(NUMBER_SIGN) X XCC= $(CC_COM_DEF) XCCC= $(CC++_COM_DEF) X XCCCC= @echo " ==> COMPILING \"$@\""; $(CC_COM) XLDCC= @echo " ==> LINKING \"$@\""; $(CC_COM) XDYNLD= @echo " ==> LINKING dynamic library \"$@\""; $(CC_COM) X XRMDEP= : X#MKDEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); $(CC_COM) -M XMKDEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); echo "Cannot do -M with unknown cc"; : XMKDEP_OUT= X XCC++ = @echo " ==> COMPILING \"$@\""; $(CC++_COM) XLDCC++ = @echo " ==> LINKING \"$@\""; $(CC++_COM) XDYNLDC++ = @echo " ==> LINKING dynamic library \"$@\""; $(CC++_COM) XMKC++DEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); $(CC++_COM); echo "Cannot do -M with unknown CC"; : XMKC++DEP_OUT= END-of-star-1.6/RULES/cc-dumb.rul echo x - star-1.6/RULES/os-cygwin_nt-6.2-wow.id sed 's/^X//' >star-1.6/RULES/os-cygwin_nt-6.2-wow.id << 'END-of-star-1.6/RULES/os-cygwin_nt-6.2-wow.id' X#ident "@(#)os-cygwin_nt-6.2-wow.id 1.1 15/06/29 " X########################################################################### X# Written 2013 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for Cygnus GCC for MS Windows NT-6.2 (Win 8) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/os-cygwin32_wow.id X XWINNTDEFS += -D_WIN32_WINNT=0x0602 END-of-star-1.6/RULES/os-cygwin_nt-6.2-wow.id echo x - star-1.6/RULES/os-darwin.def sed 's/^X//' >star-1.6/RULES/os-darwin.def << 'END-of-star-1.6/RULES/os-darwin.def' X#ident "@(#)os-darwin.def 1.2 06/05/14 " X########################################################################### X# Written 2001 by J. Schilling X########################################################################### X# X# Global definitions for Mac OS X (Darwin) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XMANSTYLE= bsd END-of-star-1.6/RULES/os-darwin.def echo x - star-1.6/RULES/os-darwin.id sed 's/^X//' >star-1.6/RULES/os-darwin.id << 'END-of-star-1.6/RULES/os-darwin.id' X#ident "@(#)os-darwin.id 1.2 06/05/14 " X########################################################################### X# Written 2001 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for Mac OS X (Darwin) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= darwin X-O_ARCH= -$(O_ARCH) END-of-star-1.6/RULES/os-darwin.id echo x - star-1.6/RULES/os-dgux.id sed 's/^X//' >star-1.6/RULES/os-dgux.id << 'END-of-star-1.6/RULES/os-dgux.id' X#ident "@(#)os-dgux.id 1.2 06/05/14 " X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for DGUX X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X_O_ARCH= $(OSREL:r4.%=dgux4) XO_ARCH= $(_O_ARCH:5.4r3%=dgux3) X-O_ARCH= -$(O_ARCH) END-of-star-1.6/RULES/os-dgux.id echo x - star-1.6/RULES/os-dgux3.def sed 's/^X//' >star-1.6/RULES/os-dgux3.def << 'END-of-star-1.6/RULES/os-dgux3.def' X#ident "@(#)os-dgux3.def 1.3 06/05/14 " X########################################################################### X# Written 1997 by J. Schilling X########################################################################### X# X# Global os definitions for DGUX X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XMANSTYLE= sysv END-of-star-1.6/RULES/os-dgux3.def echo x - star-1.6/RULES/cc-dec.rul sed 's/^X//' >star-1.6/RULES/cc-dec.rul << 'END-of-star-1.6/RULES/cc-dec.rul' X#ident "@(#)cc-dec.rul 1.19 18/08/16 " X########################################################################### X# Written 1998-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for Digital UNIX cc X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X XCPP_FLAGS= -DSCHILY_BUILD $(CPPOPTS) $(CPPOPTX) $(OSINCDIRS:%=-I%) $(OSDEFS) $(OSDEFSX) XC_FLAGS= $(COPTS) $(CWARNOPTS) $(COPTOPT) $(DECCOPTOPT) $(COPTX) XC++FLAGS= $(C++OPTS) $(C++WARNOPTS) $(C++OPTOPT) $(DECC++OPTOPT) $(C++OPTX) X XCPPOPTS= -I$(ARCHDIR) -I$(OINCSDIR) $(INCDIRS:%=-I%) $(INCDIRSX:%=-I%) XCOPTS= XCWOPTS= XCOPTOPT= -O XCOPTDYN= -fpic XCOPTGPROF= -pg XC++OPTS= XC++WOPTS= X#C++OPTOPT= -O X#C++OPTDYN= -Kpic X#C++OPTGPROF= -xpg X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_C= -lc X XLIBS_PATH= -L$(OLIBSDIR) -L/usr/ccs/lib XLIBS_PATH_STATIC= -L$(OLIBSDIR_STATIC) X XLDFLAGS= $(LDOPTS) $(LDOPTX) XLDLIBS= $(LIBS) $(LIBX) -lrt X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH) XLDOPTS= $(LIBS_PATH) $(LDPATH) XLDOPTDYN= -shared -Wl,-soname,$(TARGET) XLNDYNLIB= @$(RM) $(RM_FORCE) $(PTARGET_BASE).so; $(SYMLINK) $(TARGET) $(PTARGET_BASE).so X XFLOAT_OPTIONS= X X__CC_COM= $(_UNIQ)$(CC) X___CC_COM= $(__CC_COM:$(_UNIQ)=$(CC_COM_DEF)) XCC_COM= $(___CC_COM:$(_UNIQ)%=%) X X__CC++_COM= $(_UNIQ)$(CCC) X___CC++_COM= $(__CC++_COM:$(_UNIQ)=$(CC++_COM_DEF)) XCC++_COM= $(___CC++_COM:$(_UNIQ)%=%) X XCC_COM_DEF= cc XCC++_COM_DEF= echo "C++ not yet supported"; exit -1; : X# X# Use to comment out C++ projects X# XC++BUILD= $(NUMBER_SIGN) X XCC= $(CC_COM_DEF) XCCC= $(CC++_COM_DEF) X XCCCC= @echo " ==> COMPILING \"$@\""; $(CC_COM) XLDCC= @echo " ==> LINKING \"$@\""; $(CC_COM) XDYNLD= @echo " ==> LINKING dynamic library \"$@\""; $(CC_COM) X XRMDEP= : XMKDEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); $(CC_COM) -M XMKDEP_OUT= X XCC++ = @echo " ==> COMPILING \"$@\""; $(CC++_COM) XLDCC++ = @echo " ==> LINKING \"$@\""; $(CC++_COM) XDYNLDC++ = @echo " ==> LINKING dynamic library \"$@\""; $(CC++_COM) XMKC++DEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); $(CC++_COM) -M XMKC++DEP_OUT= END-of-star-1.6/RULES/cc-dec.rul echo x - star-1.6/RULES/cc-bemwcc.rul sed 's/^X//' >star-1.6/RULES/cc-bemwcc.rul << 'END-of-star-1.6/RULES/cc-bemwcc.rul' X#ident @(#)cc-bemwcc.rul 1.18 18/08/16 X########################################################################### X# Written 1996-2017 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for BeOS mwcc X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X XCPP_FLAGS= -DSCHILY_BUILD $(CPPOPTS) $(CPPOPTX) $(OSINCDIRS:%=-I%) $(OSDEFS) $(OSDEFSX) XC_FLAGS= $(COPTS) $(CWARNOPTS) $(COPTOPT) $(BEMWCOPTOPT) $(COPTX) XC++FLAGS= $(C++OPTS) $(C++WARNOPTS) $(C++OPTOPT) $(BEMWC++OPTOPT) $(C++OPTX) X X X# X# XXX Old BeOS needs libroot.so to get [efg]cvt() X# XXX New BeOS seems to have this in libc and in addition we include X# XXX strtod.c for floating point conversion on OS without such code. X# XXX For this reason, -DNO_FLOATINGPOINT -DUSE_FLOATINGARGS has been X# XXX removed and printing floating numbers will work with old/new BeOS X# X#OSDEFS += -DNO_FLOATINGPOINT -DUSE_FLOATINGARGS X X# X# XXX This is used by bemac-beos-cc.rul X# XCPPOPTS= -O4 -g -i- -I$(ARCHDIR) -I$(OINCSDIR) $(INCDIRS:%=-I%) $(INCDIRSX:%=-I%) X# X# XXX This is used by bemac-beos-mwcc.rul X# XCPPOPTS= -relax_pointers -opt all -sym on -g -i- -I$(ARCHDIR) -I$(OINCSDIR) $(INCDIRS:%=-I%) $(INCDIRSX:%=-I%) X# X# XXX This is used by powerpc-beos-mwcc.rul X# XCPPOPTS= -relax_pointers -opt global -sym on -g -i- -I$(ARCHDIR) -I$(OINCSDIR) $(INCDIRS:%=-I%) $(INCDIRSX:%=-I%) X XCPPOPTS= -I$(ARCHDIR) -I$(OINCSDIR) $(INCDIRS:%=-I%) $(INCDIRSX:%=-I%) XCOPTS= XCWOPTS= -w8 XCOPTOPT= -opt off XCOPTDYN= #-fpic XCOPTGPROF= #-pg XC++OPTS= XC++WOPTS= X#C++OPTOPT= -O X#C++OPTDYN= -Kpic X#C++OPTGPROF= -xpg X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so X XLIB_C= -lc X XLIBS_PATH= -L$(OLIBSDIR) XLIBS_PATH_STATIC= -L$(OLIBSDIR_STATIC) X XLDFLAGS= $(LDOPTS) $(LDOPTX) XLDLIBS= $(LIBS) $(LIBX) X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH) X# X# XXX This is used by powerpc-beos-mwcc.rul X# XLDOPTS= -multidefs -sym on -g $(LIBS_PATH) $(LDPATH) X XLDOPTS= -multidefs -msg nodup -sym on -g $(LIBS_PATH) $(LDPATH) XLDOPTDYN=# -shared -Wl,-soname,$(TARGET) XLNDYNLIB= @$(RM) $(RM_FORCE) $(PTARGET_BASE).so; $(SYMLINK) $(TARGET) $(PTARGET_BASE).so X XFLOAT_OPTIONS= X X__CC_COM= $(_UNIQ)$(CC) X___CC_COM= $(__CC_COM:$(_UNIQ)=$(CC_COM_DEF)) XCC_COM= $(___CC_COM:$(_UNIQ)%=%) X X__CC++_COM= $(_UNIQ)$(CCC) X___CC++_COM= $(__CC++_COM:$(_UNIQ)=$(CC++_COM_DEF)) XCC++_COM= $(___CC++_COM:$(_UNIQ)%=%) X XCC_COM_DEF= mwccppc XCC++_COM_DEF= echo "C++ not yet supported"; exit -1; : X# X# Use to comment out C++ projects X# XC++BUILD= $(NUMBER_SIGN) X XCC= $(CC_COM_DEF) XCCC= $(CC++_COM_DEF) X XCCCC= @echo " ==> COMPILING \"$@\""; $(CC_COM) XLDCC= @echo " ==> LINKING \"$@\""; $(CC_COM) XDYNLD= @echo " ==> LINKING dynamic library \"$@\""; $(CC_COM) X XRMDEP= : XMKDEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); $(CC_COM) -make XMKDEP_OUT= X XCC++ = @echo " ==> COMPILING \"$@\""; $(CC++_COM) XLDCC++ = @echo " ==> LINKING \"$@\""; $(CC++_COM) XDYNLDC++ = @echo " ==> LINKING dynamic library \"$@\""; $(CC++_COM) XMKC++DEP= @echo " ==> MAKING DEPENDENCIES \"$@\""; $(RMDEP); $(CC++_COM) # -make? XMKC++DEP_OUT= END-of-star-1.6/RULES/cc-bemwcc.rul echo x - star-1.6/RULES/os-cygwin_nt-6.1-wow.id sed 's/^X//' >star-1.6/RULES/os-cygwin_nt-6.1-wow.id << 'END-of-star-1.6/RULES/os-cygwin_nt-6.1-wow.id' X#ident "@(#)os-cygwin_nt-6.1-wow.id 1.1 15/06/29 " X########################################################################### X# Written 2006 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for Cygnus GCC for MS Windows NT-6.1 (Win 7) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/os-cygwin32_wow.id X XWINNTDEFS += -D_WIN32_WINNT=0x0601 END-of-star-1.6/RULES/os-cygwin_nt-6.1-wow.id echo x - star-1.6/RULES/mk-.id sed 's/^X//' >star-1.6/RULES/mk-.id << 'END-of-star-1.6/RULES/mk-.id' X#ident "@(#)mk-.id 1.18 12/12/29 " X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# Name of make program (make/gmake/smake) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X XMAKEPROG= make # Sun make XWAIT= .WAIT # Sun make notation to wait for parallel targets X XSPACE= $(_UNIQ:$(_UNIQ)%= ) XPRE_NUMBER= pre\# XNUMBER_SIGN= $(PRE_NUMBER:pre\%=%) X X########################################################################### X# X# standard (automatic) machine identification X# X########################################################################### X# X# XP_ARCH = uname -p = mach # Processor (sparc/mc68020) X# XK_ARCH = uname -m = arch -k # Kernel (sun3/sun4c/sun4m) X# XM_ARCH = arch ~ arch -k # Machine (sun3/sun4) X# X########################################################################### X# X# Due to a bug in /usr/xpg*/bin/tr on Solaris, we cannot directly translit X# many different chars to '-' using e.g. tr ', /\\()"' ',------' X# X# This is why we use sed 'y%ABC\\%abc-%'. Note that this will not work on *BSD X# X########################################################################### X XXP_ARCH:sh= (mach || uname -p || true)2>/dev/null | sed 'y%ABCDEFGHIJKLMNOPQRSTUVWXYZ, /\\()"%abcdefghijklmnopqrstuvwxyz,------%' XXK_ARCH:sh= uname -m | sed 'y%ABCDEFGHIJKLMNOPQRSTUVWXYZ, /\\()"%abcdefghijklmnopqrstuvwxyz,------%' XXM_ARCH:sh= (arch || /usr/ucb/arch || true)2>/dev/null | sed 'y%ABCDEFGHIJKLMNOPQRSTUVWXYZ, /\\()"%abcdefghijklmnopqrstuvwxyz,------%' X XP_ARCH= $(XP_ARCH) XK_ARCH= $(XK_ARCH) XM_ARCH= $(XM_ARCH) X X_XP_ARCH= $(XP_ARCH:unknown=$(K_ARCH)) X X_P_ARCH= $(_UNIQ)$(_XP_ARCH) X__P_ARCH= $(_P_ARCH:$(_UNIQ)=$(K_ARCH)) XP_ARCH= $(__P_ARCH:$(_UNIQ)%=%) X X_M_ARCH= $(_UNIQ)$(XM_ARCH) X__M_ARCH= $(_M_ARCH:$(_UNIQ)=$(K_ARCH)) XM_ARCH= $(__M_ARCH:$(_UNIQ)%=%) X XOSNAME:sh= uname -s | sed 'y%ABCDEFGHIJKLMNOPQRSTUVWXYZ, /\\()"%abcdefghijklmnopqrstuvwxyz,------%' XOSREL:sh= uname -r | sed 'y%ABCDEFGHIJKLMNOPQRSTUVWXYZ, /\\()"%abcdefghijklmnopqrstuvwxyz,------%' XOSVERSION:sh= uname -v | sed 'y%ABCDEFGHIJKLMNOPQRSTUVWXYZ, /\\()"%abcdefghijklmnopqrstuvwxyz,------%' END-of-star-1.6/RULES/mk-.id echo x - star-1.6/RULES/mk-gmake.id sed 's/^X//' >star-1.6/RULES/mk-gmake.id << 'END-of-star-1.6/RULES/mk-gmake.id' X#ident "@(#)mk-gmake.id 1.25 18/04/15 " X########################################################################### X# Written 1996-2018 by J. Schilling X########################################################################### X# X# Name of make program (make/gmake/smake) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X X_GETENV= $(_UNIQ)$(ARCH_DONE) X__GETENV= $(_GETENV:$(_UNIQ)=rules.oev) X___GETENV= $(__GETENV:$(_UNIQ)TRUE=rules.nul) XGET_ENV= $(___GETENV:$(_UNIQ)%=%) X Xinclude $(SRCROOT)/$(RULESDIR)/$(GET_ENV) X X_SETENV= $(_UNIQ)$(SETENV) X__SETENV= $(_SETENV:$(_UNIQ)=rules.env) X___SETENV= $(__SETENV:$(_UNIQ)none=rules.nul) XSET_ENV= $(___SETENV:$(_UNIQ)%=%) X Xinclude $(SRCROOT)/$(RULESDIR)/$(SET_ENV) X XMAKEPROG= gmake X.SHELLFLAGS= -ce # switch gmake-3.82 ff. to POSIX behavior XWAIT= # gmake is unable to wait for parallel targets X XSPACE= $(_UNIQ:$(_UNIQ)%= ) XPRE_NUMBER= pre\# XNUMBER_SIGN= $(PRE_NUMBER:pre%=%) X X########################################################################### X# X# standard (automatic) machine identification X# X########################################################################### X# X# XP_ARCH = uname -p = mach # Processor (sparc/mc68020) X# XK_ARCH = uname -m = arch -k # Kernel (sun3/sun4c/sun4m) X# XM_ARCH = arch ~ arch -k # Machine (sun3/sun4) X# X########################################################################### X# X# Due to a bug in /usr/xpg*/bin/tr on Solaris, we cannot directly translit X# many different chars to '-' using e.g. tr ', /\\()"' ',------' X# This is why we first tranliterate everything to '/ and later to '-' X# X# Due to a bug in *BSDs sed, we cannot use sed 'y%ABC\\%abc-%' X# X########################################################################### X Xifndef ARCH_DONE X Xifndef GMAKE_NOWARN X__gmake_warn:= $(shell cat $(SRCROOT)/$(RULESDIR)/gmake.wrn 1>&2; sleep 2) Xendif X X_MACHCMD= (mach || uname -p || true) 2> /dev/null X_ARCHCMD= (arch || /usr/ucb/arch || true) 2> /dev/null X XXP_ARCH:= $(shell $(_MACHCMD) | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ, /\\()"' 'abcdefghijklmnopqrstuvwxyz,//////' | tr ',/' ',\-') XXK_ARCH:= $(shell uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ, /\\()"' 'abcdefghijklmnopqrstuvwxyz,//////' | tr ',/' ',\-') XXM_ARCH:= $(shell $(_ARCHCMD) | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ, /\\()"' 'abcdefghijklmnopqrstuvwxyz,//////' | tr ',/' ',\-') X XP_ARCH= $(XP_ARCH) XK_ARCH= $(XK_ARCH) XM_ARCH= $(XM_ARCH) X X_XP_ARCH= $(XP_ARCH:unknown=$(K_ARCH)) X X_P_ARCH= $(_UNIQ)$(_XP_ARCH) X__P_ARCH= $(_P_ARCH:$(_UNIQ)=$(K_ARCH)) XP_ARCH= $(__P_ARCH:$(_UNIQ)%=%) X X_M_ARCH= $(_UNIQ)$(XM_ARCH) X__M_ARCH= $(_M_ARCH:$(_UNIQ)=$(K_ARCH)) XM_ARCH= $(__M_ARCH:$(_UNIQ)%=%) X XOSNAME:= $(shell uname -s | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ, /\\()"' 'abcdefghijklmnopqrstuvwxyz,//////' | tr ',/' ',\-') XOSREL:= $(shell uname -r | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ, /\\()"' 'abcdefghijklmnopqrstuvwxyz,//////' | tr ',/' ',\-') XOSVERSION:= $(shell uname -v | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ, /\\()"' 'abcdefghijklmnopqrstuvwxyz,//////' | tr ',/' ',\-') X XARCH_DONE= TRUE X Xexport XP_ARCH Xexport K_ARCH Xexport XM_ARCH Xexport P_ARCH Xexport M_ARCH Xexport OSNAME Xexport OSREL Xexport OSVERSION Xexport ARCH_DONE X Xendif END-of-star-1.6/RULES/mk-gmake.id echo x - star-1.6/RULES/mk-smake.id sed 's/^X//' >star-1.6/RULES/mk-smake.id << 'END-of-star-1.6/RULES/mk-smake.id' X#ident "@(#)mk-smake.id 1.11 18/04/15 " X########################################################################### X# Written 1996-2018 by J. Schilling X########################################################################### X# X# Name of make program (make/gmake/smake) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X X_GETENV= $(_UNIQ)$(ARCH_DONE) X__GETENV= $(_GETENV:$(_UNIQ)=rules.oev) X___GETENV= $(__GETENV:$(_UNIQ)TRUE=rules.nul) XGET_ENV= $(___GETENV:$(_UNIQ)%=%) X X# X# Disable warnings for nonportable variable assignements. X# We only use smake MS-WIN, so this is not a problem. X# X.NO_WARN: := Xinclude $(SRCROOT)/$(RULESDIR)/$(GET_ENV) X# X# Re-enable all warnings. X# X.NO_WARN: X X_SETENV= $(_UNIQ)$(SETENV) X__SETENV= $(_SETENV:$(_UNIQ)=rules.env) X___SETENV= $(__SETENV:$(_UNIQ)none=rules.nul) XSET_ENV= $(___SETENV:$(_UNIQ)%=%) X Xinclude $(SRCROOT)/$(RULESDIR)/$(SET_ENV) X XMAKEPROG= $(MAKE_NAME) XWAIT= # smake-1.2.1 does not yet wait for parallel targets X XSPACE= $(_UNIQ:$(_UNIQ)%= ) X#NUMBER_SIGN= NUMBER_SIGN is defined internally by smake X X########################################################################### X# X# standard (automatic) machine identification X# X########################################################################### X# X# XP_ARCH = MAKE_ARCH = uname -p = mach # Processor (sparc/mc68020) X# XK_ARCH = MAKE_MACH = uname -m = arch -k # Kernel (sun3/sun4c/sun4m) X# XM_ARCH = MAKE_M_ARCH = arch ~ arch -k # Machine (sun3/sun4) X# X########################################################################### X XXP_ARCH= $(MAKE_ARCH) XXK_ARCH= $(MAKE_MACH) XXM_ARCH= $(MAKE_M_ARCH) X XP_ARCH= $(XP_ARCH) XK_ARCH= $(XK_ARCH) XM_ARCH= $(XM_ARCH) X X_P_ARCH= $(_UNIQ)$(XP_ARCH) X__P_ARCH= $(_P_ARCH:$(_UNIQ)=$(MAKE_MACH)) XP_ARCH= $(__P_ARCH:$(_UNIQ)%=%) X X_M_ARCH= $(_UNIQ)$(MAKE_M_ARCH) X__M_ARCH= $(_M_ARCH:$(_UNIQ)=$(MAKE_MACH)) XM_ARCH= $(__M_ARCH:$(_UNIQ)%=%) X XHOSTNAME= $(MAKE_HOST) XOSNAME= $(MAKE_OS) XOSDEFS= $(MAKE_OSDEFS) XOSREL= $(MAKE_OSREL) XOSVERSION= $(MAKE_OSVERSION) X X# X# Disable Simple Suffix Rules X# X.SSUFFIX_RULES: X# X# Disable Suffix Rules X# X.SUFFIXES: X XARCH_DONE= TRUE Xexport ARCH_DONE END-of-star-1.6/RULES/mk-smake.id echo x - star-1.6/RULES/os-cygwin_nt-6.0-wow.id sed 's/^X//' >star-1.6/RULES/os-cygwin_nt-6.0-wow.id << 'END-of-star-1.6/RULES/os-cygwin_nt-6.0-wow.id' X#ident "@(#)os-cygwin_nt-6.0-wow.id 1.1 15/06/29 " X########################################################################### X# Written 2006 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for Cygnus GCC for MS Windows NT-6.0 (Vista) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/os-cygwin32_wow.id X XWINNTDEFS += -D_WIN32_WINNT=0x0600 END-of-star-1.6/RULES/os-cygwin_nt-6.0-wow.id echo x - star-1.6/RULES/os-cygwin_nt-6.0-wow64.id sed 's/^X//' >star-1.6/RULES/os-cygwin_nt-6.0-wow64.id << 'END-of-star-1.6/RULES/os-cygwin_nt-6.0-wow64.id' X#ident "@(#)os-cygwin_nt-6.0-wow64.id 1.1 09/07/26 " X########################################################################### X# Written 2006 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for Cygnus GCC for MS Windows NT-6.0 (Vista) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/os-cygwin32_wow64.id X XWINNTDEFS += -D_WIN32_WINNT=0x0600 END-of-star-1.6/RULES/os-cygwin_nt-6.0-wow64.id echo x - star-1.6/RULES/os-domainos.id sed 's/^X//' >star-1.6/RULES/os-domainos.id << 'END-of-star-1.6/RULES/os-domainos.id' X#ident "@(#)os-domainos.id 1.2 06/05/14 " X########################################################################### X# Written 2001 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for Apollo Domain/OS X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= domainos X-O_ARCH= -$(O_ARCH) END-of-star-1.6/RULES/os-domainos.id echo x - star-1.6/RULES/bemac-beos-cc.rul sed 's/^X//' >star-1.6/RULES/bemac-beos-cc.rul << 'END-of-star-1.6/RULES/bemac-beos-cc.rul' X#ident @(#)bemac-beos-cc.rul 1.10 13/11/04 X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for BeOS X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-bemwcc.rul X XOSDEFS += X XCPPOPTS= -O4 -g -i- -I$(ARCHDIR) -I$(OINCSDIR) $(INCDIRS:%=-I%) $(INCDIRSX:%=-I%) X XKDEFINES= -DKERNEL -D_KERNEL X X#LIB_SOCKET= -lsocket -lnsl -ldl XLIB_SOCKET= X#LIB_MATH= -lm X#LIB_KVM= -lkvm XLIB_KVM= X XLORDER= echo XTSORT= cat X XLN= /bin/ln -s END-of-star-1.6/RULES/bemac-beos-cc.rul echo x - star-1.6/RULES/i386-bsd-os-cc.rul sed 's/^X//' >star-1.6/RULES/i386-bsd-os-cc.rul << 'END-of-star-1.6/RULES/i386-bsd-os-cc.rul' X#ident "@(#)i386-bsd-os-cc.rul 1.15 13/11/04 " X########################################################################### X# Written 1998 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for BSD/OS X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-gcc.rul X XOSDEFS += XCPPOPTS= -I$(ARCHDIR) -I$(OINCSDIR) $(INCDIRS:%=-I%) -I/sys $(INCDIRSX:%=-I%) X XKDEFINES= -DKERNEL -D_KERNEL X X#COPTDYN= -fpic XCOPTDYN= X XLIB_PREFIX= lib XLIB_SUFFIX= .a X#SHL_SUFFIX= .so.1.0 XSHL_SUFFIX= X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%) XLDOPTS= $(LIBS_PATH) $(LDPATH) X#LDOPTDYN= -shared -Wl,-soname,$(TARGET) X#LNDYNLIB= @$(RM) $(RM_FORCE) $(PTARGET_BASE).so; $(SYMLINK) $(TARGET) $(PTARGET_BASE).so XLDOPTDYN= XLNDYNLIB= X XRANLIB= @echo " ==> RANDOMIZING ARCHIVE \"$@\""; ranlib END-of-star-1.6/RULES/i386-bsd-os-cc.rul echo x - star-1.6/RULES/i86pc-sunos5-cc.rul sed 's/^X//' >star-1.6/RULES/i86pc-sunos5-cc.rul << 'END-of-star-1.6/RULES/i86pc-sunos5-cc.rul' X#ident "@(#)i86pc-sunos5-cc.rul 1.13 14/03/28 " X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for SunOS 5.x on PC X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-$(C_ARCH:cc%=sunpro%).rul X XOSDEFS += -D__SVR4 -DSVR4 X XKDEFINES= -DKERNEL -D_KERNEL X X XLIB_SOCKET= -lsocket -lnsl -ldl XLIB_MATH= -lm XLIB_KVM= -lkvm -lelf XLIB_VOLMGT= -lvolmgt X XARFLAGS= crs END-of-star-1.6/RULES/i86pc-sunos5-cc.rul echo x - star-1.6/RULES/i86pc-sunos5-gcc.rul sed 's/^X//' >star-1.6/RULES/i86pc-sunos5-gcc.rul << 'END-of-star-1.6/RULES/i86pc-sunos5-gcc.rul' X#ident "@(#)i86pc-sunos5-gcc.rul 1.15 14/03/28 " X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for SunOS 5.x for PC X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-$(C_ARCH).rul X XOSDEFS += -D__SVR4 -DSVR4 XKDEFINES= -DKERNEL -D_KERNEL X XLIB_SOCKET= -lsocket -lnsl -ldl XLIB_MATH= -lm XLIB_KVM= -lkvm -lelf XLIB_VOLMGT= -lvolmgt X X# X# Solaris comes with a linker that supports mapfiles X# XMAPVERS= $(_MAPVERS) # This enables to use mapfiles X X# X# We should use -Wl,-ztext here, but gcc does not create fully compliant X# object files. X# XLDOPTDYN= -dy -G -h $(TARGET) $(PMAPVERS:%=-Wl,-M%) -ldl X XARFLAGS= crs END-of-star-1.6/RULES/i86pc-sunos5-gcc.rul echo x - star-1.6/RULES/rules.loc sed 's/^X//' >star-1.6/RULES/rules.loc << 'END-of-star-1.6/RULES/rules.loc' X#ident "@(#)rules.loc 1.16 18/08/14 " X########################################################################### X# Written 1997 by J. Schilling X########################################################################### X# X# Rules to localize files X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XPTARGET= $(ARCHDIR)/$(TARGET) X########################################################################### X# X# We are doing a copy to $(ARCHDIR) to be able to have platform dependent X# shell files in future. X# X########################################################################### X_INSMODEI= $(_UNIQ)$(INSMODE) X__INSMODEI= $(_INSMODEI:$(_UNIQ)=$(INSMODEF)) XINSMODEI= $(__INSMODEI:$(_UNIQ)%=%) X Xall localize: $(ARCHDIR) $(WAIT) $(PTARGET) $(MAN) X X$(PTARGET): $(SRCFILE) X $(LOCALIZE) $(SRCFILE) $@ X X# X# gmake only. Other make implementations use a no-xxx/ prefix. X# gmake calls prerequisites to the right of | as order-only-prerequisites X# and does not evaluate the time stamp from such prerequisites. X# X$(GMAKE_ONLY)$(PTARGET): | $(ARCHDIR) X X$(ARCHDIR): X $(MKDIR) -p $@ X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/sub.htm Xinclude $(SRCROOT)/$(RULESDIR)/rules.clr Xinclude $(SRCROOT)/$(RULESDIR)/rules.ins Xinclude $(SRCROOT)/$(RULESDIR)/rules.tag Xinclude $(SRCROOT)/$(RULESDIR)/rules.hlp Xinclude $(SRCROOT)/$(RULESDIR)/dummy.dep X########################################################################### END-of-star-1.6/RULES/rules.loc echo x - star-1.6/RULES/i586-linux-clang.rul sed 's/^X//' >star-1.6/RULES/i586-linux-clang.rul << 'END-of-star-1.6/RULES/i586-linux-clang.rul' X#ident "@(#)i586-linux-clang.rul 1.5 18/11/07 " X########################################################################### X# Written 1996-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for Linux using Clang X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-$(C_ARCH).rul X X# X# LINUX_SRC_INCLUDE is defined in DEFAULTS/Defaults.linux X# XINCDIRSX += $(LINUX_SRC_INCLUDE) XOSDEFS += X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X X# X# Sunpro C/C++ run on Solaris and Linux and both have linkers X# that support mapfiles X# XMAPVERS= $(_MAPVERS) # This enables to use mapfiles X# X# The GNU linker is buggy and does not like the official order in linker map X# files for symbol versioning. The following command reverses the order of X# the version names in the linker map file. X# XMAPFILE_POST= | sed 's/^SCHILY/+SCHILY/' | tr '\012' '@' | tr '+' '\012' | sort -V | tr '@' '\012' X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%) X# X# Uncomment the next line in case you are on an old Linux version that X# does not support the -R linker flag. X# X#LDOPTS= $(LIBS_PATH) $(LDPATH) XLDOPTMAP= $(PMAPVERS:%=-Wl,--version-script=%) XLDOPTDYN= -shared -Wl,-soname,$(TARGET) $(LDOPTMAP) X XLORDER= echo XTSORT= cat END-of-star-1.6/RULES/i586-linux-clang.rul echo x - star-1.6/RULES/i86pc-sunos5-clang.rul sed 's/^X//' >star-1.6/RULES/i86pc-sunos5-clang.rul << 'END-of-star-1.6/RULES/i86pc-sunos5-clang.rul' X#ident "@(#)i86pc-sunos5-clang.rul 1.2 14/04/07 " X########################################################################### X# Written 1996-2014 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for SunOS 5.x for PC using Clang X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-$(C_ARCH).rul X XOSDEFS += -D__SVR4 -DSVR4 XKDEFINES= -DKERNEL -D_KERNEL X XLIB_SOCKET= -lsocket -lnsl -ldl XLIB_MATH= -lm XLIB_KVM= -lkvm -lelf XLIB_VOLMGT= -lvolmgt X X# X# Solaris comes with a linker that supports mapfiles X# XMAPVERS= $(_MAPVERS) # This enables to use mapfiles X X# X# We should use -Wl,-ztext here, but gcc does not create fully compliant X# object files. X# X#LDOPTDYN= -dy -G -h $(TARGET) $(PMAPVERS:%=-Wl,-M%) -ldl XLDOPTDYN= -Wl,-dy -Wl,-G -Wl,-h$(TARGET) $(PMAPVERS:%=-Wl,-M%) -ldl X XARFLAGS= crs END-of-star-1.6/RULES/i86pc-sunos5-clang.rul echo x - star-1.6/RULES/sun4-sunos5-clang.rul sed 's/^X//' >star-1.6/RULES/sun4-sunos5-clang.rul << 'END-of-star-1.6/RULES/sun4-sunos5-clang.rul' X#ident "@(#)sun4-sunos5-clang.rul 1.1 14/04/02 " X########################################################################### X# Written 1996-2014 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for SunOS 5.x on sparc for Clang X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-$(C_ARCH).rul X XOSDEFS += -D__SVR4 -DSVR4 XKDEFINES= -DKERNEL -D_KERNEL X XLIB_SOCKET= -lsocket -lnsl -ldl XLIB_MATH= -lm XLIB_KVM= -lkvm -lelf XLIB_VOLMGT= -lvolmgt X X# X# Solaris comes with a linker that supports mapfiles X# XMAPVERS= $(_MAPVERS) # This enables to use mapfiles X X# X# We should use -Wl,-ztext here, but gcc does not create fully compliant X# object files. X# XLDOPTDYN= -dy -G -h $(TARGET) $(PMAPVERS:%=-Wl,-M%) -ldl X XARFLAGS= crs END-of-star-1.6/RULES/sun4-sunos5-clang.rul echo x - star-1.6/RULES/r-gmake.dep sed 's/^X//' >star-1.6/RULES/r-gmake.dep << 'END-of-star-1.6/RULES/r-gmake.dep' X#ident "@(#)r-gmake.dep 1.17 18/08/16 " X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# Dependency building rules for gmake X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XDEP_SUFFIX= .d XRMDEP= $(RM) $(RM_FORCE) $@ X___C++DEP_FILES= $(C++FILES:%.C=%.d) X__C++DEP_FILES= $(___C++DEP_FILES:%.cc=%.d) X_C++DEP_FILES= $(__C++DEP_FILES:%.cpp=%.d) XC++DEP_FILES= $(_C++DEP_FILES:%.cxx=%.d) XC++PDEP_FILES= $(C++DEP_FILES:%=$(ARCHDIR)/%) XDEP_FILE= $(CFILES:%.c=%.d) $(C++DEP_FILES) XPDEP_FILE= $(CFILES:%.c=$(ARCHDIR)/%.d) $(C++PDEP_FILES) XPALLDEP_FILE= $(CFILES:%.c=$(ARCHDIR)/%.d) $(C++PDEP_FILES) $(ARCHDIR)/$(TARGET).dep XDEP_DEP= $(ARCHDIR)/Dnull X########################################################################### Xdepend: rmdep $(DEP_FILE) X Xrmdep: X $(RM) $(RM_FORCE) $(PALLDEP_FILE) X X########################################################################### X# X# Make the complete path to the architecture subdirectory. X# Make $(ARCHDIR)/man as well here to avoid this directory to become root X# owned when root later calls "make install". X# X########################################################################### X$(ARCHDIR) $(ARCHDIR)/man: X $(MKDIR) -p $@ X X########################################################################### X# X# Generate dependency file(s). X# This rules is checked when the dependency file(s) are included. X# X# Modify the the path for .o files to reflect that they are placed in X# $(ARCHDIR). Add the dependency file itself to each line so that X# the dependencies will be rebuilt if a source is newer that the X# appropriate dependency file. X# X########################################################################### X$(ARCHDIR)/%.d: %.c X $(MKDEP) $(CPP_FLAGS) $(CPPFLAGS) $(MKDEP_OUT) $< \ X | sed -e 's;^\(.*\)\.$o[ ]*:;$(ARCHDIR)/\1.$o $(ARCHDIR)/\1.d:;' > $@ X X$(ARCHDIR)/%.d: %.C X $(MKC++DEP) $(CPP_FLAGS) $(CPPFLAGS) $(MKC++DEP_OUT) $< \ X | sed -e 's;^\(.*\)\.$o[ ]*:;$(ARCHDIR)/\1.$o $(ARCHDIR)/\1.d:;' > $@ X$(ARCHDIR)/%.d: %.cc X $(MKC++DEP) $(CPP_FLAGS) $(CPPFLAGS) $(MKC++DEP_OUT) $< \ X | sed -e 's;^\(.*\)\.$o[ ]*:;$(ARCHDIR)/\1.$o $(ARCHDIR)/\1.d:;' > $@ X$(ARCHDIR)/%.d: %.cpp X $(MKC++DEP) $(CPP_FLAGS) $(CPPFLAGS) $(MKC++DEP_OUT) $< \ X | sed -e 's;^\(.*\)\.$o[ ]*:;$(ARCHDIR)/\1.$o $(ARCHDIR)/\1.d:;' > $@ X$(ARCHDIR)/%.d: %.cxx X $(MKC++DEP) $(CPP_FLAGS) $(CPPFLAGS) $(MKC++DEP_OUT) $< \ X | sed -e 's;^\(.*\)\.$o[ ]*:;$(ARCHDIR)/\1.$o $(ARCHDIR)/\1.d:;' > $@ X X$(PDEP_FILE): $(DEP_DEP) X X$(DEP_DEP): X @if [ ! -f $@ ]; then \ X echo " ==> MAKING DIRECTORY \"$(ARCHDIR)\""; \ X $(_MKDIR) -p $(ARCHDIR); \ X echo " ==> MAKING DIRECTORY \"$(ARCHDIR)/man\""; \ X $(_MKDIR) -p $(ARCHDIR)/man; \ X echo > $@; \ X fi X X########################################################################### X# X# Include the dependency file(s) generated from the rules above. X# X########################################################################### X-include $(PDEP_FILE) END-of-star-1.6/RULES/r-gmake.dep echo x - star-1.6/RULES/i786-mingw32_nt-gcc.rul sed 's/^X//' >star-1.6/RULES/i786-mingw32_nt-gcc.rul << 'END-of-star-1.6/RULES/i786-mingw32_nt-gcc.rul' X#ident "@(#)i786-mingw32_nt-gcc.rul 1.13 18/04/11 " X########################################################################### X# X# Platform dependent MACROS for Win32/Mingw32 X# X########################################################################### X# Copyright (c) 2004-2018 J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-gcc.rul X XOSDEFS += XCPPOPTS= -I/MinGW/Include -I$(ARCHDIR) -I$(OINCSDIR) $(INCDIRS:%=-I%) $(INCDIRSX:%=-I%) X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X XWIN_LIBS= $(WIN32_LIBS) X XLDLIBS= $(LIBS) $(LIBX) $(WIN_LIBS) -lmingw32 X XLDOPTS= $(LIBS_PATH) $(LDPATH) X XLORDER= echo XTSORT= cat X X_MKDIR= $(_MKDIR_SH) XMKDIR= $(MKDIR_SH) XINSMKDIR= $(INSMKDIR_SH) END-of-star-1.6/RULES/i786-mingw32_nt-gcc.rul echo x - star-1.6/RULES/os-mac-os.id sed 's/^X//' >star-1.6/RULES/os-mac-os.id << 'END-of-star-1.6/RULES/os-mac-os.id' X#ident "@(#)os-mac-os.id 1.2 06/05/14 " X########################################################################### X# Written 2000 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for Mac OS X X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X_O_ARCH= $(OSREL:9.%=mac-os9) XO_ARCH= $(_O_ARCH:10.%=mac-os10) X-O_ARCH= -$(O_ARCH) END-of-star-1.6/RULES/os-mac-os.id echo x - star-1.6/RULES/os-mac-os10.def sed 's/^X//' >star-1.6/RULES/os-mac-os10.def << 'END-of-star-1.6/RULES/os-mac-os10.def' X#ident "@(#)os-mac-os10.def 1.2 06/05/14 " X########################################################################### X# Written 2000 by J. Schilling X########################################################################### X# X# Global os definitions for Mac OS X X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XMANSTYLE= bsd END-of-star-1.6/RULES/os-mac-os10.def echo x - star-1.6/RULES/os-mingw32_95-4.0.id sed 's/^X//' >star-1.6/RULES/os-mingw32_95-4.0.id << 'END-of-star-1.6/RULES/os-mingw32_95-4.0.id' X#ident "@(#)os-mingw32_95-4.0.id 1.2 06/05/14 " X########################################################################### X# X# OS specific MACRO definitions for Win32/Mingw32 X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= mingw32_nt X-O_ARCH= -$(O_ARCH) END-of-star-1.6/RULES/os-mingw32_95-4.0.id echo x - star-1.6/RULES/os-mingw32_98-4.0.id sed 's/^X//' >star-1.6/RULES/os-mingw32_98-4.0.id << 'END-of-star-1.6/RULES/os-mingw32_98-4.0.id' X#ident "@(#)os-mingw32_98-4.0.id 1.2 06/05/14 " X########################################################################### X# X# OS specific MACRO definitions for Win32/Mingw32 X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= mingw32_nt X-O_ARCH= -$(O_ARCH) END-of-star-1.6/RULES/os-mingw32_98-4.0.id echo x - star-1.6/RULES/os-mingw32_98-4.10.id sed 's/^X//' >star-1.6/RULES/os-mingw32_98-4.10.id << 'END-of-star-1.6/RULES/os-mingw32_98-4.10.id' X#ident "@(#)os-mingw32_98-4.10.id 1.2 06/05/14 " X########################################################################### X# X# OS specific MACRO definitions for Win32/Mingw32 X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= mingw32_nt X-O_ARCH= -$(O_ARCH) END-of-star-1.6/RULES/os-mingw32_98-4.10.id echo x - star-1.6/RULES/os-mingw32_me-4.90.id sed 's/^X//' >star-1.6/RULES/os-mingw32_me-4.90.id << 'END-of-star-1.6/RULES/os-mingw32_me-4.90.id' X#ident "@(#)os-mingw32_me-4.90.id 1.2 06/05/14 " X########################################################################### X# X# OS specific MACRO definitions for Win32/Mingw32 X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= mingw32_nt X-O_ARCH= -$(O_ARCH) END-of-star-1.6/RULES/os-mingw32_me-4.90.id echo x - star-1.6/RULES/os-mingw32_nt-4.0.id sed 's/^X//' >star-1.6/RULES/os-mingw32_nt-4.0.id << 'END-of-star-1.6/RULES/os-mingw32_nt-4.0.id' X#ident "@(#)os-mingw32_nt-4.0.id 1.2 06/05/14 " X########################################################################### X# X# OS specific MACRO definitions for Win32/Mingw32 X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= mingw32_nt X-O_ARCH= -$(O_ARCH) END-of-star-1.6/RULES/os-mingw32_nt-4.0.id echo x - star-1.6/RULES/os-mingw32_nt-5.0.id sed 's/^X//' >star-1.6/RULES/os-mingw32_nt-5.0.id << 'END-of-star-1.6/RULES/os-mingw32_nt-5.0.id' X#ident "@(#)os-mingw32_nt-5.0.id 1.2 06/05/14 " X########################################################################### X# X# OS specific MACRO definitions for Win32/Mingw32 X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= mingw32_nt X-O_ARCH= -$(O_ARCH) END-of-star-1.6/RULES/os-mingw32_nt-5.0.id echo x - star-1.6/RULES/os-mingw32_nt-5.1.id sed 's/^X//' >star-1.6/RULES/os-mingw32_nt-5.1.id << 'END-of-star-1.6/RULES/os-mingw32_nt-5.1.id' X#ident "@(#)os-mingw32_nt-5.1.id 1.2 06/05/14 " X########################################################################### X# X# OS specific MACRO definitions for Win32/Mingw32 X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= mingw32_nt X-O_ARCH= -$(O_ARCH) END-of-star-1.6/RULES/os-mingw32_nt-5.1.id echo x - star-1.6/RULES/os-ms-dos.def sed 's/^X//' >star-1.6/RULES/os-ms-dos.def << 'END-of-star-1.6/RULES/os-ms-dos.def' X#ident "@(#)os-ms-dos.def 1.2 06/05/14 " X########################################################################### X# X# Global os definitions for MS-DOS/DJGPP v2 X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XMANSTYLE= sysv END-of-star-1.6/RULES/os-ms-dos.def echo x - star-1.6/RULES/os-ms-dos.id sed 's/^X//' >star-1.6/RULES/os-ms-dos.id << 'END-of-star-1.6/RULES/os-ms-dos.id' X#ident "@(#)os-ms-dos.id 1.2 06/05/14 " X########################################################################### X# X# OS specific MACRO definitions for MS-DOS/DJGPP v2 X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= ms-dos X-O_ARCH= -$(O_ARCH) END-of-star-1.6/RULES/os-ms-dos.id echo x - star-1.6/RULES/os-netbsd.def sed 's/^X//' >star-1.6/RULES/os-netbsd.def << 'END-of-star-1.6/RULES/os-netbsd.def' X#ident "@(#)os-netbsd.def 1.2 06/05/14 " X########################################################################### X# Written 1997 by J. Schilling X########################################################################### X# X# Global os definitions for NetBSD X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XMANSTYLE= bsd END-of-star-1.6/RULES/os-netbsd.def echo x - star-1.6/RULES/gmake.wrn sed 's/^X//' >star-1.6/RULES/gmake.wrn << 'END-of-star-1.6/RULES/gmake.wrn' X W A R N I N G Messages like: X Xgmake[2]: Entering directory `/tmp/cdrtools-2.01/libschily' X../RULES/r-gmake.dep:76: OBJ//cvmod.d: No such file or directory X../RULES/r-gmake.dep:76: OBJ//dat.d: No such file or directory X../RULES/r-gmake.dep:76: OBJ//fcons.d: No such file or directory X../RULES/r-gmake.dep:76: OBJ//fdown.d: No such file or directory X../RULES/r-gmake.dep:76: OBJ//fdup.d: No such file or directory X../RULES/r-gmake.dep:76: OBJ//ffileread.d: No such file or directory X../RULES/r-gmake.dep:76: OBJ//ffilewrite.d: No such file or directory X../RULES/r-gmake.dep:76: OBJ//fgetline.d: No such file or directory X../RULES/r-gmake.dep:76: OBJ//fgetstr.d: No such file or directory X../RULES/r-gmake.dep:76: OBJ//file_raise.d: No such file or directory X../RULES/r-gmake.dep:76: OBJ//fileclose.d: No such file or directory X.... X Xare caused by a GNU make bug and not by the Schily makefile system. X XThe related bug has been reported to the GNU make maintainers in 1998 but Xas the bug has not yet been fixed, it seems that GNU make is unmaintained :-( XA working highly portable make program is at X X https://sourceforge.net/projects/s-make/files/ X XYou may switch off this warning by calling "gmake GMAKE_NOWARN=true ..." END-of-star-1.6/RULES/gmake.wrn echo x - star-1.6/RULES/rules.man sed 's/^X//' >star-1.6/RULES/rules.man << 'END-of-star-1.6/RULES/rules.man' X#ident "@(#)rules.man 1.11 18/08/14 " X########################################################################### X# Written 1997-2018 by J. Schilling X########################################################################### X# X# Manual page building rules X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/man-$(MANSTYLE).def X########################################################################### X XINSDIR= $(MANBASE:%=%/)$(MANDIR)/$(MANSECT) XSUBARCHDIR= /$(MANDIR) XTARGET= $(TARGETMAN).$(MANSUFFIX) XSRCFILE= $(MANFILE) X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.htm X X X########################################################################### X# The rest is copied from rules.loc X########################################################################### XPTARGET= $(ARCHDIR)/$(TARGET) X########################################################################### X# X# We are doing a copy to $(ARCHDIR) to be able to have platform dependent X# shell files in future. X# X########################################################################### X_INSMODEI= $(_UNIQ)$(INSMODE) X__INSMODEI= $(_INSMODEI:$(_UNIQ)=$(INSMODEF)) XINSMODEI= $(__INSMODEI:$(_UNIQ)%=%) X Xall man: $(ARCHDIR) $(WAIT) $(PTARGET) X Xinstall installman: $(ARCHDIR) man X Xinstallman: man install X X$(PTARGET): $(SRCFILE) X $(LOCALIZE) $(SRCFILE) $@ X X# X# gmake only. Other make implementations use a no-xxx/ prefix. X# gmake calls prerequisites to the right of | as order-only-prerequisites X# and does not evaluate the time stamp from such prerequisites. X# X$(GMAKE_ONLY)$(PTARGET): | $(ARCHDIR) X X$(ARCHDIR): X $(MKDIR) -p $@ X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.clr Xinclude $(SRCROOT)/$(RULESDIR)/rules.ins Xinclude $(SRCROOT)/$(RULESDIR)/rules.tag Xinclude $(SRCROOT)/$(RULESDIR)/rules.hlp Xinclude $(SRCROOT)/$(RULESDIR)/dummy.dep X########################################################################### END-of-star-1.6/RULES/rules.man echo x - star-1.6/RULES/os-cygwin_nt-5.2-wow.id sed 's/^X//' >star-1.6/RULES/os-cygwin_nt-5.2-wow.id << 'END-of-star-1.6/RULES/os-cygwin_nt-5.2-wow.id' X#ident "@(#)os-cygwin_nt-5.2-wow.id 1.1 15/06/29 " X########################################################################### X# Written 2006 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for Cygnus GCC for MS Windows NT-5.2 (Server 2003) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/os-cygwin32_wow.id X XWINNTDEFS += -D_WIN32_WINNT=0x0502 END-of-star-1.6/RULES/os-cygwin_nt-5.2-wow.id echo x - star-1.6/RULES/os-dragonfly.def sed 's/^X//' >star-1.6/RULES/os-dragonfly.def << 'END-of-star-1.6/RULES/os-dragonfly.def' X#ident "@(#)os-dragonfly.def 1.2 06/05/14 " X########################################################################### X# Written 2006 by J. Schilling X########################################################################### X# X# Global os definitions for DragonFly BSD X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XMANSTYLE= bsd END-of-star-1.6/RULES/os-dragonfly.def echo x - star-1.6/RULES/os-dragonfly.id sed 's/^X//' >star-1.6/RULES/os-dragonfly.id << 'END-of-star-1.6/RULES/os-dragonfly.id' X#ident "@(#)os-dragonfly.id 1.2 06/05/14 " X########################################################################### X# Written 2006 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for DragonFly BSD X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= dragonfly X-O_ARCH= -$(O_ARCH) END-of-star-1.6/RULES/os-dragonfly.id echo x - star-1.6/RULES/os-freemint.def sed 's/^X//' >star-1.6/RULES/os-freemint.def << 'END-of-star-1.6/RULES/os-freemint.def' X#ident @(#)os-freemint.def 1.1 08/11/08 X########################################################################### X# Written 2008 by Y. Doyeux X########################################################################### X# X# Global os definitions for FreeMiNT on ATARI computers X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XMANSTYLE= bsd END-of-star-1.6/RULES/os-freemint.def echo x - star-1.6/RULES/os-cygwin32_wow.def sed 's/^X//' >star-1.6/RULES/os-cygwin32_wow.def << 'END-of-star-1.6/RULES/os-cygwin32_wow.def' X#ident "@(#)os-cygwin32_wow.def 1.1 15/06/29 " X########################################################################### X# Written 1997 by J. Schilling X########################################################################### X# X# Global os definitions for CYGWIN32_WOW X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XMANSTYLE= bsd X END-of-star-1.6/RULES/os-cygwin32_wow.def echo x - star-1.6/RULES/os-cygwin32_wow.id sed 's/^X//' >star-1.6/RULES/os-cygwin32_wow.id << 'END-of-star-1.6/RULES/os-cygwin32_wow.id' X#ident "@(#)os-cygwin32_wow.id 1.1 15/06/29 " X########################################################################### X# Written 1997 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for Cygnus GCC for MS Windows NT X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= cygwin32_wow X-O_ARCH= -$(O_ARCH) X X#WINNTDEFS += -D_WIN32_WINNT=0x0400 END-of-star-1.6/RULES/os-cygwin32_wow.id echo x - star-1.6/RULES/os-cygwin_nt-6.4-wow.id sed 's/^X//' >star-1.6/RULES/os-cygwin_nt-6.4-wow.id << 'END-of-star-1.6/RULES/os-cygwin_nt-6.4-wow.id' X#ident "@(#)os-cygwin_nt-6.4-wow.id 1.1 15/08/03 " X########################################################################### X# Written 2015 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for Cygnus GCC for MS Windows NT-6.4 (Win 10.0) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/os-cygwin32_wow.id X XWINNTDEFS += -D_WIN32_WINNT=0x0604 END-of-star-1.6/RULES/os-cygwin_nt-6.4-wow.id echo x - star-1.6/RULES/os-cygwin_nt-6.4-wow64.id sed 's/^X//' >star-1.6/RULES/os-cygwin_nt-6.4-wow64.id << 'END-of-star-1.6/RULES/os-cygwin_nt-6.4-wow64.id' X#ident "@(#)os-cygwin_nt-6.4-wow64.id 1.1 15/08/03 " X########################################################################### X# Written 2015 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for Cygnus GCC for MS Windows NT-6.4 (Win 10.0) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/os-cygwin32_wow64.id X XWINNTDEFS += -D_WIN32_WINNT=0x0604 END-of-star-1.6/RULES/os-cygwin_nt-6.4-wow64.id echo x - star-1.6/RULES/os-cygwin_nt-6.4.id sed 's/^X//' >star-1.6/RULES/os-cygwin_nt-6.4.id << 'END-of-star-1.6/RULES/os-cygwin_nt-6.4.id' X#ident "@(#)os-cygwin_nt-6.4.id 1.1 15/08/03 " X########################################################################### X# Written 2015 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for Cygnus GCC for MS Windows NT-6.4 (Win 10.0) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/os-cygwin32_nt.id X XWINNTDEFS += -D_WIN32_WINNT=0x0604 END-of-star-1.6/RULES/os-cygwin_nt-6.4.id echo x - star-1.6/RULES/os-cygwin_nt-10.0-wow.id sed 's/^X//' >star-1.6/RULES/os-cygwin_nt-10.0-wow.id << 'END-of-star-1.6/RULES/os-cygwin_nt-10.0-wow.id' X#ident "@(#)os-cygwin_nt-10.0-wow.id 1.1 15/08/03 " X########################################################################### X# Written 2015 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for Cygnus GCC for MS Windows NT-10.0 (Win 10.0) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/os-cygwin32_wow.id X XWINNTDEFS += -DWINVER=0x0A00 -D_WIN32_WINNT=0x0A00 END-of-star-1.6/RULES/os-cygwin_nt-10.0-wow.id echo x - star-1.6/RULES/os-cygwin_nt-10.0-wow64.id sed 's/^X//' >star-1.6/RULES/os-cygwin_nt-10.0-wow64.id << 'END-of-star-1.6/RULES/os-cygwin_nt-10.0-wow64.id' X#ident "@(#)os-cygwin_nt-10.0-wow64.id 1.1 15/08/03 " X########################################################################### X# Written 2015 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for Cygnus GCC for MS Windows NT-10.0 (Win 10.0) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/os-cygwin32_wow64.id X XWINNTDEFS += -DWINVER=0x0A00 -D_WIN32_WINNT=0x0A00 END-of-star-1.6/RULES/os-cygwin_nt-10.0-wow64.id echo x - star-1.6/RULES/os-cygwin_nt-10.0.id sed 's/^X//' >star-1.6/RULES/os-cygwin_nt-10.0.id << 'END-of-star-1.6/RULES/os-cygwin_nt-10.0.id' X#ident "@(#)os-cygwin_nt-10.0.id 1.1 15/08/03 " X########################################################################### X# Written 2015 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for Cygnus GCC for MS Windows NT-10.0 (Win 10.0) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/os-cygwin32_nt.id X XWINNTDEFS += -DWINVER=0x0A00 -D_WIN32_WINNT=0x0A00 END-of-star-1.6/RULES/os-cygwin_nt-10.0.id echo x - star-1.6/RULES/os-cygwin_nt-5.1.id sed 's/^X//' >star-1.6/RULES/os-cygwin_nt-5.1.id << 'END-of-star-1.6/RULES/os-cygwin_nt-5.1.id' X#ident "@(#)os-cygwin_nt-5.1.id 1.4 07/05/29 " X########################################################################### X# Written 2006 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for Cygnus GCC for MS Windows NT-5.1 (XP) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/os-cygwin32_nt.id X XWINNTDEFS += -D_WIN32_WINNT=0x0501 END-of-star-1.6/RULES/os-cygwin_nt-5.1.id echo x - star-1.6/RULES/os-freemint.id sed 's/^X//' >star-1.6/RULES/os-freemint.id << 'END-of-star-1.6/RULES/os-freemint.id' X#ident @(#)os-freemint.id 1.1 08/11/08 X########################################################################### X# Written 2008 by Y. Doyeux X########################################################################### X# X# OS specific MACRO definitions for FreeMiNT on ATARI computers X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= freemint X-O_ARCH= -$(O_ARCH) END-of-star-1.6/RULES/os-freemint.id echo x - star-1.6/RULES/os-gnu.def sed 's/^X//' >star-1.6/RULES/os-gnu.def << 'END-of-star-1.6/RULES/os-gnu.def' X#ident "@(#)os-gnu.def 1.2 06/05/14 " X########################################################################### X# Written 1997 by J. Schilling X########################################################################### X# X# Global os definitions for GNU (hurd) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XMANSTYLE= bsd END-of-star-1.6/RULES/os-gnu.def echo x - star-1.6/RULES/amd64-bitrig-clang.rul sed 's/^X//' >star-1.6/RULES/amd64-bitrig-clang.rul << 'END-of-star-1.6/RULES/amd64-bitrig-clang.rul' X#ident "@(#)amd64-bitrig-clang.rul 1.3 18/04/11 " X########################################################################### X# Written 2015-2018 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for Bitrig using Clang X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-$(C_ARCH).rul X XOSDEFS += X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so.$(DYNMAJOR).$(DYNMINOR) X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X XLDOPTS= $(LIBS_PATH) $(LDPATH) X XRANLIB= @echo " ==> RANDOMIZING ARCHIVE \"$@\""; ranlib END-of-star-1.6/RULES/amd64-bitrig-clang.rul echo x - star-1.6/RULES/os-bitrig.def sed 's/^X//' >star-1.6/RULES/os-bitrig.def << 'END-of-star-1.6/RULES/os-bitrig.def' X#ident "@(#)os-bitrig.def 1.1 15/10/08 " X########################################################################### X# Written 2015 by J. Schilling X########################################################################### X# X# Global os definitions for Bitrig X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XMANSTYLE= bsd END-of-star-1.6/RULES/os-bitrig.def echo x - star-1.6/RULES/os-bitrig.id sed 's/^X//' >star-1.6/RULES/os-bitrig.id << 'END-of-star-1.6/RULES/os-bitrig.id' X#ident "@(#)os-bitrig.id 1.1 15/10/08 " X########################################################################### X# Written 2015 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for Bitrig X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XO_ARCH= bitrig X-O_ARCH= -$(O_ARCH) END-of-star-1.6/RULES/os-bitrig.id echo x - star-1.6/RULES/os-cygwin_me-4.90.id sed 's/^X//' >star-1.6/RULES/os-cygwin_me-4.90.id << 'END-of-star-1.6/RULES/os-cygwin_me-4.90.id' X#ident "@(#)os-cygwin_me-4.90.id 1.2 07/05/08 " X########################################################################### X# Written 2006 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for Cygnus GCC for MS Windows 4.90 (ME) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/os-cygwin32_nt.id X XOSDEFS += -D_WIN32_WINDOWS=0x0490 END-of-star-1.6/RULES/os-cygwin_me-4.90.id echo x - star-1.6/RULES/os-cygwin_nt-4.0.id sed 's/^X//' >star-1.6/RULES/os-cygwin_nt-4.0.id << 'END-of-star-1.6/RULES/os-cygwin_nt-4.0.id' X#ident "@(#)os-cygwin_nt-4.0.id 1.4 07/05/29 " X########################################################################### X# Written 2006 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for Cygnus GCC for MS Windows NT-4.0 (NT-4.0) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/os-cygwin32_nt.id X XWINNTDEFS += -D_WIN32_WINNT=0x0400 END-of-star-1.6/RULES/os-cygwin_nt-4.0.id echo x - star-1.6/RULES/os-cygwin_nt-5.0.id sed 's/^X//' >star-1.6/RULES/os-cygwin_nt-5.0.id << 'END-of-star-1.6/RULES/os-cygwin_nt-5.0.id' X#ident "@(#)os-cygwin_nt-5.0.id 1.4 07/05/29 " X########################################################################### X# Written 2006 by J. Schilling X########################################################################### X# X# OS specific MACRO definitions for Cygnus GCC for MS Windows NT-5.0 (WIN2000) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/os-cygwin32_nt.id X XWINNTDEFS += -D_WIN32_WINNT=0x0500 END-of-star-1.6/RULES/os-cygwin_nt-5.0.id echo x - star-1.6/RULES/rules.tst sed 's/^X//' >star-1.6/RULES/rules.tst << 'END-of-star-1.6/RULES/rules.tst' X#ident "@(#)rules.tst 1.1 16/06/16 " X########################################################################### X# Written 2016 by J. Schilling X########################################################################### X# X# Test rules X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X Xtests: X @DIR=tests; \ X if [ -d ./$$DIR -a -r ./$$DIR/Makefile ] ; then \ X cd ./$$DIR && "$(MAKE)" $(MAKEMACS) XARCH=$(XARCH) DIRNAME=$(CURDIR)/$$DIR $@; \ X else \ X echo "NOTICE: Partial source ($(CURDIR)/$$DIR) missing";\ X fi \ END-of-star-1.6/RULES/rules.tst echo x - star-1.6/RULES/rules.hlp sed 's/^X//' >star-1.6/RULES/rules.hlp << 'END-of-star-1.6/RULES/rules.hlp' X#ident "@(#)rules.hlp 1.21 18/08/14 " X########################################################################### X# Written 1996-2017 by J. Schilling X########################################################################### X# X# Help rules X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X# Location for targets: X# X# - all : see appropriate rules X# - man installman : rules.man X# - localize : rules.loc X# - lint : rules.lnt X# - clean, clobber, distclean, relink, rmtarget : rules.clr X# - rel : rules.rel X# - install, ibins : rules.ins X# - html, htmlx, htmlxn : rules.htm & sub.htm X# - tarpkg, tarpkg1 tarpkg2 : rules.sps X# - depend, rmdep : rules.dep X# - config : rules.cnf X# - tags, TAGS : rules.tag X# - .help : rules.hlp X# - .version : rules.hlp X# - tests : rules.tst X# - tinfo : rules.dir/rules.rdi X# - cstyle : rules.cst X# X########################################################################### X.help: X @echo "Usage: make [target]" X @echo "Available targets are:" $(ALLTARGETS) X @echo " all make the default target" X @echo " man make localized man pages" X @echo " localize make localized scripts" X @echo " lint lint all sources for the default target" X @echo " clean remove all made objects and the default target" X @echo " clobber remove all from 'clean' and all dependency files" X @echo " cstyle run 'cstyle' on the source files X @echo " distclean remove all from 'clobber' and all made files" X @echo " for all architectures" X @echo " relink remove and relink the default target" X @echo " rmtarget remove the default target" X @echo " install install the default target to final destination" X @echo " installman install the man pages to final destination" X @echo " ibins install the default target to local dir 'bins'" X @echo " uninstall uninstall the default target from final destination" X @echo " html create html vesions from the manual pages" X @echo " htmlx create enhanced html vesions from the manual pages" X @echo " htmlxn create enhanced html vesions from the manual pages if needed" X @echo " tarpkg create an installable tar packet -> tarpkg1 + parpkg2" X @echo " tarpkg1 helps to create an installable tar packet - install stage" X @echo " tarpkg2 installable tar packet - tar -c stage" X @echo " depend remove dependency file to prepare a remake" X @echo " config remake the dynamic configuration files" X @echo " tags make vi/ved compatible tag file" X @echo " TAGS make emacs compatible tag file" X @echo " .help display this help" X @echo " .version display version information for the makefile system" X @echo " tests Run conformance tests if available for target" X @echo " tinfo display target info for slottable target components" X @echo " shell start $(SHELL) with the environment used for compilation" X X.version: X @echo "Makefiles (The Schily Makefile System) Version: $(MAKEFILES_VERSION)" END-of-star-1.6/RULES/rules.hlp echo x - star-1.6/RULES/9000-725-hp-ux-gcc.rul sed 's/^X//' >star-1.6/RULES/9000-725-hp-ux-gcc.rul << 'END-of-star-1.6/RULES/9000-725-hp-ux-gcc.rul' X#ident "@(#)9000-725-hp-ux-gcc.rul 1.12 18/04/12 " X########################################################################### X# Written 1996-2017 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for HP/UX X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-gcc.rul X XOSDEFS += X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .sl.$(DYNMAJOR) X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%) XLDOPTS= $(LIBS_PATH) $(LDPATH) XLDOPTDYN= -b XDYNLD= @echo " ==> LINKING dynamic library \"$@\""; ld XLNDYNLIB= @$(RM) $(RM_FORCE) $(PTARGET_BASE).sl; $(SYMLINK) $(TARGET) $(PTARGET_BASE).sl X XLORDER= echo XTSORT= cat END-of-star-1.6/RULES/9000-725-hp-ux-gcc.rul echo x - star-1.6/RULES/aviion-dgux3-gcc.rul sed 's/^X//' >star-1.6/RULES/aviion-dgux3-gcc.rul << 'END-of-star-1.6/RULES/aviion-dgux3-gcc.rul' X#ident "@(#)aviion-dgux3-gcc.rul 1.9 07/05/08 " X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for DGUX 3.x on mc88100 X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-gcc.rul X XOSDEFS += -D__SVR4 -DSVR4 X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= -lkvm -lelf X X#LDOPTDYN= -dy -G -ztext -h $(TARGET) -ldl XLDOPTDYN= -shared -ztext -h $(TARGET) -ldl X XARFLAGS= crs END-of-star-1.6/RULES/aviion-dgux3-gcc.rul echo x - star-1.6/RULES/aviion-dgux4-cc.rul sed 's/^X//' >star-1.6/RULES/aviion-dgux4-cc.rul << 'END-of-star-1.6/RULES/aviion-dgux4-cc.rul' X#ident "@(#)aviion-dgux4-cc.rul 1.8 07/05/08 " X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for DGUX 4.x on mc88100/pentium X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-dg.rul X XOSDEFS += -D__SVR4 -DSVR4 X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_SOCKET= -lsocket -lnsl -ldl XLIB_MATH= -lm XLIB_KVM= -lkvm -lelf X XARFLAGS= crs END-of-star-1.6/RULES/aviion-dgux4-cc.rul echo x - star-1.6/RULES/aviion-dgux4-gcc.rul sed 's/^X//' >star-1.6/RULES/aviion-dgux4-gcc.rul << 'END-of-star-1.6/RULES/aviion-dgux4-gcc.rul' X#ident "@(#)aviion-dgux4-gcc.rul 1.9 07/05/08 " X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for DGUX 4.x on mc88100/pentium X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-gcc.rul X XOSDEFS += -D__SVR4 -DSVR4 X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_SOCKET= -lsocket -lnsl -ldl XLIB_MATH= -lm XLIB_KVM= -lkvm -lelf X XLDOPTDYN= -shared -ztext -h $(TARGET) -ldl X XARFLAGS= crs END-of-star-1.6/RULES/aviion-dgux4-gcc.rul echo x - star-1.6/RULES/bepc-beos-gcc.rul sed 's/^X//' >star-1.6/RULES/bepc-beos-gcc.rul << 'END-of-star-1.6/RULES/bepc-beos-gcc.rul' X#ident @(#)bepc-beos-gcc.rul 1.12 07/05/09 X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for BeOS X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-gcc.rul X X# X# XXX Old BeOS needs libroot.so to get [efg]cvt() X# XXX New BeOS seems to have this in libc and in addition we include X# XXX strtod.c for floating point conversion on OS without such code. X# XXX For this reason, -DNO_FLOATINGPOINT -DUSE_FLOATINGARGS has been X# XXX removed and printing floating numbers will work with old/new BeOS X# X#OSDEFS += -DNO_FLOATINGPOINT -DUSE_FLOATINGARGS XOSDEFS += X XKDEFINES= -DKERNEL -D_KERNEL X X#CONFFLAGS= i586 X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so X XLIB_SOCKET= -lsocket -lbind XLIB_MATH= XLIB_KVM= X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%) XLDOPTS= $(LIBS_PATH) $(LDPATH) X XLORDER= echo XTSORT= cat X XLN= /bin/ln -s END-of-star-1.6/RULES/bepc-beos-gcc.rul echo x - star-1.6/RULES/dn5500-domainos-cc.rul sed 's/^X//' >star-1.6/RULES/dn5500-domainos-cc.rul << 'END-of-star-1.6/RULES/dn5500-domainos-cc.rul' X#ident "@(#)dn5500-domainos-cc.rul 1.6 07/05/08 " X########################################################################### X# Written 2001 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for DomainOS (sys5.3, 10.4.1) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-apollo.rul X XOSDEFS += X XKDEFINES= -DKERNEL -D_KERNEL X X#LIB_SOCKET= -lsocket -lnsl -ldl XLIB_SOCKET= XLIB_MATH= -lm X#LIB_KVM= -lkvm XLIB_KVM= X XLORDER= echo XTSORT= cat X END-of-star-1.6/RULES/dn5500-domainos-cc.rul echo x - star-1.6/RULES/dummy.dep sed 's/^X//' >star-1.6/RULES/dummy.dep << 'END-of-star-1.6/RULES/dummy.dep' X#ident @(#)dummy.dep 1.2 06/05/14 X########################################################################### X# Written 1996 by J. Schilling X########################################################################### X# X# Dependency building dummy rules X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xdepend rmdep: X @echo "$@: nothing to make" END-of-star-1.6/RULES/dummy.dep echo x - star-1.6/RULES/i386-ms-dos-gcc.rul sed 's/^X//' >star-1.6/RULES/i386-ms-dos-gcc.rul << 'END-of-star-1.6/RULES/i386-ms-dos-gcc.rul' X#ident "@(#)i386-ms-dos-gcc.rul 1.5 07/05/08 " X########################################################################### X# X# Platform dependent MACROS for MSDOS/DJGPP v2 X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-gcc.rul X XOSDEFS += X XCOPTDYN= XCOPTGPROF= -pg X XLIB_PREFIX= lib XLIB_SUFFIX= .a XSHL_SUFFIX= .so X XLIB_SOCKET= XLIB_MATH= -lm XLIB_KVM= X XLDOPTS= $(LIBS_PATH) $(LDPATH) XLDOPTDYN= XLNDYNLIB= X X#LDCC= @echo " ==> LINKING \"$@\""; gcc -Wl,--strip-all XDYNLD= @echo " ==> LINKING dynamic library \"$@\""; ld X XLORDER= echo XTSORT= cat END-of-star-1.6/RULES/i386-ms-dos-gcc.rul echo x - star-1.6/RULES/i386-os2-gcc.rul sed 's/^X//' >star-1.6/RULES/i386-os2-gcc.rul << 'END-of-star-1.6/RULES/i386-os2-gcc.rul' X#ident "@(#)i386-os2-gcc.rul 1.13 07/05/09 " X########################################################################### X# First version written 1999 by C. Wohlgemuth X########################################################################### X# X# Platform dependent MACROS for OS/2 using gcc (EMX) X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-gcc.rul X X# XXX strtod.c now does floating point conversion on OS without ?cvt(). X# XXX For this reason, -DNO_FLOATINGPOINT -DUSE_FLOATINGARGS has been X# XXX removed and printing floating numbers will work on any OS. X# XOSDEFS += -D__OS2 X X# X# Using -Zcrtdll is a hack to allow this flag to be seen X# from configure too. XCOPTS= -Zcrtdll X XKDEFINES= X XCOPTDYN= XCOPTGPROF= XLIB_PREFIX= XLIB_SUFFIX= .a XSHL_SUFFIX= X XLIB_SOCKET= -lsocket XLIB_MATH= XLIB_KVM= X X#LDOPTS= $(LIBS_PATH) $(LDPATH) $(RUNPATH:-R%=-Wl,-R%) XLDOPTS= $(LIBS_PATH) $(LDPATH) X XLDOPTDYN= X XLDCC= @echo " ==> LINKING \"$@\""; gcc -Zcrtdll X XLORDER= echo XTSORT= cat END-of-star-1.6/RULES/i386-os2-gcc.rul echo x - star-1.6/RULES/i386-unixware-cc.rul sed 's/^X//' >star-1.6/RULES/i386-unixware-cc.rul << 'END-of-star-1.6/RULES/i386-unixware-cc.rul' X#ident "@(#)i386-unixware-cc.rul 1.7 07/05/08 " X########################################################################### X# Written 1999 by J. Schilling/Santa Cruz Operation X########################################################################### X# X# Platform dependent MACROS for SCO UnixWare 2.x / 7.x using cc X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-sco_uw.rul X XOSDEFS += -DUNIXWARE -DSVR4 X XKDEFINES= -DKERNEL -D_KERNEL X XLIB_SOCKET= -lsocket -lnsl -ldl XLIB_MATH= -lm X#LIB_KVM= -lkvm XLIB_KVM= X XARFLAGS= cr XLORDER= echo XTSORT= cat END-of-star-1.6/RULES/i386-unixware-cc.rul echo c - star-1.6/DEFAULTS mkdir -p star-1.6/DEFAULTS > /dev/null 2>&1 echo x - star-1.6/DEFAULTS/Defaults sed 's/^X//' >star-1.6/DEFAULTS/Defaults << 'END-of-star-1.6/DEFAULTS/Defaults' X#ident "%W% %E% %Q%" X########################################################################### X# X# global definitions: include system specific file X# X########################################################################### X Xinclude $(DEFLTSROOT)/$(DEFLTSDIR)/Defaults.$(O_ARCH) END-of-star-1.6/DEFAULTS/Defaults echo x - star-1.6/DEFAULTS/Defaults.aix sed 's/^X//' >star-1.6/DEFAULTS/Defaults.aix << 'END-of-star-1.6/DEFAULTS/Defaults.aix' X#ident "@(#)Defaults.aix 1.6 13/11/04 " X########################################################################### X# X# global definitions for IBM AIX Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### XDEFCCOM= cc X#DEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### XCWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib X X########################################################################### X# X# Installation config stuff X# X########################################################################### XINS_BASE= /opt/schily XINS_KBASE= / XINS_RBASE= / X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS/Defaults.aix echo x - star-1.6/DEFAULTS/Defaults.dgux sed 's/^X//' >star-1.6/DEFAULTS/Defaults.dgux << 'END-of-star-1.6/DEFAULTS/Defaults.dgux' X#ident "@(#)Defaults.dgux 1.6 13/11/04 " X########################################################################### X# X# global definitions for Data General DGUX Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### X#DEFCCOM= cc XDEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### XCWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib X X########################################################################### X# X# Installation config stuff X# X########################################################################### XINS_BASE= /opt/schily XINS_KBASE= / XINS_RBASE= / X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS/Defaults.dgux echo x - star-1.6/DEFAULTS/Defaults.dgux3 sed 's/^X//' >star-1.6/DEFAULTS/Defaults.dgux3 << 'END-of-star-1.6/DEFAULTS/Defaults.dgux3' X#ident "@(#)Defaults.dgux3 1.6 13/11/04 " X########################################################################### X# X# global definitions for Data General DGUX Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### X#DEFCCOM= cc XDEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### XCWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib X X########################################################################### X# X# Installation config stuff X# X########################################################################### XINS_BASE= /opt/schily XINS_KBASE= / XINS_RBASE= / X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS/Defaults.dgux3 echo x - star-1.6/DEFAULTS/Defaults.dgux4 sed 's/^X//' >star-1.6/DEFAULTS/Defaults.dgux4 << 'END-of-star-1.6/DEFAULTS/Defaults.dgux4' X#ident "@(#)Defaults.dgux4 1.6 13/11/04 " X########################################################################### X# X# global definitions for Data General DGUX Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### X#DEFCCOM= cc XDEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### XCWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib X X########################################################################### X# X# Installation config stuff X# X########################################################################### XINS_BASE= /opt/schily XINS_KBASE= / XINS_RBASE= / X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS/Defaults.dgux4 echo x - star-1.6/DEFAULTS/Defaults.freebsd sed 's/^X//' >star-1.6/DEFAULTS/Defaults.freebsd << 'END-of-star-1.6/DEFAULTS/Defaults.freebsd' X#ident "@(#)Defaults.freebsd 1.6 13/11/04 " X########################################################################### X# X# global definitions for FreeBSD Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### XDEFCCOM= cc X#DEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### XCWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= /usr/local/include XLDPATH= -L/opt/schily/lib -L/usr/local/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) Will probably not work X X########################################################################### X# X# Installation config stuff X# X########################################################################### XINS_BASE= /opt/schily XINS_KBASE= / XINS_RBASE= / X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS/Defaults.freebsd echo x - star-1.6/DEFAULTS/Defaults.hp-ux sed 's/^X//' >star-1.6/DEFAULTS/Defaults.hp-ux << 'END-of-star-1.6/DEFAULTS/Defaults.hp-ux' X#ident "@(#)Defaults.hp-ux 1.6 13/11/04 " X########################################################################### X# X# global definitions for HP/UX Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### X#DEFCCOM= cc XDEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### XCWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib X X########################################################################### X# X# Installation config stuff X# X########################################################################### XINS_BASE= /opt/schily XINS_KBASE= / XINS_RBASE= / X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS/Defaults.hp-ux echo x - star-1.6/DEFAULTS/Defaults.irix sed 's/^X//' >star-1.6/DEFAULTS/Defaults.irix << 'END-of-star-1.6/DEFAULTS/Defaults.irix' X#ident "@(#)Defaults.irix 1.6 13/11/04 " X########################################################################### X# X# global definitions for Silicon Graphics Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### XDEFCCOM= cc X#DEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### XCWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib X X########################################################################### X# X# Installation config stuff X# X########################################################################### XINS_BASE= /opt/schily XINS_KBASE= / XINS_RBASE= / X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS/Defaults.irix echo x - star-1.6/DEFAULTS/Defaults.linux sed 's/^X//' >star-1.6/DEFAULTS/Defaults.linux << 'END-of-star-1.6/DEFAULTS/Defaults.linux' X#ident "@(#)Defaults.linux 1.9 18/05/23 " X########################################################################### X# X# global definitions for Linux Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### XDEFCCOM= cc X#DEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### XCWARNOPTS= X X########################################################################### X# X# LINUX_SRC_INCLUDE is used in RULES/*-linux-*cc*.rul X# X########################################################################### XLINUX_INCL_PATH= /usr/src/linux/include X X_LINUX_SRC_INCLUDE= $(_UNIQ)$(MAY_LINUX_SRC_INCLUDE) X__LINUX_SRC_INCLUDE= $(_LINUX_SRC_INCLUDE:$(_UNIQ)=$(LINUX_INCL_PATH)) XLINUX_SRC_INCLUDE= $(__LINUX_SRC_INCLUDE:$(_UNIQ)no%=%) X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib X X########################################################################### X# X# Unhide POSIX extensions from /usr/include/ X# X########################################################################### XOSDEFS += -D_GNU_SOURCE X X########################################################################### X# X# Installation config stuff X# X########################################################################### XINS_BASE= /opt/schily XINS_KBASE= / XINS_RBASE= / X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS/Defaults.linux echo x - star-1.6/DEFAULTS/Defaults.sunos4 sed 's/^X//' >star-1.6/DEFAULTS/Defaults.sunos4 << 'END-of-star-1.6/DEFAULTS/Defaults.sunos4' X#ident "@(#)Defaults.sunos4 1.5 13/11/04 " X########################################################################### X# X# global definitions for SunOS Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### X#DEFCCOM= cc XDEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### XCWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) Will not work on SunOS X X########################################################################### X# X# Installation config stuff X# X########################################################################### XINS_BASE= /opt/schily XINS_KBASE= / XINS_RBASE= / X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS/Defaults.sunos4 echo x - star-1.6/DEFAULTS/Defaults.sunos5 sed 's/^X//' >star-1.6/DEFAULTS/Defaults.sunos5 << 'END-of-star-1.6/DEFAULTS/Defaults.sunos5' X#ident "@(#)Defaults.sunos5 1.6 13/11/04 " X########################################################################### X# X# global definitions for Solaris Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### XDEFCCOM= cc X#DEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### XCWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib X X########################################################################### X# X# Installation config stuff X# X########################################################################### XINS_BASE= /opt/schily XINS_KBASE= / XINS_RBASE= / X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS/Defaults.sunos5 echo x - star-1.6/DEFAULTS/Defaults.netbsd sed 's/^X//' >star-1.6/DEFAULTS/Defaults.netbsd << 'END-of-star-1.6/DEFAULTS/Defaults.netbsd' X#ident "@(#)Defaults.netbsd 1.6 18/11/14 " X########################################################################### X# X# global definitions for NetBSD Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### XDEFCCOM= cc X#DEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### XCWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) Will probably not work XRUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib X X########################################################################### X# X# Installation config stuff X# X########################################################################### XINS_BASE= /opt/schily XINS_KBASE= / XINS_RBASE= / X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS/Defaults.netbsd echo x - star-1.6/DEFAULTS/Defaults.openbsd sed 's/^X//' >star-1.6/DEFAULTS/Defaults.openbsd << 'END-of-star-1.6/DEFAULTS/Defaults.openbsd' X#ident "@(#)Defaults.openbsd 1.5 13/11/04 " X########################################################################### X# X# global definitions for OpenBSD Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### XDEFCCOM= cc X#DEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### XCWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) Will probably not work X X########################################################################### X# X# Installation config stuff X# X########################################################################### XINS_BASE= /opt/schily XINS_KBASE= / XINS_RBASE= / X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS/Defaults.openbsd echo x - star-1.6/DEFAULTS/Defaults.cygwin32_nt sed 's/^X//' >star-1.6/DEFAULTS/Defaults.cygwin32_nt << 'END-of-star-1.6/DEFAULTS/Defaults.cygwin32_nt' X#ident "@(#)Defaults.cygwin32_nt 1.7 17/07/09 " X########################################################################### X# X# global definitions for Cygnus GCC for WINNT Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### X#DEFCCOM= cc XDEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### XCWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= X#LDPATH= -L/opt/schily/lib XLDPATH= X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= X X########################################################################### X# X# Installation config stuff X# X########################################################################### XINS_BASE= /opt/schily XINS_KBASE= / XINS_RBASE= / X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= root X X# X# This is not the correct place for doing this, X# the correct place is RULES/cc-msc.rul. X# We do it here because otherwise cc-config would not work. X# This kind of hack may not work for other platforms. X# X_PLATFORM= cygwin XVC=7 X X_VCNAME= $(_UNIQ)$(XMAKEPROG) X__VCNAME= $(_VCNAME:$(_UNIQ)=dummy) X___VCNAME= $(__VCNAME:$(_UNIQ)smake=vc$(VC)$(_PLATFORM:%=-%)) XVCNAME= $(___VCNAME:$(_UNIQ)%=dummy) X X_VC_SETUP= $(_UNIQ)$(VC_SETUP) X__VC_SETUP= $(_VC_SETUP:$(_UNIQ)=$(VCNAME)-setup) XVCSETUP= $(__VC_SETUP:$(_UNIQ)%=%) X X########################################################################### X# IMPORTANT Note: X# We also include $(DEFLTSROOT)/$(DEFLTSDIR)/$(VCSETUP) from RULES/cc-msc.rul X# in order to be able to test for the existence of "cl.exe" early. X########################################################################### Xinclude $(DEFLTSROOT)/$(DEFLTSDIR)/$(VCSETUP) END-of-star-1.6/DEFAULTS/Defaults.cygwin32_nt echo x - star-1.6/DEFAULTS/MKLINKS sed 's/^X//' >star-1.6/DEFAULTS/MKLINKS << 'END-of-star-1.6/DEFAULTS/MKLINKS' X#!/bin/sh X# Xln -s Defaults.dgux Defaults.dgux3 Xln -s Defaults.dgux Defaults.dgux4 END-of-star-1.6/DEFAULTS/MKLINKS echo x - star-1.6/DEFAULTS/Defaults.bsd-os sed 's/^X//' >star-1.6/DEFAULTS/Defaults.bsd-os << 'END-of-star-1.6/DEFAULTS/Defaults.bsd-os' X#ident "@(#)Defaults.bsd-os 1.5 13/11/04 " X########################################################################### X# X# global definitions for BSD/OS Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### X#DEFCCOM= cc XDEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### XCWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= X#LDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) Will probably not work X X########################################################################### X# X# Installation config stuff X# X########################################################################### XINS_BASE= /opt/schily XINS_KBASE= / XINS_RBASE= / X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS/Defaults.bsd-os echo x - star-1.6/DEFAULTS/Defaults.osf1 sed 's/^X//' >star-1.6/DEFAULTS/Defaults.osf1 << 'END-of-star-1.6/DEFAULTS/Defaults.osf1' X#ident "@(#)Defaults.osf1 1.6 13/11/04 " X########################################################################### X# X# global definitions for Digital UNIX (OSF1) Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### XDEFCCOM= cc X#DEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### XCWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib X X########################################################################### X# X# Installation config stuff X# X########################################################################### XINS_BASE= /opt/schily XINS_KBASE= / XINS_RBASE= / X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS/Defaults.osf1 echo x - star-1.6/DEFAULTS/Defaults.nextstep sed 's/^X//' >star-1.6/DEFAULTS/Defaults.nextstep << 'END-of-star-1.6/DEFAULTS/Defaults.nextstep' X#ident "@(#)Defaults.nextstep 1.5 13/11/04 " X########################################################################### X# X# global definitions for NeXT Step Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### XDEFCCOM= cc X#DEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### XCWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) Will probably not work X X########################################################################### X# X# Installation config stuff X# X########################################################################### XINS_BASE= /opt/schily XINS_KBASE= / XINS_RBASE= / X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS/Defaults.nextstep echo x - star-1.6/DEFAULTS/Defaults.rhapsody sed 's/^X//' >star-1.6/DEFAULTS/Defaults.rhapsody << 'END-of-star-1.6/DEFAULTS/Defaults.rhapsody' X#ident "@(#)Defaults.rhapsody 1.4 13/11/04 " X########################################################################### X# X# global definitions for NeXT Step (Apple Rhapsody) Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### XDEFCCOM= cc X#DEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### XCWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= /usr/local/include XLDPATH= #-L/opt/schily/lib XLDPATH= -L/usr/local/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) Will probably not work X X########################################################################### X# X# Installation config stuff X# X########################################################################### XINS_BASE= /opt/schily XINS_KBASE= / XINS_RBASE= / X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= wheel END-of-star-1.6/DEFAULTS/Defaults.rhapsody echo x - star-1.6/DEFAULTS/vc7-setup sed 's/^X//' >star-1.6/DEFAULTS/vc7-setup << 'END-of-star-1.6/DEFAULTS/vc7-setup' X# @(#)vc7-setup 1.5 09/05/16 Copyright 2006 J. Schilling X X# X# Keep in sync with vc7-cygwin-setup as we cannot rely on hard links X# X X# X# Disable warnings for nonportable variable assignements. X# We only use smake MS-WIN, so this is not a problem. X# X.NO_WARN: := X X# X# A German installation X# XVSINSTALLDIR=C:\Programme\Microsoft Visual Studio 8 XVSINS=/cygdrive/c/Programme/Microsoft Visual Studio 8 X X# X# An English installation X# XVSINSTALLDIR=C:\Program Files\Microsoft Visual Studio 8 XVSINS=/cygdrive/c/Program Files/Microsoft Visual Studio 8 X Xexport VSINSTALLDIR X XVCINSTALLDIR :=${VSINSTALLDIR}\VC Xexport VCINSTALLDIR X XPATH :=${VSINS}/VC/BIN:${VSINS}/Common7/IDE:${PATH} Xexport PATH X XINCLUDE :=${VCINSTALLDIR}\INCLUDE;${VCINSTALLDIR}\PlatformSDK\INCLUDE;${INCLUDE} Xexport INCLUDE X XLIB :=${VCINSTALLDIR}\LIB;${VCINSTALLDIR}\PlatformSDK\LIB;${LIB} Xexport LIB X XVC_SETUP=dummy-setup Xexport VC_SETUP X X# X# Re-enable all warnings. X# X.NO_WARN: END-of-star-1.6/DEFAULTS/vc7-setup echo x - star-1.6/DEFAULTS/Defaults.newsos6 sed 's/^X//' >star-1.6/DEFAULTS/Defaults.newsos6 << 'END-of-star-1.6/DEFAULTS/Defaults.newsos6' X#ident "@(#)Defaults.newsos6 1.6 13/11/04 " X########################################################################### X# X# global definitions for Sony NEWS-OS 6.x X# X########################################################################### X# X# Compiler stuff X# X########################################################################### XDEFCCOM= cc X#DEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### XCWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib X X########################################################################### X# X# Installation config stuff X# X########################################################################### XINS_BASE= /opt/schily XINS_KBASE= / XINS_RBASE= / X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS/Defaults.newsos6 echo x - star-1.6/DEFAULTS/Defaults.beos sed 's/^X//' >star-1.6/DEFAULTS/Defaults.beos << 'END-of-star-1.6/DEFAULTS/Defaults.beos' X#ident "@(#)Defaults.beos 1.6 13/11/04 " X########################################################################### X# X# global definitions for BeOS Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### X#DEFCCOM= cc XDEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### XCWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib X X########################################################################### X# X# Installation config stuff X# X########################################################################### XINS_BASE= /opt/schily XINS_KBASE= / XINS_RBASE= / X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS/Defaults.beos echo x - star-1.6/DEFAULTS/Defaults.os2 sed 's/^X//' >star-1.6/DEFAULTS/Defaults.os2 << 'END-of-star-1.6/DEFAULTS/Defaults.os2' X#ident "@(#)Defaults.os2 1.6 13/11/04 " X########################################################################### X# X# global definitions for OS/2 Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### X#DEFCCOM= cc XDEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### XCWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib X X########################################################################### X# X# Installation config stuff X# X########################################################################### XINS_BASE= /opt/schily XINS_KBASE= / XINS_RBASE= / X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS/Defaults.os2 echo x - star-1.6/DEFAULTS/Defaults.qnx sed 's/^X//' >star-1.6/DEFAULTS/Defaults.qnx << 'END-of-star-1.6/DEFAULTS/Defaults.qnx' X#ident "@(#)Defaults.qnx 1.5 13/11/04 " X########################################################################### X# X# global definitions for QNX Systems X# X########################################################################### X# X# Compiler stuff X# X# When QNX support started in december 1999, there was only the watcom X# C-compler (cc). Now, in novemver 2001 we switch to gcc. X# X########################################################################### X#DEFCCOM= cc XDEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### XCWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) Will probably not work X X########################################################################### X# X# Installation config stuff X# X########################################################################### XINS_BASE= /opt/schily XINS_KBASE= / XINS_RBASE= / X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS/Defaults.qnx echo x - star-1.6/DEFAULTS/Defaults.openserver sed 's/^X//' >star-1.6/DEFAULTS/Defaults.openserver << 'END-of-star-1.6/DEFAULTS/Defaults.openserver' X#ident "@(#)Defaults.openserver 1.4 13/11/04 " X########################################################################### X# X# global definitions for SCO OpenServer 5 Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### XDEFCCOM= cc X#DEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### XCWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= XRUNPATH= X X########################################################################### X# X# Installation config stuff X# X########################################################################### XINS_BASE= /usr/local XINS_KBASE= / XINS_RBASE= / X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS/Defaults.openserver echo x - star-1.6/DEFAULTS/Defaults.unixware sed 's/^X//' >star-1.6/DEFAULTS/Defaults.unixware << 'END-of-star-1.6/DEFAULTS/Defaults.unixware' X#ident "@(#)Defaults.unixware 1.4 13/11/04 " X########################################################################### X# X# global definitions for SCO UnixWare Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### XDEFCCOM= cc X#DEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### XCWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= XRUNPATH= X X########################################################################### X# X# Installation config stuff X# X########################################################################### XINS_BASE= /usr/local XINS_KBASE= / XINS_RBASE= / X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS/Defaults.unixware echo x - star-1.6/DEFAULTS/Defaults.mac-os10 sed 's/^X//' >star-1.6/DEFAULTS/Defaults.mac-os10 << 'END-of-star-1.6/DEFAULTS/Defaults.mac-os10' X#ident "@(#)Defaults.mac-os10 1.4 13/11/04 " X########################################################################### X# X# global definitions for Mac OS X Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### XDEFCCOM= cc X#DEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### XCWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= /usr/local/include XLDPATH= #-L/opt/schily/lib XLDPATH= -L/usr/local/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) Will probably not work X X########################################################################### X# X# Installation config stuff X# X########################################################################### XINS_BASE= /opt/schily XINS_KBASE= / XINS_RBASE= / X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= wheel END-of-star-1.6/DEFAULTS/Defaults.mac-os10 echo x - star-1.6/DEFAULTS/Defaults.darwin sed 's/^X//' >star-1.6/DEFAULTS/Defaults.darwin << 'END-of-star-1.6/DEFAULTS/Defaults.darwin' X#ident "@(#)Defaults.darwin 1.4 13/11/04 " X########################################################################### X# X# global definitions for Mac OS X Darwin Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### XDEFCCOM= cc X#DEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### XCWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= /usr/local/include XLDPATH= #-L/opt/schily/lib XLDPATH= -L/usr/local/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) Will probably not work X X########################################################################### X# X# Installation config stuff X# X########################################################################### XINS_BASE= /opt/schily XINS_KBASE= / XINS_RBASE= / X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= wheel END-of-star-1.6/DEFAULTS/Defaults.darwin echo x - star-1.6/DEFAULTS/Defaults.domainos sed 's/^X//' >star-1.6/DEFAULTS/Defaults.domainos << 'END-of-star-1.6/DEFAULTS/Defaults.domainos' X#ident "@(#)Defaults.domainos 1.6 13/11/04 " X########################################################################### X# X# global definitions for Apollo Domain/OS Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### XDEFCCOM= cc X#DEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### XCWARNOPTS= -W0,-info,0 X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib X X########################################################################### X# X# Installation config stuff X# X########################################################################### XINS_BASE= /opt/schily XINS_KBASE= / XINS_RBASE= / X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS/Defaults.domainos echo x - star-1.6/DEFAULTS/Defaults.amigaos sed 's/^X//' >star-1.6/DEFAULTS/Defaults.amigaos << 'END-of-star-1.6/DEFAULTS/Defaults.amigaos' X#ident "@(#)Defaults.amigaos 1.6 13/11/04 " X########################################################################### X# X# global definitions for AmigaOS Systems using CC=gcc X# X########################################################################### X# X# Compiler stuff X# X########################################################################### X#DEFCCOM= cc XDEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### XCWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib X X########################################################################### X# X# Installation config stuff X# X########################################################################### XINS_BASE= /opt/schily XINS_KBASE= / XINS_RBASE= / X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS/Defaults.amigaos echo x - star-1.6/DEFAULTS/Defaults.gnu sed 's/^X//' >star-1.6/DEFAULTS/Defaults.gnu << 'END-of-star-1.6/DEFAULTS/Defaults.gnu' X#ident "@(#)Defaults.gnu 1.6 13/11/04 " X########################################################################### X# X# global definitions for GNU (hurd) Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### X#DEFCCOM= cc XDEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### XCWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= /usr/src/linux/include XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib X X########################################################################### X# X# Installation config stuff X# X########################################################################### XINS_BASE= /opt/schily XINS_KBASE= / XINS_RBASE= / X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS/Defaults.gnu echo x - star-1.6/DEFAULTS/Defaults.bsd-os3 sed 's/^X//' >star-1.6/DEFAULTS/Defaults.bsd-os3 << 'END-of-star-1.6/DEFAULTS/Defaults.bsd-os3' X#ident "@(#)Defaults.bsd-os3 1.5 13/11/04 " X########################################################################### X# X# global definitions for BSD/OS Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### X#DEFCCOM= cc XDEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### XCWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= X#LDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) Will probably not work X X########################################################################### X# X# Installation config stuff X# X########################################################################### XINS_BASE= /opt/schily XINS_KBASE= / XINS_RBASE= / X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS/Defaults.bsd-os3 echo x - star-1.6/DEFAULTS/Defaults.ms-dos sed 's/^X//' >star-1.6/DEFAULTS/Defaults.ms-dos << 'END-of-star-1.6/DEFAULTS/Defaults.ms-dos' X#ident "@(#)Defaults.ms-dos 1.6 13/11/04 " X########################################################################### X# X# global definitions for MSDOS/DJGPP v2 Systems using CC=gcc X# X########################################################################### X# X# Compiler stuff X# X########################################################################### X#DEFCCOM= cc XDEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### XCWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib X X########################################################################### X# X# Installation config stuff X# X########################################################################### XINS_BASE= /opt/schily XINS_KBASE= / XINS_RBASE= / X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS/Defaults.ms-dos echo x - star-1.6/DEFAULTS/Defaults.mingw32_nt sed 's/^X//' >star-1.6/DEFAULTS/Defaults.mingw32_nt << 'END-of-star-1.6/DEFAULTS/Defaults.mingw32_nt' X#ident "@(#)Defaults.mingw32_nt 1.5 13/11/04 " X########################################################################### X# X# global definitions for Win32/Mingw32 systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### X#DEFCCOM= cc XDEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### XCWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= X#LDPATH= -L/opt/schily/lib XLDPATH= X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= X X########################################################################### X# X# Installation config stuff X# X########################################################################### XINS_BASE= /opt/schily XINS_KBASE= / XINS_RBASE= / X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS/Defaults.mingw32_nt echo x - star-1.6/DEFAULTS/Defaults.interix sed 's/^X//' >star-1.6/DEFAULTS/Defaults.interix << 'END-of-star-1.6/DEFAULTS/Defaults.interix' X#ident "@(#)Defaults.interix 1.7 13/11/04 " X########################################################################### X# X# global definitions for Interix Systems (WIN-NT with SFU) using CC=gcc X# X########################################################################### X# X# Compiler stuff X# X########################################################################### X#DEFCCOM= cc XDEFCCOM= gcc X X########################################################################### X# X# Avoid to have something like "Intel_x86_Family15_Model4_Stepping1" X# in $(OARCH), we rather use $(K_ARCH) which is e.g. "x86". X# XXX If this is changed, both files in DEFAULTS/ and DEFAULTS_ENG as X# XXX well as the file conf/oarch.sh need to be changed. X# X########################################################################### XP_ARCH= $(K_ARCH) X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### XCWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= --rpath $(INS_BASE)/lib --rpath /opt/schily/lib --rpath $(OLIBSDIR) XRUNPATH= --rpath $(INS_BASE)/lib --rpath /opt/schily/lib X X########################################################################### X# X# Installation config stuff X# X########################################################################### XINS_BASE= /opt/schily XINS_KBASE= / XINS_RBASE= / X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin X X# X# This is not the correct place for doing this, X# the correct place is RULES/cc-ms*.rul. X# We do it here because otherwise cc-config would not work. X# This kind of hack may not work for other platforms. X# X_PLATFORM= interix XVC=7 X X_VC_SETUP= $(_UNIQ)$(VC_SETUP) X__VC_SETUP= $(_VC_SETUP:$(_UNIQ)=vc$(VC)$(_PLATFORM:%=-%)-setup) XVCSETUP= $(__VC_SETUP:$(_UNIQ)%=%) X X########################################################################### X# IMPORTANT Note: X# We also include $(DEFLTSROOT)/$(DEFLTSDIR)/$(VCSETUP) from RULES/cc-ms*.rul X# in order to be able to test for the existence of "cl.exe" early. X########################################################################### Xinclude $(DEFLTSROOT)/$(DEFLTSDIR)/$(VCSETUP) END-of-star-1.6/DEFAULTS/Defaults.interix echo x - star-1.6/DEFAULTS/dummy-setup sed 's/^X//' >star-1.6/DEFAULTS/dummy-setup << 'END-of-star-1.6/DEFAULTS/dummy-setup' END-of-star-1.6/DEFAULTS/dummy-setup echo x - star-1.6/DEFAULTS/vc6-setup sed 's/^X//' >star-1.6/DEFAULTS/vc6-setup << 'END-of-star-1.6/DEFAULTS/vc6-setup' X# @(#)vc6-setup 1.4 09/05/16 Copyright 2006 J. Schilling X X# X# Keep in sync with vc6-cygwin-setup as we cannot rely on hard links X# X X# X# Disable warnings for nonportable variable assignements. X# We only use smake MS-WIN, so this is not a problem. X# X.NO_WARN: := X XVSCommonDir=C:\Programme\Microsoft Visual Studio\Common XVSCommonPath=/cygdrive/c/Programme/Microsoft Visual Studio/Common Xexport VSCommonDir X XMSDevDir=C:\Programme\Microsoft Visual Studio\Common\msdev98 XMSDevPath=/cygdrive/c/Programme/Microsoft Visual Studio/Common/msdev98 Xexport MSDevDir X XMSVCDir=C:\Programme\Microsoft Visual Studio\VC98 XMSVCPath=/cygdrive/c/Programme/Microsoft Visual Studio/VC98 Xexport MSVCDir X XVcOsDir=WIN95 XVcOsDir=WINNT Xexport VcOsDir X XPATH :=${MSDevPath}\BIN:${MSVCPath}\BIN:${VSCommonPath}\TOOLS\${VcOsDir}:${VSCommonPath}\TOOLS:${PATH} Xexport PATH X XINCLUDE :=${MSVCDir}\ATL\INCLUDE;${MSVCDir}\INCLUDE;${MSVCDir}\\MFC\INCLUDE;${INCLUDE} Xexport INCLUDE X XLIB :=${MSVCDir}\LIB;${MSVCDir}\MFC\LIB;${LIB} Xexport LIB X XVC_SETUP=dummy-setup Xexport VC_SETUP X X# X# Re-enable all warnings. X# X.NO_WARN: END-of-star-1.6/DEFAULTS/vc6-setup echo x - star-1.6/DEFAULTS/vc6-cygwin-setup sed 's/^X//' >star-1.6/DEFAULTS/vc6-cygwin-setup << 'END-of-star-1.6/DEFAULTS/vc6-cygwin-setup' X# @(#)vc6-cygwin-setup 1.4 09/05/16 Copyright 2006 J. Schilling X X# X# Keep in sync with vc6-setup as we cannot rely on hard links X# X X# X# Disable warnings for nonportable variable assignements. X# We only use smake MS-WIN, so this is not a problem. X# X.NO_WARN: := X XVSCommonDir=C:\Programme\Microsoft Visual Studio\Common XVSCommonPath=/cygdrive/c/Programme/Microsoft Visual Studio/Common Xexport VSCommonDir X XMSDevDir=C:\Programme\Microsoft Visual Studio\Common\msdev98 XMSDevPath=/cygdrive/c/Programme/Microsoft Visual Studio/Common/msdev98 Xexport MSDevDir X XMSVCDir=C:\Programme\Microsoft Visual Studio\VC98 XMSVCPath=/cygdrive/c/Programme/Microsoft Visual Studio/VC98 Xexport MSVCDir X XVcOsDir=WIN95 XVcOsDir=WINNT Xexport VcOsDir X XPATH :=${MSDevPath}\BIN:${MSVCPath}\BIN:${VSCommonPath}\TOOLS\${VcOsDir}:${VSCommonPath}\TOOLS:${PATH} Xexport PATH X XINCLUDE :=${MSVCDir}\ATL\INCLUDE;${MSVCDir}\INCLUDE;${MSVCDir}\\MFC\INCLUDE;${INCLUDE} Xexport INCLUDE X XLIB :=${MSVCDir}\LIB;${MSVCDir}\MFC\LIB;${LIB} Xexport LIB X XVC_SETUP=dummy-setup Xexport VC_SETUP X X# X# Re-enable all warnings. X# X.NO_WARN: END-of-star-1.6/DEFAULTS/vc6-cygwin-setup echo x - star-1.6/DEFAULTS/vc6-interix-setup sed 's/^X//' >star-1.6/DEFAULTS/vc6-interix-setup << 'END-of-star-1.6/DEFAULTS/vc6-interix-setup' X# @(#)vc6-interix-setup 1.4 07/04/20 Copyright 2006 J. Schilling X X# X# Disable warnings for nonportable variable assignements. X# We only use smake MS-WIN, so this is not a problem. X# X.NO_WARN: := X XVSCommonDir=C:\Programme\Microsoft Visual Studio\Common XVSCommonPath=/dev/fs/C/Programme/Microsoft Visual Studio/Common Xexport VSCommonDir X XMSDevDir=C:\Programme\Microsoft Visual Studio\Common\msdev98 XMSDevPath=/dev/fs/C/Programme/Microsoft Visual Studio/Common/msdev98 Xexport MSDevDir X XMSVCDir=C:\Programme\Microsoft Visual Studio\VC98 XMSVCPath=/dev/fs/C/Programme/Microsoft Visual Studio/VC98 Xexport MSVCDir X XVcOsDir=WIN95 XVcOsDir=WINNT Xexport VcOsDir X XPATH :=${MSDevPath}\BIN:${MSVCPath}\BIN:${VSCommonPath}\TOOLS\${VcOsDir}:${VSCommonPath}\TOOLS:${PATH} Xexport PATH X XINCLUDE :=${MSVCDir}\ATL\INCLUDE;${MSVCDir}\INCLUDE;${MSVCDir}\\MFC\INCLUDE;${INCLUDE} Xexport INCLUDE X XLIB :=${MSVCDir}\LIB;${MSVCDir}\MFC\LIB;${LIB} Xexport LIB X XVC_SETUP=dummy-setup Xexport VC_SETUP X X# X# Re-enable all warnings. X# X.NO_WARN: END-of-star-1.6/DEFAULTS/vc6-interix-setup echo x - star-1.6/DEFAULTS/vc9-setup sed 's/^X//' >star-1.6/DEFAULTS/vc9-setup << 'END-of-star-1.6/DEFAULTS/vc9-setup' X# @(#)vc9-setup 1.3 11/08/01 Copyright 2006-2011 J. Schilling X X# X# Keep in sync with vc9-cygwin-setup as we cannot rely on hard links X# X X# X# Disable warnings for nonportable variable assignements. X# We only use smake MS-WIN, so this is not a problem. X# X.NO_WARN: := X X# X# A German installation X# XVSINSTALLDIR=C:\Programme\Microsoft Visual Studio 9.0 XVSINS=/cygdrive/c/Programme/Microsoft Visual Studio 9.0 X X# X# An English installation X# XVSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio 9.0 XVSBASEDIR=C:\Program Files (x86) XVSINS=/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 9.0 X Xexport VSINSTALLDIR X XVCINSTALLDIR :=${VSINSTALLDIR}\VC Xexport VCINSTALLDIR X XPATH :=${VSINS}/VC/bin:${VSINS}/Common7/IDE:${PATH} Xexport PATH X X#INCLUDE :=${VCINSTALLDIR}\include;${VCINSTALLDIR}\PlatformSDK\INCLUDE;${INCLUDE} XINCLUDE :=${VCINSTALLDIR}\atlmfc\include;${VCINSTALLDIR}\include;${VSBASEDIR}\Microsoft SDKs\Windows\v5.0\include;C:\Program Files\\Microsoft SDKs\Windows\v6.0A\include;${INCLUDE} Xexport INCLUDE X X#LIB :=${VCINSTALLDIR}\lib;${VCINSTALLDIR}\PlatformSDK\LIB;${LIB} XLIB :=${VCINSTALLDIR}\atlmfc\lib;${VCINSTALLDIR}\lib;C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib;${LIB} Xexport LIB X XVC_SETUP=dummy-setup Xexport VC_SETUP X X# X# Re-enable all warnings. X# X.NO_WARN: END-of-star-1.6/DEFAULTS/vc9-setup echo x - star-1.6/DEFAULTS/vc7-cygwin-setup sed 's/^X//' >star-1.6/DEFAULTS/vc7-cygwin-setup << 'END-of-star-1.6/DEFAULTS/vc7-cygwin-setup' X# @(#)vc7-cygwin-setup 1.5 09/05/16 Copyright 2006 J. Schilling X X# X# Keep in sync with vc7-setup as we cannot rely on hard links X# X X# X# Disable warnings for nonportable variable assignements. X# We only use smake MS-WIN, so this is not a problem. X# X.NO_WARN: := X X# X# A German installation X# XVSINSTALLDIR=C:\Programme\Microsoft Visual Studio 8 XVSINS=/cygdrive/c/Programme/Microsoft Visual Studio 8 X X# X# An English installation X# XVSINSTALLDIR=C:\Program Files\Microsoft Visual Studio 8 XVSINS=/cygdrive/c/Program Files/Microsoft Visual Studio 8 X Xexport VSINSTALLDIR X XVCINSTALLDIR :=${VSINSTALLDIR}\VC Xexport VCINSTALLDIR X XPATH :=${VSINS}/VC/BIN:${VSINS}/Common7/IDE:${PATH} Xexport PATH X XINCLUDE :=${VCINSTALLDIR}\INCLUDE;${VCINSTALLDIR}\PlatformSDK\INCLUDE;${INCLUDE} Xexport INCLUDE X XLIB :=${VCINSTALLDIR}\LIB;${VCINSTALLDIR}\PlatformSDK\LIB;${LIB} Xexport LIB X XVC_SETUP=dummy-setup Xexport VC_SETUP X X# X# Re-enable all warnings. X# X.NO_WARN: END-of-star-1.6/DEFAULTS/vc7-cygwin-setup echo x - star-1.6/DEFAULTS/vc7-interix-setup sed 's/^X//' >star-1.6/DEFAULTS/vc7-interix-setup << 'END-of-star-1.6/DEFAULTS/vc7-interix-setup' X# @(#)vc7-interix-setup 1.7 07/04/24 Copyright 2006 J. Schilling X X# X# Disable warnings for nonportable variable assignements. X# We only use smake MS-WIN, so this is not a problem. X# X.NO_WARN: := X X# X# A German installation X# XVSINSTALLDIR=C:\Programme\Microsoft Visual Studio 8 XVSINS=/dev/fs/C/Programme/Microsoft Visual Studio 8 X X# X# An English installation X# XVSINSTALLDIR=C:\Program Files\Microsoft Visual Studio 8 XVSINS=/dev/fs/C/Program Files/Microsoft Visual Studio 8 X Xexport VSINSTALLDIR X XVCINSTALLDIR :=${VSINSTALLDIR}\VC Xexport VCINSTALLDIR X XPATH :=${VSINS}/VC/bin:${VSINS}/Common7/IDE:${PATH} Xexport PATH X XINCLUDE :=${VCINSTALLDIR}\include;${VCINSTALLDIR}\PlatformSDK\Include;${INCLUDE} Xexport INCLUDE X XLIB :=${VCINSTALLDIR}\LIB;${VCINSTALLDIR}\PlatformSDK\LIB;${LIB} Xexport LIB X XVC_SETUP=dummy-setup Xexport VC_SETUP X X# X# Re-enable all warnings. X# X.NO_WARN: END-of-star-1.6/DEFAULTS/vc7-interix-setup echo x - star-1.6/DEFAULTS/Defaults.dragonfly sed 's/^X//' >star-1.6/DEFAULTS/Defaults.dragonfly << 'END-of-star-1.6/DEFAULTS/Defaults.dragonfly' X#ident "@(#)Defaults.dragonfly 1.6 13/11/04 " X########################################################################### X# X# global definitions for FreeBSD Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### XDEFCCOM= cc X#DEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### XCWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= /usr/local/include XLDPATH= -L/opt/schily/lib -L/usr/local/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) Will probably not work X X########################################################################### X# X# Installation config stuff X# X########################################################################### XINS_BASE= /opt/schily XINS_KBASE= / XINS_RBASE= / X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS/Defaults.dragonfly echo x - star-1.6/DEFAULTS/Defaults.freemint sed 's/^X//' >star-1.6/DEFAULTS/Defaults.freemint << 'END-of-star-1.6/DEFAULTS/Defaults.freemint' X#ident @(#)Defaults.freemint 1.4 13/11/04 X########################################################################### X# X# global definitions for FreeMiNT on ATARI computers X# X########################################################################### X# X# Compiler stuff X# X########################################################################### X#DEFCCOM= cc XDEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### XCWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= X#LDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) Will probably not work X X########################################################################### X# X# Installation config stuff X# X########################################################################### XINS_BASE= /opt/schily XINS_KBASE= / XINS_RBASE= / X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS/Defaults.freemint echo x - star-1.6/DEFAULTS/Defaults.syllable sed 's/^X//' >star-1.6/DEFAULTS/Defaults.syllable << 'END-of-star-1.6/DEFAULTS/Defaults.syllable' X#ident "@(#)Defaults.syllable 1.3 13/11/04 " X########################################################################### X# X# global definitions for Syllable Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### X#DEFCCOM= cc XDEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### XCWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= /ainc XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib X X########################################################################### X# X# Installation config stuff X# X########################################################################### XINS_BASE= /opt/schily XINS_KBASE= / XINS_RBASE= / X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS/Defaults.syllable echo x - star-1.6/DEFAULTS/Defaults.haiku sed 's/^X//' >star-1.6/DEFAULTS/Defaults.haiku << 'END-of-star-1.6/DEFAULTS/Defaults.haiku' X#ident "@(#)Defaults.haiku 1.4 13/11/04 " X########################################################################### X# X# global definitions for Haiku Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### X#DEFCCOM= cc XDEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### XCWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib X X########################################################################### X# X# Installation config stuff X# X########################################################################### XINS_BASE= /boot/opt/schily XINS_KBASE= / XINS_RBASE= / X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS/Defaults.haiku echo x - star-1.6/DEFAULTS/vc7_64-cygwin-setup sed 's/^X//' >star-1.6/DEFAULTS/vc7_64-cygwin-setup << 'END-of-star-1.6/DEFAULTS/vc7_64-cygwin-setup' X# @(#)vc7_64-cygwin-setup 1.1 09/05/16 Copyright 2006 J. Schilling X X# X# Keep in sync with vc7_64-setup as we cannot rely on hard links X# X X# X# Disable warnings for nonportable variable assignements. X# We only use smake MS-WIN, so this is not a problem. X# X.NO_WARN: := X X# X# A German installation X# X#VSINSTALLDIR=C:\Programme\Microsoft Visual Studio 8 X#VSINS=/cygdrive/c/Programme/Microsoft Visual Studio 8 X X# X# An English installation on an English Windows XP 64 Bit host X# XVSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio 8 XVSINS=/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 8 X Xexport VSINSTALLDIR X XVCINSTALLDIR :=${VSINSTALLDIR}\VC Xexport VCINSTALLDIR X XPATH :=${VSINS}/VC/BIN/amd64:${VSINS}/Common7/IDE:${PATH} Xexport PATH X XINCLUDE :=${VCINSTALLDIR}\INCLUDE;${VCINSTALLDIR}\PlatformSDK\INCLUDE;${INCLUDE} Xexport INCLUDE X XLIB :=${VCINSTALLDIR}\LIB\amd64;${VCINSTALLDIR}\PlatformSDK\LIB\amd64;${LIB} Xexport LIB X XVC_SETUP=dummy-setup Xexport VC_SETUP X X# X# Re-enable all warnings. X# X.NO_WARN: END-of-star-1.6/DEFAULTS/vc7_64-cygwin-setup echo x - star-1.6/DEFAULTS/vc7_64-setup sed 's/^X//' >star-1.6/DEFAULTS/vc7_64-setup << 'END-of-star-1.6/DEFAULTS/vc7_64-setup' X# @(#)vc7_64-setup 1.1 09/05/16 Copyright 2006 J. Schilling X X# X# Keep in sync with vc7_64-cygwin-setup as we cannot rely on hard links X# X X# X# Disable warnings for nonportable variable assignements. X# We only use smake MS-WIN, so this is not a problem. X# X.NO_WARN: := X X# X# A German installation on a German Windows (32Bit) host, to be used X# for cross compiling stuff (no autoconf run) X# X#VSINSTALLDIR=C:\Programme\Microsoft Visual Studio 8 X#VSINS=/cygdrive/c/Programme/Microsoft Visual Studio 8 X X# X# An English installation on an English Windows XP 64 Bit host X# XVSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio 8 XVSINS=/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 8 X Xexport VSINSTALLDIR X XVCINSTALLDIR :=${VSINSTALLDIR}\VC Xexport VCINSTALLDIR X XPATH :=${VSINS}/VC/BIN/amd64:${VSINS}/Common7/IDE:${PATH} Xexport PATH X XINCLUDE :=${VCINSTALLDIR}\INCLUDE;${VCINSTALLDIR}\PlatformSDK\INCLUDE;${INCLUDE} Xexport INCLUDE X XLIB :=${VCINSTALLDIR}\LIB\amd64;${VCINSTALLDIR}\PlatformSDK\LIB\amd64;${LIB} Xexport LIB X XVC_SETUP=dummy-setup Xexport VC_SETUP X X# X# Re-enable all warnings. X# X.NO_WARN: END-of-star-1.6/DEFAULTS/vc7_64-setup echo x - star-1.6/DEFAULTS/Defaults.cygwin32_wow64 sed 's/^X//' >star-1.6/DEFAULTS/Defaults.cygwin32_wow64 << 'END-of-star-1.6/DEFAULTS/Defaults.cygwin32_wow64' X#ident "@(#)Defaults.cygwin32_wow64 1.8 17/07/09 " X########################################################################### X# X# global definitions for Cygnus GCC for WINNT Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### X#DEFCCOM= cc XDEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### XCWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= X#LDPATH= -L/opt/schily/lib XLDPATH= X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= X X########################################################################### X# X# Installation config stuff X# X########################################################################### XINS_BASE= /opt/schily XINS_KBASE= / XINS_RBASE= / X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= root X X# X# This is not the correct place for doing this, X# the correct place is RULES/cc-msc.rul. X# We do it here because otherwise cc-config would not work. X# This kind of hack may not work for other platforms. X# X_PLATFORM= cygwin XVC=7 XVC=9 X X_VCNAME= $(_UNIQ)$(XMAKEPROG) X__VCNAME= $(_VCNAME:$(_UNIQ)=dummy) X___VCNAME= $(__VCNAME:$(_UNIQ)smake=vc$(VC)$(_PLATFORM:%=-%)) XVCNAME= $(___VCNAME:$(_UNIQ)%=dummy) X X_VC_SETUP= $(_UNIQ)$(VC_SETUP) X__VC_SETUP= $(_VC_SETUP:$(_UNIQ)=$(VCNAME)-setup) XVCSETUP= $(__VC_SETUP:$(_UNIQ)%=%) X X########################################################################### X# IMPORTANT Note: X# We also include $(DEFLTSROOT)/$(DEFLTSDIR)/$(VCSETUP) from RULES/cc-msc.rul X# in order to be able to test for the existence of "cl.exe" early. X########################################################################### Xinclude $(DEFLTSROOT)/$(DEFLTSDIR)/$(VCSETUP) END-of-star-1.6/DEFAULTS/Defaults.cygwin32_wow64 echo x - star-1.6/DEFAULTS/vc9-cygwin-setup sed 's/^X//' >star-1.6/DEFAULTS/vc9-cygwin-setup << 'END-of-star-1.6/DEFAULTS/vc9-cygwin-setup' X# @(#)vc9-cygwin-setup 1.4 11/08/01 Copyright 2006-2011 J. Schilling X X# X# Keep in sync with vc9-cygwin-setup as we cannot rely on hard links X# X X# X# Disable warnings for nonportable variable assignements. X# We only use smake MS-WIN, so this is not a problem. X# X.NO_WARN: := X X# X# A German installation X# XVSINSTALLDIR=C:\Programme\Microsoft Visual Studio 9.0 XVSINS=/cygdrive/c/Programme/Microsoft Visual Studio 9.0 X X# X# An English installation X# XVSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio 9.0 XVSBASEDIR=C:\Program Files (x86) XVSINS=/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 9.0 X Xexport VSINSTALLDIR X XVCINSTALLDIR :=${VSINSTALLDIR}\VC Xexport VCINSTALLDIR X XPATH :=${VSINS}/VC/bin:${VSINS}/Common7/IDE:${PATH} Xexport PATH X X#INCLUDE :=${VCINSTALLDIR}\include;${VCINSTALLDIR}\PlatformSDK\INCLUDE;${INCLUDE} XINCLUDE :=${VCINSTALLDIR}\atlmfc\include;${VCINSTALLDIR}\include;${VSBASEDIR}\Microsoft SDKs\Windows\v5.0\include;C:\Program Files\\Microsoft SDKs\Windows\v6.0A\include;${INCLUDE} Xexport INCLUDE X X#LIB :=${VCINSTALLDIR}\lib;${VCINSTALLDIR}\PlatformSDK\LIB;${LIB} XLIB :=${VCINSTALLDIR}\atlmfc\lib;${VCINSTALLDIR}\lib;C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib;${LIB} Xexport LIB X XVC_SETUP=dummy-setup Xexport VC_SETUP X X# X# Re-enable all warnings. X# X.NO_WARN: END-of-star-1.6/DEFAULTS/vc9-cygwin-setup echo x - star-1.6/DEFAULTS/Defaults.openvms sed 's/^X//' >star-1.6/DEFAULTS/Defaults.openvms << 'END-of-star-1.6/DEFAULTS/Defaults.openvms' X#ident "@(#)Defaults.openvms 1.2 13/11/04 " X########################################################################### X# X# global definitions for OpenVMS X# X########################################################################### X# X# Compiler stuff X# X########################################################################### XDEFCCOM= cc X#DEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### XCWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib X X########################################################################### X# X# Installation config stuff X# X########################################################################### XINS_BASE= /opt/schily XINS_KBASE= / XINS_RBASE= / X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS/Defaults.openvms echo x - star-1.6/DEFAULTS/Defaults.gnu-kfreebsd sed 's/^X//' >star-1.6/DEFAULTS/Defaults.gnu-kfreebsd << 'END-of-star-1.6/DEFAULTS/Defaults.gnu-kfreebsd' X#ident "@(#)Defaults.gnu-kfreebsd 1.2 13/11/04 " X########################################################################### X# X# global definitions for Linux kfreebsd Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### XDEFCCOM= cc X#DEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### XCWARNOPTS= X X########################################################################### X# X# LINUX_SRC_INCLUDE is used in RULES/*-linux-*cc*.rul X# X########################################################################### XLINUX_INCL_PATH= /usr/src/linux/include X X_LINUX_SRC_INCLUDE= $(_UNIQ)$(MAY_LINUX_SRC_INCLUDE) X__LINUX_SRC_INCLUDE= $(_LINUX_SRC_INCLUDE:$(_UNIQ)=$(LINUX_INCL_PATH)) XLINUX_SRC_INCLUDE= $(__LINUX_SRC_INCLUDE:$(_UNIQ)no%=%) X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib X X########################################################################### X# X# Unhide POSIX extensions from /usr/include/ X# X########################################################################### XOSDEFS += -D_GNU_SOURCE X X########################################################################### X# X# Installation config stuff X# X########################################################################### XINS_BASE= /opt/schily XINS_KBASE= / XINS_RBASE= / X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS/Defaults.gnu-kfreebsd echo x - star-1.6/DEFAULTS/Defaults.pyro sed 's/^X//' >star-1.6/DEFAULTS/Defaults.pyro << 'END-of-star-1.6/DEFAULTS/Defaults.pyro' X#ident "@(#)Defaults.pyro 1.2 13/11/04 " X########################################################################### X# X# global definitions for Pyro Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### X#DEFCCOM= cc XDEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### XCWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= /boot/Include XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib X X########################################################################### X# X# Installation config stuff X# X########################################################################### XINS_BASE= /tmp/schily XINS_KBASE= /tmp/schily/admin XINS_RBASE= /tmp/schily/admin X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= admin XDEFINSGRP= bin END-of-star-1.6/DEFAULTS/Defaults.pyro echo x - star-1.6/DEFAULTS/Defaults.cygwin32_wow sed 's/^X//' >star-1.6/DEFAULTS/Defaults.cygwin32_wow << 'END-of-star-1.6/DEFAULTS/Defaults.cygwin32_wow' X#ident "@(#)Defaults.cygwin32_wow 1.2 17/07/09 " X########################################################################### X# X# global definitions for Cygnus GCC for WINNT Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### X#DEFCCOM= cc XDEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### XCWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= X#LDPATH= -L/opt/schily/lib XLDPATH= X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= X X########################################################################### X# X# Installation config stuff X# X########################################################################### XINS_BASE= /opt/schily XINS_KBASE= / XINS_RBASE= / X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= root X X# X# This is not the correct place for doing this, X# the correct place is RULES/cc-msc.rul. X# We do it here because otherwise cc-config would not work. X# This kind of hack may not work for other platforms. X# X_PLATFORM= cygwin XVC=7 XVC=9 X X_VCNAME= $(_UNIQ)$(XMAKEPROG) X__VCNAME= $(_VCNAME:$(_UNIQ)=dummy) X___VCNAME= $(__VCNAME:$(_UNIQ)smake=vc$(VC)$(_PLATFORM:%=-%)) XVCNAME= $(___VCNAME:$(_UNIQ)%=dummy) X X_VC_SETUP= $(_UNIQ)$(VC_SETUP) X__VC_SETUP= $(_VC_SETUP:$(_UNIQ)=$(VCNAME)-setup) XVCSETUP= $(__VC_SETUP:$(_UNIQ)%=%) X X########################################################################### X# IMPORTANT Note: X# We also include $(DEFLTSROOT)/$(DEFLTSDIR)/$(VCSETUP) from RULES/cc-msc.rul X# in order to be able to test for the existence of "cl.exe" early. X########################################################################### Xinclude $(DEFLTSROOT)/$(DEFLTSDIR)/$(VCSETUP) END-of-star-1.6/DEFAULTS/Defaults.cygwin32_wow echo x - star-1.6/DEFAULTS/Defaults.bitrig sed 's/^X//' >star-1.6/DEFAULTS/Defaults.bitrig << 'END-of-star-1.6/DEFAULTS/Defaults.bitrig' X#ident "@(#)Defaults.bitrig 1.1 15/10/08 " X########################################################################### X# X# global definitions for Bitrig Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### XDEFCCOM= clang X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### XCWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) Will probably not work X X########################################################################### X# X# Installation config stuff X# X########################################################################### XINS_BASE= /opt/schily XINS_KBASE= / XINS_RBASE= / X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS/Defaults.bitrig echo x - star-1.6/DEFAULTS/Defaults.minix sed 's/^X//' >star-1.6/DEFAULTS/Defaults.minix << 'END-of-star-1.6/DEFAULTS/Defaults.minix' X#ident "@(#)Defaults.minix 1.1 15/11/08 " X########################################################################### X# X# global definitions for Minix Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### XDEFCCOM= clang X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### XCWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) Will probably not work X X########################################################################### X# X# Installation config stuff X# X########################################################################### XINS_BASE= /opt/schily XINS_KBASE= / XINS_RBASE= / X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS/Defaults.minix echo x - star-1.6/DEFAULTS/Defaults.os400 sed 's/^X//' >star-1.6/DEFAULTS/Defaults.os400 << 'END-of-star-1.6/DEFAULTS/Defaults.os400' X#ident "@(#)Defaults.os400 1.1 18/09/19 " X########################################################################### X# X# global definitions for IBM OS400 Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### X#DEFCCOM= cc XDEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### XCWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib X X########################################################################### X# X# Installation config stuff X# X########################################################################### XINS_BASE= /opt/schily XINS_KBASE= / XINS_RBASE= / X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS/Defaults.os400 echo c - star-1.6/DEFAULTS_ENG mkdir -p star-1.6/DEFAULTS_ENG > /dev/null 2>&1 echo x - star-1.6/DEFAULTS_ENG/Defaults sed 's/^X//' >star-1.6/DEFAULTS_ENG/Defaults << 'END-of-star-1.6/DEFAULTS_ENG/Defaults' X#ident "%W% %E% %Q%" X########################################################################### X# X# global definitions: include system specific file X# X########################################################################### X Xinclude $(DEFLTSROOT)/$(DEFLTSDIR)/Defaults.$(O_ARCH) END-of-star-1.6/DEFAULTS_ENG/Defaults echo x - star-1.6/DEFAULTS_ENG/Defaults.aix sed 's/^X//' >star-1.6/DEFAULTS_ENG/Defaults.aix << 'END-of-star-1.6/DEFAULTS_ENG/Defaults.aix' X#ident "@(#)Defaults.aix 1.6 13/11/04 " X########################################################################### X# X# global definitions for IBM AIX Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### XDEFCCOM= cc X#DEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### X#CWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib X X########################################################################### X# X# Installation config stuff X# X########################################################################### X#INS_BASE= /opt/schily X#INS_KBASE= / X#INS_RBASE= / XINS_BASE= /tmp/schily XINS_KBASE= /tmp/schily/root XINS_RBASE= /tmp/schily/root X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS_ENG/Defaults.aix echo x - star-1.6/DEFAULTS_ENG/Defaults.dgux sed 's/^X//' >star-1.6/DEFAULTS_ENG/Defaults.dgux << 'END-of-star-1.6/DEFAULTS_ENG/Defaults.dgux' X#ident "@(#)Defaults.dgux 1.6 13/11/04 " X########################################################################### X# X# global definitions for Data General DGUX Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### X#DEFCCOM= cc XDEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### X#CWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib X X########################################################################### X# X# Installation config stuff X# X########################################################################### X#INS_BASE= /opt/schily X#INS_KBASE= / X#INS_RBASE= / XINS_BASE= /tmp/schily XINS_KBASE= /tmp/schily/root XINS_RBASE= /tmp/schily/root X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS_ENG/Defaults.dgux echo x - star-1.6/DEFAULTS_ENG/Defaults.dgux3 sed 's/^X//' >star-1.6/DEFAULTS_ENG/Defaults.dgux3 << 'END-of-star-1.6/DEFAULTS_ENG/Defaults.dgux3' X#ident "@(#)Defaults.dgux3 1.6 13/11/04 " X########################################################################### X# X# global definitions for Data General DGUX Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### X#DEFCCOM= cc XDEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### X#CWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib X X########################################################################### X# X# Installation config stuff X# X########################################################################### X#INS_BASE= /opt/schily X#INS_KBASE= / X#INS_RBASE= / XINS_BASE= /tmp/schily XINS_KBASE= /tmp/schily/root XINS_RBASE= /tmp/schily/root X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS_ENG/Defaults.dgux3 echo x - star-1.6/DEFAULTS_ENG/Defaults.dgux4 sed 's/^X//' >star-1.6/DEFAULTS_ENG/Defaults.dgux4 << 'END-of-star-1.6/DEFAULTS_ENG/Defaults.dgux4' X#ident "@(#)Defaults.dgux4 1.6 13/11/04 " X########################################################################### X# X# global definitions for Data General DGUX Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### X#DEFCCOM= cc XDEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### X#CWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib X X########################################################################### X# X# Installation config stuff X# X########################################################################### X#INS_BASE= /opt/schily X#INS_KBASE= / X#INS_RBASE= / XINS_BASE= /tmp/schily XINS_KBASE= /tmp/schily/root XINS_RBASE= /tmp/schily/root X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS_ENG/Defaults.dgux4 echo x - star-1.6/DEFAULTS_ENG/Defaults.freebsd sed 's/^X//' >star-1.6/DEFAULTS_ENG/Defaults.freebsd << 'END-of-star-1.6/DEFAULTS_ENG/Defaults.freebsd' X#ident "@(#)Defaults.freebsd 1.6 13/11/04 " X########################################################################### X# X# global definitions for FreeBSD Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### XDEFCCOM= cc X#DEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### X#CWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= /usr/local/include XLDPATH= -L/opt/schily/lib -L/usr/local/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) Will probably not work X X########################################################################### X# X# Installation config stuff X# X########################################################################### X#INS_BASE= /opt/schily X#INS_KBASE= / X#INS_RBASE= / XINS_BASE= /tmp/schily XINS_KBASE= /tmp/schily/root XINS_RBASE= /tmp/schily/root X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS_ENG/Defaults.freebsd echo x - star-1.6/DEFAULTS_ENG/Defaults.hp-ux sed 's/^X//' >star-1.6/DEFAULTS_ENG/Defaults.hp-ux << 'END-of-star-1.6/DEFAULTS_ENG/Defaults.hp-ux' X#ident "@(#)Defaults.hp-ux 1.6 13/11/04 " X########################################################################### X# X# global definitions for HP/UX Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### X#DEFCCOM= cc XDEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### X#CWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib X X########################################################################### X# X# Installation config stuff X# X########################################################################### X#INS_BASE= /opt/schily X#INS_KBASE= / X#INS_RBASE= / XINS_BASE= /tmp/schily XINS_KBASE= /tmp/schily/root XINS_RBASE= /tmp/schily/root X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS_ENG/Defaults.hp-ux echo x - star-1.6/DEFAULTS_ENG/Defaults.irix sed 's/^X//' >star-1.6/DEFAULTS_ENG/Defaults.irix << 'END-of-star-1.6/DEFAULTS_ENG/Defaults.irix' X#ident "@(#)Defaults.irix 1.6 13/11/04 " X########################################################################### X# X# global definitions for Silicon Graphics Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### XDEFCCOM= cc X#DEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### X#CWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib X X########################################################################### X# X# Installation config stuff X# X########################################################################### X#INS_BASE= /opt/schily X#INS_KBASE= / X#INS_RBASE= / XINS_BASE= /tmp/schily XINS_KBASE= /tmp/schily/root XINS_RBASE= /tmp/schily/root X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS_ENG/Defaults.irix echo x - star-1.6/DEFAULTS_ENG/Defaults.linux sed 's/^X//' >star-1.6/DEFAULTS_ENG/Defaults.linux << 'END-of-star-1.6/DEFAULTS_ENG/Defaults.linux' X#ident "@(#)Defaults.linux 1.8 13/11/04 " X########################################################################### X# X# global definitions for Linux Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### XDEFCCOM= cc X#DEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### X#CWARNOPTS= X X########################################################################### X# X# LINUX_SRC_INCLUDE is used in RULES/*-linux-*cc*.rul X# X########################################################################### XLINUX_INCL_PATH= /usr/src/linux/include X X_LINUX_SRC_INCLUDE= $(_UNIQ)$(MAY_LINUX_SRC_INCLUDE) X__LINUX_SRC_INCLUDE= $(_LINUX_SRC_INCLUDE:$(_UNIQ)=$(LINUX_INCL_PATH)) XLINUX_SRC_INCLUDE= $(__LINUX_SRC_INCLUDE:$(_UNIQ)no%=%) X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib X X########################################################################### X# X# Unhide POSIX extensions from /usr/include/ X# X########################################################################### XOSDEFS += -D_GNU_SOURCE X X########################################################################### X# X# Installation config stuff X# X########################################################################### X#INS_BASE= /opt/schily X#INS_KBASE= / X#INS_RBASE= / XINS_BASE= /tmp/schily XINS_KBASE= /tmp/schily/root XINS_RBASE= /tmp/schily/root X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS_ENG/Defaults.linux echo x - star-1.6/DEFAULTS_ENG/Defaults.sunos4 sed 's/^X//' >star-1.6/DEFAULTS_ENG/Defaults.sunos4 << 'END-of-star-1.6/DEFAULTS_ENG/Defaults.sunos4' X#ident "@(#)Defaults.sunos4 1.5 13/11/04 " X########################################################################### X# X# global definitions for SunOS Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### X#DEFCCOM= cc XDEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### X#CWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) Will not work on SunOS X X########################################################################### X# X# Installation config stuff X# X########################################################################### X#INS_BASE= /opt/schily X#INS_KBASE= / X#INS_RBASE= / XINS_BASE= /tmp/schily XINS_KBASE= /tmp/schily/root XINS_RBASE= /tmp/schily/root X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS_ENG/Defaults.sunos4 echo x - star-1.6/DEFAULTS_ENG/Defaults.sunos5 sed 's/^X//' >star-1.6/DEFAULTS_ENG/Defaults.sunos5 << 'END-of-star-1.6/DEFAULTS_ENG/Defaults.sunos5' X#ident "@(#)Defaults.sunos5 1.6 13/11/04 " X########################################################################### X# X# global definitions for Solaris Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### XDEFCCOM= cc X#DEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### X#CWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib X X########################################################################### X# X# Installation config stuff X# X########################################################################### X#INS_BASE= /opt/schily X#INS_KBASE= / X#INS_RBASE= / XINS_BASE= /tmp/schily XINS_KBASE= /tmp/schily/root XINS_RBASE= /tmp/schily/root X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS_ENG/Defaults.sunos5 echo x - star-1.6/DEFAULTS_ENG/README sed 's/^X//' >star-1.6/DEFAULTS_ENG/README << 'END-of-star-1.6/DEFAULTS_ENG/README' XThis directory contains engineering defaults END-of-star-1.6/DEFAULTS_ENG/README echo x - star-1.6/DEFAULTS_ENG/Defaults.netbsd sed 's/^X//' >star-1.6/DEFAULTS_ENG/Defaults.netbsd << 'END-of-star-1.6/DEFAULTS_ENG/Defaults.netbsd' X#ident "@(#)Defaults.netbsd 1.6 18/11/14 " X########################################################################### X# X# global definitions for NetBSD Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### XDEFCCOM= cc X#DEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### X#CWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) Will probably not work XRUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib X X########################################################################### X# X# Installation config stuff X# X########################################################################### X#INS_BASE= /opt/schily X#INS_KBASE= / X#INS_RBASE= / XINS_BASE= /tmp/schily XINS_KBASE= /tmp/schily/root XINS_RBASE= /tmp/schily/root X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS_ENG/Defaults.netbsd echo x - star-1.6/DEFAULTS_ENG/Defaults.openbsd sed 's/^X//' >star-1.6/DEFAULTS_ENG/Defaults.openbsd << 'END-of-star-1.6/DEFAULTS_ENG/Defaults.openbsd' X#ident "@(#)Defaults.openbsd 1.5 13/11/04 " X########################################################################### X# X# global definitions for OpenBSD Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### XDEFCCOM= cc X#DEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### X#CWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) Will probably not work X X########################################################################### X# X# Installation config stuff X# X########################################################################### X#INS_BASE= /opt/schily X#INS_KBASE= / X#INS_RBASE= / XINS_BASE= /tmp/schily XINS_KBASE= /tmp/schily/root XINS_RBASE= /tmp/schily/root X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS_ENG/Defaults.openbsd echo x - star-1.6/DEFAULTS_ENG/Defaults.bsd-os sed 's/^X//' >star-1.6/DEFAULTS_ENG/Defaults.bsd-os << 'END-of-star-1.6/DEFAULTS_ENG/Defaults.bsd-os' X#ident "@(#)Defaults.bsd-os 1.5 13/11/04 " X########################################################################### X# X# global definitions for BSD/OS Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### X#DEFCCOM= cc XDEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### X#CWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= X#LDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) Will probably not work X X########################################################################### X# X# Installation config stuff X# X########################################################################### X#INS_BASE= /opt/schily X#INS_KBASE= / X#INS_RBASE= / XINS_BASE= /tmp/schily XINS_KBASE= /tmp/schily/root XINS_RBASE= /tmp/schily/root X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS_ENG/Defaults.bsd-os echo x - star-1.6/DEFAULTS_ENG/Defaults.cygwin32_nt sed 's/^X//' >star-1.6/DEFAULTS_ENG/Defaults.cygwin32_nt << 'END-of-star-1.6/DEFAULTS_ENG/Defaults.cygwin32_nt' X#ident "@(#)Defaults.cygwin32_nt 1.7 17/07/09 " X########################################################################### X# X# global definitions for Cygnus GCC for WINNT Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### X#DEFCCOM= cc XDEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### X#CWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= X#LDPATH= -L/opt/schily/lib XLDPATH= X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= X X########################################################################### X# X# Installation config stuff X# X########################################################################### X#INS_BASE= /opt/schily X#INS_KBASE= / X#INS_RBASE= / XINS_BASE= /tmp/schily XINS_KBASE= /tmp/schily/root XINS_RBASE= /tmp/schily/root X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= root X X# X# This is not the correct place for doing this, X# the correct place is RULES/cc-msc.rul. X# We do it here because otherwise cc-config would not work. X# This kind of hack may not work for other platforms. X# X_PLATFORM= cygwin XVC=7 X X_VCNAME= $(_UNIQ)$(XMAKEPROG) X__VCNAME= $(_VCNAME:$(_UNIQ)=dummy) X___VCNAME= $(__VCNAME:$(_UNIQ)smake=vc$(VC)$(_PLATFORM:%=-%)) XVCNAME= $(___VCNAME:$(_UNIQ)%=dummy) X X_VC_SETUP= $(_UNIQ)$(VC_SETUP) X__VC_SETUP= $(_VC_SETUP:$(_UNIQ)=$(VCNAME)-setup) XVCSETUP= $(__VC_SETUP:$(_UNIQ)%=%) X X########################################################################### X# IMPORTANT Note: X# We also include $(DEFLTSROOT)/$(DEFLTSDIR)/$(VCSETUP) from RULES/cc-msc.rul X# in order to be able to test for the existence of "cl.exe" early. X########################################################################### Xinclude $(DEFLTSROOT)/$(DEFLTSDIR)/$(VCSETUP) END-of-star-1.6/DEFAULTS_ENG/Defaults.cygwin32_nt echo x - star-1.6/DEFAULTS_ENG/MKLINKS sed 's/^X//' >star-1.6/DEFAULTS_ENG/MKLINKS << 'END-of-star-1.6/DEFAULTS_ENG/MKLINKS' X#!/bin/sh X# Xln -s Defaults.dgux Defaults.dgux3 Xln -s Defaults.dgux Defaults.dgux4 END-of-star-1.6/DEFAULTS_ENG/MKLINKS echo x - star-1.6/DEFAULTS_ENG/Defaults.osf1 sed 's/^X//' >star-1.6/DEFAULTS_ENG/Defaults.osf1 << 'END-of-star-1.6/DEFAULTS_ENG/Defaults.osf1' X#ident "@(#)Defaults.osf1 1.6 13/11/04 " X########################################################################### X# X# global definitions for Digital UNIX (OSF1) Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### XDEFCCOM= cc X#DEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### X#CWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib X X########################################################################### X# X# Installation config stuff X# X########################################################################### X#INS_BASE= /opt/schily X#INS_KBASE= / X#INS_RBASE= / XINS_BASE= /tmp/schily XINS_KBASE= /tmp/schily/root XINS_RBASE= /tmp/schily/root X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS_ENG/Defaults.osf1 echo x - star-1.6/DEFAULTS_ENG/Defaults.nextstep sed 's/^X//' >star-1.6/DEFAULTS_ENG/Defaults.nextstep << 'END-of-star-1.6/DEFAULTS_ENG/Defaults.nextstep' X#ident "@(#)Defaults.nextstep 1.5 13/11/04 " X########################################################################### X# X# global definitions for NeXT Step Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### XDEFCCOM= cc X#DEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### X#CWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) Will probably not work X X########################################################################### X# X# Installation config stuff X# X########################################################################### X#INS_BASE= /opt/schily X#INS_KBASE= / X#INS_RBASE= / XINS_BASE= /tmp/schily XINS_KBASE= /tmp/schily/root XINS_RBASE= /tmp/schily/root X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS_ENG/Defaults.nextstep echo x - star-1.6/DEFAULTS_ENG/Defaults.rhapsody sed 's/^X//' >star-1.6/DEFAULTS_ENG/Defaults.rhapsody << 'END-of-star-1.6/DEFAULTS_ENG/Defaults.rhapsody' X#ident "@(#)Defaults.rhapsody 1.4 13/11/04 " X########################################################################### X# X# global definitions for NeXT Step (Apple Rhapsody) Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### XDEFCCOM= cc X#DEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### X#CWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= /usr/local/include XLDPATH= #-L/opt/schily/lib XLDPATH= -L/usr/local/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) Will probably not work X X########################################################################### X# X# Installation config stuff X# X########################################################################### X#INS_BASE= /opt/schily X#INS_KBASE= / X#INS_RBASE= / XINS_BASE= /tmp/schily XINS_KBASE= /tmp/schily/root XINS_RBASE= /tmp/schily/root X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= wheel END-of-star-1.6/DEFAULTS_ENG/Defaults.rhapsody echo x - star-1.6/DEFAULTS_ENG/Defaults.newsos6 sed 's/^X//' >star-1.6/DEFAULTS_ENG/Defaults.newsos6 << 'END-of-star-1.6/DEFAULTS_ENG/Defaults.newsos6' X#ident "@(#)Defaults.newsos6 1.6 13/11/04 " X########################################################################### X# X# global definitions for Sony NEWS-OS 6.x X# X########################################################################### X# X# Compiler stuff X# X########################################################################### XDEFCCOM= cc X#DEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### X#CWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib X X########################################################################### X# X# Installation config stuff X# X########################################################################### X#INS_BASE= /opt/schily X#INS_KBASE= / X#INS_RBASE= / XINS_BASE= /tmp/schily XINS_KBASE= /tmp/schily/root XINS_RBASE= /tmp/schily/root X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS_ENG/Defaults.newsos6 echo x - star-1.6/DEFAULTS_ENG/Defaults.beos sed 's/^X//' >star-1.6/DEFAULTS_ENG/Defaults.beos << 'END-of-star-1.6/DEFAULTS_ENG/Defaults.beos' X#ident "@(#)Defaults.beos 1.6 13/11/04 " X########################################################################### X# X# global definitions for BeOS Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### X#DEFCCOM= cc XDEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### X#CWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib X X########################################################################### X# X# Installation config stuff X# X########################################################################### X#INS_BASE= /opt/schily X#INS_KBASE= / X#INS_RBASE= / XINS_BASE= /tmp/schily XINS_KBASE= /tmp/schily/root XINS_RBASE= /tmp/schily/root X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS_ENG/Defaults.beos echo x - star-1.6/DEFAULTS_ENG/Defaults.os2 sed 's/^X//' >star-1.6/DEFAULTS_ENG/Defaults.os2 << 'END-of-star-1.6/DEFAULTS_ENG/Defaults.os2' X#ident "@(#)Defaults.os2 1.6 13/11/04 " X########################################################################### X# X# global definitions for OS/2 Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### X#DEFCCOM= cc XDEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### X#CWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib X X########################################################################### X# X# Installation config stuff X# X########################################################################### X#INS_BASE= /opt/schily X#INS_KBASE= / X#INS_RBASE= / XINS_BASE= /tmp/schily XINS_KBASE= /tmp/schily/root XINS_RBASE= /tmp/schily/root X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS_ENG/Defaults.os2 echo x - star-1.6/DEFAULTS_ENG/Defaults.qnx sed 's/^X//' >star-1.6/DEFAULTS_ENG/Defaults.qnx << 'END-of-star-1.6/DEFAULTS_ENG/Defaults.qnx' X#ident "@(#)Defaults.qnx 1.5 13/11/04 " X########################################################################### X# X# global definitions for QNX Systems X# X########################################################################### X# X# Compiler stuff X# X# When QNX support started in december 1999, there was only the watcom X# C-compler (cc). Now, in novemver 2001 we switch to gcc. X# X########################################################################### X#DEFCCOM= cc XDEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### X#CWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) Will probably not work X X########################################################################### X# X# Installation config stuff X# X########################################################################### X#INS_BASE= /opt/schily X#INS_KBASE= / X#INS_RBASE= / XINS_BASE= /tmp/schily XINS_KBASE= /tmp/schily/root XINS_RBASE= /tmp/schily/root X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS_ENG/Defaults.qnx echo x - star-1.6/DEFAULTS_ENG/Defaults.openserver sed 's/^X//' >star-1.6/DEFAULTS_ENG/Defaults.openserver << 'END-of-star-1.6/DEFAULTS_ENG/Defaults.openserver' X#ident "@(#)Defaults.openserver 1.4 13/11/04 " X########################################################################### X# X# global definitions for SCO OpenServer 5 Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### XDEFCCOM= cc X#DEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### X#CWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= XRUNPATH= X X########################################################################### X# X# Installation config stuff X# X########################################################################### X#INS_BASE= /usr/local X#INS_KBASE= / X#INS_RBASE= / XINS_BASE= /tmp/schily XINS_KBASE= /tmp/schily/root XINS_RBASE= /tmp/schily/root X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS_ENG/Defaults.openserver echo x - star-1.6/DEFAULTS_ENG/Defaults.unixware sed 's/^X//' >star-1.6/DEFAULTS_ENG/Defaults.unixware << 'END-of-star-1.6/DEFAULTS_ENG/Defaults.unixware' X#ident "@(#)Defaults.unixware 1.4 13/11/04 " X########################################################################### X# X# global definitions for SCO UnixWare Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### XDEFCCOM= cc X#DEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### X#CWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= XRUNPATH= X X########################################################################### X# X# Installation config stuff X# X########################################################################### X#INS_BASE= /usr/local X#INS_KBASE= / X#INS_RBASE= / XINS_BASE= /tmp/schily XINS_KBASE= /tmp/schily/root XINS_RBASE= /tmp/schily/root X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS_ENG/Defaults.unixware echo x - star-1.6/DEFAULTS_ENG/Defaults.mac-os10 sed 's/^X//' >star-1.6/DEFAULTS_ENG/Defaults.mac-os10 << 'END-of-star-1.6/DEFAULTS_ENG/Defaults.mac-os10' X#ident "@(#)Defaults.mac-os10 1.4 13/11/04 " X########################################################################### X# X# global definitions for Mac OS X Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### XDEFCCOM= cc X#DEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### X#CWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= /usr/local/include XLDPATH= #-L/opt/schily/lib XLDPATH= -L/usr/local/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) Will probably not work X X########################################################################### X# X# Installation config stuff X# X########################################################################### X#INS_BASE= /opt/schily X#INS_KBASE= / X#INS_RBASE= / XINS_BASE= /tmp/schily XINS_KBASE= /tmp/schily/root XINS_RBASE= /tmp/schily/root X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= wheel END-of-star-1.6/DEFAULTS_ENG/Defaults.mac-os10 echo x - star-1.6/DEFAULTS_ENG/Defaults.darwin sed 's/^X//' >star-1.6/DEFAULTS_ENG/Defaults.darwin << 'END-of-star-1.6/DEFAULTS_ENG/Defaults.darwin' X#ident "@(#)Defaults.darwin 1.4 13/11/04 " X########################################################################### X# X# global definitions for Mac OS X Darwin Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### XDEFCCOM= cc X#DEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### X#CWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= /usr/local/include XLDPATH= #-L/opt/schily/lib XLDPATH= -L/usr/local/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) Will probably not work X X########################################################################### X# X# Installation config stuff X# X########################################################################### X#INS_BASE= /opt/schily X#INS_KBASE= / X#INS_RBASE= / XINS_BASE= /tmp/schily XINS_KBASE= /tmp/schily/root XINS_RBASE= /tmp/schily/root X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= wheel END-of-star-1.6/DEFAULTS_ENG/Defaults.darwin echo x - star-1.6/DEFAULTS_ENG/Defaults.domainos sed 's/^X//' >star-1.6/DEFAULTS_ENG/Defaults.domainos << 'END-of-star-1.6/DEFAULTS_ENG/Defaults.domainos' X#ident "@(#)Defaults.domainos 1.6 13/11/04 " X########################################################################### X# X# global definitions for Apollo Domain/OS Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### XDEFCCOM= cc X#DEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### X#CWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib X X########################################################################### X# X# Installation config stuff X# X########################################################################### X#INS_BASE= /opt/schily X#INS_KBASE= / X#INS_RBASE= / XINS_BASE= /tmp/schily XINS_KBASE= /tmp/schily/root XINS_RBASE= /tmp/schily/root X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS_ENG/Defaults.domainos echo x - star-1.6/DEFAULTS_ENG/Defaults.amigaos sed 's/^X//' >star-1.6/DEFAULTS_ENG/Defaults.amigaos << 'END-of-star-1.6/DEFAULTS_ENG/Defaults.amigaos' X#ident "@(#)Defaults.amigaos 1.6 13/11/04 " X########################################################################### X# X# global definitions for AmigaOS Systems using CC=gcc X# X########################################################################### X# X# Compiler stuff X# X########################################################################### X#DEFCCOM= cc XDEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### X#CWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib X X########################################################################### X# X# Installation config stuff X# X########################################################################### X#INS_BASE= /opt/schily X#INS_KBASE= / X#INS_RBASE= / XINS_BASE= /tmp/schily XINS_KBASE= /tmp/schily/root XINS_RBASE= /tmp/schily/root X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS_ENG/Defaults.amigaos echo x - star-1.6/DEFAULTS_ENG/Defaults.gnu sed 's/^X//' >star-1.6/DEFAULTS_ENG/Defaults.gnu << 'END-of-star-1.6/DEFAULTS_ENG/Defaults.gnu' X#ident "@(#)Defaults.gnu 1.6 13/11/04 " X########################################################################### X# X# global definitions for GNU (hurd) Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### X#DEFCCOM= cc XDEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### X#CWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= /usr/src/linux/include XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib X X########################################################################### X# X# Installation config stuff X# X########################################################################### X#INS_BASE= /opt/schily X#INS_KBASE= / X#INS_RBASE= / XINS_BASE= /tmp/schily XINS_KBASE= /tmp/schily/root XINS_RBASE= /tmp/schily/root X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS_ENG/Defaults.gnu echo x - star-1.6/DEFAULTS_ENG/Defaults.bsd-os3 sed 's/^X//' >star-1.6/DEFAULTS_ENG/Defaults.bsd-os3 << 'END-of-star-1.6/DEFAULTS_ENG/Defaults.bsd-os3' X#ident "@(#)Defaults.bsd-os3 1.5 13/11/04 " X########################################################################### X# X# global definitions for BSD/OS Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### X#DEFCCOM= cc XDEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### X#CWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= X#LDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) Will probably not work X X########################################################################### X# X# Installation config stuff X# X########################################################################### X#INS_BASE= /opt/schily X#INS_KBASE= / X#INS_RBASE= / XINS_BASE= /tmp/schily XINS_KBASE= /tmp/schily/root XINS_RBASE= /tmp/schily/root X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS_ENG/Defaults.bsd-os3 echo x - star-1.6/DEFAULTS_ENG/Defaults.ms-dos sed 's/^X//' >star-1.6/DEFAULTS_ENG/Defaults.ms-dos << 'END-of-star-1.6/DEFAULTS_ENG/Defaults.ms-dos' X#ident "@(#)Defaults.ms-dos 1.6 13/11/04 " X########################################################################### X# X# global definitions for MSDOS/DJGPP v2 Systems using CC=gcc X# X########################################################################### X# X# Compiler stuff X# X########################################################################### X#DEFCCOM= cc XDEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### X#CWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib X X########################################################################### X# X# Installation config stuff X# X########################################################################### X#INS_BASE= /opt/schily X#INS_KBASE= / X#INS_RBASE= / XINS_BASE= /tmp/schily XINS_KBASE= /tmp/schily/root XINS_RBASE= /tmp/schily/root X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS_ENG/Defaults.ms-dos echo x - star-1.6/DEFAULTS_ENG/Defaults.mingw32_nt sed 's/^X//' >star-1.6/DEFAULTS_ENG/Defaults.mingw32_nt << 'END-of-star-1.6/DEFAULTS_ENG/Defaults.mingw32_nt' X#ident "@(#)Defaults.mingw32_nt 1.5 13/11/04 " X########################################################################### X# X# global definitions for Win32/Mingw32 systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### X#DEFCCOM= cc XDEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### X#CWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= X#LDPATH= -L/opt/schily/lib XLDPATH= X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= X X########################################################################### X# X# Installation config stuff X# X########################################################################### X#INS_BASE= /opt/schily X#INS_KBASE= / X#INS_RBASE= / XINS_BASE= /tmp/schily XINS_KBASE= /tmp/schily/root XINS_RBASE= /tmp/schily/root X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS_ENG/Defaults.mingw32_nt echo x - star-1.6/DEFAULTS_ENG/Defaults.interix sed 's/^X//' >star-1.6/DEFAULTS_ENG/Defaults.interix << 'END-of-star-1.6/DEFAULTS_ENG/Defaults.interix' X#ident "@(#)Defaults.interix 1.7 13/11/04 " X########################################################################### X# X# global definitions for Interix Systems (WIN-NT with SFU) using CC=gcc X# X########################################################################### X# X# Compiler stuff X# X########################################################################### X#DEFCCOM= cc XDEFCCOM= gcc X X########################################################################### X# X# Avoid to have something like "Intel_x86_Family15_Model4_Stepping1" X# in $(OARCH), we rather use $(K_ARCH) which is e.g. "x86". X# XXX If this is changed, both files in DEFAULTS/ and DEFAULTS_ENG as X# XXX well as the file conf/oarch.sh need to be changed. X# X########################################################################### XP_ARCH= $(K_ARCH) X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### X#CWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= --rpath $(INS_BASE)/lib --rpath /opt/schily/lib --rpath $(OLIBSDIR) XRUNPATH= --rpath $(INS_BASE)/lib --rpath /opt/schily/lib X X########################################################################### X# X# Installation config stuff X# X########################################################################### X#INS_BASE= /opt/schily X#INS_KBASE= / X#INS_RBASE= / XINS_BASE= /tmp/schily XINS_KBASE= /tmp/schily/root XINS_RBASE= /tmp/schily/root X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin X X# X# This is not the correct place for doing this, X# the correct place is RULES/cc-ms*.rul. X# We do it here because otherwise cc-config would not work. X# This kind of hack may not work for other platforms. X# X_PLATFORM= interix XVC=7 X X_VC_SETUP= $(_UNIQ)$(VC_SETUP) X__VC_SETUP= $(_VC_SETUP:$(_UNIQ)=vc$(VC)$(_PLATFORM:%=-%)-setup) XVCSETUP= $(__VC_SETUP:$(_UNIQ)%=%) X X########################################################################### X# IMPORTANT Note: X# We also include $(DEFLTSROOT)/$(DEFLTSDIR)/$(VCSETUP) from RULES/cc-ms*.rul X# in order to be able to test for the existence of "cl.exe" early. X########################################################################### Xinclude $(DEFLTSROOT)/$(DEFLTSDIR)/$(VCSETUP) END-of-star-1.6/DEFAULTS_ENG/Defaults.interix echo x - star-1.6/DEFAULTS_ENG/vc7-setup sed 's/^X//' >star-1.6/DEFAULTS_ENG/vc7-setup << 'END-of-star-1.6/DEFAULTS_ENG/vc7-setup' X# @(#)vc7-setup 1.5 09/05/16 Copyright 2006 J. Schilling X X# X# Keep in sync with vc7-cygwin-setup as we cannot rely on hard links X# X X# X# Disable warnings for nonportable variable assignements. X# We only use smake MS-WIN, so this is not a problem. X# X.NO_WARN: := X X# X# A German installation X# XVSINSTALLDIR=C:\Programme\Microsoft Visual Studio 8 XVSINS=/cygdrive/c/Programme/Microsoft Visual Studio 8 X X# X# An English installation X# XVSINSTALLDIR=C:\Program Files\Microsoft Visual Studio 8 XVSINS=/cygdrive/c/Program Files/Microsoft Visual Studio 8 X Xexport VSINSTALLDIR X XVCINSTALLDIR :=${VSINSTALLDIR}\VC Xexport VCINSTALLDIR X XPATH :=${VSINS}/VC/BIN:${VSINS}/Common7/IDE:${PATH} Xexport PATH X XINCLUDE :=${VCINSTALLDIR}\INCLUDE;${VCINSTALLDIR}\PlatformSDK\INCLUDE;${INCLUDE} Xexport INCLUDE X XLIB :=${VCINSTALLDIR}\LIB;${VCINSTALLDIR}\PlatformSDK\LIB;${LIB} Xexport LIB X XVC_SETUP=dummy-setup Xexport VC_SETUP X X# X# Re-enable all warnings. X# X.NO_WARN: END-of-star-1.6/DEFAULTS_ENG/vc7-setup echo x - star-1.6/DEFAULTS_ENG/dummy-setup sed 's/^X//' >star-1.6/DEFAULTS_ENG/dummy-setup << 'END-of-star-1.6/DEFAULTS_ENG/dummy-setup' END-of-star-1.6/DEFAULTS_ENG/dummy-setup echo x - star-1.6/DEFAULTS_ENG/vc6-setup sed 's/^X//' >star-1.6/DEFAULTS_ENG/vc6-setup << 'END-of-star-1.6/DEFAULTS_ENG/vc6-setup' X# @(#)vc6-setup 1.4 09/05/16 Copyright 2006 J. Schilling X X# X# Keep in sync with vc6-cygwin-setup as we cannot rely on hard links X# X X# X# Disable warnings for nonportable variable assignements. X# We only use smake MS-WIN, so this is not a problem. X# X.NO_WARN: := X XVSCommonDir=C:\Programme\Microsoft Visual Studio\Common XVSCommonPath=/cygdrive/c/Programme/Microsoft Visual Studio/Common Xexport VSCommonDir X XMSDevDir=C:\Programme\Microsoft Visual Studio\Common\msdev98 XMSDevPath=/cygdrive/c/Programme/Microsoft Visual Studio/Common/msdev98 Xexport MSDevDir X XMSVCDir=C:\Programme\Microsoft Visual Studio\VC98 XMSVCPath=/cygdrive/c/Programme/Microsoft Visual Studio/VC98 Xexport MSVCDir X XVcOsDir=WIN95 XVcOsDir=WINNT Xexport VcOsDir X XPATH :=${MSDevPath}\BIN:${MSVCPath}\BIN:${VSCommonPath}\TOOLS\${VcOsDir}:${VSCommonPath}\TOOLS:${PATH} Xexport PATH X XINCLUDE :=${MSVCDir}\ATL\INCLUDE;${MSVCDir}\INCLUDE;${MSVCDir}\\MFC\INCLUDE;${INCLUDE} Xexport INCLUDE X XLIB :=${MSVCDir}\LIB;${MSVCDir}\MFC\LIB;${LIB} Xexport LIB X XVC_SETUP=dummy-setup Xexport VC_SETUP X X# X# Re-enable all warnings. X# X.NO_WARN: END-of-star-1.6/DEFAULTS_ENG/vc6-setup echo x - star-1.6/DEFAULTS_ENG/vc6-cygwin-setup sed 's/^X//' >star-1.6/DEFAULTS_ENG/vc6-cygwin-setup << 'END-of-star-1.6/DEFAULTS_ENG/vc6-cygwin-setup' X# @(#)vc6-cygwin-setup 1.4 09/05/16 Copyright 2006 J. Schilling X X# X# Keep in sync with vc6-setup as we cannot rely on hard links X# X X# X# Disable warnings for nonportable variable assignements. X# We only use smake MS-WIN, so this is not a problem. X# X.NO_WARN: := X XVSCommonDir=C:\Programme\Microsoft Visual Studio\Common XVSCommonPath=/cygdrive/c/Programme/Microsoft Visual Studio/Common Xexport VSCommonDir X XMSDevDir=C:\Programme\Microsoft Visual Studio\Common\msdev98 XMSDevPath=/cygdrive/c/Programme/Microsoft Visual Studio/Common/msdev98 Xexport MSDevDir X XMSVCDir=C:\Programme\Microsoft Visual Studio\VC98 XMSVCPath=/cygdrive/c/Programme/Microsoft Visual Studio/VC98 Xexport MSVCDir X XVcOsDir=WIN95 XVcOsDir=WINNT Xexport VcOsDir X XPATH :=${MSDevPath}\BIN:${MSVCPath}\BIN:${VSCommonPath}\TOOLS\${VcOsDir}:${VSCommonPath}\TOOLS:${PATH} Xexport PATH X XINCLUDE :=${MSVCDir}\ATL\INCLUDE;${MSVCDir}\INCLUDE;${MSVCDir}\\MFC\INCLUDE;${INCLUDE} Xexport INCLUDE X XLIB :=${MSVCDir}\LIB;${MSVCDir}\MFC\LIB;${LIB} Xexport LIB X XVC_SETUP=dummy-setup Xexport VC_SETUP X X# X# Re-enable all warnings. X# X.NO_WARN: END-of-star-1.6/DEFAULTS_ENG/vc6-cygwin-setup echo x - star-1.6/DEFAULTS_ENG/vc6-interix-setup sed 's/^X//' >star-1.6/DEFAULTS_ENG/vc6-interix-setup << 'END-of-star-1.6/DEFAULTS_ENG/vc6-interix-setup' X# @(#)vc6-interix-setup 1.4 07/04/20 Copyright 2006 J. Schilling X X# X# Disable warnings for nonportable variable assignements. X# We only use smake MS-WIN, so this is not a problem. X# X.NO_WARN: := X XVSCommonDir=C:\Programme\Microsoft Visual Studio\Common XVSCommonPath=/dev/fs/C/Programme/Microsoft Visual Studio/Common Xexport VSCommonDir X XMSDevDir=C:\Programme\Microsoft Visual Studio\Common\msdev98 XMSDevPath=/dev/fs/C/Programme/Microsoft Visual Studio/Common/msdev98 Xexport MSDevDir X XMSVCDir=C:\Programme\Microsoft Visual Studio\VC98 XMSVCPath=/dev/fs/C/Programme/Microsoft Visual Studio/VC98 Xexport MSVCDir X XVcOsDir=WIN95 XVcOsDir=WINNT Xexport VcOsDir X XPATH :=${MSDevPath}\BIN:${MSVCPath}\BIN:${VSCommonPath}\TOOLS\${VcOsDir}:${VSCommonPath}\TOOLS:${PATH} Xexport PATH X XINCLUDE :=${MSVCDir}\ATL\INCLUDE;${MSVCDir}\INCLUDE;${MSVCDir}\\MFC\INCLUDE;${INCLUDE} Xexport INCLUDE X XLIB :=${MSVCDir}\LIB;${MSVCDir}\MFC\LIB;${LIB} Xexport LIB X XVC_SETUP=dummy-setup Xexport VC_SETUP X X# X# Re-enable all warnings. X# X.NO_WARN: END-of-star-1.6/DEFAULTS_ENG/vc6-interix-setup echo x - star-1.6/DEFAULTS_ENG/vc7-cygwin-setup sed 's/^X//' >star-1.6/DEFAULTS_ENG/vc7-cygwin-setup << 'END-of-star-1.6/DEFAULTS_ENG/vc7-cygwin-setup' X# @(#)vc7-cygwin-setup 1.5 09/05/16 Copyright 2006 J. Schilling X X# X# Keep in sync with vc7-setup as we cannot rely on hard links X# X X# X# Disable warnings for nonportable variable assignements. X# We only use smake MS-WIN, so this is not a problem. X# X.NO_WARN: := X X# X# A German installation X# XVSINSTALLDIR=C:\Programme\Microsoft Visual Studio 8 XVSINS=/cygdrive/c/Programme/Microsoft Visual Studio 8 X X# X# An English installation X# XVSINSTALLDIR=C:\Program Files\Microsoft Visual Studio 8 XVSINS=/cygdrive/c/Program Files/Microsoft Visual Studio 8 X Xexport VSINSTALLDIR X XVCINSTALLDIR :=${VSINSTALLDIR}\VC Xexport VCINSTALLDIR X XPATH :=${VSINS}/VC/BIN:${VSINS}/Common7/IDE:${PATH} Xexport PATH X XINCLUDE :=${VCINSTALLDIR}\INCLUDE;${VCINSTALLDIR}\PlatformSDK\INCLUDE;${INCLUDE} Xexport INCLUDE X XLIB :=${VCINSTALLDIR}\LIB;${VCINSTALLDIR}\PlatformSDK\LIB;${LIB} Xexport LIB X XVC_SETUP=dummy-setup Xexport VC_SETUP X X# X# Re-enable all warnings. X# X.NO_WARN: END-of-star-1.6/DEFAULTS_ENG/vc7-cygwin-setup echo x - star-1.6/DEFAULTS_ENG/vc7-interix-setup sed 's/^X//' >star-1.6/DEFAULTS_ENG/vc7-interix-setup << 'END-of-star-1.6/DEFAULTS_ENG/vc7-interix-setup' X# @(#)vc7-interix-setup 1.7 07/04/24 Copyright 2006 J. Schilling X X# X# Disable warnings for nonportable variable assignements. X# We only use smake MS-WIN, so this is not a problem. X# X.NO_WARN: := X X# X# A German installation X# XVSINSTALLDIR=C:\Programme\Microsoft Visual Studio 8 XVSINS=/dev/fs/C/Programme/Microsoft Visual Studio 8 X X# X# An English installation X# XVSINSTALLDIR=C:\Program Files\Microsoft Visual Studio 8 XVSINS=/dev/fs/C/Program Files/Microsoft Visual Studio 8 X Xexport VSINSTALLDIR X XVCINSTALLDIR :=${VSINSTALLDIR}\VC Xexport VCINSTALLDIR X XPATH :=${VSINS}/VC/bin:${VSINS}/Common7/IDE:${PATH} Xexport PATH X XINCLUDE :=${VCINSTALLDIR}\include;${VCINSTALLDIR}\PlatformSDK\Include;${INCLUDE} Xexport INCLUDE X XLIB :=${VCINSTALLDIR}\LIB;${VCINSTALLDIR}\PlatformSDK\LIB;${LIB} Xexport LIB X XVC_SETUP=dummy-setup Xexport VC_SETUP X X# X# Re-enable all warnings. X# X.NO_WARN: END-of-star-1.6/DEFAULTS_ENG/vc7-interix-setup echo x - star-1.6/DEFAULTS_ENG/Defaults.dragonfly sed 's/^X//' >star-1.6/DEFAULTS_ENG/Defaults.dragonfly << 'END-of-star-1.6/DEFAULTS_ENG/Defaults.dragonfly' X#ident "@(#)Defaults.dragonfly 1.6 13/11/04 " X########################################################################### X# X# global definitions for FreeBSD Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### XDEFCCOM= cc X#DEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### X#CWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= /usr/local/include XLDPATH= -L/opt/schily/lib -L/usr/local/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) Will probably not work X X########################################################################### X# X# Installation config stuff X# X########################################################################### X#INS_BASE= /opt/schily X#INS_KBASE= / X#INS_RBASE= / XINS_BASE= /tmp/schily XINS_KBASE= /tmp/schily/root XINS_RBASE= /tmp/schily/root X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS_ENG/Defaults.dragonfly echo x - star-1.6/DEFAULTS_ENG/Defaults.freemint sed 's/^X//' >star-1.6/DEFAULTS_ENG/Defaults.freemint << 'END-of-star-1.6/DEFAULTS_ENG/Defaults.freemint' X#ident @(#)Defaults.freemint 1.4 13/11/04 X########################################################################### X# X# global definitions for FreeMiNT on ATARI computers X# X########################################################################### X# X# Compiler stuff X# X########################################################################### X#DEFCCOM= cc XDEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### X#CWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= X#LDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) Will probably not work X X########################################################################### X# X# Installation config stuff X# X########################################################################### X#INS_BASE= /opt/schily X#INS_KBASE= / X#INS_RBASE= / XINS_BASE= /tmp/schily XINS_KBASE= /tmp/schily/root XINS_RBASE= /tmp/schily/root X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS_ENG/Defaults.freemint echo x - star-1.6/DEFAULTS_ENG/Defaults.syllable sed 's/^X//' >star-1.6/DEFAULTS_ENG/Defaults.syllable << 'END-of-star-1.6/DEFAULTS_ENG/Defaults.syllable' X#ident "@(#)Defaults.syllable 1.3 13/11/04 " X########################################################################### X# X# global definitions for Syllable Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### X#DEFCCOM= cc XDEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### X#CWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= /ainc XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib X X########################################################################### X# X# Installation config stuff X# X########################################################################### X#INS_BASE= /opt/schily X#INS_KBASE= / X#INS_RBASE= / XINS_BASE= /tmp/schily XINS_KBASE= /tmp/schily/root XINS_RBASE= /tmp/schily/root X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS_ENG/Defaults.syllable echo x - star-1.6/DEFAULTS_ENG/Defaults.haiku sed 's/^X//' >star-1.6/DEFAULTS_ENG/Defaults.haiku << 'END-of-star-1.6/DEFAULTS_ENG/Defaults.haiku' X#ident "@(#)Defaults.haiku 1.3 13/11/04 " X########################################################################### X# X# global definitions for Haiku Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### X#DEFCCOM= cc XDEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### X#CWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib X X########################################################################### X# X# Installation config stuff X# X########################################################################### X#INS_BASE= /opt/schily X#INS_KBASE= / X#INS_RBASE= / XINS_BASE= /tmp/schily XINS_KBASE= /tmp/schily/root XINS_RBASE= /tmp/schily/root X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS_ENG/Defaults.haiku echo x - star-1.6/DEFAULTS_ENG/vc7_64-cygwin-setup sed 's/^X//' >star-1.6/DEFAULTS_ENG/vc7_64-cygwin-setup << 'END-of-star-1.6/DEFAULTS_ENG/vc7_64-cygwin-setup' X# @(#)vc7_64-cygwin-setup 1.1 09/05/16 Copyright 2006 J. Schilling X X# X# Keep in sync with vc7_64-setup as we cannot rely on hard links X# X X# X# Disable warnings for nonportable variable assignements. X# We only use smake MS-WIN, so this is not a problem. X# X.NO_WARN: := X X# X# A German installation X# X#VSINSTALLDIR=C:\Programme\Microsoft Visual Studio 8 X#VSINS=/cygdrive/c/Programme/Microsoft Visual Studio 8 X X# X# An English installation on an English Windows XP 64 Bit host X# XVSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio 8 XVSINS=/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 8 X Xexport VSINSTALLDIR X XVCINSTALLDIR :=${VSINSTALLDIR}\VC Xexport VCINSTALLDIR X XPATH :=${VSINS}/VC/BIN/amd64:${VSINS}/Common7/IDE:${PATH} Xexport PATH X XINCLUDE :=${VCINSTALLDIR}\INCLUDE;${VCINSTALLDIR}\PlatformSDK\INCLUDE;${INCLUDE} Xexport INCLUDE X XLIB :=${VCINSTALLDIR}\LIB\amd64;${VCINSTALLDIR}\PlatformSDK\LIB\amd64;${LIB} Xexport LIB X XVC_SETUP=dummy-setup Xexport VC_SETUP X X# X# Re-enable all warnings. X# X.NO_WARN: END-of-star-1.6/DEFAULTS_ENG/vc7_64-cygwin-setup echo x - star-1.6/DEFAULTS_ENG/vc7_64-setup sed 's/^X//' >star-1.6/DEFAULTS_ENG/vc7_64-setup << 'END-of-star-1.6/DEFAULTS_ENG/vc7_64-setup' X# @(#)vc7_64-setup 1.1 09/05/16 Copyright 2006 J. Schilling X X# X# Keep in sync with vc7_64-cygwin-setup as we cannot rely on hard links X# X X# X# Disable warnings for nonportable variable assignements. X# We only use smake MS-WIN, so this is not a problem. X# X.NO_WARN: := X X# X# A German installation on a German Windows (32Bit) host, to be used X# for cross compiling stuff (no autoconf run) X# X#VSINSTALLDIR=C:\Programme\Microsoft Visual Studio 8 X#VSINS=/cygdrive/c/Programme/Microsoft Visual Studio 8 X X# X# An English installation on an English Windows XP 64 Bit host X# XVSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio 8 XVSINS=/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 8 X Xexport VSINSTALLDIR X XVCINSTALLDIR :=${VSINSTALLDIR}\VC Xexport VCINSTALLDIR X XPATH :=${VSINS}/VC/BIN/amd64:${VSINS}/Common7/IDE:${PATH} Xexport PATH X XINCLUDE :=${VCINSTALLDIR}\INCLUDE;${VCINSTALLDIR}\PlatformSDK\INCLUDE;${INCLUDE} Xexport INCLUDE X XLIB :=${VCINSTALLDIR}\LIB\amd64;${VCINSTALLDIR}\PlatformSDK\LIB\amd64;${LIB} Xexport LIB X XVC_SETUP=dummy-setup Xexport VC_SETUP X X# X# Re-enable all warnings. X# X.NO_WARN: END-of-star-1.6/DEFAULTS_ENG/vc7_64-setup echo x - star-1.6/DEFAULTS_ENG/Defaults.cygwin32_wow64 sed 's/^X//' >star-1.6/DEFAULTS_ENG/Defaults.cygwin32_wow64 << 'END-of-star-1.6/DEFAULTS_ENG/Defaults.cygwin32_wow64' X#ident "@(#)Defaults.cygwin32_wow64 1.7 17/07/09 " X########################################################################### X# X# global definitions for Cygnus GCC for WINNT Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### X#DEFCCOM= cc XDEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### X#CWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= X#LDPATH= -L/opt/schily/lib XLDPATH= X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= X X########################################################################### X# X# Installation config stuff X# X########################################################################### X#INS_BASE= /opt/schily X#INS_KBASE= / X#INS_RBASE= / XINS_BASE= /tmp/schily XINS_KBASE= /tmp/schily/root XINS_RBASE= /tmp/schily/root X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= root X X# X# This is not the correct place for doing this, X# the correct place is RULES/cc-msc.rul. X# We do it here because otherwise cc-config would not work. X# This kind of hack may not work for other platforms. X# X_PLATFORM= cygwin XVC=7 X X_VCNAME= $(_UNIQ)$(XMAKEPROG) X__VCNAME= $(_VCNAME:$(_UNIQ)=dummy) X___VCNAME= $(__VCNAME:$(_UNIQ)smake=vc$(VC)$(_PLATFORM:%=-%)) XVCNAME= $(___VCNAME:$(_UNIQ)%=dummy) X X_VC_SETUP= $(_UNIQ)$(VC_SETUP) X__VC_SETUP= $(_VC_SETUP:$(_UNIQ)=$(VCNAME)-setup) XVCSETUP= $(__VC_SETUP:$(_UNIQ)%=%) X X########################################################################### X# IMPORTANT Note: X# We also include $(DEFLTSROOT)/$(DEFLTSDIR)/$(VCSETUP) from RULES/cc-msc.rul X# in order to be able to test for the existence of "cl.exe" early. X########################################################################### Xinclude $(DEFLTSROOT)/$(DEFLTSDIR)/$(VCSETUP) END-of-star-1.6/DEFAULTS_ENG/Defaults.cygwin32_wow64 echo x - star-1.6/DEFAULTS_ENG/Defaults.openvms sed 's/^X//' >star-1.6/DEFAULTS_ENG/Defaults.openvms << 'END-of-star-1.6/DEFAULTS_ENG/Defaults.openvms' X#ident "@(#)Defaults.openvms 1.2 13/11/04 " X########################################################################### X# X# global definitions for OpenVMS X# X########################################################################### X# X# Compiler stuff X# X########################################################################### XDEFCCOM= cc X#DEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### X#CWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib X X########################################################################### X# X# Installation config stuff X# X########################################################################### XINS_BASE= /opt/schily XINS_KBASE= / XINS_RBASE= / X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS_ENG/Defaults.openvms echo x - star-1.6/DEFAULTS_ENG/vc9-cygwin-setup sed 's/^X//' >star-1.6/DEFAULTS_ENG/vc9-cygwin-setup << 'END-of-star-1.6/DEFAULTS_ENG/vc9-cygwin-setup' X# @(#)vc9-cygwin-setup 1.4 11/08/01 Copyright 2006-2011 J. Schilling X X# X# Keep in sync with vc9-cygwin-setup as we cannot rely on hard links X# X X# X# Disable warnings for nonportable variable assignements. X# We only use smake MS-WIN, so this is not a problem. X# X.NO_WARN: := X X# X# A German installation X# XVSINSTALLDIR=C:\Programme\Microsoft Visual Studio 9.0 XVSINS=/cygdrive/c/Programme/Microsoft Visual Studio 9.0 X X# X# An English installation X# XVSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio 9.0 XVSBASEDIR=C:\Program Files (x86) XVSINS=/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 9.0 X Xexport VSINSTALLDIR X XVCINSTALLDIR :=${VSINSTALLDIR}\VC Xexport VCINSTALLDIR X XPATH :=${VSINS}/VC/bin:${VSINS}/Common7/IDE:${PATH} Xexport PATH X X#INCLUDE :=${VCINSTALLDIR}\include;${VCINSTALLDIR}\PlatformSDK\INCLUDE;${INCLUDE} XINCLUDE :=${VCINSTALLDIR}\atlmfc\include;${VCINSTALLDIR}\include;${VSBASEDIR}\Microsoft SDKs\Windows\v5.0\include;C:\Program Files\\Microsoft SDKs\Windows\v6.0A\include;${INCLUDE} Xexport INCLUDE X X#LIB :=${VCINSTALLDIR}\lib;${VCINSTALLDIR}\PlatformSDK\LIB;${LIB} XLIB :=${VCINSTALLDIR}\atlmfc\lib;${VCINSTALLDIR}\lib;C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib;${LIB} Xexport LIB X XVC_SETUP=dummy-setup Xexport VC_SETUP X X# X# Re-enable all warnings. X# X.NO_WARN: END-of-star-1.6/DEFAULTS_ENG/vc9-cygwin-setup echo x - star-1.6/DEFAULTS_ENG/vc9-setup sed 's/^X//' >star-1.6/DEFAULTS_ENG/vc9-setup << 'END-of-star-1.6/DEFAULTS_ENG/vc9-setup' X# @(#)vc9-setup 1.3 11/08/01 Copyright 2006-2011 J. Schilling X X# X# Keep in sync with vc9-cygwin-setup as we cannot rely on hard links X# X X# X# Disable warnings for nonportable variable assignements. X# We only use smake MS-WIN, so this is not a problem. X# X.NO_WARN: := X X# X# A German installation X# XVSINSTALLDIR=C:\Programme\Microsoft Visual Studio 9.0 XVSINS=/cygdrive/c/Programme/Microsoft Visual Studio 9.0 X X# X# An English installation X# XVSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio 9.0 XVSBASEDIR=C:\Program Files (x86) XVSINS=/cygdrive/c/Program Files (x86)/Microsoft Visual Studio 9.0 X Xexport VSINSTALLDIR X XVCINSTALLDIR :=${VSINSTALLDIR}\VC Xexport VCINSTALLDIR X XPATH :=${VSINS}/VC/bin:${VSINS}/Common7/IDE:${PATH} Xexport PATH X X#INCLUDE :=${VCINSTALLDIR}\include;${VCINSTALLDIR}\PlatformSDK\INCLUDE;${INCLUDE} XINCLUDE :=${VCINSTALLDIR}\atlmfc\include;${VCINSTALLDIR}\include;${VSBASEDIR}\Microsoft SDKs\Windows\v5.0\include;C:\Program Files\\Microsoft SDKs\Windows\v6.0A\include;${INCLUDE} Xexport INCLUDE X X#LIB :=${VCINSTALLDIR}\lib;${VCINSTALLDIR}\PlatformSDK\LIB;${LIB} XLIB :=${VCINSTALLDIR}\atlmfc\lib;${VCINSTALLDIR}\lib;C:\Program Files\\Microsoft SDKs\Windows\v6.0A\lib;${LIB} Xexport LIB X XVC_SETUP=dummy-setup Xexport VC_SETUP X X# X# Re-enable all warnings. X# X.NO_WARN: END-of-star-1.6/DEFAULTS_ENG/vc9-setup echo x - star-1.6/DEFAULTS_ENG/Defaults.gnu-kfreebsd sed 's/^X//' >star-1.6/DEFAULTS_ENG/Defaults.gnu-kfreebsd << 'END-of-star-1.6/DEFAULTS_ENG/Defaults.gnu-kfreebsd' X#ident "@(#)Defaults.gnu-kfreebsd 1.2 13/11/04 " X########################################################################### X# X# global definitions for Linux kfreebsd Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### XDEFCCOM= cc X#DEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### X#CWARNOPTS= X X########################################################################### X# X# LINUX_SRC_INCLUDE is used in RULES/*-linux-*cc*.rul X# X########################################################################### XLINUX_INCL_PATH= /usr/src/linux/include X X_LINUX_SRC_INCLUDE= $(_UNIQ)$(MAY_LINUX_SRC_INCLUDE) X__LINUX_SRC_INCLUDE= $(_LINUX_SRC_INCLUDE:$(_UNIQ)=$(LINUX_INCL_PATH)) XLINUX_SRC_INCLUDE= $(__LINUX_SRC_INCLUDE:$(_UNIQ)no%=%) X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib X X########################################################################### X# X# Unhide POSIX extensions from /usr/include/ X# X########################################################################### XOSDEFS += -D_GNU_SOURCE X X########################################################################### X# X# Installation config stuff X# X########################################################################### X#INS_BASE= /opt/schily X#INS_KBASE= / X#INS_RBASE= / XINS_BASE= /tmp/schily XINS_KBASE= /tmp/schily/root XINS_RBASE= /tmp/schily/root X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS_ENG/Defaults.gnu-kfreebsd echo x - star-1.6/DEFAULTS_ENG/Defaults.pyro sed 's/^X//' >star-1.6/DEFAULTS_ENG/Defaults.pyro << 'END-of-star-1.6/DEFAULTS_ENG/Defaults.pyro' X#ident "@(#)Defaults.pyro 1.2 13/11/04 " X########################################################################### X# X# global definitions for Pyro Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### X#DEFCCOM= cc XDEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### X#CWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= /boot/Include XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib X X########################################################################### X# X# Installation config stuff X# X########################################################################### X#INS_BASE= /opt/schily X#INS_KBASE= / X#INS_RBASE= / XINS_BASE= /tmp/schily XINS_KBASE= /tmp/schily/admin XINS_RBASE= /tmp/schily/admin X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= admin XDEFINSGRP= bin END-of-star-1.6/DEFAULTS_ENG/Defaults.pyro echo x - star-1.6/DEFAULTS_ENG/Defaults.cygwin32_wow sed 's/^X//' >star-1.6/DEFAULTS_ENG/Defaults.cygwin32_wow << 'END-of-star-1.6/DEFAULTS_ENG/Defaults.cygwin32_wow' X#ident "@(#)Defaults.cygwin32_wow 1.2 17/07/09 " X########################################################################### X# X# global definitions for Cygnus GCC for WINNT Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### X#DEFCCOM= cc XDEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### X#CWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= X#LDPATH= -L/opt/schily/lib XLDPATH= X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= X X########################################################################### X# X# Installation config stuff X# X########################################################################### X#INS_BASE= /opt/schily X#INS_KBASE= / X#INS_RBASE= / XINS_BASE= /tmp/schily XINS_KBASE= /tmp/schily/root XINS_RBASE= /tmp/schily/root X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= root X X# X# This is not the correct place for doing this, X# the correct place is RULES/cc-msc.rul. X# We do it here because otherwise cc-config would not work. X# This kind of hack may not work for other platforms. X# X_PLATFORM= cygwin XVC=7 X X_VCNAME= $(_UNIQ)$(XMAKEPROG) X__VCNAME= $(_VCNAME:$(_UNIQ)=dummy) X___VCNAME= $(__VCNAME:$(_UNIQ)smake=vc$(VC)$(_PLATFORM:%=-%)) XVCNAME= $(___VCNAME:$(_UNIQ)%=dummy) X X_VC_SETUP= $(_UNIQ)$(VC_SETUP) X__VC_SETUP= $(_VC_SETUP:$(_UNIQ)=$(VCNAME)-setup) XVCSETUP= $(__VC_SETUP:$(_UNIQ)%=%) X X########################################################################### X# IMPORTANT Note: X# We also include $(DEFLTSROOT)/$(DEFLTSDIR)/$(VCSETUP) from RULES/cc-msc.rul X# in order to be able to test for the existence of "cl.exe" early. X########################################################################### Xinclude $(DEFLTSROOT)/$(DEFLTSDIR)/$(VCSETUP) END-of-star-1.6/DEFAULTS_ENG/Defaults.cygwin32_wow echo x - star-1.6/DEFAULTS_ENG/Defaults.bitrig sed 's/^X//' >star-1.6/DEFAULTS_ENG/Defaults.bitrig << 'END-of-star-1.6/DEFAULTS_ENG/Defaults.bitrig' X#ident "@(#)Defaults.bitrig 1.1 15/10/08 " X########################################################################### X# X# global definitions for Bitrig Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### XDEFCCOM= clang X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### X#CWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) Will probably not work X X########################################################################### X# X# Installation config stuff X# X########################################################################### X#INS_BASE= /opt/schily X#INS_KBASE= / X#INS_RBASE= / XINS_BASE= /tmp/schily XINS_KBASE= /tmp/schily/root XINS_RBASE= /tmp/schily/root X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS_ENG/Defaults.bitrig echo x - star-1.6/DEFAULTS_ENG/Defaults.minix sed 's/^X//' >star-1.6/DEFAULTS_ENG/Defaults.minix << 'END-of-star-1.6/DEFAULTS_ENG/Defaults.minix' X#ident "@(#)Defaults.minix 1.1 15/11/08 " X########################################################################### X# X# global definitions for Minix Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### XDEFCCOM= clang X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### X#CWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) Will probably not work X X########################################################################### X# X# Installation config stuff X# X########################################################################### X#INS_BASE= /opt/schily X#INS_KBASE= / X#INS_RBASE= / XINS_BASE= /tmp/schily XINS_KBASE= /tmp/schily/root XINS_RBASE= /tmp/schily/root X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS_ENG/Defaults.minix echo x - star-1.6/DEFAULTS_ENG/Defaults.os400 sed 's/^X//' >star-1.6/DEFAULTS_ENG/Defaults.os400 << 'END-of-star-1.6/DEFAULTS_ENG/Defaults.os400' X#ident "@(#)Defaults.os400 1.1 18/09/19 " X########################################################################### X# X# global definitions for IBM OS400 Systems X# X########################################################################### X# X# Compiler stuff X# X########################################################################### X#DEFCCOM= cc XDEFCCOM= gcc X X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### X#CWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib -R$(OLIBSDIR) XRUNPATH= -R$(INS_BASE)/lib -R/opt/schily/lib X X########################################################################### X# X# Installation config stuff X# X########################################################################### X#INS_BASE= /opt/schily X#INS_KBASE= / X#INS_RBASE= / XINS_BASE= /tmp/schily XINS_KBASE= /tmp/schily/root XINS_RBASE= /tmp/schily/root X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= root XDEFINSGRP= bin END-of-star-1.6/DEFAULTS_ENG/Defaults.os400 echo c - star-1.6/include mkdir -p star-1.6/include > /dev/null 2>&1 echo x - star-1.6/include/Makefile sed 's/^X//' >star-1.6/include/Makefile << 'END-of-star-1.6/include/Makefile' X#ident %W% %E% %Q% X########################################################################### X# Sample makefile for sub directory makes X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XDIRS= schily X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.dir X########################################################################### END-of-star-1.6/include/Makefile echo c - star-1.6/include/schily mkdir -p star-1.6/include/schily > /dev/null 2>&1 echo x - star-1.6/include/schily/fnmatch.h sed 's/^X//' >star-1.6/include/schily/fnmatch.h << 'END-of-star-1.6/include/schily/fnmatch.h' X/* @(#)fnmatch.h 8.13 10/10/09 Copyright 2006-2010 J. Schilling from 8.1 (Berkeley) */ X X#ifndef _SCHILY_FNMATCH_H X#define _SCHILY_FNMATCH_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifdef HAVE_FNMATCH_H X#include X#else /* !HAVE_FNMATCH_H */ X X#ifdef __cplusplus Xextern "C" { X#endif X Xextern int fnmatch __PR((const char *, const char *, int)); X X#ifdef __cplusplus X} X#endif X X#endif /* !HAVE_FNMATCH */ X X/* X * Copyright (c) 1992, 1993 X * The Regents of the University of California. All rights reserved. X * X * Redistribution and use in source and binary forms, with or without X * modification, are permitted provided that the following conditions X * are met: X * 1. Redistributions of source code must retain the above copyright X * notice, this list of conditions and the following disclaimer. X * 2. Redistributions in binary form must reproduce the above copyright X * notice, this list of conditions and the following disclaimer in the X * documentation and/or other materials provided with the distribution. X * 3. Neither the name of the University nor the names of its contributors X * may be used to endorse or promote products derived from this software X * without specific prior written permission. X * X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE X * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF X * SUCH DAMAGE. X * X * @(#)fnmatch.h 8.13 (Berkeley) 10/09/10 X */ X X#ifdef __cplusplus Xextern "C" { X#endif X X#ifndef FNM_NOMATCH X#define FNM_NOMATCH 1 /* Match failed. */ X#endif X#ifndef FNM_ERROR X#define FNM_ERROR 2 /* An error occured */ X#endif X#ifndef FNM_NOSYS X#define FNM_NOSYS 3 /* Function (XPG4) not supported */ X#endif X X#ifndef FNM_NOESCAPE X#define FNM_NOESCAPE 0x01 /* Disable backslash escaping. */ X#endif X#ifndef FNM_PATHNAME X#define FNM_PATHNAME 0x02 /* Slash must be matched by slash. */ X#endif X#ifndef FNM_PERIOD X#define FNM_PERIOD 0x04 /* Period must be matched by period. */ X#endif X#if !defined(FNM_IGNORECASE) && !defined(FNM_CASEFOLD) X#define FNM_IGNORECASE 0x10 /* Ignore case when making comparisons */ X#endif X#if !defined(FNM_IGNORECASE) && defined(FNM_CASEFOLD) X#define FNM_IGNORECASE FNM_CASEFOLD X#endif X#ifndef FNM_CASEFOLD X#define FNM_CASEFOLD FNM_IGNORECASE X#endif X#ifndef FNM_LEADING_DIR X#define FNM_LEADING_DIR 0x20 /* Ignore / after Imatch. */ X#endif X Xextern int js_fnmatch __PR((const char *, const char *, int)); X X#if !defined(HAVE_FNMATCH_IGNORECASE) X#define fnmatch js_fnmatch X#endif X X#ifdef __cplusplus X} X#endif X X#endif /* !_SCHILY_FNMATCH_H */ END-of-star-1.6/include/schily/fnmatch.h echo x - star-1.6/include/schily/dirent.h sed 's/^X//' >star-1.6/include/schily/dirent.h << 'END-of-star-1.6/include/schily/dirent.h' X/* @(#)dirent.h 1.29 11/08/04 Copyright 1987, 1998, 2000-2011 J. Schilling */ X/* X * Copyright (c) 1987, 1998, 2000-2011 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_DIRENT_H X#define _SCHILY_DIRENT_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifdef __cplusplus Xextern "C" { X#endif X X#ifdef JOS X# ifdef HAVE_SYS_STYPES_H X# ifndef _INCL_SYS_STYPES_H X# include X# define _INCL_SYS_STYPES_H X# endif X# endif X# ifdef HAVE_SYS_FILEDESC_H X# ifndef _INCL_SYS_FILEDESC_H X# include X# define _INCL_SYS_FILEDESC_H X# endif X# endif X# define NEED_READDIR X# define dirent _direct X# define DIR_NAMELEN(dirent) strlen((dirent)->d_name) X# define DIRSIZE 30 X# define FOUND_DIRSIZE X typedef struct _dirent { X char name[DIRSIZE]; X short ino; X } dirent; X X#else /* !JOS */ X X# ifndef _SCHILY_TYPES_H X# include X# endif X# ifndef _SCHILY_STAT_H X# include X# endif X# ifndef _SCHILY_LIMITS_H X# include X# endif X# ifndef _SCHILY_PARAM_H X# include X# endif X# ifndef _SCHILY_STDLIB_H X# include /* MSVC: get _MAX_DIR */ X# endif X X# ifdef HAVE_DIRENT_H /* This a POSIX compliant system */ X# ifndef _INCL_DIRENT_H X# include X# define _INCL_DIRENT_H X# endif X# define DIR_NAMELEN(dirent) strlen((dirent)->d_name) X# define _FOUND_DIR_ X# else /* This is a Pre POSIX system */ X X# define dirent direct X# define DIR_NAMELEN(dirent) (dirent)->d_namlen X X# if defined(HAVE_SYS_DIR_H) X# ifndef _INCL_SYS_DIR_H X# include X# define _INCL_SYS_DIR_H X# endif X# define _FOUND_DIR_ X# endif X X# if defined(HAVE_NDIR_H) && !defined(_FOUND_DIR_) X# ifndef _INCL_NDIR_H X# include X# define _INCL_NDIR_H X# endif X# define _FOUND_DIR_ X# endif X X# if defined(HAVE_SYS_NDIR_H) && !defined(_FOUND_DIR_) X# ifndef _INCL_SYS_NDIR_H X# include X# define _INCL_SYS_NDIR_H X# endif X# define _FOUND_DIR_ X# endif X# endif /* HAVE_DIRENT_H */ X X# if defined(_FOUND_DIR_) X/* X * Don't use defaults here to allow recognition of problems. X */ X# if !defined(FOUND_DIRSIZE) && defined(MAXNAMELEN) X# define DIRSIZE MAXNAMELEN /* From sys/param.h */ X# define FOUND_DIRSIZE X# endif X X# if !defined(FOUND_DIRSIZE) && defined(MAXNAMLEN) X# define DIRSIZE MAXNAMLEN /* From dirent.h */ X# define FOUND_DIRSIZE X# endif X X# ifdef __never__ X /* X * DIRSIZ(dp) is a parameterized macro, we cannot use it here. X */ X# if !defined(FOUND_DIRSIZE) && defined(DIRSIZ) X# define DIRSIZE DIRSIZ /* From sys/dir.h */ X# define FOUND_DIRSIZE X# endif X# endif /* __never__ */ X X# if !defined(FOUND_DIRSIZE) && defined(NAME_MAX) X# define DIRSIZE NAME_MAX /* From limits.h */ X# define FOUND_DIRSIZE X# endif X X# else /* !_FOUND_DIR_ */ X X# if !defined(FOUND_DIRSIZE) && defined(_MAX_DIR) X# if defined(__MINGW32__) || defined(_MSC_VER) X# define DIRSIZE _MAX_DIR /* From stdlib.h */ X# define FOUND_DIRSIZE X# define NEED_READDIR X# undef dirent X# define dirent _direct X# undef DIR_NAMELEN X# define DIR_NAMELEN(dirent) strlen((dirent)->d_name) X# endif X# endif X X# ifndef NEED_READDIR X# define NEED_DIRENT X# define NEED_READDIR X# undef dirent X# define dirent _direct X# undef DIR_NAMELEN X# define DIR_NAMELEN(dirent) strlen((dirent)->d_name) X# endif /* !NEED_READDIR */ X X# endif /* _FOUND_DIR_ */ X X X#ifdef NEED_DIRENT X X#ifndef FOUND_DIRSIZE X#define DIRSIZE 14 /* The old UNIX standard value */ X#define FOUND_DIRSIZE X#endif X Xtypedef struct _dirent { X short ino; X char name[DIRSIZE]; X} dirent; X X#endif /* NEED_DIRENT */ X X#endif /* !JOS */ X X#ifdef NEED_READDIR X X#ifndef _SCHILY_STDIO_H X#include X#endif X#if defined(__MINGW32__) || defined(_MSC_VER) X#ifndef _SCHILY_IO_H X#include /* for _findfirst() */ X#endif X#ifndef _SCHILY_UTYPES_H X#include X#endif X#endif X X struct _direct { X unsigned long d_ino; X unsigned short d_reclen; X unsigned short d_namlen; X char d_name[DIRSIZE +1]; X }; X#define HAVE_DIRENT_D_INO X X typedef struct __dirdesc { X FILE *dd_fd; X X#if defined(__MINGW32__) || defined(_MSC_VER) X struct _direct dd_dir; /* dirent for this dir */ X struct _finddata_t dd_data; /* _findnext() results */ X intptr_t dd_handle; /* _findnext() handle */ X int dd_state; /* Current Dir state */ X char dd_dirname[1]; /* Dir to open */ X#endif X } DIR; X Xextern DIR *opendir __PR((const char *)); Xextern int closedir __PR((DIR *)); Xextern struct dirent *readdir __PR((DIR *)); X X#endif /* NEED_READDIR */ X X#if !defined(HAVE_DIRFD) && defined(HAVE_DIR_DD_FD) X# define dirfd(dirp) ((dirp)->dd_fd) X#endif X X#ifdef __cplusplus X} X#endif X X#endif /* _SCHILY_DIRENT_H */ END-of-star-1.6/include/schily/dirent.h echo x - star-1.6/include/schily/btorder.h sed 's/^X//' >star-1.6/include/schily/btorder.h << 'END-of-star-1.6/include/schily/btorder.h' X/* @(#)btorder.h 1.22 12/12/03 Copyright 1996-2012 J. Schilling */ X/* X * Definitions for Bit and Byte ordering X * X * Copyright (c) 1996-2012 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X X#ifndef _SCHILY_BTORDER_H X#define _SCHILY_BTORDER_H X X#ifndef _SCHILY_MCONFIG_H X#include /* load bit/byte-oder from xmconfig.h */ X#endif X X#ifndef _SCHILY_TYPES_H X#include /* try to load isa_defs.h on Solaris */ X#endif X X#ifdef __cplusplus Xextern "C" { X#endif X X/* X * Convert bit-order definitions from xconfig.h into our values X * and verify them. X */ X#if defined(HAVE_C_BITFIELDS) && \ X defined(BITFIELDS_LTOH) X#define _BIT_FIELDS_LTOH X#endif X X#if defined(HAVE_C_BITFIELDS) && \ X defined(BITFIELDS_HTOL) X#define _BIT_FIELDS_HTOL X#endif X X#if defined(HAVE_C_BITFIELDS) && \ X !defined(BITFIELDS_HTOL) X#define BITFIELDS_LTOH X#define _BIT_FIELDS_LTOH X#endif X X#if defined(_BIT_FIELDS_LTOH) && defined(_BIT_FIELDS_HTOL) X/* X * #error will not work for all compilers (e.g. sunos4) X * The following line will abort compilation on all compilers X * if none of the above is defined. And that's what we want. X */ Xerror Only one of _BIT_FIELDS_LTOH or _BIT_FIELDS_HTOL may be defined X X#include /* Avoid "unknown directive" with K&R */ X#endif X X X/* X * Convert byte-order definitions from xconfig.h into our values X * and verify them. X * Note that we cannot use the definitions _LITTLE_ENDIAN and _BIG_ENDIAN X * because they are used on IRIX-6.5 with different meaning. X */ X#if defined(HAVE_C_BIGENDIAN) && \ X !defined(WORDS_BIGENDIAN) X#define WORDS_LITTLEENDIAN X/* #define _LITTLE_ENDIAN */ X#endif X X#if defined(HAVE_C_BIGENDIAN) && \ X defined(WORDS_BIGENDIAN) X#undef WORDS_LITTLEENDIAN X/* #define _BIG_ENDIAN */ X#endif X X#if defined(_BIT_FIELDS_LTOH) || defined(_BIT_FIELDS_HTOL) X/* X * Bitorder is already known. X */ X#else X/* X * Bitorder not yet known. X */ X# if defined(sun3) || defined(mc68000) || \ X defined(sun4) || defined(__sparc) || defined(sparc) || \ X defined(__hppa) || defined(_ARCH_PPC) || defined(_IBMR2) X# define _BIT_FIELDS_HTOL X# endif X X# if defined(__sgi) && defined(__mips) X# define _BIT_FIELDS_HTOL X# endif X X# if defined(__i386__) || defined(__i386) || defined(i386) || \ X defined(__alpha__) || defined(__alpha) || defined(alpha) || \ X defined(__arm__) || defined(__arm) || defined(arm) X# define _BIT_FIELDS_LTOH X# endif X X# if defined(__ppc__) || defined(ppc) || defined(__ppc) || \ X defined(__PPC) || defined(powerpc) || defined(__powerpc__) X X# if defined(__BIG_ENDIAN__) X# define _BIT_FIELDS_HTOL X# else X# define _BIT_FIELDS_LTOH X# endif X# endif X#endif X X#ifdef __cplusplus X} X#endif X X#endif /* _SCHILY_BTORDER_H */ END-of-star-1.6/include/schily/btorder.h echo x - star-1.6/include/schily/ccomdefs.h sed 's/^X//' >star-1.6/include/schily/ccomdefs.h << 'END-of-star-1.6/include/schily/ccomdefs.h' X/* @(#)ccomdefs.h 1.12 11/07/21 Copyright 2000-2011 J. Schilling */ X/* X * Various compiler dependant macros. X * X * Copyright (c) 2000-2011 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_CCOMDEFS_H X#define _SCHILY_CCOMDEFS_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifdef __cplusplus Xextern "C" { X#endif X X/* X * Compiler-dependent macros to declare that functions take printf-like X * or scanf-like arguments. They are defined to nothing for versions of gcc X * that are not known to support the features properly (old versions of gcc-2 X * didn't permit keeping the keywords out of the application namespace). X */ X#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7) || \ X defined(NO_PRINTFLIKE) X X#define __printflike__(fmtarg, firstvararg) X#define __printf0like__(fmtarg, firstvararg) X#define __scanflike__(fmtarg, firstvararg) X X#else /* We found GCC that supports __attribute__ */ X X#define __printflike__(fmtarg, firstvararg) \ X __attribute__((__format__(__printf__, fmtarg, firstvararg))) X#define __printf0like__(fmtarg, firstvararg) \ X __attribute__((__format__(__printf0__, fmtarg, firstvararg))) X X/* X * FreeBSD GCC implements printf0 that allows the format string to X * be a NULL pointer. X */ X#if __FreeBSD_cc_version < 300001 X#undef __printf0like__ X#define __printf0like__ __printflike__ X#endif X X#define __scanflike__(fmtarg, firstvararg) \ X __attribute__((__format__(__scanf__, fmtarg, firstvararg))) X X#endif /* GNUC */ X X#if __GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ > 2 X/* GCC-3.3 or more */ X X/* CSTYLED */ X#define UConst __attribute__ ((__used__)) const X X#else /* less than GNUC 3.3 */ X X#define UConst const X X#endif /* less than GNUC 3.3 */ X X#ifdef __PCC__ X/* X * Hack until pcc supports __attribute__ ((__used__)) X */ X#ifdef UConst X#undef UConst X#define UConst const X#endif X#endif X X#ifdef __cplusplus X} X#endif X X#endif /* _SCHILY_CCOMDEFS_H */ END-of-star-1.6/include/schily/ccomdefs.h echo x - star-1.6/include/schily/deflts.h sed 's/^X//' >star-1.6/include/schily/deflts.h << 'END-of-star-1.6/include/schily/deflts.h' X/* @(#)deflts.h 1.9 11/11/24 Copyright 1997-2011 J. Schilling */ X/* X * Definitions for reading program defaults. X * X * Copyright (c) 1997-2011 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_DEFLTS_H X#define _SCHILY_DEFLTS_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifdef __cplusplus Xextern "C" { X#endif X X#define DEFLT "/etc/default" X X/* X * cmd's to defltcntl() X */ X#define DC_GETFLAGS 0 /* Get actual flags */ X#define DC_SETFLAGS 1 /* Set new flags */ X X/* X * flags to defltcntl() X * X * Make sure that when adding features, the default behaviour X * is the same as old behaviour. X */ X#define DC_CASE 0x0001 /* Don't ignore case */ X X#define DC_STD DC_CASE /* Default flags */ X X/* X * Macros to handle flags X */ X#ifndef TURNON X#define TURNON(flags, mask) flags |= mask X#define TURNOFF(flags, mask) flags &= ~(mask) X#define ISON(flags, mask) (((flags) & (mask)) == (mask)) X#define ISOFF(flags, mask) (((flags) & (mask)) != (mask)) X#endif X Xextern int defltopen __PR((const char *name)); Xextern int defltclose __PR((void)); Xextern int defltsect __PR((const char *name)); Xextern int defltfirst __PR((void)); Xextern char *defltread __PR((const char *name)); Xextern char *defltnext __PR((const char *name)); Xextern int defltcntl __PR((int cmd, int flags)); X X#ifdef __cplusplus X} X#endif X X#endif /* _SCHILY_DEFLTS_H */ END-of-star-1.6/include/schily/deflts.h echo x - star-1.6/include/schily/device.h sed 's/^X//' >star-1.6/include/schily/device.h << 'END-of-star-1.6/include/schily/device.h' X/* @(#)device.h 1.20 17/10/07 Copyright 1995-2017 J. Schilling */ X/* X * Generic header for users of major(), minor() and makedev() X * X * Copyright (c) 1995-2017 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_DEVICE_H X#define _SCHILY_DEVICE_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X/* X * On generic SVR4, major is a function (defined in sys/mkdev.h). X * On Solaris it is defined ... X * As we cannot just test if major is #define'd, we have to X * define _FOUND_MAJOR_ instead. X * X * WARNING: Do never include in SVR4, it contains X * an old definition for major()/minor() defining 8 minorbits. X * Use instead. X */ X#ifndef _SCHILY_TYPES_H X#include X#endif X#ifndef _SCHILY_STDINT_H X#include X#endif X X/* X * Some systems define major in . X * We are ready... X */ X#ifdef major X# define _FOUND_MAJOR_ X#endif X X#ifdef MAJOR_IN_MKDEV X# ifndef _INCL_SYS_MKDEV_H X# include X# define _INCL_SYS_MKDEV_H X# endif X /* X * Interix doesn't use makedev(); it uses mkdev() X */ X# if !defined(makedev) && defined(mkdev) X# define makedev(a, b) mkdev((a), (b)) X# endif X# define _FOUND_MAJOR_ X#endif X X#ifndef _FOUND_MAJOR_ X# ifdef MAJOR_IN_SYSMACROS X# ifndef _INCL_SYS_SYSMACROS_H X# include X# define _INCL_SYS_SYSMACROS_H X# endif X# define _FOUND_MAJOR_ X# endif X#endif X X/* X * If we are on HP/UX before HP/UX 8, X * major/minor are not in . X */ X#ifndef _FOUND_MAJOR_ X# if defined(hpux) || defined(__hpux__) || defined(__hpux) X# ifndef _INCL_SYS_MKOD_H X# include X# define _INCL_SYS_MKOD_H X# endif X# define _FOUND_MAJOR_ X# endif X#endif X X#ifndef _FOUND_MAJOR_ X# ifdef VMS X# define major(dev) (((((long)dev) >> 8) & 0xFF)) X# define minor(dev) ((((long)dev) & 0xFF)) X# define makedev(majo, mino) (((majo) << 8) | (mino)) X# define _FOUND_MAJOR_ X# endif /* VMS */ X#endif /* _FOUND_MAJOR_ */ X X#ifdef __cplusplus Xextern "C" { X#endif X X/* X * For all other systems define major()/minor() here. X * XXX Check if this definition will be usefull for ms dos too. X */ X#ifndef _FOUND_MAJOR_ X# define major(dev) (((dev) >> 8) & 0xFF) X# define minor(dev) ((dev) & 0xFF) X# define makedev(majo, mino) (((majo) << 8) | (mino)) X#endif X X/* X * Don't pollute namespace... X */ X#undef _FOUND_MAJOR_ X X#ifdef __XDEV__ X/* X * The following defines are currently only needed for 'star'. X * We make it conditional code to avoid to pollute the namespace. X */ X#define XDEV_T Ullong X Xextern int minorbits; Xextern XDEV_T minormask; Xextern XDEV_T _dev_mask[]; X X#define dev_major(dev) (((XDEV_T)(dev)) >> minorbits) X#define _dev_major(mbits, dev) (((XDEV_T)(dev)) >> (mbits)) X X#define dev_minor(dev) (((XDEV_T)(dev)) & minormask) X#define _dev_minor(mbits, dev) (((XDEV_T)(dev)) & _dev_mask[(mbits)]) X X X#define dev_make(majo, mino) ((((XDEV_T)(majo)) << minorbits) | \ X ((XDEV_T)(mino))) X#define _dev_make(mbits, majo, mino) ((((XDEV_T)(majo)) << (mbits)) | \ X ((XDEV_T)(mino))) X Xextern void dev_init __PR((BOOL debug)); X#ifndef dev_major Xextern XDEV_T dev_major __PR((XDEV_T dev)); Xextern XDEV_T _dev_major __PR((int mbits, XDEV_T dev)); Xextern XDEV_T dev_minor __PR((XDEV_T dev)); Xextern XDEV_T _dev_minor __PR((int mbits, XDEV_T dev)); Xextern XDEV_T dev_make __PR((XDEV_T majo, XDEV_T mino)); Xextern XDEV_T _dev_make __PR((int mbits, XDEV_T majo, XDEV_T mino)); X#endif X X#endif /* __XDEV__ */ X X#ifdef __cplusplus X} X#endif X X#endif /* _SCHILY_DEVICE_H */ END-of-star-1.6/include/schily/device.h echo x - star-1.6/include/schily/fcntl.h sed 's/^X//' >star-1.6/include/schily/fcntl.h << 'END-of-star-1.6/include/schily/fcntl.h' X/* @(#)fcntl.h 1.21 18/07/15 Copyright 1996-2018 J. Schilling */ X/* X * Generic header for users of open(), creat() and chmod() X * X * Copyright (c) 1996-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_FCNTL_H X#define _SCHILY_FCNTL_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifndef _SCHILY_TYPES_H X#include /* Needed for fcntl.h */ X#endif X X#ifndef _SCHILY_STAT_H X#include /* For 3rd arg of open() and chmod() */ X#endif X X#ifdef HAVE_SYS_FILE_H X/* X * Historical systems with flock() only need sys/file.h X */ X# ifndef _INCL_SYS_FILE_H X# include X# define _INCL_SYS_FILE_H X# endif X#endif X#ifdef HAVE_FCNTL_H X# ifndef _INCL_FCNTL_H X# include X# define _INCL_FCNTL_H X#endif X#endif X X/* X * Do not define more than O_RDONLY / O_WRONLY / O_RDWR / O_BINARY X * The values may differ. X * X * O_BINARY is defined here to allow all applications to compile on a non DOS X * environment without repeating this definition. X * O_SEARCH, O_DIRECTORY and NOFOLLOW are defined here to allow to compile on X * older platforms. X * open(name, O_SEARCH) is like UNOS open(name, "") (open neither for read nor X * for write). This allows to call fstat() and to get an fd for openat(fd, ...) X */ X#ifndef O_RDONLY X# define O_RDONLY 0 X#endif X#ifndef O_WRONLY X# define O_WRONLY 1 X#endif X#ifndef O_RDWR X# define O_RDWR 2 X#endif X#ifndef O_BINARY /* Only present on DOS or similar */ X# define O_BINARY 0 X#endif X#ifndef O_NDELAY /* This is undefined on BeOS :-( */ X# define O_NDELAY 0 X#endif X#ifndef O_EXEC /* Open for exec only (non-directory) */ X# define O_EXEC O_RDONLY X#endif X#ifndef O_SEARCH /* Open for search only. */ X/* X * O_SEARCH is in POSIX.1-2008, but Linux added O_PATH in 2011 X * so Linux people do not seem to read the standard. X */ X#ifdef O_PATH X# define O_SEARCH O_PATH /* Linux O_PATH is similar */ X#else X# define O_SEARCH O_RDONLY X#endif X#endif X#ifndef O_DIRECTORY /* Fail if not a directory */ X# define O_DIRECTORY 0 X#endif X#ifndef O_NOFOLLOW /* Fail if a symlink */ X# define O_NOFOLLOW 0 X#endif X X#ifndef O_ACCMODE X#define O_ACCMODE (O_RDONLY|O_WRONLY|O_RDWR|O_EXEC|O_SEARCH) X#endif X X#ifdef O_NOATIME /* Allow #ifdef O_NOATIME */ X#define _O_NOATIME O_NOATIME X#else X#define _O_NOATIME 0 X#endif X X#ifndef FD_CLOEXEC X#define FD_CLOEXEC 1 /* close on exec flag */ X#endif X X/* X * The following definitions are used for emulating the *at() functions. X * We use higher numbers for our definitions, to allow to add emulations X * for missing functions without causing a clash with system definitions. X */ X#ifndef HAVE_OPENAT X#ifndef AT_FDCWD X#define AT_FDCWD 0xffd19553 /* *at() to working dir */ X#endif X#endif X#ifndef HAVE_FSTATAT X#ifndef AT_SYMLINK_NOFOLLOW X#define AT_SYMLINK_NOFOLLOW 0x10000 /* emulate lstat() */ X#endif X#endif X#ifndef HAVE_UNLINKAT X#ifndef AT_REMOVEDIR X#define AT_REMOVEDIR 0x20000 /* emulate rmdir() */ X#endif X#endif X#ifndef HAVE_FACCESSAT X#ifndef AT_EACCESS X#define AT_EACCESS 0x40000 /* EUID access() */ X#endif X#endif X#ifndef HAVE_LINKAT X#ifndef AT_SYMLINK_FOLLOW X#define AT_SYMLINK_FOLLOW 0x80000 /* follow symlinks before link() */ X#endif X#endif X X#endif /* _SCHILY_FCNTL_H */ END-of-star-1.6/include/schily/fcntl.h echo x - star-1.6/include/schily/mman.h sed 's/^X//' >star-1.6/include/schily/mman.h << 'END-of-star-1.6/include/schily/mman.h' X/* @(#)mman.h 1.4 07/01/16 Copyright 2001-2007 J. Schilling */ X/* X * Definitions to be used for mmap() X * X * Copyright (c) 2001-2007 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_MMAN_H X#define _SCHILY_MMAN_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifndef _SCHILY_TYPES_H X#include X#endif X X#if defined(HAVE_SMMAP) X X#ifndef _INCL_SYS_MMAN_H X#include X#define _INCL_SYS_MMAN_H X#endif X X#ifndef MAP_ANONYMOUS X# ifdef MAP_ANON X# define MAP_ANONYMOUS MAP_ANON X# endif X#endif X X#ifndef MAP_FILE X# define MAP_FILE 0 /* Needed on Apollo Domain/OS */ X#endif X X/* X * Needed for Apollo Domain/OS and may be for others? X */ X#ifdef _MMAP_WITH_SIZEP X# define mmap_sizeparm(s) (&(s)) X#else X# define mmap_sizeparm(s) (s) X#endif X X#endif /* defined(HAVE_SMMAP) */ X X#endif /* _SCHILY_MMAN_H */ END-of-star-1.6/include/schily/mman.h echo x - star-1.6/include/schily/getargs.h sed 's/^X//' >star-1.6/include/schily/getargs.h << 'END-of-star-1.6/include/schily/getargs.h' X/* @(#)getargs.h 1.23 17/09/19 Copyright 1985-2017 J. Schilling */ X/* X * Definitions for getargs()/getallargs()/getfiles() X * X * Copyright (c) 1985-2017 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_GETARGS_H X#define _SCHILY_GETARGS_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X#ifndef _SCHILY_UTYPES_H X#include X#endif X X#ifdef __cplusplus Xextern "C" { X#endif X X/* X * Return values for get*args()/get*files() X * X * This package calls options "flags", they are returned from get*args(). X * X * Note that NOTAFILE is not returned by the interface functions. X * NOTAFILE is however used as return code from the user's callback functions X * to signal that the current arg may be an option the callback function does X * not know and definitely is no file type argument. X * X * General rules for the return code of the interface functions X * get*args()/get*files(): X * X * > 0 A file type argument was found X * 0 All arguments have been parsed X * < 0 An error occured X * X * Flag and file arg processing should be terminated after getting a return X * code <= 0. X */ X#define FLAGDELIM 2 /* "--" stopped flag processing */ X#define NOTAFLAG 1 /* Not a flag type argument */ X#define NOARGS 0 /* No more args */ X#define BADFLAG (-1) /* Not a valid flag argument */ X#define BADFMT (-2) /* Error in format string */ X#define NOTAFILE (-3) /* Seems to be a flag type */ X X/* X * The callback functions are called with the following parameters: X * X * arg The option argument X * valp A pointer to the related value argument from a get*arg*() call X * pac A pointer to the current argument counter X * pav A pointer to the current argument vector X * opt The option that caused the call X * X * The return value of the callback function may be: X * X * FLAGDELIM Pretend "--" stopped flag processing X * FLAGPARSED A valid flag was found, getallargs() will continue scanning X * ------------ the following codes will interrupt getallargs() processing: X * NOARGS Pretend all arguments have been examined X * BADFLAG Not a valid flag argument X * BADFMT General Error X * NOTAFILE Continue to check the format string for matches with option arg X */ X#define FLAGPARSED 1 /* Flag was sucessfully parsed */ X Xtypedef int (*getargfun) __PR((const char *__arg, void *__valp)); Xtypedef int (*getpargfun) __PR((const char *__arg, void *__valp, X int *__pac, char *const **__pav, X const char *__opt)); X X#define NO_ARGFUN (getargpfun)0 X Xstruct ga_flags { X const char *ga_format; /* Comma separated list for one flag */ X void *ga_arg; /* Ptr. to variable to fill for flag */ X getpargfun ga_funcp; /* Ptr. for function to call (&/~) */ X}; X Xstruct ga_props { X UInt32_t ga_flags; /* Flags to define behavior */ X UInt32_t ga_oflags; /* State flags */ X size_t ga_size; /* Size of this struct gs_props */ X}; X X/* X * This may be used instead of a struct ga_props * parameter: X */ X#define GA_NO_PROPS (struct ga_props *)0 /* Default behavior */ X#define GA_POSIX_PROPS (struct ga_props *)-1 /* POSIX behavior */ X X/* X * Definitions for ga_flags X */ X#define GAF_DEFAULT 0x00 /* The default behavior */ X#define GAF_NO_PLUS 0x01 /* Options may not start with '+' */ X#define GAF_NO_EQUAL 0x02 /* Disallow '=' between opt and val */ X#define GAF_NEED_DASH 0x04 /* Need dash before (-name=val), */ X /* name=val is not allowed */ X#define GAF_DELIM_DASHDASH 0x08 /* "--" stops even get?allargs() */ X#define GAF_SINGLEARG 0x10 /* Last singlechar opt may have arg */ X#define GAF_POSIX 0x1000 /* Will be expanded as shown below */ X X/* X * POSIX does not allow options in the form "+option", "-option=value" or X * "option=value". get*files() needs to know what may be a valid option. X * X * If ga_flags == GAF_POSIX, ga_flags is replaced with the value X * of the current definition for GAF_POSIX_DEFAULT. X * X * GAF_NO_PLUS do not allow options to start with a '+' X * GAF_NO_EQUAL do not allow options to contain '=' between name & val X * X * Warning: future versions may need different flags for POSIX, better use the X * GA_POSIX_PROPS "struct" or the GAF_POSIX flag. X */ X#define GAF_POSIX_DEFAULT (GAF_NO_PLUS | GAF_NO_EQUAL | GAF_SINGLEARG) X X/* X * Keep in sync with schily.h X */ Xextern int getallargs __PR((int *, char * const**, const char *, ...)); Xextern int getargs __PR((int *, char * const**, const char *, ...)); Xextern int getfiles __PR((int *, char * const**, const char *)); Xextern char *getargerror __PR((int)); X X/* X * The new list versions of the functions need struct ga_props and thus need X * getargs.h X */ Xextern int getlallargs __PR((int *, char * const**, struct ga_props *, X const char *, ...)); Xextern int getlargs __PR((int *, char * const**, struct ga_props *, X const char *, ...)); Xextern int getlfiles __PR((int *, char * const**, struct ga_props *, X const char *)); Xextern int _getarginit __PR((struct ga_props *, size_t, UInt32_t)); X X#define getarginit(p, f) _getarginit(p, sizeof (struct ga_props), f) X X/* X * The vector versions of the functions need struct ga_flags and thus need X * getargs.h X */ Xextern int getvallargs __PR((int *, char * const**, struct ga_props *, X struct ga_flags *)); Xextern int getvargs __PR((int *, char * const**, struct ga_props *, X struct ga_flags *)); Xextern int getvfiles __PR((int *, char * const**, struct ga_props *, X struct ga_flags *)); X X#ifdef __cplusplus X} X#endif X X#endif /* _SCHILY_GETARGS_H */ END-of-star-1.6/include/schily/getargs.h echo x - star-1.6/include/schily/getcwd.h sed 's/^X//' >star-1.6/include/schily/getcwd.h << 'END-of-star-1.6/include/schily/getcwd.h' X/* @(#)getcwd.h 1.6 10/08/24 Copyright 1998-2010 J. Schilling */ X/* X * Definitions for getcwd() X * X * Copyright (c) 1998-2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_GETCWD_H X#define _SCHILY_GETCWD_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X#ifndef _SCHILY_UNISTD_H X#include X#endif X X#ifdef JOS X# ifndef _INCL_SYS_STYPES_H X# include X# define _INCL_SYS_STYPES_H X# endif X#endif X X#ifdef __cplusplus Xextern "C" { X#endif X X#ifdef JOS X extern char *gwd(); X# define getcwd(b, len) gwd(b) X#else X# ifndef HAVE_GETCWD X# define getcwd(b, len) getwd(b) X# endif X#endif X X#ifdef __cplusplus X} X#endif X X#endif /* _SCHILY_GETCWD_H */ END-of-star-1.6/include/schily/getcwd.h echo x - star-1.6/include/schily/intcvt.h sed 's/^X//' >star-1.6/include/schily/intcvt.h << 'END-of-star-1.6/include/schily/intcvt.h' X/* @(#)intcvt.h 1.8 13/10/26 Copyright 1986-2013 J. Schilling */ X/* X * Definitions for conversion to/from integer data types of various size. X * X * Copyright (c) 1986-2013 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_INTCVT_H X#define _SCHILY_INTCVT_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X#ifndef _SCHILY_UTYPES_H X#include X#endif X X#define i_to_2_byte(a, i) (((Uchar *)(a))[0] = ((i) >> 8) & 0xFF,\ X ((Uchar *)(a))[1] = (i) & 0xFF) X X#define i_to_3_byte(a, i) (((Uchar *)(a))[0] = ((i) >> 16)& 0xFF,\ X ((Uchar *)(a))[1] = ((i) >> 8) & 0xFF,\ X ((Uchar *)(a))[2] = (i) & 0xFF) X X#define i_to_4_byte(a, i) (((Uchar *)(a))[0] = ((i) >> 24)& 0xFF,\ X ((Uchar *)(a))[1] = ((i) >> 16)& 0xFF,\ X ((Uchar *)(a))[2] = ((i) >> 8) & 0xFF,\ X ((Uchar *)(a))[3] = (i) & 0xFF) X X X X#define a_to_byte(a) (((Int8_t *)a)[0]) X X#define a_to_u_byte(a) ((UInt8_t) \ X (((Uchar *)a)[0] & 0xFF)) X X#define a_to_u_2_byte(a) ((UInt16_t) \ X ((((Uchar *)a)[1] & 0xFF) | \ X (((Uchar *)a)[0] << 8 & 0xFF00))) X X#define a_to_2_byte(a) (int)(Int16_t)a_to_u_2_byte(a) X X#define a_to_u_3_byte(a) ((Ulong) \ X ((((Uchar *)a)[2] & 0xFF) | \ X (((Uchar *)a)[1] << 8 & 0xFF00) | \ X (((Uchar *)a)[0] << 16 & 0xFF0000))) X X#define a_to_3_byte(a) a_to_u_3_byte(a) /* XXX signed version? */ X X#ifdef __STDC__ X# define __TOP_4BYTE 0xFF000000UL X#else X# define __TOP_4BYTE 0xFF000000 X#endif X X#define a_to_u_4_byte(a) ((Ulong) \ X ((((Uchar*)a)[3] & 0xFF) | \ X (((Uchar*)a)[2] << 8 & 0xFF00) | \ X (((Uchar*)a)[1] << 16 & 0xFF0000) | \ X (((Uchar*)a)[0] << 24 & __TOP_4BYTE))) X X#define a_to_4_byte(a) (long)(Int32_t)a_to_u_4_byte(a) X X/* X * Little Endian versions of above macros X */ X#define li_to_2_byte(a, i) (((Uchar *)(a))[1] = ((i) >> 8) & 0xFF,\ X ((Uchar *)(a))[0] = (i) & 0xFF) X X#define li_to_3_byte(a, i) (((Uchar *)(a))[2] = ((i) >> 16)& 0xFF,\ X ((Uchar *)(a))[1] = ((i) >> 8) & 0xFF,\ X ((Uchar *)(a))[0] = (i) & 0xFF) X X#define li_to_4_byte(a, i) (((Uchar *)(a))[3] = ((i) >> 24)& 0xFF,\ X ((Uchar *)(a))[2] = ((i) >> 16)& 0xFF,\ X ((Uchar *)(a))[1] = ((i) >> 8) & 0xFF,\ X ((Uchar *)(a))[0] = (i) & 0xFF) X X X#define la_to_u_2_byte(a) ((UInt16_t) \ X ((((Uchar*)a)[0] & 0xFF) | \ X (((Uchar*)a)[1] << 8 & 0xFF00))) X X#define la_to_2_byte(a) (int)(Int16_t)la_to_u_2_byte(a) X X#define la_to_u_3_byte(a) ((Ulong) \ X ((((Uchar*)a)[0] & 0xFF) | \ X (((Uchar*)a)[1] << 8 & 0xFF00) | \ X (((Uchar*)a)[2] << 16 & 0xFF0000))) X X#define la_to_3_byte(a) la_to_u_3_byte(a) /* XXX signed version? */ X X#define la_to_u_4_byte(a) ((Ulong) \ X ((((Uchar*)a)[0] & 0xFF) | \ X (((Uchar*)a)[1] << 8 & 0xFF00) | \ X (((Uchar*)a)[2] << 16 & 0xFF0000) | \ X (((Uchar*)a)[3] << 24 & __TOP_4BYTE))) X X#define la_to_4_byte(a) (long)(Int32_t)la_to_u_4_byte(a) X X#endif /* _SCHILY_INTCVT_H */ END-of-star-1.6/include/schily/intcvt.h echo x - star-1.6/include/schily/jmpdefs.h sed 's/^X//' >star-1.6/include/schily/jmpdefs.h << 'END-of-star-1.6/include/schily/jmpdefs.h' X/* @(#)jmpdefs.h 1.10 18/06/04 Copyright 1998-2018 J. Schilling */ X/* X * Definitions that help to handle a jmp_buf X * X * Copyright (c) 1998-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_JMPDEFS_H X#define _SCHILY_JMPDEFS_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifndef _SCHILY_SETJMP_H X#include X#endif X X#ifdef __cplusplus Xextern "C" { X#endif X Xtypedef struct { X jmp_buf jb; X} jmps_t; X X#if defined(HAVE_SIGSETJMP) && defined(HAVE_SIGLONGJMP) X#define HAVE_SIGJMPS_T X Xtypedef struct { X sigjmp_buf jb; X} sigjmps_t; X X#else X X/* X * Make sure to use the best available X */ X#define sigjmp_buf jmp_buf X#define sigjmps_t jmps_t X#define sigsetjmp(je, sm) setjmp(je) X#define siglongjmp longjmp X X#endif X X#ifdef __cplusplus X} X#endif X X#endif /* _SCHILY_JMPDEFS_H */ END-of-star-1.6/include/schily/jmpdefs.h echo x - star-1.6/include/schily/libport.h sed 's/^X//' >star-1.6/include/schily/libport.h << 'END-of-star-1.6/include/schily/libport.h' X/* @(#)libport.h 1.49 18/07/23 Copyright 1995-2018 J. Schilling */ X/* X * Prototypes for POSIX standard functions that may be missing on the X * local platform and thus are implemented inside libschily. X * X * Copyright (c) 1995-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X X#ifndef _SCHILY_LIBPORT_H X#define _SCHILY_LIBPORT_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X#ifndef _SCHILY_TYPES_H X#include X#endif X X#ifndef _SCHILY_UNISTD_H X#include X#endif X X#ifdef __cplusplus Xextern "C" { X#endif X X#if defined(_INCL_SYS_TYPES_H) || defined(_INCL_TYPES_H) || defined(size_t) X# ifndef FOUND_SIZE_T X# define FOUND_SIZE_T X# endif X#endif X#if defined(_MSC_VER) && !defined(_SIZE_T_DEFINED) X# undef FOUND_SIZE_T X#endif X X#ifdef OPENSERVER X/* X * Don't use the usleep() from libc on SCO's OPENSERVER. X * It will kill our processes with SIGALRM. X */ X/* X * Don't #undef HAVE_USLEEP in this file, SCO has a X * usleep() prototype in unistd.h X */ X/* #undef HAVE_USLEEP */ X#endif X X#ifdef FOUND_SIZE_T X/* X * We currently cannot define this here because there IRIX has a definition X * than violates the standard. X */ X#ifndef HAVE_SNPRINTF X/*PRINTFLIKE3*/ Xextern int snprintf __PR((char *, size_t, const char *, ...)) X __printflike__(3, 4); X#endif X#endif X X#ifdef EOF /* stdio.h has been included */ X#ifdef FOUND_SIZE_T X#ifndef HAVE_GETDELIM Xextern ssize_t getdelim __PR((char **, size_t *, int, FILE *)); X#endif X#endif X#endif X X#ifndef HAVE_GETHOSTID Xextern long gethostid __PR((void)); X#endif X#ifndef HAVE_GETPAGESIZE Xextern int getpagesize __PR((void)); X#endif X#ifndef HAVE_USLEEP Xextern int usleep __PR((int usec)); X#endif X X#ifndef HAVE_STRCASECMP Xextern int strcasecmp __PR((const char *, const char *)); X#endif X#ifdef FOUND_SIZE_T X#ifndef HAVE_STRNCASECMP Xextern int strncasecmp __PR((const char *, const char *, X size_t)); X#endif X#endif X X#ifndef HAVE_STRCAT Xextern char *strcat __PR((char *s1, const char *s2)); X#endif X#ifndef HAVE_STRCHR Xextern char *strchr __PR((const char *s1, int c)); X#endif X#ifndef HAVE_STRCMP Xextern int strcmp __PR((const char *s1, const char *s2)); X#endif X#ifndef HAVE_STRCPY Xextern char *strcpy __PR((char *s1, const char *s2)); X#endif X#if !defined(HAVE_STRDUP) || defined(__SVR4) Xextern char *strdup __PR((const char *s)); X#endif X#ifdef FOUND_SIZE_T X#ifndef HAVE_STRNDUP Xextern char *strndup __PR((const char *s, size_t len)); X#endif X#ifndef HAVE_STRLEN Xextern size_t strlen __PR((const char *s)); X#endif X#ifndef HAVE_STRNLEN Xextern size_t strnlen __PR((const char *s, size_t len)); X#endif X#ifndef HAVE_STRLCAT Xextern size_t strlcat __PR((char *s1, const char *s2, X size_t len)); X#endif X#ifndef HAVE_STRLCPY Xextern size_t strlcpy __PR((char *s1, const char *s2, X size_t len)); X#endif X#ifndef HAVE_STRNCAT Xextern char *strncat __PR((char *s1, const char *s2, X size_t len)); X#endif X#ifndef HAVE_STRNCMP Xextern int strncmp __PR((const char *s1, const char *s2, X size_t len)); X#endif X#ifndef HAVE_STRNCPY Xextern char *strncpy __PR((char *s1, const char *s2, X size_t len)); X#endif X#endif /* FOUND_SIZE_T */ X#ifndef HAVE_STRRCHR Xextern char *strrchr __PR((const char *s1, int c)); X#endif X X#ifndef HAVE_STRSTR Xextern char *strstr __PR((const char *s1, const char *s2)); X#endif X X#ifdef _SCHILY_WCHAR_H X#ifndef HAVE_WCSCAT Xextern wchar_t *wcscat __PR((wchar_t *s1, const wchar_t *s2)); X#endif X#ifndef HAVE_WCSCHR Xextern wchar_t *wcschr __PR((const wchar_t *s1, wchar_t c)); X#endif X#ifndef HAVE_WCSCMP Xextern int wcscmp __PR((const wchar_t *s1, X const wchar_t *s2)); X#endif X#ifndef HAVE_WCSCPY Xextern wchar_t *wcscpy __PR((wchar_t *s1, const wchar_t *s2)); X#endif X#ifndef HAVE_WCSDUP Xextern wchar_t *wcsdup __PR((const wchar_t *s)); X#endif X#ifdef FOUND_SIZE_T X#ifndef HAVE_WCSNDUP Xextern wchar_t *wcsndup __PR((const wchar_t *s, size_t len)); X#endif X#ifndef HAVE_WCSLEN Xextern size_t wcslen __PR((const wchar_t *s)); X#endif X#ifndef HAVE_WCSNLEN Xextern size_t wcsnlen __PR((const wchar_t *s, size_t len)); X#endif X#ifndef HAVE_WCSLCAT Xextern size_t wcslcat __PR((wchar_t *s1, const wchar_t *s2, X size_t len)); X#endif X#ifndef HAVE_WCSLCPY Xextern size_t wcslcpy __PR((wchar_t *s1, const wchar_t *s2, X size_t len)); X#endif X#ifndef HAVE_WCSNCAT Xextern wchar_t *wcsncat __PR((wchar_t *s1, const wchar_t *s2, X size_t len)); X#endif X#ifndef HAVE_WCSNCMP Xextern int wcsncmp __PR((const wchar_t *s1, X const wchar_t *s2, X size_t len)); X#endif X#ifndef HAVE_WCSNCPY Xextern wchar_t *wcsncpy __PR((wchar_t *s1, const wchar_t *s2, X size_t len)); X#endif X#endif /* FOUND_SIZE_T */ X#ifndef HAVE_WCSRCHR Xextern wchar_t *wcsrchr __PR((const wchar_t *s1, wchar_t c)); X#endif X X#ifndef HAVE_WCSSTR Xextern wchar_t *wcsstr __PR((const wchar_t *s1, X const wchar_t *s2)); X#endif X#endif /* _SCHILY_WCHAR_H */ X X#ifndef HAVE_RENAME Xextern int rename __PR((const char *__old, X const char *__new)); X#endif X X/* X * XXX Note: libgen.h / -lgen on Solaris contain eaccess() X */ X#ifndef HAVE_EACCESS Xextern int eaccess __PR((const char *name, int mode)); X#endif X X/* X * See also libgen.h X */ X#ifndef HAVE_BASENAME Xextern char *basename __PR((char *name)); X#endif X#ifndef HAVE_DIRNAME Xextern char *dirname __PR((char *name)); X#endif X X#ifndef HAVE_TIMEGM X#if defined(_SCHILY_TIME_H) Xextern time_t timegm __PR((struct tm *)); X#endif X#endif X X#ifndef HAVE_GETUID Xextern uid_t getuid __PR((void)); X#endif X#ifndef HAVE_GETEUID Xextern uid_t geteuid __PR((void)); X#endif X#ifndef HAVE_SETUID Xextern int setuid __PR((uid_t uid)); X#endif X#ifndef HAVE_SETEUID Xextern int seteuid __PR((uid_t uid)); X#endif X X#ifndef HAVE_GETGID Xextern gid_t getgid __PR((void)); X#endif X#ifndef HAVE_GETEGID Xextern gid_t getegid __PR((void)); X#endif X#ifndef HAVE_SETGID Xextern int setgid __PR((gid_t gid)); X#endif X#ifndef HAVE_SETEGID Xextern int setegid __PR((gid_t gid)); X#endif X X#ifndef HAVE_GETPWNAM Xextern struct passwd *getpwnam __PR((const char *name)); X#endif X#ifndef HAVE_GETPWENT Xextern struct passwd *getpwent __PR((void)); X#endif X#ifndef HAVE_GETPWUID Xextern struct passwd *getpwuid __PR((uid_t uid)); X#endif X#ifndef HAVE_SETPWENT Xextern void setpwent __PR((void)); X#endif X#ifndef HAVE_ENDPWENT Xextern void endpwent __PR((void)); X#endif X X X#ifndef HAVE_GETGRNAM Xextern struct group *getgrnam __PR((const char *name)); X#endif X#ifndef HAVE_GETGRENT Xextern struct group *getgrent __PR((void)); X#endif X#ifndef HAVE_GETGRGID Xextern struct group *getgrgid __PR((gid_t gid)); X#endif X#ifndef HAVE_SETGRENT Xextern void setgrent __PR((void)); X#endif X#ifndef HAVE_ENDGRENT Xextern void endgrent __PR((void)); X#endif X X#ifndef HAVE_FCHDIR Xextern int fchdir __PR((int fd)); X#endif X#ifndef HAVE_OPENAT X#if defined(HAVE_LARGEFILES) X# define openat openat64 X#endif Xextern int openat __PR((int fd, const char *name, int oflag, ...)); X#endif X X X#ifndef HAVE_GETTIMEOFDAY X#ifdef _SCHILY_TIME_H Xextern int gettimeofday __PR((struct timeval *__tp, void *__tzp)); X#endif X#endif X X#ifndef HAVE_FACCESSAT Xextern int faccessat __PR((int fd, const char *name, X int amode, int flag)); X#endif X#ifndef HAVE_FCHMODAT Xextern int fchmodat __PR((int fd, const char *name, X mode_t mode, int flag)); X#endif X#ifndef HAVE_LCHMOD Xextern int lchmod __PR((const char *name, mode_t mode)); X#endif X X#ifndef HAVE_FCHOWNAT Xextern int fchownat __PR((int fd, const char *name, X uid_t owner, gid_t group, int flag)); X#endif X X#ifndef HAVE_FDOPENDIR X#ifdef _SCHILY_DIRENT_H Xextern DIR *fdopendir __PR((int fd)); X#endif X#endif X X#ifdef _SCHILY_STAT_H X#ifndef HAVE_FSTATAT X#if defined(HAVE_LARGEFILES) X# define fstatat fstatat64 X#endif Xextern int fstatat __PR((int fd, const char *name, X struct stat *sbuf, int flag)); X#endif X#endif /* _SCHILY_STAT_H */ X#ifdef _SCHILY_TIME_H X#ifndef HAVE_FUTIMENS Xextern int futimens __PR((int fd, X const struct timespec __times[2])); X#endif X#ifndef HAVE_FUTIMESAT Xextern int futimesat __PR((int fd, const char *name, X const struct timeval __times[2])); X#endif X#ifndef HAVE_LUTIMENS Xextern int lutimens __PR((const char *name, X const struct timespec __times[2])); X#endif X#endif /* _SCHILY_TIME_H */ X#ifndef HAVE_LINKAT Xextern int linkat __PR((int fd1, const char *name1, X int fd2, const char *name2, int flag)); X#endif X#ifndef HAVE_MKDIRAT Xextern int mkdirat __PR((int fd, const char *name, mode_t mode)); X#endif X#ifndef HAVE_MKFIFO Xextern int mkfifo __PR((const char *name, mode_t mode)); X#endif X#ifndef HAVE_MKFIFOAT Xextern int mkfifoat __PR((int fd, const char *name, mode_t mode)); X#endif X#ifndef HAVE_MKNODAT Xextern int mknodat __PR((int fd, const char *name, X mode_t mode, dev_t dev)); X#endif X#ifndef HAVE_READLINKAT Xextern ssize_t readlinkat __PR((int fd, const char *name, X char *lbuf, size_t lbufsize)); X#endif X#ifndef HAVE_RENAMEAT Xextern int renameat __PR((int oldfd, const char *__old, X int newfd, const char *__new)); X#endif X#ifndef HAVE_SYMLINKAT Xextern int symlinkat __PR((const char *content, X int fd, const char *name)); X#endif X#ifndef HAVE_UNLINKAT Xextern int unlinkat __PR((int fd, const char *name, int flag)); X#endif X#ifdef _SCHILY_TIME_H X#ifndef HAVE_UTIMENS Xextern int utimens __PR((const char *name, X const struct timespec __times[2])); X#endif X#ifndef HAVE_UTIMENSAT Xextern int utimensat __PR((int fd, const char *name, X const struct timespec __times[2], X int flag)); X#endif X#endif /* _SCHILY_TIME_H */ X X#ifndef HAVE_PUTENV Xextern int putenv __PR((char *new)); X#endif X#ifndef HAVE_UNSETENV Xextern int unsetenv __PR((const char *name)); X#endif X X#ifndef HAVE_WAITID X#ifdef _SCHILY_WAIT_H X#define waitid js_waitid Xextern int waitid __PR((idtype_t idtype, id_t id, X siginfo_t *infop, int opts)); X#endif X#endif X X#ifdef __SUNOS4 X/* X * Define prototypes for POSIX standard functions that are missing on SunOS-4.x X * to make compilation smooth. X */ X#include X X#endif /* __SUNOS4 */ X X#ifdef __cplusplus X} X#endif X X#endif /* _SCHILY_LIBPORT_H */ END-of-star-1.6/include/schily/libport.h echo x - star-1.6/include/schily/librmt.h sed 's/^X//' >star-1.6/include/schily/librmt.h << 'END-of-star-1.6/include/schily/librmt.h' X/* @(#)librmt.h 1.24 18/06/09 Copyright 1995,1996,2000-2018 J. Schilling */ X/* X * Prototypes for rmt client subroutines X * X * Copyright (c) 1995,1996,2000-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_LIBRMT_H X#define _SCHILY_LIBRMT_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X#ifndef _SCHILY_TYPES_H X#include X#endif X X#include X X#ifdef __cplusplus Xextern "C" { X#endif X X/* X * remote.c X */ Xextern void rmtinit __PR((int (*errmsgn) X (int, const char *, ...), X void (*eexit)(int))); Xextern int rmtdebug __PR((int dlevel)); Xextern const char *rmtrmt __PR((const char *rmt_name)); Xextern const char *rmtrsh __PR((const char *rsh_name)); Xextern char *rmtfilename __PR((char *name)); Xextern char *rmthostname __PR((char *hostname, int hnsize, X char *rmtspec)); Xextern int rmtgetconn __PR((char *host, int trsize, X int excode)); Xextern int rmtopen __PR((int fd, char *fname, int fmode)); Xextern int rmtclose __PR((int fd)); Xextern int rmtread __PR((int fd, char *buf, int count)); Xextern int rmtwrite __PR((int fd, char *buf, int count)); Xextern off_t rmtseek __PR((int fd, off_t offset, X int whence)); Xextern int rmtioctl __PR((int fd, int cmd, int count)); X#ifdef MTWEOF Xextern int rmtstatus __PR((int fd, struct mtget *mtp)); X#endif Xextern int rmtxstatus __PR((int fd, struct rmtget *mtp)); X#ifdef MTWEOF Xextern void _rmtg2mtg __PR((struct mtget *mtp, X struct rmtget *rmtp)); Xextern int _mtg2rmtg __PR((struct rmtget *rmtp, X struct mtget *mtp)); X#endif X X#ifdef __cplusplus X} X#endif X X#endif /* _SCHILY_LIBRMT_H */ END-of-star-1.6/include/schily/librmt.h echo x - star-1.6/include/schily/maxpath.h sed 's/^X//' >star-1.6/include/schily/maxpath.h << 'END-of-star-1.6/include/schily/maxpath.h' X/* @(#)maxpath.h 1.13 17/04/27 Copyright 1985, 1995, 1998, 2001-2017 J. Schilling */ X/* X * Definitions for dealing with statically limitations on pathnames X * X * Copyright (c) 1985, 1995, 1998, 2001-2017 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_MAXPATH_H X#define _SCHILY_MAXPATH_H X X#ifndef _SCHILY_DIRENT_H X#include /* Includes mconfig.h if needed */ X#endif X X#ifdef JOS X#ifndef _SCHILY_JOS_MAXP_H X# include X#endif X# ifndef FOUND_MAXPATHNAME X# define FOUND_MAXPATHNAME X# endif X# ifndef FOUND_MAXFILENAME X# define FOUND_MAXFILENAME X# endif X#endif /* JOS */ X X#if !defined(FOUND_MAXPATHNAME) && defined(MAXPATHLEN) X# define MAXPATHNAME MAXPATHLEN /* From sys/param.h */ X# define FOUND_MAXPATHNAME X#endif X X#if !defined(FOUND_MAXPATHNAME) && defined(PATH_MAX) X# define MAXPATHNAME PATH_MAX /* From limits.h */ X# define FOUND_MAXPATHNAME X#endif X X#if !defined(FOUND_MAXPATHNAME) X#include X#endif X#if !defined(FOUND_MAXPATHNAME) && defined(_MAX_PATH) X# define MAXPATHNAME _MAX_PATH /* From MS stdlib.h */ X# define FOUND_MAXPATHNAME X#endif X X#if !defined(FOUND_MAXPATHNAME) X# define MAXPATHNAME 1024 /* Is there a limit? */ X#endif X X#ifndef PATH_MAX X#define PATH_MAX MAXPATHNAME X#endif X X X/* X * Don't use defaults here to allow recognition of problems. X */ X#if !defined(FOUND_MAXFILENAME) && defined(MAXNAMELEN) X# define MAXFILENAME MAXNAMELEN /* From sys/param.h */ X# define FOUND_MAXFILENAME X#endif X X#if !defined(FOUND_MAXFILENAME) && defined(MAXNAMLEN) X# define MAXFILENAME MAXNAMLEN /* From dirent.h */ X# define FOUND_MAXFILENAME X#endif X X#ifdef __never__ X/* X * DIRSIZ(dp) is a parameterized macro, we cannot use it here. X */ X#if !defined(FOUND_MAXFILENAME) && defined(DIRSIZ) X# define MAXFILENAME DIRSIZ /* From sys/dir.h */ X# define FOUND_MAXFILENAME X#endif X#endif /* __never__ */ X X#if !defined(FOUND_MAXFILENAME) && defined(NAME_MAX) X# define MAXFILENAME NAME_MAX /* From limits.h */ X# define FOUND_MAXFILENAME X#endif X X#if !defined(FOUND_MAXFILENAME) && defined(FOUND_DIRSIZE) X# define MAXFILENAME DIRSIZE /* From schily/dirent.h */ X# define FOUND_MAXFILENAME X#endif X X#if !defined(FOUND_MAXFILENAME) X#include X#endif X#if !defined(FOUND_MAXFILENAME) && defined(_MAX_FNAME) X# define MAXFILENAME _MAX_FNAME /* From MS stdlib.h */ X# define FOUND_MAXFILENAME X#endif X X#if !defined(FOUND_MAXFILENAME) X# define MAXFILENAME 256 X#endif X X#ifndef NAME_MAX X#define NAME_MAX MAXFILENAME X#endif X#ifndef MAXNAMLEN X#define MAXNAMLEN MAXFILENAME X#endif X#ifndef MAXNAMELEN X#define MAXNAMELEN MAXFILENAME X#endif X X#endif /* _SCHILY_MAXPATH_H */ END-of-star-1.6/include/schily/maxpath.h echo x - star-1.6/include/schily/mconfig.h sed 's/^X//' >star-1.6/include/schily/mconfig.h << 'END-of-star-1.6/include/schily/mconfig.h' X/* @(#)mconfig.h 1.73 19/04/03 Copyright 1995-2019 J. Schilling */ X/* X * definitions for machine configuration X * X * Copyright (c) 1995-2019 J. Schilling X * X * This file must be included before any other file. X * If this file is not included before stdio.h you will not be X * able to get LARGEFILE support X * X * Use only cpp instructions. X * X * NOTE: SING: (Schily Is Not Gnu) X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_MCONFIG_H X#define _SCHILY_MCONFIG_H X X/* X * Tell our users that this is a Schily SING compile environment. X */ X#define IS_SCHILY X X/* X * We need to do this before we include xconfig.h X */ X#ifdef NO_LARGEFILES X#undef USE_LARGEFILES X#endif X#ifdef NO_ACL X#undef USE_ACL X#endif X X/* X * Inside we get architecture specific Processor defines X * fetched from compiler predefinitions only. X */ X#include X X/* X * Inside we decide whether to use static or dynamic X * autoconf stuff. X */ X#include X X/* X * Make sure that neither HAVE_LARGEFILES nor USE_LARGEFILES is defined X * if the platform does not support large files. X */ X#ifndef HAVE_LARGEFILES X#undef USE_LARGEFILES X#endif X X#ifdef __cplusplus Xextern "C" { X#endif X X/* X * The NetBSD people want to bother us. X * They removed the definition for 'unix' and are bleating for every test X * for #if defined(unix). So we need to check for NetBSD early. X */ X#ifndef IS_UNIX X# if defined(__NetBSD__) X# define IS_UNIX X# endif X#endif X X#ifndef IS_UNIX X# if (defined(unix) || defined(__unix) || defined(__unix__)) && \ X !defined(__DJGPP__) X# define IS_UNIX X# endif X#endif X X#ifdef __MSDOS__ X# define IS_MSDOS X#endif X X#if defined(tos) || defined(__tos) X# define IS_TOS X#endif X X#ifdef THINK_C X# define IS_MAC X#endif X X#if defined(sun) || defined(__sun) || defined(__sun__) X# define IS_SUN X#endif X X#if defined(__CYGWIN32__) || defined(__CYGWIN__) X# define IS_GCC_WIN32 X# define IS_CYGWIN X X#if defined(unix) || defined(_X86) X# define IS_CYGWIN_1 X#endif X#endif X X/* X * GCC & Clang address sanitizer detection: X */ X#if defined(__SANITIZE_ADDRESS__) /* GCC */ X#define IS_ASAN X#endif X#if defined(__has_feature) /* Clang */ X#if __has_feature(address_sanitizer) X#define IS_ASAN X#endif X#endif X X X/* ------------------------------------------------------------------------- */ X/* X * Some magic that cannot (yet) be figured out with autoconf. X */ X X#if defined(sun3) || defined(mc68000) || defined(mc68020) X# ifndef HAVE_SCANSTACK X# define HAVE_SCANSTACK X# endif X#endif X#ifdef sparc X# ifndef HAVE_LDSTUB X# define HAVE_LDSTUB X# endif X# ifndef HAVE_SCANSTACK X# define HAVE_SCANSTACK X# endif X#endif X#if defined(__i386_) || defined(i386) X# ifndef HAVE_XCHG X# define HAVE_XCHG X# endif X# ifndef HAVE_SCANSTACK X# define HAVE_SCANSTACK X# endif X#endif X X/* X * Use of SCANSTACK is disabled by default X */ X#ifndef USE_SCANSTACK X# undef HAVE_SCANSTACK X#else X/* X * But .... X * The tests are much better now, so always give it a chance. X */ X#ifndef HAVE_SCANSTACK X# define HAVE_SCANSTACK X#endif X#endif X X/* X * The address sanitizer does not like our frame pointer modifications X * and would otherwise warn against a stack corruption. X */ X#ifdef IS_ASAN X# undef HAVE_SCANSTACK X#endif X X/* X * Allow to overwrite the defines in the makefiles by calling X * X * make COPTX=-DFORCE_SCANSTACK X */ X#ifdef FORCE_SCANSTACK X# undef NO_SCANSTACK X#ifndef HAVE_SCANSTACK X# define HAVE_SCANSTACK X#endif X#ifndef USE_SCANSTACK X# define USE_SCANSTACK X#endif X#endif X X/* X * This is the global switch to deactivate stack scanning X */ X#ifdef NO_SCANSTACK X# ifdef HAVE_SCANSTACK X# undef HAVE_SCANSTACK X# endif X#endif X X/* X * This is the global switch to deactivate using #pragma weak X */ X#ifdef NO_PRAGMA_WEAK X# ifdef HAVE_PRAGMA_WEAK X# undef HAVE_PRAGMA_WEAK X# endif X#endif X X#ifdef NO_FORK X# ifdef HAVE_FORK X# undef HAVE_FORK X# endif X# ifdef HAVE_VFORK X# undef HAVE_VFORK X# endif X#endif X#ifdef NO_VFORK X# ifdef HAVE_VFORK X# undef HAVE_VFORK X# endif X#endif X X#if defined(SOL2) || defined(SOL2) || \ X defined(S5R4) || defined(__S5R4) || defined(SVR4) X# ifndef __SVR4 X# define __SVR4 X# endif X#endif X X#ifdef __SVR4 X# ifndef SVR4 X# define SVR4 X# endif X#endif X X/* X * SunOS 4.x / SunOS 5.x X */ X#if defined(IS_SUN) X# define HAVE_GETAV0 X#endif X X/* X * AIX X */ X#if defined(_IBMR2) || defined(_AIX) X# ifndef IS_UNIX X# define IS_UNIX /* ??? really ??? */ X# endif X#endif X X/* X * QNX X */ X#if defined(__QNX__) X# ifndef IS_UNIX X# define IS_UNIX X# endif X#endif X X/* X * Silicon Graphics (must be before SVR4) X */ X#if defined(sgi) || defined(__sgi) X# define __NOT_SVR4__ /* Not a real SVR4 implementation */ X#endif X X/* X * Data General X */ X#if defined(__DGUX__) X#ifdef XXXXXXX X# undef HAVE_MTGET_DSREG X# undef HAVE_MTGET_RESID X# undef HAVE_MTGET_FILENO X# undef HAVE_MTGET_BLKNO X#endif X# define mt_type mt_model X# define mt_dsreg mt_status1 X# define mt_erreg mt_status2 X /* X * DGUX hides its flock as dg_flock. X */ X# define HAVE_FLOCK X# define flock dg_flock X /* X * Use the BSD style wait on DGUX to get the resource usages of child X * processes. X */ X# define _BSD_WAIT_FLAVOR X#endif X X/* X * Apple Rhapsody (This is the name for Mac OS X beta) X */ X#if defined(__NeXT__) && defined(__TARGET_OSNAME) && __TARGET_OSNAME == rhapsody X# define HAVE_OSDEF /* prevent later definitions to overwrite current */ X# ifndef IS_UNIX X# define IS_UNIX X# endif X#endif X X/* X * NextStep X */ X#if defined(__NeXT__) && !defined(HAVE_OSDEF) X#define NO_PRINT_OVR X#undef HAVE_USG_STDIO X /* X * NeXT Step 3.x uses X * __flsbuf(unsigned char, FILE *) X * instead of __flsbuf(int, FILE *) X */ X# ifndef IS_UNIX X# define IS_UNIX X# endif X#endif X X/* X * Mac OS X X */ X#if defined(__APPLE__) && defined(__MACH__) X# ifndef IS_UNIX X# define IS_UNIX X# endif X# define IS_MACOS_X X#endif X X/* X * NextStep 3.x has a broken linker that does not allow us to override X * these functions. X */ X#ifndef __OPRINTF__ X X#ifdef NO_PRINT_OVR X# define printf Xprintf X# define fprintf Xfprintf X# define sprintf Xsprintf X#endif X X#endif /* __OPRINTF__ */ X X/* ------------------------------------------------------------------------- */ X X#ifndef _SCHILY_PROTOTYP_H X#include X#endif X X/* X * We use HAVE_LONGLONG as generalized test on whether "long long", "__in64" or X * something similar exist. X * X * In case that HAVE_LONGLONG is defined here, this is an indication that X * "long long" works. We define HAVE_LONG_LONG to keep this knowledge. X */ X#ifdef HAVE_LONGLONG X# define HAVE_LONG_LONG X#endif X X/* X * Microsoft C defines _MSC_VER X * use __int64 instead of long long and use 0i64 for a signed long long const X * and 0ui64 for an unsigned long long const. X * X * #if defined(HAVE___INT64) X * use __int64 X * #elif defined(HAVE_LONGLONG) X * use long long X * #endif X * X * Be very careful here as older MSVC versions do not implement long long but X * rather __int64 and once someone makes 'long long' 128 bits on a 64 bit X * machine, we may need to check for a MSVC __int128 type. X */ X#ifndef HAVE_LONGLONG X# if defined(HAVE___INT64) X# define HAVE_LONGLONG X# endif X#endif X X/* X * gcc 2.x generally implements the "long long" type. X */ X#ifdef __GNUC__ X# if __GNUC__ > 1 X# ifndef HAVE_LONGLONG X# define HAVE_LONGLONG X# endif X# ifndef HAVE_LONG_LONG X# define HAVE_LONG_LONG X# endif X# endif X#endif X X#ifdef __CHAR_UNSIGNED__ /* GNU GCC define (dynamic) */ X#ifndef CHAR_IS_UNSIGNED X#define CHAR_IS_UNSIGNED /* Sing Schily define (static) */ X#endif X#endif X X/* X * Convert to GNU name X */ X#ifdef HAVE_STDC_HEADERS X# ifndef STDC_HEADERS X# define STDC_HEADERS X# endif X#endif X/* X * Convert to SCHILY name X */ X#ifdef STDC_HEADERS X# ifndef HAVE_STDC_HEADERS X# define HAVE_STDC_HEADERS X# endif X#endif X X#ifdef IS_UNIX X# define HAVE_PATH_DELIM X# define PATH_DELIM '/' X# define PATH_DELIM_STR "/" X# define PATH_ENV_DELIM ':' X# define PATH_ENV_DELIM_STR ":" X# define far X# define near X#endif X X/* X * Win32 with Gygwin X */ X#ifdef IS_GCC_WIN32 X# define HAVE_PATH_DELIM X# define PATH_DELIM '/' X# define PATH_DELIM_STR "/" X# define PATH_ENV_DELIM ':' X# define PATH_ENV_DELIM_STR ":" X# define HAVE_DOS_DRIVELETTER X# define far X# define near X# define NEED_O_BINARY X#endif X X/* X * Win32 with Mingw32 X */ X#ifdef __MINGW32__ X# define HAVE_PATH_DELIM X# define PATH_DELIM '/' X# define PATH_DELIM_STR "/" X# define PATH_ENV_DELIM ';' X# define PATH_ENV_DELIM_STR ";" X# define HAVE_DOS_DRIVELETTER X# define far X# define near X# define NEED_O_BINARY X#endif X X/* X * OS/2 EMX X */ X#ifdef __EMX__ /* We don't want to call it UNIX */ X# define HAVE_PATH_DELIM X# define PATH_DELIM '/' X# define PATH_DELIM_STR "/" X# define PATH_ENV_DELIM ';' X# define PATH_ENV_DELIM_STR ";" X# define HAVE_DOS_DRIVELETTER X# define far X# define near X# define NEED_O_BINARY X#endif X X#ifdef __BEOS__ /* We don't want to call it UNIX */ X# define HAVE_PATH_DELIM X# define PATH_DELIM '/' X# define PATH_DELIM_STR "/" X# define PATH_ENV_DELIM ':' X# define PATH_ENV_DELIM_STR ":" X# define far X# define near X#endif X X/* X * DOS with DJGPP X */ X#ifdef __DJGPP__ /* We don't want to call it UNIX */ X# define HAVE_PATH_DELIM X# define PATH_DELIM '/' X# define PATH_DELIM_STR "/" X# define PATH_ENV_DELIM ';' X# define PATH_ENV_DELIM_STR ";" X# define HAVE_DOS_DRIVELETTER X X# define NEED_O_BINARY X#endif X X/* X * Vanilla DOS X */ X#if defined(IS_MSDOS) && !defined(__DJGPP__) X# define HAVE_PATH_DELIM X# define PATH_DELIM '\\' X# define PATH_DELIM_STR "\\" X# define PATH_ENV_DELIM ';' X# define PATH_ENV_DELIM_STR ";" X# define HAVE_DOS_DRIVELETTER X X# define NEED_O_BINARY X#endif X X/* X * ATARI TOS X */ X#ifdef IS_TOS X# define HAVE_PATH_DELIM X# define PATH_DELIM '\\' X# define PATH_DELIM_STR "\\" X# define PATH_ENV_DELIM ',' X# define PATH_ENV_DELIM_STR "," X# define HAVE_DOS_DRIVELETTER X# define far X# define near X#endif X X/* X * Mac OS 9 X */ X#ifdef IS_MAC X# define HAVE_PATH_DELIM X# define PATH_DELIM ':' X# define PATH_DELIM_STR ":" X# define PATH_ENV_DELIM ';' /* ??? */ X# define PATH_ENV_DELIM_STR ";" /* ??? */ X# define far X# define near X#endif X X/* X * I hope this will make compilation on unknown OS easier. X */ X#ifndef HAVE_PATH_DELIM /* Default to POSIX rules */ X# define HAVE_PATH_DELIM X# define PATH_DELIM '/' X# define PATH_DELIM_STR "/" X# define PATH_ENV_DELIM ':' X# define PATH_ENV_DELIM_STR ":" X# define far X# define near X#endif X X/* X * Is there a solution for /dev/tty and similar? X */ X#ifdef HAVE__DEV_NULL X# define DEV_NULL "/dev/null" X#else X#if defined(_MSC_VER) || defined(__MINGW32__) X# define DEV_NULL "NUL" X#else X/* X * What to do here? X */ X#endif X#endif X X#ifdef DBG_MALLOC X/* X * We need to include this here already in order to make sure that X * every program that is based on mconfig.h will include schily/dbgmalloc.h X * in case that we specify -DDBG_MALLOC X */ X#include X#else X#undef DBG_MALLOC_MARK X#define DBG_MALLOC_MARK(a) X#endif X X#ifdef __cplusplus X} X#endif X X#endif /* _SCHILY_MCONFIG_H */ END-of-star-1.6/include/schily/mconfig.h echo x - star-1.6/include/schily/mtio.h sed 's/^X//' >star-1.6/include/schily/mtio.h << 'END-of-star-1.6/include/schily/mtio.h' X/* @(#)mtio.h 1.6 10/08/23 Copyright 1995,2000-2010 J. Schilling */ X/* X * Generic header for users of magnetic tape ioctl interface. X * X * If there is no local mtio.h or equivalent, define X * simplified mtio definitions here in order X * to be able to do at least remote mtio on systems X * that have no local mtio X * X * Copyright (c) 1995,2000-2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_MTIO_H X#define _SCHILY_MTIO_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifdef HAVE_SYS_MTIO_H X X#include X X#else /* ! HAVE_SYS_MTIO_H */ X X X#ifdef __cplusplus Xextern "C" { X#endif X X/* X * Definitions for magnetic tape io control commands X */ X X/* X * structure for MTIOCTOP - magnetic tape operation command X */ Xstruct mtop { X short mt_op; /* op code (see below) */ X daddr_t mt_count; /* repeat count or param */ X}; X X/* X * op code values for mt_op X */ X#define MTWEOF 0 /* write EOF record(s) */ X#define MTFSF 1 /* fwd space over file mark(s) */ X#define MTBSF 2 /* back space over file mark(s) (1/2" only ) */ X#define MTFSR 3 /* fwd space record(s) (to inter-record gap) */ X#define MTBSR 4 /* back space record(s) (to inter-record gap) */ X#define MTREW 5 /* rewind tape */ X#define MTOFFL 6 /* rewind and put the drive offline */ X#define MTNOP 7 /* no operation (sets status ?) */ X X/* X * structure for MTIOCGET - magnetic tape get status command X */ Xstruct mtget { X short mt_type; /* type of magnetic tape device */ X /* the next two regs are device dependent */ X short mt_dsreg; /* drive status 'register' */ X short mt_erreg; /* error 'register' */ X daddr_t mt_resid; /* transfer residual count */ X daddr_t mt_fileno; /* file # for current position */ X daddr_t mt_blkno; /* block # for current position */ X}; X X#define HAVE_MTGET_TYPE X#define HAVE_MTGET_DSREG X#define HAVE_MTGET_ERREG X#define HAVE_MTGET_RESID X#define HAVE_MTGET_FILENO X#define HAVE_MTGET_BLKNO X X/* X * Define some junk here as software may assume that these two definitions X * are always present. X */ X#define MTIOCGET 0x12340001 X#define MTIOCTOP 0x12340002 X X#ifdef __cplusplus X} X#endif X X#endif /* HAVE_SYS_MTIO_H */ X X#endif /* _SCHILY_MTIO_H */ END-of-star-1.6/include/schily/mtio.h echo x - star-1.6/include/schily/signal.h sed 's/^X//' >star-1.6/include/schily/signal.h << 'END-of-star-1.6/include/schily/signal.h' X/* @(#)signal.h 1.13 18/06/16 Copyright 1997-2018 J. Schilling */ X/* X * Signal abstraction for signals X * X * Copyright (c) 1997-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_SIGNAL_H X#define _SCHILY_SIGNAL_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X#ifndef _SCHILY_TYPES_H X#include X#endif X X#ifdef HAVE_SIGNAL_H X#ifndef _INCL_SIGNAL_H X#include X#define _INCL_SIGNAL_H X#endif X#endif X X#ifndef SIGCHLD /* POSIX name is missing */ X#ifdef SIGCLD X#define SIGCHLD SIGCLD X#endif X#endif X X/* X * Very old Solaris versions (probably only before 1993) did not include X * siginfo.h in sginal.h. POSIX requires the availaibility of siginfo_t X * from signal.h, so include siginfo.h if available on this platform. X */ X#ifdef HAVE_SIGINFO_H X#ifndef _INCL_SIGINFO_H X#include X#define _INCL_SIGINFO_H X#endif X#else X#ifdef HAVE_SYS_SIGINFO_H X#ifndef _INCL_SYS_SIGINFO_H X#include X#define _INCL_SYS_SIGINFO_H X#endif X#endif X#endif X X#if !defined(HAVE_TYPE_SIGINFO_T) && !defined(HAVE_SIGINFO_T) X X#ifndef _SCHILY_TIME_H X#include X#endif X#ifndef _SCHILY_TIMES_H X#include X#endif X Xtypedef struct { X int si_code; /* Child status code */ X pid_t si_pid; /* Child pid */ X int si_status; /* Child exit code or signal number */ X clock_t si_utime; X clock_t si_stime; X} siginfo_t; X X#ifndef id_t X#define id_t pid_t X#endif X X#endif /* !defined(HAVE_TYPE_SIGINFO_T) && !defined(HAVE_SIGINFO_T) */ X X#endif /* _SCHILY_SIGNAL_H */ END-of-star-1.6/include/schily/signal.h echo x - star-1.6/include/schily/patmatch.h sed 's/^X//' >star-1.6/include/schily/patmatch.h << 'END-of-star-1.6/include/schily/patmatch.h' X/* @(#)patmatch.h 1.16 17/07/02 Copyright 1985,1993-2017 J. Schilling */ X X#ifndef _SCHILY_PATMATCH_H X#define _SCHILY_PATMATCH_H X/* X * Definitions for the pattern matching functions. X * X * Copyright (c) 1985,1993-2017 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X/* X * The pattern matching functions are based on the algorithm X * presented by Martin Richards in: X * X * "A Compact Function for Regular Expression Pattern Matching", X * Software-Practice and Experience, Vol. 9, 527-534 (1979) X * X * Several changes have been made to the original source which has been X * written in BCPL: X * X * '/' is replaced by '!' (to allow UNIX filenames) X * '(',')' are replaced by '{', '}' X * '\'' is replaced by '\\' (UNIX compatible quote) X * X * Character classes have been added to allow "[]" X * to be used. X * Start of line '^' and end of line '$' have been added. X * X * Any number in the following comment is zero or more occurrencies X */ X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifdef __cplusplus Xextern "C" { X#endif X X#define ALT '!' /* Alternation in match i.e. this!that!the_other */ X#define REP '#' /* Any number of occurrences of the following expr */ X#define NIL '%' /* Empty string (exactly nothing) */ X#define STAR '*' /* Any number of any character (equivalent of #?) */ X#define ANY '?' /* Any one character */ X#define QUOTE '\\' /* Quotes the next character */ X#define LBRACK '{' /* Begin of precedence grouping */ X#define RBRACK '}' /* End of precedence grouping */ X#define LCLASS '[' /* Begin of character set */ X#define RCLASS ']' /* End of character set */ X#define NOT '^' /* If first in set: invert set content */ X#define RANGE '-' /* Range notation in sets */ X#define START '^' /* Begin of a line */ X#define END '$' /* End of a line */ X X/* X * A list of case statements that may be used for a issimple() or ispattern() X * funtion that checks whether a string conrtains characters that need the X * pattern matcher. X * X * Note that this list does not contain NOT or RANGE because you need X * LCLASS and RCLASS in addition. X */ X#define casePAT case ALT: case REP: case NIL: case STAR: case ANY: \ X case QUOTE: case LBRACK: case RBRACK: \ X case LCLASS: case RCLASS: case START: case END: X X X#define MAXPAT 128 /* Max length of pattern for opatmatch()/opatlmatch() */ X Xextern int patcompile __PR((const unsigned char *__pat, int __patlen, X int *__aux)); X Xextern unsigned char *opatmatch __PR((const unsigned char *__pat, X const int *__aux, X const unsigned char *__str, X int __soff, int __slen, X int __alt)); Xextern unsigned char *opatlmatch __PR((const unsigned char *__pat, X const int *__aux, X const unsigned char *__str, X int __soff, int __slen, X int __alt)); Xextern unsigned char *patmatch __PR((const unsigned char *__pat, X const int *__aux, X const unsigned char *__str, X int __soff, int __slen, X int __alt, int __state[])); Xextern unsigned char *patlmatch __PR((const unsigned char *__pat, X const int *__aux, X const unsigned char *__str, X int __soff, int __slen, X int __alt, int __state[])); X X#ifdef __cplusplus X} X#endif X X#ifdef _SCHILY_WCHAR_H X X#ifdef __cplusplus Xextern "C" { X#endif X Xextern int patwcompile __PR((const wchar_t *__pat, int __patlen, X int *__aux)); Xextern wchar_t *patwmatch __PR((const wchar_t *__pat, const int *__aux, X const wchar_t *__str, X int __soff, int __slen, X int __alt, int __state[])); Xextern wchar_t *patwlmatch __PR((const wchar_t *__pat, const int *__aux, X const wchar_t *__str, X int __soff, int __slen, X int __alt, int __state[])); X Xextern unsigned char *patmbmatch __PR((const wchar_t *__pat, X const int *__aux, X const unsigned char *__str, X int __soff, int __slen, X int __alt, int __state[])); Xextern unsigned char *patmblmatch __PR((const wchar_t *__pat, X const int *__aux, X const unsigned char *__str, X int __soff, int __slen, X int __alt, int __state[])); X X X#ifdef __cplusplus X} X#endif X#endif /* _SCHILY_WCHAR_H */ X X#endif /* _SCHILY_PATMATCH_H */ END-of-star-1.6/include/schily/patmatch.h echo x - star-1.6/include/schily/prototyp.h sed 's/^X//' >star-1.6/include/schily/prototyp.h << 'END-of-star-1.6/include/schily/prototyp.h' X/* @(#)prototyp.h 1.17 15/12/26 Copyright 1995-2015 J. Schilling */ X/* X * Definitions for dealing with ANSI / KR C-Compilers X * X * Copyright (c) 1995-2015 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X/* X * includes X * To be correct, we need to include before we test X * for _SCHILY_PROTOTYP_H X * X * In order to keep the silly Solaris hdrchk(1) quiet, we are forced to X * have the _SCHILY_PROTOTYP_H first in . X * To keep hdrchk(1) quiet and be correct, we need to introduce a second X * guard _SCHILY_PROTOTYP_X_H. X */ X#ifndef _SCHILY_PROTOTYP_H X#define _SCHILY_PROTOTYP_H X X#ifndef _SCHILY_MCONFIG_H X#undef _SCHILY_PROTOTYP_H X#include X#endif X X#ifndef _SCHILY_PROTOTYP_X_H X#define _SCHILY_PROTOTYP_X_H X X#include X X#ifdef __cplusplus Xextern "C" { X#endif X X#ifndef PROTOTYPES X /* X * If this has already been defined, X * someone else knows better than us... X */ X# ifdef __STDC__ X# if __STDC__ /* ANSI C */ X# define PROTOTYPES X# endif X# if defined(sun) && __STDC__ - 0 == 0 /* Sun C */ X# define PROTOTYPES X# endif X# endif X#endif /* PROTOTYPES */ X X#if !defined(PROTOTYPES) && (defined(__cplusplus) || defined(_MSC_VER)) X /* X * C++ always supports prototypes. X * Define PROTOTYPES so we are not forced to make X * a separtate autoconf run for C++ X * X * Microsoft C has prototypes but does not define __STDC__ X */ X# define PROTOTYPES X#endif X X/* X * If we have prototypes, we should have stdlib.h string.h stdarg.h X */ X#ifdef PROTOTYPES X#if !(defined(SABER) && defined(sun)) X# ifndef HAVE_STDARG_H X# define HAVE_STDARG_H X# endif X#endif X#ifndef JOS X# ifndef HAVE_STDLIB_H X# define HAVE_STDLIB_H X# endif X# ifndef HAVE_STRING_H X# define HAVE_STRING_H X# endif X# ifndef HAVE_STDC_HEADERS X# define HAVE_STDC_HEADERS X# endif X# ifndef STDC_HEADERS X# define STDC_HEADERS /* GNU name */ X# endif X#endif X#endif X X#ifdef NO_PROTOTYPES /* Force not to use prototypes */ X# undef PROTOTYPES X#endif X X#ifdef PROTOTYPES X# define __PR(a) a X#else X# define __PR(a) () X#endif X X#if !defined(PROTOTYPES) && !defined(NO_CONST_DEFINE) X# ifndef const X# define const X# endif X# ifndef signed X# define signed X# endif X# ifndef volatile X# define volatile X# endif X#endif X X#ifdef PROTOTYPES X#define ALERT '\a' X#else X#define ALERT '\07' X#endif X X#ifdef __cplusplus X} X#endif X X#endif /* _SCHILY_PROTOTYP_X_H */ X#endif /* _SCHILY_PROTOTYP_H */ END-of-star-1.6/include/schily/prototyp.h echo x - star-1.6/include/schily/rmtio.h sed 's/^X//' >star-1.6/include/schily/rmtio.h << 'END-of-star-1.6/include/schily/rmtio.h' X/* @(#)rmtio.h 1.7 10/08/24 Copyright 1995,2000-2010 J. Schilling */ X/* X * Definition for enhanced remote tape IO X * X * Copyright (c) 1995,2000-2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_RMTIO_H X#define _SCHILY_RMTIO_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X#ifndef _SCHILY_UTYPES_H X#include X#endif X X#ifdef __cplusplus Xextern "C" { X#endif X X/* X * values for mt_op X */ X#define RMTWEOF 0 /* write an end-of-file record */ X#define RMTFSF 1 /* forward space over file mark */ X#define RMTBSF 2 /* backward space over file mark (1/2" only ) */ X#define RMTFSR 3 /* forward space to inter-record gap */ X#define RMTBSR 4 /* backward space to inter-record gap */ X#define RMTREW 5 /* rewind */ X#define RMTOFFL 6 /* rewind and put the drive offline */ X#define RMTNOP 7 /* no operation, sets status only */ X X#ifdef __needed__ X#define MTRETEN 8 /* retension the tape (cartridge tape only) */ X#define MTERASE 9 /* erase the entire tape */ X#define MTEOM 10 /* position to end of media */ X#define MTNBSF 11 /* backward space file to BOF */ X X#define MTSRSZ 12 /* set record size */ X#define MTGRSZ 13 /* get record size */ X#define MTLOAD 14 /* for loading a tape (use o_delay to open */ X /* the tape device) */ X#endif X X/* X * Definitions for the new RMT Protocol version 1 X * X * The new Protocol version tries to make the use X * of rmtioctl() more portable between different platforms. X */ X#define RMTIVERSION -1 /* Opcode to request version */ X#define RMT_NOVERSION -1 /* Old version code */ X#define RMT_VERSION 1 /* New (current) version code */ X X/* X * Support for commands bejond MTWEOF..MTNOP (0..7) X */ X#define RMTICACHE 0 /* enable controller cache */ X#define RMTINOCACHE 1 /* disable controller cache */ X#define RMTIRETEN 2 /* retension the tape (cartridge tape only) */ X#define RMTIERASE 3 /* erase the entire tape */ X#define RMTIEOM 4 /* position to end of media */ X#define RMTINBSF 5 /* backward space file to BOF */ X X/* X * Old MTIOCGET copies a binary version of struct mtget back X * over the wire. This is highly non portable. X * MTS_* retrieves ascii versions (%d format) of a single X * field in the struct mtget. X * NOTE: MTS_ERREG may only be valid on the first call and X * must be retrived first. X */ X#define MTS_TYPE 'T' /* mtget.mt_type */ X#define MTS_DSREG 'D' /* mtget.mt_dsreg */ X#define MTS_ERREG 'E' /* mtget.mt_erreg */ X#define MTS_RESID 'R' /* mtget.mt_resid */ X#define MTS_FILENO 'F' /* mtget.mt_fileno */ X#define MTS_BLKNO 'B' /* mtget.mt_blkno */ X#define MTS_FLAGS 'f' /* mtget.mt_flags */ X#define MTS_BF 'b' /* mtget.mt_bf */ X X/* X * structure for remote MTIOCGET - mag tape get status command X */ Xstruct rmtget { X Llong mt_type; /* type of magtape device */ X /* the following two registers are grossly device dependent */ X Llong mt_dsreg; /* ``drive status'' register */ X Int32_t mt_dsreg1; /* ``drive status'' register */ X Int32_t mt_dsreg2; /* ``drive status'' register */ X Llong mt_gstat; /* ``generic status'' register */ X Llong mt_erreg; /* ``error'' register */ X /* optional error info. */ X Llong mt_resid; /* residual count */ X Llong mt_fileno; /* file number of current position */ X Llong mt_blkno; /* block number of current position */ X Llong mt_flags; X Llong mt_gflags; /* generic flags */ X long mt_bf; /* optimum blocking factor */ X int mt_xflags; /* eXistence flags for struct members */ X}; X X/* X * Values for mt_xflags X */ X#define RMT_TYPE 0x0001 /* mt_type/mt_model present */ X#define RMT_DSREG 0x0002 /* mt_dsreg present */ X#define RMT_DSREG1 0x0004 /* mt_dsreg1 present */ X#define RMT_DSREG2 0x0008 /* mt_dsreg2 present */ X#define RMT_GSTAT 0x0010 /* mt_gstat present */ X#define RMT_ERREG 0x0020 /* mt_erreg present */ X#define RMT_RESID 0x0040 /* mt_resid present */ X#define RMT_FILENO 0x0080 /* mt_fileno present */ X#define RMT_BLKNO 0x0100 /* mt_blkno present */ X#define RMT_FLAGS 0x0200 /* mt_flags present */ X#define RMT_BF 0x0400 /* mt_bf present */ X#define RMT_COMPAT 0x0800 /* Created from old compat data */ X X/* X * values for mt_flags X */ X#define RMTF_SCSI 0x01 X#define RMTF_REEL 0x02 X#define RMTF_ASF 0x04 X#define RMTF_TAPE_HEAD_DIRTY 0x08 X#define RMTF_TAPE_CLN_SUPPORTED 0x10 X X/* X * these are recommended X */ X#ifdef __needed__ X#define MT_ISQIC 0x32 /* generic QIC tape drive */ X#define MT_ISREEL 0x33 /* generic reel tape drive */ X#define MT_ISDAT 0x34 /* generic DAT tape drive */ X#define MT_IS8MM 0x35 /* generic 8mm tape drive */ X#define MT_ISOTHER 0x36 /* generic other type of tape drive */ X X/* more Sun devices */ X#define MT_ISTAND25G 0x37 /* sun: SCSI Tandberg 2.5 Gig QIC */ X#define MT_ISDLT 0x38 /* sun: SCSI DLT tape drive */ X#define MT_ISSTK9840 0x39 /* sun: STK 9840 (Ironsides) */ X#endif X X#ifdef __cplusplus X} X#endif X X#endif /* _SCHILY_RMTIO_H */ END-of-star-1.6/include/schily/rmtio.h echo x - star-1.6/include/schily/schily.h sed 's/^X//' >star-1.6/include/schily/schily.h << 'END-of-star-1.6/include/schily/schily.h' X/* @(#)schily.h 1.130 18/10/14 Copyright 1985-2018 J. Schilling */ X/* X * Definitions for libschily X * X * This file should be included past: X * X * schily/mconfig.h / config.h X * schily/standard.h X * stdio.h X * stdlib.h (better use schily/stdlib.h) X * unistd.h (better use schily/unistd.h) needed f. LARGEFILE support X * schily/string.h X * sys/types.h X * X * If you need stdio.h, you must include it before schily/schily.h X * X * NOTE: If you need ctype.h and did not include stdio.h you need to X * include ctype.h past schily/schily.h as OpenBSD does not follow POSIX X * and defines EOF in ctype.h X * X * Copyright (c) 1985-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_SCHILY_H X#define _SCHILY_SCHILY_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifndef _SCHILY_STANDARD_H X#include X#endif X#ifndef _SCHILY_CCOMDEFS_H X#include X#endif X X#ifdef __cplusplus Xextern "C" { X#endif X X#if defined(_INCL_SYS_TYPES_H) || defined(_INCL_TYPES_H) || defined(off_t) X# ifndef FOUND_OFF_T X# define FOUND_OFF_T X# endif X#endif X#if defined(_INCL_SYS_TYPES_H) || defined(_INCL_TYPES_H) || defined(size_t) X# ifndef FOUND_SIZE_T X# define FOUND_SIZE_T X# endif X#endif X#if defined(_MSC_VER) && !defined(_SIZE_T_DEFINED) X# undef FOUND_SIZE_T X#endif X X#ifdef __never_def__ X/* X * It turns out that we cannot use the folloginw definition because there are X * some platforms that do not behave application friendly. These are mainly X * BSD-4.4 based systems (which #undef a definition when size_t is available. X * We actually removed this code because of a problem with QNX Neutrino. X * For this reason, it is important not to include directly but X * via the Schily SING include files so we know whether it has been included X * before we come here. X */ X#if defined(_SIZE_T) || defined(_T_SIZE_) || defined(_T_SIZE) || \ X defined(__SIZE_T) || defined(_SIZE_T_) || \ X defined(_GCC_SIZE_T) || defined(_SIZET_) || \ X defined(__sys_stdtypes_h) || defined(___int_size_t_h) || defined(size_t) X X#ifndef FOUND_SIZE_T X# define FOUND_SIZE_T /* We already included a size_t definition */ X#endif X#endif X#endif /* __never_def__ */ X X#if defined(HAVE_LARGEFILES) X# define _fcons _fcons64 X# define fdup fdup64 X# define fileluopen fileluopen64 X# define fileopen fileopen64 X# define filemopen filemopen64 X# define filepos filepos64 X# define filereopen filereopen64 X# define fileseek fileseek64 X# define filesize filesize64 X# define filestat filestat64 X# define _openfd _openfd64 X#endif X X/* X * The official POSIX rule is not to define "new" interfaces that X * are in conflict with older interfaces of the same name. X * Our interfaces fexec*() have been defined and published in 1982. X * The new POSIX interfaces define a different interface and the X * new POSIX interfaces even use names that are not compatible with X * POSIX rules. The new POSIX interfaces in question should be called X * fdexec*() to follow the rules of other similar POSIX functions. X * Simiar problems exist with getline()/fgetline(). X */ X#if defined(HAVE_RAW_FEXECL) || defined(HAVE_RAW_FEXECLE) || \ X defined(HAVE_RAW_FEXECV) || defined(HAVE_RAW_FEXECVE) X#define RENAME_FEXEC X#endif X#if defined(HAVE_RAW_FSPAWNV) || defined(HAVE_RAW_FSPAWNL) || \ X defined(HAVE_RAW_FSPAWNV_NOWAIT) X#define RENAME_FSPAWN X#endif X#if defined(HAVE_RAW_GETLINE) || defined(HAVE_RAW_FGETLINE) X#define RENAME_GETLINE X#endif X X#ifdef __needed__ X#define RENAME_FEXEC X#define RENAME_FSPAWN X#define RENAME_GETLINE X#endif X X#if defined(RENAME_FEXEC) || defined(RENAME_FSPAWN) X#ifndef _SCHILY_UNISTD_H X#include /* Need to incl. before fexec*() protoypes */ X#endif X#endif X X#if defined(RENAME_GETLINE) X#ifndef _SCHILY_STDIO_H X#include /* Need to incl. before *getline() protoypes */ X#endif X X#endif X X#ifdef EOF /* stdio.h has been included */ X Xextern int _cvmod __PR((const char *, int *, int *)); Xextern FILE *_fcons __PR((FILE *, int, int)); Xextern FILE *fdup __PR((FILE *)); X#if !defined(fdown) || defined(PROTOTYPES) X/* X * We cannot declare fdown() with K&R in case that fdown() has been #define'd X */ Xextern int fdown __PR((FILE *)); X#endif Xextern int js_fexecl __PR((const char *, FILE *, FILE *, FILE *, X const char *, ...)); Xextern int js_fexecle __PR((const char *, FILE *, FILE *, FILE *, X const char *, ...)); X /* 6th arg not const, fexecv forces av[ac] = NULL */ Xextern int js_fexecv __PR((const char *, FILE *, FILE *, FILE *, int, X char **)); Xextern int js_fexecve __PR((const char *, FILE *, FILE *, FILE *, X char * const *, char * const *)); Xextern int js_fspawnv __PR((FILE *, FILE *, FILE *, int, char * const *)); Xextern int js_fspawnl __PR((FILE *, FILE *, FILE *, const char *, ...)); Xextern int js_fspawnv_nowait __PR((FILE *, FILE *, FILE *, X const char *, int, char *const*)); Xextern int js_fgetline __PR((FILE *, char *, int)); X#ifdef FOUND_SIZE_T Xextern ssize_t fgetaline __PR((FILE *, char **, size_t *)); Xextern ssize_t getaline __PR((char **, size_t *)); X#endif Xextern int fgetstr __PR((FILE *, char *, int)); Xextern int file_getraise __PR((FILE *)); Xextern void file_raise __PR((FILE *, int)); Xextern int fileclose __PR((FILE *)); Xextern FILE *fileluopen __PR((int, const char *)); Xextern FILE *fileopen __PR((const char *, const char *)); X#ifdef _SCHILY_TYPES_H Xextern FILE *filemopen __PR((const char *, const char *, mode_t)); X#endif X#ifdef FOUND_OFF_T Xextern off_t filepos __PR((FILE *)); X#endif X#ifdef FOUND_SIZE_T Xextern ssize_t fileread __PR((FILE *, void *, size_t)); Xextern ssize_t ffileread __PR((FILE *, void *, size_t)); X#endif Xextern FILE *filereopen __PR((const char *, const char *, FILE *)); X#ifdef FOUND_OFF_T Xextern int fileseek __PR((FILE *, off_t)); Xextern off_t filesize __PR((FILE *)); X#endif X#ifdef S_IFMT Xextern int filestat __PR((FILE *, struct stat *)); X#endif X#ifdef FOUND_SIZE_T Xextern ssize_t filewrite __PR((FILE *, void *, size_t)); Xextern ssize_t ffilewrite __PR((FILE *, void *, size_t)); X#endif Xextern int flush __PR((void)); Xextern int fpipe __PR((FILE **)); X#ifdef __never__ Xextern int fprintf __PR((FILE *, const char *, ...)) __printflike__(2, 3); X#endif Xextern int getbroken __PR((FILE *, char *, char, char **, int)); Xextern int ofindline __PR((FILE *, char, const char *, int, X char **, int)); Xextern int peekc __PR((FILE *)); X X#ifdef __never_def__ X/* X * We cannot define this or we may get into problems with DOS based systems. X */ Xextern int spawnv __PR((FILE *, FILE *, FILE *, int, char * const *)); Xextern int spawnl __PR((FILE *, FILE *, FILE *, const char *, ...)); Xextern int spawnv_nowait __PR((FILE *, FILE *, FILE *, X const char *, int, char *const*)); X#endif /* __never_def__ */ X#endif /* EOF */ X X/* X * Flags for absfpath() and resolvefpath(): X */ X#define RSPF_EXIST 0x01 /* All path components must exist */ X#define RSPF_NOFOLLOW_LAST 0x02 /* Don't follow link in last pathcomp */ X X#ifdef FOUND_SIZE_T Xextern char *abspath __PR((const char *relp, char *absp, size_t asize)); Xextern char *absnpath __PR((const char *relp, char *absp, size_t asize)); Xextern char *absfpath __PR((const char *relp, char *absp, size_t asize, X int __flags)); X#ifndef HAVE_RESOLVEPATH Xextern int resolvepath __PR((const char *__path, X char *__buf, size_t __bufsiz)); X#endif Xextern int resolvenpath __PR((const char *__path, X char *__buf, size_t __bufsiz)); Xextern int resolvefpath __PR((const char *__path, X char *__buf, size_t __bufsiz, int __flags)); X#endif X X#ifdef _SCHILY_TYPES_H Xextern int mkdirs __PR((char *, mode_t)); Xextern int makedirs __PR((char *, mode_t, int __striplast)); X#endif X Xextern int lxchdir __PR((char *)); X#ifdef HAVE_FCHDIR X#define fdsetname(fd, name) (0) X#define fdclosename(fd) (0) X#else Xextern int fdsetname __PR((int fd, const char *name)); Xextern int fdclosename __PR((int fd)); X#endif Xextern int diropen __PR((const char *)); Xextern int dirrdopen __PR((const char *)); Xextern int dirclose __PR((int)); X Xstruct save_wd { X int fd; X char *name; X}; X Xextern int savewd __PR((struct save_wd *sp)); Xextern void closewd __PR((struct save_wd *sp)); Xextern int restorewd __PR((struct save_wd *sp)); X X X#ifdef _SCHILY_UTYPES_H Xtypedef struct gnmult { X char key; X Llong mult; X} gnmult_t; X Xextern int getllnum __PR((char *arg, Llong *lvalp)); Xextern int getxnum __PR((char *arg, long *valp, gnmult_t *mult)); Xextern int getllxnum __PR((char *arg, Llong *lvalp, gnmult_t *mult)); X Xextern int getlltnum __PR((char *arg, Llong *lvalp)); Xextern int getxtnum __PR((char *arg, time_t *valp, gnmult_t *mult)); Xextern int getllxtnum __PR((char *arg, Llong *lvalp, gnmult_t *mult)); X#endif Xextern int getnum __PR((char *arg, long *valp)); X#ifdef _SCHILY_TIME_H Xextern int gettnum __PR((char *arg, time_t *valp)); X#endif X X#ifdef _SCHILY_TIME_H X Xextern int getnstimeofday __PR((struct timespec *__tp)); Xextern int setnstimeofday __PR((struct timespec *__tp)); X X#ifdef _SCHILY_UTYPES_H Xextern Llong mklgmtime __PR((struct tm *)); X#endif Xextern time_t mkgmtime __PR((struct tm *)); X#endif X X X#ifdef EOF /* stdio.h has been included */ X#ifdef _SCHILY_TYPES_H X/* X * getperm() flags: X */ X#define GP_NOX 0 /* This is not a dir and 'X' is not valid */ X#define GP_DOX 1 /* 'X' perm character is valid */ X#define GP_XERR 2 /* 'X' perm characters are invalid */ X#define GP_FPERM 4 /* TRUE if we implement find -perm */ X#define GP_UMASK 8 /* TRUE if we implement umask */ X Xextern int getperm __PR((FILE *f, char *perm, char *opname, \ X mode_t *modep, int smode, int flag)); Xextern void permtostr __PR((mode_t mode, char *)); X#endif X#endif X X#ifdef FOUND_SIZE_T Xextern ssize_t _niread __PR((int, void *, size_t)); Xextern ssize_t _niwrite __PR((int, void *, size_t)); Xextern ssize_t _nixread __PR((int, void *, size_t)); Xextern ssize_t _nixwrite __PR((int, void *, size_t)); X#endif Xextern int _openfd __PR((const char *, int)); Xextern int on_comerr __PR((void (*fun)(int, void *), void *arg)); X/*PRINTFLIKE1*/ Xextern void comerr __PR((const char *, ...)) __printflike__(1, 2); X/*PRINTFLIKE2*/ Xextern void xcomerr __PR((int, const char *, ...)) __printflike__(2, 3); X/*PRINTFLIKE2*/ Xextern void comerrno __PR((int, const char *, ...)) __printflike__(2, 3); X/*PRINTFLIKE3*/ Xextern void xcomerrno __PR((int, int, const char *, ...)) __printflike__(3, 4); X/*PRINTFLIKE1*/ Xextern int errmsg __PR((const char *, ...)) __printflike__(1, 2); X/*PRINTFLIKE2*/ Xextern int errmsgno __PR((int, const char *, ...)) __printflike__(2, 3); X#ifdef FOUND_SIZE_T X/*PRINTFLIKE3*/ Xextern int serrmsg __PR((char *, size_t, const char *, ...)) X __printflike__(3, 4); X/*PRINTFLIKE4*/ Xextern int serrmsgno __PR((int, char *, size_t, const char *, ...)) X __printflike__(4, 5); X#endif Xextern void comexit __PR((int)); Xextern char *errmsgstr __PR((int)); X X/*PRINTFLIKE1*/ Xextern void gtcomerr __PR((const char *, ...)) __printflike__(1, 2); X/*PRINTFLIKE2*/ Xextern void gtxcomerr __PR((int, const char *, ...)) __printflike__(2, 3); X/*PRINTFLIKE2*/ Xextern void gtcomerrno __PR((int, const char *, ...)) __printflike__(2, 3); X/*PRINTFLIKE3*/ Xextern void gtxcomerrno __PR((int, int, const char *, ...)) __printflike__(3, 4); X/*PRINTFLIKE1*/ Xextern int gterrmsg __PR((const char *, ...)) __printflike__(1, 2); X/*PRINTFLIKE2*/ Xextern int gterrmsgno __PR((int, const char *, ...)) __printflike__(2, 3); X X#ifdef GT_COMERR X#define comerr gtcomerr X#define xcomerr gtxcomerr X#define comerrno gtcomerrno X#define xcomerrno gtxcomerrno X#define errmsg gterrmsg X#define errmsgno gterrmsgno X#endif X X#ifdef EOF /* stdio.h has been included */ X/*PRINTFLIKE2*/ Xextern void fcomerr __PR((FILE *, const char *, ...)) X __printflike__(2, 3); X/*PRINTFLIKE3*/ Xextern void fxcomerr __PR((FILE *, int, const char *, ...)) X __printflike__(3, 4); X/*PRINTFLIKE3*/ Xextern void fcomerrno __PR((FILE *, int, const char *, ...)) X __printflike__(3, 4); X/*PRINTFLIKE4*/ Xextern void fxcomerrno __PR((FILE *, int, int, const char *, ...)) X __printflike__(4, 5); X/*PRINTFLIKE2*/ Xextern int ferrmsg __PR((FILE *, const char *, ...)) X __printflike__(2, 3); X/*PRINTFLIKE3*/ Xextern int ferrmsgno __PR((FILE *, int, const char *, ...)) X __printflike__(3, 4); X X/*PRINTFLIKE2*/ Xextern void fgtcomerr __PR((FILE *, const char *, ...)) X __printflike__(2, 3); X/*PRINTFLIKE3*/ Xextern void fgtxcomerr __PR((FILE *, int, const char *, ...)) X __printflike__(3, 4); X/*PRINTFLIKE3*/ Xextern void fgtcomerrno __PR((FILE *, int, const char *, ...)) X __printflike__(3, 4); X/*PRINTFLIKE4*/ Xextern void fgtxcomerrno __PR((FILE *, int, int, const char *, ...)) X __printflike__(4, 5); X/*PRINTFLIKE2*/ Xextern int fgterrmsg __PR((FILE *, const char *, ...)) X __printflike__(2, 3); X/*PRINTFLIKE3*/ Xextern int fgterrmsgno __PR((FILE *, int, const char *, ...)) X __printflike__(3, 4); X X#ifdef GT_COMERR X#define fcomerr fgtcomerr X#define fxcomerr fgtxcomerr X#define fcomerrno fgtcomerrno X#define fxcomerrno fgtxcomerrno X#define ferrmsg fgterrmsg X#define ferrmsgno fgterrmsgno X#endif X X#ifdef _SCHILY_VARARGS_H X/* X * Definitions for the second _comerr() parameter: X */ X#define COMERR_RETURN 0 /* Do not exit, return only */ X#define COMERR_EXIT 1 /* Exit program, map (X % 256) != X to -64 */ X#define COMERR_EXCODE 2 /* Exit program, do not map exit codes */ X/*PRINTFLIKE5*/ Xextern int _comerr __PR((FILE *, int, int, int, X const char *, va_list)); X#endif /* _SCHILY_VARARGS_H */ X#endif /* EOF */ X X/*PRINTFLIKE1*/ Xextern int error __PR((const char *, ...)) __printflike__(1, 2); X/*PRINTFLIKE1*/ Xextern int gterror __PR((const char *, ...)) __printflike__(1, 2); X X#ifdef GT_ERROR X#undef error X#define error gterror X#endif X X#ifdef FOUND_SIZE_T Xextern char *fillbytes __PR((void *, ssize_t, char)); Xextern char *zerobytes __PR((void *, ssize_t)); Xextern char *findbytes __PR((const void *, ssize_t, char)); X#endif Xextern char *findinpath __PR((char *__name, int __mode, X BOOL __plain_file, char *__path)); Xextern int findline __PR((const char *, char, const char *, X int, char **, int)); Xextern int js_getline __PR((char *, int)); Xextern int getstr __PR((char *, int)); Xextern int breakline __PR((char *, char, char **, int)); Xextern int getallargs __PR((int *, char * const**, const char *, ...)); Xextern int getargs __PR((int *, char * const**, const char *, ...)); Xextern int getfiles __PR((int *, char * const**, const char *)); Xextern char *astoi __PR((const char *, int *)); Xextern char *astol __PR((const char *, long *)); Xextern char *astolb __PR((const char *, long *, int base)); X#ifdef _SCHILY_UTYPES_H Xextern char *astoll __PR((const char *, Llong *)); Xextern char *astollb __PR((const char *, Llong *, int)); Xextern char *astoull __PR((const char *, Ullong *)); Xextern char *astoullb __PR((const char *, Ullong *, int)); X#endif X Xextern int patcompile __PR((const unsigned char *, int, int *)); Xextern unsigned char *patmatch __PR((const unsigned char *, const int *, X const unsigned char *, X int, int, int, int[])); Xextern unsigned char *patlmatch __PR((const unsigned char *, const int *, X const unsigned char *, X int, int, int, int[])); X X#ifdef __never__ Xextern int printf __PR((const char *, ...)) __printflike__(1, 2); X#endif X#ifdef FOUND_SIZE_T Xextern char *movebytes __PR((const void *, void *, ssize_t)); Xextern char *movecbytes __PR((const void *, void *, int, size_t)); X#endif X Xextern void save_args __PR((int, char **)); Xextern int saved_ac __PR((void)); Xextern char **saved_av __PR((void)); Xextern char *saved_av0 __PR((void)); Xextern char *searchfileinpath __PR((char *__name, int __mode, X int __file_mode, char *__path)); X#define SIP_ANY_FILE 0x00 /* Search for any file type */ X#define SIP_PLAIN_FILE 0x01 /* Search for plain files - not dirs */ X#define SIP_NO_PATH 0x10 /* Do not do PATH search */ X#define SIP_ONLY_PATH 0x20 /* Do only PATH search */ X#define SIP_NO_STRIPBIN 0x40 /* Do not strip "/bin" from PATH elem. */ X#define SIP_TYPE_MASK 0x0F /* Mask file type related bits */ X X#ifndef seterrno Xextern int seterrno __PR((int)); X#endif Xextern void set_progname __PR((const char *)); Xextern char *get_progname __PR((void)); Xextern char *get_progpath __PR((void)); Xextern char *getexecpath __PR((void)); X Xextern void setfp __PR((void * const *)); Xextern int wait_chld __PR((int)); /* for fspawnv_nowait() */ Xextern int geterrno __PR((void)); Xextern void raisecond __PR((const char *, long)); X#ifdef __never__ X/* X * sprintf() may be declared incorrectly somewhere else X * e.g. in old BSD include files X */ Xextern int sprintf __PR((char *, const char *, ...)); X#endif Xextern char *ovstrcpy __PR((char *, const char *)); Xextern char *strcatl __PR((char *, ...)); X#ifdef FOUND_SIZE_T Xextern size_t strlcatl __PR((char *, size_t, ...)); X#endif Xextern int streql __PR((const char *, const char *)); X#ifdef _SCHILY_WCHAR_H Xextern wchar_t *wcscatl __PR((wchar_t *, ...)); X#ifdef FOUND_SIZE_T Xextern size_t wcslcatl __PR((wchar_t *, size_t, ...)); X#endif Xextern int wcseql __PR((const wchar_t *, const wchar_t *)); X#endif X#ifdef va_arg Xextern int format __PR((void (*)(char, void *), void *, const char *, X va_list)); Xextern int fprformat __PR((void *, const char *, va_list)); X#else Xextern int format __PR((void (*)(char, void *), void *, const char *, void *)); Xextern int fprformat __PR((void *, const char *, void *)); X#endif X Xextern int ftoes __PR((char *, double, int, int)); Xextern int ftofs __PR((char *, double, int, int)); X#ifdef HAVE_LONGDOUBLE Xextern int qftoes __PR((char *, long double, int, int)); Xextern int qftofs __PR((char *, long double, int, int)); X#endif X X/*PRINTFLIKE1*/ Xextern int js_error __PR((const char *, ...)) __printflike__(1, 2); X/*PRINTFLIKE2*/ Xextern int js_dprintf __PR((int, const char *, ...)) X __printflike__(2, 3); X#ifdef EOF /* stdio.h has been included */ X/*PRINTFLIKE2*/ Xextern int js_fprintf __PR((FILE *, const char *, ...)) X __printflike__(2, 3); X#endif /* EOF */ X/*PRINTFLIKE1*/ Xextern int js_printf __PR((const char *, ...)) __printflike__(1, 2); X#ifdef FOUND_SIZE_T X/*PRINTFLIKE3*/ Xextern int js_snprintf __PR((char *, size_t, const char *, ...)) X __printflike__(3, 4); X#endif X/*PRINTFLIKE2*/ Xextern int js_sprintf __PR((char *, const char *, ...)) X __printflike__(2, 3); X X#ifdef EOF /* stdio.h has been included */ X/*PRINTFLIKE2*/ Xextern int fgtprintf __PR((FILE *, const char *, ...)) X __printflike__(2, 3); X#endif /* EOF */ X/*PRINTFLIKE1*/ Xextern int gtprintf __PR((const char *, ...)) __printflike__(1, 2); X X#ifdef FOUND_SIZE_T Xextern void swabbytes __PR((void *, ssize_t)); X#endif Xextern char **getmainfp __PR((void)); Xextern char **getavp __PR((void)); Xextern char *getav0 __PR((void)); Xextern void **getfp __PR((void)); Xextern int flush_reg_windows __PR((int)); X#ifdef FOUND_SIZE_T Xextern ssize_t cmpbytes __PR((const void *, const void *, ssize_t)); Xextern int cmpmbytes __PR((const void *, const void *, ssize_t)); Xextern ssize_t cmpnullbytes __PR((const void *, ssize_t)); X#endif X X#ifdef nonono X#if defined(HAVE_LARGEFILES) X/* X * To allow this, we need to figure out how to do autoconfiguration for off64_t X */ Xextern FILE *_fcons64 __PR((FILE *, int, int)); Xextern FILE *fdup64 __PR((FILE *)); Xextern FILE *fileluopen64 __PR((int, const char *)); Xextern FILE *fileopen64 __PR((const char *, const char *)); X#ifdef FOUND_OFF_T Xextern off64_t filepos64 __PR((FILE *)); X#endif Xextern FILE *filereopen64 __PR((const char *, const char *, FILE *)); X#ifdef FOUND_OFF_T Xextern int fileseek64 __PR((FILE *, off64_t)); Xextern off64_t filesize64 __PR((FILE *)); X#endif X#ifdef S_IFMT Xextern int filestat64 __PR((FILE *, struct stat *)); X#endif Xextern int _openfd64 __PR((const char *, int)); X#endif X#endif X X#ifndef NO_SCHILY_PRINT /* Define to disable *printf() redirects */ X#ifdef SCHILY_PRINT X#ifdef __never__ X#ifndef GT_ERROR X#undef error X#define error js_error X#endif X#endif /* __never__ */ X#undef dprintf X#define dprintf js_dprintf X#undef fprintf X#define fprintf js_fprintf X#undef printf X#define printf js_printf X#undef snprintf X#define snprintf js_snprintf X#undef sprintf X#define sprintf js_sprintf X#else X#ifndef HAVE_SNPRINTF X#undef snprintf X#define snprintf js_snprintf X#endif /* HAVE_SNPRINTF */ X#endif /* SCHILY_PRINT */ X#endif /* NO_SCHILY_PRINT */ X X#ifndef NO_SCHILY_GETLINE /* Define to disable *getline() redirect */ X#undef getline X#define getline js_getline X#undef fgetline X#define fgetline js_fgetline X#endif X X#ifndef NO_SCHILY_FEXEC /* Define to disable fexec*() redirect */ X#undef fexecl X#define fexecl js_fexecl X#undef fexecle X#define fexecle js_fexecle X#undef fexecv X#define fexecv js_fexecv X#undef fexecve X#define fexecve js_fexecve X#endif X X#ifndef NO_SCHILY_FSPAWN /* Define to disable fspawn*() redirect */ X#undef fspawnv X#define fspawnv js_fspawnv X#undef fspawnv_nowait X#define fspawnv_nowait js_fspawnv_nowait X#undef fspawnl X#define fspawnl js_fspawnl X#endif X Xextern int js_mexval __PR((int exval)); X#ifdef FOUND_SIZE_T Xextern void *js_malloc __PR((size_t size, char *msg)); Xextern void *js_realloc __PR((void *ptr, size_t size, char *msg)); X#endif Xextern char *js_savestr __PR((const char *s)); X X#ifdef _SCHILY_JMPDEFS_H X X/* X * Special values for the "jmp" parameter. X * X * Control how the siglongjmp() should be handled: X */ X#define JM_EXIT ((sigjmps_t *)-1) /* Call comexit(errno) instead */ X#define JM_RETURN ((sigjmps_t *)0) /* Return instead */ X Xextern int js_jmexval __PR((int exval)); X#ifdef FOUND_SIZE_T Xextern void *js_jmalloc __PR((size_t size, char *msg, sigjmps_t *jmp)); Xextern void *js_jrealloc __PR((void *ptr, size_t size, char *msg, X sigjmps_t *jmp)); X#endif Xextern char *js_jsavestr __PR((const char *s, sigjmps_t *jmp)); X Xextern int js_fjmexval __PR((int exval)); X#ifdef EOF /* stdio.h has been included */ X#ifdef FOUND_SIZE_T Xextern void *js_fjmalloc __PR((FILE *f, size_t size, char *msg, X sigjmps_t *jmp)); Xextern void *js_fjrealloc __PR((FILE *f, void *ptr, size_t size, X char *msg, sigjmps_t *jmp)); X#endif Xextern char *js_fjsavestr __PR((FILE *f, const char *s, sigjmps_t *jmp)); X#endif /* EOF */ X#endif /* _SCHILY_JMPDEFS_H */ X X#define ___mexval js_mexval X#define ___malloc js_malloc X#define ___realloc js_realloc X#define ___savestr js_savestr X#define __jmexval js_jmexval X#define __jmalloc js_jmalloc X#define __jrealloc js_jrealloc X#define __jsavestr js_jsavestr X#define __fjmalloc js_fjmalloc X#define __fjmexval js_fjmexval X#define __fjrealloc js_fjrealloc X#define __fjsavestr js_fjsavestr X X#ifdef __cplusplus X} X#endif X X#if defined(_JOS) || defined(JOS) X# ifndef _SCHILY_JOS_IO_H X# include X# endif X#endif X X#if !defined(_SCHILY_LIBPORT_H) && !defined(NO_LIBPORT_H) X#include X#endif X#if !defined(_SCHILY_HOSTNAME_H) && defined(USE_HOSTNAME_H) X#include X#endif X X#endif /* _SCHILY_SCHILY_H */ END-of-star-1.6/include/schily/schily.h echo x - star-1.6/include/schily/sigblk.h sed 's/^X//' >star-1.6/include/schily/sigblk.h << 'END-of-star-1.6/include/schily/sigblk.h' X/* @(#)sigblk.h 1.12 08/12/24 Copyright 1985, 1995-2008 J. Schilling */ X/* X * software signal block definition X * X * Copyright (c) 1985, 1995-2008 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_SIGBLK_H X#define _SCHILY_SIGBLK_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifdef __cplusplus Xextern "C" { X#endif X Xtypedef struct sigblk { X long **sb_savfp; /* Real saved framepointer */ X struct sigblk *sb_signext; /* Next sw signal blk for this func */ X short sb_siglen; /* Strlen for sb_signame */ X const char *sb_signame; /* Name of software signal */ X X /* sb_sigfun: function to call */ X int (*sb_sigfun) __PR((const char *, long, long)); X X long sb_sigarg; /* Second arg for sb_sigfun */ X} SIGBLK; X X/* X * The handler function is called with three arguments: X * X * 1) The name of the software signal X * 2) The argument from the handlecond() call X * 3) The argument from the raisecond() call X */ Xtypedef int (*handlefunc_t) __PR((const char *, long, long)); X Xextern void handlecond __PR((const char *, SIGBLK *, X int(*)(const char *, long, long), X long)); Xextern void raisecond __PR((const char *, long)); Xextern void starthandlecond __PR((SIGBLK *)); Xextern void unhandlecond __PR((SIGBLK *)); X X#ifdef __cplusplus X} X#endif X X#endif /* _SCHILY_SIGBLK_H */ END-of-star-1.6/include/schily/sigblk.h echo x - star-1.6/include/schily/stat.h sed 's/^X//' >star-1.6/include/schily/stat.h << 'END-of-star-1.6/include/schily/stat.h' X/* @(#)stat.h 1.20 15/08/23 Copyright 1998-2015 J. Schilling */ X/* X * Definitions for stat() file mode X * X * Copyright (c) 1998-2015 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_STAT_H X#define _SCHILY_STAT_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifndef _SCHILY_TYPES_H X#include /* Needed for sys/stat.h */ X#endif X#ifndef _INCL_SYS_STAT_H X#include /* For S_IS* and S_IF* */ X#define _INCL_SYS_STAT_H X#endif X X#if !defined(HAVE_LSTAT) || !defined(S_IFLNK) X#define lstat stat X#endif X X/* X * Apollo Domain/OS has a broken sys/stat.h that defines X * S_IFIFO == S_IFSOCK and creates trouble if the constants X * are used as case labels. X */ X#if S_IFIFO == S_IFSOCK X# undef S_IFSOCK X#endif X X#ifdef STAT_MACROS_BROKEN X#undef S_ISFIFO /* Named pipe */ X#undef S_ISCHR /* Character special */ X#undef S_ISMPC /* UNUSED multiplexed c */ X#undef S_ISDIR /* Directory */ X#undef S_ISNAM /* Named file (XENIX) */ X#undef S_ISBLK /* Block special */ X#undef S_ISMPB /* UNUSED multiplexed b */ X#undef S_ISREG /* Regular file */ X#undef S_ISCTG /* Contiguous file */ X#undef S_ISLNK /* Symbolic link */ X#undef S_ISSHAD /* Solaris shadow inode */ X#undef S_ISSOCK /* UNIX domain socket */ X#undef S_ISDOOR /* Solaris DOOR */ X#undef S_ISPORT /* Solaris event port */ X#undef S_ISWHT /* BSD whiteout */ X#undef S_ISEVC /* UNOS eventcount */ X#endif X X#ifndef S_ISFIFO /* 1 Named pipe */ X# ifdef S_IFIFO X# define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) X# else X# define S_ISFIFO(m) (0) X# endif X#endif X#ifndef S_ISCHR /* 2 Character special */ X# ifdef S_IFCHR X# define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) X# else X# define S_ISCHR(m) (0) X# endif X#endif X#ifndef S_ISMPC /* 3 UNUSED multiplexed char */ X# ifdef S_IFMPC X# define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC) X# else X# define S_ISMPC(m) (0) X# endif X#endif X#ifndef S_ISDIR /* 4 Directory */ X# ifdef S_IFDIR X# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) X# else X# define S_ISDIR(m) (0) X# endif X#endif X#ifndef S_ISNAM /* 5 Named file (XENIX) */ X# ifdef S_IFNAM X# define S_ISNAM(m) (((m) & S_IFMT) == S_IFNAM) X# else X# define S_ISNAM(m) (0) X# endif X#endif X#ifndef S_ISBLK /* 6 Block special */ X# ifdef S_IFBLK X# define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) X# else X# define S_ISBLK(m) (0) X# endif X#endif X#ifndef S_ISMPB /* 7 UNUSED multiplexed block */ X# ifdef S_IFMPB X# define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB) X# else X# define S_ISMPB(m) (0) X# endif X#endif X#ifndef S_ISREG /* 8 Regular file */ X# ifdef S_IFREG X# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) X# else X# define S_ISREG(m) (0) X# endif X#endif X#ifndef S_ISCTG /* 9 Contiguous file */ X# ifdef S_IFCTG X# define S_ISCTG(m) (((m) & S_IFMT) == S_IFCTG) X# else X# define S_ISCTG(m) (0) X# endif X#endif X#ifndef S_ISLNK /* 10 Symbolic link */ X# ifdef S_IFLNK X# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) X# else X# define S_ISLNK(m) (0) X# endif X#endif X#ifndef S_ISSHAD /* 11 Solaris shadow inode */ X# ifdef S_IFSHAD X# define S_ISSHAD(m) (((m) & S_IFMT) == S_IFSHAD) X# else X# define S_ISSHAD(m) (0) X# endif X#endif X#ifndef S_ISSOCK /* 12 UNIX domain socket */ X# ifdef S_IFSOCK X# define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK) X# else X# define S_ISSOCK(m) (0) X# endif X#endif X#ifndef S_ISDOOR /* 13 Solaris DOOR */ X# ifdef S_IFDOOR X# define S_ISDOOR(m) (((m) & S_IFMT) == S_IFDOOR) X# else X# define S_ISDOOR(m) (0) X# endif X#endif X#ifndef S_ISPORT /* 14 Solaris event port */ X# ifdef S_IFPORT X# define S_ISPORT(m) (((m) & S_IFMT) == S_IFPORT) X# else X# define S_ISPORT(m) (0) X# endif X#endif X#ifndef S_ISWHT /* 14 BSD whiteout */ X# ifdef S_IFWHT X# define S_ISWHT(m) (((m) & S_IFMT) == S_ISWHT) X# else X# define S_ISWHT(m) (0) X# endif X#endif X#ifndef S_IFEVC /* 15 UNOS eventcount */ X# ifdef S_IFEVC X# define S_ISEVC(m) (((m) & S_IFMT) == S_IFEVC) X# else X# define S_ISEVC(m) (0) X# endif X#endif X X#ifndef S_TYPEISMQ X/* X * XXX ??? where is a definition of a message queue ??? X */ X# define S_TYPEISMQ(_stbuf) (0) X#endif X#ifndef S_TYPEISSEM X# ifdef S_INSEM X# define S_TYPEISSEM(_stbuf) (S_ISNAM((_stbuf)->st_mode) && \ X (_stbuf)->st_rdev == S_INSEM) X# else X# define S_TYPEISSEM(_stbuf) (0) X# endif X#endif X#ifndef S_TYPEISSHM X# ifdef S_INSHD X# define S_TYPEISSHM(_stbuf) (S_ISNAM((_stbuf)->st_mode) && \ X (_stbuf)->st_rdev == S_INSHD) X# else X# define S_TYPEISSHM(_stbuf) (0) X# endif X#endif X X/* X * Mode permission bits. X * UNIX V.7 has only S_ISUID/S_ISGID/S_ISVTX and S_IREAD/S_IWRITE/S_IEXEC X * X * S_ISUID/S_ISGID/S_ISVTX is available on UNIX V.7 and POSIX X */ X#ifndef S_ISUID /* Set-user-ID on execution */ X#define S_ISUID 0 /* If it is not defined, it is not supported */ X#endif X#ifndef S_ISGID /* Set-group-ID on execution */ X#define S_ISGID 0 /* If it is not defined, it is not supported */ X#endif X#ifndef S_ISVTX /* On directories, restricted deletion flag */ X#define S_ISVTX 0 /* If it is not defined, it is not supported */ X#endif X X/* X * S_IREAD/S_IWRITE/S_IEXEC is only available on UNIX V.7 but not on POSIX X * Emulate these definitions to support compilation of programs like X * SCCS and the Bourne Shell and to make the other definitions simpler. X */ X#ifndef S_IREAD X#ifdef S_IRUSR X#define S_IREAD S_IRUSR /* Use POSIX name */ X#else X#define S_IREAD 0400 /* Very old UNIX, use own definition */ X#endif X#endif X#ifndef S_IWRITE X#ifdef S_IWUSR X#define S_IWRITE S_IWUSR /* Use POSIX name */ X#else X#define S_IWRITE 0200 /* Very old UNIX, use own definition */ X#endif X#endif X#ifndef S_IEXEC X#ifdef S_IXUSR X#define S_IEXEC S_IXUSR /* Use POSIX name */ X#else X#define S_IEXEC 0100 /* Very old UNIX, use own definition */ X#endif X#endif X X#ifndef S_IRUSR /* Read permission, owner */ X#define S_IRUSR S_IREAD /* Needed on old UNIX systems */ X#endif X#ifndef S_IWUSR /* Write permission, owner */ X#define S_IWUSR S_IWRITE /* Needed on old UNIX systems */ X#endif X#ifndef S_IXUSR /* Execute/search permission, owner */ X#define S_IXUSR S_IEXEC /* Needed on old UNIX systems */ X#endif X#ifndef S_IRGRP /* Read permission, group */ X#define S_IRGRP (S_IREAD >> 3) /* Needed on old UNIX systems */ X#endif X#ifndef S_IWGRP /* Write permission, group */ X#define S_IWGRP (S_IWRITE >> 3) /* Needed on old UNIX systems */ X#endif X#ifndef S_IXGRP /* Execute/search permission, group */ X#define S_IXGRP (S_IEXEC >> 3) /* Needed on old UNIX systems */ X#endif X#ifndef S_IROTH /* Read permission, others */ X#define S_IROTH (S_IREAD >> 6) /* Needed on old UNIX systems */ X#endif X#ifndef S_IWOTH /* Write permission, others */ X#define S_IWOTH (S_IWRITE >> 6) /* Needed on old UNIX systems */ X#endif X#ifndef S_IXOTH /* Execute/search permission, others */ X#define S_IXOTH (S_IEXEC >> 6) /* Needed on old UNIX systems */ X#endif X X#ifndef S_IRWXU /* Read, write, execute/search by owner */ X#define S_IRWXU (S_IRUSR|S_IWUSR|S_IXUSR) X#endif X#ifndef S_IRWXG /* Read, write, execute/search by group */ X#define S_IRWXG (S_IRGRP|S_IWGRP|S_IXGRP) X#endif X#ifndef S_IRWXO /* Read, write, execute/search by others */ X#define S_IRWXO (S_IROTH|S_IWOTH|S_IXOTH) X#endif X X/* X * SCO UnixWare has st_atim.st__tim.tv_nsec but the st_atim.tv_nsec tests also X * succeeds. If we use st_atim.tv_nsec on UnixWare, we get a warning about X * illegal structure usage. For this reason, our code needs to have X * #ifdef HAVE_ST__TIM before #ifdef HAVE_ST_NSEC. X */ X#if defined(HAVE_ST_ATIMENSEC) X X/* X * Found e.g. on NetBSD and OpenBSD. X */ X#define stat_ansecs(s) ((s)->st_atimensec) X#define stat_mnsecs(s) ((s)->st_mtimensec) X#define stat_cnsecs(s) ((s)->st_ctimensec) X X#define stat_set_ansecs(s, n) ((s)->st_atimensec = n) X#define stat_set_mnsecs(s, n) ((s)->st_mtimensec = n) X#define stat_set_cnsecs(s, n) ((s)->st_ctimensec = n) X X#define _FOUND_STAT_NSECS_ X#endif X X#if defined(HAVE_ST_ATIME_N) X X/* X * Found e.g. on AIX. X */ X#define stat_ansecs(s) ((s)->st_atime_n) X#define stat_mnsecs(s) ((s)->st_mtime_n) X#define stat_cnsecs(s) ((s)->st_ctime_n) X X#define stat_set_ansecs(s, n) ((s)->st_atime_n = n) X#define stat_set_mnsecs(s, n) ((s)->st_mtime_n = n) X#define stat_set_cnsecs(s, n) ((s)->st_ctime_n = n) X X#define _FOUND_STAT_NSECS_ X#endif X X#if defined(HAVE_ST__TIM) && !defined(_FOUND_STAT_NSECS_) X X/* X * Found e.g. on UnixWare. X */ X#define stat_ansecs(s) ((s)->st_atim.st__tim.tv_nsec) X#define stat_mnsecs(s) ((s)->st_mtim.st__tim.tv_nsec) X#define stat_cnsecs(s) ((s)->st_ctim.st__tim.tv_nsec) X X#define stat_set_ansecs(s, n) ((s)->st_atim.st__tim.tv_nsec = n) X#define stat_set_mnsecs(s, n) ((s)->st_mtim.st__tim.tv_nsec = n) X#define stat_set_cnsecs(s, n) ((s)->st_ctim.st__tim.tv_nsec = n) X X#define _FOUND_STAT_NSECS_ X#endif X X#if defined(HAVE_ST_NSEC) && !defined(_FOUND_STAT_NSECS_) X X/* X * Found e.g. on SunOS-5.x and IRIX. X */ X#define stat_ansecs(s) ((s)->st_atim.tv_nsec) X#define stat_mnsecs(s) ((s)->st_mtim.tv_nsec) X#define stat_cnsecs(s) ((s)->st_ctim.tv_nsec) X X#define stat_set_ansecs(s, n) ((s)->st_atim.tv_nsec = n) X#define stat_set_mnsecs(s, n) ((s)->st_mtim.tv_nsec = n) X#define stat_set_cnsecs(s, n) ((s)->st_ctim.tv_nsec = n) X X#define _FOUND_STAT_NSECS_ X#endif X X#if defined(HAVE_ST_ATIMESPEC) && !defined(_FOUND_STAT_NSECS_) X X/* X * Found e.g. on FreeBSD and Mac OS X. X */ X#define stat_ansecs(s) ((s)->st_atimespec.tv_nsec) X#define stat_mnsecs(s) ((s)->st_mtimespec.tv_nsec) X#define stat_cnsecs(s) ((s)->st_ctimespec.tv_nsec) X X#define stat_set_ansecs(s, n) ((s)->st_atimespec.tv_nsec = n) X#define stat_set_mnsecs(s, n) ((s)->st_mtimespec.tv_nsec = n) X#define stat_set_cnsecs(s, n) ((s)->st_ctimespec.tv_nsec = n) X X#define _FOUND_STAT_NSECS_ X#endif X X/* X * st_spare1 is last as some implementations keep backwards X * compatibility although there is one of the nsec implementations. X */ X#if defined(HAVE_ST_SPARE1) && !defined(_FOUND_STAT_NSECS_) X X/* X * Found e.g. on SunOS-4.x and HP-UX. X */ X#define stat_ansecs(s) ((s)->st_spare1 * 1000) X#define stat_mnsecs(s) ((s)->st_spare2 * 1000) X#define stat_cnsecs(s) ((s)->st_spare3 * 1000) X X#define stat_set_ansecs(s, n) ((s)->st_spare1 = n / 1000) X#define stat_set_mnsecs(s, n) ((s)->st_spare2 = n / 1000) X#define stat_set_cnsecs(s, n) ((s)->st_spare3 = n / 1000) X X#define _FOUND_STAT_USECS_ X#define _FOUND_STAT_NSECS_ X#endif X X#if !defined(_FOUND_STAT_NSECS_) X#define stat_ansecs(s) (0) X#define stat_mnsecs(s) (0) X#define stat_cnsecs(s) (0) X X#define stat_set_ansecs(s, n) (0) X#define stat_set_mnsecs(s, n) (0) X#define stat_set_cnsecs(s, n) (0) X#endif X X#endif /* _SCHILY_STAT_H */ END-of-star-1.6/include/schily/stat.h echo x - star-1.6/include/schily/time.h sed 's/^X//' >star-1.6/include/schily/time.h << 'END-of-star-1.6/include/schily/time.h' X/* @(#)time.h 1.20 13/10/01 Copyright 1996-2013 J. Schilling */ X/* X * Generic header for users of time(), gettimeofday() ... X * X * It includes definitions for time_t, struct timeval, ... X * X * Copyright (c) 1996-2013 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_TIME_H X#define _SCHILY_TIME_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifndef _SCHILY_TYPES_H X#include /* Needed for time_t */ X#endif X X#ifdef TIME_WITH_SYS_TIME X# ifndef _INCL_SYS_TIME_H X# include X# define _INCL_SYS_TIME_H X# endif X# ifndef _INCL_TIME_H X# include X# define _INCL_TIME_H X# endif X#else X#ifdef HAVE_SYS_TIME_H X# ifndef _INCL_SYS_TIME_H X# include X# define _INCL_SYS_TIME_H X# endif X#else X# ifndef _INCL_TIME_H X# include X# define _INCL_TIME_H X# endif X#endif X#endif X X#ifdef __cplusplus Xextern "C" { X#endif X X#ifdef timerclear X/* X * With MSVC timerclear / struct timeval present in case that X * winsock2.h has been included before. X */ X#undef HAVE_STRUCT_TIMEVAL X#define HAVE_STRUCT_TIMEVAL 1 X#endif X X#ifndef HAVE_STRUCT_TIMEVAL X Xstruct timeval { X long tv_sec; X long tv_usec; X}; X#endif X X#ifndef HAVE_STRUCT_TIMEZONE X Xstruct timezone { X int tz_minuteswest; X int tz_dsttime; X}; X#endif X X#ifndef HAVE_STRUCT_TIMESPEC X Xstruct timespec { X time_t tv_sec; X long tv_nsec; X}; X#endif X X X#undef timerclear X#define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0 X X#undef timerfix X#define timerfix1(tvp) while ((tvp)->tv_usec < 0) { \ X (tvp)->tv_sec--; \ X (tvp)->tv_usec += 1000000; \ X } X X#define timerfix2(tvp) while ((tvp)->tv_usec > 1000000) { \ X (tvp)->tv_sec++; \ X (tvp)->tv_usec -= 1000000; \ X } X X#define timerfix(tvp) do { timerfix1(tvp); timerfix2(tvp); } while (0) X X/* X * timersub() and timeradd() are defined on FreeBSD with a different X * interface (3 parameters). X */ X#undef timersub X#define timersub(tvp1, tvp2) do { \ X (tvp1)->tv_sec -= (tvp2)->tv_sec; \ X (tvp1)->tv_usec -= (tvp2)->tv_usec; \ X timerfix1(tvp1); timerfix2(tvp1); \ X } while (0) X X#undef timeradd X#define timeradd(tvp1, tvp2) do { \ X (tvp1)->tv_sec += (tvp2)->tv_sec; \ X (tvp1)->tv_usec += (tvp2)->tv_usec; \ X timerfix1(tvp1); timerfix2(tvp1); \ X } while (0) X X X#undef timespecclear X#define timespecclear(tsp) (tsp)->tv_sec = (tsp)->tv_nsec = 0 X X#undef timespecfix X#define timespecfix1(tsp) while ((tsp)->tv_nsec < 0) { \ X (tsp)->tv_sec--; \ X (tsp)->tv_nsec += 1000000000; \ X } X X#define timespecfix2(tsp) while ((tsp)->tv_nsec > 1000000000) { \ X (tsp)->tv_sec++; \ X (tsp)->tv_nsec -= 1000000000; \ X } X X#define timespecfix(tsp) do { timespecfix1(tsp); timespecfix2(tsp); } while (0) X X#undef timespecsub X#define timespecsub(tsp1, tsp2) do { \ X (tsp1)->tv_sec -= (tsp2)->tv_sec; \ X (tsp1)->tv_nsec -= (tsp2)->tv_nsec; \ X timespecfix1(tsp1); timespecfix2(tsp1); \ X } while (0) X X#undef timespecadd X#define timespecadd(tsp1, tsp2) do { \ X (tsp1)->tv_sec += (tsp2)->tv_sec; \ X (tsp1)->tv_nsec += (tsp2)->tv_nsec; \ X timespecfix1(tsp1); timespecfix2(tsp1); \ X } while (0) X X#ifdef __cplusplus X} X#endif X X#endif /* _SCHILY_TIME_H */ END-of-star-1.6/include/schily/time.h echo x - star-1.6/include/schily/standard.h sed 's/^X//' >star-1.6/include/schily/standard.h << 'END-of-star-1.6/include/schily/standard.h' X/* @(#)standard.h 1.40 13/05/01 Copyright 1985-2013 J. Schilling */ X/* X * standard definitions X * X * This file should be included past: X * X * mconfig.h / config.h X * stdio.h X * stdlib.h (better use schily/stdlib.h) X * unistd.h (better use schily/unistd.h) needed f. LARGEFILE support X * X * If you need stdio.h, you must include it before standard.h X * X * Copyright (c) 1985-2013 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_STANDARD_H X#define _SCHILY_STANDARD_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifdef __cplusplus Xextern "C" { X#endif X X#ifdef M68000 X# ifndef tos X# define JOS 1 X# endif X#endif X X/* X * fundamental constants X */ X#ifndef NULL X# define NULL 0 X#endif X#ifndef TRUE X# define TRUE 1 X# define FALSE 0 X#endif X X/* X * Program exit codes used with comerr(), comexit() and similar. X * X * Exit codes between -2 and -63 are currently available to flag X * program specific error conditions. X */ X#define EX_BAD (-1) /* Default error exit code */ X#define EX_CLASH (-64) /* Exit code used with exit clashes */ X X/* X * standard storage class definitions X */ X#define GLOBAL extern X#define IMPORT extern X#define EXPORT X#define INTERN static X#define LOCAL static X#define FAST register X X#ifndef PROTOTYPES X# ifndef const X# define const X# endif X# ifndef signed X# define signed X# endif X# ifndef volatile X# define volatile X# endif X#endif /* PROTOTYPES */ X X/* X * standard type definitions X * X * The hidden Schily BOOL definition is used in case we need to deal X * with other BOOL defines on systems we like to port to. X */ Xtypedef int __SBOOL; Xtypedef int BOOL; X#ifdef JOS X# ifndef __GNUC__ X# define NO_VOID X# endif X#endif X#ifdef NO_VOID X# ifndef lint X typedef int void; X# endif X#endif X X#if defined(_INCL_SYS_TYPES_H) || defined(_INCL_TYPES_H) || defined(off_t) X# ifndef FOUND_OFF_T X# define FOUND_OFF_T X# endif X#endif X#if defined(_INCL_SYS_TYPES_H) || defined(_INCL_TYPES_H) || defined(size_t) X# ifndef FOUND_SIZE_T X# define FOUND_SIZE_T X# endif X#endif X#if defined(_MSC_VER) && !defined(_SIZE_T_DEFINED) X# undef FOUND_SIZE_T X#endif X X#ifdef __never_def__ X/* X * It turns out that we cannot use the folloginw definition because there are X * some platforms that do not behave application friendly. These are mainly X * BSD-4.4 based systems (which #undef a definition when size_t is available. X * We actually removed this code because of a problem with QNX Neutrino. X * For this reason, it is important not to include directly but X * via the Schily SING include files so we know whether it has been included X * before we come here. X */ X#if defined(_SIZE_T) || defined(_T_SIZE_) || defined(_T_SIZE) || \ X defined(__SIZE_T) || defined(_SIZE_T_) || \ X defined(_GCC_SIZE_T) || defined(_SIZET_) || \ X defined(__sys_stdtypes_h) || defined(___int_size_t_h) || defined(size_t) X X#ifndef FOUND_SIZE_T X# define FOUND_SIZE_T /* We already included a size_t definition */ X#endif X#endif X#endif /* __never_def__ */ X X#ifdef __cplusplus X} X#endif X X#if defined(_JOS) || defined(JOS) X# ifndef _SCHILY_SCHILY_H X# include X# endif X X# ifndef _SCHILY_JOS_DEFS_H X# include X# endif X X# ifndef _SCHILY_JOS_IO_H X# include X# endif X#endif X X#endif /* _SCHILY_STANDARD_H */ END-of-star-1.6/include/schily/standard.h echo x - star-1.6/include/schily/stdlib.h sed 's/^X//' >star-1.6/include/schily/stdlib.h << 'END-of-star-1.6/include/schily/stdlib.h' X/* @(#)stdlib.h 1.11 15/11/28 Copyright 1996-2015 J. Schilling */ X/* X * Definitions for stdlib X * X * Copyright (c) 1996-2015 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_STDLIB_H X#define _SCHILY_STDLIB_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifdef HAVE_STDLIB_H X#ifndef _INCL_STDLIB_H X#include X#define _INCL_STDLIB_H X#endif X#endif /* HAVE_STDLIB_H */ X X X#ifdef HAVE_POSIX_MALLOC_H /* Haiku */ X#ifndef _INCL_POSIX_MALLOC_H X#include X#define _INCL_POSIX_MALLOC_H X#endif X#endif /* HAVE_POSIX_MALLOC_H */ X X#ifdef __cplusplus Xextern "C" { X#endif X X#if !defined(_INCL_STDLIB_H) && !defined(_INCL_POSIX_MALLOC_H) Xextern char *malloc(); Xextern char *realloc(); X#endif X X#ifndef _INCL_STDLIB_H Xextern double atof(); X#endif X X#ifdef __cplusplus X} X#endif X X X X#ifndef EXIT_FAILURE X#define EXIT_FAILURE 1 X#endif X#ifndef EXIT_SUCCESS X#define EXIT_SUCCESS 0 X#endif X#ifndef RAND_MAX X#define RAND_MAX 32767 X#endif X X#endif /* _SCHILY_STDLIB_H */ END-of-star-1.6/include/schily/stdlib.h echo x - star-1.6/include/schily/string.h sed 's/^X//' >star-1.6/include/schily/string.h << 'END-of-star-1.6/include/schily/string.h' X/* @(#)string.h 1.12 11/11/24 Copyright 1996-2011 J. Schilling */ X/* X * Definitions for strings X * X * Copyright (c) 1996-2011 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_STRING_H X#define _SCHILY_STRING_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifndef _SCHILY_TYPES_H X#include /* Try to get size_t */ X#endif X X/* X * It may be that IBM's AIX has problems when doing X * #include X * #include X * So I moved the #include to the top. As the file strings.h X * defines strcasecmp() we may need it... X * X * Note that the only real problem appears if we use rubbish FSF based code that X * #defines _NO_PROTO X */ X#ifdef HAVE_STRINGS_H X#ifndef _INCL_STRINGS_H X#include X#define _INCL_STRINGS_H X#endif X#endif /* HAVE_STRINGS_H */ X X X#ifdef HAVE_STRING_H X#ifndef _INCL_STRING_H X#include X#define _INCL_STRING_H X#endif X#else /* HAVE_STRING_H */ X X#ifdef __cplusplus Xextern "C" { X#endif X X#ifndef NULL X#define NULL 0 X#endif X Xextern void *memcpy __PR((void *, const void *, int)); Xextern void *memmove __PR((void *, const void *, int)); Xextern char *strcpy __PR((char *, const char *)); Xextern char *strncpy __PR((char *, const char *, int)); X Xextern char *strcat __PR((char *, const char *)); Xextern char *strncat __PR((char *, const char *, int)); X Xextern int memcmp __PR((const void *, const void *, int)); Xextern int strcmp __PR((const char *, const char *)); Xextern int strcoll __PR((const char *, const char *)); Xextern int strncmp __PR((const char *, const char *, int)); Xextern int strxfrm __PR((char *, const char *, int)); X Xextern void *memchr __PR((const void *, int, int)); Xextern char *strchr __PR((const char *, int)); X Xextern int strcspn __PR((const char *, const char *)); X/* #pragma int_to_unsigned strcspn */ X Xextern char *strpbrk __PR((const char *, const char *)); Xextern char *strrchr __PR((const char *, int)); X Xextern int strspn __PR((const char *, const char *)); X/* #pragma int_to_unsigned strspn */ X Xextern char *strstr __PR((const char *, const char *)); Xextern char *strtok __PR((char *, const char *)); Xextern void *memset __PR((void *, int, int)); Xextern char *strerror __PR((int)); X Xextern int strlen __PR((const char *)); X/* #pragma int_to_unsigned strlen */ X Xextern void *memccpy __PR((void *, const void *, int, int)); X Xextern int strcasecmp __PR((const char *, const char *)); Xextern int strncasecmp __PR((const char *, const char *, size_t)); X X#ifdef __cplusplus X} X#endif X X#endif /* HAVE_STRING_H */ X X#endif /* _SCHILY_STRING_H */ END-of-star-1.6/include/schily/string.h echo x - star-1.6/include/schily/stkframe.h sed 's/^X//' >star-1.6/include/schily/stkframe.h << 'END-of-star-1.6/include/schily/stkframe.h' X/* @(#)stkframe.h 1.13 10/08/27 Copyright 1995-2010 J. Schilling */ X/* X * Common definitions for routines that parse the stack frame. X * X * This file has to be fixed if you want to port routines which use getfp(). X * Have a look at struct frame below and use it as a sample, X * the new struct frame must at least contain a member 'fr_savfp'. X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_STKFRAME_H X#define _SCHILY_STKFRAME_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#if defined(sun) && (defined(SVR4) || defined(__SVR4) || defined(__SVR4__)) X /* X * Solaris 2.x aka SunOS 5.x X */ X# ifdef i386 X /* X * On Solaris 2.1 x86 sys/frame.h is not useful at all X * On Solaris 2.4 x86 sys/frame.h is buggy (fr_savfp is int!!) X */ X# ifndef _INCL_SYS_REG_H X# include X# define _INCL_SYS_REG_H X# endif X# endif X# ifndef _INCL_SYS_FRAME_H X# include X# define _INCL_SYS_FRAME_H X# endif X X#else X# if defined(sun) X /* X * SunOS 4.x X */ X# ifndef _INCL_MACHINE_FRAME_H X# include X# define _INCL_MACHINE_FRAME_H X# endif X# else X /* X * Anything that is not SunOS X */ X X#ifdef __cplusplus Xextern "C" { X#endif X X#ifndef _SCHILY_UTYPES_H X#include X#endif X X/* X * XXX: I hope this will be useful on other machines (no guarantee) X * XXX: It is taken from a sun Motorola system, but should also be useful X * XXX: on a i386. X * XXX: In general you have to write a sample program, set a breakpoint X * XXX: on a small function and inspect the stackframe with adb. X */ X Xstruct frame { X struct frame *fr_savfp; /* saved frame pointer */ X Intptr_t fr_savpc; /* saved program counter */ X int fr_arg[1]; /* array of arguments */ X}; X X#ifdef __cplusplus X} X#endif X X# endif /* ! defined (sun) */ X#endif /* ! defined (sun) && (defined(SVR4) || defined(__SVR4) || ... */ X X#endif /* _SCHILY_STKFRAME_H */ END-of-star-1.6/include/schily/stkframe.h echo x - star-1.6/include/schily/termios.h sed 's/^X//' >star-1.6/include/schily/termios.h << 'END-of-star-1.6/include/schily/termios.h' X/* @(#)termios.h 1.34 11/08/13 Copyright 1984-2011 J. Schilling */ X/* X * Terminal driver tty mode handling X * X * Copyright (c) 1984-2011 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X X#ifndef _SCHILY_TERMIOS_H X#define _SCHILY_TERMIOS_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifndef _SCHILY_TYPES_H X#include X#endif X#ifndef _SCHILY_UNISTD_H X#include /* Haiku needs this for _POSIX_VDISABLE */ X#endif X X#ifdef JOS X# include X# include X#else X#ifdef HAVE_TERMIOS_H X# ifndef _INCL_TERMIOS_H X# include X# define _INCL_TERMIOS_H X# endif /* _INCL_TERMIOS_H */ X# ifdef TIOCGETA /* FreeBSD */ X# define TCGETS TIOCGETA X# define TCSETSW TIOCSETAW X# endif X# ifdef TCGETATTR X# define TCGETS TCGETATTR X# define TCSETSW TCSETATTRD X# endif X#else X# ifdef HAVE_TERMIO_H X# ifndef _INCL_TERMIO_H X# include X# define _INCL_TERMIO_H X# endif /* _INCL_TERMIO_H */ X# ifndef TCGETS X# define termios termio X# define TCGETS TCGETA X# define TCSETSW TCSETAW X# endif X# else X# define USE_V7_TTY X# endif X#endif X#endif X X#if !defined(HAVE_TCGETATTR) || !defined(HAVE_TCSETATTR) X# undef TCSANOW X#else X# define USE_TCSETATTR /* Use tcsetattr() instead of ioctl() */ X# define USE_TERMIOS /* Termio as classification */ X#endif X X#ifndef TCSANOW X# if !defined(TCGETS) || !defined(TCSETSW) X# define USE_V7_TTY X# else X# define USE_TCSETSW /* Use ioctl()s */ X# ifndef USE_TERMIOS X# define USE_TERMIOS /* Termio as classification */ X# endif X# endif X#endif X X#if defined(USE_V7_TTY) && defined(HAVE_SGTTY_H) X# ifndef _INCL_SGTTY_H X# include X# define _INCL_SGTTY_H X# endif X#endif X X#if defined(USE_V7_TTY) X# ifndef TIOCGETP X# undef USE_V7_TTY X# define USE_NO_TTY_IOCTL /* A DOS system? */ X# endif X#endif X X#if defined(USE_NO_TTY_IOCTL) && defined(HAVE_CONIO_H) X# ifndef _INCL_CONIO_H X# include X# define _INCL_CONIO_H X# endif /* _INCL_CONIO_H */ X# define USE_GETCH /* A DOS system! */ X#endif X X X#if !defined(_INCL_TERMIOS_H) && !defined(_INCL_TERMIO_H) X# include X#endif X X#ifdef HAVE_SYS_BSDTTY_H X#ifndef _INCL_SYS_BSDTTY_H X#include X#define _INCL_SYS_BSDTTY_H X#endif X#endif X X#if !defined(TIOCGWINSZ) && ! defined(TIOCGSIZE) X# include X#endif X X#ifndef OXTABS /* OS/2 EMX */ X#define OXTABS 0 X#endif X#ifndef XTABS X# ifndef TAB3 /* FreeBSD */ X# define TABDLY OXTABS X# define XTABS OXTABS X# else X# define XTABS TAB3 X# endif X#endif X#ifndef ONLCR /* OS/2 EMX */ X#define ONLCR 0 X#endif X#ifndef OCRNL /* FreeBSD */ X# define OCRNL 0 X#endif X#ifndef ONLRET /* FreeBSD */ X# define ONLRET 0 X#endif X#ifndef _POSIX_VDISABLE X# define _POSIX_VDISABLE 0 X#endif X X#endif /* _SCHILY_TERMIOS_H */ END-of-star-1.6/include/schily/termios.h echo x - star-1.6/include/schily/termcap.h sed 's/^X//' >star-1.6/include/schily/termcap.h << 'END-of-star-1.6/include/schily/termcap.h' X/* @(#)termcap.h 1.10 10/08/27 Copyright 1995-2010 J. Schilling */ X/* X * Copyright (c) 1995-2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_TERMCAP_H X#define _SCHILY_TERMCAP_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X#ifndef _SCHILY_STANDARD_H X#include X#endif X X#ifdef __cplusplus Xextern "C" { X#endif X X/* X * Flags for tcsetflags() X */ X#define TCF_NO_TC 0x0001 /* Don't follow tc= entries */ X#define TCF_NO_SIZE 0x0002 /* Don't get actual ttysize (li#/co#) */ X#define TCF_NO_STRIP 0x0004 /* Don't strip down termcap buffer */ X Xextern char PC; /* Pad character */ Xextern char *BC; /* Backspace if not "\b" from "bc" capability */ Xextern char *UP; /* Cursor up string from "up" capability */ Xextern short ospeed; /* output speed coded as in ioctl */ X Xextern int tgetent __PR((char *bp, char *name)); Xextern int tcsetflags __PR((int flags)); Xextern char *tcgetbuf __PR((void)); Xextern int tgetnum __PR((char *ent)); Xextern BOOL tgetflag __PR((char *ent)); Xextern char *tgetstr __PR((char *ent, char **array)); Xextern char *tdecode __PR((char *ep, char **array)); X Xextern int tputs __PR((char *cp, int affcnt, X int (*outc)(int c))); Xextern char *tgoto __PR((char *cm, int destcol, int destline)); X X#ifdef __cplusplus X} X#endif X X#endif /* _SCHILY_TERMCAP_H */ END-of-star-1.6/include/schily/termcap.h echo x - star-1.6/include/schily/unistd.h sed 's/^X//' >star-1.6/include/schily/unistd.h << 'END-of-star-1.6/include/schily/unistd.h' X/* @(#)unistd.h 1.28 17/04/30 Copyright 1996-2017 J. Schilling */ X/* X * Definitions for unix system interface X * X * Copyright (c) 1996-2017 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_UNISTD_H X#define _SCHILY_UNISTD_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X/* X * unistd.h grants things like off_t to be typedef'd. X */ X#ifndef _SCHILY_TYPES_H X#include X#endif X X/* X * inttypes.h grants things like Intptr_t to be typedef'd. X */ X#ifndef _SCHILY_INTTYPES_H X#include X#endif X X#ifdef HAVE_UNISTD_H X X#ifndef _INCL_UNISTD_H X#include X#define _INCL_UNISTD_H X#endif X X#ifndef _SC_PAGESIZE X#ifdef _SC_PAGE_SIZE /* HP/UX & OSF */ X#define _SC_PAGESIZE _SC_PAGE_SIZE X#endif X#endif X X#else /* !HAVE_UNISTD_H */ X#ifndef _SCHILY_STDLIB_H X#include /* MSVC: no unistd.h environ is in stdlib.h */ X#endif X#endif /* !HAVE_UNISTD_H */ X X/* X * MSVC has getcwd()/chdir()/mkdir()/rmdir() in direct.h X */ X#if defined(_MSC_VER) && defined(HAVE_DIRECT_H) X#ifndef _INCL_DIRECT_H X#include X#define _INCL_DIRECT_H X#endif X#endif X X/* X * MSVC has size_t in stddef.h X */ X#ifdef HAVE_STDDEF_H X#ifndef _INCL_STDDEF_H X#include X#define _INCL_STDDEF_H X#endif X#endif X X#ifndef STDIN_FILENO X# ifdef JOS X# ifndef _SCHILY_JOS_IO_H X# include X# endif X# else X# define STDIN_FILENO 0 X# define STDOUT_FILENO 1 X# define STDERR_FILENO 2 X# endif X#endif X X#ifndef R_OK X/* Symbolic constants for the "access" routine: */ X#define R_OK 4 /* Test for Read permission */ X#define W_OK 2 /* Test for Write permission */ X#define X_OK 1 /* Test for eXecute permission */ X#define F_OK 0 /* Test for existence of File */ X#endif X#ifndef E_OK X#ifdef HAVE_ACCESS_E_OK X#ifdef EFF_ONLY_OK X#define E_OK EFF_ONLY_OK /* Irix */ X#else X#ifdef EUID_OK X#define E_OK EUID_OK /* UNICOS (0400) */ X#else X#define E_OK 010 /* Test effective uids */ X#endif /* EUID_OK */ X#endif /* EFF_ONLY_OK */ X#else X#define E_OK 0 X#endif /* HAVE_ACCESS_E_OK */ X#endif /* !E_OK */ X X/* Symbolic constants for the "lseek" routine: */ X#ifndef SEEK_SET X#define SEEK_SET 0 /* Set file pointer to "offset" */ X#endif X#ifndef SEEK_CUR X#define SEEK_CUR 1 /* Set file pointer to current plus "offset" */ X#endif X#ifndef SEEK_END X#define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ X#endif X X#ifdef __cplusplus Xextern "C" { X#endif X X#ifndef HAVE_ENVIRON_DEF Xextern char **environ; X#endif X X#if !defined(HAVE_UNISTD_H) || !defined(_POSIX_VERSION) X/* X * Maybe we need a lot more definitions here... X * It is not clear whether we should have prototyped definitions. X */ X#if !defined(_MSC_VER) && !defined(__MINGW32__) X/* X * MS C comes with broken prototypes in wrong header files (in our case, the X * wrong prototype is in io.h). Avoid to redefine the broken MS stuff with X * correct prototypes. X */ Xextern int access __PR((const char *, int)); Xextern int close __PR((int)); Xextern int dup __PR((int)); Xextern int dup2 __PR((int, int)); Xextern int link __PR((const char *, const char *)); Xextern int read __PR((int, void *, size_t)); Xextern int unlink __PR((const char *)); Xextern int write __PR((int, const void *, size_t)); X#endif X#if !defined(_MSC_VER) && !defined(__MINGW32__) X/* X * MS C comes with broken prototypes in wrong header files (in our case, the X * wrong prototype is in stdlib.h). Avoid to redefine the broken MS stuff with X * correct prototypes. X */ Xextern void _exit __PR((int)); X#endif X#endif X X#if !defined(HAVE_PIPE) && defined(HAVE__PIPE) && defined(HAVE_IO_H) X#ifndef _SCHILY_LIMITS_H X#include /* for PIPE_BUF */ X#endif X#ifndef _SCHILY_FCNTL_H X#include /* for O_BINARY */ X#endif X#ifndef _SCHILY_IO_H X#include /* for _pipe() */ X#endif X X#define pipe(pp) _pipe(pp, PIPE_BUF, O_BINARY) X#endif X X#ifdef __cplusplus X} X#endif X X#endif /* _SCHILY_UNISTD_H */ END-of-star-1.6/include/schily/unistd.h echo x - star-1.6/include/schily/utime.h sed 's/^X//' >star-1.6/include/schily/utime.h << 'END-of-star-1.6/include/schily/utime.h' X/* @(#)utime.h 1.9 10/08/24 Copyright 2001-2010 J. Schilling */ X/* X * Defines for utimes() / utime() X * X * Copyright (c) 2001-2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_UTIME_H X#define _SCHILY_UTIME_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifndef _SCHILY_TYPES_H X#include X#endif X X#ifdef HAVE_UTIMES X#ifndef _SCHILY_TIME_H X#include X#endif X#endif X X#ifdef HAVE_UTIME_H X#ifndef _INCL_UTIME_H X#include X#define _INCL_UTIME_H X#endif X#else X#ifdef HAVE_SYS_UTIME_H X#ifndef _INCL_SYS_UTIME_H X#include X#define _INCL_SYS_UTIME_H X#endif X#else X X#ifdef __cplusplus Xextern "C" { X#endif X Xstruct utimbuf { X time_t actime; X time_t modtime; X}; X X#ifdef __cplusplus X} X#endif X X#endif X#endif X X#ifdef __comment__ X/* X * file.c contains this X * I am not sure if it is really needed. X * It may be a good idea to add a test for HAVE_STRUCT_UTIMBUF X * as in gnutar. X */ X#if (__COHERENT__ >= 0x420) X# include X#else X# include X#endif X X#endif /* __comment__ */ X X#endif /* _SCHILY_UTIME_H */ END-of-star-1.6/include/schily/utime.h echo x - star-1.6/include/schily/varargs.h sed 's/^X//' >star-1.6/include/schily/varargs.h << 'END-of-star-1.6/include/schily/varargs.h' X/* @(#)varargs.h 1.8 14/01/06 Copyright 1998-2014 J. Schilling */ X/* X * Generic header for users of var args ... X * X * Includes a default definition for va_copy() X * and some magic know how about the SVr4 Power PC var args ABI X * to create a __va_arg_list() macro. X * X * The __va_arg_list() macro is needed to fetch a va_list type argument X * from a va_list. This is needed to implement a recursive "%r" printf. X * X * Copyright (c) 1998-2014 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_VARARGS_H X#define _SCHILY_VARARGS_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifdef __cplusplus Xextern "C" { X#endif X X#ifdef PROTOTYPES X/* X * For ANSI C-compilers prefer stdarg.h X */ X# ifdef HAVE_STDARG_H X# ifndef _INCL_STDARG_H X# include X# define _INCL_STDARG_H X# endif X# else X# ifndef _INCL_VARARGS_H X# include X# define _INCL_VARARGS_H X# endif X# endif X#else X/* X * For K&R C-compilers prefer varargs.h X */ X# ifdef HAVE_VARARGS_H X# ifndef _INCL_VARARGS_H X# include X# define _INCL_VARARGS_H X# endif X# else X# ifndef _INCL_STDARG_H X# include X# define _INCL_STDARG_H X# endif X# endif X#endif X X#if (defined(__linux__) || defined(__linux) || defined(sun)) && \ X (defined(__ppc) || defined(__PPC) || \ X defined(powerpc) || defined(__powerpc__)) X X# ifndef VA_LIST_IS_ARRAY X# define VA_LIST_IS_ARRAY X# endif X#endif X X X/* X * __va_copy() is used by GCC 2.8 or newer until va_copy() becomes X * a final ISO standard. X */ X#if !defined(va_copy) && !defined(HAVE_VA_COPY) X# if defined(__va_copy) X# define va_copy(to, from) __va_copy(to, from) X# endif X#endif X X/* X * va_copy() is a Solaris extension to provide a portable way to perform a X * variable argument list "bookmarking" function. X * If it is not available via stdarg.h, use a simple assignement for backward X * compatibility. X */ X#if !defined(va_copy) && !defined(HAVE_VA_COPY) X#ifdef VA_LIST_IS_ARRAY X# define va_copy(to, from) ((to)[0] = (from)[0]) X#else X# define va_copy(to, from) ((to) = (from)) X#endif X#endif X X/* X * I don't know any portable way to get an arbitrary X * C object from a var arg list so I use a X * system-specific routine __va_arg_list() that knows X * if 'va_list' is an array. You will not be able to X * assign the value of __va_arg_list() but it works X * to be used as an argument of a function. X * It is a requirement for recursive printf to be able X * to use this function argument. If your system X * defines va_list to be an array you need to know this X * via autoconf or another mechanism. X * It would be nice to have something like X * __va_arg_list() in stdarg.h X */ X X#ifdef VA_LIST_IS_ARRAY X# define __va_arg_list(list) va_arg(list, void *) X#else X# define __va_arg_list(list) va_arg(list, va_list) X#endif X X/* X * This structure allows to work around the C limitation that a variable of X * type array cannot appear at the left side of an assignement operator. X * By putting va_list inside a struture, the assignement will work even in case X * that va_list is an array2. X */ Xtypedef struct { X va_list ap; X} va_lists_t; X X#ifdef __cplusplus X} X#endif X X#endif /* _SCHILY_VARARGS_H */ END-of-star-1.6/include/schily/varargs.h echo x - star-1.6/include/schily/wait.h sed 's/^X//' >star-1.6/include/schily/wait.h << 'END-of-star-1.6/include/schily/wait.h' X/* @(#)wait.h 1.28 18/06/07 Copyright 1995-2018 J. Schilling */ X/* X * Definitions to deal with various kinds of wait flavour X * X * Copyright (c) 1995-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_WAIT_H X#define _SCHILY_WAIT_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X/* X * Needed for SysVr4 X */ X#ifndef _SCHILY_TYPES_H X#include X#endif X X#if defined(HAVE_WAIT_H) X# ifndef _INCL_WAIT_H X# include X# define _INCL_WAIT_H X# endif X#else X/* X * K&R Compiler doesn't like #elif X */ X# if defined(HAVE_SYS_WAIT_H) /* POSIX.1 compl. sys/wait.h */ X# undef HAVE_UNION_WAIT /* POSIX.1 doesn't use U_W */ X# ifndef _INCL_SYS_WAIT_H X# include X# define _INCL_SYS_WAIT_H X# endif X# else X# if defined(HAVE_UNION_WAIT) /* Pure BSD U_W / sys/wait.h */ X# ifndef _INCL_SYS_WAIT_H X# include X# define _INCL_SYS_WAIT_H X# endif X# endif X# endif X#endif X#ifdef JOS X# ifndef _INCL_SYS_EXIT_H X# include X# define _INCL_SYS_EXIT_H X# endif X#endif X#if defined(__EMX__) || defined(__DJGPP__) X# ifndef _INCL_PROCESS_H X# include X# define _INCL_PROCESS_H X# endif X#endif X X/* X * Since some platforms need to include in order to make X * usable, we now always include in special X * since this way supply a siginfo_t emulation. X * X * In former times, we had: X * #if !defined(HAVE_TYPE_SIGINFO_T) && defined(HAVE_SIGINFO_T) X */ X#ifndef _SCHILY_SIGNAL_H X#include X#endif X X#ifdef __cplusplus Xextern "C" { X#endif X X/* X * waitid() idtype_t definition, define when missing or broken. X * NetBSD-5 has an idtype_t that is in conflict with POSIX. X */ X#ifndef HAVE_TYPE_IDTYPE_T X X#undef HAVE_WAITID /* Can't have waitid() with broken idtype_t */ X X#undef P_PID X#undef P_PPID X#undef P_PGID X#undef P_SID X#undef P_CID X#undef P_UID X#undef P_GID X#undef P_ALL X X#define P_PID MY_P_PID X#define P_PPID MY_P_PPID X#define P_PGID MY_P_PGID X#define P_SID MY_P_SID X#define P_CID MY_P_CID X#define P_UID MY_P_UID X#define P_GID MY_P_GID X#define P_ALL MY_P_ALL X Xtypedef enum { X P_PID, /* A process identifier. */ X P_PPID, /* A parent process identifier. */ X P_PGID, /* A process group (job control group) */ X /* identifier. */ X P_SID, /* A session identifier. */ X P_CID, /* A scheduling class identifier. */ X P_UID, /* A user identifier. */ X P_GID, /* A group identifier. */ X P_ALL, /* All processes. */ X} js_idtype_t; X X#undef idtype_t X#define idtype_t js_idtype_t X X#endif /* HAVE_TYPE_IDTYPE_T */ X X#ifndef WCOREFLG X#ifdef WCOREFLAG X#define WCOREFLG WCOREFLAG X#else X#define WCOREFLG 0x80 X#endif X#define NO_WCOREFLG X#endif X X#ifndef WSTOPFLG X#ifdef _WSTOPPED X#define WSTOPFLG _WSTOPPED X#else X#define WSTOPFLG 0x7F X#endif X#define NO_WSTOPFLG X#endif X X#ifndef WCONTFLG X#define WCONTFLG 0xFFFF X#define NO_WCONTFLG X#endif X X/* X * Work around a NetBSD bug that has been imported from BSD. X * There is a #define WSTOPPED _WSTOPPED that is in conflict with the X * AT&T waitid() flags definition that is part of the POSIX standard. X */ X#if defined(WSTOPPED) && defined(_WSTOPPED) && WSTOPPED == _WSTOPPED X#undef WSTOPPED X#define WSTOPPED WUNTRACED X#endif X X/* X * waitid() option flags: X */ X#ifndef WCONTINUED X#define WCONTINUED 0 X#define NO_WCONTINUED X#endif X#ifndef WEXITED X#define WEXITED 0 X#define NO_WEXITED X#endif X#ifndef WNOHANG X#define WNOHANG 0 X#define NO_WNOHANG X#endif X#ifndef WNOWAIT X#define WNOWAIT 0 X#define NO_WNOWAIT X#endif X#ifndef WSTOPPED X#ifdef WUNTRACED X#define WSTOPPED WUNTRACED X#else X#define WSTOPPED 0 X#endif X#define NO_WSTOPPED X#endif X#ifndef WTRAPPED X#define WTRAPPED 0 X#define NO_WTRAPPED X#endif X X/* X * waitid() code values, #define them when they are missing: X */ X#ifndef CLD_EXITED /* Assume all is missing then */ X#define CLD_EXITED 1 /* child has exited */ X#define CLD_KILLED 2 /* child was killed */ X#define CLD_DUMPED 3 /* child has coredumped */ X#define CLD_TRAPPED 4 /* traced child has stopped */ X#define CLD_STOPPED 5 /* child has stopped on signal */ X#define CLD_CONTINUED 6 /* stopped child has continued */ X#define NO_CLD_EXITED X#endif /* CLD_EXITED */ X X#if defined(HAVE_UNION_WAIT) && defined(USE_UNION_WAIT) X# define WAIT_T union wait X# define _W_U(w) ((union wait *)&(w)) X# ifndef WTERMSIG X# define WTERMSIG(status) (_W_U(status)->w_termsig) X# endif X# ifndef WCOREDUMP X# define WCOREDUMP(status) (_W_U(status)->w_coredump) X# endif X# ifndef WEXITSTATUS X# define WEXITSTATUS(status) (_W_U(status)->w_retcode) X# endif X# ifndef WSTOPSIG X# define WSTOPSIG(status) (_W_U(status)->w_stopsig) X# endif X# ifndef WIFCONTINUED X# define WIFCONTINUED(status) (0) X# endif X# ifndef WIFSTOPPED X# define WIFSTOPPED(status) (_W_U(status)->w_stopval == \ X WSTOPFLG) X# endif X# ifndef WIFSIGNALED X# define WIFSIGNALED(status) (_W_U(status)->w_stopval != \ X WSTOPFLG && \ X _W_U(status)->w_termsig != 0) X# endif X# ifndef WIFEXITED X# define WIFEXITED(status) (_W_U(status)->w_stopval != \ X WSTOPFLG && \ X _W_U(status)->w_termsig == 0) X# endif X#else X# define WAIT_T int X# define _W_I(w) (*(int *)&(w)) X# ifndef WTERMSIG X# define WTERMSIG(status) (_W_I(status) & 0x7F) X# endif X# ifndef WCOREDUMP X# ifdef WIFCORED /* Haiku */ X# define WCOREDUMP(status) (WIFCORED(_W_I(status))) X# else X# define WCOREDUMP(status) (_W_I(status) & 0x80) X# endif X# endif X# ifndef WEXITSTATUS X# define WEXITSTATUS(status) ((_W_I(status) >> 8) & 0xFF) X# endif X# ifndef WSTOPSIG X# define WSTOPSIG(status) ((_W_I(status) >> 8) & 0xFF) X# endif X/* X * WIFSTOPPED and WIFSIGNALED match the definitions on older UNIX versions X * e.g. SunOS-4.x or HP-UX X */ X# ifndef WIFCONTINUED X# ifdef NO_WCONTINUED X# define WIFCONTINUED(status) (0) X# else X# define WIFCONTINUED(status) ((_W_I(status) & 0xFFFF) == \ X WCONTFLG) X# endif X# endif X# ifndef WIFSTOPPED X# define WIFSTOPPED(status) ((_W_I(status) & 0xFF) == 0x7F) X# endif X# ifndef WIFSIGNALED X# define WIFSIGNALED(status) ((_W_I(status) & 0xFF) != 0x7F && \ X WTERMSIG(status) != 0) X# endif X# ifndef WIFEXITED X# define WIFEXITED(status) ((_W_I(status) & 0xFF) == 0) X# endif X#endif X X X#ifdef __cplusplus X} X#endif X X#endif /* _SCHILY_WAIT_H */ END-of-star-1.6/include/schily/wait.h echo x - star-1.6/include/schily/utypes.h sed 's/^X//' >star-1.6/include/schily/utypes.h << 'END-of-star-1.6/include/schily/utypes.h' X/* @(#)utypes.h 1.37 18/12/19 Copyright 1997-2018 J. Schilling */ X/* X * Definitions for some user defined types X * X * Copyright (c) 1997-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_UTYPES_H X#define _SCHILY_UTYPES_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X/* X * uypes.h is based on inttypes.h X */ X#ifndef _SCHILY_INTTYPES_H X#include X#endif X X#ifdef __cplusplus Xextern "C" { X#endif X X/* X * Several unsigned cardinal types X */ Xtypedef unsigned long Ulong; Xtypedef unsigned int Uint; Xtypedef unsigned short Ushort; Xtypedef unsigned char Uchar; X X/* X * The IBM AIX C-compiler seems to be the only compiler on the world X * which does not allow to use unsigned char bit fields as a hint X * for packed bit fields. Define a pesical type to avoid warnings. X * The packed attribute is honored wit unsigned int in this case too. X */ X#if defined(_AIX) && !defined(__GNUC__) X Xtypedef unsigned int Ucbit; X X#else X Xtypedef unsigned char Ucbit; X X#endif X X#ifdef __BAD_CHAR_SIGNED__ /* From */ X#undef CHAR_MIN /* Solaris is wrong */ X#undef CHAR_MAX X#endif X X#ifndef CHAR_MIN X#define CHAR_MIN TYPE_MINVAL(char) X#endif X#ifndef CHAR_MAX X#define CHAR_MAX TYPE_MAXVAL(char) X#endif X#ifndef UCHAR_MAX X#define UCHAR_MAX TYPE_MAXVAL(unsigned char) X#endif X X#ifndef SHRT_MIN X#define SHRT_MIN TYPE_MINVAL(short) X#endif X#ifndef SHRT_MAX X#define SHRT_MAX TYPE_MAXVAL(short) X#endif X#ifndef USHRT_MAX X#define USHRT_MAX TYPE_MAXVAL(unsigned short) X#endif X X#ifndef INT_MIN X#define INT_MIN TYPE_MINVAL(int) X#endif X#ifndef INT_MAX X#define INT_MAX TYPE_MAXVAL(int) X#endif X#ifndef UINT_MAX X#define UINT_MAX TYPE_MAXVAL(unsigned int) X#endif X X#ifndef LONG_MIN X#define LONG_MIN TYPE_MINVAL(long) X#endif X#ifndef LONG_MAX X#define LONG_MAX TYPE_MAXVAL(long) X#endif X#ifndef ULONG_MAX X#define ULONG_MAX TYPE_MAXVAL(unsigned long) X#endif X X#define OFF_T_MIN TYPE_MINVAL(off_t) X#define OFF_T_MAX TYPE_MAXVAL(off_t) X X#define UID_T_MIN TYPE_MINVAL(uid_t) X#define UID_T_MAX TYPE_MAXVAL(uid_t) X X#define GID_T_MIN TYPE_MINVAL(gid_t) X#define GID_T_MAX TYPE_MAXVAL(gid_t) X X#define PID_T_MIN TYPE_MINVAL(pid_t) X#define PID_T_MAX TYPE_MAXVAL(pid_t) X X#define MODE_T_MIN TYPE_MINVAL(mode_t) X#define MODE_T_MAX TYPE_MAXVAL(mode_t) X X#define TIME_T_MIN TYPE_MINVAL(time_t) X#define TIME_T_MAX TYPE_MAXVAL(time_t) X X#define CADDR_T_MIN TYPE_MINVAL(caddr_t) X#define CADDR_T_MAX TYPE_MAXVAL(caddr_t) X X#define DADDR_T_MIN TYPE_MINVAL(daddr_t) X#define DADDR_T_MAX TYPE_MAXVAL(daddr_t) X X#define DEV_T_MIN TYPE_MINVAL(dev_t) X#define DEV_T_MAX TYPE_MAXVAL(dev_t) X X#define MAJOR_T_MIN TYPE_MINVAL(major_t) X#define MAJOR_T_MAX TYPE_MAXVAL(major_t) X X#define MINOR_T_MIN TYPE_MINVAL(minor_t) X#define MINOR_T_MAX TYPE_MAXVAL(minor_t) X X#define INO_T_MIN TYPE_MINVAL(ino_t) X#define INO_T_MAX TYPE_MAXVAL(ino_t) X X#define NLINK_T_MIN TYPE_MINVAL(nlink_t) X#define NLINK_T_MAX TYPE_MAXVAL(nlink_t) X X#define BLKSIZE_T_MIN TYPE_MINVAL(blksize_t) X#define BLKSIZE_T_MAX TYPE_MAXVAL(blksize_t) X X#define BLKCNT_T_MIN TYPE_MINVAL(blkcnt_t) X#define BLKCNT_T_MAX TYPE_MAXVAL(blkcnt_t) X X#define CLOCK_T_MIN TYPE_MINVAL(clock_t) X#define CLOCK_T_MAX TYPE_MAXVAL(clock_t) X X#define SOCKLEN_T_MIN TYPE_MINVAL(socklen_t) X#define SOCKLEN_T_MAX TYPE_MAXVAL(socklen_t) X X#ifdef __cplusplus X} X#endif X X#endif /* _SCHILY_UTYPES_H */ END-of-star-1.6/include/schily/utypes.h echo x - star-1.6/include/schily/alloca.h sed 's/^X//' >star-1.6/include/schily/alloca.h << 'END-of-star-1.6/include/schily/alloca.h' X/* @(#)alloca.h 1.7 10/08/24 Copyright 2002-2010 J. Schilling */ X/* X * Definitions for users of alloca() X * X * Important: #include this directly after X * and before any other include file. X * See comment in _AIX part below. X * X * Copyright (c) 2002-2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X X#ifndef _SCHILY_ALLOCA_H X#define _SCHILY_ALLOCA_H X X#ifdef __GNUC__ X# ifndef alloca X# define alloca(s) __builtin_alloca(s) X# endif X#else X# ifdef _MSC_VER X# include X# define alloca _alloca X# else X# if HAVE_ALLOCA_H X# include X# else X# ifdef _AIX X /* X * Indent so pre-ANSI compilers will ignore it X * X * Some versions of AIX may require this to be X * first in the file and only preceded by X * comments and preprocessor directives/ X */ X /* CSTYLED */ X #pragma alloca X# else X# ifndef alloca X#ifdef __cplusplus Xextern "C" { X#endif X /* X * predefined by HP cc +Olibcalls X */ X# ifdef PROTOTYPES X extern void *alloca(); X# else X extern char *alloca(); X# endif X#ifdef __cplusplus X} X#endif X# endif X# endif X# endif X# endif X#endif X X#endif /* _SCHILY_ALLOCA_H */ END-of-star-1.6/include/schily/alloca.h echo x - star-1.6/include/schily/nlsdefs.h sed 's/^X//' >star-1.6/include/schily/nlsdefs.h << 'END-of-star-1.6/include/schily/nlsdefs.h' X/* @(#)nlsdefs.h 1.5 10/12/19 Copyright 2004-2010 J. Schilling */ X/* X * Native language support X * X * Copyright (c) 2004-2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_NLSDEFS_H X#define _SCHILY_NLSDEFS_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifndef NO_NLS X#ifndef USE_NLS X#define USE_NLS /* Make nls the default */ X#endif X#endif X X#ifdef HAVE_LIBINTL_H X#ifndef _INCL_LIBINTL_H X#include /* gettext() */ X#define _INCL_LIBINTL_H X#endif X#else X#undef USE_NLS X#endif X X#ifndef _SCHILY_LOCALE_H X#include /* LC_* definitions */ X#endif X#ifndef _INCL_LOCALE_H X#undef USE_NLS X#endif X X#ifdef HAVE_LANGINFO_H X#ifndef _INCL_LAGINFO_H X#include /* YESSTR amnd similar */ X#define _INCL_LANGINFO_H X#endif X#else X#undef USE_NLS X#endif X X#ifndef HAVE_GETTEXT X#undef USE_NLS X#endif X X#ifdef NO_NLS X#undef USE_NLS X#endif X X#ifdef NO_TEXT_DOMAIN X#undef TEXT_DOMAIN X#endif X X#ifndef USE_NLS X#undef gettext X#define gettext(s) s X#undef dgettext X#define dgettext(d, s) s X#undef dcgettext X#define dcgettext(d, s, c) s X X#undef textdomain X#define textdomain(a) ((char *)0) X#undef bindtextdomain X#define bindtextdomain(d, dir) ((char *)0) X#undef bind_textdomain_codeset X#define bind_textdomain_codeset(d, c) ((char *)0) X#endif X X#ifdef lint X/* X * Allow lint to check printf() format strings. X */ X#define _(s) s X#else /* lint */ X X#ifdef USE_DGETTEXT /* e.g. in a library */ X#define _(s) dgettext(TEXT_DOMAIN, s) X#else X#define _(s) gettext(s) X#endif X#endif /* lint */ X/* X * Allow to mark strings for xgettext(1) X */ X#define __(s) s X X#endif /* _SCHILY_NLSDEFS_H */ END-of-star-1.6/include/schily/nlsdefs.h echo x - star-1.6/include/schily/align.h sed 's/^X//' >star-1.6/include/schily/align.h << 'END-of-star-1.6/include/schily/align.h' X/* @(#)align.h 1.11 13/07/23 Copyright 1995-2013 J. Schilling */ X/* X * Platform dependent definitions for aligning data. X * X * Copyright (c) 1995-2013 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X/* X * The automatically created included file defines the following macros: X * X * saligned(a) One parameter aligned for a "short int" X * s2aligned(a, b) Both parameters aligned for a "short int" X * ialigned(a) One parameter aligned for a "int" X * i2aligned(a, b) Both parameters aligned for a "int" X * laligned(a) One parameter aligned for a "long" X * l2aligned(a, b) Both parameters aligned for a "long" X * llaligned(a) One parameter aligned for a "long long" X * ll2aligned(a, b) Both parameters aligned for a "long long" X * faligned(a) One parameter aligned for a "float" X * f2aligned(a, b) Both parameters aligned for a "float" X * daligned(a) One parameter aligned for a "double" X * d2aligned(a, b) Both parameters aligned for a "double" X * paligned(a) One parameter aligned for a "pointer" X * p2aligned(a, b) Both parameters aligned for a "pointe" X * X * salign(x) Align for a "short int" X * ialign(x) Align for a "int" X * lalign(x) Align for a "long" X * llalign(x) Align for a "long long" X * falign(x) Align for a "float" X * dalign(x) Align for a "double" X * palign(x) Align for a "pointer" X */ X#ifndef _SCHILY_ALIGN_H X#define _SCHILY_ALIGN_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifndef _SCHILY_UTYPES_H X#include X#endif X X#ifdef SCHILY_BUILD /* #defined by Schily makefile system */ X /* X * Include $(SRCROOT)/incs/$(OARCH)/align.h via X * -I$(SRCROOT)/incs/$(OARCH)/ X */ X# include X#else /* !SCHILY_BUILD */ X/* X * The stuff for static compilation. Include files from a previous X * dynamic autoconfiguration. X */ X#ifdef __SUNOS5_SPARC_CC32 X#include X#define __JS_ARCH_ALIGN_INCL X#endif X#ifdef __SUNOS5_SPARC_CC64 X#include X#define __JS_ARCH_ALIGN_INCL X#endif X#ifdef __SUNOS5_SPARC_GCC32 X#include X#define __JS_ARCH_ALIGN_INCL X#endif X#ifdef __SUNOS5_SPARC_GCC64 X#include X#define __JS_ARCH_ALIGN_INCL X#endif X#ifdef __SUNOS5_X86_CC32 X#include X#define __JS_ARCH_ALIGN_INCL X#endif X#ifdef __SUNOS5_X86_CC64 X#include X#define __JS_ARCH_ALIGN_INCL X#endif X#ifdef __SUNOS5_X86_GCC32 X#include X#define __JS_ARCH_ALIGN_INCL X#endif X#ifdef __SUNOS5_X86_GCC64 X#include X#define __JS_ARCH_ALIGN_INCL X#endif X X#ifdef __HPUX_HPPA_CC32 X#include X#define __JS_ARCH_CONF_INCL X#endif X#ifdef __HPUX_HPPA_CC64 X#include X#define __JS_ARCH_CONF_INCL X#endif X#ifdef __HPUX_HPPA_GCC32 X#include X#define __JS_ARCH_CONF_INCL X#endif X#ifdef __HPUX_HPPA_GCC64 X#include X#define __JS_ARCH_CONF_INCL X#endif X X#ifdef __LINUX_ARMV6L_GCC32 X#include X#define __JS_ARCH_CONF_INCL X#endif X#ifdef __LINUX_ARMV5L_GCC32 X#include X#define __JS_ARCH_CONF_INCL X#endif X#ifdef __LINUX_ARMV5TEJL_GCC32 X#include X#define __JS_ARCH_CONF_INCL X#endif X#ifdef __LINUX_I386_GCC32 X#include X#define __JS_ARCH_CONF_INCL X#endif X#ifdef __LINUX_amd64_GCC64 X#include X#define __JS_ARCH_CONF_INCL X#endif X X#ifdef __MSWIN_X86_CL32 X#include X#define __JS_ARCH_ALIGN_INCL X#endif X X#ifdef __CYGWIN_X86_GCC X#include X#define __JS_ARCH_ALIGN_INCL X#endif X X#ifndef __JS_ARCH_ALIGN_INCL X/* X * #error will not work for all compilers (e.g. sunos4) X * The following line will abort compilation on all compilers X * if none of the above is defined. And that's what we want. X */ XError unconfigured architecture X X#include /* Avoid "unknown directive" with K&R */ X#endif X X#endif /* SCHILY_BUILD */ X X#ifdef __cplusplus Xextern "C" { X#endif X/* X * Fake in order to keep the silly hdrchk(1) quiet. X */ X#ifdef __cplusplus X} X#endif X X#endif /* _SCHILY_ALIGN_H */ END-of-star-1.6/include/schily/align.h echo x - star-1.6/include/schily/avoffset.h sed 's/^X//' >star-1.6/include/schily/avoffset.h << 'END-of-star-1.6/include/schily/avoffset.h' X/* @(#)avoffset.h 1.13 13/08/26 Copyright 1995-2013 J. Schilling */ X/* X * Platform dependent definitions for stack scanning. X * X * Copyright (c) 1995-2013 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X/* X * This file includes definitions for STACK_DIRECTION, X * AV_OFFSET and FP_INDIR. X * X * STACK_DIRECTION: X * +1 -> stack grows to larger addresses X * -1 -> stack "groes" to lower addresses X * X * FP_INDIR: the number of fp chain elements above 'main'. X * X * AV_OFFSET: the offset of &av[0] relative to the frame pointer X * in 'main'. X * X * If getav0() does not work on a specific architecture X * the program which generated this automaticly generated include file X * may dump core. In this case, the generated include file does not include X * definitions for AV_OFFSET and FP_INDIR but ends after the X * STACK_DIRECTION definition. X * If AV_OFFSET or FP_INDIR are missing in the file, all code X * that use the definitions are automatically disabled. X */ X#ifndef _SCHILY_AVOFFSET_H X#define _SCHILY_AVOFFSET_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifdef SCHILY_BUILD /* #defined by Schily makefile system */ X /* X * Include $(SRCROOT)/incs/$(OARCH)/avoffset.h via X * -I$(SRCROOT)/incs/$(OARCH)/ X */ X# include X#else /* !SCHILY_BUILD */ X/* X * The stuff for static compilation. Include files from a previous X * dynamic autoconfiguration. X */ X#ifdef __SUNOS5_SPARC_CC32 X#include X#define __JS_ARCH_AVOFFSET_INCL X#endif X#ifdef __SUNOS5_SPARC_CC64 X#include X#define __JS_ARCH_AVOFFSET_INCL X#endif X#ifdef __SUNOS5_SPARC_GCC32 X#include X#define __JS_ARCH_AVOFFSET_INCL X#endif X#ifdef __SUNOS5_SPARC_GCC64 X#include X#define __JS_ARCH_AVOFFSET_INCL X#endif X#ifdef __SUNOS5_X86_CC32 X#include X#define __JS_ARCH_AVOFFSET_INCL X#endif X#ifdef __SUNOS5_X86_CC64 X#include X#define __JS_ARCH_AVOFFSET_INCL X#endif X#ifdef __SUNOS5_X86_GCC32 X#include X#define __JS_ARCH_AVOFFSET_INCL X#endif X#ifdef __SUNOS5_X86_GCC64 X#include X#define __JS_ARCH_AVOFFSET_INCL X#endif X X#ifdef __HPUX_HPPA_CC32 X#include X#define __JS_ARCH_CONF_INCL X#endif X#ifdef __HPUX_HPPA_CC64 X#include X#define __JS_ARCH_CONF_INCL X#endif X#ifdef __HPUX_HPPA_GCC32 X#include X#define __JS_ARCH_CONF_INCL X#endif X#ifdef __HPUX_HPPA_GCC64 X#include X#define __JS_ARCH_CONF_INCL X#endif X X#ifdef __LINUX_ARMV6L_GCC32 X#include X#define __JS_ARCH_CONF_INCL X#endif X#ifdef __LINUX_ARMV5L_GCC32 X#include X#define __JS_ARCH_CONF_INCL X#endif X#ifdef __LINUX_ARMV5TEJL_GCC32 X#include X#define __JS_ARCH_CONF_INCL X#endif X#ifdef __LINUX_I386_GCC32 X#include X#define __JS_ARCH_CONF_INCL X#endif X#ifdef __LINUX_amd64_GCC64 X#include X#define __JS_ARCH_CONF_INCL X#endif X X#ifdef __MSWIN_X86_CL32 X#include X#define __JS_ARCH_AVOFFSET_INCL X#endif X X#ifdef __CYGWIN_X86_GCC X#include X#define __JS_ARCH_AVOFFSET_INCL X#endif X X#ifndef __JS_ARCH_AVOFFSET_INCL X/* X * #error will not work for all compilers (e.g. sunos4) X * The following line will abort compilation on all compilers X * if none of the above is defined. And that's what we want. X */ XError unconfigured architecture X X#include /* Avoid "unknown directive" with K&R */ X#endif X X#endif /* SCHILY_BUILD */ X X#ifdef __cplusplus Xextern "C" { X#endif X/* X * Fake in order to keep the silly hdrchk(1) quiet. X */ X#ifdef __cplusplus X} X#endif X X#endif /* _SCHILY_AVOFFSET_H */ END-of-star-1.6/include/schily/avoffset.h echo x - star-1.6/include/schily/xmconfig.h sed 's/^X//' >star-1.6/include/schily/xmconfig.h << 'END-of-star-1.6/include/schily/xmconfig.h' X/* @(#)xmconfig.h 1.45 10/08/27 Copyright 1995-2010 J. Schilling */ X/* X * This file either includes the manual generated X * static definitions for a machine configuration. X * X * Copyright (c) 1995-2010 J. Schilling X * X * Use only cpp instructions. X * X * NOTE: SING: (Schily Is Not Gnu) X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_XMCONFIG_H X#define _SCHILY_XMCONFIG_H X X/* X * This is the only static (hand crafted) set of machine configuration X * left over. We are trying to avoid even this in future. X */ X X X#ifdef __cplusplus Xextern "C" { X#endif X X#if defined(VMS) X# define PROTOTYPES X# define HAVE_OSDEF /* prevent later defines to overwrite current */ X# define __NOT_SVR4__ /* Not a real SVR4 implementation */ X X# define HAVE_UNISTD_H X# define HAVE_SYS_TYPES_H X# define HAVE_CTYPE_H X/* # define HAVE_SYS_TIME_H */ X# define HAVE_FCNTL_H X# define HAVE_USLEEP X# if __DECC_VER >= 60000000 X# define HAVE_INTTYPES_H X# endif /* __DECC_VER >= 60000000 */ X# define SIZEOF_CHAR 1 X# define SIZEOF_UNSIGNED_CHAR SIZEOF_CHAR X# define SIZEOF_SHORT_INT 2 X# define SIZEOF_UNSIGNED_SHORT_INT SIZEOF_SHORT_INT X# define SIZEOF_INT 4 X# define SIZEOF_UNSIGNED_INT SIZEOF_INT X# define SIZEOF_LONG_INT 4 X# define SIZEOF_UNSIGNED_LONG_INT SIZEOF_LONG_INT X# ifdef __VAX X# define SIZEOF_LONG_LONG 4 X# else /* def __VAX */ X# endif /* def __VAX [else] */ X# define SIZEOF_UNSIGNED_LONG_LONG SIZEOF_LONG_LONG X# define SIZEOF_CHAR_P 4 X X# include X# ifndef __OFF_T X typedef int off_t; X# endif /* ndef __OFF_T */ X X# if defined(__alpha) X# define HOST_CPU "Alpha" X# elif defined(__ia64) X# define HOST_CPU "IA64" X# elif defined(__vax) X# define HOST_CPU "VAX" X# else X# define HOST_CPU "VAX(?)" X# endif X# define HOST_VENDOR "HP" X# define HOST_OS "VMS/OpenVMS" X# define RETSIGTYPE void X# define HAVE_STDARG_H X# define HAVE_STDLIB_H X# define HAVE_STRING_H X# define HAVE_STDC_HEADERS X# define STDC_HEADERS X# define HAVE_UNISTD_H X# define HAVE_FCNTL_H X# define HAVE_DIRENT_H X# define HAVE_WAIT_H X# define HAVE_SYS_UTSNAME_H X# define HAVE_GETCWD X# define HAVE_STRERROR X# define HAVE_MEMMOVE X# define HAVE_MMAP X# define HAVE_FLOCK X# define HAVE_GETHOSTNAME X# define HAVE_SELECT X# define USLEEPRETURN_T unsigned int X X# define HAVE_STRUCT_TIMEVAL X# define HAVE_UTSNAME_ARCH /* uname -p */ X X# define HAVE_MALLOC X# define HAVE_CALLOC X# define HAVE_REALLOC X X# define HAVE_UNAME X# define HAVE_RENAME X# define HAVE_PUTENV X# define HAVE_STRNCPY X X/* 2005-11-22 SMS. Enabled some above. Added some below. */ X# define HAVE_ECVT X# define HAVE_FCVT X# define HAVE_GCVT X# define HAVE_NICE 1 X# define HAVE_SELECT X# define HAVE_STRCASECMP X# if __CRTL_VER >= 70312000 X# define HAVE_SNPRINTF X# endif /* __CRTL_VER >= 70312000 */ X# define NICE_DECR -8 X X/* 2005-03-14 SMS. Need VMS-specific open() parameters. */ X#ifndef NO_OPENFD_SRC X# define _OPENFD_SRC /* Use VMS-specific _openfd() function. */ X# define _openfd openfd_vms /* This one. */ X# define O_BINARY 0x0004 /* DOS-like value. Implies "ctx=bin". */ X#endif X X# define HAVE_C_BIGENDIAN X# define HAVE_C_BITFIELDS X# define BITFIELDS_LTOH X X/* 2006-09-14 SMS. Various things for libfind. */ X# define fork fork_dummy X# ifndef _POSIX_ARG_MAX X# define _POSIX_ARG_MAX 4096 /* Probably needed. */ X# endif /* ndef _POSIX_ARG_MAX */ X# define HAVE_DECL_STAT X# define HAVE_DECL_LSTAT X X/* 2006-09-17 SMS. */ X# if __CRTL_VER >= 70000000 X# define HAVE_GETPAGESIZE X# endif /* __CRTL_VER >= 70000000 */ X X extern pid_t fork_dummy(void); X X#endif /* defined(VMS) */ X X X#ifdef __cplusplus X} X#endif X X#endif /* _SCHILY_XMCONFIG_H */ END-of-star-1.6/include/schily/xmconfig.h echo x - star-1.6/include/schily/errno.h sed 's/^X//' >star-1.6/include/schily/errno.h << 'END-of-star-1.6/include/schily/errno.h' X/* @(#)errno.h 1.7 10/08/24 Copyright 2006-2010 J. Schilling */ X/* X * Error number related definitions X * X * Copyright (c) 2006-2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_ERRNO_H X#define _SCHILY_ERRNO_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifdef JOS X#include X X#define ENOEXEC EBADHEADER X#define EACCES EACCESS X#define ENOENT ENOFILE X#define EEXIST EEXISTS X#else X#include X X#define EMISSDIR ENOENT X#define ENDOFFILE EFBIG X#endif X X#ifndef HAVE_ERRNO_DEF Xextern int errno; X#endif X X#ifndef HAVE_STRERROR Xextern char *sys_errlist[]; Xextern int sys_nerr; X#endif X X#ifdef __cplusplus Xextern "C" { X#endif X X#ifndef seterrno Xextern int seterrno __PR((int)); X#endif Xextern int geterrno __PR((void)); X X#ifdef __cplusplus X} X#endif X X#endif /* _SCHILY_ERRNO_H */ END-of-star-1.6/include/schily/errno.h echo x - star-1.6/include/schily/archdefs.h sed 's/^X//' >star-1.6/include/schily/archdefs.h << 'END-of-star-1.6/include/schily/archdefs.h' X/* @(#)archdefs.h 1.15 17/11/25 Copyright 2006-2017 J. Schilling */ X/* X * Processor, instruction set and OS architecture specific defines. X * The information is fetched from compiler predefinitions only. X * X * Copyright (c) 2006-2017 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_ARCHDEFS_H X#define _SCHILY_ARCHDEFS_H X X/* X * The code in this file only depends on compiler predefined macros. X * For this reason, it does not need to include schily/mconfig.h X */ X X#if defined(sun) || defined(__sun) || defined(__sun__) X#ifndef __sun X#define __sun X#endif X#endif X X#if defined(sun2) X#ifndef __mc68010 X#define __mc68010 X#endif X#endif X X#if defined(mc68020) || defined(__mc68020) || defined(sun3) X#ifndef __mc68020 X#define __mc68020 X#endif X#endif X X#if defined(__mc68010) || defined(__mc68020) X#ifndef __mc68000 X#define __mc68000 X#endif X#endif X X#if defined(i386) || defined(__i386) || defined(__i386__) || defined(_M_IX86) X#ifndef __i386 X#define __i386 X#endif X#endif X X#if defined(__amd64) || defined(__amd64__) || \ X defined(__x86_64) || defined(__x86_64__) || defined(_M_AMD64) X#ifndef __amd64 X#define __amd64 X#endif X#endif X X#if defined(__i386) || defined(__amd64) X#ifndef __x86 X#define __x86 X#endif X#endif X X#if defined(sparc) || defined(__sparc) || defined(__sparc__) X#ifndef __sparc X#define __sparc X#endif X#endif X X#if defined(__sparcv9) || defined(__sparcv9__) X#ifndef __sparc X#define __sparc X#endif X#ifndef __sparcv9 X#define __sparcv9 X#endif X#endif X X#if defined(__sparc) && defined(__arch64__) X#ifndef __sparcv9 X#define __sparcv9 X#endif X#endif X X#if defined(SOL2) || defined(SOL2) || \ X defined(S5R4) || defined(__S5R4) || defined(SVR4) X# ifndef __SVR4 X# define __SVR4 X# endif X#endif X X#if defined(sun2) || defined(sun3) || defined(__sun) X#ifndef __sun X#define __sun X#endif X#ifndef __GNUC__ X#ifndef __IS_SUNPRO_C X#ifdef __SVR4 X#define __IS_SUNPRO_C X#else X#define __IS_SUN_C X#endif /* __SVR4 */ X#endif /* !__IS_SUNPRO_C */ X#endif /* !__GNUC__ */ X#endif /* __sun */ X X X/* X * SunOS 4 specific defines X */ X#if defined(__sun) && !defined(__SVR4) X X#define __SUNOS4 X X#if defined(__mc68000) X#define __SUNOS4_MC68000 X#ifdef __GNUC__ X#define __SUNOS4_MC68000_GCC32 X#define __JS_ARCH_DEFINED X#endif X#ifdef __IS_SUN_C X#define __SUNOS4_MC68000_CC32 X#define __JS_ARCH_DEFINED X#endif X#endif /* __mc68000 */ X X#if defined(__sparc) X#define __SUNOS4_SPARC X#ifdef __GNUC__ X#define __SUNOS4_SPARC_GCC32 X#define __JS_ARCH_DEFINED X#endif X#if defined(__IS_SUN_C) || defined(__SUNPRO_C) || defined(__IS_SUNPRO_C) X#define __SUNOS4_SPARC_CC32 X#define __JS_ARCH_DEFINED X#endif X#endif /* __sparc */ X X#endif /* SunOS 4 */ X X X/* X * SunOS 5 specific defines X */ X#if defined(__sun) && defined(__SVR4) X X#define __SUNOS5 X X#if defined(__sparc) X#ifdef __GNUC__ X#ifdef __sparcv9 X#define __SUNOS5_SPARC_GCC64 X#else X#define __SUNOS5_SPARC_GCC32 X#endif X#define __JS_ARCH_DEFINED X#endif X#if defined(__SUNPRO_C) || defined(__IS_SUNPRO_C) X#ifdef __sparcv9 X#define __SUNOS5_SPARC_CC64 X#else X#define __SUNOS5_SPARC_CC32 X#endif X#define __JS_ARCH_DEFINED X#endif X#endif /* __sparc */ X X#if defined(__x86) X#ifdef __GNUC__ X#ifdef __amd64 X#define __SUNOS5_X86_GCC64 X#else X#define __SUNOS5_X86_GCC32 X#endif X#define __JS_ARCH_DEFINED X#endif X#if defined(__SUNPRO_C) || defined(__IS_SUNPRO_C) X#ifdef __amd64 X#define __SUNOS5_X86_CC64 X#else X#define __SUNOS5_X86_CC32 X#endif X#define __JS_ARCH_DEFINED X#endif X#endif /* __x86 */ X X#endif /* SunOS 5 */ X X/* X * HP-UX specific defines X */ X#if defined(__hpux) X X#if defined(__hppa) X#ifdef __GNUC__ X#ifdef __LP64__ /* This may be wrong! */ X#define __HPUX_HPPA_GCC64 X#else X#define __HPUX_HPPA_GCC32 X#endif X#define __JS_ARCH_DEFINED X#endif X#if !defined(__GNUC__) X#ifdef __LP64__ X#define __HPUX_HPPA_CC64 X#else X#define __HPUX_HPPA_CC32 X#endif X#define __JS_ARCH_DEFINED X#endif X#endif /* __hppa */ X X#endif /* HP-UX */ X X/* X * Linux specific defines X */ X#if defined(__linux) X X#if defined(__arm__) X#ifdef __GNUC__ X#ifdef __ARM_ARCH_5TE__ X#define __LINUX_ARMV5TEJL_GCC32 X#define __JS_ARCH_DEFINED X#endif X#ifndef __JS_ARCH_DEFINED X#ifdef __ARM_ARCH_6__ X#define __LINUX_ARMV6L_GCC32 X#define __JS_ARCH_DEFINED X#endif X#endif X#ifndef __JS_ARCH_DEFINED X#ifdef __ARM_ARCH_5__ X#define __LINUX_ARMV5L_GCC32 X#define __JS_ARCH_DEFINED X#endif X#endif X#endif /* __GNUC__ */ X#endif /* __arm__ */ X X#if defined(__i386__) || defined(i386) X#ifdef __GNUC__ X#define __LINUX_I386_GCC32 X#define __JS_ARCH_DEFINED X#endif X#endif /* __i386__ */ X#if defined(__amd64__) || defined(__amd64) X#ifdef __GNUC__ X#define __LINUX_amd64_GCC64 X#define __JS_ARCH_DEFINED X#endif X#endif /* __amd64__ */ X X#endif /* Linux */ X X/* X * MS-WIN specific defines X * X * cl defines one of: X * _M_ALPHA X * _M_IX86 X * _M_AMD64 X * _M_M68K X * _M_PPC PPC in general X * _M_MPPC Power Macintosh X * _M_MRX000 Mips X * _M_IA64 Itanium X */ X#if defined(_MSC_VER) && (defined(_X86_) || defined(_M_IX86)) X#define __MSWIN_X86_CL32 X#define __JS_ARCH_DEFINED X#endif X X#if defined(__CYGWIN32__) || defined(__CYGWIN__) X#define __CYGWIN_X86_GCC X#define __JS_ARCH_DEFINED X#endif X X#endif /* _SCHILY_ARCHDEFS_H */ END-of-star-1.6/include/schily/archdefs.h echo x - star-1.6/include/schily/xconfig.h sed 's/^X//' >star-1.6/include/schily/xconfig.h << 'END-of-star-1.6/include/schily/xconfig.h' X/* @(#)xconfig.h 1.13 13/07/23 Copyright 1995-2013 J. Schilling */ X/* X * This file either includes the dynamic or manual autoconf stuff. X * X * Copyright (c) 1995-2013 J. Schilling X * X * This file is included from and usually X * includes $(SRCROOT)/incs/$(OARCH)/xconfig.h via X * -I$(SRCROOT)/incs/$(OARCH)/ X * X * Use only cpp instructions. X * X * NOTE: SING: (Schily Is Not Gnu) X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_XCONFIG_H X#define _SCHILY_XCONFIG_H X X/* X * This hack that is needed as long as VMS has no POSIX shell. X * It will go away soon. VMS users: in future you need to specify: X * cc -DUSE_STATIC_CONF X */ X#ifdef VMS X# define USE_STATIC_CONF X#endif X X#ifdef NO_STATIC_CONF X#undef USE_STATIC_CONF X#endif X X#ifdef USE_STATIC_CONF X# include /* The static autoconf stuff */ X#else /* USE_STATIC_CONF */ X X X#ifdef SCHILY_BUILD /* #defined by Schily makefile system */ X /* X * Include $(SRCROOT)/incs/$(OARCH)/xconfig.h via X * -I$(SRCROOT)/incs/$(OARCH)/ X */ X# include /* The current dynamic autoconf stuff */ X#else /* !SCHILY_BUILD */ X/* X * The stuff for static compilation. Include files from a previous X * dynamic autoconfiguration. X */ X#ifdef __SUNOS5_SPARC_CC32 X#include X#define __JS_ARCH_CONF_INCL X#endif X#ifdef __SUNOS5_SPARC_CC64 X#include X#define __JS_ARCH_CONF_INCL X#endif X#ifdef __SUNOS5_SPARC_GCC32 X#include X#define __JS_ARCH_CONF_INCL X#endif X#ifdef __SUNOS5_SPARC_GCC64 X#include X#define __JS_ARCH_CONF_INCL X#endif X#ifdef __SUNOS5_X86_CC32 X#include X#define __JS_ARCH_CONF_INCL X#endif X#ifdef __SUNOS5_X86_CC64 X#include X#define __JS_ARCH_CONF_INCL X#endif X#ifdef __SUNOS5_X86_GCC32 X#include X#define __JS_ARCH_CONF_INCL X#endif X#ifdef __SUNOS5_X86_GCC64 X#include X#define __JS_ARCH_CONF_INCL X#endif X X#ifdef __SUNOS4_MC68000_CC32 X#ifdef __mc68020 X#include X#define __JS_ARCH_CONF_INCL X#endif X#endif X#ifdef __SUNOS4_MC68000_GCC32 X#ifdef __mc68020 X#include X#define __JS_ARCH_CONF_INCL X#endif X#endif X X#ifdef __HPUX_HPPA_CC32 X#include X#define __JS_ARCH_CONF_INCL X#endif X#ifdef __HPUX_HPPA_CC64 X#include X#define __JS_ARCH_CONF_INCL X#endif X#ifdef __HPUX_HPPA_GCC32 X#include X#define __JS_ARCH_CONF_INCL X#endif X#ifdef __HPUX_HPPA_GCC64 X#include X#define __JS_ARCH_CONF_INCL X#endif X X#ifdef __LINUX_ARMV6L_GCC32 X#include X#define __JS_ARCH_CONF_INCL X#endif X#ifdef __LINUX_ARMV5L_GCC32 X#include X#define __JS_ARCH_CONF_INCL X#endif X#ifdef __LINUX_ARMV5TEJL_GCC32 X#include X#define __JS_ARCH_CONF_INCL X#endif X#ifdef __LINUX_I386_GCC32 X#include X#define __JS_ARCH_CONF_INCL X#endif X#ifdef __LINUX_amd64_GCC64 X#include X#define __JS_ARCH_CONF_INCL X#endif X X#ifdef __MSWIN_X86_CL32 X#include X#define __JS_ARCH_CONF_INCL X#endif X X#ifdef __CYGWIN_X86_GCC X#include X#define __JS_ARCH_CONF_INCL X#endif X X#ifndef __JS_ARCH_CONF_INCL X/* X * #error will not work for all compilers (e.g. sunos4) X * The following line will abort compilation on all compilers X * if none of the above is defined. And that's what we want. X */ XError unconfigured architecture X X#include /* Avoid "unknown directive" with K&R */ X#endif X X#endif /* SCHILY_BUILD */ X X#endif /* USE_STATIC_CONF */ X X#ifdef __cplusplus Xextern "C" { X#endif X/* X * Fake in order to keep the silly hdrchk(1) quiet. X */ X#ifdef __cplusplus X} X#endif X X#endif /* _SCHILY_XCONFIG_H */ END-of-star-1.6/include/schily/xconfig.h echo x - star-1.6/include/schily/Makefile sed 's/^X//' >star-1.6/include/schily/Makefile << 'END-of-star-1.6/include/schily/Makefile' X#ident @(#)Makefile 1.22 13/10/27 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= align.h X Xinclude Targets XXMK_FILE= $(X_MK_LIST) X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/Makefile echo x - star-1.6/include/schily/align.mk sed 's/^X//' >star-1.6/include/schily/align.mk << 'END-of-star-1.6/include/schily/align.mk' X#ident @(#)align.mk 1.1 06/12/17 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= align.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/align.mk echo x - star-1.6/include/schily/alloca.mk sed 's/^X//' >star-1.6/include/schily/alloca.mk << 'END-of-star-1.6/include/schily/alloca.mk' X#ident @(#)alloca.mk 1.1 06/12/17 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= alloca.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/alloca.mk echo x - star-1.6/include/schily/archdefs.mk sed 's/^X//' >star-1.6/include/schily/archdefs.mk << 'END-of-star-1.6/include/schily/archdefs.mk' X#ident @(#)archdefs.mk 1.1 06/12/17 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= archdefs.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/archdefs.mk echo x - star-1.6/include/schily/avoffset.mk sed 's/^X//' >star-1.6/include/schily/avoffset.mk << 'END-of-star-1.6/include/schily/avoffset.mk' X#ident @(#)avoffset.mk 1.1 06/12/17 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= avoffset.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/avoffset.mk echo x - star-1.6/include/schily/btorder.mk sed 's/^X//' >star-1.6/include/schily/btorder.mk << 'END-of-star-1.6/include/schily/btorder.mk' X#ident @(#)btorder.mk 1.1 06/12/17 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= btorder.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/btorder.mk echo x - star-1.6/include/schily/ccomdefs.mk sed 's/^X//' >star-1.6/include/schily/ccomdefs.mk << 'END-of-star-1.6/include/schily/ccomdefs.mk' X#ident @(#)ccomdefs.mk 1.1 06/12/17 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= ccomdefs.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/ccomdefs.mk echo x - star-1.6/include/schily/deflts.mk sed 's/^X//' >star-1.6/include/schily/deflts.mk << 'END-of-star-1.6/include/schily/deflts.mk' X#ident @(#)deflts.mk 1.1 06/12/17 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= deflts.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/deflts.mk echo x - star-1.6/include/schily/device.mk sed 's/^X//' >star-1.6/include/schily/device.mk << 'END-of-star-1.6/include/schily/device.mk' X#ident @(#)device.mk 1.1 06/12/17 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= device.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/device.mk echo x - star-1.6/include/schily/dirent.mk sed 's/^X//' >star-1.6/include/schily/dirent.mk << 'END-of-star-1.6/include/schily/dirent.mk' X#ident @(#)dirent.mk 1.1 06/12/17 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= dirent.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/dirent.mk echo x - star-1.6/include/schily/errno.mk sed 's/^X//' >star-1.6/include/schily/errno.mk << 'END-of-star-1.6/include/schily/errno.mk' X#ident @(#)errno.mk 1.1 06/12/17 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= errno.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/errno.mk echo x - star-1.6/include/schily/fcntl.mk sed 's/^X//' >star-1.6/include/schily/fcntl.mk << 'END-of-star-1.6/include/schily/fcntl.mk' X#ident @(#)fcntl.mk 1.1 06/12/17 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= fcntl.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/fcntl.mk echo x - star-1.6/include/schily/fnmatch.mk sed 's/^X//' >star-1.6/include/schily/fnmatch.mk << 'END-of-star-1.6/include/schily/fnmatch.mk' X#ident @(#)fnmatch.mk 1.1 06/12/17 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= fnmatch.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/fnmatch.mk echo x - star-1.6/include/schily/getargs.mk sed 's/^X//' >star-1.6/include/schily/getargs.mk << 'END-of-star-1.6/include/schily/getargs.mk' X#ident @(#)getargs.mk 1.1 06/12/17 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= getargs.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/getargs.mk echo x - star-1.6/include/schily/getcwd.mk sed 's/^X//' >star-1.6/include/schily/getcwd.mk << 'END-of-star-1.6/include/schily/getcwd.mk' X#ident @(#)getcwd.mk 1.1 06/12/17 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= getcwd.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/getcwd.mk echo x - star-1.6/include/schily/intcvt.mk sed 's/^X//' >star-1.6/include/schily/intcvt.mk << 'END-of-star-1.6/include/schily/intcvt.mk' X#ident @(#)intcvt.mk 1.1 06/12/17 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= intcvt.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/intcvt.mk echo x - star-1.6/include/schily/jmpdefs.mk sed 's/^X//' >star-1.6/include/schily/jmpdefs.mk << 'END-of-star-1.6/include/schily/jmpdefs.mk' X#ident @(#)jmpdefs.mk 1.1 06/12/17 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= jmpdefs.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/jmpdefs.mk echo x - star-1.6/include/schily/types.mk sed 's/^X//' >star-1.6/include/schily/types.mk << 'END-of-star-1.6/include/schily/types.mk' X#ident @(#)types.mk 1.1 07/01/03 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= types.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/types.mk echo x - star-1.6/include/schily/libport.mk sed 's/^X//' >star-1.6/include/schily/libport.mk << 'END-of-star-1.6/include/schily/libport.mk' X#ident @(#)libport.mk 1.1 06/12/17 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= libport.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/libport.mk echo x - star-1.6/include/schily/librmt.mk sed 's/^X//' >star-1.6/include/schily/librmt.mk << 'END-of-star-1.6/include/schily/librmt.mk' X#ident @(#)librmt.mk 1.1 06/12/17 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= librmt.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/librmt.mk echo x - star-1.6/include/schily/maxpath.mk sed 's/^X//' >star-1.6/include/schily/maxpath.mk << 'END-of-star-1.6/include/schily/maxpath.mk' X#ident @(#)maxpath.mk 1.1 06/12/17 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= maxpath.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/maxpath.mk echo x - star-1.6/include/schily/mconfig.mk sed 's/^X//' >star-1.6/include/schily/mconfig.mk << 'END-of-star-1.6/include/schily/mconfig.mk' X#ident @(#)mconfig.mk 1.1 06/12/17 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= mconfig.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/mconfig.mk echo x - star-1.6/include/schily/mman.mk sed 's/^X//' >star-1.6/include/schily/mman.mk << 'END-of-star-1.6/include/schily/mman.mk' X#ident @(#)mman.mk 1.1 06/12/17 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= mman.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/mman.mk echo x - star-1.6/include/schily/mtio.mk sed 's/^X//' >star-1.6/include/schily/mtio.mk << 'END-of-star-1.6/include/schily/mtio.mk' X#ident @(#)mtio.mk 1.1 06/12/17 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= mtio.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/mtio.mk echo x - star-1.6/include/schily/nlsdefs.mk sed 's/^X//' >star-1.6/include/schily/nlsdefs.mk << 'END-of-star-1.6/include/schily/nlsdefs.mk' X#ident @(#)nlsdefs.mk 1.1 06/12/17 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= nlsdefs.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/nlsdefs.mk echo x - star-1.6/include/schily/patmatch.mk sed 's/^X//' >star-1.6/include/schily/patmatch.mk << 'END-of-star-1.6/include/schily/patmatch.mk' X#ident @(#)patmatch.mk 1.1 06/12/17 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= patmatch.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/patmatch.mk echo x - star-1.6/include/schily/prototyp.mk sed 's/^X//' >star-1.6/include/schily/prototyp.mk << 'END-of-star-1.6/include/schily/prototyp.mk' X#ident @(#)prototyp.mk 1.1 06/12/17 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= prototyp.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/prototyp.mk echo x - star-1.6/include/schily/rmtio.mk sed 's/^X//' >star-1.6/include/schily/rmtio.mk << 'END-of-star-1.6/include/schily/rmtio.mk' X#ident @(#)rmtio.mk 1.1 06/12/17 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= rmtio.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/rmtio.mk echo x - star-1.6/include/schily/schily.mk sed 's/^X//' >star-1.6/include/schily/schily.mk << 'END-of-star-1.6/include/schily/schily.mk' X#ident @(#)schily.mk 1.1 06/12/17 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= schily.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/schily.mk echo x - star-1.6/include/schily/sigblk.mk sed 's/^X//' >star-1.6/include/schily/sigblk.mk << 'END-of-star-1.6/include/schily/sigblk.mk' X#ident @(#)sigblk.mk 1.1 06/12/17 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= sigblk.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/sigblk.mk echo x - star-1.6/include/schily/signal.mk sed 's/^X//' >star-1.6/include/schily/signal.mk << 'END-of-star-1.6/include/schily/signal.mk' X#ident @(#)signal.mk 1.1 06/12/17 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= signal.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/signal.mk echo x - star-1.6/include/schily/standard.mk sed 's/^X//' >star-1.6/include/schily/standard.mk << 'END-of-star-1.6/include/schily/standard.mk' X#ident @(#)standard.mk 1.1 06/12/17 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= standard.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/standard.mk echo x - star-1.6/include/schily/stat.mk sed 's/^X//' >star-1.6/include/schily/stat.mk << 'END-of-star-1.6/include/schily/stat.mk' X#ident @(#)stat.mk 1.1 06/12/17 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= stat.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/stat.mk echo x - star-1.6/include/schily/stdlib.mk sed 's/^X//' >star-1.6/include/schily/stdlib.mk << 'END-of-star-1.6/include/schily/stdlib.mk' X#ident @(#)stdlib.mk 1.1 06/12/17 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= stdlib.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/stdlib.mk echo x - star-1.6/include/schily/stkframe.mk sed 's/^X//' >star-1.6/include/schily/stkframe.mk << 'END-of-star-1.6/include/schily/stkframe.mk' X#ident @(#)stkframe.mk 1.1 06/12/17 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= stkframe.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/stkframe.mk echo x - star-1.6/include/schily/string.mk sed 's/^X//' >star-1.6/include/schily/string.mk << 'END-of-star-1.6/include/schily/string.mk' X#ident @(#)string.mk 1.1 06/12/17 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= string.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/string.mk echo x - star-1.6/include/schily/termcap.mk sed 's/^X//' >star-1.6/include/schily/termcap.mk << 'END-of-star-1.6/include/schily/termcap.mk' X#ident @(#)termcap.mk 1.1 06/12/17 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= termcap.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/termcap.mk echo x - star-1.6/include/schily/termios.mk sed 's/^X//' >star-1.6/include/schily/termios.mk << 'END-of-star-1.6/include/schily/termios.mk' X#ident @(#)termios.mk 1.1 06/12/17 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= termios.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/termios.mk echo x - star-1.6/include/schily/time.mk sed 's/^X//' >star-1.6/include/schily/time.mk << 'END-of-star-1.6/include/schily/time.mk' X#ident @(#)time.mk 1.1 06/12/17 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= time.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/time.mk echo x - star-1.6/include/schily/unistd.mk sed 's/^X//' >star-1.6/include/schily/unistd.mk << 'END-of-star-1.6/include/schily/unistd.mk' X#ident @(#)unistd.mk 1.1 06/12/17 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= unistd.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/unistd.mk echo x - star-1.6/include/schily/iconv.h sed 's/^X//' >star-1.6/include/schily/iconv.h << 'END-of-star-1.6/include/schily/iconv.h' X/* @(#)iconv.h 1.4 08/01/02 Copyright 2007 J. Schilling */ X/* X * Abstraction from iconv.h X * X * Copyright (c) 2007 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_ICONV_H X#define _SCHILY_ICONV_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifdef HAVE_ICONV_H X#ifndef _INCL_ICONV_H X#include X#define _INCL_ICONV_H X#endif X#else X#undef USE_ICONV X#endif X X/* X * Libiconv on Cygwin is not autoconf-friendly. X * iconv.h #defined iconv to libiconv X * We would need a AC_CHECK_FUNC() macro that allows to specify includefiles. X */ X#if defined(HAVE_LIBICONV) && defined(HAVE_LIBICONV_OPEN) && \ X defined(HAVE_LIBICONV_CLOSE) && \ X defined(iconv) && defined(iconv_open) && defined(iconv_close) X# ifndef HAVE_ICONV X# define HAVE_ICONV X# endif X# ifndef HAVE_ICONV_OPEN X# define HAVE_ICONV_OPEN X# endif X# ifndef HAVE_ICONV_CLOSE X# define HAVE_ICONV_CLOSE X# endif X#endif X X#if !defined(HAVE_ICONV_OPEN) || !defined(HAVE_ICONV_CLOSE) X# undef HAVE_ICONV X#endif X X#ifndef HAVE_ICONV X#undef USE_ICONV X#endif X X#ifdef NO_ICONV X#undef USE_ICONV X#endif X X#ifndef USE_ICONV X#undef iconv_t X#define iconv_t char * X#endif X X X#endif /* _SCHILY_ICONV_H */ END-of-star-1.6/include/schily/iconv.h echo x - star-1.6/include/schily/utime.mk sed 's/^X//' >star-1.6/include/schily/utime.mk << 'END-of-star-1.6/include/schily/utime.mk' X#ident @(#)utime.mk 1.1 06/12/17 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= utime.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/utime.mk echo x - star-1.6/include/schily/utypes.mk sed 's/^X//' >star-1.6/include/schily/utypes.mk << 'END-of-star-1.6/include/schily/utypes.mk' X#ident @(#)utypes.mk 1.1 06/12/17 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= utypes.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/utypes.mk echo x - star-1.6/include/schily/varargs.mk sed 's/^X//' >star-1.6/include/schily/varargs.mk << 'END-of-star-1.6/include/schily/varargs.mk' X#ident @(#)varargs.mk 1.1 06/12/17 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= varargs.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/varargs.mk echo x - star-1.6/include/schily/wait.mk sed 's/^X//' >star-1.6/include/schily/wait.mk << 'END-of-star-1.6/include/schily/wait.mk' X#ident @(#)wait.mk 1.1 06/12/17 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= wait.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/wait.mk echo x - star-1.6/include/schily/xconfig.mk sed 's/^X//' >star-1.6/include/schily/xconfig.mk << 'END-of-star-1.6/include/schily/xconfig.mk' X#ident @(#)xconfig.mk 1.1 06/12/17 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= xconfig.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/xconfig.mk echo x - star-1.6/include/schily/xmconfig.mk sed 's/^X//' >star-1.6/include/schily/xmconfig.mk << 'END-of-star-1.6/include/schily/xmconfig.mk' X#ident @(#)xmconfig.mk 1.1 06/12/17 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= xmconfig.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/xmconfig.mk echo x - star-1.6/include/schily/types.h sed 's/^X//' >star-1.6/include/schily/types.h << 'END-of-star-1.6/include/schily/types.h' X/* @(#)types.h 1.5 09/10/22 Copyright 2006-2009 J. Schilling */ X/* X * Abstraction from sys/types.h X * X * Copyright (c) 2006-2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_TYPES_H X#define _SCHILY_TYPES_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifdef HAVE_SYS_TYPES_H X#ifndef _INCL_SYS_TYPES_H X#include X#define _INCL_SYS_TYPES_H X#endif X#else X#ifdef HAVE_TYPES_H X#ifndef _INCL_TYPES_H X#include X#define _INCL_TYPES_H X#endif X#endif X#endif X X#ifdef HAVE_STDDEF_H X#ifndef _INCL_STDDEF_H X#include /* For offsetof(), ptrdiff_t, wchar_t, size_t */ X#define _INCL_STDDEF_H X#endif X#endif X X#endif /* _SCHILY_TYPES_H */ END-of-star-1.6/include/schily/types.h echo x - star-1.6/include/schily/param.mk sed 's/^X//' >star-1.6/include/schily/param.mk << 'END-of-star-1.6/include/schily/param.mk' X#ident @(#)param.mk 1.1 07/01/03 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= param.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/param.mk echo x - star-1.6/include/schily/param.h sed 's/^X//' >star-1.6/include/schily/param.h << 'END-of-star-1.6/include/schily/param.h' X/* @(#)param.h 1.7 12/01/22 Copyright 2006-2011 J. Schilling */ X/* X * Abstraction from sys/param.h X * X * Copyright (c) 2006-2011 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_PARAM_H X#define _SCHILY_PARAM_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X/* X * Let us include system defined types first. X */ X#ifndef _SCHILY_TYPES_H X#include X#endif X#ifdef HAVE_SYS_PARAM_H X#ifndef _INCL_SYS_PARAM_H X#include /* Must be before limits.h */ X#define _INCL_SYS_PARAM_H X#endif X#endif X#ifndef _SCHILY_LIMITS_H X#include /* For _SC_CLK_TCK */ X#endif X#ifndef _SCHILY_UNISTD_H X#include /* For _SC_CLK_TCK */ X#endif X X#ifndef NBBY X#define NBBY 8 /* Number of bits per byte */ X#endif X X#ifndef DEV_BSIZE X#define DEV_BSIZE 512 /* UNIX Device Block size */ X#endif X X/* X * NODEV may be in sys/param.h keep this definition past the include. X */ X#ifndef NODEV X#define NODEV ((dev_t)-1L) X#endif X X#ifndef HZ X#if defined(_SC_CLK_TCK) X#define HZ ((clock_t)sysconf(_SC_CLK_TCK)) X#else X#define HZ 100 X#endif X#endif X X/* X * Do we need to define _XOPEN_SOURCE to get NZERO? X * On Linux, it is needed but on Linux NZERO is 20. X */ X#ifndef NZERO /* for nice(2) */ X#define NZERO 20 X#endif X X#endif /* _SCHILY_PARAM_H */ END-of-star-1.6/include/schily/param.h echo x - star-1.6/include/schily/wchar.mk sed 's/^X//' >star-1.6/include/schily/wchar.mk << 'END-of-star-1.6/include/schily/wchar.mk' X#ident @(#)wchar.mk 1.1 07/01/24 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= wchar.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/wchar.mk echo x - star-1.6/include/schily/wchar.h sed 's/^X//' >star-1.6/include/schily/wchar.h << 'END-of-star-1.6/include/schily/wchar.h' X/* @(#)wchar.h 1.23 18/05/17 Copyright 2007-2018 J. Schilling */ X/* X * Abstraction from wchar.h X * X * Copyright (c) 2007-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_WCHAR_H X#define _SCHILY_WCHAR_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifndef _SCHILY_STDLIB_H X#include /* for MB_CUR_MAX, mbtowc()/wctomb() */ X#endif X#ifndef _SCHILY_TYPES_H X#include X#endif X#ifdef HAVE_STDDEF_H X#ifndef _INCL_STDDEF_H X#include /* Needed for e.g. size_t (POSIX) */ X#define _INCL_STDDEF_H X#endif X#endif X#ifndef _SCHILY_STDIO_H X#include /* Needed for e.g. FILE (POSIX) */ X#endif X#ifndef _SCHILY_VARARGS_H X#include /* Needed for e.g. va_list (POSIX) */ X#endif X X X#if !defined(HAVE_MBTOWC) || !defined(HAVE_WCTOMB) X#if defined(HAVE_MBRTOWC) && defined(HAVE_WCRTOMB) X# define mbtowc(wp, cp, len) mbrtowc(wp, cp, len, (mbstate_t *)0) X# define wctomb(cp, wc) wcrtomb(cp, wc, (mbstate_t *)0) X#else X# define NO_WCHAR X#endif X#endif X X#ifdef HAVE_WCHAR_H X X#ifndef _INCL_WCHAR_H X#include X#define _INCL_WCHAR_H X#endif X X#ifndef HAVE_MBSINIT X#define mbsinit(sp) ((int)((sp) == 0)) X#endif X#ifndef HAVE_MBRTOWC X#define mbrtowc(wp, cp, len, sp) mbtowc(wp, cp, len) X#endif X#ifndef HAVE_WCRTOMB X#define wcrtomb(cp, wc, sp) wctomb(cp, wc) X#endif X X#ifndef USE_WCHAR X#define USE_WCHAR X#endif X X#else /* HAVE_WCHAR_H */ X X#undef USE_WCHAR X#endif /* !HAVE_WCHAR_H */ X X#if !defined(HAVE_WCTYPE_H) && !defined(HAVE_ISWPRINT) X#undef USE_WCHAR X#undef USE_WCTYPE X#endif X X#ifdef NO_WCTYPE X#undef USE_WCHAR X#undef USE_WCTYPE X#endif X X#ifdef NO_WCHAR X#undef USE_WCHAR X#undef USE_WCTYPE X#endif X X#ifndef USE_WCHAR X X/* X * We either don't have wide chars or we don't use them... X */ X#undef wchar_t X#define wchar_t char X#undef wint_t X#define wint_t int X/* X * We cannot define wctype_t here because of a bug in Linux (missing xctype_t X * definition in wchar.h X */ X#ifdef __never__ X#undef wctype_t X#define wctype_t int X#endif X X#undef WEOF X#define WEOF ((wint_t)-1) X X#ifndef _SCHILY_UTYPES_H X#include /* For TYPE_MAXVAL() */ X#endif X X#undef WCHAR_MAX X#define WCHAR_MAX TYPE_MAXVAL(wchar_t) X#undef WCHAR_MIN X#define WCHAR_MIN TYPE_MINVAL(wchar_t) X X#undef WINT_MAX X#define WINT_MAX TYPE_MAXVAL(wint_t) X#undef WINT_MIN X#define WINT_MIN TYPE_MINVAL(wint_t) X X#undef WCTYPE_MAX X#define WCTYPE_MAX TYPE_MAXVAL(wctype_t) X#undef WCTYPE_MIN X#define WCTYPE_MIN TYPE_MINVAL(wctype_t) X X#undef SIZEOF_WCHAR_T X#define SIZEOF_WCHAR_T SIZEOF_CHAR X X#undef MB_CUR_MAX X#define MB_CUR_MAX 1 X#undef MB_LEN_MAX X#define MB_LEN_MAX 1 X X/* X * The mbtowc() for the non-multibyte case could be as simple as X * X * #define mbtowc(wp, cp, len) (*(wp) = *(cp), 1) X * X * but Mac OS X forces us to do many mbtowc(NULL, NULL, 0) calls in order X * to reset the internal state. On other platforms that do not support X * wide chars, NULL may be defined as (void *)0, so we need to check X * for "wp" != NULL and to cast "wp" and "cp" to their expected types. X */ X#undef mbtowc X#define mbtowc(wp, cp, len) ((void)((wp) ? \ X *(wchar_t *)(wp) = *(char *)(cp) : 1), 1) X#undef mbrtowc X#define mbrtowc(wp, cp, len, sp) ((void)((wp) ? \ X *(wchar_t *)(wp) = *(char *)(cp) : 1), 1) X#undef wctomb X#define wctomb(cp, wc) (*(cp) = wc, 1) X#undef wcrtomb X#define wcrtomb(cp, wc, sp) (*(cp) = wc, 1) X X#undef mbsinit X#define mbsinit(sp) ((int)((sp) == 0)) X X#undef wcwidth X#define wcwidth(wc) (1) X X#else /* USE_WCHAR */ X X#ifndef HAVE_WCWIDTH X#undef wcwidth X#define wcwidth(wc) (1) X#endif X X#endif /* USE_WCHAR */ X X#endif /* _SCHILY_WCHAR_H */ END-of-star-1.6/include/schily/wchar.h echo x - star-1.6/include/schily/schilyp.mk sed 's/^X//' >star-1.6/include/schily/schilyp.mk << 'END-of-star-1.6/include/schily/schilyp.mk' X#ident @(#)schilyp.mk 1.1 07/02/13 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= schilyp.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/schilyp.mk echo x - star-1.6/include/schily/schilyp.h sed 's/^X//' >star-1.6/include/schily/schilyp.h << 'END-of-star-1.6/include/schily/schilyp.h' X/* @(#)schilyp.h 1.2 09/06/06 Copyright 2007-2009 J. Schilling */ X/* X * Include definitions for libschily and define *printf() -> js_*printf() X * X * Copyright (c) 2007-2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_SCHILYP_H X#define _SCHILY_SCHILYP_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifndef _SCHILY_SCHILY_H X#include X#endif X X/* X * Always use js_*printf() X */ X#undef fprintf X#define fprintf js_fprintf X#undef printf X#define printf js_printf X#undef snprintf X#define snprintf js_snprintf X#undef sprintf X#define sprintf js_sprintf X X#endif /* _SCHILY_SCHILYP_H */ END-of-star-1.6/include/schily/schilyp.h echo x - star-1.6/include/schily/iconv.mk sed 's/^X//' >star-1.6/include/schily/iconv.mk << 'END-of-star-1.6/include/schily/iconv.mk' X#ident @(#)iconv.mk 1.1 07/05/04 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= iconv.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/iconv.mk echo x - star-1.6/include/schily/ioctl.h sed 's/^X//' >star-1.6/include/schily/ioctl.h << 'END-of-star-1.6/include/schily/ioctl.h' X/* @(#)ioctl.h 1.1 07/05/24 Copyright 2007 J. Schilling */ X/* X * Abstraction from sys/ioctl.h X * X * Copyright (c) 2007 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_IOCTL_H X#define _SCHILY_IOCTL_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifdef HAVE_SYS_IOCTL_H X#ifndef _INCL_SYS_IOCTL_H X#include X#define _INCL_SYS_IOCTL_H X#endif X#endif X X#endif /* _SCHILY_IOCTL_H */ END-of-star-1.6/include/schily/ioctl.h echo x - star-1.6/include/schily/siconv.mk sed 's/^X//' >star-1.6/include/schily/siconv.mk << 'END-of-star-1.6/include/schily/siconv.mk' X#ident @(#)siconv.mk 1.1 07/05/14 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= siconv.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/siconv.mk echo x - star-1.6/include/schily/siconv.h sed 's/^X//' >star-1.6/include/schily/siconv.h << 'END-of-star-1.6/include/schily/siconv.h' X/* @(#)siconv.h 1.5 10/12/20 Copyright 2007-2010 J. Schilling */ X/* X * Definitions fur users of libsiconv X * X * Copyright (c) 2007-2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_SICONV_H X#define _SCHILY_SICONV_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X#ifndef _SCHILY_UTYPES_H X#include X#endif X#ifndef _SCHILY_ICONV_H X#include X#endif X X#ifdef __cplusplus Xextern "C" { X#endif X X Xtypedef struct siconv_table siconvt_t; Xstruct siconv_table { X char *sic_name; /* SICONV charset name */ X UInt16_t *sic_cs2uni; /* Charset -> Unicode */ X UInt8_t **sic_uni2cs; /* Unicode -> Charset */ X iconv_t sic_cd2uni; /* iconv Charset -> Unicode */ X iconv_t sic_uni2cd; /* iconv Unicode -> Charset */ X siconvt_t *sic_alt; /* alternate iconv tab */ X siconvt_t *sic_next; /* Next table */ X int sic_refcnt; /* Reference count */ X}; X X#define use_iconv(t) ((t)->sic_cd2uni != NULL) X X#define sic_c2uni(t, c) ((t)->sic_cs2uni[c]) X#define sic_uni2c(t, c) ((t)->sic_uni2cs[((c) >> 8) & 0xFF][(c) & 0xFF]) X Xextern int sic_list __PR((FILE *)); Xextern siconvt_t *sic_open __PR((char *)); Xextern const char *sic_base __PR((void)); Xextern int sic_close __PR((siconvt_t *)); X X#ifdef __cplusplus X} X#endif X X#endif /* _SCHILY_SICONV_H */ END-of-star-1.6/include/schily/siconv.h echo x - star-1.6/include/schily/ioctl.mk sed 's/^X//' >star-1.6/include/schily/ioctl.mk << 'END-of-star-1.6/include/schily/ioctl.mk' X#ident @(#)ioctl.mk 1.1 07/05/24 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= ioctl.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/ioctl.mk echo x - star-1.6/include/schily/checkerr.h sed 's/^X//' >star-1.6/include/schily/checkerr.h << 'END-of-star-1.6/include/schily/checkerr.h' X/* @(#)checkerr.h 1.17 19/02/28 Copyright 2003-2019 J. Schilling */ X/* X * Generic error control for programs that do file i/o. X * The error control is usually used by archiving programs. X * X * The current version does not provide a stable interface. X * It does not support multi-threaded programs and it may call X * comerr() from the parser. If you use the code before there is X * an official stable and "library-compliant" interface, be careful X * and watch for changes. X * X * Copyright (c) 2003-2019 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_CHECKERR_H X#define _SCHILY_CHECKERR_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X#ifndef _SCHILY_STANDARD_H X#include X#endif X#ifndef _SCHILY_UTYPES_H X#include X#endif X X#ifdef __cplusplus Xextern "C" { X#endif X X/* X * Error conditions handled by error control. X */ X#define E_STAT 0x0001 /* Could not stat(2) file */ X#define E_GETACL 0x0002 /* Could not retrieve ACL info */ X#define E_OPEN 0x0004 /* Could not open file */ X#define E_READ 0x0008 /* Could not read file */ X#define E_WRITE 0x0010 /* Could not write file */ X#define E_GROW 0x0020 /* File did grow during backup */ X#define E_SHRINK 0x0040 /* File did shrink during backup */ X#define E_MISSLINK 0x0080 /* Missing hard link(s) for file */ X#define E_NAMETOOLONG 0x0100 /* File name too long for archive */ X#define E_FILETOOBIG 0x0200 /* File too big for archive */ X#define E_SPECIALFILE 0x0400 /* Improper file type for archive */ X#define E_READLINK 0x0800 /* Could not read symbolic link */ X#define E_GETXATTR 0x1000 /* Could not get xattr */ X#define E_CHDIR 0x2000 /* Could not chdir() */ X#define E_ICONV 0x4000 /* Could not convert via iconv() */ X#define E_ID 0x8000 /* Could not write numeric uid/gid */ X#define E_TIME (0x0001|E_FL1) /* Could not convert time_t */ X X/* X * Currently unused: none X */ X X#define E_SETTIME 0x10000 /* Could not set file times */ X#define E_SETMODE 0x20000 /* Could not set access modes */ X#define E_SECURITY 0x40000 /* Skipped for security reasons */ X#define E_LSECURITY 0x80000 /* Link skipped for security */ X#define E_SAMEFILE 0x100000 /* Skipped from/to identical */ X#define E_BADACL 0x200000 /* ACL string conversion error */ X#define E_SETACL 0x400000 /* Could not set ACL for file */ X#define E_SETXATTR 0x800000 /* Could not set xattr */ X X/* X * Unused for flag array index: 0x1000000 .. 0x8000000 X */ X#define E_FL1 0x1000000 /* 1st enhancement bit */ X#define E_FL2 0x2000000 /* 2nd enhancement bit */ X#define E_FL3 0x3000000 /* 3rd enhancement index */ X#define E_FL4 0x4000000 /* 3rd enhancement bit */ X#define E_FL5 0x5000000 /* 5th enhancement index */ X#define E_FL6 0x6000000 /* 6th enhancement index */ X#define E_FL7 0x7000000 /* 7th enhancement index */ X#define E_FL8 0x8000000 /* 4th enhancement bit */ X#define E_FL9 0x9000000 /* 9th enhancement index */ X#define E_FL10 0xA000000 /* 10th enhancement index */ X#define E_FL11 0xB000000 /* 11th enhancement index */ X#define E_FL12 0xC000000 /* 12th enhancement index */ X#define E_FL13 0xD000000 /* 13th enhancement index */ X#define E_FL14 0xE000000 /* 14th enhancement index */ X#define E_FL15 0xF000000 /* 15th enhancement index */ X#define E_EMASK 0xF000000 /* Enhancement mask */ X#define E_NFL 16 /* Number of flag array elements */ X#define E_SHIFT 24 /* Sift to get index */ X X#define E_DIFF 0x10000000 /* Diffs encountered */ X#define E_WARN 0x20000000 /* Print this error but do exit(0) */ X#define E_ABORT 0x40000000 /* Abort on this error */ X#define E_EXT 0x80000000 /* Extended (TBD later) */ X X#define E_ALL (~(UInt32_t)(E_DIFF|E_ABORT)) X Xextern int errconfig __PR((char *name)); Xextern BOOL errhidden __PR((int etype, const char *fname)); Xextern BOOL errwarnonly __PR((int etype, const char *fname)); Xextern BOOL errabort __PR((int etype, const char *fname, X BOOL doexit)); X X#ifdef __cplusplus X} X#endif X X#endif /* _SCHILY_CHECKERR_H */ END-of-star-1.6/include/schily/checkerr.h echo x - star-1.6/include/schily/checkerr.mk sed 's/^X//' >star-1.6/include/schily/checkerr.mk << 'END-of-star-1.6/include/schily/checkerr.mk' X#ident @(#)checkerr.mk 1.1 07/07/14 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= checkerr.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/checkerr.mk echo x - star-1.6/include/schily/fstream.h sed 's/^X//' >star-1.6/include/schily/fstream.h << 'END-of-star-1.6/include/schily/fstream.h' X/* @(#)fstream.h 1.19 18/10/07 Copyright 1985-2018 J. Schilling */ X/* X * Definitions for the file stream package X * X * Copyright (c) 1985-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_FSTREAM_H X#define _SCHILY_FSTREAM_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifdef __cplusplus Xextern "C" { X#endif X X#define STR_SBUF_SIZE 127 /* Size of "static" stream buffer */ X X#ifdef WSTRINGS Xtypedef short CHAR; X#else Xtypedef char CHAR; X#endif X X/* X * The stream filter structure. X * X * If the filter function (*fstr_func)() is a NULL pointer, then fstr_file is X * a FILE * object and input is read from that FILE * by calling the read X * function (*fstr_rfunc)(). X * X * If the filter function (*fstr_func)() is not a NULL pointer, then fstr_file X * is a stream * object and input is read from that stream object by calling X * the filter function (*fstr_func)(). X * X * The two callback functions have the following tasks: X * X * (*fstr_func)(ostream, istream) filters from istream to ostream X * (*fstr_rfunc)(istream) reads a new input from is->fstr_file X * X * As long as fstr_bp points to a non-null character, this character is X * returned. If the local buffer is empty, the functions are checked: X * X * If (*fstr_func)() is not a NULL pointer, then it is a filter function X * that is called whenever fstr_buf is empty. X * X * If (*fstr_func)() is a NULL pointer and (*fstr_rfunc)() is not a NULL pointer X * then (*fstr_rfunc)() is called to fill the buffer and to return the first X * charcter from the buffer. X */ Xtypedef struct fstream fstream; X Xstruct fstream { X FILE *fstr_file; /* The input FILE * or input fstream * */ X int fstr_flags; /* Flags available for the caller */ X /* End of the public part of the structure */ X fstream *fstr_pushed; /* Chain of pushed strcutures */ X CHAR *fstr_bp; /* The current pointer to coocked input */ X CHAR *fstr_buf; /* The current buffer for coocked input */ X int (*fstr_func) __PR((struct fstream *__out, FILE *__in)); X int (*fstr_rfunc) __PR((struct fstream *__in)); X void *fstr_auxp; /* Aux pointer e.g. to detect alias loops */ X CHAR fstr_sbuf[STR_SBUF_SIZE + 1]; X}; X Xtypedef int (*fstr_fun) __PR((struct fstream *, FILE *)); Xtypedef int (*fstr_efun) __PR((char *)); Xtypedef int (*fstr_rfun) __PR((struct fstream *)); X Xextern fstream *mkfstream __PR((FILE *f, fstr_fun, fstr_rfun, fstr_efun)); Xextern fstream *fspush __PR((fstream *fsp, fstr_efun efun)); Xextern fstream *fspop __PR((fstream *fsp)); Xextern fstream *fspushed __PR((fstream *fsp)); Xextern void fsclose __PR((fstream *fsp)); Xextern FILE *fssetfile __PR((fstream *fsp, FILE *f)); Xextern int fsgetc __PR((fstream *fsp)); Xextern size_t fsgetlen __PR((fstream *fsp)); Xextern void fspushstr __PR((fstream *fsp, char *ss)); Xextern void fspushcha __PR((fstream *fsp, int c)); X X#ifdef __cplusplus X} X#endif X X#endif /* _SCHILY_FSTREAM_H */ END-of-star-1.6/include/schily/fstream.h echo x - star-1.6/include/schily/find.mk sed 's/^X//' >star-1.6/include/schily/find.mk << 'END-of-star-1.6/include/schily/find.mk' X#ident @(#)find.mk 1.1 08/04/06 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= find.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/find.mk echo x - star-1.6/include/schily/find.h sed 's/^X//' >star-1.6/include/schily/find.h << 'END-of-star-1.6/include/schily/find.h' X/* @(#)find.h 1.27 18/08/30 Copyright 2005-2018 J. Schilling */ X/* X * Definitions for libfind users. X * X * Copyright (c) 2004-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_FIND_H X#define _SCHILY_FIND_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifndef _SCHILY_STDIO_H X#include X#endif X X#ifndef _SCHILY_STANDARD_H X#include X#endif X#ifndef _SCHILY_INTTYPES_H X#include X#endif X#ifndef _SCHILY_STAT_H X#include X#endif X X#ifdef __cplusplus Xextern "C" { X#endif X X#ifndef __sqfun_t_defined Xtypedef int (*sqfun_t) __PR((void *arg)); X#define __sqfun_t_defined X#endif X X#ifndef __cbfun_t_defined Xtypedef int (*cbfun_t) __PR((int ac, char **argv)); X#define __cbfun_t_defined X#endif X Xtypedef struct find_args { X int Argc; /* A copy of argc */ X char **Argv; /* A copy of argv */ X FILE *std[3]; /* To redirect stdin/stdout/err */ X char *primarg; /* If != 0 arg for last primary */ X char *primname; /* The name of the last primary */ X int primtype; /* The type of the last primary */ X BOOL found_action; /* -print/-ls/-exec found */ X int patlen; /* strlen() for longest pattern */ X int walkflags; /* Walkflags modifed by parser */ X int maxdepth; /* -mindepth arg */ X int mindepth; /* -maxdepth arg */ X struct plusargs *plusp; /* List of -exec {} + commands */ X void *jmp; /* Used internally by parser */ X int error; /* Error code from find_parse() */ X int argsize; /* Argument size for this cmd */ X cbfun_t callfun; /* Callback function for -call */ X void *__reserved[16]; /* For future extensions */ X} finda_t; X X/* X * finda_t->primtype is set to ENDARGS by find_parse() if a complete expression X * could be parsed. X */ X#define FIND_ENDARGS 1000 /* Found End of Arg Vector */ X#define FIND_ERRARG 1001 /* Parser abort by -help or error */ X X/* X * Flags used for struct WALK->pflags: X */ X#define PF_ACL 0x00001 /* Check ACL from struct WALK->pflags */ X#define PF_HAS_ACL 0x10000 /* This file has ACL */ X#define PF_XATTR 0x00002 /* Check XATTR from struct WALK->pflags */ X#define PF_HAS_XATTR 0x20000 /* This file has XATTR */ X X#ifndef FIND_NODE X#define findn_t void X#endif X X#ifndef __squit_t_defined X Xtypedef struct { X sqfun_t quitfun; /* Function to query for shell signal quit */ X void *qfarg; /* Generic arg for shell builtin quit fun */ X Int32_t flags; /* Flags to identify data beyond qfarg */ X cbfun_t callfun; /* Callback function for -call */ X void *__reserved[16]; /* For future extensions */ X} squit_t; X X#define SQ_CALL 0x01 /* Use call feature */ X X#define __squit_t_defined X#endif X X Xextern void find_argsinit __PR((finda_t *fap)); Xextern void find_sqinit __PR((squit_t *quit)); Xextern void find_timeinit __PR((time_t __now)); Xextern findn_t *find_printnode __PR((void)); Xextern findn_t *find_addprint __PR((findn_t *np, finda_t *fap)); Xextern void find_free __PR((findn_t *t, finda_t *fap)); Xextern int find_token __PR((char *__word)); Xextern char *find_tname __PR((int op)); Xextern findn_t *find_parse __PR((finda_t *fap)); Xextern void find_firstprim __PR((int *pac, char *const **pav)); X Xextern BOOL find_primary __PR((findn_t *t, int op)); Xextern BOOL find_pname __PR((findn_t *t, char *__word)); Xextern BOOL find_hasprint __PR((findn_t *t)); Xextern BOOL find_hasexec __PR((findn_t *t)); Xextern BOOL find_expr __PR((char *f, char *ff, struct stat *fs, X struct WALK *state, findn_t *t)); X Xextern int find_plusflush __PR((void *p, struct WALK *state)); Xextern void find_usage __PR((FILE *f)); Xextern char *find_strvers __PR((void)); Xextern int find_vers __PR((void)); Xextern int find_main __PR((int ac, char **av, char **ev, X FILE *std[3], squit_t *__quit)); X X#ifdef __cplusplus X} X#endif X X#endif /* _SCHILY_FIND_H */ END-of-star-1.6/include/schily/find.h echo x - star-1.6/include/schily/walk.mk sed 's/^X//' >star-1.6/include/schily/walk.mk << 'END-of-star-1.6/include/schily/walk.mk' X#ident @(#)walk.mk 1.1 08/04/06 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= walk.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/walk.mk echo x - star-1.6/include/schily/walk.h sed 's/^X//' >star-1.6/include/schily/walk.h << 'END-of-star-1.6/include/schily/walk.h' X/* @(#)walk.h 1.35 18/10/29 Copyright 2004-2018 J. Schilling */ X/* X * Definitions for directory tree walking X * X * Copyright (c) 2004-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_WALK_H X#define _SCHILY_WALK_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifndef _SCHILY_STAT_H X#include X#endif X X#ifndef _SCHILY_STDIO_H X#include X#endif X X#ifdef __cplusplus Xextern "C" { X#endif X X/* X * Flags to control treewalk() via 'walkflags'. X * X * WALK_CHDIR Change directory while traversing X * X * WALK_PHYS Clearing WALK_PHYS has highest precedence and equals X * 'find -follow'. If WALK_PHYS is clear, always use stat. X * By default, WALK_PHYS should be set. X * X * WALK_ARGFOLLOW If WALK_ARGFOLLOW is set, symlinks that are used as X * the first argument for trewalk() are followed even X * if WALK_PHYS is set. Setting WALK_ARGFOLLOW equals X * 'find -H'. X * X * WALK_ALLFOLLOW If WALK_ALLFOLLOW is set, all symlinks are followed X * even if WALK_PHYS is set. Setting WALK_ALLFOLLOW X * equals 'find -L'. X */ X#define WALK_PHYS 1 /* Use lstat() instead of stat() */ X#define WALK_MOUNT 2 /* Do not cross mount points */ X#define WALK_DEPTH 4 /* Call content before calling the dir */ X#define WALK_CHDIR 8 /* Use chdir() to each directory */ X#define WALK_ARGFOLLOW 0x10 /* Use stat() for top level args only */ X#define WALK_ALLFOLLOW 0x20 /* Use stat() for all files */ X#define WALK_NOSTAT 0x40 /* Avoid to call stat() if st_nlink =>2 */ X#define WALK_NOEXIT 0x100 /* Do not exit() in case of hard errors */ X#define WALK_NOMSG 0x200 /* Do not write messages to stderr */ X#define WALK_LS_ATIME 0x1000 /* -ls lists atime instead of mtime */ X#define WALK_LS_CTIME 0x2000 /* -ls lists ctime instead of mtime */ X#define WALK_STRIPLDOT 0x4000 /* Strip leading "./" from path */ X#define WALK_MOUNTPLUS 0x8000 /* Do not continue at mount points */ X#define WALK_XDEV 0x8000 /* Do not continue at mount points */ X X/* X * The 'type' argument to walkfun. X */ X#define WALK_F 1 /* File */ X#define WALK_SL 2 /* Symbolic Link */ X#define WALK_D 3 /* Directory */ X#define WALK_DP 4 /* Directory previously visited */ X#define WALK_DNR 5 /* Directory with no read permission */ X#define WALK_NS 6 /* Unknown file type stat failed */ X#define WALK_SLN 7 /* Symbolic Link points to nonexistent file */ X X#ifndef __sqfun_t_defined Xtypedef int (*sqfun_t) __PR((void *arg)); X#define __sqfun_t_defined X#endif X X#ifndef __cbfun_t_defined Xtypedef int (*cbfun_t) __PR((int ac, char **argv)); X#define __cbfun_t_defined X#endif X Xstruct WALK { X int flags; /* Flags for communication with (*walkfun)() */ X int base; /* Filename offset in path for (*walkfun)() */ X int level; /* The nesting level set up for (*walkfun)() */ X int walkflags; /* treewalk() control flags */ X void *twprivate; /* treewalk() private do not touch */ X FILE *std[3]; /* To redirect stdin/stdout/err in treewalk */ X char **env; /* To allow different env in treewalk/exec */ X sqfun_t quitfun; /* Function to query for shell signal quit */ X void *qfarg; /* Generic arg for shell builtin quit fun */ X int maxdepth; /* (*walkfun)() private, unused by treewalk */ X int mindepth; /* (*walkfun)() private, unused by treewalk */ X char *lname; /* (*walkfun)() private, unused by treewalk */ X void *tree; /* (*walkfun)() private, unused by treewalk */ X void *patstate; /* (*walkfun)() private, unused by treewalk */ X int err; /* (*walkfun)() private, unused by treewalk */ X int pflags; /* (*walkfun)() private, unused by treewalk */ X int auxi; /* (*walkfun)() private, unused by treewalk */ X void *auxp; /* (*walkfun)() private, unused by treewalk */ X void *__reserved[16]; /* For future extensions */ X}; X X/* X * Flags in struct WALK used to communicate with (*walkfun)() X */ X#define WALK_WF_PRUNE 1 /* (*walkfun)() -> walk(): abort waking tree */ X#define WALK_WF_QUIT 2 /* (*walkfun)() -> walk(): quit completely */ X#define WALK_WF_NOCHDIR 4 /* walk() -> (*walkfun)(): WALK_DNR w chdir() */ X#define WALK_WF_NOCWD 8 /* walk() -> caller: cannot get working dir */ X#define WALK_WF_NOHOME 16 /* walk() -> caller: cannot chdir("..") */ X#define WALK_WF_NOTDIR 32 /* walk() -> walk(): file is not a directory */ X X#define WALK_WF_CHOWN 4096 /* (*walkfun)(): changed st_uid or st_gid */ X#define WALK_WF_CHMOD 8192 /* (*walkfun)(): changed st_mode */ X#define WALK_WF_CHTIME 16384 /* (*walkfun)(): changed st_mtime or st_ctime */ X Xtypedef int (*walkfun) __PR((char *_nm, struct stat *_fs, int _type, X struct WALK *_state)); X Xextern int treewalk __PR((char *_nm, walkfun _fn, X struct WALK *_state)); Xextern void walkinitstate __PR((struct WALK *_state)); Xextern void *walkopen __PR((struct WALK *_state)); Xextern int walkgethome __PR((struct WALK *_state)); Xextern int walkhome __PR((struct WALK *_state)); Xextern int walkcwd __PR((struct WALK *_state)); Xextern int walkclose __PR((struct WALK *_state)); X X#ifdef __cplusplus X} X#endif X X#endif /* _SCHILY_WALK_H */ END-of-star-1.6/include/schily/walk.h echo x - star-1.6/include/schily/stdio.h sed 's/^X//' >star-1.6/include/schily/stdio.h << 'END-of-star-1.6/include/schily/stdio.h' X/* @(#)stdio.h 1.14 16/11/06 Copyright 2009-2016 J. Schilling */ X/* X * Abstraction from stdio.h X * X * Copyright (c) 2009-2016 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_STDIO_H X#define _SCHILY_STDIO_H X#ifndef NO_SCHILY_STDIO_H /* We #undef _SCHILY_STDIO_H later because */ X /* of the ill designed "hdrchk" program */ X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifdef INCL_MYSTDIO X#ifndef _INCL_MYSTDIO_H X#include X#define _INCL_MYSTDIO_H X#endif X X#else /* INCL_MYSTDIO */ X X#ifndef _INCL_STDIO_H X#include X#define _INCL_STDIO_H X#endif X#endif /* INCL_MYSTDIO */ X X#ifdef __cplusplus Xextern "C" { X#endif X X#ifdef HAVE_LARGEFILES X/* X * If HAVE_LARGEFILES is defined, it is guaranteed that fseeko()/ftello() X * both are available. X */ X#define fseek fseeko X#define ftell ftello X#else /* !HAVE_LARGEFILES */ X X/* X * If HAVE_LARGEFILES is not defined, we depend on specific tests for X * fseeko()/ftello() which must have been done before the tests for X * Large File support have been done. X * Note that this only works if the tests used below are really done before X * the Large File autoconf test is run. This is because autoconf does no X * clean testing but instead cumulatively modifes the envivonment used for X * testing. X */ X#ifdef HAVE_FSEEKO X# define fseek fseeko X#endif X#ifdef HAVE_FTELLO X# define ftell ftello X#endif X#endif X X#if !defined(HAVE_POPEN) && defined(HAVE__POPEN) X#define popen(c, m) _popen((c), (m)) X#endif X X#if !defined(HAVE_PCLOSE) && defined(HAVE__PCLOSE) X#define pclose(fp) _pclose(fp) X#endif X X#ifdef FAST_GETC_PUTC X/* X * The following code partially allows libschily to access FILE * as fast as X * from inside libc on Solaris. X * This makes it possible to implement js_printf() from libschily aprox. X * 33% faster than printf() from libc on Solaris. To do this, we X * partially unhide the FILE structure in a 64 bit environment on Solaris X * to allow to run putc_unlocked() as a marcro. X * X * If you believe you can do this on onther platforms, send a note. X */ X#if defined(__SVR4) && defined(__sun) && defined(_LP64) X#ifndef _SCHILY_TYPES_H X#include /* Needed for ssize_t */ X#endif X X/* X * This is how the 64 bit FILE * begins on Solaris. X */ Xstruct SCHILY__FILE_TAG { X unsigned char *_ptr; /* next character from/to here in buffer */ X unsigned char *_base; /* the buffer */ X unsigned char *_end; /* the end of the buffer */ X ssize_t _cnt; /* number of available characters in buffer */ X}; X X#define __getc_unlocked(p) (--(p)->_cnt < 0 \ X ? __filbuf((FILE *)p) \ X : (int)*(p)->_ptr++) X X#define getc_unlocked(p) __getc_unlocked((struct SCHILY__FILE_TAG *)p) X X#define __putc_unlocked(x, p) (--(p)->_cnt < 0 \ X ? __flsbuf((x), (FILE *)(p)) \ X : (int)(*(p)->_ptr++ = \ X (unsigned char) (x))) X X#define putc_unlocked(x, p) __putc_unlocked(x, (struct SCHILY__FILE_TAG *)p) X Xextern int __filbuf __PR((FILE *)); Xextern int __flsbuf __PR((int, FILE *)); X X#else /* !defined(__SVR4) && defined(__sun) && defined(_LP64) */ X#undef FAST_GETC_PUTC X#endif /* !defined(__SVR4) && defined(__sun) && defined(_LP64) */ X#endif /* FAST_GETC_PUTC */ X X#ifdef __cplusplus X} X#endif X X#else /* !NO_SCHILY_STDIO_H */ X#undef _SCHILY_STDIO_H /* #undef here to pass "hdrchk" */ X#endif /* NO_SCHILY_STDIO_H */ X#endif /* _SCHILY_STDIO_H */ END-of-star-1.6/include/schily/stdio.h echo x - star-1.6/include/schily/fetchdir.h sed 's/^X//' >star-1.6/include/schily/fetchdir.h << 'END-of-star-1.6/include/schily/fetchdir.h' X/* @(#)fetchdir.h 1.8 16/03/10 Copyright 2002-2016 J. Schilling */ X/* X * Copyright (c) 2002-2016 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_FETCHDIR_H X#define _SCHILY_FETCHDIR_H X X#ifndef _SCHILY_DIRENT_H X#include /* Includes mconfig.h if needed */ X#endif X X/* X * The original value used to fill the info byte before each name was ^A (1). X * We thus need to make this value the "unknown" type value and this finally X * results in the FDT_* values be 1 + the UNIX file type value. X */ X#define FDT_UNKN 1 X#define FDT_FIFO 2 X#define FDT_CHR 3 X#define FDT_DIR 5 X#define FDT_BLK 7 X#define FDT_REG 9 X#define FDT_LNK 11 X#define FDT_SOCK 13 X#define FDT_WHT 15 X X#ifdef __cplusplus Xextern "C" { X#endif X Xextern char *fetchdir __PR((char *dir, int *entp, int *lenp, X ino_t **inop)); Xextern char *dfetchdir __PR((DIR *dir, char *__dirname, int *entp, X int *lenp, ino_t **inop)); Xextern int fdircomp __PR((const void *p1, const void *p2)); Xextern char **sortdir __PR((char *dir, int *entp)); Xextern int cmpdir __PR((int ents1, int ents2, X char **ep1, char **ep2, X char **oa, char **od, X int *alenp, int *dlenp)); X X#ifdef __cplusplus X} X#endif X X#endif /* _SCHILY_FETCHDIR_H */ END-of-star-1.6/include/schily/fetchdir.h echo x - star-1.6/include/schily/fetchdir.mk sed 's/^X//' >star-1.6/include/schily/fetchdir.mk << 'END-of-star-1.6/include/schily/fetchdir.mk' X#ident @(#)fetchdir.mk 1.1 08/04/06 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= fetchdir.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/fetchdir.mk echo x - star-1.6/include/schily/idcache.h sed 's/^X//' >star-1.6/include/schily/idcache.h << 'END-of-star-1.6/include/schily/idcache.h' X/* @(#)idcache.h 1.3 10/08/24 Copyright 1993, 1995-2010 J. Schilling */ X/* X * Copyright (c) 1993, 1995-2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_IDCACHE_H X#define _SCHILY_IDCACHE_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifndef _SCHILY_TYPES_H X#include X#endif X X#ifdef __cplusplus Xextern "C" { X#endif X Xextern BOOL ic_nameuid __PR((char *name, int namelen, uid_t uid)); Xextern BOOL ic_uidname __PR((char *name, int namelen, uid_t *uidp)); Xextern BOOL ic_namegid __PR((char *name, int namelen, gid_t gid)); Xextern BOOL ic_gidname __PR((char *name, int namelen, gid_t *gidp)); Xextern uid_t ic_uid_nobody __PR((void)); Xextern gid_t ic_gid_nobody __PR((void)); X X#ifdef __cplusplus X} X#endif X X#endif /* _SCHILY_IDCACHE_H */ END-of-star-1.6/include/schily/idcache.h echo x - star-1.6/include/schily/idcache.mk sed 's/^X//' >star-1.6/include/schily/idcache.mk << 'END-of-star-1.6/include/schily/idcache.mk' X#ident @(#)idcache.mk 1.1 08/04/06 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= idcache.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/idcache.mk echo x - star-1.6/include/schily/hostname.h sed 's/^X//' >star-1.6/include/schily/hostname.h << 'END-of-star-1.6/include/schily/hostname.h' X/* @(#)hostname.h 1.22 14/01/01 Copyright 1995-2014 J. Schilling */ X/* X * This file has been separated from libport.h in order to avoid X * to include netdb.h in case gethostname() is not needed. X * X * Copyright (c) 1995-2014 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X X#ifndef _SCHILY_HOSTNAME_H X#define _SCHILY_HOSTNAME_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X#ifndef _SCHILY_TYPES_H X#include X#endif X X/* X * Try to get HOST_NAME_MAX for gethostname() from unistd.h or limits.h X */ X#ifndef _SCHILY_UNISTD_H X#include X#endif X#ifndef _SCHILY_LIMITS_H X#include X#endif X X#ifndef HOST_NAME_MAX X#if defined(HAVE_NETDB_H) && !defined(HOST_NOT_FOUND) && \ X !defined(_INCL_NETDB_H) X#ifndef _SCHILY_NETDB_H X#include /* #defines MAXHOSTNAMELEN */ X#endif X#endif X#ifdef MAXHOSTNAMELEN X#define HOST_NAME_MAX MAXHOSTNAMELEN X#endif X#endif X X#ifndef HOST_NAME_MAX X#ifndef _SCHILY_PARAM_H X#include /* Include various defs needed with some OS */ X#endif /* Linux MAXHOSTNAMELEN */ X#ifdef MAXHOSTNAMELEN X#define HOST_NAME_MAX MAXHOSTNAMELEN X#endif X#endif X X#ifndef HOST_NAME_MAX X#define HOST_NAME_MAX 255 X#endif X#ifndef MAXHOSTNAMELEN X#define MAXHOSTNAMELEN HOST_NAME_MAX X#endif X X#ifdef __cplusplus Xextern "C" { X#endif X X/* X * The gethostname() prototype from Win-DOS are in the wrong include files X * (winsock*.h instead of unistd.h) and they are in conflict with the standard. X * Because the prototype is in the wrong file and the function is not in libc, X * configure will believe gethostname() is missing. X * We cannot define our own correct prototype, but this is not a problem as the X * return type is int. X */ X#if !defined(__MINGW32__) X#ifndef HAVE_GETHOSTNAME Xextern int gethostname __PR((char *name, int namelen)); X#endif X#endif X#ifndef HAVE_GETDOMAINNAME Xextern int getdomainname __PR((char *name, int namelen)); X#endif X X#ifdef __SUNOS4 X/* X * Define prototypes for POSIX standard functions that are missing on SunOS-4.x X * to make compilation smooth. X */ Xextern int gethostname __PR((char *name, int namelen)); Xextern int getdomainname __PR((char *name, int namelen)); X#endif /* __SUNOS4 */ X X#ifdef __cplusplus X} X#endif X X#endif /* _SCHILY_HOSTNAME_H */ END-of-star-1.6/include/schily/hostname.h echo x - star-1.6/include/schily/hostname.mk sed 's/^X//' >star-1.6/include/schily/hostname.mk << 'END-of-star-1.6/include/schily/hostname.mk' X#ident @(#)hostname.mk 1.1 08/12/20 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= hostname.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/hostname.mk echo x - star-1.6/include/schily/fstream.mk sed 's/^X//' >star-1.6/include/schily/fstream.mk << 'END-of-star-1.6/include/schily/fstream.mk' X#ident @(#)fstream.mk 1.1 08/01/02 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= fstream.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/fstream.mk echo x - star-1.6/include/schily/stdio.mk sed 's/^X//' >star-1.6/include/schily/stdio.mk << 'END-of-star-1.6/include/schily/stdio.mk' X#ident "@(#)stdio.mk 1.1 09/01/05 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= stdio.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/stdio.mk echo x - star-1.6/include/schily/sysexits.h sed 's/^X//' >star-1.6/include/schily/sysexits.h << 'END-of-star-1.6/include/schily/sysexits.h' X/* @(#)sysexits.h 1.6 15/04/22 J. Schilling */ X/* X * X * Copyright (c) 2009-2015 J. Schilling X * X * Copyright (c) 1987, 1993 X * The Regents of the University of California. All rights reserved. X * X * Redistribution and use in source and binary forms, with or without X * modification, are permitted provided that the following conditions X * are met: X * 1. Redistributions of source code must retain the above copyright X * notice, this list of conditions and the following disclaimer. X * 2. Redistributions in binary form must reproduce the above copyright X * notice, this list of conditions and the following disclaimer in the X * documentation and/or other materials provided with the distribution. X * 3. Neither the name of the University nor the names of its contributors X * may be used to endorse or promote products derived from this software X * without specific prior written permission. X * X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE X * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF X * SUCH DAMAGE. X * X * @(#)sysexits.h 8.1 (Berkeley) 6/2/93 X */ X X#ifndef _SCHILY_SYSEXITS_H X#define _SCHILY_SYSEXITS_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifdef HAVE_SYSEXITS_H X#include X#endif /* HAVE_SYSEXITS_H */ X X/* X * SYSEXITS.H -- Exit status codes for system programs. X * X * This include file attempts to categorize possible error X * exit statuses for system programs, notably delivermail X * and the Berkeley network. X * X * Error numbers begin at EX__BASE to reduce the possibility of X * clashing with other exit statuses that random programs may X * already return. The meaning of the codes is approximately X * as follows: X * X * EX_USAGE -- The command was used incorrectly, e.g., with X * the wrong number of arguments, a bad flag, a bad X * syntax in a parameter, or whatever. X * EX_DATAERR -- The input data was incorrect in some way. X * This should only be used for user's data & not X * system files. X * EX_NOINPUT -- An input file (not a system file) did not X * exist or was not readable. This could also include X * errors like "No message" to a mailer (if it cared X * to catch it). X * EX_NOUSER -- The user specified did not exist. This might X * be used for mail addresses or remote logins. X * EX_NOHOST -- The host specified did not exist. This is used X * in mail addresses or network requests. X * EX_UNAVAILABLE -- A service is unavailable. This can occur X * if a support program or file does not exist. This X * can also be used as a catchall message when something X * you wanted to do doesn't work, but you don't know X * why. X * EX_SOFTWARE -- An internal software error has been detected. X * This should be limited to non-operating system related X * errors as possible. X * EX_OSERR -- An operating system error has been detected. X * This is intended to be used for such things as "cannot X * fork", "cannot create pipe", or the like. It includes X * things like getuid returning a user that does not X * exist in the passwd file. X * EX_OSFILE -- Some system file (e.g., /etc/passwd, /etc/utmp, X * etc.) does not exist, cannot be opened, or has some X * sort of error (e.g., syntax error). X * EX_CANTCREAT -- A (user specified) output file cannot be X * created. X * EX_IOERR -- An error occurred while doing I/O on some file. X * EX_TEMPFAIL -- temporary failure, indicating something that X * is not really an error. In sendmail, this means X * that a mailer (e.g.) could not create a connection, X * and the request should be reattempted later. X * EX_PROTOCOL -- the remote system returned something that X * was "not possible" during a protocol exchange. X * EX_NOPERM -- You did not have sufficient permission to X * perform the operation. This is not intended for X * file system problems, which should use NOINPUT or X * CANTCREAT, but rather for higher level permissions. X * X * Haiku recently added an #ifdef _BSD_SOURCE around the definitions, X * so we may need to #define things even though we did include the X * system's sysexits.h. X */ X X#ifndef EX_OK X#define EX_OK 0 /* successful termination */ X#endif X X#ifndef EX__BASE X#define EX__BASE 64 /* base value for error messages */ X X#define EX_USAGE 64 /* command line usage error */ X#define EX_DATAERR 65 /* data format error */ X#define EX_NOINPUT 66 /* cannot open input */ X#define EX_NOUSER 67 /* addressee unknown */ X#define EX_NOHOST 68 /* host name unknown */ X#define EX_UNAVAILABLE 69 /* service unavailable */ X#define EX_SOFTWARE 70 /* internal software error */ X#define EX_OSERR 71 /* system error (e.g., can't fork) */ X#define EX_OSFILE 72 /* critical OS file missing */ X#define EX_CANTCREAT 73 /* can't create (user) output file */ X#define EX_IOERR 74 /* input/output error */ X#define EX_TEMPFAIL 75 /* temp failure; user is invited to retry */ X#define EX_PROTOCOL 76 /* remote error in protocol */ X#define EX_NOPERM 77 /* permission denied */ X#define EX_CONFIG 78 /* configuration error */ X X#define EX_NOTFOUND 79 /* entry not found */ X#define EX__MAX 79 /* maximum listed value */ X#endif X X#endif /* !_SCHILY_SYSEXITS_H */ END-of-star-1.6/include/schily/sysexits.h echo x - star-1.6/include/schily/sysexits.mk sed 's/^X//' >star-1.6/include/schily/sysexits.mk << 'END-of-star-1.6/include/schily/sysexits.mk' X#ident "@(#)sysexits.mk 1.1 09/02/04 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= sysexits.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/sysexits.mk echo x - star-1.6/include/schily/wctype.h sed 's/^X//' >star-1.6/include/schily/wctype.h << 'END-of-star-1.6/include/schily/wctype.h' X/* @(#)wctype.h 1.11 18/05/17 Copyright 2009-2018 J. Schilling */ X/* X * Abstraction from wctype.h X * X * Copyright (c) 2009-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_WCTYPE_H X#define _SCHILY_WCTYPE_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifndef _SCHILY_WCHAR_H X#include X#endif X X#ifdef HAVE_WCTYPE_H X/* X * Include wctype.h if wchars have been enabled in schily/wchar.h X */ X#ifdef USE_WCHAR X#ifndef _INCL_WCTYPE_H X#include X#define _INCL_WCTYPE_H X#endif X#ifndef USE_WCTYPE X#define USE_WCTYPE X#endif X#endif /* USE_WCHAR */ X#endif /* HAVE_WCTYPE_H */ X X#if defined(HAVE_ISWPRINT) && defined(USE_WCHAR) X#ifndef USE_WCTYPE X#define USE_WCTYPE X#endif X#endif X X/* X * DJGPP has wctype.h but no iswprint()... X * HP-UX-10.x has iswprint()... in wchar.h X */ X#if (!defined(HAVE_WCTYPE_H) && !defined(HAVE_WCHAR_H)) || \ X !defined(HAVE_ISWPRINT) X#undef USE_WCTYPE X#endif X X#ifdef NO_WCTYPE X#undef USE_WCTYPE X#endif X X#ifndef USE_WCTYPE X X#ifndef _SCHILY_CTYPE_H X#include X#endif X X#undef iswalnum X#define iswalnum(c) isalnum(c) X#undef iswalpha X#define iswalpha(c) isalpha(c) X#ifdef HAVE_ISBLANK X#undef iswblank X#define iswblank(c) isblank(c) X#endif X#undef iswcntrl X#define iswcntrl(c) iscntrl(c) X#undef iswcntrl X#define iswcntrl(c) iscntrl(c) X#undef iswdigit X#define iswdigit(c) isdigit(c) X#undef iswgraph X#define iswgraph(c) isgraph(c) X#undef iswlower X#define iswlower(c) islower(c) X#undef iswprint X#define iswprint(c) isprint(c) X#undef iswpunct X#define iswpunct(c) ispunct(c) X#undef iswspace X#define iswspace(c) isspace(c) X#undef iswupper X#define iswupper(c) isupper(c) X#undef iswxdigit X#define iswxdigit(c) isxdigit(c) X X#undef towlower X#define towlower(c) tolower(c) X#undef towupper X#define towupper(c) toupper(c) X X#endif /* !USE_WCTYPE */ X X#ifndef HAVE_WCTYPE Xextern wctype_t wctype __PR((const char *)); X#endif X#ifndef HAVE_ISWCTYPE Xextern int iswctype __PR((wint_t , wctype_t)); X#endif X X#endif /* _SCHILY_WCTYPE_H */ END-of-star-1.6/include/schily/wctype.h echo x - star-1.6/include/schily/wctype.mk sed 's/^X//' >star-1.6/include/schily/wctype.mk << 'END-of-star-1.6/include/schily/wctype.mk' X#ident "@(#)wctype.mk 1.1 09/04/12 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= wctype.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/wctype.mk echo x - star-1.6/include/schily/dlfcn.h sed 's/^X//' >star-1.6/include/schily/dlfcn.h << 'END-of-star-1.6/include/schily/dlfcn.h' X/* @(#)dlfcn.h 1.5 18/03/21 Copyright 2015-2018 J. Schilling */ X/* X * Abstraction from dlfcn.h X * X * Copyright (c) 2015-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_DLFCN_H X#define _SCHILY_DLFCN_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifdef HAVE_DLFCN_H X#ifndef _INCL_DLFCN_H X#include /* POSIX */ X#define _INCL_DLFCN_H X#define FOUND_DLFCN_H X#endif X#endif X X#ifdef HAVE_DL_H X#ifndef FOUND_DLFCN_H X#ifndef _INCL_DL_H X#include /* HP-UX */ X#define _INCL_DL_H X#define FOUND_DLFCN_H X#endif X#endif X#endif X X#if defined(HAVE_DLOPEN) && defined(HAVE_DLCLOSE) /* POSIX */ X#define HAVE_LOADABLE_LIBS X#endif X X#if !defined(HAVE_LOADABLE_LIBS) && defined(HAVE_SHL_LOAD) /* HP-UX */ X#define HAVE_LOADABLE_LIBS X#endif X X#if !defined(HAVE_LOADABLE_LIBS) && defined(HAVE_LOADLIBRARY) /* Win-DOS */ X#define HAVE_LOADABLE_LIBS X#endif X X/* X * dlopen() modes X */ X#ifndef RTLD_LAZY /* The only mode in SunOS-4.0 */ X#define RTLD_LAZY 0x00001 X#define RTLD_NOW 0x00002 X#define RTLD_GLOBAL 0x00100 X#define RTLD_LOCAL 0x00000 X#endif X X#ifdef __never_ X/* X * dlsym() speudo handles X * These handles are not valid on SunOS-4.0 X */ X#ifndef RTLD_NEXT X#define RTLD_NEXT (void *)-1 X#define RTLD_DEFAULT (void *)-2 X#define RTLD_SELF (void *)-3 X#endif X#endif X X/* X * dlsym() speudo handle for SunOS-4.0 X */ X#if defined(HAVE_DLSYM) && !defined(RTLD_SELF) X#define RTLD_SELF (void *)0 X#endif X X#ifdef __cplusplus Xextern "C" { X#endif X X#ifndef HAVE_DLOPEN Xextern void *dlopen __PR((const char *__pathname, int mode)); X#endif X#ifndef HAVE_DLCLOSE Xextern int dlclose __PR((void *__handle)); X#endif X#ifndef HAVE_DLSYM Xextern void *dlsym __PR((void *__handle, const char *name)); X#endif X#ifndef HAVE_DLERROR Xextern char *dlerror __PR((void)); X#endif X X#ifdef __cplusplus X} X#endif X X X X#endif /* _SCHILY_DLFCN_H */ END-of-star-1.6/include/schily/dlfcn.h echo x - star-1.6/include/schily/dlfcn.mk sed 's/^X//' >star-1.6/include/schily/dlfcn.mk << 'END-of-star-1.6/include/schily/dlfcn.mk' X#ident "@(#)dlfcn.mk 1.1 09/05/01 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= dlfcn.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/dlfcn.mk echo x - star-1.6/include/schily/shcall.h sed 's/^X//' >star-1.6/include/schily/shcall.h << 'END-of-star-1.6/include/schily/shcall.h' X/* @(#)shcall.h 1.4 18/08/01 Copyright 2009-2018 J. Schilling */ X/* X * Abstraction from shcall.h X * X * Copyright (c) 2009-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_SHCALL_H X#define _SCHILY_SHCALL_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X#ifndef _SCHILY_INTTYPES_H X#include X#endif X X#ifdef __cplusplus Xextern "C" { X#endif X X#ifndef __sqfun_t_defined Xtypedef int (*sqfun_t) __PR((void *arg)); X#define __sqfun_t_defined X#endif X X#ifndef __cbfun_t_defined Xtypedef int (*cbfun_t) __PR((int ac, char **argv)); X#define __cbfun_t_defined X#endif X X#ifndef __squit_t_defined X Xtypedef struct { X sqfun_t quitfun; /* Function to query for shell signal quit */ X void *qfarg; /* Generic arg for shell builtin quit fun */ X Int32_t flags; /* Flags to identify data beyond qfarg */ X cbfun_t callfun; /* Callback function for -call */ X void *__reserved[16]; /* For future extensions */ X} squit_t; X X#define SQ_CALL 0x01 /* Use call feature */ X X#define __squit_t_defined X#endif X Xtypedef int (*shcall) __PR((int ac, char **av, char **ev, X FILE *std[3], squit_t *__quit)); X X#ifdef __cplusplus X} X#endif X X#endif /* _SCHILY_SHCALL_H */ END-of-star-1.6/include/schily/shcall.h echo x - star-1.6/include/schily/shcall.mk sed 's/^X//' >star-1.6/include/schily/shcall.mk << 'END-of-star-1.6/include/schily/shcall.mk' X#ident "@(#)shcall.mk 1.1 09/05/01 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= shcall.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/shcall.mk echo x - star-1.6/include/schily/limits.h sed 's/^X//' >star-1.6/include/schily/limits.h << 'END-of-star-1.6/include/schily/limits.h' X/* @(#)limits.h 1.8 19/02/28 Copyright 2011-2019 J. Schilling */ X/* X * Copyright (c) 2011-2019 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_LIMITS_H X#define _SCHILY_LIMITS_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifdef HAVE_LIMITS_H X#ifndef _INCL_LIMITS_H X#include X#define _INCL_LIMITS_H X#endif X#endif X X#ifndef COLL_WEIGHTS_MAX X#define COLL_WEIGHTS_MAX 2 X#endif X X#ifndef _POSIX2_LINE_MAX X#define _POSIX2_LINE_MAX 2048 X#endif X X/* X * Include sys/param.h for PIPE_BUF X */ X#ifndef _SCHILY_PARAM_H X#include X#endif X X#ifndef PIPE_BUF X#if defined(__MINGW32__) || defined(_MSC_VER) X#define PIPE_BUF 5120 X#else X#define PIPE_BUF 512 X#endif X#endif /* PIPE_BUF */ X X/* X * For definitions of TYPE_MINVAL() ... X */ X#ifndef _SCHILY_TYPE_VAL_H X#include X#endif X X#ifndef INT_MIN X#define INT_MIN TYPE_MINVAL(int) X#endif X#ifndef INT_MAX X#define INT_MAX TYPE_MAXVAL(int) X#endif X#ifndef UINT_MIN X#define UINT_MIN TYPE_MINVAL(unsigned int) X#endif X#ifndef UINT_MAX X#define UINT_MAX TYPE_MAXVAL(unsigned int) X#endif X X#ifndef LONG_MIN X#define LONG_MIN TYPE_MINVAL(long) X#endif X#ifndef LONG_MAX X#define LONG_MAX TYPE_MAXVAL(long) X#endif X#ifndef ULONG_MIN X#define ULONG_MIN TYPE_MINVAL(unsigned long) X#endif X#ifndef ULONG_MAX X#define ULONG_MAX TYPE_MAXVAL(unsigned long) X#endif X X#ifndef LLONG_MIN X#define LLONG_MIN TYPE_MINVAL(long) X#endif X#ifndef LLONG_MAX X#define LLONG_MAX TYPE_MAXVAL(long long) X#endif X#ifndef ULLONG_MIN X#define ULLONG_MIN TYPE_MINVAL(unsigned long long) X#endif X#ifndef ULLONG_MAX X#define ULLONG_MAX TYPE_MAXVAL(unsigned long long) X#endif X X#endif /* _SCHILY_LIMITS_H */ END-of-star-1.6/include/schily/limits.h echo x - star-1.6/include/schily/limits.mk sed 's/^X//' >star-1.6/include/schily/limits.mk << 'END-of-star-1.6/include/schily/limits.mk' X#ident "@(#)limits.mk 1.1 09/05/24 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= limits.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/limits.mk echo x - star-1.6/include/schily/locale.h sed 's/^X//' >star-1.6/include/schily/locale.h << 'END-of-star-1.6/include/schily/locale.h' X/* @(#)locale.h 1.2 09/05/24 Copyright 2009 J. Schilling */ X/* X * Copyright (c) 2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_LOCALE_H X#define _SCHILY_LOCALE_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifdef HAVE_LOCALE_H X#ifndef _INCL_LOCALE_H X#include /* LC_* definitions */ X#define _INCL_LOCALE_H X#endif X#ifndef USE_LOCALE X#define USE_LOCALE X#endif X#else X#undef USE_LOCALE X#endif X X#ifndef HAVE_SETLOCALE X#undef USE_LOCALE X#endif X X#ifdef NO_LOCALE X#undef USE_LOCALE X#endif X X#ifndef USE_LOCALE X#undef setlocale X#define setlocale(n, s) ((void *)0) X#endif X X X#endif /* _SCHILY_LOCALE_H */ END-of-star-1.6/include/schily/locale.h echo x - star-1.6/include/schily/md4.h sed 's/^X//' >star-1.6/include/schily/md4.h << 'END-of-star-1.6/include/schily/md4.h' X/* @(#)md4.h 1.4 10/08/27 2009-2010 J. Schilling */ X/* X * MD4 hash code taken from OpenBSD X * X * Portions Copyright (c) 2009-2010 J. Schilling X */ X/* $OpenBSD: md4.h,v 1.15 2004/06/22 01:57:30 jfb Exp $ */ X X/* X * This code implements the MD4 message-digest algorithm. X * The algorithm is due to Ron Rivest. This code was X * written by Colin Plumb in 1993, no copyright is claimed. X * This code is in the public domain; do with it what you wish. X * Todd C. Miller modified the MD5 code to do MD4 based on RFC 1186. X * X * Equivalent code is available from RSA Data Security, Inc. X * This code has been tested against that, and is equivalent, X * except that you don't need to include two pages of legalese X * with every copy. X */ X X#ifndef _SCHILY_MD4_H X#define _SCHILY_MD4_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X#include X X#define MD4_BLOCK_LENGTH 64 X#define MD4_DIGEST_LENGTH 16 X#define MD4_DIGEST_STRING_LENGTH (MD4_DIGEST_LENGTH * 2 + 1) X Xtypedef struct MD4Context { X UInt32_t state[4]; /* state */ X UInt32_t count[2]; /* number of bits, mod 2^64 */ X UInt8_t buffer[MD4_BLOCK_LENGTH]; /* input buffer */ X} MD4_CTX; X X#ifdef __cplusplus Xextern "C" { X#endif X Xextern void MD4Init __PR((MD4_CTX *)); Xextern void MD4Update __PR((MD4_CTX *, const void *, size_t)); Xextern void MD4Pad __PR((MD4_CTX *)); Xextern void MD4Final __PR((UInt8_t [MD4_DIGEST_LENGTH], MD4_CTX *)); Xextern void MD4Transform __PR((UInt32_t [4], X const UInt8_t [MD4_BLOCK_LENGTH])); Xextern char *MD4End __PR((MD4_CTX *, char *)); Xextern char *MD4File __PR((const char *, char *)); Xextern char *MD4FileChunk __PR((const char *, char *, off_t, off_t)); Xextern char *MD4Data __PR((const UInt8_t *, size_t, char *)); X X#ifdef __cplusplus X} X#endif X X#endif /* _SCHILY_MD4_H */ END-of-star-1.6/include/schily/md4.h echo x - star-1.6/include/schily/locale.mk sed 's/^X//' >star-1.6/include/schily/locale.mk << 'END-of-star-1.6/include/schily/locale.mk' X#ident "@(#)locale.mk 1.1 09/05/23 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= locale.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/locale.mk echo x - star-1.6/include/schily/md4.mk sed 's/^X//' >star-1.6/include/schily/md4.mk << 'END-of-star-1.6/include/schily/md4.mk' X#ident "@(#)md4.mk 1.1 09/06/20 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= md4.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/md4.mk echo x - star-1.6/include/schily/md5.h sed 's/^X//' >star-1.6/include/schily/md5.h << 'END-of-star-1.6/include/schily/md5.h' X/* @(#)md5.h 1.11 10/08/27 2008-2010 J. Schilling */ X/* X * MD5 hash code taken from OpenBSD X * X * Portions Copyright (c) 2008-2010 J. Schilling X */ X X/* $OpenBSD: md5.h,v 1.16 2004/06/22 01:57:30 jfb Exp $ */ X X/* X * This code implements the MD5 message-digest algorithm. X * The algorithm is due to Ron Rivest. This code was X * written by Colin Plumb in 1993, no copyright is claimed. X * This code is in the public domain; do with it what you wish. X * X * Equivalent code is available from RSA Data Security, Inc. X * This code has been tested against that, and is equivalent, X * except that you don't need to include two pages of legalese X * with every copy. X */ X X#ifndef _SCHILY_MD5_H X#define _SCHILY_MD5_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X#include X X#define MD5_BLOCK_LENGTH 64 X#define MD5_DIGEST_LENGTH 16 X#define MD5_DIGEST_STRING_LENGTH (MD5_DIGEST_LENGTH * 2 + 1) X Xtypedef struct MD5Context { X UInt32_t state[4]; /* state */ X UInt32_t count[2]; /* number of bits, mod 2^64 */ X UInt8_t buffer[MD5_BLOCK_LENGTH]; /* input buffer */ X} MD5_CTX; X X#ifdef __cplusplus Xextern "C" { X#endif X Xextern void MD5Init __PR((MD5_CTX *)); Xextern void MD5Update __PR((MD5_CTX *, const void *, size_t)); Xextern void MD5Pad __PR((MD5_CTX *)); Xextern void MD5Final __PR((UInt8_t [MD5_DIGEST_LENGTH], MD5_CTX *)); Xextern void MD5Transform __PR((UInt32_t [4], X const UInt8_t [MD5_BLOCK_LENGTH])); Xextern char *MD5End __PR((MD5_CTX *, char *)); Xextern char *MD5File __PR((const char *, char *)); Xextern char *MD5FileChunk __PR((const char *, char *, off_t, off_t)); Xextern char *MD5Data __PR((const UInt8_t *, size_t, char *)); X X#ifdef __cplusplus X} X#endif X X#endif /* _SCHILY_MD5_H */ END-of-star-1.6/include/schily/md5.h echo x - star-1.6/include/schily/md5.mk sed 's/^X//' >star-1.6/include/schily/md5.mk << 'END-of-star-1.6/include/schily/md5.mk' X#ident "@(#)md5.mk 1.1 09/06/20 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= md5.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/md5.mk echo x - star-1.6/include/schily/sigset.h sed 's/^X//' >star-1.6/include/schily/sigset.h << 'END-of-star-1.6/include/schily/sigset.h' X/* @(#)sigset.h 1.11 11/09/16 Copyright 1997-2011 J. Schilling */ X/* X * Signal set abstraction for BSD/SVR4 signals X * X * Copyright (c) 1997-2011 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_SIGSET_H X#define _SCHILY_SIGSET_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifdef HAVE_SIGSET X/* X * Try to by default use the function that sets up signal handlers in a way X * that does not reset the handler after it has been called. X */ X#define signal sigset X#endif X X#ifdef HAVE_SIGPROCMASK X#define blocked_sigs(a) { \ X sigset_t __new; \ X \ X sigemptyset(&__new); \ X sigprocmask(SIG_BLOCK, &__new, &a);\ X } X#define block_sigs(a) { \ X sigset_t __new; \ X \ X sigfillset(&__new); \ X sigprocmask(SIG_BLOCK, &__new, &a);\ X } X#define block_sig(s) { \ X sigset_t __new; \ X \ X sigemptyset(&__new); \ X sigaddset(&__new, (s)); \ X sigprocmask(SIG_BLOCK, &__new, NULL);\ X } X#define unblock_sig(s) { \ X sigset_t __new; \ X \ X sigemptyset(&__new); \ X sigaddset(&__new, (s)); \ X sigprocmask(SIG_UNBLOCK, &__new, NULL);\ X } X#define restore_sigs(a) sigprocmask(SIG_SETMASK, &a, 0); X X#else /* !HAVE_SIGPROCMASK */ X#if defined(HAVE_SIGBLOCK) && defined(HAVE_SIGSETMASK) X X#define sigset_t int X#define block_sigs(a) a = sigblock(0xFFFFFFFF) X#define restore_sigs(a) sigsetmask(a); X#define blocked_sigs(a) { \ X int __old; \ X \ X block_sigs(__old); \ X a = __old; \ X sigsetmask(__old); \ X } X#define block_sig(s) { \ X int __old, __new; \ X \ X block_sigs(__old); \ X __new = sigmask(s); \ X __new = __old | __new; \ X sigsetmask(__new); \ X } X#define unblock_sig(s) { \ X int __old, __new; \ X \ X block_sigs(__old); \ X __new = sigmask(s); \ X __new = __old & ~__new; \ X sigsetmask(__new); \ X } X#else /* ! defined(HAVE_SIGBLOCK) && defined(HAVE_SIGSETMASK) */ X X#define sigset_t int X#define blocked_sigs(a) X#define block_sigs(a) X#define block_sig(a) X#define restore_sigs(a) X#define unblock_sig(s) X#endif /* ! defined(HAVE_SIGBLOCK) && defined(HAVE_SIGSETMASK) */ X#endif /* HAVE_SIGPROCMASK */ X X#endif /* _SCHILY_SIGSET_H */ END-of-star-1.6/include/schily/sigset.h echo x - star-1.6/include/schily/sigset.mk sed 's/^X//' >star-1.6/include/schily/sigset.mk << 'END-of-star-1.6/include/schily/sigset.mk' X#ident @(#)sigset.mk 1.2 09/06/30 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= sigset.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/sigset.mk echo x - star-1.6/include/schily/pwd.h sed 's/^X//' >star-1.6/include/schily/pwd.h << 'END-of-star-1.6/include/schily/pwd.h' X/* @(#)pwd.h 1.1 09/07/10 Copyright 2009 J. Schilling */ X/* X * Passwd abstraction X * X * Copyright (c) 2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_PWD_H X#define _SCHILY_PWD_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X#ifndef _SCHILY_TYPES_H X#include X#endif X X#ifdef HAVE_PWD_H X#ifndef _INCL_PWD_H X#include X#define _INCL_PWD_H X#endif X#else X X#ifdef __cplusplus Xextern "C" { X#endif X Xstruct passwd { X char *pw_name; X char *pw_passwd; X uid_t pw_uid; X gid_t pw_gid; X char *pw_gecos; X char *pw_dir; X char *pw_shell; X}; X X#ifdef __cplusplus X} X#endif X X#endif /* ! HAVE_PWD_H */ X X#endif /* _SCHILY_PWD_H */ END-of-star-1.6/include/schily/pwd.h echo x - star-1.6/include/schily/pwd.mk sed 's/^X//' >star-1.6/include/schily/pwd.mk << 'END-of-star-1.6/include/schily/pwd.mk' X#ident "@(#)pwd.mk 1.1 09/07/10 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= pwd.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/pwd.mk echo x - star-1.6/include/schily/grp.h sed 's/^X//' >star-1.6/include/schily/grp.h << 'END-of-star-1.6/include/schily/grp.h' X/* @(#)grp.h 1.1 09/07/10 Copyright 2009 J. Schilling */ X/* X * Group abstraction X * X * Copyright (c) 2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_GRP_H X#define _SCHILY_GRP_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X#ifndef _SCHILY_TYPES_H X#include X#endif X X#ifdef HAVE_GRP_H X#ifndef _INCL_GRP_H X#include X#define _INCL_GRP_H X#endif X#else X X#ifdef __cplusplus Xextern "C" { X#endif X Xstruct group { X char *gr_name; X char *gr_passwd; X gid_t gr_gid; X char **gr_mem; X}; X X#ifdef __cplusplus X} X#endif X X#endif /* ! HAVE_GRP_H */ X X#endif /* _SCHILY_GRP_H */ END-of-star-1.6/include/schily/grp.h echo x - star-1.6/include/schily/grp.mk sed 's/^X//' >star-1.6/include/schily/grp.mk << 'END-of-star-1.6/include/schily/grp.mk' X#ident "@(#)grp.mk 1.1 09/07/10 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= grp.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/grp.mk echo x - star-1.6/include/schily/ctype.h sed 's/^X//' >star-1.6/include/schily/ctype.h << 'END-of-star-1.6/include/schily/ctype.h' X/* @(#)ctype.h 1.2 16/06/19 Copyright 2009-2016 J. Schilling */ X/* X * Ctype abstraction X * X * Copyright (c) 2009-2016 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_CTYPE_H X#define _SCHILY_CTYPE_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X#ifndef _SCHILY_TYPES_H X#include X#endif X X#ifdef HAVE_CTYPE_H X#ifndef _INCL_CTYPE_H X#include X#define _INCL_CTYPE_H X#endif X#else X X#endif /* ! HAVE_CTYPE_H */ X X#endif /* _SCHILY_CTYPE_H */ END-of-star-1.6/include/schily/ctype.h echo x - star-1.6/include/schily/ctype.mk sed 's/^X//' >star-1.6/include/schily/ctype.mk << 'END-of-star-1.6/include/schily/ctype.mk' X#ident "@(#)ctype.mk 1.1 09/07/10 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= ctype.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/ctype.mk echo x - star-1.6/include/schily/Targets sed 's/^X//' >star-1.6/include/schily/Targets << 'END-of-star-1.6/include/schily/Targets' X#ident @(#)Targets 1.27 19/02/28 X XX_MK_LIST= \ X align.mk alloca.mk archdefs.mk assert.mk avoffset.mk \ X btorder.mk \ X ccomdefs.mk checkerr.mk ctype.mk \ X dbgmalloc.mk deflts.mk device.mk dirent.mk dlfcn.mk \ X err_arch.mk err_bit.mk err_char.mk err_type.mk \ X errno.mk fcntl.mk \ X fetchdir.mk find.mk float.mk fnmatch.mk fstream.mk \ X getargs.mk getcwd.mk getopt.mk grp.mk \ X hostname.mk \ X iconv.mk idcache.mk in.mk inet.mk io.mk ioctl.mk ipc.mk \ X intcvt.mk inttypes.mk \ X jmpdefs.mk \ X jos_defs.mk jos_io.mk jos_maxp.mk \ X libgen.mk libport.mk librmt.mk limits.mk locale.mk \ X math.mk maxpath.mk mconfig.mk \ X md4.mk md5.mk \ X mman.mk mtio.mk \ X netdb.mk nlsdefs.mk \ X param.mk patmatch.mk poll.mk priv.mk procfs.mk prototyp.mk pwd.mk \ X regex.mk _regex.mk resource.mk rmd160.mk rmtio.mk \ X schily.mk schilyp.mk select.mk sem.mk shedit.mk shm.mk \ X setjmp.mk sha1.mk sha2.mk sha3.mk shcall.mk \ X siconv.mk shadow.mk \ X sigblk.mk signal.mk sigset.mk socket.mk standard.mk stat.mk \ X stdarg.mk stdint.mk stdio.mk \ X stdlib.mk stkframe.mk strar.mk string.mk \ X sunos4_proto.mk \ X sysexits.mk syslog.mk systeminfo.mk \ X termcap.mk termios.mk time.mk timeb.mk times.mk \ X type_val.mk types.mk unistd.mk utime.mk utsname.mk utypes.mk \ X values.mk varargs.mk vfork.mk \ X walk.mk wchar.mk wctype.mk wait.mk \ X windows.mk \ X xconfig.mk xmconfig.mk END-of-star-1.6/include/schily/Targets echo x - star-1.6/include/schily/sha1.h sed 's/^X//' >star-1.6/include/schily/sha1.h << 'END-of-star-1.6/include/schily/sha1.h' X/* @(#)sha1.h 1.4 10/08/27 2010 J. Schilling */ X/* X * SHA1 hash code taken from OpenBSD X * X * Portions Copyright (c) 2010 J. Schilling X */ X X/* $OpenBSD: sha1.h,v 1.23 2004/06/22 01:57:30 jfb Exp $ */ X X/* X * SHA-1 in C X * By Steve Reid X * 100% Public Domain X */ X X#ifndef _SCHILY_SHA1_H X#define _SCHILY_SHA1_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X#ifndef _SCHILY_UTYPES_H X#include X#endif X X#define SHA1_BLOCK_LENGTH 64 X#define SHA1_DIGEST_LENGTH 20 X#define SHA1_DIGEST_STRING_LENGTH (SHA1_DIGEST_LENGTH * 2 + 1) X Xtypedef struct { X UInt32_t state[5]; X UInt32_t count[2]; X UInt8_t buffer[SHA1_BLOCK_LENGTH]; X} SHA1_CTX; X X#ifdef __cplusplus Xextern "C" { X#endif X Xextern void SHA1Init __PR((SHA1_CTX *)); Xextern void SHA1Pad __PR((SHA1_CTX *)); Xextern void SHA1Transform __PR((UInt32_t [5], X const UInt8_t [SHA1_BLOCK_LENGTH])); Xextern void SHA1Update __PR((SHA1_CTX *, const UInt8_t *, size_t)); Xextern void SHA1Final __PR((UInt8_t [SHA1_DIGEST_LENGTH], X SHA1_CTX *)); Xextern char *SHA1End __PR((SHA1_CTX *, char *)); Xextern char *SHA1File __PR((const char *, char *)); Xextern char *SHA1FileChunk __PR((const char *, char *, off_t, off_t)); Xextern char *SHA1Data __PR((const UInt8_t *, size_t, char *)); X X#ifdef __cplusplus X} X#endif X X#define HTONDIGEST(x) do { \ X x[0] = htonl(x[0]); \ X x[1] = htonl(x[1]); \ X x[2] = htonl(x[2]); \ X x[3] = htonl(x[3]); \ X x[4] = htonl(x[4]); } while (0) X X#define NTOHDIGEST(x) do { \ X x[0] = ntohl(x[0]); \ X x[1] = ntohl(x[1]); \ X x[2] = ntohl(x[2]); \ X x[3] = ntohl(x[3]); \ X x[4] = ntohl(x[4]); } while (0) X X#endif /* _SCHILY_SHA1_H */ END-of-star-1.6/include/schily/sha1.h echo x - star-1.6/include/schily/in.h sed 's/^X//' >star-1.6/include/schily/in.h << 'END-of-star-1.6/include/schily/in.h' X/* @(#)in.h 1.1 09/07/13 Copyright 2009 J. Schilling */ X/* X * In abstraction X * X * Copyright (c) 2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_IN_H X#define _SCHILY_IN_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifdef HAVE_NETINET_IN_H X#ifndef _INCL_NETINET_IN_H X#include X#define _INCL_NETINET_IN_H X#endif X#endif X X#endif /* _SCHILY_IN_H */ END-of-star-1.6/include/schily/in.h echo x - star-1.6/include/schily/in.mk sed 's/^X//' >star-1.6/include/schily/in.mk << 'END-of-star-1.6/include/schily/in.mk' X#ident "@(#)in.mk 1.1 09/07/13 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= in.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/in.mk echo x - star-1.6/include/schily/inet.h sed 's/^X//' >star-1.6/include/schily/inet.h << 'END-of-star-1.6/include/schily/inet.h' X/* @(#)inet.h 1.3 13/07/08 Copyright 2009-2013 J. Schilling */ X/* X * Inet abstraction X * X * Copyright (c) 2009-2013 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_INET_H X#define _SCHILY_INET_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifdef HAVE_ARPA_INET_H X#ifndef _INCL_ARPA_INET_H X#include X#define _INCL_ARPA_INET_H X#endif X#else /* !HAVE_ARPA_INET_H */ X X/* X * BeOS does not have X * but inet_ntaoa() is in X */ X#ifdef HAVE_NETDB_H X#ifndef _SCHILY_NETDB_H X#include X#endif X#endif /* HAVE_NETDB_H */ X X#endif /* !HAVE_ARPA_INET_H */ X X#endif /* _SCHILY_INET_H */ END-of-star-1.6/include/schily/inet.h echo x - star-1.6/include/schily/inet.mk sed 's/^X//' >star-1.6/include/schily/inet.mk << 'END-of-star-1.6/include/schily/inet.mk' X#ident "@(#)inet.mk 1.1 09/07/13 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= inet.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/inet.mk echo x - star-1.6/include/schily/io.h sed 's/^X//' >star-1.6/include/schily/io.h << 'END-of-star-1.6/include/schily/io.h' X/* @(#)io.h 1.1 09/07/13 Copyright 2009 J. Schilling */ X/* X * DOS io.h abstraction X * X * Copyright (c) 2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_IO_H X#define _SCHILY_IO_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X#ifndef _SCHILY_FCNTL_H X#include X#endif X X#ifndef NEED_O_BINARY X#if O_BINARY != 0 X#define NEED_O_BINARY X#endif X#endif X X#if defined(HAVE_IO_H) && defined(NEED_O_BINARY) X#ifndef _INCL_IO_H X#include X#define _INCL_IO_H X#endif X#else /* ! defined(HAVE_IO_H) && defined(NEED_O_BINARY) */ X X#define setmode(f, m) X X#endif X X#endif /* _SCHILY_IO_H */ END-of-star-1.6/include/schily/io.h echo x - star-1.6/include/schily/io.mk sed 's/^X//' >star-1.6/include/schily/io.mk << 'END-of-star-1.6/include/schily/io.mk' X#ident "@(#)io.mk 1.1 09/07/13 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= io.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/io.mk echo x - star-1.6/include/schily/netdb.h sed 's/^X//' >star-1.6/include/schily/netdb.h << 'END-of-star-1.6/include/schily/netdb.h' X/* @(#)netdb.h 1.2 15/11/30 Copyright 2009-2015 J. Schilling */ X/* X * Netdb abstraction X * X * Copyright (c) 2009-2015 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_NETDB_H X#define _SCHILY_NETDB_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifdef HAVE_NETDB_H X#ifndef _INCL_NETDB_H X#include X#define _INCL_NETDB_H X#endif X#endif X X#ifdef HAVE_ARPA_AIXRCMDS_H X#ifndef _INCL_ARPA_AIXRCMDS_H X#include X#define _INCL_ARPA_AIXRCMDS_H X#endif X#endif X X#endif /* _SCHILY_NETDB_H */ END-of-star-1.6/include/schily/netdb.h echo x - star-1.6/include/schily/netdb.mk sed 's/^X//' >star-1.6/include/schily/netdb.mk << 'END-of-star-1.6/include/schily/netdb.mk' X#ident "@(#)netdb.mk 1.1 09/07/13 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= netdb.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/netdb.mk echo x - star-1.6/include/schily/setjmp.h sed 's/^X//' >star-1.6/include/schily/setjmp.h << 'END-of-star-1.6/include/schily/setjmp.h' X/* @(#)setjmp.h 1.1 09/07/13 Copyright 2009 J. Schilling */ X/* X * Setjmp abstraction X * X * Copyright (c) 2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_SETJMP_H X#define _SCHILY_SETJMP_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifndef _INCL_SETJMP_H X#define _INCL_SETJMP_H X#include X#endif X X#endif /* _SCHILY_SETJMP_H */ END-of-star-1.6/include/schily/setjmp.h echo x - star-1.6/include/schily/setjmp.mk sed 's/^X//' >star-1.6/include/schily/setjmp.mk << 'END-of-star-1.6/include/schily/setjmp.mk' X#ident "@(#)setjmp.mk 1.1 09/07/13 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= setjmp.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/setjmp.mk echo x - star-1.6/include/schily/shadow.h sed 's/^X//' >star-1.6/include/schily/shadow.h << 'END-of-star-1.6/include/schily/shadow.h' X/* @(#)shadow.h 1.1 09/07/13 Copyright 2009 J. Schilling */ X/* X * Shadow abstraction X * X * Copyright (c) 2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_SHADOW_H X#define _SCHILY_SHADOW_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifdef HAVE_SHADOW_H X#ifndef _INCL_SHADOW_H X#include X#define _INCL_SHADOW_H X#endif X#endif X X#endif /* _SCHILY_SHADOW_H */ END-of-star-1.6/include/schily/shadow.h echo x - star-1.6/include/schily/shadow.mk sed 's/^X//' >star-1.6/include/schily/shadow.mk << 'END-of-star-1.6/include/schily/shadow.mk' X#ident "@(#)shadow.mk 1.1 09/07/13 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= shadow.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/shadow.mk echo x - star-1.6/include/schily/socket.h sed 's/^X//' >star-1.6/include/schily/socket.h << 'END-of-star-1.6/include/schily/socket.h' X/* @(#)socket.h 1.3 12/11/14 Copyright 2009-2012 J. Schilling */ X/* X * Socket abstraction X * X * Copyright (c) 2009-2012 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_SOCKET_H X#define _SCHILY_SOCKET_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifdef HAVE_SYS_SOCKET_H X X#ifndef _INCL_SYS_SOCKET_H X#include X#define _INCL_SYS_SOCKET_H X#endif X X/* X * Compatibility defines for UNIX/POSIX: X * X * Win32 defines a socket layer in winsock.h that is not POSIX compliant. X * The functions socket() and accept() return an "unsigned int" instead of just X * an "int". As a result, an error return from socket() and accept() cannot be X * -1 but is INVALID_SOCKET. All functions from the Win32 socket layer except X * socket() and accept() return -1 on error. X * Since a socket is not a file descriptor on Win32, we cannot call close() X * but need to call closesocket(). X * If we like to write software that compiles on a Win32 system without a X * POSIX layer, we need use the following definitions as a workaround even X * for UNIX/POSIX systems. X */ X X#define SOCKET int /* The socket type on UNIX/POSIX */ X#define INVALID_SOCKET (-1) /* Error return code for socket()/accept() */ X#define closesocket close /* Use instead of close(s) for Win32 compat */ X X#else /* On a non-POSIX system: */ X/* X * If we are on a Win32 system without a POSIX layer, we would need to include X * winsock.h but this includes definitions that cause compatibility problems. X * For this reason, we instead include our windows.h that contains the needed X * workaround. X */ X#ifdef HAVE_WINDOWS_H X#include X#endif /* HAVE_WINDOWS_H */ X#endif X X#endif /* _SCHILY_SOCKET_H */ END-of-star-1.6/include/schily/socket.h echo x - star-1.6/include/schily/socket.mk sed 's/^X//' >star-1.6/include/schily/socket.mk << 'END-of-star-1.6/include/schily/socket.mk' X#ident "@(#)socket.mk 1.1 09/07/13 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= socket.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/socket.mk echo x - star-1.6/include/schily/times.h sed 's/^X//' >star-1.6/include/schily/times.h << 'END-of-star-1.6/include/schily/times.h' X/* @(#)times.h 1.1 09/07/13 Copyright 2009 J. Schilling */ X/* X * Times abstraction X * X * Copyright (c) 2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_TIMES_H X#define _SCHILY_TIMES_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X#ifndef _SCHILY_TIME_H X#include X#endif X#ifndef _SCHILY_LIMITS_H X#include X#endif X#ifndef _SCHILY_UNISTD_H X#include X#endif X X/* X * Make sure to include schily/time.h before, because of a Next Step bug. X */ X#ifdef HAVE_SYS_TIMES_H X#ifndef _INCL_SYS_TIMES_H X#define _INCL_SYS_TIMES_H X#include X#endif X#endif X X#ifndef CLK_TCK X#if defined(_SC_CLK_TCK) X#define CLK_TCK ((clock_t)sysconf(_SC_CLK_TCK)) X#else X#define CLK_TCK 60 X#endif X#endif X X#endif /* _SCHILY_TIMES_H */ END-of-star-1.6/include/schily/times.h echo x - star-1.6/include/schily/times.mk sed 's/^X//' >star-1.6/include/schily/times.mk << 'END-of-star-1.6/include/schily/times.mk' X#ident "@(#)times.mk 1.1 09/07/13 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= times.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/times.mk echo x - star-1.6/include/schily/utsname.h sed 's/^X//' >star-1.6/include/schily/utsname.h << 'END-of-star-1.6/include/schily/utsname.h' X/* @(#)utsname.h 1.3 11/08/05 Copyright 2009-2011 J. Schilling */ X/* X * Utsname abstraction X * X * Copyright (c) 2009-2011 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_UTSNAME_H X#define _SCHILY_UTSNAME_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X/* X * NeXT Step has sys/utsname but not uname() X */ X#ifdef HAVE_SYS_UTSNAME_H X#ifndef _INCL_SYS_UTSNAME_H X#define _INCL_SYS_UTSNAME_H X#include X#endif X#else /* !HAVE_SYS_UTSNAME_H */ X X#ifdef __cplusplus Xextern "C" { X#endif X X#ifndef SYS_NMLN X#define SYS_NMLN 257 X#endif X Xstruct utsname { X char sysname[SYS_NMLN]; /* Name of this OS */ X char nodename[SYS_NMLN]; /* Name of this network node */ X char release[SYS_NMLN]; /* Release level */ X char version[SYS_NMLN]; /* Version level */ X char machine[SYS_NMLN]; /* hardware type */ X}; X X#ifndef HAVE_UNAME Xextern int uname __PR((struct utsname *)); X#endif X X#ifdef __cplusplus X} X#endif X X#endif /* !HAVE_SYS_UTSNAME_H */ X X#endif /* _SCHILY_UTSNAME_H */ END-of-star-1.6/include/schily/utsname.h echo x - star-1.6/include/schily/utsname.mk sed 's/^X//' >star-1.6/include/schily/utsname.mk << 'END-of-star-1.6/include/schily/utsname.mk' X#ident "@(#)utsname.mk 1.1 09/07/13 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= utsname.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/utsname.mk echo x - star-1.6/include/schily/vfork.h sed 's/^X//' >star-1.6/include/schily/vfork.h << 'END-of-star-1.6/include/schily/vfork.h' X/* @(#)vfork.h 1.4 09/11/15 Copyright 2009 J. Schilling */ X/* X * Vfork abstraction X * X * Copyright (c) 2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_VFORK_H X#define _SCHILY_VFORK_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X#ifndef _SCHILY_UNISTD_H X#include /* vfork() definitions are here on Solaris */ X#endif X X#ifdef HAVE_VFORK_H X#ifndef _INCL_VFORK_H X#define _INCL_VFORK_H X#include X#endif X#endif X#ifdef HAVE_SYS_FORK_H X#ifndef _INCL_SYS_FORK_H X#define _INCL_SYS_FORK_H X#include X#endif X#endif X X#ifdef VMS X#ifndef VMS_VFORK_OK X/* X * vfork() on VMS implements strange deviations from the expected behavior. X * The child does not run correctly unless it calls exec*(). X * The file descriptors are not separated from the parent. X * X * decc$set_child_standard_streams() allows to work around the most important X * problem of having no separate space for file descriptors if the code is X * prepared for the deviations. X * X * As VMS silently overwrites the "vfork" #definition from mconfig.h in X * unistd.h, we need to reset to the definition in mconfig.h for all programs X * that are not prepared for the deviations. X */ X#ifndef HAVE_VFORK /* Paranoia in case VMS implements a working vfork() */ X#undef vfork X#define vfork fork X#endif /* HAVE_VFORK */ X X#else /* VMS_VFORK_OK */ X X#define set_child_standard_fds(in, out, err) \ X decc$set_child_standard_streams((in), (out), (err)) X#endif /* VMS_VFORK_OK */ X#endif /* VMS */ X X#endif /* _SCHILY_VFORK_H */ END-of-star-1.6/include/schily/vfork.h echo x - star-1.6/include/schily/vfork.mk sed 's/^X//' >star-1.6/include/schily/vfork.mk << 'END-of-star-1.6/include/schily/vfork.mk' X#ident "@(#)vfork.mk 1.1 09/07/13 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= vfork.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/vfork.mk echo x - star-1.6/include/schily/systeminfo.h sed 's/^X//' >star-1.6/include/schily/systeminfo.h << 'END-of-star-1.6/include/schily/systeminfo.h' X/* @(#)systeminfo.h 1.1 09/07/14 Copyright 2009 J. Schilling */ X/* X * Systeminfo abstraction X * X * Copyright (c) 2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_SYSTEMINFO_H X#define _SCHILY_SYSTEMINFO_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifdef HAVE_SYS_SYSTEMINFO_H X#ifndef _INCL_SYS_SYSTEMINFO_H X#define _INCL_SYS_SYSTEMINFO_H X#include X#endif X#endif X X#endif /* _SCHILY_SYSTEMINFO_H */ END-of-star-1.6/include/schily/systeminfo.h echo x - star-1.6/include/schily/systeminfo.mk sed 's/^X//' >star-1.6/include/schily/systeminfo.mk << 'END-of-star-1.6/include/schily/systeminfo.mk' X#ident "@(#)systeminfo.mk 1.1 09/07/14 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= systeminfo.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/systeminfo.mk echo x - star-1.6/include/schily/sha1.mk sed 's/^X//' >star-1.6/include/schily/sha1.mk << 'END-of-star-1.6/include/schily/sha1.mk' X#ident "@(#)sha1.mk 1.1 09/08/01 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= sha1.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/sha1.mk echo x - star-1.6/include/schily/resource.h sed 's/^X//' >star-1.6/include/schily/resource.h << 'END-of-star-1.6/include/schily/resource.h' X/* @(#)resource.h 1.11 15/08/14 Copyright 1995-2015 J. Schilling */ X/* X * Abstraction from resource limits X * X * Missing parts for wait3() taken from SunOS X * X * Copyright (c) 1995-2015 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_RESOURCE_H X#define _SCHILY_RESOURCE_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifndef _SCHILY_TIME_H X#include X#endif X X/* X * Get definitions from system include files X */ X#ifdef HAVE_SYS_RESOURCE_H X#ifndef _INCL_SYS_RESOURCE_H X#include X#define _INCL_SYS_RESOURCE_H X#endif X#endif X X#ifdef __cplusplus Xextern "C" { X#endif X X/* X * Now check which definitions are missing and define them localy. X */ X X#ifndef RUSAGE_SELF X/* X * Resource utilization information. X */ X X#define RUSAGE_SELF 0 X#define RUSAGE_CHILDREN -1 X X#endif /* RUSAGE_SELF */ X X#ifndef HAVE_STRUCT_RUSAGE X X/* X * On a vanilla BSD system, all fields are set. X * On other systems, parts may not be supported. X * X * S: 0 means that the value is 0 on Solaris X * S: * means that the value is the sum of rm_asrss on Solaris X * X * POSIX and BeOS/Haiku define only ru_utime and ru_stime. X */ Xstruct rusage { X struct timeval ru_utime; /* user time used */ X struct timeval ru_stime; /* system time used */ X long ru_maxrss; /* maximum resident set size S: 0 */ X#define ru_first ru_ixrss X long ru_ixrss; /* integral shared memory size S: 0 */ X long ru_idrss; /* integral unshared data size S: * */ X long ru_isrss; /* integral unshared stack size S: 0 */ X long ru_minflt; /* any page faults not requiring I/O */ X long ru_majflt; /* any page faults requiring I/O */ X long ru_nswap; /* swaps */ X long ru_inblock; /* block input operations */ X long ru_oublock; /* block output operations */ X long ru_msgsnd; /* messages sent */ X long ru_msgrcv; /* messages received */ X long ru_nsignals; /* signals received */ X long ru_nvcsw; /* voluntary context switches */ X long ru_nivcsw; /* involuntary " */ X#define ru_last ru_nivcsw X}; X#endif /* HAVE_STRUCT_RUSAGE */ X X#ifndef RLIMIT_CPU X/* X * Resource limits X */ X#define RLIMIT_CPU 0 /* cpu time in milliseconds */ X#define RLIMIT_FSIZE 1 /* maximum file size */ X#define RLIMIT_DATA 2 /* data size */ X#define RLIMIT_STACK 3 /* stack size */ X#define RLIMIT_CORE 4 /* core file size */ X#define RLIMIT_RSS 5 /* resident set size */ X X#define RLIM_NLIMITS 6 /* number of resource limits */ X X#ifndef RLIM_INFINITY X#define RLIM_INFINITY 0x7fffffff X#endif X X#ifndef HAVE_TYPE_RLIM_T X#define rlim_t Intmax_t X#endif X Xstruct rlimit { X rlim_t rlim_cur; /* current (soft) limit */ X rlim_t rlim_max; /* maximum value for rlim_cur */ X}; X X#endif /* RLIMIT_CPU */ X X#ifdef __cplusplus X} X#endif X X#endif /* _SCHILY_RESOURCE_H */ END-of-star-1.6/include/schily/resource.h echo x - star-1.6/include/schily/resource.mk sed 's/^X//' >star-1.6/include/schily/resource.mk << 'END-of-star-1.6/include/schily/resource.mk' X#ident "@(#)resource.mk 1.1 09/08/03 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= resource.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/resource.mk echo x - star-1.6/include/schily/select.h sed 's/^X//' >star-1.6/include/schily/select.h << 'END-of-star-1.6/include/schily/select.h' X/* @(#)select.h 1.1 09/08/04 Copyright 2009 J. Schilling */ X/* X * Select abstraction X * X * Copyright (c) 2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_SELECT_H X#define _SCHILY_SELECT_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X#ifndef _SCHILY_TYPES_H X#include X#endif X#ifndef _SCHILY_TIME_H X#include X#endif X X#ifdef HAVE_SYS_SELECT_H X#ifndef _INCL_SYS_SELECT_H X#include X#define _INCL_SYS_SELECT_H X#endif X#endif X X/* X * Some systems need sys/socket.h instead or in addition to sys/select.h X */ X#ifdef NEED_SYS_SOCKET_H X#ifndef _SCHILY_SOCKET_H X#include X#endif X#endif X X#endif /* _SCHILY_SELECT_H */ END-of-star-1.6/include/schily/select.h echo x - star-1.6/include/schily/select.mk sed 's/^X//' >star-1.6/include/schily/select.mk << 'END-of-star-1.6/include/schily/select.mk' X#ident "@(#)select.mk 1.1 09/08/04 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= select.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/select.mk echo x - star-1.6/include/schily/priv.h sed 's/^X//' >star-1.6/include/schily/priv.h << 'END-of-star-1.6/include/schily/priv.h' X/* @(#)priv.h 1.5 13/05/28 Copyright 2009-2013 J. Schilling */ X/* X * Abstraction code for fine grained process privileges X * X * Copyright (c) 2009-2013 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_PRIV_H X#define _SCHILY_PRIV_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X/* X * The Solaris process privileges interface. X */ X#if defined(HAVE_PRIV_H) && \ X defined(HAVE_GETPPRIV) && defined(HAVE_SETPPRIV) && \ X defined(HAVE_PRIV_SET) X X#define HAVE_SOLARIS_PPRIV X#endif X X#ifdef NO_SOLARIS_PPRIV X#undef HAVE_SOLARIS_PPRIV X#endif X X#ifdef HAVE_SOLARIS_PPRIV X#ifndef _INCL_PRIV_H X#define _INCL_PRIV_H X#include X#endif X#endif X X/* X * AIX implements an incompatible process privileges interface. X * On AIX, we have sys/priv.h, getppriv(), setppriv() but no priv_set(). X */ X#if defined(HAVE_SYS_PRIV_H) && \ X defined(HAVE_GETPPRIV) && defined(HAVE_SETPPRIV) && \ X defined(HAVE_PRIVBIT_SET) X X#define HAVE_AIX_PPRIV X#endif X X#ifdef NO_AIX_PPRIV X#undef HAVE_AIX_PPRIV X#endif X X#ifdef HAVE_AIX_PPRIV X#ifndef _INCL_SYS_PRIV_H X#define _INCL_SYS_PRIV_H X#include X#endif X#endif X X/* X * The POSIX.1e draft has been withdrawn in 1997. X * Linux started to implement this outdated concept in 1997. X * On Linux, we have sys/capability.h, cap_get_proc(), cap_set_proc(), X * cap_set_flag() cap_clear_flag() X */ X#if defined(HAVE_SYS_CAPABILITY_H) && \ X defined(HAVE_CAP_GET_PROC) && defined(HAVE_CAP_SET_PROC) && \ X defined(HAVE_CAP_SET_FLAG) && defined(HAVE_CAP_CLEAR_FLAG) X X#define HAVE_LINUX_CAPS X#endif X X#ifdef NO_LINUX_CAPS X#undef HAVE_LINUX_CAPS X#endif X X#ifdef HAVE_LINUX_CAPS X#ifndef _INCL_SYS_CAPABILITY_H X#define _INCL_SYS_CAPABILITY_H X#include X#endif X#endif X X/* X * Privileges abstraction layer definitions X */ X#define SCHILY_PRIV_FILE_CHOWN 10 /* Allow to chown any file */ X#define SCHILY_PRIV_FILE_CHOWN_SELF 11 /* Allow to chown own files */ X#define SCHILY_PRIV_FILE_DAC_EXECUTE 12 /* Overwrite execute permission */ X#define SCHILY_PRIV_FILE_DAC_READ 13 /* Overwrite read permission */ X#define SCHILY_PRIV_FILE_DAC_SEARCH 14 /* Overwrite dir search permission */ X#define SCHILY_PRIV_FILE_DAC_WRITE 15 /* Overwrite write permission */ X#define SCHILY_PRIV_FILE_DOWNGRADE_SL 16 /* Downgrade sensivity label */ X#define SCHILY_PRIV_FILE_LINK_ANY 17 /* Hard-link files not owned */ X#define SCHILY_PRIV_FILE_OWNER 18 /* Allow chmod ... to unowned files */ X#define SCHILY_PRIV_FILE_SETID 19 /* Allow chown or suid/sgid without being owner */ X#define SCHILY_PRIV_FILE_UPGRADE_SL 20 /* Upgrade sensivity label */ X#define SCHILY_PRIV_FILE_FLAG_SET 22 /* Allow set file attributes as "immutable" */ X X#define SCHILY_PRIV_IPC_DAC_READ 40 /* Overwrite read permission */ X#define SCHILY_PRIV_IPC_DAC_WRITE 41 /* Overwrite write permission */ X#define SCHILY_PRIV_IPC_OWNER 42 /* Allow chmod ... to unowned files */ X X#define SCHILY_PRIV_NET_BINDMLP 50 /* Allow to bind multi-level ports */ X#define SCHILY_PRIV_NET_ICMPACCESS 51 /* Allow to send/receive ICMP packets */ X#define SCHILY_PRIV_NET_MAC_AWARE 52 /* Allow to set NET_MAC_AWARE flag */ X#define SCHILY_PRIV_NET_OBSERVABILITY 53 /* Allow tp access network device for receiving traffic */ X#define SCHILY_PRIV_NET_PRIVADDR 54 /* Allow to bind priv ports */ X#define SCHILY_PRIV_NET_RAWACCESS 55 /* Allow raw network access */ X X#define SCHILY_PRIV_PROC_AUDIT 60 /* Allow to create audit records */ X#define SCHILY_PRIV_PROC_CHROOT 61 /* Allow chroot */ X#define SCHILY_PRIV_PROC_CLOCK_HIGHRES 62 /* Allow to use high resulution timers */ X#define SCHILY_PRIV_PROC_EXEC 63 /* Allow to call exec*() */ X#define SCHILY_PRIV_PROC_FORK 64 /* Allow to call fork*()/vfork*() */ X#define SCHILY_PRIV_PROC_INFO 65 /* Allow to examine /proc status without sendsig priv */ X#define SCHILY_PRIV_PROC_LOCK_MEMORY 66 /* Allow to lock pages into physical memory */ X#define SCHILY_PRIV_PROC_OWNER 67 /* Allow sendsig and /proc to other procs */ X#define SCHILY_PRIV_PROC_PRIOCNTL 68 /* Allow to send sognals or trace outside session */ X#define SCHILY_PRIV_PROC_SESSION 68 /* Allow to send sognals or trace outside session */ X#define SCHILY_PRIV_PROC_SETID 69 /* Allow set proc's UID/GID */ X X#define SCHILY_PRIV_SYS_ACCT 80 /* Allow process accounting */ X#define SCHILY_PRIV_SYS_ADMIN 81 /* Allow system administration */ X#define SCHILY_PRIV_SYS_AUDIT 82 /* Allow so start kernel auditing */ X#define SCHILY_PRIV_SYS_CONFIG 83 /* Allow various system config tasks */ X#define SCHILY_PRIV_SYS_DEVICES 84 /* Allow device specific stuff */ X#define SCHILY_PRIV_SYS_DL_CONFIG 85 /* Allow tp configure datalink interfaces */ X#define SCHILY_PRIV_SYS_IP_CONFIG 86 /* Allow to configure IP interfaces */ X#define SCHILY_PRIV_SYS_LINKDIR 87 /* Allow to link/unlink directories */ X#define SCHILY_PRIV_SYS_MOUNT 88 /* Allow file-system administration */ X#define SCHILY_PRIV_SYS_NET_CONFIG 89 /* Allow to configure the network */ X#define SCHILY_PRIV_SYS_NFS 90 /* Allow to configure NFS */ X#define SCHILY_PRIV_SYS_PPP_CONFIG 91 /* Allow to configure PPP */ X#define SCHILY_PRIV_SYS_RES_CONFIG 92 /* Allow to configure system resources */ X#define SCHILY_PRIV_SYS_RESOURCE 93 /* Allow setrlimit */ X#define SCHILY_PRIV_SYS_SMB 94 /* Allow to configure SMB */ X#define SCHILY_PRIV_SYS_SUSER_COMPAT 95 /* Allow to load modules that call suser() */ X#define SCHILY_PRIV_SYS_TIME 96 /* Allow to set time */ X#define SCHILY_PRIV_SYS_TRANS_LABEL 97 /* Allow to translate labels in trusted extensions */ X X#endif /* _SCHILY_PRIV_H */ END-of-star-1.6/include/schily/priv.h echo x - star-1.6/include/schily/priv.mk sed 's/^X//' >star-1.6/include/schily/priv.mk << 'END-of-star-1.6/include/schily/priv.mk' X#ident "@(#)priv.mk 1.1 09/08/07 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= priv.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/priv.mk echo x - star-1.6/include/schily/assert.h sed 's/^X//' >star-1.6/include/schily/assert.h << 'END-of-star-1.6/include/schily/assert.h' X/* @(#)assert.h 1.1 09/08/07 Copyright 2009 J. Schilling */ X/* X * Abstraction code for assert.h X * X * Copyright (c) 2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_ASSERT_H X#define _SCHILY_ASSERT_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifdef HAVE_ASSERT_H X#ifndef _INCL_ASSERT_H X#define _INCL_ASSERT_H X#include X#endif X#else /* !HAVE_ASSERT_H */ X X#undef assert X X#ifdef NDEBUG X#define assert(ignore) ((void) 0) X#else X#if defined(__STDC__) X#define assert(exp) (void)((exp) || (__assert(#exp, __FILE__, __LINE__), 0)) X#else X#define assert(exp) (void)((exp) || (__assert("exp", __FILE__, __LINE__), 0)) X#endif X#endif X X#endif /* !HAVE_ASSERT_H */ X X#endif /* _SCHILY_ASSERT_H */ END-of-star-1.6/include/schily/assert.h echo x - star-1.6/include/schily/assert.mk sed 's/^X//' >star-1.6/include/schily/assert.mk << 'END-of-star-1.6/include/schily/assert.mk' X#ident "@(#)assert.mk 1.1 09/08/07 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= assert.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/assert.mk echo x - star-1.6/include/schily/syslog.h sed 's/^X//' >star-1.6/include/schily/syslog.h << 'END-of-star-1.6/include/schily/syslog.h' X/* @(#)syslog.h 1.1 09/08/07 Copyright 2009 J. Schilling */ X/* X * Abstraction code for syslog X * X * Copyright (c) 2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_SYSLOG_H X#define _SCHILY_SYSLOG_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifdef HAVE_SYSLOG_H X#ifndef _INCL_SYSLOG_H X#define _INCL_SYSLOG_H X#include X#endif X#endif X X#endif /* _SCHILY_SYSLOG_H */ END-of-star-1.6/include/schily/syslog.h echo x - star-1.6/include/schily/syslog.mk sed 's/^X//' >star-1.6/include/schily/syslog.mk << 'END-of-star-1.6/include/schily/syslog.mk' X#ident "@(#)syslog.mk 1.1 09/08/07 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= syslog.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/syslog.mk echo x - star-1.6/include/schily/procfs.h sed 's/^X//' >star-1.6/include/schily/procfs.h << 'END-of-star-1.6/include/schily/procfs.h' X/* @(#)procfs.h 1.1 09/08/07 Copyright 2009 J. Schilling */ X/* X * Abstraction code for the process filesystem X * X * Copyright (c) 2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_PROCFS_H X#define _SCHILY_PROCFS_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifdef HAVE_PROCFS_H X#ifndef _INCL_PROCFS_H X#define _INCL_PROCFS_H X#include X#endif X#else X#ifdef HAVE_SYS_PROCFS_H X#ifndef _INCL_SYS_PROCFS_H X#define _INCL_SYS_PROCFS_H X#include X#endif X#endif X#endif X X#endif /* _SCHILY_PROCFS_H */ END-of-star-1.6/include/schily/procfs.h echo x - star-1.6/include/schily/procfs.mk sed 's/^X//' >star-1.6/include/schily/procfs.mk << 'END-of-star-1.6/include/schily/procfs.mk' X#ident "@(#)procfs.mk 1.1 09/08/07 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= procfs.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/procfs.mk echo x - star-1.6/include/schily/float.h sed 's/^X//' >star-1.6/include/schily/float.h << 'END-of-star-1.6/include/schily/float.h' X/* @(#)float.h 1.1 09/08/08 Copyright 2009 J. Schilling */ X/* X * Abstraction code for float.h X * X * Copyright (c) 2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_FLOAT_H X#define _SCHILY_FLOAT_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifdef HAVE_FLOAT_H X#ifndef _INCL_FLOAT_H X#define _INCL_FLOAT_H X#include X#endif X#endif X X#ifdef HAVE_VALUES_H X#ifndef _INCL_VALUES_H X#define _INCL_VALUES_H X#include X#endif X X#ifndef FLT_MAX X#define FLT_MAX MAXFLOAT X#endif X#ifndef FLT_MIN X#define FLT_MIN MINFLOAT X#endif X#ifndef DBL_MAX X#define DBL_MAX MAXDOUBLE X#endif X#ifndef DBL_MIN X#define DBL_MIN MINDOUBLE X#endif X X#endif X X X X#endif /* _SCHILY_FLOAT_H */ END-of-star-1.6/include/schily/float.h echo x - star-1.6/include/schily/float.mk sed 's/^X//' >star-1.6/include/schily/float.mk << 'END-of-star-1.6/include/schily/float.mk' X#ident "@(#)float.mk 1.1 09/08/08 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= float.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/float.mk echo x - star-1.6/include/schily/ipc.h sed 's/^X//' >star-1.6/include/schily/ipc.h << 'END-of-star-1.6/include/schily/ipc.h' X/* @(#)ipc.h 1.1 09/08/08 Copyright 2009 J. Schilling */ X/* X * Abstraction code for ipc.h X * X * Copyright (c) 2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_IPC_H X#define _SCHILY_IPC_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifdef HAVE_SYS_IPC_H X#ifndef _INCL_SYS_IPC_H X#define _INCL_SYS_IPC_H X#include X#endif X#endif X X#endif /* _SCHILY_IPC_H */ END-of-star-1.6/include/schily/ipc.h echo x - star-1.6/include/schily/ipc.mk sed 's/^X//' >star-1.6/include/schily/ipc.mk << 'END-of-star-1.6/include/schily/ipc.mk' X#ident "@(#)ipc.mk 1.1 09/08/08 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= ipc.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/ipc.mk echo x - star-1.6/include/schily/sem.h sed 's/^X//' >star-1.6/include/schily/sem.h << 'END-of-star-1.6/include/schily/sem.h' X/* @(#)sem.h 1.1 09/08/08 Copyright 2009 J. Schilling */ X/* X * Abstraction code for sem.h X * X * Copyright (c) 2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_SEM_H X#define _SCHILY_SEM_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifdef HAVE_SYS_SEM_H X#ifndef _INCL_SYS_SEM_H X#define _INCL_SYS_SEM_H X#include X#endif X#endif X X#endif /* _SCHILY_SEM_H */ END-of-star-1.6/include/schily/sem.h echo x - star-1.6/include/schily/sem.mk sed 's/^X//' >star-1.6/include/schily/sem.mk << 'END-of-star-1.6/include/schily/sem.mk' X#ident "@(#)sem.mk 1.1 09/08/08 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= sem.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/sem.mk echo x - star-1.6/include/schily/shm.h sed 's/^X//' >star-1.6/include/schily/shm.h << 'END-of-star-1.6/include/schily/shm.h' X/* @(#)shm.h 1.1 09/08/08 Copyright 2009 J. Schilling */ X/* X * Abstraction code for shm.h X * X * Copyright (c) 2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_SHM_H X#define _SCHILY_SHM_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifdef HAVE_SYS_SHM_H X#ifndef _INCL_SYS_SHM_H X#define _INCL_SYS_SHM_H X#include X#endif X#endif X X#endif /* _SCHILY_SHM_H */ END-of-star-1.6/include/schily/shm.h echo x - star-1.6/include/schily/shm.mk sed 's/^X//' >star-1.6/include/schily/shm.mk << 'END-of-star-1.6/include/schily/shm.mk' X#ident "@(#)shm.mk 1.1 09/08/08 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= shm.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/shm.mk echo x - star-1.6/include/schily/rmd160.h sed 's/^X//' >star-1.6/include/schily/rmd160.h << 'END-of-star-1.6/include/schily/rmd160.h' X/* @(#)rmd160.h 1.5 10/08/27 2009-2010 J. Schilling */ X/* X * RMD160 hash code taken from OpenBSD X * X * Portions Copyright (c) 2009-2010 J. Schilling X */ X/* $OpenBSD: rmd160.h,v 1.16 2004/06/22 01:57:30 jfb Exp $ */ X/* X * Copyright (c) 2001 Markus Friedl. All rights reserved. X * X * Redistribution and use in source and binary forms, with or without X * modification, are permitted provided that the following conditions X * are met: X * 1. Redistributions of source code must retain the above copyright X * notice, this list of conditions and the following disclaimer. X * 2. Redistributions in binary form must reproduce the above copyright X * notice, this list of conditions and the following disclaimer in the X * documentation and/or other materials provided with the distribution. X * X * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR X * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES X * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. X * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, X * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT X * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, X * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY X * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT X * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF X * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. X */ X#ifndef _SCHILY_RMD160_H X#define _SCHILY_RMD160_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X#include X X#ifdef __cplusplus Xextern "C" { X#endif X X#define RMD160_BLOCK_LENGTH 64 X#define RMD160_DIGEST_LENGTH 20 X#define RMD160_DIGEST_STRING_LENGTH (RMD160_DIGEST_LENGTH * 2 + 1) X X/* RMD160 context. */ Xtypedef struct RMD160Context { X UInt32_t state[5]; /* state */ X UInt32_t count[2]; /* number of bits, mod 2^64 */ X UInt8_t buffer[RMD160_BLOCK_LENGTH]; /* input buffer */ X} RMD160_CTX; X Xextern void RMD160Init __PR((RMD160_CTX *)); Xextern void RMD160Transform __PR((UInt32_t [5], X const UInt8_t [RMD160_BLOCK_LENGTH])); Xextern void RMD160Update __PR((RMD160_CTX *, const UInt8_t *, size_t)); Xextern void RMD160Pad __PR((RMD160_CTX *)); Xextern void RMD160Final __PR((UInt8_t [RMD160_DIGEST_LENGTH], X RMD160_CTX *)); Xextern char *RMD160End __PR((RMD160_CTX *, char *)); Xextern char *RMD160File __PR((const char *, char *)); Xextern char *RMD160FileChunk __PR((const char *, char *, off_t, off_t)); Xextern char *RMD160Data __PR((const UInt8_t *, size_t, char *)); X X#ifdef __cplusplus X} X#endif X X#endif /* _SCHILY_RMD160_H */ END-of-star-1.6/include/schily/rmd160.h echo x - star-1.6/include/schily/rmd160.mk sed 's/^X//' >star-1.6/include/schily/rmd160.mk << 'END-of-star-1.6/include/schily/rmd160.mk' X#ident "@(#)rmd160.mk 1.1 09/08/08 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= rmd160.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/rmd160.mk echo x - star-1.6/include/schily/sha2.h sed 's/^X//' >star-1.6/include/schily/sha2.h << 'END-of-star-1.6/include/schily/sha2.h' X/* @(#)sha2.h 1.5 10/08/27 2009-2010 J. Schilling */ X/* X * SHA2 hash code taken from OpenBSD X * X * Portions Copyright (c) 2009-2010 J. Schilling X */ X X/* $OpenBSD: sha2.h,v 1.7 2008/09/06 12:00:19 djm Exp $ */ X X/* X * FILE: sha2.h X * AUTHOR: Aaron D. Gifford X * X * Copyright (c) 2000-2001, Aaron D. Gifford X * All rights reserved. X * X * Redistribution and use in source and binary forms, with or without X * modification, are permitted provided that the following conditions X * are met: X * 1. Redistributions of source code must retain the above copyright X * notice, this list of conditions and the following disclaimer. X * 2. Redistributions in binary form must reproduce the above copyright X * notice, this list of conditions and the following disclaimer in the X * documentation and/or other materials provided with the distribution. X * 3. Neither the name of the copyright holder nor the names of contributors X * may be used to endorse or promote products derived from this software X * without specific prior written permission. X * X * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTOR(S) ``AS IS'' AND X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE X * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTOR(S) BE LIABLE X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF X * SUCH DAMAGE. X * X * $From: sha2.h,v 1.1 2001/11/08 00:02:01 adg Exp adg $ X */ X X#ifndef _SCHILY_SHA2_H X#define _SCHILY_SHA2_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X#include X X X/* ** SHA-256/384/512 Various Length Definitions ********************** */ X#define SHA256_BLOCK_LENGTH 64 X#define SHA256_DIGEST_LENGTH 32 X#define SHA256_DIGEST_STRING_LENGTH (SHA256_DIGEST_LENGTH * 2 + 1) X#ifdef HAVE_LONGLONG X#define SHA384_BLOCK_LENGTH 128 X#define SHA384_DIGEST_LENGTH 48 X#define SHA384_DIGEST_STRING_LENGTH (SHA384_DIGEST_LENGTH * 2 + 1) X#define SHA512_BLOCK_LENGTH 128 X#define _SHA512_BLOCK_LENGTH 128 X#define SHA512_DIGEST_LENGTH 64 X#define SHA512_DIGEST_STRING_LENGTH (SHA512_DIGEST_LENGTH * 2 + 1) X#else X#define _SHA512_BLOCK_LENGTH 128 X#endif X X X/* ** SHA-256/384/512 Context Structure ****************************** */ Xtypedef struct _SHA2_CTX { X union { X UInt32_t st32[8]; X#ifdef HAVE_LONGLONG X UInt64_t st64[8]; X#else X UInt32_t st64[16]; /* Keep original size */ X#endif X } state; X#ifdef HAVE_LONGLONG X UInt64_t bitcount[2]; X#else X UInt32_t bitcount[4]; X#endif X UInt8_t buffer[_SHA512_BLOCK_LENGTH]; X} SHA2_CTX; X X X#ifdef __cplusplus Xextern "C" { X#endif X Xextern void SHA256Init __PR((SHA2_CTX *)); Xextern void SHA256Transform __PR((UInt32_t state[8], X const UInt8_t [SHA256_BLOCK_LENGTH])); Xextern void SHA256Update __PR((SHA2_CTX *, const UInt8_t *, size_t)); Xextern void SHA256Pad __PR((SHA2_CTX *)); Xextern void SHA256Final __PR((UInt8_t [SHA256_DIGEST_LENGTH], X SHA2_CTX *)); Xextern char *SHA256End __PR((SHA2_CTX *, char *)); Xextern char *SHA256File __PR((const char *, char *)); Xextern char *SHA256FileChunk __PR((const char *, char *, off_t, off_t)); Xextern char *SHA256Data __PR((const UInt8_t *, size_t, char *)); X X#ifdef HAVE_LONGLONG Xextern void SHA384Init __PR((SHA2_CTX *)); Xextern void SHA384Transform __PR((UInt64_t state[8], X const UInt8_t [SHA384_BLOCK_LENGTH])); Xextern void SHA384Update __PR((SHA2_CTX *, const UInt8_t *, size_t)); Xextern void SHA384Pad __PR((SHA2_CTX *)); Xextern void SHA384Final __PR((UInt8_t [SHA384_DIGEST_LENGTH], X SHA2_CTX *)); Xextern char *SHA384End __PR((SHA2_CTX *, char *)); Xextern char *SHA384File __PR((const char *, char *)); Xextern char *SHA384FileChunk __PR((const char *, char *, off_t, off_t)); Xextern char *SHA384Data __PR((const UInt8_t *, size_t, char *)); X Xextern void SHA512Init __PR((SHA2_CTX *)); Xextern void SHA512Transform __PR((UInt64_t state[8], X const UInt8_t [SHA512_BLOCK_LENGTH])); Xextern void SHA512Update __PR((SHA2_CTX *, const UInt8_t *, size_t)); Xextern void SHA512Pad __PR((SHA2_CTX *)); Xextern void SHA512Final __PR((UInt8_t [SHA512_DIGEST_LENGTH], X SHA2_CTX *)); Xextern char *SHA512End __PR((SHA2_CTX *, char *)); Xextern char *SHA512File __PR((const char *, char *)); Xextern char *SHA512FileChunk __PR((const char *, char *, off_t, off_t)); Xextern char *SHA512Data __PR((const UInt8_t *, size_t, char *)); X#endif X X#ifdef __cplusplus X} X#endif X X#endif /* _SCHILY_SHA2_H */ END-of-star-1.6/include/schily/sha2.h echo x - star-1.6/include/schily/sha2.mk sed 's/^X//' >star-1.6/include/schily/sha2.mk << 'END-of-star-1.6/include/schily/sha2.mk' X#ident "@(#)sha2.mk 1.1 09/08/09 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= sha2.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/sha2.mk echo x - star-1.6/include/schily/math.h sed 's/^X//' >star-1.6/include/schily/math.h << 'END-of-star-1.6/include/schily/math.h' X/* @(#)math.h 1.1 09/08/26 Copyright 2009 J. Schilling */ X/* X * Abstraction from math.h X * X * Copyright (c) 2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_MATH_H X#define _SCHILY_MATH_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifdef HAVE_MATH_H X#ifndef _INCL_MATH_H X#define _INCL_MATH_H X#include X#endif X#endif X X X#endif /* _SCHILY_MATH_H */ END-of-star-1.6/include/schily/math.h echo x - star-1.6/include/schily/math.mk sed 's/^X//' >star-1.6/include/schily/math.mk << 'END-of-star-1.6/include/schily/math.mk' X#ident "@(#)math.mk 1.1 09/08/26 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= math.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/math.mk echo x - star-1.6/include/schily/dbgmalloc.h sed 's/^X//' >star-1.6/include/schily/dbgmalloc.h << 'END-of-star-1.6/include/schily/dbgmalloc.h' X/* @(#)dbgmalloc.h 1.11 19/04/03 Copyright 2009-2019 J. Schilling */ X/* X * Definitions for libdmalloc X * X * Copyright (c) 2009-2019 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_DBGMALLOC_H X#define _SCHILY_DBGMALLOC_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifdef DBG_MALLOC X#include X#include X X#ifdef __cplusplus Xextern "C" { X#endif X Xextern void *dbg_malloc __PR((size_t size, char *file, X int line)); Xextern void *dbg_calloc __PR((size_t nelem, size_t elsize, X char *file, int line)); Xextern void *dbg_realloc __PR((void *t, size_t size, char *file, X int line)); Xextern void dbg_mark_alloc __PR((void *t, char *file, int line)); X X#define malloc(s) dbg_malloc(s, __FILE__, __LINE__) X#define calloc(n, s) dbg_calloc(n, s, __FILE__, __LINE__) X#define realloc(t, s) dbg_realloc(t, s, __FILE__, __LINE__) X X#define DBG_MALLOC_MARK(a) dbg_mark_alloc((a), __FILE__, __LINE__) X X#ifdef __cplusplus X} X#endif X X#else X#undef DBG_MALLOC_MARK X#define DBG_MALLOC_MARK(a) X#endif /* DBG_MALLOC */ X X#ifdef USE_JS_BOOL /* #define USE_JS_BOOL if there is a */ X#define BOOL JS_BOOL /* different (incompatible) BOOL in */ X#endif /* the using code */ X#include X X#ifdef __cplusplus Xextern "C" { X#endif X X#ifndef FALSE Xextern int acheckdamage __PR((void)); Xextern void freechecking __PR((int val)); Xextern void nomemraising __PR((int val)); X#else Xextern BOOL acheckdamage __PR((void)); Xextern void freechecking __PR((BOOL val)); Xextern void nomemraising __PR((BOOL val)); X#endif X X#if defined(_SCHILY_STDIO_H) && defined(EOF) Xextern void aprintfree __PR((FILE *f)); Xextern void aprintlist __PR((FILE *f, long l)); Xextern void aprintchunk __PR((FILE *f, long l)); X#else Xextern void aprintfree __PR((void *f)); Xextern void aprintlist __PR((void *f, long l)); Xextern void aprintchunk __PR((void *f, long l)); X#endif X Xextern size_t apsize __PR((char *t)); Xextern void *get_heapbeg __PR((void)); Xextern void *get_heapend __PR((void)); X X#ifdef USE_JS_BOOL /* If in workaround mode, */ X#undef BOOL /* revert to default BOOL */ X#endif X X#ifdef __cplusplus X} X#endif X X#endif /* _SCHILY_DBGMALLOC_H */ END-of-star-1.6/include/schily/dbgmalloc.h echo x - star-1.6/include/schily/dbgmalloc.mk sed 's/^X//' >star-1.6/include/schily/dbgmalloc.mk << 'END-of-star-1.6/include/schily/dbgmalloc.mk' X#ident "@(#)dbgmalloc.mk 1.1 09/10/16 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= dbgmalloc.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/dbgmalloc.mk echo x - star-1.6/include/schily/libgen.h sed 's/^X//' >star-1.6/include/schily/libgen.h << 'END-of-star-1.6/include/schily/libgen.h' X/* @(#)libgen.h 1.2 10/05/07 Copyright 2010 J. Schilling */ X/* X * Abstraction from libgen.h X * X * Copyright (c) 2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_LIBGEN_H X#define _SCHILY_LIBGEN_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifdef HAVE_LIBGEN_H X#ifndef _INCL_LIBGEN_H X#define _INCL_LIBGEN_H X#include X#endif X#endif X X#ifdef __cplusplus Xextern "C" { X#endif X X/* X * See also libport.h X */ X#ifndef HAVE_BASENAME Xextern char *basename __PR((char *name)); X#endif X#ifndef HAVE_DIRNAME Xextern char *dirname __PR((char *name)); X#endif X X#ifdef __cplusplus X} X#endif X X#endif /* _SCHILY_LIBGEN_H */ END-of-star-1.6/include/schily/libgen.h echo x - star-1.6/include/schily/libgen.mk sed 's/^X//' >star-1.6/include/schily/libgen.mk << 'END-of-star-1.6/include/schily/libgen.mk' X#ident "@(#)libgen.mk 1.1 10/04/28 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= libgen.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/libgen.mk echo x - star-1.6/include/schily/_regex.h sed 's/^X//' >star-1.6/include/schily/_regex.h << 'END-of-star-1.6/include/schily/_regex.h' X/* @(#)_regex.h 1.6 10/08/27 2010 J. Schilling */ X/* X * regex.h code taken from FreeBSD X * X * Portions Copyright (c) 2010 J. Schilling X */ X/* X * Copyright (c) 1992 Henry Spencer. X * Copyright (c) 1992, 1993 X * The Regents of the University of California. All rights reserved. X * X * This code is derived from software contributed to Berkeley by X * Henry Spencer of the University of Toronto. X * X * Redistribution and use in source and binary forms, with or without X * modification, are permitted provided that the following conditions X * are met: X * 1. Redistributions of source code must retain the above copyright X * notice, this list of conditions and the following disclaimer. X * 2. Redistributions in binary form must reproduce the above copyright X * notice, this list of conditions and the following disclaimer in the X * documentation and/or other materials provided with the distribution. X * 3. Neither the name of the University nor the names of its contributors X * may be used to endorse or promote products derived from this software X * without specific prior written permission. X * X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE X * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF X * SUCH DAMAGE. X * X * @(#)regex.h 8.2 (Berkeley) 1/3/94 X * $FreeBSD: src/include/regex.h,v 1.12 2010/02/16 19:39:50 imp Exp $ X */ X X#ifndef _SCHILY__REGEX_H X#define _SCHILY__REGEX_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifndef _SCHILY_TYPES_H X#include X#endif X X#ifdef __cplusplus Xextern "C" { X#endif X X#define __restrict X X/* types */ Xtypedef ssize_t regoff_t; X Xtypedef struct { X int re_magic; X size_t re_nsub; /* number of parenthesized subexpressions */ X const char *re_endp; /* end pointer for REG_PEND */ X struct re_guts *re_g; /* none of your business :-) */ X} regex_t; X Xtypedef struct { X regoff_t rm_so; /* start of match */ X regoff_t rm_eo; /* end of match */ X} regmatch_t; X X/* regcomp() flags */ X#define REG_BASIC 0000 X#define REG_EXTENDED 0001 X#define REG_ICASE 0002 X#define REG_NOSUB 0004 X#define REG_NEWLINE 0010 X#define REG_NOSPEC 0020 X#define REG_PEND 0040 X#define REG_DUMP 0200 X X/* regerror() flags */ X#define REG_ENOSYS (-1) X#define REG_NOMATCH 1 X#define REG_BADPAT 2 X#define REG_ECOLLATE 3 X#define REG_ECTYPE 4 X#define REG_EESCAPE 5 X#define REG_ESUBREG 6 X#define REG_EBRACK 7 X#define REG_EPAREN 8 X#define REG_EBRACE 9 X#define REG_BADBR 10 X#define REG_ERANGE 11 X#define REG_ESPACE 12 X#define REG_BADRPT 13 X#define REG_EMPTY 14 X#define REG_ASSERT 15 X#define REG_INVARG 16 X#define REG_ILLSEQ 17 X#define REG_ATOI 255 /* convert name to number (!) */ X#define REG_ITOA 0400 /* convert number to name (!) */ X X/* regexec() flags */ X#define REG_NOTBOL 00001 X#define REG_NOTEOL 00002 X#define REG_STARTEND 00004 X#define REG_TRACE 00400 /* tracing of execution */ X#define REG_LARGE 01000 /* force large representation */ X#define REG_BACKR 02000 /* force use of backref code */ X Xextern int regcomp __PR((regex_t *__restrict, const char *__restrict, X int)); Xextern size_t regerror __PR((int, const regex_t *__restrict, char *__restrict, X size_t)); X/* X * XXX forth parameter should be `regmatch_t [__restrict]', but isn't because X * of a bug in GCC 3.2 (when -std=c99 is specified) which perceives this as a X * syntax error. X */ Xextern int regexec __PR((const regex_t *__restrict, const char *__restrict, X size_t, X regmatch_t *__restrict, int)); Xextern void regfree __PR((regex_t *)); X X#undef __restrict X X#ifdef __cplusplus X} X#endif X X#endif /* _SCHILY__REGEX_H */ END-of-star-1.6/include/schily/_regex.h echo x - star-1.6/include/schily/_regex.mk sed 's/^X//' >star-1.6/include/schily/_regex.mk << 'END-of-star-1.6/include/schily/_regex.mk' X#ident "@(#)_regex.mk 1.1 10/05/07 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= _regex.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/_regex.mk echo x - star-1.6/include/schily/regex.h sed 's/^X//' >star-1.6/include/schily/regex.h << 'END-of-star-1.6/include/schily/regex.h' X/* @(#)regex.h 1.1 10/05/07 Copyright 2010 J. Schilling */ X/* X * Abstraction from regex.h X * X * Copyright (c) 2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_REGEX_H X#define _SCHILY_REGEX_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifdef HAVE_REGEX_Ha X#ifndef _INCL_REGEX_H X#define _INCL_REGEX_H X#include X#endif X#else X#include X#endif X X X#endif /* _SCHILY_REGEX_H */ END-of-star-1.6/include/schily/regex.h echo x - star-1.6/include/schily/regex.mk sed 's/^X//' >star-1.6/include/schily/regex.mk << 'END-of-star-1.6/include/schily/regex.mk' X#ident "@(#)regex.mk 1.1 10/05/07 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= regex.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/regex.mk echo x - star-1.6/include/schily/windows.h sed 's/^X//' >star-1.6/include/schily/windows.h << 'END-of-star-1.6/include/schily/windows.h' X/* @(#)windows.h 1.4 13/10/26 Copyright 2011-2013 J. Schilling */ X/* X * Definitions for windows.h X * X * Copyright (c) 2011-2013 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_WINDOWS_H X#define _SCHILY_WINDOWS_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifdef HAVE_WINDOWS_H X#ifndef _INCL_WINDOWS_H X X/* X * configure believes they are missing and #define's them: X */ X#if defined(_MSC_VER) || defined(__MINGW32__) X/* BEGIN CSTYLED */ X#undef u_char X#undef u_short X#undef u_int X#undef u_long X/* END CSTYLED */ X#endif X X#if defined(__CYGWIN32__) || defined(__CYGWIN__) X X/* X * Cygwin-1.7.17 (Autumn 2012) makes life hard as it prevents to rename X * the Cygwin BOOL definition. Note that we have our own BOOL definition X * in schily/standard.h that exists since 1982 which happened before Microsoft X * introduced their BOOL. X * X * Previous Cygwin versions have been compatible to the original MS include X * files and allowed to rename the BOOL from windows.h (windef.h) by just using X * #define BOOL WBOOL before #include . X * X * Recent Cygwin version are unfriendly to us and prevent this. X * We now need a two level #define to redirect the BOOL from windows.h to the X * Cygwin specific WINBOOL typedef. X * X * If we do not include schily/standard.h with newer Cygwin, we cannot get X * working typedefs for "PBOOL" and "LPBOOL". X */ X#include /* Get our BOOL typedef */ X X#define _NO_BOOL_TYPEDEF /* Avoid 2nd BOOL typedef on Cygwin-1.7.17 */ X X#define WBOOL WINBOOL /* Cygwin-1.7.17 prevents to avoid BOOL */ X#endif /* defined(__CYGWIN32__) || defined(__CYGWIN__) */ X X X#define BOOL WBOOL /* This is the Win BOOL */ X#define format __ms_format /* Avoid format parameter hides global ... */ X X#ifdef timerclear /* struct timeval has already been declared */ X#define timeval __ms_timeval X#endif X X#include X X#undef BOOL /* MS Code uses WBOOL or #define BOOL WBOOL */ X#undef format /* Return to previous definition */ X#undef timeval X X#define _INCL_WINDOWS_H X#endif X X#endif /* HAVE_WINDOWS_H */ X X#endif /* _SCHILY_WINDOWS_H */ END-of-star-1.6/include/schily/windows.h echo x - star-1.6/include/schily/windows.mk sed 's/^X//' >star-1.6/include/schily/windows.mk << 'END-of-star-1.6/include/schily/windows.mk' X#ident "@(#)windows.mk 1.1 11/08/02 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= windows.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/windows.mk echo x - star-1.6/include/schily/stdint.h sed 's/^X//' >star-1.6/include/schily/stdint.h << 'END-of-star-1.6/include/schily/stdint.h' X/* @(#)stdint.h 1.41 19/02/28 Copyright 1997-2019 J. Schilling */ X/* X * Abstraction from stdint.h X * X * Copyright (c) 1997-2019 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_STDINT_H X#define _SCHILY_STDINT_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X/* X * Let us include system defined types too. X */ X#ifndef _SCHILY_TYPES_H X#include X#endif X X/* X * For definitions of TYPE_MINVAL() ... X */ X#ifndef _SCHILY_TYPE_VAL_H X#include X#endif X X/* X * MSVC has size_t in stddef.h X */ X#ifdef HAVE_STDDEF_H X#ifndef _INCL_STDDEF_H X#include X#define _INCL_STDDEF_H X#endif X#endif X X/* X * CHAR_IS_UNSIGNED is needed to define int8_t X */ X#ifdef __CHAR_UNSIGNED__ /* GNU GCC define (dynamic) */ X#ifndef CHAR_IS_UNSIGNED X#define CHAR_IS_UNSIGNED /* Sing Schily define (static) */ X#endif X#endif X X/* X * limits.h on Solaris is broken and always #defines _CHAR_IS_SIGNED X * SunPro c #defines _CHAR_IS_UNSIGNED in case it was called with -xchar=u X * X * Note that this still does not fix the values for CHAR_MIN and CHAR_MAX X * retrived from limits.h since these constants are #defined in an #ifdef X * that is evaluated before we fix _CHAR_IS_SIGNED / _CHAR_IS_UNSIGNED. X */ X#if defined(CHAR_IS_UNSIGNED) || defined(_CHAR_IS_UNSIGNED) X#ifdef _CHAR_IS_SIGNED X#define __BAD_CHAR_SIGNED__ X#undef _CHAR_IS_SIGNED X#endif X#ifndef _CHAR_IS_UNSIGNED X#define _CHAR_IS_UNSIGNED X#endif X#endif X X/* X * This is a definition for a compiler dependant 64 bit type. X * There is currently a silently fallback to a long if the compiler does not X * support it. Check if this is the right way. X * X * Be very careful here as MSVC does not implement long long but rather __int64 X * and once someone makes 'long long' 128 bits on a 64 bit machine, we need to X * check for a MSVC __int128 type. X */ X#ifndef NO_LONGLONG X# if !defined(USE_LONGLONG) && defined(HAVE_LONGLONG) X# define USE_LONGLONG X# endif X# if !defined(USE_LONGLONG) && defined(HAVE___INT64) X# define USE_LONGLONG X# endif X#endif X X#ifdef USE_LONGLONG X X# if defined(HAVE___INT64) X Xtypedef __int64 Llong; Xtypedef unsigned __int64 Ullong; /* We should avoid this */ Xtypedef unsigned __int64 ULlong; X X#define SIZEOF_LLONG SIZEOF___INT64 X#define SIZEOF_ULLONG SIZEOF_UNSIGNED___INT64 X X# else /* We must have HAVE_LONG_LONG */ X Xtypedef long long Llong; Xtypedef unsigned long long Ullong; /* We should avoid this */ Xtypedef unsigned long long ULlong; X X#define SIZEOF_LLONG SIZEOF_LONG_LONG X#define SIZEOF_ULLONG SIZEOF_UNSIGNED_LONG_LONG X X# endif /* HAVE___INT64 / HAVE_LONG_LONG */ X X#else /* !USE_LONGLONG */ X Xtypedef long Llong; Xtypedef unsigned long Ullong; /* We should avoid this */ Xtypedef unsigned long ULlong; X X#define SIZEOF_LLONG SIZEOF_LONG X#define SIZEOF_ULLONG SIZEOF_UNSIGNED_LONG X X#endif /* USE_LONGLONG */ X X#ifndef LLONG_MIN X#define LLONG_MIN TYPE_MINVAL(Llong) X#endif X#ifndef LLONG_MAX X#define LLONG_MAX TYPE_MAXVAL(Llong) X#endif X#ifndef ULLONG_MAX X#define ULLONG_MAX TYPE_MAXVAL(Ullong) X#endif X X/* X * Start inttypes.h emulation. X * X * Thanks to Solaris 2.4 and even recent 1999 Linux versions, we X * cannot use the official UNIX-98 names here. Old Solaris versions X * define parts of the types in some exotic include files. X * Linux even defines incompatible types in . X */ X X#if defined(HAVE_INTTYPES_H) || defined(HAVE_STDINT_H) X#if defined(HAVE_INTTYPES_H) X# ifndef _INCL_INTTYPES_H X# include X# define _INCL_INTTYPES_H X# endif X#else X#if defined(HAVE_STDINT_H) X# ifndef _INCL_STDINT_H X# include X# define _INCL_STDINT_H X# endif X#endif X#endif X X#ifdef __cplusplus Xextern "C" { X#endif X X/* X * On VMS on VAX, these types are present but non-scalar. X * Thus we may not be able to use them X */ X#ifdef HAVE_LONGLONG X# define HAVE_INT64_T X# define HAVE_UINT64_T X#endif X X#define Int8_t int8_t X#define Int16_t int16_t X#define Int32_t int32_t X#ifdef HAVE_LONGLONG X#define Int64_t int64_t X#endif X#define Intmax_t intmax_t X#define UInt8_t uint8_t X#define UInt16_t uint16_t X#define UInt32_t uint32_t X#ifdef HAVE_LONGLONG X#define UInt64_t uint64_t X#endif X#define UIntmax_t uintmax_t X X#define Intptr_t intptr_t X#define UIntptr_t uintptr_t X X/* X * If we only have a UNIX-98 inttypes.h but no SUSv3 X * X * Beware not to use int64_t / uint64_t as VMS on a VAX defines X * them as non-scalar (structure) based types. X */ X#ifndef HAVE_TYPE_INTMAX_T X#define intmax_t Llong X#endif X#ifndef HAVE_TYPE_UINTMAX_T X#define uintmax_t ULlong X#endif X X#ifdef __cplusplus X} X#endif X X#else /* !HAVE_INTTYPES_H */ X X#ifdef __cplusplus Xextern "C" { X#endif X X#if SIZEOF_CHAR != 1 || SIZEOF_UNSIGNED_CHAR != 1 X/* X * #error will not work for all compilers (e.g. sunos4) X * The following line will abort compilation on all compilers X * if the above is true. And that's what we want. X */ Xerror Sizeof char is not equal 1 X X#include /* Avoid "unknown directive" with K&R */ X#endif X X#if defined(__STDC__) || defined(CHAR_IS_UNSIGNED) X typedef signed char Int8_t; X#else X typedef char Int8_t; X#endif X X#if SIZEOF_SHORT_INT == 2 X typedef short Int16_t; X#else X error No int16_t found X X#include /* Avoid "unknown directive" with K&R */ X#endif X X#if SIZEOF_INT == 4 X#if defined(_MSC_VER) && SIZEOF_LONG_INT == 4 X typedef long Int32_t; X#else X typedef int Int32_t; X#endif X#else X error No int32_t found X X#include /* Avoid "unknown directive" with K&R */ X#endif X X#if SIZEOF_LONG_INT == 8 X typedef long Int64_t; X# define HAVE_INT64_T X#else X#if SIZEOF_LONG_LONG == 8 X typedef long long Int64_t; X# define HAVE_INT64_T X#else X#if SIZEOF___INT64 == 8 X typedef __int64 Int64_t; X# define HAVE_INT64_T X#else X/* X * Tolerate platforms without 64-Bit support. X */ X/* error No int64_t found */ X#endif X#endif X#endif X X#if SIZEOF_CHAR_P == SIZEOF_INT X typedef int Intptr_t; X#else X#if SIZEOF_CHAR_P == SIZEOF_LONG_INT X typedef long Intptr_t; X#else X#if SIZEOF_CHAR_P == SIZEOF_LLONG X typedef Llong Intptr_t; X#else X error No intptr_t found X X#include /* Avoid "unknown directive" with K&R */ X#endif X#endif X#endif X Xtypedef unsigned char UInt8_t; X X#if SIZEOF_UNSIGNED_SHORT_INT == 2 X typedef unsigned short UInt16_t; X#else X error No uint16_t found X X#include /* Avoid "unknown directive" with K&R */ X#endif X X#if SIZEOF_UNSIGNED_INT == 4 X#if defined(_MSC_VER) && SIZEOF_UNSIGNED_LONG_INT == 4 X typedef unsigned long UInt32_t; X#else X typedef unsigned int UInt32_t; X#endif X#else X error No int32_t found X X#include /* Avoid "unknown directive" with K&R */ X#endif X X#if SIZEOF_UNSIGNED_LONG_INT == 8 X typedef unsigned long UInt64_t; X# define HAVE_UINT64_T X#else X#if SIZEOF_UNSIGNED_LONG_LONG == 8 X typedef unsigned long long UInt64_t; X# define HAVE_UINT64_T X#else X#if SIZEOF_UNSIGNED___INT64 == 8 X typedef unsigned __int64 UInt64_t; X# define HAVE_UINT64_T X#else X/* X * Tolerate platforms without 64-Bit support. X */ X/* error No uint64_t found */ X#endif X#endif X#endif X X#define Intmax_t Llong X#define UIntmax_t Ullong X X#if SIZEOF_CHAR_P == SIZEOF_UNSIGNED_INT X typedef unsigned int UIntptr_t; X#else X#if SIZEOF_CHAR_P == SIZEOF_UNSIGNED_LONG_INT X typedef unsigned long UIntptr_t; X#else X#if SIZEOF_CHAR_P == SIZEOF_ULLONG X typedef ULlong UIntptr_t; X#else X error No uintptr_t found X X#include /* Avoid "unknown directive" with K&R */ X#endif X#endif X#endif X X#ifdef _MSC_VER X/* X * All recent platforms define the POSIX/C-99 compliant types from inttypes.h X * except Microsoft. With these #defines, we may also use official types on a X * Microsoft environment. X * X * Warning: Linux-2.2 and before do not have inttypes.h and define some of the X * types in an incmpatible way. X */ X#undef int8_t X#define int8_t Int8_t X#undef int16_t X#define int16_t Int16_t X#undef int32_t X#define int32_t Int32_t X#undef int64_t X#define int64_t Int64_t X#undef intmax_t X#define intmax_t Intmax_t X#undef uint8_t X#define uint8_t UInt8_t X#undef uint16_t X#define uint16_t UInt16_t X#undef uint32_t X#define uint32_t UInt32_t X#undef uint64_t X#define uint64_t UInt64_t X#undef uintmax_t X#define uintmax_t UIntmax_t X X#undef intptr_t X#define intptr_t Intptr_t X#undef uintptr_t X#define uintptr_t UIntptr_t X#endif /* _MSC_VER */ X X#ifdef __cplusplus X} X#endif X X#endif /* HAVE_INTTYPES_H */ X X#ifndef INT8_MIN X#define INT8_MIN TYPE_MINVAL(Int8_t) X#endif X#ifndef INT8_MAX X#define INT8_MAX TYPE_MAXVAL(Int8_t) X#endif X#ifndef UINT8_MAX X#define UINT8_MAX TYPE_MAXVAL(UInt8_t) X#endif X X#ifndef INT16_MIN X#define INT16_MIN TYPE_MINVAL(Int16_t) X#endif X#ifndef INT16_MAX X#define INT16_MAX TYPE_MAXVAL(Int16_t) X#endif X#ifndef UINT16_MAX X#define UINT16_MAX TYPE_MAXVAL(UInt16_t) X#endif X X#ifndef INT32_MIN X#define INT32_MIN TYPE_MINVAL(Int32_t) X#endif X#ifndef INT32_MAX X#define INT32_MAX TYPE_MAXVAL(Int32_t) X#endif X#ifndef UINT32_MAX X#define UINT32_MAX TYPE_MAXVAL(UInt32_t) X#endif X X#ifdef HAVE_INT64_T X#ifndef INT64_MIN X#define INT64_MIN TYPE_MINVAL(Int64_t) X#endif X#ifndef INT64_MAX X#define INT64_MAX TYPE_MAXVAL(Int64_t) X#endif X#endif X#ifdef HAVE_UINT64_T X#ifndef UINT64_MAX X#define UINT64_MAX TYPE_MAXVAL(UInt64_t) X#endif X#endif X X#ifndef INTMAX_MIN X#define INTMAX_MIN TYPE_MINVAL(Intmax_t) X#endif X#ifndef INTMAX_MAX X#define INTMAX_MAX TYPE_MAXVAL(Intmax_t) X#endif X#ifndef UINTMAX_MAX X#define UINTMAX_MAX TYPE_MAXVAL(UIntmax_t) X#endif X X#define SIZE_T_MIN TYPE_MINVAL(size_t) X#ifdef SIZE_T_MAX X#undef SIZE_T_MAX /* FreeBSD has a similar #define */ X#endif X#define SIZE_T_MAX TYPE_MAXVAL(size_t) X X#define SSIZE_T_MIN TYPE_MINVAL(ssize_t) X#define SSIZE_T_MAX TYPE_MAXVAL(ssize_t) X X#endif /* _SCHILY_STDINT_H */ END-of-star-1.6/include/schily/stdint.h echo x - star-1.6/include/schily/stdint.mk sed 's/^X//' >star-1.6/include/schily/stdint.mk << 'END-of-star-1.6/include/schily/stdint.mk' X#ident "@(#)stdint.mk 1.1 12/01/22 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= stdint.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/stdint.mk echo x - star-1.6/include/schily/inttypes.h sed 's/^X//' >star-1.6/include/schily/inttypes.h << 'END-of-star-1.6/include/schily/inttypes.h' X/* @(#)inttypes.h 1.35 12/01/22 Copyright 1997-2012 J. Schilling */ X/* X * Abstraction from inttypes.h X * X * Copyright (c) 1997-2012 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_INTTYPES_H X#define _SCHILY_INTTYPES_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X/* X * inttypes.h is based on stdint.h X */ X#ifndef _SCHILY_STDINT_H X#include X#endif X X/* X * inttypes.h inaddition to stdint.h defines printf() format strings. X * As we have a portable printf() in libschily, we do not need these #defines. X */ X X#endif /* _SCHILY_INTTYPES_H */ END-of-star-1.6/include/schily/inttypes.h echo x - star-1.6/include/schily/inttypes.mk sed 's/^X//' >star-1.6/include/schily/inttypes.mk << 'END-of-star-1.6/include/schily/inttypes.mk' X#ident "@(#)inttypes.mk 1.1 12/01/22 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= inttypes.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/inttypes.mk echo x - star-1.6/include/schily/err_arch.h sed 's/^X//' >star-1.6/include/schily/err_arch.h << 'END-of-star-1.6/include/schily/err_arch.h' X/* @(#)err_arch.h 1.1 12/12/03 Copyright 2012 J. Schilling */ X/* X * #error include for unconfigured architecture X * X * Copyright (c) 2012 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_ERR_ARCH_H X#define _SCHILY_ERR_ARCH_H X X#error unconfigured architecture X X#endif /* _SCHILY_ERR_ARCH_H */ END-of-star-1.6/include/schily/err_arch.h echo x - star-1.6/include/schily/err_arch.mk sed 's/^X//' >star-1.6/include/schily/err_arch.mk << 'END-of-star-1.6/include/schily/err_arch.mk' X#ident "@(#)err_arch.mk 1.1 12/12/03 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= err_arch.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/err_arch.mk echo x - star-1.6/include/schily/err_bit.h sed 's/^X//' >star-1.6/include/schily/err_bit.h << 'END-of-star-1.6/include/schily/err_bit.h' X/* @(#)err_bit.h 1.1 12/12/03 Copyright 2012 J. Schilling */ X/* X * #error include for _BIT_FIELDS_LTOH / _BIT_FIELDS_HTOL X * X * Copyright (c) 2012 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_ERR_BIT_H X#define _SCHILY_ERR_BIT_H X X#error Only one of _BIT_FIELDS_LTOH or _BIT_FIELDS_HTOL may be defined X X#endif /* _SCHILY_ERR_BIT_H */ END-of-star-1.6/include/schily/err_bit.h echo x - star-1.6/include/schily/err_bit.mk sed 's/^X//' >star-1.6/include/schily/err_bit.mk << 'END-of-star-1.6/include/schily/err_bit.mk' X#ident "@(#)err_bit.mk 1.1 12/12/03 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= err_bit.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/err_bit.mk echo x - star-1.6/include/schily/timeb.h sed 's/^X//' >star-1.6/include/schily/timeb.h << 'END-of-star-1.6/include/schily/timeb.h' X/* @(#)timeb.h 1.1 13/04/30 Copyright 2013 J. Schilling */ X/* X * ftime abstraction X * X * Copyright (c) 2013 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_TIMEB_H X#define _SCHILY_TIMEB_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X#ifndef _SCHILY_TYPES_H X#include X#endif X#ifndef _SCHILY_TIME_H X#include X#endif X X#ifdef HAVE_FTIME X#ifndef _INCL_SYS_TIMEB_H X#include X#define _INCL_SYS_TIMEB_H X#endif X#endif X X#endif /* _SCHILY_TIMEB_H */ END-of-star-1.6/include/schily/timeb.h echo x - star-1.6/include/schily/poll.h sed 's/^X//' >star-1.6/include/schily/poll.h << 'END-of-star-1.6/include/schily/poll.h' X/* @(#)poll.h 1.1 13/04/29 Copyright 2013 J. Schilling */ X/* X * Poll abstraction X * X * Copyright (c) 2013 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_POLL_H X#define _SCHILY_POLL_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X#ifndef _SCHILY_TYPES_H X#include X#endif X#ifndef _SCHILY_TIME_H X#include X#endif X X#ifdef HAVE_POLL X#ifndef _INCL_POLL_H X#include X#define _INCL_POLL_H X#endif X#else X#ifndef _SCHILY_SELECT_H X#include X#endif X#endif X X#endif /* _SCHILY_POLL_H */ END-of-star-1.6/include/schily/poll.h echo x - star-1.6/include/schily/err_char.h sed 's/^X//' >star-1.6/include/schily/err_char.h << 'END-of-star-1.6/include/schily/err_char.h' X/* @(#)err_char.h 1.1 12/12/03 Copyright 2012 J. Schilling */ X/* X * #error include for sizeof (char) error X * X * Copyright (c) 2012 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_ERR_CHAR_H X#define _SCHILY_ERR_CHAR_H X X#error Sizeof char is not equal 1 X X#endif /* _SCHILY_ERR_CHAR_H */ END-of-star-1.6/include/schily/err_char.h echo x - star-1.6/include/schily/err_char.mk sed 's/^X//' >star-1.6/include/schily/err_char.mk << 'END-of-star-1.6/include/schily/err_char.mk' X#ident "@(#)err_char.mk 1.1 12/12/03 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= err_char.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/err_char.mk echo x - star-1.6/include/schily/timeb.mk sed 's/^X//' >star-1.6/include/schily/timeb.mk << 'END-of-star-1.6/include/schily/timeb.mk' X#ident "@(#)timeb.mk 1.1 13/04/30 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= timeb.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/timeb.mk echo x - star-1.6/include/schily/stdarg.h sed 's/^X//' >star-1.6/include/schily/stdarg.h << 'END-of-star-1.6/include/schily/stdarg.h' X/* @(#)stdarg.h 1.1 13/04/30 Copyright 2013 J. Schilling */ X/* X * Generic header for users of stdarg.h ... X * X * Copyright (c) 2013 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_STDARG_H X#define _SCHILY_STDARG_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifndef _SCHILY_VARARGS_H X#include X#endif X X#endif /* _SCHILY_STDARG_H */ END-of-star-1.6/include/schily/stdarg.h echo x - star-1.6/include/schily/stdarg.mk sed 's/^X//' >star-1.6/include/schily/stdarg.mk << 'END-of-star-1.6/include/schily/stdarg.mk' X#ident "@(#)stdarg.mk 1.1 13/04/30 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= stdarg.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/stdarg.mk echo x - star-1.6/include/schily/poll.mk sed 's/^X//' >star-1.6/include/schily/poll.mk << 'END-of-star-1.6/include/schily/poll.mk' X#ident "@(#)poll.mk 1.1 13/04/29 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= poll.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/poll.mk echo x - star-1.6/include/schily/sunos4_proto.h sed 's/^X//' >star-1.6/include/schily/sunos4_proto.h << 'END-of-star-1.6/include/schily/sunos4_proto.h' X/* @(#)sunos4_proto.h 1.3 13/09/14 Copyright 2013 J. Schilling */ X/* X * Prototypes for POSIX standard functions that are missing on SunOS-4.x. X * X * Copyright (c) 2013 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X X#ifndef _SCHILY_SUNOS4_PROTO_H X#define _SCHILY_SUNOS4_PROTO_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifdef __cplusplus Xextern "C" { X#endif X X/* X * ctype.h X */ X#if defined(_SCHILY_CTYPE_H) || defined(_SCHILY_WCTYPE_H) Xextern int tolower __PR((int __c)); Xextern int toupper __PR((int __c)); X#endif X X/* X * pwd.h X */ X#ifdef _SCHILY_PWD_H Xextern void endpwent __PR((void)); X#endif X X/* X * poll.h X */ X/*#ifdef _sys_poll_h*/ X#ifdef _SCHILY_POLL_H Xextern int poll __PR((struct pollfd __fds[], unsigned long __nfds, int __timeout)); X#endif X X/* X * schily/hostname.h X */ X#ifdef _SCHILY_HOSTNAME_H Xextern int gethostname __PR((char *name, int namelen)); Xextern int getdomainname __PR((char *name, int namelen)); X#endif X X/* X * signal.h X */ X#ifdef _SCHILY_SIGNAL_H Xextern int killpg __PR((pid_t __pgrp, int __sig)); Xextern int sigvec __PR((int __sig, struct sigvec *__nvec, struct sigvec *__ovec)); X#endif X X/* X * stdio.h X */ X#ifdef _INCL_STDIO_H Xextern int fclose __PR((FILE *__stream)); X/* X * XXX libshedit contains #define fflush(a) (0) that would cause a syntax error X * XXX on a K&R compiler. X */ X#ifndef fflush Xextern int fflush __PR((FILE *__stream)); X#endif Xextern int fgetc __PR((FILE *__stream)); Xextern int _filbuf __PR((FILE *__stream)); Xextern int _flsbuf __PR((int __c, FILE *__stream)); Xextern int fputc __PR((int __c, FILE *__stream)); Xextern int fputs __PR((const char *__s, FILE *__stream)); Xextern int fprintf __PR((FILE *__stream, const char * __format, ...)); Xextern size_t fread __PR((void *__ptr, size_t __size, size_t __nitems, FILE *__stream)); Xextern int fseek __PR((FILE *__stream, long __offset, int __whence)); Xextern size_t fwrite __PR((void *__ptr, size_t __size, size_t __nitems, FILE *__stream)); Xextern int pclose __PR((FILE *__stream)); Xextern void rewind __PR((FILE *__stream)); Xextern void setbuf __PR((FILE *__stream, char *__buf)); Xextern int setvbuf __PR((FILE *__stream, char *__buf, int __type, size_t __size)); Xextern int scanf __PR((const char * __format, ...)); Xextern int sscanf __PR((const char * __s, const char * __format, ...)); Xextern int ungetc __PR((int __c, FILE *__stream)); X#ifdef _SCHILY_VARARGS_H Xextern int vfprintf __PR((FILE *__stream, const char *__format, va_list __ap)); X#endif Xextern void perror __PR((const char *__s)); Xextern int printf __PR((const char * __format, ...)); X X/* Kommt von libschily */ X/*PRINTFLIKE3*/ Xextern int snprintf __PR((char * __s, size_t __n, X const char * __format, /* args*/ ...)) X __printflike__(3, 4); X#endif X X/* X * stdlib.h X */ X#ifdef _INCL_STDLIB_H X/* X * XXX cdda2wav includes a #define atexit(f) on_exit(f, 0) that X * XXX would cause syntax errors with the next prototype on a K&R compiler. X */ X#ifndef atexit Xextern int atexit __PR((void (*__func)(void))); X#endif Xextern int on_exit __PR((void (*__procp)(void), caddr_t __arg)); Xextern char * ecvt __PR((double __value, int __ndigit, int * __decpt, int * __sign)); X/* X * XXX Sun has extern int free(), but GCC has extern void free() in stdlib.h X */ X/*extern void free __PR((void *__ptr));*/ Xextern char * fcvt __PR((double __value, int __ndigit, int * __decpt, int * __sign)); Xextern char * gcvt __PR((double __value, int __ndigit, char * __buf)); Xextern int mkstemp __PR((char *__template)); Xextern char * mktemp __PR((char *__template)); Xextern int putenv __PR((char *__string)); Xextern long strtol __PR((const char * __str, char ** __endptr, int __base)); Xextern int system __PR((const char *_string)); Xextern void * valloc __PR((size_t __size)); X#endif X X/* X * string.h X */ X#ifdef _SCHILY_STRING_H Xextern void * memchr __PR((const void *__s, int __c, size_t __n)); Xextern int strcoll __PR((const char *__s1, const char *__s2)); Xextern int strncasecmp __PR((const char *__s1, const char *__s2, size_t __n)); X X/* X * strings.h X */ Xextern void bcopy __PR((const void *__s1, void *__s2, size_t __n)); Xextern void bzero __PR((void *__s, size_t __n)); X#endif X X/* X * sys/file.h X */ X#ifdef _SCHILY_FCNTL_H Xextern int flock __PR((int __fd, int __operation)); X#endif X X/* X * sys/mman.h X */ X#ifdef _SCHILY_MMAN_H Xextern int mlock __PR((caddr_t __addr, size_t __len)); Xextern int mlockall __PR((int __flags)); X#endif X X/* X * sys/resource.h X */ X#ifdef _SCHILY_RESOURCE_H Xextern int getrlimit __PR((int __resource, struct rlimit *__rlp)); Xextern int setrlimit __PR((int __resource, const struct rlimit *__rlp)); Xextern int getrusage __PR((int __who, struct rusage *__r_usage)); Xextern int getpriority __PR((int __which, int __who)); Xextern int setpriority __PR((int _which, int __who, int __value)); X Xextern pid_t wait3 __PR((int *__statusp, int __options, struct rusage *__rusage)); X#endif X X/* X * sys/shm.h X */ X#ifdef _SCHILY_SHM_H Xextern void * shmat __PR((int __shmid, const void *__shmaddr, int __shmflg)); Xextern int shmctl __PR((int __shmid, int __cmd, struct shmid_ds *__buf)); Xextern int shmget __PR((key_t __key, size_t __size, int __shmflg)); X#endif X X/* X * sys/socket.h X */ X#ifdef _SCHILY_SOCKET_H Xextern int connect __PR((int __s, const struct sockaddr *__name, int __namelen)); Xextern int socket __PR((int __domain, int __type, int __protocol)); Xextern int getsockopt __PR((int __s, int __level, int __optname, void *__optval, X int *__optlen)); Xextern int setsockopt __PR((int __s, int __level, int __optname, const void *__optval, X int __optlen)); Xextern int getpeername __PR((int __s, struct sockaddr *__name, socklen_t *__namelen)); Xextern int socketpair __PR((int __domain, int __type, int __protocol, int __sv[2])); X#endif X X/* X * sys/stat.h X */ X#ifdef _INCL_SYS_STAT_H Xextern int stat __PR((const char * __path, struct stat * __buf)); Xextern int lstat __PR((const char * __path, struct stat * __buf)); Xextern int fchmod __PR((int __fildes, mode_t __mode)); Xextern int fstat __PR((int __filedes, struct stat * __buf)); Xextern int mknod __PR((const char *__path, mode_t __mode, dev_t __dev)); X#endif X X/* X * sys/time.h X */ X#ifdef _INCL_SYS_TIME_H Xextern int gettimeofday __PR((struct timeval *__tp, void *__tzp)); Xextern int settimeofday __PR((struct timeval *__tp, void *__tzp)); Xextern int utimes __PR((const char *__path, const struct timeval __times[2])); Xextern int select __PR((int __nfds, fd_set * __readfds, fd_set * __writefds, X fd_set * __errorfds, X struct timeval * __timeout)); X X#endif X X/* X * sys/timeb.h X */ X#ifdef _sys_timeb_h Xextern int ftime __PR((struct timeb *__tp)); X#endif X X/* X * time.h X */ X#ifdef _SCHILY_TIME_H Xextern clock_t clock __PR((void)); Xextern time_t mktime __PR((struct tm *__timeptr)); Xextern size_t strftime __PR((char * _s, size_t _maxsize, X const char * __format, X const struct tm * __timeptr)); Xextern time_t time __PR((time_t *__tloc)); X#endif X X/* X * unistd.h X */ X#ifdef _SCHILY_UNISTD_H X/*extern int chdir __PR((const char *__path));*/ Xextern int fchdir __PR((int __fildes)); Xextern int fsync __PR((int __fildes)); Xextern int getdtablesize __PR((void)); Xextern long gethostid __PR((void)); Xextern int getopt __PR((int __argc, char * const __argv[], const char *__optstring)); Xextern int ioctl __PR((int __fildes, int __request, /* arg */ ...)); Xextern int lockf __PR((int __fildes, int __function, off_t __size)); Xextern int rcmd __PR((char **__ahost, unsigned short __inport, const char *__luser, X const char *__ruser, const char *__cmd, int *__fd2p)); Xextern ssize_t readlink __PR((const char * __path, char * __buf, size_t __bufsiz)); Xextern int rename __PR((const char *__old, const char *__new)); Xextern int setreuid __PR((uid_t __ruid, uid_t __euid)); Xextern int seteuid __PR((uid_t __euid)); Xextern int setegid __PR((gid_t __egid)); X Xextern int symlink __PR((const char *__name1, const char *__name2)); Xextern void sync __PR((void)); X Xextern int truncate __PR((const char *__path, off_t __length)); Xextern int ftruncate __PR((int __fildes, off_t __length)); X Xextern int brk __PR((void *__endds)); X/*extern void * sbrk __PR((intptr_t __incr));*/ Xextern void * sbrk __PR((Intptr_t __incr)); X X/*extern int usleep __PR((useconds_t __useconds));*/ Xextern int usleep __PR((unsigned __useconds)); X#endif X X#ifdef __cplusplus X} X#endif X X#endif /* _SCHILY_SUNOS4_PROTO_H */ END-of-star-1.6/include/schily/sunos4_proto.h echo x - star-1.6/include/schily/sunos4_proto.mk sed 's/^X//' >star-1.6/include/schily/sunos4_proto.mk << 'END-of-star-1.6/include/schily/sunos4_proto.mk' X#ident "@(#)sunos4_proto.mk 1.1 13/05/06 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= sunos4_proto.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/sunos4_proto.mk echo x - star-1.6/include/schily/shedit.h sed 's/^X//' >star-1.6/include/schily/shedit.h << 'END-of-star-1.6/include/schily/shedit.h' X/* @(#)shedit.h 1.15 17/12/30 Copyright 2006-2017 J. Schilling */ X/* X * Definitions for libshedit, the history editor for the shell. X * X * Copyright (c) 2006-2017 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_SHEDIT_H X#define _SCHILY_SHEDIT_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X#ifndef _SCHILY_TYPES_H X#include X#endif X#ifndef _SCHILY_SCHILY_H X#include X#endif X X#ifdef __cplusplus Xextern "C" { X#endif X X/* X * Exported functions: X * X * shedit_egetc(): read one character from the edited input X * shedit_getdelim(): get input delimiter X * shedit_treset(): reset terminal modes to non-edit X * shedit_bhist(): the builtin history command X * shedit_bshist(): the builtin savehistory command X * shedit_append_line(): to append a line to the history X * shedit_remap(): the builtin to reread termcap/mapping defaults X * shedit_list_map(): the builtin to list mappings X * shedit_del_map(): the builtin to delete mappings X * shedit_add_map(): the builtin to add mappings X * shedit_getenv(): set up pointer to local getenv() from the shell X * shedit_putenv(): set up pointer to local putenv() from the shell X * shedit_igneof(): set up pointer to local ignoreeof() from the shell X */ Xextern int shedit_egetc __PR((void)); Xextern size_t shedit_getlen __PR((void)); Xextern int shedit_getdelim __PR((void)); Xextern void shedit_treset __PR((void)); Xextern void shedit_bhist __PR((int **intrcpp)); Xextern void shedit_bshist __PR((int **intrpp)); Xextern void shedit_append_line __PR((char *linep, unsigned int len, X unsigned int pos)); Xextern void shedit_chghistory __PR((char *__val)); Xextern void shedit_histrange __PR((unsigned *firstp, X unsigned *lastp, unsigned *nextp)); Xextern void shedit_remap __PR((void)); Xextern void shedit_list_map __PR((int *f)); Xextern int shedit_del_map __PR((char *from)); Xextern int shedit_add_map __PR((char *from, char *to, char *comment)); Xextern void shedit_getenv __PR((char *(*genv)(char *name))); Xextern void shedit_putenv __PR((void (*penv) (char *name))); Xextern void shedit_igneof __PR((BOOL (*ieof) (void))); Xextern void shedit_setprompts __PR((int promptidx, int nprompts, X char *newprompts[])); X X/* X * Keep #defines in sync with bsh/bsh.h X */ X#define HI_NOINTR 0 /* History traversal noninterruptable */ X#define HI_INTR 1 /* History traversal is interruptable */ X#define HI_NONUM 2 /* Do not print numbers */ X#define HI_TAB 4 /* Print TABs */ X#define HI_REVERSE 8 /* Print in reverse order */ X#define HI_PRETTYP 16 /* Pretty Type non-printable chars */ X#define HI_ANSI_NL 32 /* Convert ASCII newlines to ANSI nl */ X Xextern int shedit_history __PR((int *f, int **intrcpp, int flg, X int _first, int _last, char *_subst)); Xextern int shedit_search_history __PR((int **intrcpp, int flg, X int _first, char *_pat)); Xextern int shedit_remove_history __PR((int **intrcpp, int flg, X int _first, char *_pat)); Xextern int shedit_read_history __PR((int *f, int **intrcpp, int flg)); X#ifdef __cplusplus X} X#endif X X#endif /* _SCHILY_SHEDIT_H */ END-of-star-1.6/include/schily/shedit.h echo x - star-1.6/include/schily/err_type.h sed 's/^X//' >star-1.6/include/schily/err_type.h << 'END-of-star-1.6/include/schily/err_type.h' X/* @(#)err_type.h 1.1 12/12/03 Copyright 2012 J. Schilling */ X/* X * #error include for missing type X * X * Copyright (c) 2012 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_ERR_TYPE_H X#define _SCHILY_ERR_TYPE_H X X#error Type is missing X X#endif /* _SCHILY_ERR_TYPE_H */ END-of-star-1.6/include/schily/err_type.h echo x - star-1.6/include/schily/err_type.mk sed 's/^X//' >star-1.6/include/schily/err_type.mk << 'END-of-star-1.6/include/schily/err_type.mk' X#ident "@(#)err_type.mk 1.1 12/12/03 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= err_type.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/err_type.mk echo x - star-1.6/include/schily/shedit.mk sed 's/^X//' >star-1.6/include/schily/shedit.mk << 'END-of-star-1.6/include/schily/shedit.mk' X#ident "@(#)shedit.mk 1.1 13/09/19 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= shedit.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/shedit.mk echo x - star-1.6/include/schily/sha3.h sed 's/^X//' >star-1.6/include/schily/sha3.h << 'END-of-star-1.6/include/schily/sha3.h' X/* @(#)sha3.h 1.6 16/10/26 2015-2016 J. Schilling */ X/* sha3.h */ X/* X * SHA3 hash code taken from X * https://github.com/rhash/RHash/tree/master/librhash X * X * Portions Copyright (c) 2015-2016 J. Schilling X */ X#ifndef _SCHILY_SHA3_H X#define _SCHILY_SHA3_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X#include X#include X X#ifdef __cplusplus Xextern "C" { X#endif X X#ifdef HAVE_LONGLONG X X#define sha3_224_hash_size 28 X#define sha3_256_hash_size 32 X#define sha3_384_hash_size 48 X#define sha3_512_hash_size 64 X#define sha3_max_permutation_size 25 X#define sha3_max_rate_in_qwords 24 X X#define SHA3_224_DIGEST_LENGTH sha3_224_hash_size X#define SHA3_224_DIGEST_STRING_LENGTH (SHA3_224_DIGEST_LENGTH * 2 + 1) X#define SHA3_256_DIGEST_LENGTH sha3_256_hash_size X#define SHA3_256_DIGEST_STRING_LENGTH (SHA3_256_DIGEST_LENGTH * 2 + 1) X#define SHA3_384_DIGEST_LENGTH sha3_384_hash_size X#define SHA3_384_DIGEST_STRING_LENGTH (SHA3_384_DIGEST_LENGTH * 2 + 1) X#define SHA3_512_DIGEST_LENGTH sha3_512_hash_size X#define SHA3_512_DIGEST_STRING_LENGTH (SHA3_512_DIGEST_LENGTH * 2 + 1) X X/* X * SHA3 Algorithm context. X */ Xtypedef struct sha3_ctx X{ X /* 1600 bits algorithm hashing state */ X UInt64_t hash[sha3_max_permutation_size]; X /* 1536-bit buffer for leftovers */ X UInt64_t message[sha3_max_rate_in_qwords]; X /* count of bytes in the message[] buffer */ X unsigned rest; X /* size of a message block processed at once */ X unsigned block_size; X} sha3_ctx, SHA3_CTX; X X/* methods for calculating the hash function */ X Xvoid rhash_sha3_224_init __PR((sha3_ctx *ctx)); Xvoid rhash_sha3_256_init __PR((sha3_ctx *ctx)); Xvoid rhash_sha3_384_init __PR((sha3_ctx *ctx)); Xvoid rhash_sha3_512_init __PR((sha3_ctx *ctx)); Xvoid rhash_sha3_update __PR((sha3_ctx *ctx, X const unsigned char *msg, X size_t size)); Xvoid rhash_sha3_final __PR((sha3_ctx *ctx, unsigned char *result)); X Xvoid SHA3_224_Init __PR((SHA3_CTX *ctx)); Xvoid SHA3_256_Init __PR((SHA3_CTX *ctx)); Xvoid SHA3_384_Init __PR((SHA3_CTX *ctx)); Xvoid SHA3_512_Init __PR((SHA3_CTX *ctx)); Xvoid SHA3_Update __PR((SHA3_CTX *ctx, X const unsigned char *msg, X size_t size)); Xvoid SHA3_Final __PR((unsigned char *result, SHA3_CTX *ctx)); X X#ifdef USE_KECCAK X#define rhash_keccak_224_init rhash_sha3_224_init X#define rhash_keccak_256_init rhash_sha3_256_init X#define rhash_keccak_384_init rhash_sha3_384_init X#define rhash_keccak_512_init rhash_sha3_512_init X#define rhash_keccak_update rhash_sha3_update Xvoid rhash_keccak_final __PR((sha3_ctx *ctx, unsigned char *result)); X#endif X X#endif /* HAVE_LONGLONG */ X X#ifdef __cplusplus X} X#endif X X#endif /* _SCHILY_SHA3_H */ END-of-star-1.6/include/schily/sha3.h echo x - star-1.6/include/schily/sha3.mk sed 's/^X//' >star-1.6/include/schily/sha3.mk << 'END-of-star-1.6/include/schily/sha3.mk' X#ident "@(#)sha3.mk 1.1 15/11/22 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= sha3.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/sha3.mk echo x - star-1.6/include/schily/strar.h sed 's/^X//' >star-1.6/include/schily/strar.h << 'END-of-star-1.6/include/schily/strar.h' X/* @(#)strar.h 1.5 18/05/17 Copyright 2001-2018 J. Schilling */ X/* X * Defitions for the stream archive interfaces. X * X * A stream archive is based on the method used for X * POSIX tar extended headers X * X * Copyright (c) 2001-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_STRAR_H X#define _SCHILY_STRAR_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X#ifndef _SCHILY_STAT_H X#include X#endif X#ifndef _SCHILY_STDIO_H X#include X#endif X#ifndef _SCHILY_UTYPES_H X#include X#endif X Xtypedef struct { X FILE *f_fp; /* FILE * f. Archiv */ X const char *f_fpname; /* Archive name */ X FILE *f_list; /* FILE * f. Listing Output */ X const char *f_listname; /* List output name */ X Ulong f_cmdflags; /* Command specific flags */ X X char *f_name; /* Zeiger auf den langen Dateinamen */ X Ulong f_namelen; /* Länge des Dateinamens */ X char *f_lname; /* Zeiger auf den langen Linknamen */ X Ulong f_lnamelen; /* Länge des Linknamens */ X X char *f_uname; /* User name oder NULL Pointer */ X Ulong f_umaxlen; /* Maximale Länge des Usernamens */ X char *f_gname; /* Group name oder NULL Pointer */ X Ulong f_gmaxlen; /* Maximale Länge des Gruppennamens */ X X dev_t f_dev; /* Geraet auf dem sich d. Datei befindet */ X ino_t f_ino; /* Dateinummer */ X nlink_t f_nlink; /* Anzahl der Links */ X X mode_t f_mode; /* Zugriffsrechte */ X X uid_t f_uid; /* Benutzernummer */ X gid_t f_gid; /* Benutzergruppe */ X X Ullong f_llsize; /* Dateigroesze wenn off_t zu kein */ X off_t f_size; /* Dateigroesze */ X off_t f_rsize; /* Dateigroesze auf Band */ X X Ulong f_flags; /* Bearbeitungshinweise */ X Ulong f_xflags; /* Flags für x-header */ X Ulong f_xftype; /* Header Dateityp (neu generell) */ X Ulong f_rxftype; /* Echter Dateityp (neu generell) */ X X#ifdef NEW_RDEV X dev_t f_rdev; /* Major/Minor bei Geraeten */ X major_t f_rdevmaj; /* Major bei Geraeten */ X minor_t f_rdevmin; /* Minor bei Geraeten */ X#else X Ulong f_rdev; /* Major/Minor bei Geraeten */ X Ulong f_rdevmaj; /* Major bei Geraeten */ X Ulong f_rdevmin; /* Minor bei Geraeten */ X#endif X X time_t f_atime; /* Zeit d. letzten Zugriffs */ X long f_ansec; /* nsec Teil " */ X time_t f_mtime; /* Zeit d. letzten Aenderung */ X long f_mnsec; /* nsec Teil " */ X time_t f_ctime; /* Zeit d. letzten Statusaend. */ X long f_cnsec; /* nsec Teil " */ X long f_status; /* File send status */ X} FINFO; X Xtypedef FINFO strar; X X/* X * Used with f_cmdflags X */ X#define CMD_VERBOSE 0xFF /* Allow verbose levels from 0..255 */ X#define CMD_CREATE 0x100 X#define CMD_XTRACT 0x200 X#define CMD_LIST 0x400 X#define CMD_CTIME 0x800 X X/* X * Used with f_flags X */ X#define F_BAD_SIZE 0x1000 /* Bad size data detected */ X#define F_BAD_META 0x2000 /* Bad meta data detected */ X#define F_BAD_UID 0x4000 /* Bad uid value detected */ X#define F_BAD_GID 0x8000 /* Bad gid value detected */ X X/* X * Used with f_xflags X */ X#define XF_ATIME 0x0001 /* Zeit d. letzten Zugriffs */ X#define XF_CTIME 0x0002 /* Zeit d. letzten Statusaend. */ X#define XF_MTIME 0x0004 /* Zeit d. letzten Aenderung */ X#define XF_COMMENT 0x0008 /* Beliebiger Kommentar */ X#define XF_UID 0x0010 /* Benutzernummer */ X#define XF_UNAME 0x0020 /* Langer Benutzername */ X#define XF_GID 0x0040 /* Benutzergruppe */ X#define XF_GNAME 0x0080 /* Langer Benutzergruppenname */ X#define XF_PATH 0x0100 /* Langer Name */ X#define XF_LINKPATH 0x0200 /* Langer Link Name */ X /* Dateigröße auf Band (f_rsize) */ X#define XF_SIZE 0x0400 /* Dateigröße wenn > 8 GB */ X#define XF_CHARSET 0x0800 /* Zeichensatz für Dateiinhalte */ X X#define XF_DEVMAJOR 0x1000 /* Major bei Geräten */ X#define XF_DEVMINOR 0x2000 /* Major bei Geräten */ X X#define XF_FFLAGS 0x10000 /* File flags */ X /* Echte Dateigröße (f_size) */ X#define XF_REALSIZE 0x20000 /* Dateigröße wenn > 8 GB */ X#define XF_STATUS 0x40000 /* File send status */ X#define XF_EOF 0x80000 /* Logical EOF in archive */ X#define XF_DEV 0x100000 /* Device FS is on */ X#define XF_INO 0x200000 /* Inode number for file */ X#define XF_NLINK 0x400000 /* Link count */ X#define XF_MODE 0x800000 /* File mode */ X#define XF_FILETYPE 0x1000000 /* File type */ X X#define XF_BINARY 0x20000000 /* Binary path/usr/group in x-header */ X X#define XF_BASE_FILEMETA (XF_FILETYPE | XF_MODE) X#define XF_ALL_FILEMETA (XF_FILETYPE | XF_MODE | \ X XF_ATIME | XF_MTIME | XF_CTIME | \ X XF_UID | XF_GID | XF_UNAME | XF_GNAME | \ X XF_DEV | XF_INO | XF_NLINK | XF_DEVMAJOR | XF_DEVMINOR) X X/* X * All Extended header tags that are covered by POSIX.1-2001 X */ X#define XF_POSIX (XF_ATIME|XF_CTIME|XF_MTIME|XF_COMMENT|\ X XF_UID|XF_UNAME|XF_GID|XF_GNAME|\ X XF_PATH|XF_LINKPATH|XF_SIZE|XF_CHARSET) X X X/* X * Open modes X */ X#define OM_READ 1 X#define OM_WRITE 2 X#define OM_ARFD 4 X Xextern int strar_open __PR((strar *s, const char *name, int arfd, X int mode, const char *codeset)); Xextern int strar_close __PR((strar *s)); Xextern void strar_init __PR((strar *s)); Xextern void strar_reset __PR((strar *s)); Xextern void strar_archtype __PR((strar *s)); Xextern void strar_eof __PR((strar *s)); Xextern int strar_send __PR((strar *s, const char *name)); Xextern int strar_st_send __PR((strar *s, struct stat *sp)); Xextern void strar_list_file __PR((strar *s)); Xextern void strar_vprint __PR((strar *s)); Xextern int strar_receive __PR((strar *s, int (*func)(strar *))); X Xextern int strar_hparse __PR((strar *s)); Xextern int strar_get __PR((strar *s)); Xextern int strar_skip __PR((strar *s)); X Xextern int strar_setnowarn __PR((int val)); Xextern void strar_xbreset __PR((void)); X X X#endif /* _SCHILY_STRAR_H */ END-of-star-1.6/include/schily/strar.h echo x - star-1.6/include/schily/strar.mk sed 's/^X//' >star-1.6/include/schily/strar.mk << 'END-of-star-1.6/include/schily/strar.mk' X#ident "@(#)strar.mk 1.1 17/02/15 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= strar.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/strar.mk echo x - star-1.6/include/schily/getopt.h sed 's/^X//' >star-1.6/include/schily/getopt.h << 'END-of-star-1.6/include/schily/getopt.h' X/* @(#)getopt.h 1.1 18/11/08 Copyright 2018 J. Schilling */ X/* X * Definitions for the enhanced getopt() from libgetopt X * X * Copyright (c) 2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_GETOPT_H X#define _SCHILY_GETOPT_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X#ifndef _SCHILY_UNISTD_H X#include /* This is where the standard puts getopt() */ X#endif X X#ifdef HAVE_GETOPT_H X#ifndef _INCL_GETOPT_H X#define _INCL_GETOPT_H X#include /* This may deliver getopt_long() */ X#endif X#endif /* HAVE_GETOPT_H */ X X#ifdef __cplusplus Xextern "C" { X#endif X X/* X * Additional external variables defined by the AT&T getopt(). X */ Xextern int opt_sp; X X#ifdef __cplusplus X} X#endif X X#endif /* _SCHILY_GETOPT_H */ END-of-star-1.6/include/schily/getopt.h echo x - star-1.6/include/schily/getopt.mk sed 's/^X//' >star-1.6/include/schily/getopt.mk << 'END-of-star-1.6/include/schily/getopt.mk' X#ident @(#)getopt.mk 1.1 18/11/08 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= getopt.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/getopt.mk echo x - star-1.6/include/schily/values.mk sed 's/^X//' >star-1.6/include/schily/values.mk << 'END-of-star-1.6/include/schily/values.mk' X#ident "@(#)values.mk 1.1 18/12/30 " X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= values.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/values.mk echo x - star-1.6/include/schily/values.h sed 's/^X//' >star-1.6/include/schily/values.h << 'END-of-star-1.6/include/schily/values.h' X/* @(#)values.h 1.1 18/12/30 Copyright 2018 J. Schilling */ X/* X * Abstraction code for values.h X * X * Copyright (c) 2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_VALUES_H X#define _SCHILY_VALUES_H X X#ifdef __cplusplus Xextern "C" { X#endif X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X#ifdef HAVE_FLOAT_H X#ifndef _INCL_FLOAT_H X#define _INCL_FLOAT_H X#include X#endif X#endif X X#ifdef HAVE_VALUES_H X#ifndef _INCL_VALUES_H X#define _INCL_VALUES_H X#include X#endif X#endif X X#ifndef BITSPERBYTE X#define BITSPERBYTE 8 X#endif X X#ifndef BITS X#define BITS(type) (BITSPERBYTE * (long)sizeof (type)) X#endif X X#ifndef HIBITS X#define HIBITS ((short)(1 << (BITS(short) - 1))) X#endif X X#if defined(__STDC__) X#ifndef HIBITI X#define HIBITI (1U << (BITS(int) - 1)) X#endif X#ifndef HIBITL X#define HIBITL (1UL << (BITS(long) - 1)) X#endif X#else X#ifndef HIBITI X#define HIBITI ((unsigned)1 << (BITS(int) - 1)) X#endif X#ifndef HIBITL X#define HIBITL (1L << (BITS(long) - 1)) X#endif X#endif X X#ifndef MAXSHORT X#define MAXSHORT ((short)~HIBITS) X#endif X#ifndef MAXINT X#define MAXINT ((int)(~HIBITI)) X#endif X#ifndef MAXLONG X#define MAXLONG ((long)(~HIBITL)) X#endif X X#ifdef __cplusplus X} X#endif X X#endif /* _SCHILY_VALUES_H */ END-of-star-1.6/include/schily/values.h echo x - star-1.6/include/schily/type_val.h sed 's/^X//' >star-1.6/include/schily/type_val.h << 'END-of-star-1.6/include/schily/type_val.h' X/* @(#)type_val.h 1.1 19/02/28 Copyright 2002-2019 J. Schilling */ X/* X * Definitions to define the maximum and minimum values X * for all scalar types. X * X * Copyright (c) 2002-2019 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _SCHILY_TYPE_VAL_H X#define _SCHILY_TYPE_VAL_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X X/* X * Let us include system defined types too. X */ X#ifndef _SCHILY_TYPES_H X#include X#endif X/* X * Include sys/param.h for NBBY - needed in case that CHAR_BIT is missing X */ X#ifndef _SCHILY_PARAM_H X#include /* Must be before limits.h */ X#endif X X/* X * Include limits.h for CHAR_BIT - needed by TYPE_MINVAL(t) and TYPE_MAXVAL(t) X */ X#ifndef _SCHILY_LIMITS_H X#include X#endif X X#ifndef CHAR_BIT X#ifdef NBBY X#define CHAR_BIT NBBY X#endif X#endif X X/* X * Last resort: define CHAR_BIT by hand X */ X#ifndef CHAR_BIT X#define CHAR_BIT 8 X#endif X X/* X * These macros may not work on all platforms but as we depend X * on two's complement in many places, they do not reduce portability. X * The macros below work with 2s complement and ones complement machines. X * Verify with this table... X * X * Bits 1's c. 2's complement. X * 100 -3 -4 X * 101 -2 -3 X * 110 -1 -2 X * 111 -0 -1 X * 000 +0 0 X * 001 +1 +1 X * 010 +2 +2 X * 011 +3 +3 X * X * Computing -TYPE_MINVAL(type) will not work on 2's complement machines X * if 'type' is int or more. Use: X * ((unsigned type)(-1 * (TYPE_MINVAL(type)+1))) + 1; X * it works for both 1's complement and 2's complement machines. X */ X#define TYPE_ISSIGNED(t) (((t)-1) < ((t)0)) X#define TYPE_ISUNSIGNED(t) (!TYPE_ISSIGNED(t)) X#if (-3 & 3) == 1 /* Two's complement */ X#define TYPE_MSBVAL(t) (2 * -(((t)1) << (sizeof (t)*CHAR_BIT - 2))) X#else X#define TYPE_MSBVAL(t) ((t)(~((t)0) << (sizeof (t)*CHAR_BIT - 1))) X#endif X#define TYPE_MINVAL(t) (TYPE_ISSIGNED(t) \ X ? TYPE_MSBVAL(t) \ X : ((t)0)) X#define TYPE_MAXVAL(t) ((t)(~((t)0) - TYPE_MINVAL(t))) X X#endif /* _SCHILY_TYPE_VAL_H */ END-of-star-1.6/include/schily/type_val.h echo x - star-1.6/include/schily/type_val.mk sed 's/^X//' >star-1.6/include/schily/type_val.mk << 'END-of-star-1.6/include/schily/type_val.mk' X#ident @(#)type_val.mk 1.1 19/02/28 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily XTARGET= type_val.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X END-of-star-1.6/include/schily/type_val.mk echo x - star-1.6/README sed 's/^X//' >star-1.6/README << 'END-of-star-1.6/README' XFor more information, see the README file in the directory "star" and in the Xdirectory "READMEs". END-of-star-1.6/README echo c - star-1.6/man mkdir -p star-1.6/man > /dev/null 2>&1 echo c - star-1.6/man/man1 mkdir -p star-1.6/man/man1 > /dev/null 2>&1 echo x - star-1.6/man/man1/match.1 sed 's/^X//' >star-1.6/man/man1/match.1 << 'END-of-star-1.6/man/man1/match.1' X. \" @(#)match.1 1.1 97/02/19 Copyright 1985-1997 J. Schilling X. \" Manual page for match X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \\(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH MATCH 1L "15. Juli 1988" "J\*org Schilling" "Schily\'s USER COMMANDS" X.SH NAME Xmatch \- searches for patterns in files X.SH SYNOPSIS X.B Xmatch X[ X.I \-option X] X.I pattern X[ X.I file \.\|.\|. X] X.SH DESCRIPTION X. \" .SH BESCHREIBUNG X.I Match Xsearches the named files or standard input (if no filenames are given) Xfor the occurrences of the given pattern on each line. XThe program accepts literal characters or special pattern matching characters. XAll lines that match the pattern are output on standard output. XYou can only specify one pattern string for each match, however, you can Xconstruct an arbitrarily complex string. XWhen you do not specify a file, match can be used as a filter to display Xdesired lines. XStandard in is used if no files are specified. X.SH OPTIONS X. \" .SH OPTIONEN X.TP X.BI \-not ", " \-v XPrints all lines that do not match. X.TP X.B \-i XIgnore the case of letters X.TP X.B \-m XForce not to use the magic mode X.TP X.B \-w XSearch for X.I pattern Xas a word X.TP X.B \-x XDisplay only those lines which match exactly X.TP X.B \-c XDisplay matching count for each file X.TP X.B \-l XDisplay name of each file which matches X.TP X.B \-s XBe silent indicate match in exit code X.TP X.B \-h XDo not display filenames X.TP X.B \-n XPrecede matching lines with line number (with respect to the input file) X.TP X.B \-b XPrecede matching lines with block number X.SH "REGULAR EXPRESSIONS" XThe following is a table of all the pattern matching characters: X.TP X.I c XAn ordinary character X.I (not Xone of the special characters discussed below) is a one character regular Xexpression that matches that character. X.TP X.BI \e\| c XA backslash (\|\e\|) followed by any special character is a one character Xregular expression that matches the special character itself. The special Xcharacters are: X.RS X.TP X! # % * { } [ ] \|\e\| ? ^ $ X.RE X.TP X.B ! XLogical X.B OR Xas in match X.I "this!that!the_other." XYou may have to use `{}' for precedence Xgrouping. X.TP X.B # XA hash mark followed by any regular expression matches any number X(including zero) occurrences of the regular expression. X.TP X.B ? XMatches exactly any one character. X.B W? Xmatches X.I "Wa, Wb, Wc, W1, W2, W3 .\|.\|." X.TP X.B * XMatches any number of any character. X.TP X.B % XMatches exactly nothing. It can be used in groups of ored patterns to specify Xthat an empty alternative is possible. X.TP X.B {} XCurly brackets may be used to enclose patterns to specify a precedence Xgrouping, and may be nested. X.B {%!{test}}version Xmatches the strings X.I "testversion" Xand X.I version. X.TP X.BI [ string ] XA non empty string of characters enclosed in square brackets Xis a one character regular expression that matches X.I any one Xcharacter in that string. XIf however the first character of the string is a circumflex (\|^\|), Xthe one character expression matches any character which is X.I not Xin the string. The ^ has this special meaning X.I only Xif it occurs first in the string. The minus (\|\-\|) may be used to Xindicate a range of consecutive ASCII characters; for example, [0-9] is Xequivalent to X.I any one of the digits. XThe \- loses it's special meaning if it occurs Xfirst (after an initial ^, if any) or last in the string. XThe right square bracket (]) and the backslash (\|\e\|) Xmust be quoted with a backslash if you want to use it within the X.I string. X.TP X.B ^ XMatches the beginning of a line. X.TP X.B $ XMatches the end of a line. (\|^*$ matches any entire line) X. \" .SH EXAMPLES X.SH EXAMPLES X. \" .SH BEISPIELE X.SH FILES XNone. X. \" Keine. X.SH "SEE ALSO" Xgrep(1), fgrep(1), egrep(1) X.SH DIAGNOSTICS X. \" .SH NOTES X.SH NOTES X. \" .SH BEMERKUNGEN XEven if a match occurs more than once per line, the line is output only once. X.PP XQuote special pattern matching characters to prevent them from Xbeing expanded by the Command Interpreter. X.SH BUGS XThe length of the pattern is currently limited to 100 characters. X.PP XThis limit is reduced by 38 if the X.B \-w Xoption is used. END-of-star-1.6/man/man1/match.1 echo x - star-1.6/man/man1/Makefile sed 's/^X//' >star-1.6/man/man1/Makefile << 'END-of-star-1.6/man/man1/Makefile' X#ident %W% %E% %Q% X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= match XMANSECT= $(MANSECT_CMD) XMANSUFFIX= $(MANSUFF_CMD) XMANFILE= match.1 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/man/man1/Makefile echo c - star-1.6/man/man4 mkdir -p star-1.6/man/man4 > /dev/null 2>&1 echo x - star-1.6/man/man4/makefiles.4 sed 's/^X//' >star-1.6/man/man4/makefiles.4 << 'END-of-star-1.6/man/man4/makefiles.4' X. \" @(#)makefiles.4 1.8 18/09/17 Copyr 1996-2018 J. Schilling X. \" User Manual page for makefile system X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.\".TH makefiles 4L "14. February 1997" "J\*org Schilling" "Schily\'s FILE FORMATS" X.TH makefiles 4L "2018/09/17" "J\*org Schilling" "File Formats" X.SH NAME Xmakefiles \- users guide for compiling projects on different platforms X.SH SYNOPSIS X.B "make [target] X.br X.B "gmake [target] X.br X.B "smake [target] X.br X.PP XTarget may be one of: X.TP 10 X\&.help Xto get a list of possible targets and a short description. X.TP Xall Xto make the default targets X.TP Xinstall Xto make and install the default targets X(see X.IR INS_BASE " and " INS_KBASE Xto learn how to modify the installation path). X.TP Xibins Xto make and install a target in X.I SRCROOT/bins X.TP Xdepend Xto re-make dependency rules for all default targets. XNote: All dependency files will automatically remade Xon the next run of make before they are included. X.TP Xclean Xto remove X.I core Xfiles and all intermediate object files. X.TP Xclobber Xto remove the targets from X.IR clean , Xall dependency files and all final targets X.TP Xdistclean Xto remove the targets from X.IR clean " and " clobber Xand all made files for all architectures. X.TP Xtags Xto make X.IR vi (1) Xcompatible tags X.TP XTAGS Xto make X.IR emacs (1) Xcompatible tags X.TP Xconfig Xreserved for future use. X.TP Xrmtarget Xto remove the default target X.TP Xrelink Xto remove the default target and remake it immediately. This can be Xused to change .e.g LD_RUN_PATH in the executable. X X.SH DESCRIPTION XMakefiles is a set of rules that allows compiling of structured Xprojects with small and uniformly structured makefiles. XAll rules are located in a central directory. XCompiling the projects on different platforms can be done Xsimultaneously without Xthe need to modify any of the makefiles that are located Xin the projects directories. X.PP XMakefiles is a set of high level portability tools superior to X.B autoconf Xand easier to use. X.PP XThree make programs are supported: X.IR "Sunpro make" , X.I "GNU make" Xand X.IR smake . X.PP X.I BSDmake Xcould be supported if it supports pattern matching rules correctly. X.PP XThe main design goal was to have a set of small and easy to read Xmakefiles, each located in the project's leaf directory and therefore Xcalled X.IR leaf -makefile. X.PP XEach of these X.IR leaf -makefiles, Xin fact contains no rule at all. It simply defines some macros Xfor the X.IR make -program Xand includes two files from a central make rule depository. XThe included files and the files that are recursively included Xdefine the rules that are needed to compile the project. X.PP XEach X.IR leaf -makefile Xis formed in a really simple way: X.TP X\(bu XIt first defines two macros that define the relative location Xof the project's root directory and the name of the directory Xthat contains the complete set of of rules and then includes Xthe rule file X.I rules.top Xfrom the directory that forms the central rule depository. XYou only have to edit the macro X.I SRCROOT Xto reflect the relative location of the project's root directory. X.TP X\(bu XThe next part of a X.IR leaf -makefile Xdefines macros that describe the target and the source. XYou can only have one target per X.IR leaf -makefile. XOf course, there may be many source files, that are needed to create Xthat target. XIf you want to make more than one target in a specific directory, Xyou have to put more than one makefile into that directory. XThis is the part of a makefile that describes a unique target. XEdit this part to contain all source files, all local include files Xand all non global compile time flags that are needed for your target. XFor a typical target this is as simple as filling in a form. X.TP X\(bu XEach X.IR leaf -makefile Xfinally includes a file from the rules directory that contains Xrules for the appropriate type of target that is to be made Xfrom this X.IR leaf -makefile. X.PP XThe makefile in each directory has to be called X.IR Makefile . XIf you want to have more than one makefile in a specific directory, Xyou have to choose different names for the other makefiles. X.PP XThere are rules for the following type of targets: X.TP 20 Xcommands XThe make rules for user level commands like X.IR cat ", " ls Xetc. are located in the file X.I rules.cmd X.TP Xdrivers XThe make rules for device drivers Xare located in the file X.I rules.drv X.TP Xlibraries XThe make rules for non shared libraries Xare located in the file X.I rules.lib X.TP Xshared libraries XThe make rules for shared libraries Xare located in the file X.I rules.shl X.TP Xlocalized files XThe make rules for localized files Xare located in the file X.I rules.loc X.TP Xnonlocalized files XThe make rules for non localized files Xare located in the file X.I rules.aux X.TP Xshell scripts XThe make rules for shell scripts (a variant of localized files) Xare located in the file X.I rules.scr X.TP Xmanual pages XThe make rules for manual pages (a variant of localized files) Xare located in the file X.I rules.man X.TP Xdiverted makefiles XThe make rules for projects that need to have more than Xone makefile in a specific directory Xare located in the file X.I rules.mks XIt contains a rule that diverts to the listed sub makefiles. XEach sub makefile may be of any type. X.TP Xdirectories XThe make rules for sub directories Xare located in the file X.I rules.dir X X.SH "Macros/Variables Used In Rules X.PP XThe following is a description of the most important macros Xused within the make rules. X.I NOTE: Xnot all of them might be changed in a specific makefile. XCarefully read the description and change only those macros Xthat are intended to be used to change the behavior of Xthe compilation. X X.TP 13 XARCHDIR Xcontains the location where object files and make targets will be placed. XA typical name would be: X.I "OBJ/sparc\-sunos5\-cc X.br XDo not change this macro. X. X.TP XASFLAGS XThe flags that are used with the assembler. X.br XDo not change this macro. X. X.TP XASMFILES Xa list of assembler source files, to be specified in a Xleaf makefile. X. X.TP XASOPTS XThe internal macro that contains the flags for the assembler. XChange this macro if you want to change the behavior. XUse: X.B "ASOPTS= value" XIf you want to override the default value. If you want to Xoverride the default assembler flags from the command line Xcall: X.B "make 'ASOPTS=value'" XUse: X.B "ASOPTS += value" XIf you want to add flags to the default value from within a makefile. X. X.TP XASOPTX Xmay be used if you want to add flags to the assembler flags from the Xcommand line. Use: X.B "make 'ASOPTX=value' X. X.TP XC_ARCH Xthis macro contains the c-compiler architecture name. X.br XDo not change this macro. X. X.TP XCCOM XThis macro may be used from the command line to use a different Xc-compiler than the default. XUse: X.B "make 'CCOM=gcc' Xto use X.I gcc Xfor the next run. XNote: The value of X.I CCOM Xmust not necessarily be identical to the real name of the c-compiler. XIt refers to a filename which contains the definition for that Xc-compiler. This hint applies as well to all other macros that deal with Xthe name of the c-compiler. XThe only macro, that contains the real invocation name of the c-compiler, Xis X.IR CC . X.I CC Xis set inside the machine dependent configuration file in the central Xrules depository and must not be changed elsewhere. X. X.TP XCFILES Xa list of C source files, to be specified in a Xleaf makefile. X. X.TP XCFLAGS XThe flags that are used with the c-compiler. XDo not use flags that belong to the c-preprocessor in the X.IR COPTOPT ", " COPTS " and " COPTX Xmacros. X.br XDo not change this macro. X. X.TP XCLEAN_FILES XA list of files ( besides the object files ) that will be Xremoved with X.IR "make clean" . X.br XDo not change this macro. X. X.TP XCLEAN_FILEX Xthis macro may be used to define additional files that should Xbe removed with X.IR "make clean" . X. X.TP XCLOBBER_FILEX Xthis macro may be used to define additional files that should Xbe removed with X.IR "make clobber" . X. X.TP XCOPTOPT XThe c-compiler optimization flag. This flag is intended to Xbe overridden either from a makefile or from command line. X. X.TP XCOPTS XThe internal macro that contains the flags for the c-compiler. XChange this macro if you want to change the behavior. XUse: X.B "COPTS= value" XIf you want to override the default value. If you want to Xoverride the default c-compiler flags from the command line Xcall: X.B "make 'COPTS=value'" XUse: X.B "COPTS += value" XIf you want to add flags to the default value from within a makefile. X. X.TP XCOPTX Xmay be used if you want to add flags to the c-compiler flags from the Xcommand line. Use: X.B "make 'COPTX=value' X. X.TP XCPPFLAGS XThe flags that are used with the c-preprocessor. XThis macro as well as: X.IR CPPOPTS " and " CPPOPTX Xare also used when compiling c-programs. XThey should contain only the following flags: X.IR "\-Dname=value ", " \-Uname " , " X.IR \-Idirectory " and " \-Ydirectory . X.br XDo not change this macro. X. X.TP XCPPOPTS XThe internal macro that contains the flags for the c-preprocessor. XChange this macro if you want to change the behavior. XUse: X.B "CPPOPTS= value" XIf you want to override the default value. If you want to Xoverride the default c-preprocessor flags from the command line Xcall: X.B "make 'CPPOPTS=value'" XUse: X.B "CPPOPTS += value" XIf you want to add flags to the default value from within a makefile. X. X.TP XCPPOPTX Xmay be used if you want to add flags to the c-preprocessor flags from the Xcommand line. Use: X.B "make 'CPPOPTX=value' X. X.TP XCURDIR XThis macro contains the name of the sub directory that is currently processed. X.br XDo not change this macro. X. X.TP XCWARNOPTS XThis macro may be set in X.I $(DEFLTSROOT)/$(DEFLTSDIR)/Defaults Xor X.I $(DEFLTSROOT)/$(DEFLTSDIR)/Defaults.$(O_ARCH) Xto overwrite the default c-compiler warn options. X. X.TP XCWOPTS XThis macro is set inside the machine dependent configuration file in the central Xrules depository and must not be changed elsewhere. XIt contains the flags that set the default warning level for the c-compiler. X. X.TP XDEFINSGRP Xthis macro may be set in the projects defaults file to set up the Xdefault group id for installation X.TP XDEFINSMODE Xthis macro may be set in the projects defaults file to set up the Xdefault file permission for installation X.TP XDEFINSUSR Xthis macro may be set in the projects defaults file to set up the Xdefault user id for installation X.TP XDEFUMASK Xthis macro may be set in the projects defaults file to set up the Xdefault X.I umask Xvalue for creating sub directories X. X.TP XDEFAULTSDIR Xthis macro may be set from command line or from the shell environment Xif the user wants to use a different set of X.I Defaults Xfiles that is not located in the directory X.B DEFAULTS Xin the source root directory. XThis may be used to hold two or more set of defaults that differ e.g. in the Xinstallation path or the C-compiler. X. X.TP XDEFAULTSROOT Xthis macro may be set in a leaf makefile, if that makefile wants to use Xa X.I Defaults Xfile that is not located in X.I $(DEFAULTSDIR) Xin the source root. XThis may be used, if a sub tree in a big project needs a different setup. X. X.TP XDEFLTSDIR XThis is an internally used macro that is set from X.I $(DEFAULTSDIR) Xor from the internal defaults. X.br XDo not change this macro. X. X.TP XDEFLTSROOT XThis is an internally used macro that is set from X.I $(DEFAULTSROOT) Xor from the internal defaults. X.br XDo not change this macro. X. X.TP XDEFCCOM Xthe default name of the c-compiler. This is usually set in the file X.I $(DEFLTSROOT)/$(DEFLTSDIR)/Defaults Xor X.IR $(DEFLTSROOT)/$(DEFLTSDIR)/Defaults.$(O_ARCH) . X. X.TP XDEFINCDIRS Xa list of directories that are searched by default in addition to Xthe system include directories. If this macro is not set, X.I $(SRCROOT)/include Xis used. X. X.TP XDIRNAME Xthis macro needs to be set in the makefile that is located in Xthe X.I "$(SRCROOT) Xdirectory. XThe value should be either set to the name of the directory Xwhere the makefile is located or to X.BR SRCROOT . XThe value of this macro is updated automatically Xto follow the directory hierarchy. XDo not change this macro in a make file other than the make file Xin the source root. X. X.TP XDIRS Xthis macro needs to be set in a makefile that is located in Xa directory that contains diversion directories. XIt must contain a list of directory names where the diversions Xgo to e.g. X.BR "DIRS= libfoo libbar libgarbage" . X. X.TP XHFILES Xfor normal operation, X.I makefiles Xwill automatically find which include files are needed Xfor compilation. XHowever, if you want to create a tag file that includes Xtags for definitions that occur within include files, Xyou should set X.I HFILES Xto be a list of include files containing such definitions. X. X.TP XINCDIRS Xthis macro will normally be a copy from X.IR DEFINCDIRS . XYou may however specify a different value in a leaf makefile Xor from command line. This will overwrite the defaults value. X. X.TP XINS_BASE Xthis macro has to be specified in the file X.I $(DEFLTSROOT)/$(DEFLTSDIR)/Defaults Xor X.IR $(DEFLTSROOT)/$(DEFLTSDIR)/Defaults.$(O_ARCH) . XIt must contain the path name of the root for installing Xgeneral targets of the project. XSee X.IR INSDIR . X. X.TP XINS_KBASE Xthis macro has to be specified in the file X.I $(DEFLTSROOT)/$(DEFLTSDIR)/Defaults Xor X.IR $(DEFLTSROOT)/$(DEFLTSDIR)/Defaults.$(O_ARCH) . XIt must contain the path name of the root for installing Xkernel modules from the project. XSee X.IR INSDIR . X. X.TP XINSDIR Xthis macro has to be specified in the leaf makefile. XIt must contain the path name of a directory relative to X.IR INS_BASE " or " INS_KBASE . XThe target will be installed into X.I "$(INS_BASE)/$(INSDIR)" . X. X.TP XINSGRP Xthis macro may be set in a leaf makefile to set up the Xgroup id for installation X.TP XINSMODE Xthis macro may be set in a leaf makefile to set up the Xfile permission for installation X.TP XINSUSR Xthis macro may be set in a leaf makefile to set up the Xuser id for installation X. X.TP XK_ARCH Xthis macro contains the kernel/machine architecture for the Xtarget machine (e.g. X.IR "sun3 sun4c sun4m sun4u 9000\-725 aviion" ). XIt is set to the output of X.I "uname \-m Xconverted to lower case. X.br XDo not change this macro. X. X.TP XKARCH Xthis macro contains the kernel/machine architecture for the Xtarget machine (e.g. X.IR "sun3 sun4c sun4m sun4u 9000\-725 aviion" ). XIt is set to the output of X.I "uname \-m Xconverted to lower case. X.br XDo not change this macro unless you want to do a cross compilation. X. X.TP XLDFLAGS XThe flags that are used with the linker. X.br XDo not change this macro. X. X.TP XLDLIBS XThe internal macro that holds the Xlibraries that are used while linking the target. X.br XDo not change this macro. X. X.TP XLDOPTS XThe internal macro that contains the flags for the linker. XChange this macro if you want to change the behavior. XUse: X.B "LDOPTS= value" XIf you want to override the default value. If you want to Xoverride the default linker flags from the command line Xcall: X.B "make 'LDOPTS=value'" XUse: X.B "LDOPTS += value" XIf you want to add flags to the default value from within a makefile. X. X.TP XLDOPTX Xmay be used if you want to add flags to the linker flags from the Xcommand line. Use: X.B "make 'LDOPTX=value' X. X.TP XLDPATH Xthe default library search path for the linker. XThis is usually set in the file X.I $(DEFLTSROOT)/$(DEFLTSDIR)/Defaults Xor X.IR $(DEFLTSROOT)/$(DEFLTSDIR)/Defaults.$(O_ARCH) . X. X.TP XLIB_KVM Xa predefined macro that contains the operating system dependent Xname of a library Xthat is needed by programs that read/write kernel virtual memory. XAdd X.I "$(LIB_KVM) Xto your list of libraries (e.g. X.BR "LIBS= \-lintl $(LIB_KVM)" ), Xif your target uses kvm. X. X.TP XLIB_MATH Xa predefined macro that contains the operating system dependent Xname of a library Xthat is needed by programs that use routines of the math library. XAdd X.I "$(LIB_MATH) Xto your list of libraries (e.g. X.BR "LIBS= \-lintl $(LIB_MATH)" ), Xif your target uses math subroutines. X. X.TP XLIB_SOCKET Xa predefined macro that contains the operating system dependent Xname of a library Xthat is needed by programs that use socket calls. XAdd X.I "$(LIB_SOCKET) Xto your list of libraries (e.g. X.BR "LIBS= \-lintl $(LIB_SOCKET)" ), Xif your target uses sockets. Note: this should (for portability reasons) Xeven be done on systems that don't require a socket library because Xthey have the socket interface inside libc. X. X.TP XLIBS_PATH Xthis macro contains the path to a directory where those Xlibraries are located, that have been build during Xa make run inside the current project. X.br XDo not change this macro. X. X.TP XM_ARCH Xthis macro contains the machine architecture for the Xtarget machine (e.g. X.IR "sun3 sun4 ip22 i86pc i586 9000\-725 aviion" ). XIt is set to the output of X.I "arch Xconverted to lower case. XOn systems, where X.I M_ARCH Xis not available, it is set to the content of X.IR K_ARCH . X.br XDo not change this macro. X. X.TP XMK_FILES Xmakefiles that divert into sub makes within the same directory Xmust set X.I MK_FILES Xto be a list of makefile names for the sub makes. XMakefile names for sub makes should have a name that is build Xby adding X.I .mk Xto the base name of the target that is defined inside the Xspecific makefile. X. X.TP XMAKEPROG XSet this macro to the name of your make program if it does Xnot support the macro X.IR MAKE_NAME . XThe make program X.I smake Xis able to identify itself. XIf you want to use a make program that is not able Xto identify itself Xand it's name is not X.IR make , Xset X.I MAKEPROG Xto the name of the make program. XCurrently only X.I gmake Xis supported as alternate value for X.IR MAKEPROG . XIf you want to use an unsupported make program Xyou have to check if it supports the needed features Xfor X.IR makefiles . XYou must write your own rule files for that make program. XIf you want to use X.IR gmake , Xyou should do X.B "setenv MAKEPROG gmake Xbefore you start X.I gmake Xor use a shell script that does this job for you. X. X.TP XMAKE XThis macro is set up by the X.I make Xprogram. XIt contains a path name that is sufficient to recursively Xcall the same X.I make Xprogram again (either that last path component or the full path Xname of the make program). X.br XDo not change this macro. X. X.TP XMAKEFLAGS XThis macro is set up by the X.I make Xprogram. XIt contains the command line flags, X.I make Xis called with. X.br XDo not change this macro. X. X.TP XMAKE_ARCH XThis macro is currently set up by X.B smake Xonly. XIt contains the processor architecture of the target machine X(e.g. mc68020, sparc, pentium). X.br XDo not change this macro. X. X.TP XMAKE_BRAND XThis macro is currently set up by X.B smake Xonly. XIt contains the brand of the target machine X(e.g. Sun_Microsystems(e.g. ). X.br XDo not change this macro. X. X.TP XMAKE_HOST XThis macro is currently set up by X.B smake Xonly. XIt contains the host name of the target machine X(e.g. duffy, sherwood, ghost). X.br XDo not change this macro. X. X.TP XMAKE_MACH XThis macro is currently set up by X.B smake Xonly. XIt contains the kernel architecture of the target machine X(e.g. sun3, sun4c, sun4m, sun4u). X.br XDo not change this macro. X. X.TP XMAKE_MODEL XThis macro is currently set up by X.B smake Xonly. XIt contains the model name of the target machine X(e.g. SUNW,SPARCstation-20). X.br XDo not change this macro. X. X.TP XMAKE_M_ARCH XThis macro is currently set up by X.B smake Xonly. XIt contains the machine architecture of the target machine X(e.g. sun3, sun4). X.br XDo not change this macro. X. X.TP XMAKE_NAME XThis macro is currently set up by X.B smake Xonly. XIt contains the official name of the Xmake program X(e.g. make, smake, gmake). X.br XDo not change this macro. X. X.TP XMAKE_OS XThis macro is currently set up by X.B smake Xonly. XIt contains the operating system name of the target machine X(e.g. sunos, linux, dgux). X.br XDo not change this macro. X. X.TP XMAKE_OSDEFS XThis macro is currently set up by X.B smake Xonly. XIt contains operating system specific defines for the compiler X(e.g. \-D__SVR4). X.br XDo not change this macro. X. X.TP XMAKE_OSREL XThis macro is currently set up by X.B smake Xonly. XIt contains the operating system release name of the target machine X(e.g. 5.5, 4.1.1). X.br XDo not change this macro. X. X.TP XMAKE_OSVERSION XThis macro is currently set up by X.B smake Xonly. XIt contains the operating system version of the target machine X(e.g. generic). X.br XDo not change this macro. X. X.TP XMAKE_SERIAL XThis macro is currently set up by X.B smake Xonly. XIt contains the serial number of the target machine X(e.g. 1920098175). X.br XDo not change this macro. X. X.TP XMANDIR Xall makefiles for manual pages must set this macro to the Xpath name relative to X.I INS_BASE Xwhere the manual page root dir for the project should be. XPossible values for english manual pages are X.IR man " or " share/man , Xpossible values for german manual pages are X.IR man/de " or " share/man/de . X. X.TP XMANFILE Xmakefiles for manual pages set this macro to the name of the Xtroff source file for the manual page X. X.TP XMANSECT Xmakefiles for manual pages set this macro to the macro name that Xcontains the real section name for this manual page. This is Xnecessary because bsd based system have different naming conventions than Xsystem V based systems. See below for a valid list of manual section Xmacros. X.TP XMANSECT_ADMIN XThis macro contains the name of the sub directory for administrative Xcommands and maintenance procedures. X.br XDo not change this macro. X.TP XMANSECT_CMD XThis macro contains the name of the sub directory for general Xuser commands. X.br XDo not change this macro. X.TP XMANSECT_DEMOS XThis macro contains the name of the sub directory for demo Xcommands. X.br XDo not change this macro. X.TP XMANSECT_DEVICE XThis macro contains the name of the sub directory for Xuser level device interfaces. X.br XDo not change this macro. X.TP XMANSECT_DRIVER XThis macro contains the name of the sub directory for Xkernel level device driver interfaces. X.br XDo not change this macro. X.TP XMANSECT_FILEFORM XThis macro contains the name of the sub directory for Xfile formats. X.br XDo not change this macro. X.TP XMANSECT_GAMES XThis macro contains the name of the sub directory for Xgames. X.br XDo not change this macro. X.TP XMANSECT_HDR XThis macro contains the name of the sub directory for Xheader files. X.br XDo not change this macro. X.TP XMANSECT_LIB XThis macro contains the name of the sub directory for Xlibrary function interfaces. X.br XDo not change this macro. X.TP XMANSECT_MACROS XThis macro contains the name of the sub directory for Xtroff macros. X.br XDo not change this macro. X.TP XMANSECT_NETWORK XThis macro contains the name of the sub directory for Xuser level network interfaces. X.br XDo not change this macro. X.TP XMANSECT_SYSCALL XThis macro contains the name of the sub directory for Xsystem call interfaces. XDo not change this macro. X.TP XMANSECT_TABLES XThis macro contains the name of the sub directory for Xtables. XDo not change this macro. X.TP XMANSTYLE XThis macro contains the name that is used to find the right Xordering conventions for manual pages. XDo not change this macro. X.TP XMANSUFFIX Xmakefiles for manual pages set this macro to the macro name that Xcontains the real suffix for this manual page. This is Xnecessary because bsd based system have different naming conventions than Xsystem V based systems. See below for a valid list of manual suffix Xmacros. X.TP XMANSUFF_ADMIN XThis macro contains the name of the file suffix for administrative Xcommands and maintenance procedures. X.br XDo not change this macro. X.TP XMANSUFF_CMD XThis macro contains the name of the file suffix for general Xuser commands. X.br XDo not change this macro. X.TP XMANSUFF_DEMOS XThis macro contains the name of the file suffix for demo Xcommands. X.br XDo not change this macro. X.TP XMANSUFF_DEVICE XThis macro contains the name of the file suffix for Xuser level device interfaces. X.br XDo not change this macro. X.TP XMANSUFF_DRIVER XThis macro contains the name of the file suffix for Xkernel level device driver interfaces. X.br XDo not change this macro. X.TP XMANSUFF_FILEFORM XThis macro contains the name of the file suffix for Xfile formats. X.br XDo not change this macro. X.TP XMANSUFF_GAMES XThis macro contains the name of the file suffix for Xgames. X.br XDo not change this macro. X.TP XMANSUFF_HDR XThis macro contains the name of the file suffix for Xheader files. X.br XDo not change this macro. X.TP XMANSUFF_LIB XThis macro contains the name of the file suffix for Xlibrary function interfaces. X.br XDo not change this macro. X.TP XMANSUFF_MACROS XThis macro contains the name of the file suffix for Xtroff macros. X.br XDo not change this macro. X.TP XMANSUFF_NETWORK XThis macro contains the name of the file suffix for Xuser level network interfaces. X.br XDo not change this macro. X.TP XMANSUFF_SYSCALL XThis macro contains the name of the file suffix for Xsystem call interfaces. XDo not change this macro. X.TP XMANSUFF_TABLES XThis macro contains the name of the file suffix for Xtables. XDo not change this macro. X.TP XMARCH Xthis macro contains the machine architecture for the Xtarget machine (e.g. X.IR "sun3 sun4 ip22 i86pc i586 9000\-725 aviion" ). XIt is set to the output of X.I "arch Xconverted to lower case. XOn systems, where X.I M_ARCH Xis not available, it is set to the content of X.IR K_ARCH . X.br XDo not change this macro unless you want to do a cross compilation. X. X.TP XO_ARCH Xthis macro contains the name of the operating system Xconverted to lower case. XIt is usually the output of: X.IR "uname \-s" . XIt may contain a modified name if the compilation rules Xfor different version of the operating system differ (e.g. Xon X.IR SunOS " and " Solaris , Xthe official operation system name in both cases is X.IR SunOS ). X.br XDo not change this macro. X. X.TP XOARCH Xthis macro contains the object architecture that is used Xfor architecture dependent sub directories. XIt is set to: X.IR "$(PARCH)\-$(O_ARCH)\-$(C_ARCH)" . X.br XDo not change this macro. X. X.TP XOARCHDIR Xthis macro contains the concatenation of X.I OBJ/ Xand X.IR "$(OARCH)" . X.br XDo not change this macro. X. X.TP XOFILES Xthis macro contains the list of objects that are the Xthe dependency list for the target. XIt is constructed from the list of Xassembler source files, Xc source files, Xlex source files and Xyacc source files. X.br XDo not change this macro. X. X.TP XOINCSDIR Xthis macro contains the concatenation of X.I $(SRCROOT)/incs/ Xand X.IR "$(OARCH)" . XIt is the location where include files that are made within a make run Xand subject to global use will be placed. X.br XDo not change this macro. X.TP XOLIBSDIR Xthis macro contains the concatenation of X.I $(SRCROOT)/libs/ Xand X.IR "$(OARCH)" . XIt is the location where libraries that are made within a make run Xwill be placed. X.br XDo not change this macro. X. X.TP XOSDEFS Xthis macro contains operating system specific c-preprocessor Xdefinitions. X.br XDo not change this macro. X. X.TP XOSNAME Xthe unmodified name of the operating system converted to lower case. XSee X.IR O_ARCH . X.br XDo not change this macro. X. X.TP XOSREL Xthe release of the operating system. X.br XDo not change this macro. X. X.TP XP_ARCH Xthis macro contains the processor architecture for the Xtarget machine (e.g. X.IR "mc68020 mc88200 sparc pentium" ). XIt is set to the output of X.I "uname \-p Xconverted to lower case. XOn systems, where X.I P_ARCH Xis not available, it is set to the content of X.IR K_ARCH . X.br XDo not change this macro. X. X.TP XPARCH Xthis macro contains the processor architecture for the Xtarget machine (e.g. X.IR "mc68020 mc88200 sparc pentium" ). XIt is set to the output of X.I "uname \-p Xconverted to lower case. XOn systems, where X.I P_ARCH Xis not available, it is set to the content of X.IR K_ARCH . X.br XDo not change this macro unless you want to do a cross compilation. X. X.TP XRULESDIR Xthe value of this macro must be set before Xthe rules file X.I "$(SRCROOT)/$(RULESDIR/rules.top Xis included. XIf you want to test the behavior of a modified version Xof the X.I makefiles Xin X.IR RULESDIR , Xput a copy into an alternate directory, modify one or more Xfiles in it and then use make with a different value of X.IR RULESDIR , Xthat points to the alternate directory. X. X.TP XRUNPATH Xis evaluated on systems, where X.I LD_RUN_PATH Xis supported. XIt contains the default library search path for dynamic linked targets Xon runtime. XThis search path will be stored inside the target. XThis is usually set in the file X.I $(DEFLTSROOT)/$(DEFLTSDIR)/Defaults Xor X.IR $(DEFLTSROOT)/$(DEFLTSDIR)/Defaults.$(O_ARCH) . XNote that older systems will use X.I LD_LIBRARY_PATH Xfor this purpose too. X. X.TP XSCRFILE Xthis macro must be set in a leaf makefile for shell scripts to define Xthe source for that script file. X. X.TP XSRCFILE Xthis macro must be set in a leaf makefile for localized files to define Xthe source for that file. X. X.TP XSRCROOT Xthis macro contains the relative position to the project's Xsource root directory. XThe value of this macro must be set before Xthe rules file X.I "$(SRCROOT)/$(RULESDIR/rules.top Xis included. X.I SRCROOT Xshould be set to X.I ../.. Xif the appropriate leaf makefile is located two directory Xlevels below the source route. X. X.TP XSUBARCHDIR Xmay be set to put the object files and the target into Xa different directory than usual. X.I SUBARCHDIR Xwill modify the value of X.IR ARCHDIR . XIf you want to make a target that is compiled for X.I dbx Xyou may use: X.IR "make COPTX=\-g SUBARCHDIR=\-dbx" . X. X.TP XTARGET Xall makefiles, that are not referring to library targets or Xsub makes / sub dir makes, Xmust define X.I TARGET Xto be the output file name of the final link operation. X. X.TP XTARGETLIB Xall makefiles that are used to make libraries Xmust define X.I TARGETLIB Xto be the central part of the target library. XIf you want to make e.g. X.I libfoo Xdefine X.IR "TARGETLIB= foo" . XThis is needed to allow operating systems to have different naming Xconventions for libraries. XIf you are making a non shared library, the example above Xwould result in a filename: X.I libfoo.a Xfor the real target. X. X.TP XTARGETMAN Xthis macro must be set in a leaf makefile for manual pages to define Xthe base name for that manual page (not including the suffix). X. X.TP XXMK_FILE Xmakefiles that want to install manual pages should set X.I XMK_FILE Xto X.B Makefile.man Xto avoid having to install a diversion make file. XThe make file found in X.I XMK_FILE Xwill be processed only if X.I make Xis called with the target X.IR install . X X.SH "GETTING STARTED X.PP XTo set up a new project, first copy the X.IR RULES " and " TEMPLATES Xdirectories and all its content into the project's root directory. X.PP XThen copy a top level makefile, a X.I Defaults Xfile and a X.I Targetdirs.archname Xfile into the project's root directory. X.PP XThen create the following directories: X.IR cmd ", " lib ", " include . X.PP XNow start creating target directories e.g below X.IR cmd " and " lib . XDon't forget to create a makefile and an appropriate X.I Targetdirs.archname Xfile on each node directory. X X.SH EXAMPLES X.PP XIf you want to set up a private copy of parts of a project, Xyou should choose a directory inside your directory tree that will become Xthe shadow projects source root directory. XThen create symbolic links named X.IR RULES " and " TEMPLATES Xto the real source root. XIf you don't want to modify the global include files, Xcreate a symbolic link to the X.I include Xdirectory too, else copy the include directory and its content. Xcopy the top level makefile, the X.I Defaults Xfile and the X.I Targetdirs.archname Xfile. X.PP XFinally copy the desired sub tree together with all Xmakefiles and the X.I Targetdirs.archname Xfiles that are located in the directories above Xyour part of the project that you want to have separately. X X.SH FILES X\&.\|.\|./RULES/* X.br X\&.\|.\|./DEFAULTS/* X.br X\&.\|.\|./TARGETS/* X.br X\&.\|.\|./TEMPLATES/* X X.SH "SEE ALSO" X.BR makerules (4), X.BR make (1), X.BR gmake (1), X.BR smake (1). X.PP XIf you want to know, how to add new rules or how to add support Xfor new operating systems or compilers look into X.BR makerules (4). X X.SH DIAGNOSTICS XDiagnostic messages depend on the make program. XHave a look at the appropriate man page. X X.SH NOTES XThe scope of this manual is only the usage of X.BR "leaf makefiles" . XIf you want to make changes to the X.B make rules Xhave a look at X.BR makerules (4). X.PP X.I makefiles Xcan be used with X.IR "Sunpro make" ", " "Gnu make" Xand X.IR smake . XAlthough Gnu make runs on many platforms, it has no useful debug Xoutput. X.PP XUse X.IR "Sunpro make" " or " "smake" Xif you have problems with a makefile. X.IR "Sunpro make" " and " "smake" , Xboth have a \-D flag, that allows you to watch the makefiles Xafter the first expansion. Use this option, if you are in doubt Xif your makefile gets expanded the right way and if the right Xrules are included. XThere is also a \-d option that gives debugging output while Xmake is running. If you want more output, use \-dd, \-ddd and so on. X.PP X.I Smake Xhas an option \-xM that shows you the include dependency for Xmake rules. X X.PP X.ne 20 XThe following is a list of all macros that are used in X.IR makefiles . XDo not use them unless their meaning has been explained Xbefore. X.PP X X.BR \-O_ARCH , X.BR .OBJDIR , X.BR .SEARCHLIST , X.BR ALLTARGETS , X.BR AR , X.BR ARCH , X.BR ARCHDIR , X.BR ARCHDIRX , X.BR ARCH_DONE , X.BR ARFLAGS , X.BR AS , X.BR ASFLAGS , X.BR ASMFILES , X.BR ASOPTS , X.BR ASOPTX , X.BR CC , X.BR CCOM , X.BR CCOM_DEF , X.BR CFILES , X.BR CFLAGS , X.BR CHGRP , X.BR CHMOD , X.BR CHOWN , X.BR CLEAN_FILES , X.BR CLEAN_FILEX , X.BR CLOBBER_FILEX , X.BR COPTDYN , X.BR COPTGPROF , X.BR COPTOPT , X.BR COPTS , X.BR COPTX , X.BR CPP , X.BR CPPFLAGS , X.BR CPPOPTS , X.BR CPPOPTX , X.BR CTAGS , X.BR CURDIR , X.BR CWARNOPTS , X.BR CWOPTS , X.BR C_ARCH , X.BR DEFAULTSDIR , X.BR DEFAULTSROOT , X.BR DEFCCOM , X.BR DEFCCOM_DEF , X.BR DEFINCDIRS , X.BR DEFINCDIRS_DEF , X.BR DEFINSGRP , X.BR DEFINSMODE , X.BR DEFINSUSR , X.BR DEFUMASK , X.BR DEF_ROOT , X.BR DEP_DEP , X.BR DEP_FILE , X.BR DEP_SUFFIX , X.BR DIRNAME , X.BR DIRS , X.BR DYNLD , X.BR ETAGS , X.BR FLOAT_OPTIONS , X.BR HFILES , X.BR HOSTNAME , X.BR INCDIRS , X.BR INSDIR , X.BR INSGRP , X.BR INSGRP_DEF , X.BR INSMODE , X.BR INSMODE_DEF , X.BR INSTALL , X.BR INSUSR , X.BR INSUSR_DEF , X.BR INS_BASE , X.BR INS_KBASE , X.BR KARCH , X.BR KARCH_DEF , X.BR KDEFINES , X.BR K_ARCH , X.BR LD , X.BR LDCC , X.BR LDFLAGS , X.BR LDLIBS , X.BR LDOPTDYN , X.BR LDOPTS , X.BR LDOPTX , X.BR LDPATH , X.BR LIBS , X.BR LIBS_PATH , X.BR LIBX , X.BR LIB_KVM , X.BR LIB_MATH , X.BR LIB_PREFIX , X.BR LIB_SOCKET , X.BR LIB_SUFFIX , X.BR LN , X.BR LNDYNLIB , X.BR LOCALIZE , X.BR LORDER , X.BR MAKE , X.BR MK_FILES , X.BR MAKEPROG , X.BR MAKE_ARCH , X.BR MAKE_HOST , X.BR MAKE_MACH , X.BR MAKE_M_ARCH , X.BR MAKE_NAME , X.BR MAKE_OS , X.BR MAKE_OSDEFS , X.BR MAKE_OSREL , X.BR MANDIR , X.BR MANFILE , X.BR MANSECT , X.BR MANSECT_ADMIN , X.BR MANSECT_CMD , X.BR MANSECT_DEMOS , X.BR MANSECT_DEVICE , X.BR MANSECT_DRIVER , X.BR MANSECT_FILEFORM , X.BR MANSECT_GAMES , X.BR MANSECT_HDR , X.BR MANSECT_LIB , X.BR MANSECT_MACROS , X.BR MANSECT_NETWORK , X.BR MANSECT_SYSCALL , X.BR MANSECT_TABLES , X.BR MANSTYLE , X.BR MANSUFFIX , X.BR MANSUFF_ADMIN , X.BR MANSUFF_CMD , X.BR MANSUFF_DEMOS , X.BR MANSUFF_DEVICE , X.BR MANSUFF_DRIVER , X.BR MANSUFF_FILEFORM , X.BR MANSUFF_GAMES , X.BR MANSUFF_HDR , X.BR MANSUFF_LIB , X.BR MANSUFF_MACROS , X.BR MANSUFF_NETWORK , X.BR MANSUFF_SYSCALL , X.BR MANSUFF_TABLES , X.BR MARCH , X.BR MARCH_DEF , X.BR MKDEP , X.BR MKDEP_OUT , X.BR MKDIR , X.BR MV , X.BR M_ARCH , X.BR OARCH , X.BR OARCHDIR , X.BR OFILES , X.BR OINCSDIR , X.BR OLIBSDIR , X.BR OSDEFS , X.BR OSNAME , X.BR OSREL , X.BR O_ARCH , X.BR PALLDEP_FILE , X.BR PARCH , X.BR PARCH_DEF , X.BR PASMFILES , X.BR PDEP_FILE , X.BR PLOFILES , X.BR POFILES , X.BR PTARGET , X.BR PTARGET_BASE , X.BR PYOFILES , X.BR P_ARCH , X.BR RANLIB , X.BR RM , X.BR RMDEP , X.BR RMTARGET , X.BR RM_FORCE , X.BR RM_RECURS , X.BR RM_RF , X.BR RULESDIR , X.BR RUNPATH , X.BR SCRFILE , X.BR SHELL , X.BR SHL_SUFFIX , X.BR SRCFILE , X.BR SRCLIBS , X.BR SRCROOT , X.BR SUBARCH , X.BR SUBARCHDIR , X.BR SYMLINK , X.BR TAGS , X.BR TARGET , X.BR TARGETLIB , X.BR TARGETMAN , X.BR TARGET_BASE , X.BR TARGET_PATH , X.BR TSORT , X.BR UMASK , X.BR UMASK_DEF , X.BR UMASK_VAL , X.BR XARCH , X.BR XK_ARCH , X.BR XMK_FILE , X.BR XMAKEPROG , X.BR XM_ARCH , X.BR XP_ARCH , X.BR _CCOM , X.BR _DEFAULTSDIR , X.BR _DEFCCOM , X.BR _DEFINSGRP , X.BR _DEFINSMODE , X.BR _DEFINSUSR , X.BR _DEFUMASK , X.BR _DIRNAME , X.BR _INCDIRS , X.BR _MAKEPROG , X.BR _MARCH , X.BR _M_ARCH , X.BR _O_ARCH , X.BR _PARCH , X.BR _P_ARCH , X.BR _UNIQ , X.BR __CCOM , X.BR __DEFAULTSDIR , X.BR __DEFCCOM , X.BR __DEFINSGRP , X.BR __DEFINSMODE , X.BR __DEFINSUSR , X.BR __DEFUMASK , X.BR __DIRNAME , X.BR __INCDIRS , X.BR __MAKEPROG , X.BR __MARCH , X.BR __M_ARCH , X.BR __PARCH , X.BR __P_ARCH , X X.SH BUGS X X.SH "Source Tree Hierarchy X.LP XThe following outline gives a quick tour through a typical Xsource hierarchy: X.LP X.na X.nh X.PD 0 X.TP X.B .../ Xroot directory of the source tree X. X.RS X.TP X.B Makefile Xthe top Makefile X.TP X.B Targetdirs Xa file containing a list of directories that are needed Xfor that project. XIf the system needs different target lists depending Xon the target system architecture , use target specific files in X.B .../TARGETS/ X.TP X\&.\|.\|. X.RE X. X.TP X.B .../RULES/ Xthe location of makefiles (included rules) X. X.RS X.TP X.B rules.top Xthe mandatory include rules (needed to setup basic rules) X.TP X.B rules.aux Xrules needed to install a non localized auxiliary file X.TP X.B rules.cmd Xrules needed to make an ordinary command (like /bin/sh) X.TP X.B rules.drv Xrules needed to make a device driver X.TP X.B rules.lib Xrules needed to make a standard (nonshared) library X.TP X.B rules.loc Xrules needed to install a localized auxiliary file X.TP X.B rules.man Xrules needed to install a localized manual page X.TP X.B rules.scr Xrules needed to install a localized shell script X.TP X.B rules.shl Xrules needed to make a shared library X.TP X.B rules.mks Xrules needed to make more than one target in a specific directory X.TP X.B rules.dir Xrules needed to make targets that are located in sub directories Xto the current directory X.TP X\&.\|.\|. X.RE X. X.TP X.B .../DEFAULTS/ Xdefault definitions for various target architectures are Xlocated in this directory. Templates for some architectures can Xbe found in the X.I .../TEMPLATES/ Xdirectory. X.RS X.TP X.B Defaults Xdefault definitions for that source tree. System dependent Xdefinitions are in X.B .../DEFAULTS/Defaults.* X.RE X.TP X.B .../TARGETS/ Xtarget list definitions for various target architectures are Xlocated in this directory. X.TP X.B .../TEMPLATES/ Xtemplates that should be used inside the project X(rename to Makefile, if it is the only makefile in that directory, Xrename to X.I target.mk, Xif there is more than one target in that directory) X. X.RS X.TP X.B Defaults XDefaults file for the source root directory X.TP X.B Defaults.linux XDefaults file for X.IR linux . XThis should be installed in the X.B .../DEFAULTS/ Xdirectory. X.TP X.B Makefile.root XMakefile for the source root directory X.TP X.B Makefile.aux XMakefile for a non localized auxiliary file X.TP X.B Makefile.cmd XMakefile for an ordinary command (like /bin/sh) X.TP X.B Makefile.lib XMakefile for a standard (nonshared) library X.TP X.B Makefile.loc XMakefile for a localized auxiliary file X.TP X.B Makefile.man XMakefile for a localized manual page X.TP X.B Makefile_de.man XMakefile for a localized manual page in the german locale X.TP X.B Makefile.scr XMakefile for a localized shell script X.TP X.B Makefile.shl XMakefile for a shared library X.TP X.B Makefile.drv XMakefile for a device driver X.TP X.B Makefile.mks XMakefile for more than one target in a specific directory X.TP X.B Makefile.dir XMakefile for targets that are located in sub directories Xto the current directory X.TP X\&.\|.\|. X.RE X. X.TP X.B .../cmd/ Xsource tree for normal commands X. X.RS X.TP X.B Makefile Xthe makefile for the X.I cmd Xsub directory X.TP X.B Targetdirs.sun4m Xa file containing a list of directories like X.I myprog X(see below) that are needed Xfor that specific architecture. X.TP X.B myprog/ Xdirectory where the sources for a specific command are located X. X.RS X.TP XMakefile Xmakefile for X.I myprog X.TP XMakefile.man Xmakefile for the manual page of X.I myprog X.TP Xmprog.c Xsource for myprog X.TP Xmprog.tr Xtroff source for the manual page of myprog X.TP X.B OBJ/ Xdirectory where system specific sub directories are located X. X.RS X.TP X.B sparc\-sunos5\-cc/ Xdirectory for binaries that belong to a specific system X.TP X\&.\|.\|. X.RE X.TP X\&.\|.\|. X.RE X.br X.TP X\&.\|.\|. X.RE X.br X.ne 5 X.TP X.B .../lib/ Xdirectory where the sources for a libraries are located X. X.RS X.TP X.B Makefile Xthe makefile for the X.I lib Xsub directory X.TP X.B Targetdirs.sun4m Xa file containing a list of directories like X.I libfoo X(see below) that are needed Xfor that specific architecture. X.TP X.B libfoo/ Xdirectory where all source files for libfoo are located X.TP X\&.\|.\|. X.RE X. X.TP X.B .../kernel Xdirectory for kernel modules X. X.RS X.TP X.B Makefile Xthe makefile for the X.I kernel Xsub directory X.TP X.B Targetdirs.sun4m Xa file containing a list of directories like X.I drv X(see below) that are needed Xfor that specific architecture. X.TP X.B drv/ Xdirectory where drivers are located X. X.RS X.TP X.B Makefile Xthe makefile for the X.I drv Xsub directory X.TP X.B Targetdirs.sun4m Xa file containing a list of directories like X.I mydrv X(see below) that are needed Xfor that specific architecture. X.TP X.B mydrv/ Xsource for a specific driver X.TP X\&.\|.\|. X.RE X. X.TP X\&.\|.\|. X.RE X. X.TP X.B .../include Xdirectory for global include files that are used in that project X. X.TP X.B .../bins Xdirectory for binary programs that are created/needed while compiling Xthe project X.RS X.TP X.B sparc\-sunos5\-cc/ Xdirectory for binaries that belong to a specific system X.TP X\&.\|.\|. X.RE X. X.TP X.B .../libs Xdirectory for libraries that are created/needed while compiling Xthe project X.RS X.TP X.B sparc\-sunos5\-cc/ Xdirectory for libraries that belong to a specific system X.TP X\&.\|.\|. X.RE X. X.TP X.B .../incs Xdirectory for include files that are created/needed while compiling Xthe project X.RS X.TP X.B sparc\-sunos5\-cc/ Xdirectory for include files that belong to a specific system X.TP X\&.\|.\|. X.RE X.TP X\&.\|.\|. X.RE X. X.ad X.PD X X.SH AUTHOR X.nf XJ\*org Schilling XSeestr. 110 XD-13353 Berlin XGermany X.fi X.PP XMail bugs and suggestions to: X.PP X.B Xjoerg.schilling@fokus.fraunhofer.de Xor X.B Xjoerg@schily.net END-of-star-1.6/man/man4/makefiles.4 echo x - star-1.6/man/man4/makerules.4 sed 's/^X//' >star-1.6/man/man4/makerules.4 << 'END-of-star-1.6/man/man4/makerules.4' X. \" @(#)makerules.4 1.4 18/09/17 Copyr 1996-2018 J. Schilling X. \" System Manual page for makefile system X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.\".TH makefiles 4L "14. February 1997" "J\*org Schilling" "Schily\'s FILE FORMATS" X.TH makerules 4L "2018/09/17" "J\*org Schilling" "File Formats" X.SH NAME Xmakerules \- system programmers guide for compiling projects on different platforms X.SH SYNOPSIS X.B "SRCROOT= .\|. X.br X.B "RULESDIR= RULES X.br X.B "include $(SRCROOT)/$(RULESDIR)/rules.top X.br X.I "local defines are here X.br X.B "include $(SRCROOT)/$(RULESDIR)/rules.* X.PP XSee chapter CURRENTLY SUPPORTED TARGET TYPES for possible values of X.BR "rules.*" . X X.SH DESCRIPTION XMakerules is a set of rules that allows compiling of structured Xprojects with small and uniformly structured makefiles. XAll rules are located in a central directory. XCompiling the projects on different platforms can be done Xsimultaneously without Xthe need to modify any of the makefiles that are located Xin the projects directories. X.PP XMakerules is a set of high level portability tools superior to X.B autoconf Xand easier to use. X.PP XThree make programs are currently supported: X.IR "Sunpro make" , X.I "GNU make" Xand X.IR smake . XIf you want to add support for other make programs, read the Xsections about the minimum requirements for a make program Xand about the structure of the X.B "make rule Xsystem. X.PP XThis manual will help programmers who need to make modifications Xon the make rule system itself. If you want to know something Xon how to use the X.B "makefile system Xhave a look at X.BR makefiles (4). X.PP XThe main design goal was to have no definition on more than place Xin the make rules. This implies that system programmers who Xwant to add or modify rules must follow this goal in order not to Xdestroy functionality in other places. X.PP XThe visible result for the user is a set of small and easy to read Xmakefiles, each located in the project's leaf directory and therefore Xcalled X.IR leaf -makefile. X.PP XEach of these X.IR leaf -makefiles, Xin fact contains no rule at all. It simply defines some macros Xfor the X.IR make -program Xand includes two files from a central make rule depository. XThese included files define the rules that are needed to compile Xthe project. X.PP XEach X.IR leaf -makefile Xis formed in a really simple way: X.TP X\(bu XIt first defines two macros that define the relative location Xof the project's root directory and the name of the directory Xthat contains the complete set of of rules and then includes Xthe rule file X.I rules.top Xfrom the directory that forms the central rule depository. XYou only have to edit the macro X.I SRCROOT Xto reflect the relative location of the project's root directory. X.TP X\(bu XThe next part of a X.IR leaf -makefile Xdefines macros that describe the target and the source. XYou can only have one target per X.IR leaf -makefile. XOf course, there may be many source files, that are needed to create Xthat target. XIf you want to make more than one target in a specific directory, Xyou have to put more than one makefile into that directory. XThis is the part of a makefile that describes a unique target. XEdit this part to contain all source files, all local include files Xand all non global compile time flags that are needed for your target. XFor a typical target this is as simple as filling in a form. X.TP X\(bu XEach X.IR leaf -makefile Xfinally includes a file from the rules directory that contains Xrules for the appropriate type of target that is to be made Xfrom this X.IR leaf -makefile. X.PP XThe makefile in each directory has to be called X.IR Makefile . XIf you want to have more than one makefile in a specific directory, Xyou have to choose different names for the other makefiles. X X.SH "Currently Supported Target Types X.PP XThere are rules for the following type of targets: X.TP 20 Xcommands XThe make rules for user level commands like X.IR cat ", " ls Xetc. are located in the file X.I rules.cmd X.TP Xdrivers XThe make rules for device drivers Xare located in the file X.I rules.drv X.TP Xlibraries XThe make rules for non shared libraries Xare located in the file X.I rules.lib X.TP Xshared libraries XThe make rules for shared libraries Xare located in the file X.I rules.shl X.TP Xlocalized files XThe make rules for localized files Xare located in the file X.I rules.loc X.TP Xnonlocalized files XThe make rules for non localized files Xare located in the file X.I rules.aux X.TP Xshell scripts XThe make rules for shell scripts (a variant of localized files) Xare located in the file X.I rules.scr X.TP Xmanual pages XThe make rules for manual pages (a variant of localized files) Xare located in the file X.I rules.man X.TP Xdiverted makefiles XThe make rules for projects that need to have more than Xone makefile in a specific directory Xare located in the file X.I rules.mks XIt contains a rule that diverts to the listed sub makefiles. XEach sub makefile may be of any type. X.TP Xdirectories XThe make rules for sub directories Xare located in the file X.I rules.dir X X.SH "Minimum Requirements For A Make Program XThe make rules currently have support for X.IR "Sunpro make" , X.I "GNU make" Xand X.IR smake . XIf you like to add support for other make programs, Xthey need to have some minimal features that go Xbeyond the capabilities of the standard X.SM "UNIX X.B make Xprogram. X.I BSDmake Xcould be supported if it supports pattern matching rules correctly. X.TP 20 Xinclude XThe make program must be able to recursively include other files Xfrom within a X.I makefile. XThe name if the file to include must be allowed to be a macro. XThe make program must be able to do this in a way that Xif the file that should be included may be a result of make rule. Xe.g if the file to be included does not exist or is outdated, Xit should be built before an attempt is made to actually include it. X.TP Xappending to a macro XA macro reference of the form: X.sp X.B "macro += addval X.sp Xshould append X.B addval Xto the string that is currently in X.BR macro . X.TP Xsuffix macro replacement XA macro reference of the form: X.sp X.B "out= $(macro\|:\|string1\|=\|string2) X.sp Xshould replace a suffix X.I string1 Xto X.I string2 Xin all words that are in X.BR macro , Xwhere string1 is either a suffix, or a word to be replaced Xin the macro definition, and string2 is the replacement Xsuffix or word. X.I String1 Xand X.I string2 Xmust be replaced correctly even if they are macros themselves. XWords in a macro value are separated by SPACE, XTAB, and escaped NEWLINE characters. X.TP Xpattern macro replacement XA macro reference of the form: X.sp X.B "out= $(macro\|:\|op%os\|=\|np%ns) X.sp Xshould replace a central pattern in X.BR macro , Xwhere X.B op Xis the existing (old) prefix and X.B os Xis the existing X(old) suffix, X.B np Xand X.B ns Xare the new prefix and new suffix, Xrespectively, and the pattern matched by % (a string of zero Xor more characters), is carried forward from the value being Xreplaced. XFor example: X.sp X.B "PROGRAM=fabricate X.br X.B "DEBUG= $(PROGRAM:%=tmp/%\-g) X.sp Xsets the value of DEBUG to tmp/fabricate\-g. X.IR Op ", " os ", " X.IR np " and " ns Xmust be replaced correctly even if they are macros themselves. X X.SH "Understanding Basic Algorithms XOne of the basic algorithms used in the make rule system Xis needed to set an undefined macro to a guaranteed default value. XBecause not all make programs have support for X.I "if then else Xstructures, a different method has to be used. X.PP XThe method used in X.B "make rules Xis implemented by using X.B "suffix macro replacement Xand X.BR "pattern macro replacement" . X.PP X.ne 5 XFirst, a macro that contains a unique suffix is defined: X.sp X.B " # Define magic unique cookie X.br X.B " _UNIQ= .XxZzy\- X.sp XThis macro is used for all places where it is necessary to have Xa macro with a guaranteed default value. XThe following example shows the basic algorithm that is used to Ximplement the phrase: X.B If X.I $(MAKE_NAME) Xcontains a value, X.B then X.I $(XMAKEPROG) Xwill be set to X.I $(MAKE_NAME) X.B else X.I $(XMAKEPROG) Xwill be set to X.IR $(MAKEPROG) . X.sp X.B " _MAKEPROG= $(_UNIQ)$(MAKE_NAME) X.br X.B " __MAKEPROG= $(_MAKEPROG:$(_UNIQ)=$(MAKEPROG)) X.br X.B " XMAKEPROG= $(__MAKEPROG:$(_UNIQ)%=%) X.sp XThe first line in this example, sets the macro X.I _MAKEPROG Xto the concatenation of the value of X.I MAKE_NAME Xand X.BR .XxZzy\- . XIf the macro X.I MAKE_NAME Xis empty at this time, X.I _MAKEPROG Xwill contain only X.BR .XxZzy\- . X.PP XIn the second line, X.I __MAKEPROG Xis set to the value of X.IR _MAKEPROG . XIf X.I _MAKEPROG Xcontains only X.B .XxZzy\- Xthis implies, that X.B .XxZzy\- Xis the suffix. This suffix is then replaced Xby the value of X.IR MAKEPROG , Xin this case X.I __MAKEPROG Xwill contain the unmodified value of X.IR MAKEPROG . XIf X.I _MAKEPROG Xcontains a concatenation of X.B .XxZzy\- Xand something else, X.B .XxZzy\- Xwill not be a suffix, but a prefix of X.I _MAKEPROG Xand for this reason X.I __MAKEPROG Xwill contain the unmodified value of X.IR _MAKEPROG , Xwhich is a concatenation of X.B .XxZzy\- Xand the value of X.IR MAKE_NAME . X.PP XIn the third line, X.I XMAKEPROG Xis set to the value of X.IR __MAKEPROG . XIf X.I __MAKEPROG Xhas the prefix X.B .XxZzy\- Xat this time, X.B .XxZzy\- Xis stripped of. X X.SH "The Structure in Make Macro names X.PP XThe names used for X.B "make macros Xare structured in a way that allows to use X.BR grep (1) Xto look for the names in the X.B make rules. XTo allow this, no name must be a substring of another name. X.PP XIf a command needs options that have to be specified Xin macros, there is a X.B "make macro Xthat is named X.I XXXFLAGS. XThis is compliant to usual make file rules. XThe are internal X.B "make macros Xcalled X.I XXXOPTS Xand X.I XXXOPTX Xthat will be combined for X.IR XXXFLAGS : X.sp X.B "LDFLAGS= $(LDOPTS) $(LDOPTX) X.sp XWhere X.I XXXOPTS Xis the name of the macro that is used internally Xand X.I XXXOPTX Xis the name of the macro that may be used from the Xcommand line of the make program. X.I XXXOPTX Xtherefore is used to append to the content of X.I XXXFLAGS XIf the value of X.I XXXFLAGS Xneed to be overwritten, X.I XXXOPTS Xmay be used within the command line flags of the make program. X X.SH "The Structure Of The Make Rule System X.SH "The Structure Of The Basic Rules in rules.top XThe file X.B RULES/rules.top Xfirst includes a rule file that depends on the Xmake program that is used. XThe name of this file is X.BI RULES/mk\- makeprog .id Xwhere X.I makeprog Xhas to be replaced by the real name of Xthe makeprogram e.g. X.BR make ", " gmake ", " smake . XThe purpose of this file is to set up a list of macros Xthat identify the system where the project is currently built. XThese macros have values that contain only lower case letters and define: X.TP 28 Xthe processor architecture XIf two systems run the same operating system, this Xis a unique value if a simple user level program will Xnot need to be recompiled in order to run on the other system. XPossible values are X.BR sparc ", " mc68020 ", " pentium . XThis is the output of X.BR "uname \-p" . XThe value is stored in X.BR P_ARCH . X.TP Xthe kernel architecture XIf two systems may use the same value for X.B P_ARCH Xbut a heavily system dependent user level program Xneed to be recompiled in order to run on the other Xsystem, These two systems have different Xkernel architectures. XThis is the output of X.BR "uname \-m" . XPossible values are X.BR sun3 ", " sun4c ", " sun4m . XThe value is stored in X.BR K_ARCH . X.TP Xthe machine architecture XAn outdated macro that is useful only on sun systems. XDo not use this, use X.B P_ARCH Xinstead. XThis is the output of X.BR arch . XPossible values are X.BR sun3 ", " sun4 . XThe value is stored in X.BR M_ARCH . X.TP Xthe hostname XThe name of the machine where the compilation takes place. XThis is the output of X.BR "uname \-n" . XThe value is stored in X.BR HOSTNAME . X.TP Xthe name of the operating system XThis is the output of X.BR "uname \-s" . XPossible values are X.BR sunos ", " dgux ", " hp\-ux ", " irix . XThe value is stored in X.BR OSNAME . X.TP Xthe release of the operating system XThis is the output of X.BR "uname \-r" . XPossible values are X.BR 5.5 ", " 4.1.4 . XThe value is stored in X.BR OSREL . X.PP XThe next file to be included from X.B RULES/rules.top Xis X.BI RULES/os\- "operating system" .id . XIt defines the macros X.B O_ARCH Xand X.B \-O_ARCH Xand may modify one of the macros that are defined Xin X.BI RULES/mk\- makeprog .id . XThe macros X.B O_ARCH Xand X.B \-O_ARCH Xare used to distinguish between different operating systems. XThe names of the compiler configuration files have X.B \-O_ARCH Xas a central part. XOn some operating systems e.g. X.B SunOS Xand X.B DG\-UX Xit is necessary to distinguish between X.B "SunOS 4.x Xand X.B "SunOS 5.x Xor X.B "DG\-UX 3.x Xand X.B "DG\-UX 4.x. X.PP XThe next file to be included from X.B RULES/rules.top Xis X.BR Defaults . XIt defines the macros X.B DEFCCOM X, X.B DEFINCDIRS X, X.B LDPATH X, X.B RUNPATH X, X.B INS_BASE Xand X.BR INS_KBASE . XIf the definitions have to be different on Xdifferent systems, this file may contain a line int the form: X.sp X.BI include " $(SRCROOT)" /Defaults. $(O_ARCH) X.sp XThe actual definitions then have to be moved into Xthese files. X.PP XNext, after setting up some internal defaults, X.B RULES/rules.top Xincludes the compiler configuration file with Xthe name: X.sp X.I $(SRCROOT)/$(RULESDIR)/$(XARCH).rul X.sp XThis file contains all necessary X.B system dependent Xstuff that is needed to configure the C-compiler Xon the appropriate system. XIt is a bad idea to create a new one from scratch. XHave a look at the other compiler configuration Xfiles and modify a similar file for your needs. XNote that there are basically two criterias to Xthat are important in a compiler configuration file. XOne is whether the system uses the X.I ELF Xheader format or not. XThe other is whether the system uses X.I shared libraries Xor not. X X.SH "The Structure Of The Application Specific Rules X.PP XThe application specific rule files are designed in Xsuch a way that they include all necessary stuff that Xis needed for that specific task. The application specific Xrule files are: X.TP 25 X$(RULES)/rules.aux XRules for installing non localized auxiliary files. X.TP X$(RULES)/rules.cmd XRules for commands like X.I sh. X.TP X$(RULES)/rules.dir XRules for sub directories. X.TP X$(RULES)/rules.drv XRules for lodable drivers. X.TP X$(RULES)/rules.lib XRules for static libraries. X.TP X$(RULES)/rules.loc XRules for installing localized auxiliary files. X.TP X$(RULES)/rules.man XRules for installing localized manual pages. X.TP X$(RULES)/rules.mks XRules for sub makefiles. X.TP X$(RULES)/rules.mod XRules for lodable stream modules. X.TP X$(RULES)/rules.scr XRules for installing localized shell scripts. X.TP X$(RULES)/rules.shl XRules for shared libraries. X X.SH "Understanding The Structure Of The Make Rule System X.PP XTo understand the structure of the X.B "make rule Xsystem while doing changes, try to use the X.B \-xM Xflag Xin the X.B smake Xprogram. XThis flag will print out the include dependency list X(i.e. a list that tell you which make rules is included Xfrom which other rule). X.PP XNote that some of the rules are make program dependent. XIf you want to make changes to these rules you may need to Xplace the definitions into separate rule files Xeach for the appropriate make program. XHave a look into the X.B RULES Xdirectory Xfor some examples. X X.SH FILES X\&.\|.\|./RULES/* X.br X\&.\|.\|./DEFAULTS/* X.br X\&.\|.\|./TARGETS/* X.br X\&.\|.\|./TEMPLATES/* X X.SH "SEE ALSO" X.BR makefiles (4), X.BR make (1), X.BR gmake (1), X.BR smake (1). X X.SH DIAGNOSTICS XDiagnostic messages depend on the make program. XHave a look at the appropriate man page. X X.SH NOTES X.PP XThe make rules Xcan be used with X.IR "Sunpro make" ", " "Gnu make" Xand X.IR smake . XAlthough Gnu make runs on many platforms, it has no useful debug Xoutput. X.PP XUse X.IR "Sunpro make" " or " "smake" Xif you have problems with a makefile. X.IR "Sunpro make" " and " "smake" , Xboth have a \-D flag, that allows you to watch the makefiles Xafter the first expansion. Use this option, if you are in doubt Xif your makefile gets expanded the right way and if the right Xrules are included. XThere is also a \-d option that gives debugging output while Xmake is running. If you want more output, use \-dd, \-ddd and so on. X.PP X.I Smake Xhas an option \-xM that shows you the include dependency for Xmake rules. X X.SH BUGS X X.SH "Source Tree Hierarchy X.LP XThe following outline gives a quick tour through a typical Xsource hierarchy: X.LP X.na X.nh X.PD 0 X.TP X.B .../ Xroot directory of the source tree X. X.RS X.TP X.B Makefile Xthe top Makefile X.TP X.B Defaults Xdefault definitions for that source tree. System dependent Xdefinitions are in X.B .../DEFAULTS/ X.TP X.B Targetdirs Xa file containing a list of directories that are needed Xfor that project. XIf the system needs different target lists depending Xon the target system architecture , use target specific files in X.B .../TARGETS/ X.TP X\&.\|.\|. X.RE X. X.TP X.B .../RULES/ Xthe location of makefiles (included rules) X. X.RS X.TP X.B rules.top Xthe mandatory include rules (needed to setup basic rules) X.TP X.B rules.aux Xrules needed to install a non localized auxiliary file X.TP X.B rules.cmd Xrules needed to make an ordinary command (like /bin/sh) X.TP X.B rules.drv Xrules needed to make a device driver X.TP X.B rules.lib Xrules needed to make a standard (nonshared) library X.TP X.B rules.loc Xrules needed to install a localized auxiliary file X.TP X.B rules.man Xrules needed to install a localized manual page X.TP X.B rules.scr Xrules needed to install a localized shell script X.TP X.B rules.shl Xrules needed to make a shared library X.TP X.B rules.mks Xrules needed to make more than one target in a specific directory X.TP X.B rules.dir Xrules needed to make targets that are located in sub directories Xto the current directory X.TP X\&.\|.\|. X.RE X. X.TP X.B .../DEFAULTS/ Xdefault definitions for various target architectures are Xlocated in this directory. Templates for some architectures can Xbe found in the X.I .../TEMPLATES/ Xdirectory. X.TP X.B .../TARGETS/ Xtarget list definitions for various target architectures are Xlocated in this directory. X.TP X.B .../TEMPLATES/ Xtemplates that should be used inside the project X(rename to Makefile, if it is the only makefile on that directory, Xrename to X.I target.mk, Xif there is more than one target in that directory) X. X.RS X.TP X.B Defaults XDefaults file for the source root directory X.TP X.B Defaults.linux XDefaults file for X.IR linux . XThis sould be installed in the X.B .../DEFAULTS/ Xdirectory. X.TP X.B Makefile.root XMakefile for the source root directory X.TP X.B Makefile.aux XMakefile for a non localized auxiliary file X.TP X.B Makefile.cmd XMakefile for an ordinary command (like /bin/sh) X.TP X.B Makefile.lib XMakefile for a standard (nonshared) library X.TP X.B Makefile.loc XMakefile for a localized auxiliary file X.TP X.B Makefile.man XMakefile for a localized manual page X.TP X.B Makefile_de.man XMakefile for a localized manual page in the german locale X.TP X.B Makefile.scr XMakefile for a localized shell script X.TP X.B Makefile.shl XMakefile for a shared library X.TP X.B Makefile.drv XMakefile for a device driver X.TP X.B Makefile.mks XMakefile for more than one target in a specific directory X.TP X.B Makefile.dir XMakefile for targets that are located in sub directories Xto the current directory X.TP X\&.\|.\|. X.RE X. X.TP X.B .../cmd/ Xsource tree for normal commands X. X.RS X.TP X.B Makefile Xthe makefile for the X.I cmd Xsub directory X.TP X.B Targetdirs.sun4m Xa file containing a list of directories like X.I myprog X(see below) that are needed Xfor that specific architecture. X.TP X.B myprog/ Xdirectory where the sources for a specific command are located X. X.RS X.TP XMakefile Xmakefile for X.I myprog X.TP XMakefile.man Xmakefile for the manual page of X.I myprog X.TP Xmprog.c Xsource for myprog X.TP Xmprog.tr Xtroff source for the manual page of myprog X.TP X.B OBJ/ Xdirectory where system specific sub directories are located X. X.RS X.TP X.B sparc\-sunos5\-cc/ Xdirectory for binaries that belong to a specific system X.TP X\&.\|.\|. X.RE X.TP X\&.\|.\|. X.RE X.br X.TP X\&.\|.\|. X.RE X.br X.ne 5 X.TP X.B .../lib/ Xdirectory where the sources for a libraries are located X. X.RS X.TP X.B Makefile Xthe makefile for the X.I lib Xsub directory X.TP X.B Targetdirs.sun4m Xa file containing a list of directories like X.I libfoo X(see below) that are needed Xfor that specific architecture. X.TP X.B libfoo/ Xdirectory where all source files for libfoo are located X.TP X\&.\|.\|. X.RE X. X.TP X.B .../kernel Xdirectory for kernel modules X. X.RS X.TP X.B Makefile Xthe makefile for the X.I kernel Xsub directory X.TP X.B Targetdirs.sun4m Xa file containing a list of directories like X.I drv X(see below) that are needed Xfor that specific architecture. X.TP X.B drv/ Xdirectory where drivers are located X. X.RS X.TP X.B Makefile Xthe makefile for the X.I drv Xsub directory X.TP X.B Targetdirs.sun4m Xa file containing a list of directories like X.I mydrv X(see below) that are needed Xfor that specific architecture. X.TP X.B mydrv/ Xsource for a specific driver X.TP X\&.\|.\|. X.RE X. X.TP X\&.\|.\|. X.RE X. X.TP X.B .../include Xdirectory for global include files that are used in that project X. X.TP X.B .../bins Xdirectory for binary programs that are created/needed while compiling Xthe project X.RS X.TP X.B sparc\-sunos5\-cc/ Xdirectory for binaries that belong to a specific system X.TP X\&.\|.\|. X.RE X. X.TP X.B .../libs Xdirectory for libraries that are created/needed while compiling Xthe project X.RS X.TP X.B sparc\-sunos5\-cc/ Xdirectory for libraries that belong to a specific system X.TP X\&.\|.\|. X.RE X. X.TP X.B .../incs Xdirectory for include files that are created/needed while compiling Xthe project X.RS X.TP X.B sparc\-sunos5\-cc/ Xdirectory for include files that belong to a specific system X.TP X\&.\|.\|. X.RE X.TP X\&.\|.\|. X.RE X. X.ad X.PD X X.SH AUTHOR X.nf XJ\*org Schilling XSeestr. 110 XD-13353 Berlin XGermany X.fi X.PP XMail bugs and suggestions to: X.PP X.B Xjoerg.schilling@fokus.fraunhofer.de Xor X.B Xjoerg@schily.net END-of-star-1.6/man/man4/makerules.4 echo x - star-1.6/man/man4/Makefile sed 's/^X//' >star-1.6/man/man4/Makefile << 'END-of-star-1.6/man/man4/Makefile' X#ident "%W% %E% %Q%" X########################################################################### X# Sample makefile for sub-makes in one directory X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMK_FILES= makefiles.mk makerules.mk X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.mks X########################################################################### END-of-star-1.6/man/man4/Makefile echo x - star-1.6/man/man4/makefiles.mk sed 's/^X//' >star-1.6/man/man4/makefiles.mk << 'END-of-star-1.6/man/man4/makefiles.mk' X#ident %W% %E% %Q% X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= makefiles XMANSECT= $(MANSECT_FILEFORM) XMANSUFFIX= $(MANSUFF_FILEFORM) XMANFILE= makefiles.4 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/man/man4/makefiles.mk echo x - star-1.6/man/man4/makerules.mk sed 's/^X//' >star-1.6/man/man4/makerules.mk << 'END-of-star-1.6/man/man4/makerules.mk' X#ident %W% %E% %Q% X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= makerules XMANSECT= $(MANSECT_FILEFORM) XMANSUFFIX= $(MANSUFF_FILEFORM) XMANFILE= makerules.4 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/man/man4/makerules.mk echo x - star-1.6/man/Makefile sed 's/^X//' >star-1.6/man/Makefile << 'END-of-star-1.6/man/Makefile' X#ident %W% %E% %Q% X########################################################################### X# Sample makefile for sub directory makes X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XDIRS= man1 man4 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.dir X########################################################################### END-of-star-1.6/man/Makefile echo c - star-1.6/READMEs mkdir -p star-1.6/READMEs > /dev/null 2>&1 echo x - star-1.6/READMEs/README.aix sed 's/^X//' >star-1.6/READMEs/README.aix << 'END-of-star-1.6/READMEs/README.aix' XYou need to use GNUmake or my smake to compile on AIX X XRead the file README.compile before compiling. X XNOTE: AIX seems to have a kernel bug in the mmap() part X that may cause kernel panics. X XIf you observe this kernel panic, try to add a line: X XCOPTS += -DUSE_USGSHM X Xto the file cdrecord/Makefile X Xor compile the package using: X Xmake COPTX=-DUSE_USGSHM X XIt seems that SVrx style shared memory does not have this kernel bug XIn newer AIX releases, the mmap() kernel problem seems to be fixed. X XIf you like to create bootable CD's for AIX on the CHRP architecture: X X The /usr/sbin/mkcd command starting shipping with X AIX 4.3.3 back in Oct 99'. It's installed by default with the system. X There's more info about it in /usr/lpp/bos.sysmgt/mkcd.README.html. X X XNOTE: there is currently no real SCSI generic support for AIX, so X cdrecord -scanbus will not work. X X /dev/rcd0 is mapped to dev=0,0,0 X /dev/rcd1 is mapped to dev=0,1,0 END-of-star-1.6/READMEs/README.aix echo x - star-1.6/READMEs/README.gmake sed 's/^X//' >star-1.6/READMEs/README.gmake << 'END-of-star-1.6/READMEs/README.gmake' XGmake compliance is included for convenience because it may Xbe found on many systems and most make programs are worse Xthan gmake. X X ***** If you are on a platform that is not yet known by the ***** X ***** Schily makefilesystem you cannot use GNU make. ***** X ***** In this case, the automake features of smake are required. ***** X XThe major problem with gmake is that it does not handle the Xinclude directive correctly. The general rule for a make program is Xto first try to "make" any object it should look on. Gmake Xdoes not try to "make" any makefile it should include. One result Xis many warnings about non-existent files (which you could ignore). XThe other problem with gmake and include files is hat gmake Xincludes the files in the opposite order than expected. The result is Xthat dependencies may not handled correctly. X XIf you have problems with the make file system and gmake, Xyou are out of luck. Gmake has a debug option, but it gives Xtons of debug messages. Less than 1% of these debug messages are Xuseful. Important things are missing in these debug messages. X XGmake has bug with the VPATH= option. Some of the macros are Xnot expanded correctly. I had to remove all occurrences of X$@ $* and $^ on some places for this reason. X XOn some platforms (e.g. OSF1), gmake is not able to correctly recognize Xthe default target. If gmake complains about this, call ./Gmake all X XTo use GNU make create a file called 'Gmake' in you search path Xthat contains: X X#!/bin/sh XMAKEPROG=gmake Xexport MAKEPROG Xexec gmake "$@" X Xand call 'Gmake' instead of gmake. On Linux and on Cygwin there is Xno gmake, 'make' on Linux and on Cygwin is really a gmake. X X'Gmake' and 'Gmake.linux' are part of this distribution. X XNote that makefile versions past 98/10/13 are trying to recognize Xgmake by assuming that $(MAKE_COMMAND) is only present if you Xare running gmake. So it may be worth to try to just call 'gmake' Xor even 'make' if your system uses gmake as the default make program. X END-of-star-1.6/READMEs/README.gmake echo x - star-1.6/READMEs/README.hpux sed 's/^X//' >star-1.6/READMEs/README.hpux << 'END-of-star-1.6/READMEs/README.hpux' X I M P O R T A N T X XOn HP-UX-11.x the maximal data size (allocated data) of a 32 bit program is X64 MB. X XOne solution is to build a 64 bit binary, for those the default process memory Xlimit is 1 GB. X X64bit binaries can be created with X X cc +DA2.0w X cc +DD64 X Xif you have the HP C-ANSI-C compiler. X XTo compile in 64 bit mode, first call ./.clean then call X X make COPTX=+DD64 LDOPTX=+DD64 X make COPTX=+DD64 LDOPTX=+DD64 install X X XIf you have an older GNU gcc, you need a 64bit compiled gcc. Older GNU gcc versions Xare not capable of switching, so you need a separate compiler installation for either: X Xl1:/u/usr/merijn 102 > file /usr/local/pa*/bin/gcc X/usr/local/pa20_32/bin/gcc: PA-RISC2.0 shared executable dynamically linked -not stripped X/usr/local/pa20_64/bin/gcc: ELF-64 executable object file - PA-RISC 2.0 (LP64) Xl1:/u/usr/merijn 103 > X XWith a newer GCC, you may call ./.clean then call: X X make COPTX=-mlp64 LDOPTX=-mlp64 X make COPTX=-mlp64 LDOPTX=-mlp64 install X X XThe other way is to alter some kernel parameters which require a reboot. XThe default kernel parameter seem to look like: X XKernel param. Value Xmaxdsiz 67108864 Xmaxdsiz_64bit 1073741824 Xmaxfiles 200 Xmaxfiles_lim 2048 Xmaxssiz 8388608 Xmaxssiz_64bit 8388608 Xmaxswapchunks 3250 Xmaxtsiz 67108864 Xmaxtsiz_64bit 1073741824 X XThe important one is maxdsiz, 64 MB is the default and it is rather low. XThere is some information page at http://www.uwsg.iu.edu/hp/hpux-tune.html#maxdsiz Xand they recommend to increase it to 1.9 GB. Sounds extreme. X XAt http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x08afe7613948d5118fef0090279cd0f9,00.html Xthey recommend 500 MB. X Xmaxssiz shouldn't be a problem either since it has to do with swap and such as Xstoring arrays and recursion etc. X XIf you like to know how to create 64 bit binaries on Solaris, please Xread README.compile. I hope this helps. If you found the right way for HP-UX, Xplease send me a mail. X X X XThe Schily makefile system usually should be able to find the best C-compiler Xon HP-UX automatically. If it does not work, here is a way force to use a different Xcompiler. X X XYou may compile with the HP ANSI C-Compiler using: X X make CCOM=cc X XTo compile with the free K&R C-compiler call: X X gmake CCOM=cc 'COPTS= ' Xor X smake CCOM=cc 'COPTS= ' X/*--------------------------------------------------------------------------*/ X XHP-UX SCSI hints: X XNote that there are no device nodes for userland SCSI on HP-UX, Xyou have to call the included shell script MKNOD.hpux first. X XIf you own a HP-9000-800 series machine, you need to install Xthe file MKNOD.hpux-800 in the /etc init shell script directory Xin order to call it after each boot. X XThis script will create the files in /dev/scsi/... and /dev/rscsi/... XThe permissions will be set to read/write for root only. X X XHP does not handle CD-ROMs as well as it should. On the HP have a look at Xthe man pages for X pfs X pfsd X pfs_mount Xand anymore that they refer too. X X/*--------------------------------------------------------------------------*/ X XFrom: XH.Merijn Brand Amsterdam Perl Mongers (http://amsterdam.pm.org/) X XAs of Jun 2002, there are some patches available to HP-UX 11.00 and 11i that Xprevent the need for pfs, and these are highly recommended, since Rock-Ridge Xextensions are now supported from the kernel level. X XFor 11.00: X Xa5:/ 103 # swlist | grep -i rock X PHCO_26449 1.0 Add Rock Ridge extension to mount_cdfs(1M) X PHKL_26448 1.0 Y2k; Rock Ridge extension for ISO-9660 X PHKL_26450 1.0 Rock Ridge extension for ISO-9660 Xa5:/ 104 # X XPHKL_26448 is not recommended, but I never had any trouble with it. I still Xhave to install PHKL_28060 over PHKL_26448 X X PHKL_28060 1.0 Y2k; Rock Ridge extension for ISO-9660 X XFor 11i: X X PHKL_28025 1.0 Rock Ridge extension for ISO-9660 X PHKL_26269 1.0 Rock Ridge extension for ISO-9660 X PHCO_25841 1.0 Add Rock Ridge extension to mount_cdfs(1M) X XI don't have 11i (yet), so I got this from HP-UX' patch database. X XThe problem is that they did /not/ enable RR by default, but made it a mount Xoption. D'uh! But you can add it in /etc/fstab, and never worry again :) X Xa5:/ 104 # grep cd /etc/fstab X/dev/cd0 /cdrom cdfs ro,rr,noauto 0 0 Xa5:/ 105 # X X END-of-star-1.6/READMEs/README.hpux echo x - star-1.6/READMEs/README.linux sed 's/^X//' >star-1.6/READMEs/README.linux << 'END-of-star-1.6/READMEs/README.linux' XWARNING: Do not use 'mc' to extract the tar file! XAll mc versions before 4.0.14 cannot extract symbolic links correctly. X XLinux is the most self incompatible OS I know. If you have any problem, Xfirst carefully read this file. X XLinux includes the gnu make program by default but it is called 'make' on linux. XYou will definitely need the shell script Gmake.linux to use gmake Xon a linux system. X XInstall it as /usr/bin/Gmake with: X Xcp Gmake.linux /usr/bin/Gmake X XThen compile the system by calling: X X/usr/bin/Gmake Xor ./Gmake.linux X XNOTE for all Linux 2.5.x versions and all Linux versions before 2.6.8: X X Linux did ship with defective kernel include files starting X with 2.5.x. These defective kernel include files did prevent X compilation. If you have problems compiling software and see X error messages related to include/scsi/scsi.h & include/scsi/sg.h X either upgrade to Linux-2.6.8 or newer or remove /usr/src/linux X XNOTE for all Linux versions using libc.so.6: X X Libc.so.6 is definitely a big problem in binary compatibility. X First you should note that Linux is not a OS but only a kernel. X X Creating a OS from kernel, libraries and applications is done X by various companies that create "Linux distributions". It seems X that these companies (e.g. SuSE and Red Hat) are fighting wars X against each other. X X There is no guarantee that a binary that has been compiled X on one Linux distribution will run correctly on a different X release of the same vendor or on a distribution from a different X vendor. You cannot copy binaries between different Linux X versions, always compile the sources by yourself. X X We should consider that the name libc.so.6 is burned out for X these incompatibility reasons. But stop: Don't be too fast. X The dynamic linker on Linux does not work correctly. It has X been derived from the SunOS 4.x linker (which worked correctly) X but the Linux version does not even warn if it could not X find a library with the right major version number. Until X this is fixed it makes no sense to switch to libc.so.7 X X See below for more information. X X XNOTES for S.u.S.E distributions: If the "make" run aborts with strange messages, Xthen you need to unset an environment variable called PROMPT_COMMAND XIt contains illegal values for a make file system. X X I M P O R T A N T X X please carefully read all notes: X XNewer Linux kernels (from 2.3.51) moved SVSv shared memory into a filesystem. XIf you get messages with error code EINVAL related to shared memory, you Xmost likely installed a newer kernel on an old system that does not mount Xthe new shared memory filesystem. XFor information on this filesystem please read README.linux-shm X XIf you have any problems to access a device on the SCSI bus, check your X/dev/sg devices first. Your system should either only have /dev/sga... Xor /dev/sg0... The newer Linux kernel use /dev/sg0... so the actual XSCSI transport code checks for /dev/sg0... first. Many Linux installations Xhave too few /dev/sg* device nodes. This is because of the funny device Xmapping. It may be possible that one SCSI device eats up 8 /dev/sg* entries. XI recommend to have at least 20 /dev/sg* device nodes. X XIn any case: first read the man page for hints how to specify the device. XIf nothing helps, first run e.g. cdrecord -scanbus. If this does not find Xyour device, the problem is in your kernel or system installation. XIf scanning the bus finds the device, you are using the wrong device name. XIf nothing help try to call e.g. strace cdrecord X XLinux ATAPI hints: X XRead README.ATAPI to learn how to use ATAPI drives with the SCSI transport Xlibrary. X XLinux SCSI hints: X XIf you want to use the user SCSI library on a target that is connected Xto a SCSI hostadapter which is not the first, you need to apply a patch Xto your Linux kernel code. This patch is located in the file X XLinux.scsi-patch X XPlease chdir to /usr/src, call Xpatch < Linux.scsi-patch Xand re-compile and re-install your kernel. X XLinux kernels past 2.0.30 will probably already have this patch included. X XI recommend to use Linux 2.0.35 or later or Linux 2.1.115 or later. XThese versions of Linux will include ATAPI support in a way needed by cdrecord. XLinux 2.1.115 or newer will in addition support the Parallel Port / ATAPI Xadapters found in some CD-R or CD-RW drives. X XIMPORTANT: X X- Linux driver design oddities ****************************************** X Although cdrecord supports to use dev=/dev/sgc, it is not recommended X and it is unsupported. X X The /dev/sg* device mapping in Linux is not stable! Using dev=/dev/sgc X in a shell script may fail after a reboot because the device you want X to talk to has moved to /dev/sgd. For the proper and OS independent X dev=,, syntax read the man page of cdrecord. X X- Linux Kernel bug ****************************************************** X In some architectures (at least on sparc / alpha / ppc) kernels prior X to 2.0.32 are not usable because the call to mlockall() kills cdrecord. X X- You configured you kernel the wrong way ******************************* X If you get a message like: X X cdrecord: Function not implemented. shmget failed X X You need to look for three possible reasons: X X - You are using a Linux Kernel 2.3.51 or newer. X Read README.linux-shm X X - You removed SVSv IPC from your kernel. You need to enable it again. X Run a Linux kernel config and recompile with SYSv IPC. X X - The allowed amount of shared memory in the kernel is X not sufficient. See next main point for a solution: X X- Linux kernel oddities ************************************************* X You may need to edit /usr/src/linux/include/asm*/shmparam.h to allow at least X 4 MB of shared memory for your architecture by modifying SHMMAX X and re-compile/re-install Linux ! X (note that Linux for Intel by default allows 16 MB) X X Do this by e.g. changing the #define for SHMMAX to: X X #define SHMMAX 0x1000000 /* max shared seg size (bytes) */ X X This will allow 16 MB for shared memory. X X- Linux kernel memory management **************************************** X If you get the message: "Cannot allocate memory. Cannot send SCSI cmd via ioctl" X Your kernel/include files are inconsistent. X X This seems to be the case with most actual Linux kernels!!!!!! X X Make sure, that the include file /usr/src/linux/include/scsi/sg.h X reflects the actual kernel. Usually, the files /usr/include/scsi/sg.h X and /usr/src/linux/include/scsi/sg.h should be identical. X X **** Never change the content of /usr/src/linux/include/scsi/sg.h without X properly recompiling the kernel. Cdrecord depends on the fact that X the value of the define SG_BIG_BUFF uses the same value as the actual X kernel. Use cdrecord -scanbus -debug to get the value of SG_BIG_BUFF X with cdrecord has been compiled. An output of: X X scsi_getbuf: 32768 bytes X X indicates that cdrecord has been compiled with 32k SG_BIG_BUF X X The Linux 'sg' driver is the worst driver design, I've ever seen. X X- Linux Binary incompatibility ***************************************** X If any of the options that take a equal sign ('=') in the middle does X not work correctly (e.g. dev= or if=) you are using a binary that X does not work correctly on your current OS distribution. X X If dev=0,0,0 does not work but -dev=0,0,0 works you found this X incompatibility. This problem is caused by an incompatibility X in ctype.h and it seems that there are other compatibility problems X e.g. with reading /etc/default/cdrecord. X X You cannot copy binaries between different Linux versions, X always compile the sources by yourself. X X If a hint from a user is correct then even a RPM binary built for X RH-6.2 did not work on RH-6.2 because of these binary incompatibilities. X X XJoerg END-of-star-1.6/READMEs/README.linux echo x - star-1.6/READMEs/README.macosX sed 's/^X//' >star-1.6/READMEs/README.macosX << 'END-of-star-1.6/READMEs/README.macosX' XFebruary 25, 2002 X XMacOS 10.1 driver now in the tree in libscg/scsi-mac-iokit.c. X XIt supports: X * Firewire, USB, and ATAPI MMC-3 compliant burners X * SCSI parallel bus attached burners (requires MacOS X.1.3) X XIt does not support: X * Older non MMC-3 burners X * CD-ROM drives/DVD-ROM drives (i.e. non-burners) X XNote that this is a limitation of MacOS X and not of the driver. XSee the end of the document if you're curious why. X XIf you just want to burn ISO images, you may want to consider using Apple's Xhdiutil program, but it is not clear how standard compliant this method is. X XBuilding X-------- X XNote if you installed MacOS X on a HFS+ volume, make install will fail if Xthere is a file called INSTALL in the directory tree because this Filesystem Xis not POSIX compliant. POSIX requires to honor character case but HFS+ Xignores the character case. If you like to use "make install" rename XINSTALL to something else. (e.g. INSTALL.txt) X X XDevice Naming X------------- X XYou need to pass a device name on the command line to the cdrecord utility X XCD burners: (probably) IOCompactDiscServices XDVD burners: (probably) IODVDServices X X# ./cdrecord dev=IOCompactDiscServices -toc X Xor if you have multiple drives, you can append a number to differentiate X X# ./cdrecord dev=IOCompactDiscServices/2 -toc X XThat should talk to the second CD-R on the system (NOT TESTED). X XSharing nicely with the Finder X------------------------------ X XThe MacOS 10.1 Finder will offer to burn any blank media you put into Xthe burner. However, you don't want to use the Finder, you want to Xuse cdrecord! So, how do you get around this problem? X XWhen you insert the media, the Finder asks "Do you want to prepare this Xdisc?". Click on the "Ignore" button. X XThe Finder will then say "No volumes found. Click Continue to continue Xwithout ejecting". Click on the "Continue" button. X X XCommon Errors X------------- X XNo matching device ... found: XMake sure you typed the device names correctly. See above. Use ioreg X-l to find if there is an IOCompactDiscServices or IODVDServices in Xthe device tree. X XUnable to get exclusive access: XAnother programs (usually the Finder) has exclusive access to the drive. XSee "Sharing Nicely with the Finder" X XUnable to get plugin interface: XThe SCSI Architecture Family of drivers (supports Firewire, ATAPI, and XUSB) has a special module that allows user code like libscg to send XSCSI commands to a device. This module is only attached, though, if Xthe kernel device driver thinks the device is sufficiently interesting X(e.g. the kernel thinks it's a burner). X XYou can see if the module is loaded by looking for XSCSITaskUserClientIniter in the output of ioreg -l. X XWhy doesn't it support my SCSI device? X-------------------------------------- X XApple's kernel drivers enforces the rule that application cannot send XSCSI commands to devices for which they feel they have enough kernel Xsupport. This includes hard disks and CD/DVD ROMs. They make an exception Xfor burners, though. X XThere are two possible work-arounds, neither of which has been Ximplemented. One is to write a kernel driver that wraps the Apple Xkernel drivers and exposes a raw SCSI interface, overriding the Apple Xkernel drivers. The other is to write a SCSI device emulator at user Xmode that translates SCSI commands into the appropriate interface Xcalls to IOKit. X XBugs X---- XSend bugs to: csapuntz@stanford.edu END-of-star-1.6/READMEs/README.macosX echo x - star-1.6/READMEs/README.macosX-old-versions sed 's/^X//' >star-1.6/READMEs/README.macosX-old-versions << 'END-of-star-1.6/READMEs/README.macosX-old-versions' X********************************************************************************* X* * X* WARNING * X* * X* This is only valid for OLD MacOS X versions * X* This are versions _before_ MacOS X-10.1 (Darwin-1.4) * X* * X* * X********************************************************************************* X XIf uname -a does print something like: X XDarwin HOST 1.4 Darwin Kernel Version 1.4: Sun Sep 9 15:39:59 PDT 2001; root:xnu/xnu-201.obj~1/RELEASE_PPC Power Macintosh powerpc X Xor a version > 1.4 then you should rather read README.macosX X X/*--------------------------------------------------------------------------*/ X XUnfortunately, Apple does not deliver a consistent Mac OS-X system XThe longer they work on it, the more bugs they introduce... X XIn addition, there is no visible 'clean' road of development. XRelease names (from 'uname') are confusing and don't help to find out what Xrelease they refer to. X X/*--------------------------------------------------------------------------*/ X The next hint is for Mac OS X versions up to January 2000 only: X XThe file tries to include which cannot Xbe found. X XTo be able to compile, I suggest to create a symlink: X XSystem/Library/Frameworks/System.framework/Versions/B/Headers/kern -> kernserv X XTo do this, chdir to: X XSystem/Library/Frameworks/System.framework/Versions/B/Headers/ X Xand call X Xln -s kernserv kern X Xas root. X/*--------------------------------------------------------------------------*/ X X X/*--------------------------------------------------------------------------*/ X This hint is for Mac OS X version starting ~ April 2000: X XApple did remove the generic SCSI transport driver for unknown reasons! XCdrtools compile, but as there is no SCSI transport, you may only write XCD's connected to other systems using the REMOTE SCSI protocol. X/*--------------------------------------------------------------------------*/ X X/*--------------------------------------------------------------------------*/ X This hint is for Mac OS X versions starting around March 2001: X XIf your compile log looks like this: X X ==> MAKING "all" ON SUBCOMPONENT ".../libschily.mk" X ==> COMPILING "OBJ/powerpc-darwin-cc/cmpbytes.o" Xcmpbytes.c: In function `cmpbytes': Xcmpbytes.c:49: invalid operands to binary | Xmake[1]: *** [OBJ/powerpc-darwin-cc/cmpbytes.o] Error 1 Xmake: *** [all] Error 2 X XYou are hit by the Apple developers. Some time ago they started to introduce Xa file which uses types defines in XWhile the buggy types are ignored in they are used if found Xin . X XAs a workaround, you may edit X X incs/power-macintosh-darwin-cc/xconfig.h X Xafter it has been created by autoconf and make the lint containing XHAME_INTTYPES_H this way: X X/* #undef HAVE_INTTYPES_H */ /* to use UNIX-98 inttypes.h */ X XThis will tell the autoconf using code to ignore the system supplied X and use the internal version. X XIMPORTANT: Don't forget to tell the Apple support that MacOSX sucks until they Xfix such fundamental bugs in the system include files! X XIn case you are interested in the full details: the reason why cdrecord Xdoes not compile is that MacOS X defines a type X Xtypedef int * intptr_t; Xtypedef unsigned int * uintptr_t; X Xinstead of the correct: X Xtypedef long intptr_t; Xtypedef unsigned long intptr_t; X X... a result of either Apple developers being unwilling to read or unable to Xunderstand simple standards written in English :-( X XSee: http://www.opengroup.org/onlinepubs/7908799/xsh/inttypes.h.html X X/*--------------------------------------------------------------------------*/ END-of-star-1.6/READMEs/README.macosX-old-versions echo x - star-1.6/READMEs/README.mingw32 sed 's/^X//' >star-1.6/READMEs/README.mingw32 << 'END-of-star-1.6/READMEs/README.mingw32' X XHow to compile: X X- Download (http://www.mingw.org) and install the following Mingw32 packages: X X MinGW-3.1.0-1.exe X MSYS-1.0.10.exe X X- Set PATH environment variable using command: X X set path=c:\msys\1.0\bin;c:\mingw\bin;%path% X X- enter 'make' command in top level directory of the unpacked project END-of-star-1.6/READMEs/README.mingw32 echo x - star-1.6/READMEs/README.msdos sed 's/^X//' >star-1.6/READMEs/README.msdos << 'END-of-star-1.6/READMEs/README.msdos' X# @(#)README.msdos 1.2 04/06/07 J. Schilling X XYou cannot compile this program on DOS directly, you need a win32 environment. XSee below for more information. You need DJGPP for a compilation. X XThe DOS/DJGPP have been made with help from X Alex Kopylov X XYou may like to check his Web Page: http://bootcd.narod.ru/index_e.htm too. X XCompilation under DJGPP is fully integrated into the Schily Makefile System, Xhowever you need to use 'smake' (version 1.2a20 or newer). It seems that XGNU make and other make programs don't work. X XAs the file names of a typical UNIX project don't fit into the DOS 8.3 naming Xscheme, you must have long names support, i.e. you must use a Windows DOS-box Xinstead pure DOS X XTo compile under DJGPP: X X- Unpack the following DJGPP packages into c:\djgpp directory: X X ftp://ftp.delorie.com/pub/djgpp/current/v2/beta/djdev204.zip X ftp://ftp.delorie.com/pub/djgpp/alpha/v2gnu/bsh205bb.zip X ftp://ftp.delorie.com/pub/djgpp/alpha/v2gnu/gcc340b.zip X ftp://ftp.delorie.com/pub/djgpp/alpha/v2gnu/gpp340b.zip X ftp://ftp.delorie.com/pub/djgpp/beta/v2gnu/bnu214b.zip X ftp://ftp.delorie.com/pub/djgpp/beta/v2gnu/dif28b.zip X ftp://ftp.delorie.com/pub/djgpp/beta/v2gnu/fil41b.zip X ftp://ftp.delorie.com/pub/djgpp/beta/v2gnu/grep251b.zip X ftp://ftp.delorie.com/pub/djgpp/beta/v2gnu/gwk311b.zip X ftp://ftp.delorie.com/pub/djgpp/beta/v2gnu/gzip135b.zip X ftp://ftp.delorie.com/pub/djgpp/beta/v2gnu/mak380b.zip X ftp://ftp.delorie.com/pub/djgpp/beta/v2gnu/pat253b.zip X ftp://ftp.delorie.com/pub/djgpp/beta/v2gnu/sed407b.zip X ftp://ftp.delorie.com/pub/djgpp/beta/v2gnu/shl2011b.zip X ftp://ftp.delorie.com/pub/djgpp/beta/v2gnu/tar112ab.zip X ftp://ftp.delorie.com/pub/djgpp/beta/v2gnu/txt20b.zip X XNote that these are the best files on 21.05.2004, things may change in future. X X- Set environment variables using commands: X X set path=c:\djgpp\bin;%path% X set djgpp=c:\djgpp\djgpp.env X X If you are using an smake version before 1.2a23, you also need: X X set djgpp_sh=c:\djgpp\bin\sh.exe X X X- Unpack the source archive using command: X X tar -xpz < package-name.tar.gz X X If you like to use star, you need star-1.5a36 or newer. X Use a command line like: X X star -xpz < package-name.tar.gz X X- Enter 'smake' command in top level directory of the unpacked project X (to make 'smake' itself, use a command 'dos_make' instead). X X Note that in case you don't have a 'smake' binary for DOS, you need to X compile one before or fetch a binary from: X X http://bootcd.narod.ru/index_e.htm X XIn order to run commands on MS-DOS that use SCSI commands, you must have an XASPI manager installed in your config.sys. For example: X X SCSI devices: X X device = aspi2dos.sys (not tested!) X device = aspi4dos.sys (not tested!) X device = aspi8dos.sys X device = aspi8u2.sys (not tested!) X X ATAPI devices: X X device = oakaspi.sys X X USB devices: X X device = usbaspi.sys (not tested!) X XThe ASPI managers may be fetched from: X X http://bootcd.narod.ru/index_e.htm END-of-star-1.6/READMEs/README.msdos echo x - star-1.6/READMEs/README.ppc sed 's/^X//' >star-1.6/READMEs/README.ppc << 'END-of-star-1.6/READMEs/README.ppc' XIf your system uses the SVr4 ABI (designed by Motorola), you will only Xbe able to compile my library files lib/format.c and lib/getargs.c if your XC-compiler supports the macro va_copy() or __va_copy() from stdarg.h. X XMach/Next STep/Apple Rhapsody on ppc use a 'void *' for the type va_list Xso you don't need to make changes on these systems. X XSolaris/ppc (made in 1992) is the first UNIX implementation for the PPC. XIt includes the va_copy() macro that allows you to assign a C object of the Xtype va_list in a system independent way. X XLinux/ppc uses exactly the same construct as Solaris for the type va_list. XYou will only be able to compile lib/format.c and lib/getargs.c if your XC-compiler includes the macro va_copy() or __va_copy(). If this is not the Xcase, you will need to upgrade your C-compiler first. GCC 2.8.0 and later Xincludes this macro. X XHere is what Solaris /usr/include/sys/varargs.h looks like: X X/* X * va_copy is a Solaris extension to provide a portable way to perform X * a variable argument list ``bookmarking'' function. X */ X#if defined(__ppc) X#define va_copy(to, from) ((to)[0] = (from)[0]) X#else X#define va_copy(to, from) ((to) = (from)) X#endif X XTo be able to compile my lib/format.c and lib/getargs.c on a OS Ximplementation that uses an array for va_list, you will need Xthis va_copy() enhancement too. X XThe files mentioned above already compile on a PPC Apple Rhapsody system. XBut as mentioned before, Rhapsody uses a void * for va_list (maybe because XApple includes badly designed international printf code from BSD 4.4 Xthat requires va_list to be void * to work). X XNotice: lib/format.c allows a %r format that needs additional features X in stdarg.h. You need to know whether va_list is an array. X I hope that GCC will include some definitions in future versions X that allow to propagate va_list type objects from var args X in function calls. X XGCC X=== X XIf you are not using GCC 2.8.0, you can add the following definition Xto va-ppc.h : X X/usr/lib/gcc-lib/*-linux-gnulibc1/2.*/include/va-ppc.h X X#define va_copy(to, from) ((to)[0] = (from)[0]) X Xand to all other va-*.h files: X X#define va_copy(to, from) ((to) = (from)) X XImportant: Check before if you don't have a GCC that is already patched. X XJoerg X END-of-star-1.6/READMEs/README.ppc echo x - star-1.6/READMEs/README.solaris sed 's/^X//' >star-1.6/READMEs/README.solaris << 'END-of-star-1.6/READMEs/README.solaris' XNever compile anything in a locale other than "C" unless you are sure Xthat your C-compiler and the program 'nm' has been patched. XThis is not needed with Solaris 2.6 or later and with the Workshop 5.0 Xcompiler or later. X XEven if you are a recent Solaris version, use locale "C" in case of problems. X XTo ensure that locale "C"' is set, do X Xsetenv LC_ALL C X Xin csh Xor X XLC_ALL=C Xexport LC_ALL Xin sh X Xbefore running make. Or simply call X Xenv LC_ALL=C make X XThe reason: X X1) On Solaris before 2.5.1 'nm' dumps core in any other locale. X For that reason lorder will not work. X *** no patch available **** but fixed on Solaris 2.5.1 X according to Sun X X2) The SunPro C-compiler will not convert floating X point numbers correctly if e.g. in "de" locale (Germany) X 1.3 will be interpreted as 1.0!!!! X *** patch available *** X X3) /usr/xpg4/bin/tr does not work correctly if locale is not "C" X Try: X echo ABC | env LC_ALL=de /usr/xpg4/bin/tr 'A-Z' 'a-z' X X it prints: X X BCD X X X XIf you want to do compilations on Solaris, it is best not have /usr/ucb Xin your PATH. If you want to have /usr/ucb in the PATH it must be the last Xentry. You also should put /usr/ccs/bin/ before /usr/xpg4/bin/ in the PATH Xto make sure that /usr/ccs/bin/make is used and not /usr/xpg4/bin/make. X XTo be able to use 'make' 'as' and 'ld' you need to make sure that X/usr/ccs/bin is in your path. X XAvoid /usr/ucb and /usr/xpg4/bin in your PATH if you have problems. X XMake sure - even if you use GCC - you don't use GNU as, GNU ld Xand GNU tsort/lorder. X XFor CD-Recording please read the README.volmgt too. X XOn Solaris you need to stop the volume management if you like to use the USCSI Xfallback SCSI transport code. Even things like cdrecord -scanbus Xwill not work if the volume management is running. X XIf you run Solaris 7 FCS, install patch 107465-02 to fix a read ahead bug in the Xhsfs code. X XIf you have problems with 12 byte SCSI commands on Solaris (mainly x86) get XPatch 108779-01 X XIf you have problems with ISO-9660 partitions > 4 GB where Solaris wraps to Xoffset mod 4 GB when reading from the FS install patch 113277-04. X X X IMPORTANT information for Solaris x86 X XIf have no DMA, you will get problems with buffer underruns and may never use Xthe maximum write speed of current CD/DVD drives. X XFor more information, read README.solaris-x86-ata-DMA and README.solaris-x86-ATAPI-DMA Xand take care that the locations for patching may change in future versions. X X END-of-star-1.6/READMEs/README.solaris echo x - star-1.6/READMEs/README.win32 sed 's/^X//' >star-1.6/READMEs/README.win32 << 'END-of-star-1.6/READMEs/README.win32' X# @(#)README.win32 1.10 14/12/07 Copyright 2000-2014 J. Schilling X Xcdrecord-1.8a22 or later can be compiled on Win9X/NT4 using Cygnus' cygwin Xwhich is freely available from: X X http://sourceware.cygnus.com/cygwin/ Xor X http://sources.redhat.com/cygwin/ X XTo compile on Cygwin, get Cygwin by executing setup.exe X XYou will need approx. 120 MB to install a full cygwin developer release. X XGet the tar'ed cdrtools source and unpack it with 'gnutar' or 'star', X Xe.g. Start a bash command line window and type: X X star -xpz < cdrtools-3.01.tar.gz X X don't use winzip to unpack the tar archive, it will not X unpack symlinks correctly. X XThen (from the bash command line window) run 'make' ... X XIf you have problems with GNU make, get 'smake' from: X X http://sourceforge.net/projects/s-make/files/alpha/ X X/*--------------------------------------------------------------------------*/ XA bash window is available from the START -> Programs -> Cygnus Solutions Xmenu or by clicking at the Cygwin Logo on the desktop. X/*--------------------------------------------------------------------------*/ XPre-compiled current 'cdrtools' Win32 binaries which should run on XW95, W98 and WNT are available from: X X http://sourceforge.net/projects/cdrtools/files/alpha/win32 X XTo use the pre-compiled binary, put the files cygwin1.dll, mount.exe as well Xas the files: X Xcdrecord.exe - The CD recording program Xcdda2wav.exe - The DAE (Digital Audio Extraction) program Xmkisofs.exe - The ISO-9660/Rock Ridge/Joliet Filesystem formatter Xreadcd.exe - A simple program to extract CD-ROM raw data to a file X Xin your WINDOWS binary directory and from a Command/MS-DOS (or bash) window Xtype: X cdrecord -help X Xfor usage, see also: X X http://cdrecord.org/ X XAll programs in this directory are Unix command line utilities and know Xnothing about DOS/WIN. They run in a POSIX subsystem that is supplied by Xcygwin1.dll. Therefore all directory names are given in Unix (POSIX) format X(i.e. use '/' for a directory separator, not '\'). To access files on another Xdisks (i.e. floppy, CDROM and network disk), you need to use the supplied "mount" Xcommand e.g. X X mount a: /a X mount d: /cdrom X Xi.e. files on the floppy disk are accessed as being in directory /a and Xfiles on the CDROM are accessed as /cdrom (assuming your CDROM is drive d:) X XYu may also use the new /cygpath notation by typing /cygpath/a for Xyour local floppy. X XThe notation //a/dir as a replacement for the DOS directory name a:\dir Xmay not work in future releases of Cygwin. X XThe following command creates a CD image in the current directory Xusing a source directories on the CDROM drive, a sub-directory and the Xfloppy drive: X X mkisofs -o hsfs.iso -J -R /cdrom/subdir dir1 /a X XIf you use the options noted above, the hsfs.iso image is ISO-9660 Xcompliant and includes both Rock Ridge (IEEE P1282) and XJoliet (Microsoft proprietary) extensions. X XIf your CD writer is on target 6, type X X cdrecord dev=6,0 -v speed=4 hsfs.iso X Xto write the image at speed 4 in TAO mode, or X X cdrecord dev=6,0 -v speed=4 -dao hsfs.iso X Xto write the image in DAO mode. X XIf you don't like to create the image file 'hsfs.iso' you may use a PIPE Xto connect mkisofs's output to cdrecord's input by calling: X X mkisofs -J -R /cdrom/subdir dir1 /a | cdrecord dev=6,0 -v speed=4 - X XIMPORTANT NOTE: If you use PIPE's on Win32, you definitely need a POSIX X compliant shell to start the programs. Native Win32 PIPE's X are not POSIX compliant and will not work with POSIX compliant X programs. X X/*--------------------------------------------------------------------------*/ XIf you don't know which target your CD-writer is, call X X cdrecord -scanbus X XThis gives output similar to: X XCdrecord-ProDVD sparc-sun-solaris2.4 release 1.8a39 Copyright (C) 1995-2000 Jörg Schilling XUsing libscg version 'schily-0.1' Xscsibus0: X 0,0,0 0) 'Quantum ' 'XP34300 ' 'F76D' Disk X 0,1,0 1) 'SEAGATE ' 'ST11200N ' '8334' Disk X 0,2,0 2) * X 0,3,0 3) 'TOSHIBA ' 'MK537FB/ ' '6258' Disk X 0,4,0 4) 'WANGTEK ' '5150ES SCSI-36 ' 'ESB6' Removable Tape X 0,5,0 5) 'EXABYTE ' 'EXB-8500-85QUE ' '0428' Removable Tape X 0,6,0 6) 'TOSHIBA ' 'XM-3401TASUNSLCD' '3593' Removable CD-ROM X 0,7,0 7) HOST ADAPTOR Xscsibus1: X 1,0,0 100) 'IBM ' 'DCAS-34330 ' 'S65A' Disk X 1,1,0 101) * X 1,2,0 102) * X 1,3,0 103) * X 1,4,0 104) 'PLEXTOR ' 'CD-R PX-W8220T' '1.00' Removable CD-ROM X 1,5,0 105) 'YAMAHA ' 'CRW4416S ' '1.0f' Removable CD-ROM X 1,6,0 106) * X 1,7,0 107) HOST ADAPTOR X XThe numbers on the labels are SCSIbus# * 100 + target# X XYou then call cdrecord dev=bus#,target#,0 X XIf you e.g. like to talk to the Yamaha drive from the list above, you need to Xcall: X X cdrecord dev=1,5,0 ...... X X/*--------------------------------------------------------------------------*/ X X NOTE X XIf "cdrecord -scanbus" dumps core (dies from program fault), you have Xa broken ASPI driver on your PC. X XIf you cannot see your drive(s), the following registry changes should make Xthem visible: X X [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Aspi32] X "ErrorControl"=dword:00000001 X "Start"=dword:00000001 X "Type"=dword:00000001 X X [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Aspi32\Parameters] X "ExcludeMiniports"="" X X XIf you like to use the tools with SCSI or ATAPI, you need a working XASPI32 driver and dll on your system. If you don't have it already, Xlook for 'aspi_me'. You need to set you clock back to a time before XJan 1st 1999 to be able to install it. Note that 'aspi_me' contains Xoriginal Adaptec drivers and is banned from most ftp servers for this Xreason. X XIf you do not have superuser permission which would allow you to use Xthe SPTI SCSI interface that is similar to a UNIX ioctl interface, Xyou need a special ASPI driver version on NT-5.0 (Win2000) X XYou may get one by searching for: X X wnaspi32.dll X X X/*--------------------------------------------------------------------------*/ X X IMPORTANT X XIn order to avoid damaging CD blanks because Win is trying to access Xthe drive while cdrecord writes to it, you definitely should edit Xyour registry and set the value of X XHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Cdrom\Autorun X Xto '0'. X XThe Registry entry noted above is valid for WNT, I don't know Xif you need to do this for W95 or W98, nor do I know the Xcorrect Registry entry for these systems. X X/*--------------------------------------------------------------------------*/ X X For binary only users: X XError messages and help output is directed to stderr. Win32 command Xinterpreters don't know about stderr. I recommend to install bash.exe Xbecause it is a POSIX compliant shell and allow working PIPE's and Xit also gives you a command line history that may be edited using Xcursor commands. X XOtherwise you may want to install the Cygwin light version which Xonly includes the user commands. END-of-star-1.6/READMEs/README.win32 echo x - star-1.6/READMEs/README.sunos sed 's/^X//' >star-1.6/READMEs/README.sunos << 'END-of-star-1.6/READMEs/README.sunos' XIt seems that at there is a structure alignment problem Xwith the structure scsi_cmd at least with gcc. X XIf you get a message: 'XXX X XIf you want to run cdrecord on SunOS 4.x on a sparc system Xplease make sure that you are using the old Sun cc Xby typing: X X make CCOM=cc X END-of-star-1.6/READMEs/README.sunos echo x - star-1.6/READMEs/README.install sed 's/^X//' >star-1.6/READMEs/README.install << 'END-of-star-1.6/READMEs/README.install' X# @(#)README.install 1.5 18/09/17 Copyright 1997-2018 J. Schilling X XTo install makefiles, just take the tar archive makefiles.tar Xand untar it on the source root of your new project. X XThe tar file contains: X X- the RULES directory with the main make rules X- two different DEFAULT directories with predefined project settings X- a directory containing templates for all purpose X- a skeleton directory structure for the new project X- some README files that will be useful for developers and users X XIf you want to see a better example, please have a look at the "star" Xsource. It may be found on: X Xhttp://sourceforge.net/projects/s-tar/files/ X X XHave a look at the manual page, it is included in the distribution. XInstall the manual page with X Xmake install first and include /opt/schily/share/man in your MANPATH X XAuthor: X XJoerg Schilling XSeestr. 110 XD-13353 Berlin XGermany X XEmail: joerg.schilling@fokus.fraunhofer.de, joerg@schily.net X XPlease mail bugs and suggestions to me. END-of-star-1.6/READMEs/README.install echo x - star-1.6/TODO sed 's/^X//' >star-1.6/TODO << 'END-of-star-1.6/TODO' XNOTE: Before blaming star for something found in this list, look at your favorite X tar implementation for the presence of similar bugs/missing features. X X X- Need a way to handle backups that include /export/home & /home: Missing links X message because loopback filesystem gives more hardlinks than really present. X X- Linkcount below zero with the command: star -c /usr/bin /usr/bin X X- Add Option to both (verbose print & errors) appear on stderr. X X- malloc path buffers and 'chdir' to be able to deal with pathnames > 1024 bytes. X X- add an option to reduce primary file name length to 99 chars X for all formats to enhance the portability of the archives. X X- union member .dbuf is still star_header!!! X X- If -p flag is ommited, files are handled different from old tar. X Star always does does a chmod on non directories. X Tar uses creat(file, st_mode & 0x07777) X X- AIX uses tape.h ??? for mt ioctl's X END-of-star-1.6/TODO echo x - star-1.6/Gmake sed 's/^X//' >star-1.6/Gmake << 'END-of-star-1.6/Gmake' X#!/bin/sh XMAKEPROG=gmake Xexport MAKEPROG Xexec gmake "$@" END-of-star-1.6/Gmake echo x - star-1.6/Gmake.linux sed 's/^X//' >star-1.6/Gmake.linux << 'END-of-star-1.6/Gmake.linux' X#!/bin/sh X XMAKEPROG=gmake Xexport MAKEPROG X X# gmake is called 'make' on Linux X Xexec make "$@" END-of-star-1.6/Gmake.linux echo x - star-1.6/COPYING sed 's/^X//' >star-1.6/COPYING << 'END-of-star-1.6/COPYING' XThe software in this directory tree is free software and uses Xlicenses that are aproved be the OpenSource Initative X X http://www.opensource.org/ X XNot all sub-projects use the same license. Here is a list of Xsub-directories and it's related licenses: X Xconf/ X Files from the Schily Autoconf system (GPL) X Support shell scripts for the Schily Makefile system (CDDL) XDEFAULTS/ X Default files for the Schily Makefile system (CDDL) XDEFAULTS_ENG/ X Default files for the Schily Makefile system (CDDL) Xinc/ X Support C-Files for the Schily Makefile system (CDDL) Xinclude/ X Support H-Files for the Schily Makefile system (CDDL) XRULES/ X The main part of the Schily Makefilesystem (CDDL) XTARGETS/ X Slot support for the Schily Makefile system (CDDL) XTEMPLATES/ X Template support for the Schily Makefile system (CDDL) X X XFor more information on the CDDL read the file CDDL.Schily.txt XFor more information on the GPL read the file GPL-2.0.txt XFor more information on the LGPL read the file LGPL-2.1.txt END-of-star-1.6/COPYING echo x - star-1.6/README.compile sed 's/^X//' >star-1.6/README.compile << 'END-of-star-1.6/README.compile' X# @(#)README.compile 1.40 18/09/17 Copyright 1997-2018 J. Schilling X XShort overview for those who don't read manuals: X X Calling configure manually is outdated because this is a task of the X makefile system. X X There is no 'configure', simply call 'make' on the top level X directory. X X ***** X If you do not have a recent "smake" on your machine, you may first X need to compile and install a recent "smake". X X In order to get a recent "smake" source, it is recommended to fetch X the "schilytools" tarball. If your local make program is not able to X automatically compile a bootstrap smake program in the "psmake" X directory from "schilytools", please read the file "BOOTSTRAP". X ***** X X X ***** If this does not work for you, read the rest if this file ***** X ***** If you have any problem, also first read the topic specific ***** X ***** README.* files (e.g. README.linux for Linux problems). ***** X X All results in general will be placed into a directory named X OBJ// in the current projects leaf directory. X X You **need** either the Schily "smake" program, the SunPRO make X that is included in "schilytools" and typically installed in X /opt/schily/bin/make and /opt/schily/bin/dmake, the SunPRO make X from /usr/bin/make (SunOS 4.x) or /usr/ccs/bin/make (SunOS 5.x) X or GNU make to compile this program. Read READMEs/README.gmake for X more information on gmake and a list of the most annoying bugs in gmake. X X All other make programs are either not smart enough or have bugs. X X My "smake" source is at: X X https://sourceforge.net/projects/s-make/files/ X X It is easy to compile and doesn't need a working make program X on your machine. If you don't have a working "make" program on the X machine where you like to compile "smake" read the file "BOOTSTRAP". X X If you have the choice between all three make programs, the X preference would be X X 1) smake (preferred) X 2) Schily SunPRO make (preferred over (3)) X 3) SunPRO make X 4) GNU make (this is the last resort) X X Important notice: "smake" that comes with SGI/IRIX will not work!!! X This is not the Schily "smake" but a dumb make program from SGI. X X ***** If you are on a platform that is not yet known by the ***** X ***** Schily makefilesystem you cannot use GNU make. ***** X ***** In this case, the automake features of smake are required. ***** X X Note that GNU make has major bugs on various platforms and thus cannot X be used at all on VMS and OS/2. GNU make on Cygwin causes problems X because it does not deal with spaces and newlines correctly. X X Please read the README's for your operating system too. X X WARNING X Do not use 'mc' to extract the tar file! X All mc versions before 4.0.14 cannot extract symbolic links correctly. X X The versions of WinZip that support tar archives cannot be used either. X The reason is that they don't support symbolic links. X Star and Gnutar do support symbolic links even on win32 systems. X To support symbolic links on win32, you need to link with the X Cygwin32 POSIX library. X X To unpack an archive, use: X X gzip -d < some-arch.tar.gz | tar xpf - X X Replace 'some-arch.tar.gz' by the actual archive name. X X If your platform does not support hard links or symbolic links, you X first need to compile "star" and then call: X X star -xp -copy-links < some-arch.tar.gz X X If your platform does not support hard links but supports X symbolic links, you only need to call the command above once. X If your platform does not support symbolic links, you need to call X the command twice because a symbolic link may occur in the archive X before the file it points to. X X X XHere comes the long form: X X XPREFACE: X X Calling configure manually is outdated because this is a task of the X makefile system. X X You don't have to call configure with this make file system. X X Calling 'make' or 'make all' on the top level directory will create X all needed targets. Calling 'make install' will install all needed X files. X X This program uses a new makefilesystem, introduced in 1993. This X makefilesystem uses techniques and ideas from the 1980s and 1990s, X is designed in a modular way and allows sources to be combined in a X modular way. For mor information on the modular features read X README.SSPM. X X The makefilesystem is optimized for a program called 'smake' X Copyright 1985 by Jörg Schilling, but SunPro make (the make program X that comes with SunOS >= 4.0 and Solaris) as well as newer versions X of GNU make will work also. BSDmake could be made working, if it X supports pattern matching rules correctly. X X The makefile system allows simultaneous compilation on a wide X variety of target systems if the source tree is accessible via NFS. X X XFinding Compilation Results: X X To allow simultaneous compilations, all binaries and results of a X 'compilation' in any form are placed in sub-directories. This includes X automatically generated include files. Results will in general be X placed into a directory named OBJ// in the current project's X leaf directory, libraries will be placed into a directory called X libs// that is located in the source tree root directory. X X will be something like 'sparc-sunos5-cc' X X This is the main reason why simultaneous compilation is possible on X all supported platforms if the source is mounted via NFS. X X XHow to compile: X X To compile a system or sub-system, simply enter 'smake', 'dmake', 'make' X or 'Gmake'. Compilation may be initialized at any point of the source X tree of a system. X X WARNING: If compilation is started in a sub tree, only all objects X in that sub tree will be made. This usually excludes needed libraries. X NOTE: Compilation may not be started in a subdirectory unless a make X call from inside the directory "inc" has been run before. X X NOTE: The "schilytools" source tree and the "smake" source tree come X with a "smake" bootstrap environment that uses Makefile as a trampoline X and SMakefile as the major makefile in the project root directory. X If you like to use a make program other than smake from the project X root directory without the bootstrap trampoline, use X "$MAKE -f SMakefile", e.g. X X dmake -f SMakefile X X On sub directories, "-f SMakefile" is neither needed nor useful. X X Add other command line options or command line parameter if needed. X X XHow to compile in parallel mode: X X The smake program does not yet support parallel compilation. X X The dmake program supports parallel compilation. If you like the X default number of parallel jobs, just call 'dmake'. If you like X a different number, call 'dmake -j #', where # is the number of X parallel jobs. X X Note that dmake collects the output from different jobs and prints X them in a way that does not interleave. For the Schily variant of X the dmake program, the Schily Makefilesystem by default disables the X job headers in the output. If you like to see them, call: X X dmake DMAKE_OUTPUT_MODE=TXT1 X X The gmake program supports parallel mode, but does not separate the X output. If you get error or warning messages, you usually will be X confused by the mixture of the output. Recent gmake versions added X an option to separate the output from various jobs. Have a look X at the man page. X X XHow to install results: X X To install the product of a compilation in your system, call: X X smake install X X at top level. The binaries will usually be installed in X /opt/schily/bin. The directory /opt// has been agreed X on by all major UNIX vendors in 1989. Unfortunately, still not all X vendors follow this agreement. X X If you want to change the default installation directory, edit the X appropriate (system dependent) files in the DEFAULTS directory X (e.g. DEFAULTS/Defaults.sunos5). X X ***** If "smake install" doesn't do anything, you are on a broken ***** X ***** File System. Remove the file INSTALL in this case (the FS ***** X ***** does not handle upper/lower case characters correctly). ***** X ***** This is true for all DOS based filesystems and for Apple's ***** X ***** HFS+ filesystem. ***** X X XUsing a different installation directory: X X If your system does not yet use the standard installation path in X X /opt/ X X or if you don't like this installation directory, you can easily X change the installation directory. You may edit the DEFAULTS file X for your system and modify the macro INS_BASE. X X You may use a different installation directory without editing the X DEFAULTS files. If you like to install everything in the deprecated path X /usr/local, the next paragraph describes the procedure. X X If your make program supports to propagate make macros to sub make programs X which is the case for recent smake releases as well as for a recent gnumake: X X smake INS_BASE=/usr/local install X or X gmake INS_BASE=/usr/local install X X If your make program doesn't propagate make macros (e.g. SunPRO make), X call: X X env INS_BASE=/usr/local make -e install X X Note that INS_BASE=/usr/local needs to be specified for every operation X that compiles or links programs, as the path may be stored inside the X binaries. X X The location for the root specific configuratin files is controlled X via the INS_RBASE= make macro. The default vaulue for this macro is "/". X If you like to install global default configuration files into X /usr/local/etc instead of /etc, you need to spefify INS_RBASE=/usr/local X X Note that some binaries have $(INS_BASE) and $(INS_RBASE) compiled into. X If you like to like to modify the compiled-in path values, call: X X smake clean X smake INS_BASE=/usr/local INS_RBASE=/usr/local X X XSetting up a different Link mode: X X The following link modes are available: X X static statical linking as in historical UNIX X X dynamic dynamic linking as introduced by SunOS X in 1987, Microsoft's DLLs, ... X The knowledge on how to achieve this for X a particular platform is hidden in the X makefile system. X X profiled Linking against profiled libraries. X Profiled libraries are prepared for the X use with "gprof" (introduced by BSD in the X late 1970s). X X The makefile system sets up a default linkmode in the patform X related defaults file (typically in the file DEFAULTS/Defaults.) X in the projects root directory. This is done with the entry: X X DEFLINKMODE= X X A different linkmode may be selected at compile/link time by e.g. calling: X X smake LINKMODE=dynamic X X If there are already existing binaries, call: X X smake relink LINKMODE=dynamic X X instead. X X XCompiling a different ELF RUNPATH into the binaries: X X In order to allow binaries to work correctly even if the shared X libraries are not in the default search path of the runtime linker, X a RUNPATH needs to be set. X X The ELF RUNPATH is by default derived from $(INS_BASE). If you like to X set INS_BASE=/usr and create binaries that do not include a RUNPATH at all, X call: X X smake relink RUNPATH= X X XUsing a different man path prefix: X X Manual pages are by default installed under: X X $(INS_BASE)/$(MANBASE)/man X and MANBASE=share X X If you like a different prefix for man pages, call: X X smake DEFMANBASE=something install X X to install man pages into $(INS_BASE)/something/man/* X X If you like to install man pages under $(INS_BASE)/man/*, call X X smake DEFMANBASE=. install X XInstalling stripped binaries: X X If you like to install stripped binaries via "smake install", call: X X smake STRIPFLAGS=-s install X X This calls "strip" on every final install path for all executable X binaries. X XInstalling to a prototype directory to implement package creation staging: X X If you like to create a prototype directory tree that is used as an X intermediate store for package creation, use the DESTDIR macro: X X smake INS_BASE=/usr/local DESTDIR=/tmp install X X This will compile in "/usr/local" as prefix into all related binaries X and then create a usr/local tree below /tmp (i.e. /tmp/usr/local). X X Note that you need to call "smake clean" before in case that the code X was previously compiled with different defaults with regards to INS_BASE X XSetting different default directory permissions for install directories: X X All directories that are created by the Schily makefile system in the X target directory path when X X smake install X X is called system use a special default 022 that is in DEFINSUMASK= X This causes all directories in the target install path to be created X with 0755 permissions. X X All other directories that are created by the Schily makefile system X use a single global default 002 that is in DEFUMASK= X X If you like to create install directories with e.g. 0775 permissions, X call: X X smake DEFINSUMASK=002 install X XUsing a different C compiler: X X The *compiler family* is configured via the CCOM= make macro. This X selects a whole set of related macros that are needed to support a X specific compiler family. X X The *compiler family* usually defines a C compiler and a related X C++ compiler. X X If the configured default compiler family is not present on the current X machine, the makefilesystem will try an automatic fallback to GCC. For X this reason, in most cases, you will not need to manually select a X compiler. X X The default compiler family can be modified in the files in the X DEFAULT directory. If you want to have a different compiler family X for one compilation, call: X X make CCOM=gcc X or X make CCOM=cc X X This works even when your make program doesn't propagate make macros. X X XCreating 64 bit executables on Solaris: X X Simply call: X X make CCOM=gcc64 X or X make CCOM=cc64 X X It is not clear if GCC already supports other platforms in 64 bit mode. X As all GCC versions before 3.1 did emit hundreds of compilation X warnings related to 64 bit bugs when compiling itself, so there may be X other platforms are not supported in 64 bit mode. X XCreating executables using the Sun Studio compiler on Linux: X X Simply call: X X make CCOM=suncc X X If the compilation does not work, try: X X mkdir /opt/sunstudio12/prod/include/cc/linux X cp /usr/include/linux/types.h /opt/sunstudio12/prod/include/cc/linux X X Then edit /opt/sunstudio12/prod/include/cc/linux/types.h and remove all X lines like: "#if defined(__GNUC__) && !defined(__STRICT_ANSI__)" X as well as the related #endif. X XCreating executables using the clang compiler: X X Simply call: X X make CCOM=clang X X And in order to intentionally create 32 bit or 64 bit binaries, call: X X make CCOM=clang64 X or X make CCOM=clang64 X X XUsing a different compiler binary name: X X Call: X X make CC=/opt/instrumented/bin/cc X X Note that all knowledge about the options of a compiler is derived X from the CCOM= variable, so if you like to use an instrumented gcc X variant, you may like to call: X X make CCOM=gcc CC=fluffy-gcc X X You may use CC="fluffy-gcc fluffy-gcc-specific options" if you like X to enforce specific options with the compiler. See hints on cross X compilation below. X XAvoiding to compile C++ based projects: X X Call: X make C++BUILD=off X X XGetting help from the make file system: X X For a list of targets call: X X make .help X X .help is a special target that prints help for the makefile system. X X XGetting more information on the make file system: X X The man page makefiles.4 located in man/man4/makefiles.4 contains X the documentation on general use and for leaf makefiles. X X The man page makerules.4 located in man/man4/makerules.4 contains X the documentation for system programmers who want to modify X the make rules of the makefile system. X X For further information read X X http://sf.net/projects/schilytools/files/makefiles/PortableSoftware.ps.gz X X XHints for compilation: X X The makefile system is optimized for 'smake'. Smake will give the X fastest processing and best debugging output. X X SunPro make will work as is. GNU make need some special preparation. X X Read READMEs/README.gmake for more information on gmake. X X To use GNU make create a file called 'Gmake' in your search path X that contains: X X #!/bin/sh X MAKEPROG=gmake X export MAKEPROG X exec gmake "$@" X X and call 'Gmake' instead of gmake. On Linux, there is no gmake, the X program installed as 'make' on Linux is really a gmake. X X 'Gmake' and 'Gmake.linux' are part of this distribution. X X Some versions of gmake are very buggy. There are e.g. versions of gmake X on some architectures that will not correctly recognize the default X target. In this case, call 'make all' or '../Gmake all'. X X Note that pseudo error messages from gmake similar to: X X gmake[1]: Entering directory `cdrtools-1.10/conf' X ../RULES/rules.cnf:58: ../incs/sparc-sunos5-cc/Inull: No such file or directory X ../RULES/rules.cnf:59: ../incs/sparc-sunos5-cc/rules.cnf: No such file or directory X X are a result of a bug in GNU make. The make file system itself is X correct (as you could prove by using smake). X If your gmake version still has this bug, send a bug report to: X X "Paul D. Smith" X X He is the current GNU make maintainer. X X If you like to use 'smake', please always compile it from source. X The packages are located on: X X https://sourceforge.net/projects/s-make/files/alpha/ X X Smake has a -D flag to see the actual makefile source used X and a -d flag that gives easy to read debugging info. Use smake -xM X to get a makefile dependency list. Try smake -help X X XCompiling the project using engineering defaults: X X The defaults found in the directory DEFAULTS are configured to X give minimum warnings. This is made because many people will X be irritated by warning messages and because the GNU C compiler X will give warnings for perfectly correct and portable C code. X X If you want to port code to new platforms or do engineering X on the code, you should use the alternate set of defaults found X in the directory DEFAULTS_ENG. X You may do this permanently by renaming the directories or X for one compilation by calling: X X make DEFAULTSDIR=DEFAULTS_ENG X X Note however, that some GCC versions print a lot of wrong warnings X in this mode. Well known problems with GCC warnings are: X X - The recursive printf format "%r" that is in use since ~ 1980 X is not supported and causes a lot of incorrect warnings as X GCC does not know that "%r" takes 2 parameters. X X - The standard C construct "(void) read(fd, buf, sizeof (buf))" X is flagged by some versions of GCC even though the void cast X is a clear expression of the fact that the return code from read X is intentionally ignored. This may cause many useless warnings X for last resort error messages used in programs. X X XCompiling the project to allow debugging with dbx/gdb: X X If you like to compile with debugging information for dbx or gdb, X call: X X make clean X make COPTX=-g LDOPTX=-g X X If your debugger does not like optimized binaries, call something X like: X X make "COPTX=-g -xO0" LDOPTX=-g X or X make "COPTX=-g -O0" LDOPTX=-g X X depending on the option system used by your C compiler. X X XCompiling the project to allow performance monitoring with gprof from BSD: X X If you like to compile for performance monitoriing with gprof, X call: X X make clean X make COPTX=-xpg LDOPTX=-xpg LINKMODE=profiled X X or X make COPTX=-pg LDOPTX=-pg LINKMODE=profiled X X depending on the option system used by your C compiler. X X XCreating Blastwave packages: X X Call: X .clean X smake -f Mcsw X X You need the program "fakeroot" and will find the results X in packages/. X X Note that a single program source tree will allow you to create X packages like CSWstar but not the packages CSWschilybase and X CSWschilyutils on which CSWstar depends. X X X X X If you want to see an example, please have a look at the "star" X source. It may be found on: X X http://sourceforge.net/projects/s-tar/files/ X X Have a look at the manual page, it is included in the distribution. X Install the manual page with X X make install first and include /opt/schily/man in your MANPATH X X Note that some systems (e.g. Solaris 2.x) require you either to call X /usr/lib/makewhatis /opt/schily/man or to call X X man -F X X XCompiling in a cross compilation environment: X X The Schily autoconf system has been enhanced to support cross X compilation. Schily autoconf is based on GNU autoconf-2.13 and X GNU autoconf does not support cross compilation because it needs X to run scripts on the target system for some of the tests. X X The "configure" script that is delivered with the Schily makefile X system runs more than 770 tests and approx. 70 of them need to be X run on the target system. X X The Schily autoconf system now supports a method to run these ~70 X tests natively on a target system. You either need a target machine X with remote login features or you need an emulator with a method to X copy files into the emulated system and to run binaries on the X emulated system as e.g. the Android emulator. X X We currently deliver three scripts for "remote" execution of X programs on the target system: X X runrmt_ssh runs the commands remove via ssh X runrmt_rsh runs the commands remove via rsh X runrmt_android runs the commands remove via the debug bridge X X If you need to remotely run programs on a system that is not X supported by one of there three scripts, you need to modify one X of them to match your needs. X X To enable Cross Compilation use the following environment variables: X X CONFIG_RMTCALL= Set up to point to a script that does X the remote execution, e.g.: X X CONFIG_RMTCALL=`pwd`/conf/runrmt_ssh X X CONFIG_RMTHOST= Set up to point to your remote host, e.g.: X X CONFIG_RMTHOST=hostname X or X CONFIG_RMTHOST=user@hostname X X use a dummy if you like to use something X like the Android emulator. X X CONFIG_RMTDEBUG= Set to something non-null in order to X let the remote execution script mark X remote comands. This will result in X configure messages like: X X checking bits in minor device number... REMOTE 8 X X If you cannot run commands on the target X platform, you may set: X X CONFIG_RMTDEBUG=true X CONFIG_RMTCALL=: X X carefully watch for the "REMOTE" flagged test X output and later manually edit the file: X X incs//xconfig.h X X Do not forget to manually edit the files: X X incs//align.h X and X incs//avoffset.h X X Note that smake includes automake features that automatically X retrieve system ID information. For this reason, you need to overwrite X related macros from the command line if you like to do a X cross compilation. X X Related make macros: X X K_ARCH= # (sun4v) Kernel ARCH filled from uname -m / arch -k X M_ARCH= # (sun4) Machine filled from arch X P_ARCH= # (sparc) CPU ARCH filled from uname -p / mach X OSNAME= # sunos, linux, .... X OSREL= # 5.11 X OSVERSION= # snv_130 X CCOM= # generic compiler name (e.g. "gcc") X CC= # compiler to call (name for binary) X CC_COM= # compiler to call (name + basic args) X X ARCH= overwrites M_ARCH and P_ARCH X X It is usually suffucient to set ARCH and OSNAME. X X In order to use a cross compiler environment instead of a native compiler, X set the make macro CC_COM or CC to something different than "cc". X X If you are on Linux and like to compile for Android, do the following: X X 1) set up CC acording to the instructions from the cross compiler X tool chain. Important: you need to read the information for your X tool chain. A working setup may look similar to: X X NDK=/home/joerg/android-ndk-r7 X SYSROOT=\$NDK/platforms/android-14/arch-arm X CC="\$NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc --sysroot=\$SYSROOT" X export NDK X export SYSROOT X export CC X X X 2) set environment variables CONFIG_RMTCALL / CONFIG_RMTHOST, e.g.: X setenv CONFIG_RMTCALL `pwd`/conf/runrmt_android X setenv CONFIG_RMTHOST NONE X X 3) call smake: X X smake ARCH=armv5 OSNAME=linux CCOM=gcc "CC_COM=$CC" X X or X X smake ARCH=armv5 OSNAME=linux CCOM=gcc "CC=$CC" X X XCompiling with the address sanitizer: X X Be careful with a compiler enhancement called "addess sanitizer". X X First a note: the address sanitizer needs a lot of memory when in X 64-bit mode. For this reason, it is recommended to run the tests X in 32-bit mode as it may be impossible to provide a sufficient amount X of memory for the 64-bit mode. X X 1) The address sanitizer may cause autoconf to behave incorrectly in X case that the compiler options used by the "configure" run include the X address sanitizer. It seems that in addition, the address sanitizer X adds more libraries to the link list and as a result prevents X the correct autoconf decision on whether a specific library from X a "configure" test is needed by some binaries. X X If you are not sure about the current state of the source tree, start X with calling: X X ./.clean X X in the top level source directory. This makes the source tree to behave X as if if was recently unpacked from the tar archive. X X Then run run e.g.: X X cd inc/ X smake CCOM=gcc32 X cd .. X X to prepare the auto-configuration without using the address sanitizer. X This special treatment is needed as the assumptions in the address X sanitizer would not allow us to run the autoconfiguration code X correctly. X X 2) The address sanitizer by default ignores installed SIGSEGV handlers X and thus ignores the intention of the author of the code. X X The correct behavior may be switched on via setting the environment X variable: X X ASAN_OPTIONS=allow_user_segv_handler=true X X As a redult, the command line to compile the code after the X auto-configuration has been done as mentioned above is: X X ASAN_OPTIONS=allow_user_segv_handler=true smake CCOM=gcc32 COPTX="-g -O0 -fsanitize=address" LDOPTX="-g -fsanitize=address" X X 3) If you are on Linux, do not forget to call "ulimit -c unlimited", X before calling the binary. This is needed as the default on Linux is X not to create a core file. X X 4) Set the environment ASAN_OPTIONS= for the execution of the binary X to control the behavior of the Address Sanitizer while the binary X is run. X X If you like to disable the memory leak detection because your program X is a short running program that intentionally does not free() resources X before calling exit(), use: X X ASAN_OPTIONS=allow_user_segv_handler=true:detect_leaks=0 X X If you also like to get a core dump on error to debug, you may like X to use: X X ASAN_OPTIONS=allow_user_segv_handler=true:detect_leaks=0:abort_on_error=1 X X Note that the Address Sanitizer disables the creation of a core file X for 64 bit binaries as the tables used by the Address Sanitizer may X cause the core file to have a size of 16 TB. X X XCompiling with the "Americal fuzzy lop": X X Follow the instruction from above for the address sanitizer, but X use this command line to call the compiler: X X ASAN_OPTIONS=allow_user_segv_handler=true AFL_HARDEN=1 AFL_USE_ASAN=1 smake CC=afl-gcc CCOM=gcc32 X X XAuthor: X XJoerg Schilling XSeestr. 110 XD-13353 Berlin XGermany X XEmail: joerg.schilling@fokus.fraunhofer.de, joerg@schily.net X XPlease mail bugs and suggestions to me. END-of-star-1.6/README.compile echo x - star-1.6/Changelog sed 's/^X//' >star-1.6/Changelog << 'END-of-star-1.6/Changelog' X*************** Release 1.5 ******************* X XSun Apr 13 16:01:29 2008 Joerg Schilling X * star.c 1.316 X Version -> 1.5 X XSun Apr 6 20:28:14 2008 Joerg Schilling X * xheader.c 1.76 X * header.c 1.135 X uid_nobody() -> ic_uid_nobody() X XSun Apr 6 18:32:15 2008 Joerg Schilling X * findinfo.c 1.8 X * star_sym.c 1.6 X * restore.c 1.59 X * list.c 1.70 X * star.c 1.315 X * starsubs.h 1.108 X * xheader.c 1.75 X * header.c 1.134 X * extract.c 1.131 X * create.c 1.125 X * acl_unix.c 1.37 X * diff.c 1.82 X Vollstaendige Trennung star/libfind X XWed Mar 19 20:09:22 2008 Joerg Schilling X * acl_unix.c 1.36 X opt_acl() auch ohne USE_ACL sicherstellen X XWed Mar 19 20:00:22 2008 Joerg Schilling X * suntar.c 1.31 X * create.c 1.124 X Copyright -> 2008 X XWed Mar 19 19:58:22 2008 Joerg Schilling X * create.c 1.123 X Fuer inkrementelle Dumps nun info->f_mtime >= Newer.tv_sec statt info->f_mtime > Newer.tv_sec X XWed Mar 19 19:57:22 2008 Joerg Schilling X * star.c 1.314 X Version -> 1.5a89 X XTue Mar 18 20:36:34 2008 Joerg Schilling X * restore.c 1.58 X Coredump im Debugmodus vermeiden wenn Level 0 Dump eingespielt wird und ogp == NULL X XSun Mar 16 22:37:49 2008 Joerg Schilling X * suntar.c 1.30 X --sattr neu X suntar -E -p -> star H=exustar -acl X XSun Mar 16 16:45:02 2008 Joerg Schilling X * extract.c 1.130 X Copyright -> 2008 X XSun Mar 16 16:40:40 2008 Joerg Schilling X * starsubs.h 1.107 X * star.c 1.313 X * buffer.c 1.146 X * fflags.c 1.21 X * acl_unix.c 1.35 X * xattr.c 1.10 X Kompilationsoptionen bet star -version mit ausgeben mit neuen opt_*() Funktionen X XFri Mar 14 00:35:55 2008 Joerg Schilling X * xheader.c 1.74 X * star.h 1.117 X Copyright -> 2008 X XFri Mar 14 00:33:43 2008 Joerg Schilling X * star.h 1.116 X * xheader.c 1.73 X SCHILY.acl.type neu als Vorsorge fuer VFSv4 ACLs X XTue Mar 4 00:03:12 2008 Joerg Schilling X * star.c 1.312 X Version -> 1.5a88 X XSun Feb 17 14:32:17 2008 Joerg Schilling X * diff.h 1.14 X * diff.c 1.81 X * star.c 1.311 X diffopts=symperm neu X XSat Feb 16 16:50:17 2008 Joerg Schilling X * extract.c 1.129 X K&R mag nicht ein Label _und_ eine Funktion setmodes X XThu Dec 27 17:39:41 2007 Joerg Schilling X * star_unix.c 1.92 X samefile() nun sicher gegen NULL Pointer X XTue Dec 11 18:11:17 2007 Joerg Schilling X * star_unix.c 1.91 X * starsubs.h 1.106 X * buffer.c 1.145 X samefile() und Verhindern dass star -cv f=/dev/stdout > file ein defektes Archiv liefert X XMon Nov 26 23:22:16 2007 Joerg Schilling X * buffer.c 1.144 X gettimeofday(&starttime) nur einmal und nicht bei jedem Oeffnen eines neuen Archivs X XSun Nov 11 22:56:12 2007 Joerg Schilling X * buffer.c 1.143 X besserer Kommentar fuer startvol() X XThu Nov 8 18:01:12 2007 Joerg Schilling X * volhdr.c 1.31 X "Blocksize %d\n" -> "Blocksize %d records\n" X XSun Oct 28 22:17:46 2007 Joerg Schilling X * dumpdate.c 1.18 X Cstyle X XSun Oct 28 22:16:34 2007 Joerg Schilling X * star.c 1.310 X Version -> 1.5a87 X XSun Oct 28 22:16:04 2007 Joerg Schilling X * dumpdate.h 1.13 X Copyright -> 2007 X XSun Oct 28 22:15:31 2007 Joerg Schilling X * dumpdate.h 1.12 X * star.c 1.309 X * dumpdate.c 1.17 X Umbau damit /etc/dumpdates gelockt wird und kurz vor dem Schreiben am Ende noch mal neu gelesen wird X XFri Oct 26 01:27:20 2007 Joerg Schilling X * star.c 1.308 X dumplevel= wird mit list= oder -find verboten X XFri Oct 26 01:12:20 2007 Joerg Schilling X * header.c 1.133 X Neue Option -link-data X F_DATA_SKIPPED neu X info->f_llsize immer setzen X XFri Oct 26 01:10:55 2007 Joerg Schilling X * extract.c 1.128 X Neue Option -link-data X F_DATA_SKIPPED neu X XFri Oct 26 01:07:58 2007 Joerg Schilling X * cpiohdr.c 1.23 X info->f_llsize immer setzen X F_DATA_SKIPPED neu X XFri Oct 26 01:04:22 2007 Joerg Schilling X * create.c 1.122 X * star.c 1.307 X Neue Option -link-data X XThu Oct 25 23:43:03 2007 Joerg Schilling X * star.h 1.115 X F_DATA_SKIPPED neu X XThu Oct 25 23:41:47 2007 Joerg Schilling X * xheader.c 1.72 X info->f_llsize immer setzen X XThu Oct 25 23:32:53 2007 Joerg Schilling X * props.h 1.23 X * props.c 1.52 X PR_LINK_DATA neu X XSat Oct 20 20:38:06 2007 Joerg Schilling X * buffer.c 1.142 X zbuf beseitigt, zur Kompressionsfeststellung wird nun bigbuf verwendet X XSat Oct 20 17:13:18 2007 Joerg Schilling X * gnutar.c 1.21 X * fifo.c 1.67 X Copyright -> 2007 X XSat Oct 20 17:12:52 2007 Joerg Schilling X * fifo.h 1.30 X Copyroght -> 2007 X XSat Oct 20 16:44:21 2007 Joerg Schilling X * suntar.c 1.29 X --do-statistics neu in -help X XSat Oct 20 16:43:59 2007 Joerg Schilling X * gnutar.c 1.20 X * pax.c 1.24 X * suntar.c 1.28 X -no-statitstics wird Default, neue Option -do-statistics X XSat Oct 20 16:38:10 2007 Joerg Schilling X * buffer.c 1.141 X * fifo.h 1.29 X * cpiohdr.c 1.22 X * header.c 1.132 X * cpio.c 1.22 X Neue Option -cpio-statistics, cpio gibt per Default eine Statistik aus die identisch zu cpio ist X XSat Oct 20 01:40:33 2007 Joerg Schilling X * star.c 1.306 X Neue Optionen -xmeta und -cpio-statistics X XSat Oct 20 01:34:59 2007 Joerg Schilling X * extract.c 1.127 X Neue Option -xmeta X XFri Oct 19 01:16:56 2007 Joerg Schilling X * buffer.c 1.140 X bigbuf ist nun Pagealigned X XFri Oct 19 01:16:27 2007 Joerg Schilling X * fifo.c 1.66 X Umstellung auf getpagesize() aus libschily X XTue Oct 9 11:26:02 2007 Joerg Schilling X * star.c 1.305 X Versin -> 1.5a86 X XTue Oct 9 11:25:40 2007 Joerg Schilling X * diff.c 1.80 X "sparse" Vergleich nicht machen bei Hardlinks ohne Inhalt X XSat Oct 6 16:05:52 2007 Joerg Schilling X * star_sym.c 1.5 X Versuch mit star_sym die Datenbank neu aufzubauen X XSat Oct 6 15:37:05 2007 Joerg Schilling X * restore.c 1.57 X #ifdef STAR_SYM beseitigt, stattdessen neue Variable is_star X immer #define PRINT_L_SYM damit star_sym.c kein spezielles restore.o braucht X Neue Funktion printLsym() fuer star_sym.c X sym_dump() nun mit writeheader() Aufruf, damit star-symdump komplett ist X XSat Oct 6 15:23:12 2007 Joerg Schilling X * starsubs.h 1.105 X Mehr oeffentliche Symbole fuer restore.c wegen star_sym.c X XTue Sep 25 15:12:04 2007 Joerg Schilling X * restore.c 1.56 X Umstellung einiger Symbole auf EXPORT fuer star_sym.c X XSat Sep 22 17:03:47 2007 Joerg Schilling X * checkerr.c 1.18 X * volhdr.c 1.30 X * acl_unix.c 1.34 X Copyright -> 2007 X XSat Sep 22 17:03:15 2007 Joerg Schilling X * checkerr.c 1.17 X * extract.c 1.126 X * fflags.c 1.20 X * diff.c 1.79 X * list.c 1.69 X * acl_unix.c 1.33 X Cstyle X XSat Sep 22 16:45:08 2007 Joerg Schilling X * restore.c 1.55 X Unbenutzte printf() Parameter beseitigt X XSat Sep 22 16:44:32 2007 Joerg Schilling X * extract.c 1.125 X * volhdr.c 1.29 X Unbenutzte Variablen beseitigt X XSat Sep 22 15:14:27 2007 Joerg Schilling X * restore.c 1.54 X sym_initmaps() neu, Codeumstellungen fuer star_sym X XThu Sep 13 01:12:29 2007 Joerg Schilling X * star_sym.c 1.4 X Erweiterte Dummys fuer aktuelles star X XThu Sep 13 00:44:24 2007 Joerg Schilling X * star.c 1.304 X Version -> 1.5a85 X XThu Sep 13 00:43:39 2007 Joerg Schilling X * extract.c 1.124 X * restore.c 1.53 X symlinks und special Files nicht loeschen und neu anlegen bei -restore damit das Datum der Directory darueber erhalten bleibt X XWed Sep 12 21:47:22 2007 Joerg Schilling X * starsubs.h 1.104 X same_symlink()/same_special() neu X XWed Sep 12 21:46:17 2007 Joerg Schilling X * star.h 1.114 X Neues Flag F_SAME X XWed Sep 12 15:58:45 2007 Joerg Schilling X * restore.c 1.52 X * star.h 1.113 X * buffer.c 1.139 X star_symtable wird nun nicht mehr einfach ueberschrieben und evt. unvollständig bei Systemabsturz waehrend des Schreibens von star_symtable X XMon Sep 3 01:25:01 2007 Joerg Schilling X * checkerr.c 1.16 X errflags() versucht nicht mehr den String Paramerer zu modifizieren (GCC Core dump) X XWed Aug 22 14:52:41 2007 Joerg Schilling X * star.c 1.303 X Version -> 1.5a84 X XTue Aug 21 14:45:30 2007 Joerg Schilling X * extract.c 1.123 X has_dotdot() findet nun auch ".." bei OBJ//..//../star/ X XMon Jul 16 10:43:14 2007 Joerg Schilling X * star.c 1.302 X Verion -> 1.5a83 X XSun Jul 15 20:38:52 2007 Joerg Schilling X * star.c 1.301 X * star.h 1.112 X * create.c 1.121 X * starsubs.h 1.103 X Neuer Parameter "forceadd" bei create() X star ruft cdreate() im Dump-Modus nun so auf, dass die Directory von der Kommandozeile immer archiviert wird X XSun Jul 15 20:29:04 2007 Joerg Schilling X * restore.c 1.51 X unlink(sym_lock); bei mehr Fehlern X XSun Jul 15 17:49:23 2007 Joerg Schilling X * create.c 1.120 X Auch Hardgelinkte Directories vor den Archivieren mit take_file() pruefen X XTue Jul 10 01:04:34 2007 Joerg Schilling X * star.c 1.300 X Bei leeren inkrementellen Dumps wird nun zumindest "." geschrieben damit restore funktioniert X XTue Jul 10 01:03:52 2007 Joerg Schilling X * restore.c 1.50 X Ein fehlender Dumplevel kann nun mir -force-restore uebersprungen werden X unlink(sym_lock) bei diversen Abbruechen um ein spaeteres Blockieren zu vermeiden X XSat Jul 7 13:18:00 2007 Joerg Schilling X * starsubs.h 1.102 X put_svolhdr() neu X XSat Jun 30 01:01:10 2007 Joerg Schilling X * volhdr.c 1.28 X mot dumplevel >= 0 immer einen Volheader schreiben auch bei leerem inkrementellem Dump X XSat Jun 30 01:01:10 2007 Joerg Schilling X * star.c 1.299 X mit dumplevel >= 0 immer einen Volheader schreiben auch bei leerem inkrementellem Dump X XWed Jun 27 01:55:20 2007 Joerg Schilling X * cpiohdr.c 1.21 X Copyright -> 2007 X XWed Jun 27 01:54:47 2007 Joerg Schilling X * star.c 1.298 X Version -> 1.5a82 X XWed Jun 27 01:54:13 2007 Joerg Schilling X * cpiohdr.c 1.20 X astoh_cpio() akzeptiert nun auch Hex Grossbuchstaben wegen GNU cpio X XSat Jun 16 17:55:58 2007 Joerg Schilling X * star_unix.c 1.90 X * fflags.c 1.19 X Copyright -> 2007 X XSat Jun 16 17:54:39 2007 Joerg Schilling X * star.c 1.297 X Version -> 1.5a81 X XFri Jun 15 18:49:43 2007 Joerg Schilling X * fflags.c 1.18 X Umstellung auf HAVE_USABLE_LINUX_EXT2_FS_H & TRY_EXT2_FS X XFri Jun 15 18:44:54 2007 Joerg Schilling X * star_unix.c 1.89 X #include / #include beseitigt X XTue Jun 12 02:50:21 2007 Joerg Schilling X * buffer.c 1.138 X Wenn write() -1 liefert, nicht mehr -1 auf die Statistik addieren X XSun Jun 3 22:46:23 2007 Joerg Schilling X * star.c 1.296 X Version -> 1.5a80 X XSun Jun 3 18:06:51 2007 Joerg Schilling X * extract.c 1.122 X * star.c 1.295 X -install neu X XSun Jun 3 17:57:09 2007 Joerg Schilling X * cpio.c 1.21 X cpio nimmt nun star -install -force-remove -remove-recursive -no-fsync beim Extrahieren X Neue Option -do-fsync X XTue May 29 23:13:08 2007 Joerg Schilling X * star.h 1.111 X Umbau auf schily/param.h X XTue May 29 23:09:53 2007 Joerg Schilling X * star_unix.c 1.88 X * starsubs.h 1.101 X sxsymlink() nun mit name Parameter damit star -install funktioniert X XMon May 28 23:45:50 2007 Joerg Schilling X * extract.c 1.121 X is_eexist() neu X XMon May 28 15:37:43 2007 Joerg Schilling X * suntar.c 1.27 X * star.c 1.294 X * remove.c 1.52 X -keep-nonempty-dirs neu X XSun May 27 01:44:03 2007 Joerg Schilling X * extract.c 1.120 X Bei -force-remove link_file: from/to identical, skipping ... unterdruecken X XSun May 27 01:42:23 2007 Joerg Schilling X * suntar.c 1.26 X Neue Option --do-fsync X tar -x ist nicht star -xU sondern star -xU -force-remove -no-fsync X XSat May 26 16:08:21 2007 Joerg Schilling X * gnutar.c 1.19 X gnutar -X funktioniert nun X XSat May 26 16:04:04 2007 Joerg Schilling X * star.c 1.293 X * list.c 1.68 X * create.c 1.119 X * extract.c 1.119 X * diff.c 1.78 X -X Option neu X XSat May 26 15:51:30 2007 Joerg Schilling X * suntar.c 1.25 X tar -X funktioniert nun X XFri May 25 19:13:55 2007 Joerg Schilling X * suntar.c 1.24 X -T Option (Trusted Solaris) neu in char *sun_copt X XFri May 25 18:59:32 2007 Joerg Schilling X * starsubs.h 1.100 X * lhash.c 1.16 X hash_xbuild()/hash_xlookup() neu fuer eXclude Option X XFri May 25 18:47:39 2007 Joerg Schilling X * fflags.c 1.17 X * star_unix.c 1.87 X Include linux/types.h & linux/gfp.h nach Hinwweis von Michael Teichgräber X XFri May 25 14:37:48 2007 Joerg Schilling X * extract.c 1.118 X Fehler beim Einschalten von O_DSYNC korrigiert, bislang wurde F_GETFD statt F_GETFL verwendet X XFri May 25 14:22:55 2007 Joerg Schilling X * buffer.c 1.137 X Umbau auf schily/ioctl.h X tarf = (FILE *)NULL auch mit "copyflag" X file_raise(tarf, FALSE) nur wenn tarf != (FILE *)NULL X XThu May 24 14:38:06 2007 Joerg Schilling X * star_unix.c 1.86 X * fflags.c 1.16 X Umstellung auf schily/ioctl.h X XThu May 10 23:34:40 2007 Joerg Schilling X * suntar.c 1.23 X * gnutar.c 1.18 X * cpio.c 1.20 X * pax.c 1.23 X xxx_setopts() neu um char *opts auf den wirklichen Opt String zu setzen damit getfiles() funktioniert X XWed May 9 02:13:31 2007 Joerg Schilling X * suntar.c 1.22 X -T option neu X artype=header Option neu X -E aktiviert X -n gibtnur noch eine Warnung X XSun May 6 23:38:10 2007 Joerg Schilling X * suntar.c 1.21 X -P ist doch implementiert X Warnung dass bei -k Dateien nicht geteilt werden X XWed Apr 25 12:43:11 2007 Joerg Schilling X * star.c 1.292 X Version -> 1.5a79 X XSun Apr 22 01:54:39 2007 Joerg Schilling X * acl_unix.c 1.32 X Linux hat ab 3 ACL Entries default ACLs X XFri Apr 20 18:05:36 2007 Joerg Schilling X * names.c 1.23 X Endlosrekursion in nameinit() verhundern in dem name_init = TRUE gesetzt wird X XSat Apr 7 01:15:32 2007 Joerg Schilling X * star.c 1.291 X Version -> 1.5a78 X XSat Apr 7 00:50:21 2007 Joerg Schilling X * star.h 1.110 X * starsubs.h 1.99 X * xheader.c 1.71 X * suntar.c 1.20 X * pax.c 1.22 X * findinfo.c 1.7 X * header.c 1.131 X * hole.c 1.53 X * list.c 1.67 X * dumpdate.c 1.16 X * extract.c 1.117 X * cpio.c 1.19 X * diff.c 1.77 X Copyright -> 2007 X XSat Apr 7 00:43:54 2007 Joerg Schilling X * cpio.c 1.18 X * pax.c 1.21 X * star.h 1.109 X * suntar.c 1.19 X * header.c 1.130 X * star.c 1.290 X * buffer.c 1.136 X -7z (p7zip) Support neu X XWed Apr 4 02:53:58 2007 Joerg Schilling X * cpio.c 1.17 X * pax.c 1.20 X * star.h 1.108 X * suntar.c 1.18 X * star.c 1.289 X * header.c 1.129 X * buffer.c 1.135 X Support fuer lzop Kompression neu X XWed Mar 28 16:53:37 2007 Joerg Schilling X * findinfo.c 1.6 X * star.c 1.288 X find_node -> findn_t * X XSun Mar 11 13:51:13 2007 Joerg Schilling X * bitstring.h 1.6 X Copyright -> 2007 X _SCHILY_H -> _SCHILY_SCHILY_H X bit_ffcs()/bit_ffss() nun ohne sinnloses for (_byte; X XSun Mar 11 13:23:31 2007 Joerg Schilling X * star.c 1.287 X Copyright -> 2007 X Version -> 1.5a77 X Unbenoetigter number() Prototyp beseitigt X XMon Feb 26 16:03:18 2007 Joerg Schilling X * list.c 1.66 X * diff.c 1.76 X * extract.c 1.116 X #include -> #include "walk.h" X XMon Feb 26 16:02:50 2007 Joerg Schilling X * star.c 1.286 X walkinitstate() neu X walkflags |= WALK_NOEXIT neu X XThu Feb 22 21:23:27 2007 Joerg Schilling X * star.c 1.285 X Umbau auf neue libfind X XSun Feb 18 15:09:42 2007 Joerg Schilling X * hole.c 1.52 X get_end_hole() muss TRUE liefern wenn wir genau am Ende der Sparseliste sind weil es dann ken Loch am Ende gibt X XSun Feb 18 15:08:39 2007 Joerg Schilling X * extract.c 1.115 X Kommentar fuer xt_file() X XSun Feb 18 14:26:56 2007 Joerg Schilling X * starsubs.h 1.98 X * star.c 1.284 X * xheader.c 1.70 X * header.c 1.128 X * names.c 1.22 X uid_nobody()/gid_nobody() sind nun nicht mehr Variablen sondern Funktionen X nameinit() -> LOCAL und automatisch X XWed Feb 14 18:22:40 2007 Joerg Schilling X * names.c 1.21 X Copyright -> 2007 X XThu Feb 8 10:53:35 2007 Joerg Schilling X * names.c 1.20 X "common" varaible -> "data" wegen Mac OS X Linker Problemen X XMon Feb 5 00:04:36 2007 Joerg Schilling X * star.c 1.283 X getnum()/getllnum -> libschily X XTue Jan 16 23:23:53 2007 Joerg Schilling X * dumpdate.c 1.15 X Bessere Fehlermeldungen X XTue Jan 16 23:21:02 2007 Joerg Schilling X * buffer.c 1.134 X comerrno(EX_BAD, "Cannot update compressed archives.\n"); beim Versuch star -u/-r auf komprimiertes Archiv X XSun Dec 17 20:55:27 2006 Joerg Schilling X * names.c 1.19 X nameuid()/namegid() muessen #ifdef PROTOTYPES haben da uid_t/gid_t evt short sind X XSun Dec 3 22:17:25 2006 Joerg Schilling X * header.c 1.127 X Wenn die Checksumme im Header 0 zu sein scheint, dann ist das kein gueltiger Headerblock X Sing Checksummenberechnung erfolgt nun in signed long statt unsigned long X XMon Nov 20 14:31:29 2006 Joerg Schilling X * star.c 1.282 X Version -> 1.5a76 X XSun Nov 12 20:09:40 2006 Joerg Schilling X * hole.c 1.51 X Im Falle von bad_sparse_index() seterrno(EX_BAD), damit die "Error writing..." Meldung nicht einen alten errno zeigt X XSun Nov 12 01:07:28 2006 Joerg Schilling X * acl_unix.c 1.31 X Wenn acl(info->f_name, GETACLCNT, 0, NULL) ENOSYS returniert, dann keine Fehlermeldung X XSun Nov 12 01:05:57 2006 Joerg Schilling X * hole.c 1.50 X Loecher am Ende eines Files die kleiner als 512 Bytes waren wurden nicht korrekt erkannt X XSat Nov 11 23:06:48 2006 Joerg Schilling X * hole.c 1.49 X get_sparse_func() prueft nun bei jedem Schleifendurchlauf ob fh->fh_spindex >= fh->fh_nsparse um ein defektes star Archiv zu erkennen X XSat Nov 11 21:45:47 2006 Joerg Schilling X * buffer.c 1.133 X wenn readtape() eine geringere Blocksize als erwartet findet wird nun auch stats->nblocks korrigiert X XSun Nov 5 02:48:13 2006 Joerg Schilling X * starsubs.h 1.97 X mem.c beseitigt X XSat Nov 4 00:56:49 2006 Joerg Schilling X * append.c 1.24 X Directories immer ohne Slash am Ende vergleichen. X XFri Nov 3 18:35:03 2006 Joerg Schilling X * header.c 1.126 X info->f_namelen = info->f_lnamelen = 0; neu in tcb_to_info() X XWed Nov 1 01:15:09 2006 Joerg Schilling X * match.c 1.10 X star x dir/ liefert nun nicht mehr pattern did not match X XTue Oct 31 18:34:50 2006 Joerg Schilling X * acltext.c 1.12 X #include schily/schily.h neu X XTue Oct 31 18:06:24 2006 Joerg Schilling X * dumpdate.c 1.14 X * star_unix.c 1.85 X * list.c 1.65 X * acl_unix.c 1.30 X * props.c 1.51 X * remove.c 1.51 X * buffer.c 1.132 X * acltext.c 1.11 X * names.c 1.18 X * cpiohdr.c 1.19 X * fflags.c 1.15 X * xheader.c 1.69 X * chdir.c 1.3 X * longnames.c 1.48 X * checkerr.c 1.15 X * append.c 1.23 X * lhash.c 1.15 X * tartest.c 1.12 X * defaults.c 1.10 X * dirtime.c 1.24 X * device.c 1.13 X * volhdr.c 1.27 X * unicode.c 1.8 X * movearch.c 1.31 X * subst.c 1.9 X * match.c 1.9 X * table.c 1.24 X * xtab.h 1.4 X * star.h 1.107 X * dumpdate.h 1.11 X * props.h 1.22 X * starsubs.h 1.96 X Copyright -> 2006 X XMon Oct 30 20:08:41 2006 Joerg Schilling X * star_sym.c 1.3 X Includefiles -> include/schily/* X Copyright -> 2006 X XSun Oct 15 16:59:19 2006 Joerg Schilling X * props.c 1.50 X CPIO ASC & CRC Format koennen bis zu 4 GB - 1 Byte X XSun Oct 15 16:51:44 2006 Joerg Schilling X * extract.c 1.114 X EOF Erkennung in xt_file() funktioniert nun auch mit dem CPIO Format X XSat Oct 7 23:55:05 2006 Joerg Schilling X * hole.c 1.48 X newpos in get_sparse_func() war nicht initialisiert X XSat Oct 7 22:42:32 2006 Joerg Schilling X * hole.c 1.47 X get_end_hole(): uninitialisiete Variable "add" repariert X get_end_hole(): Return TRUE wenn das letzte ftruncate() klapt X XWed Sep 27 02:49:44 2006 Joerg Schilling X * findinfo.c 1.5 X Umstellung auf globales walkstate zur Uebermittling diverser Parameter X XWed Sep 27 02:38:32 2006 Joerg Schilling X * list.c 1.64 X * diff.c 1.75 X * extract.c 1.113 X walkopen()/walkgethome() sowie walkhome()/walkclose()/free(walkstate.twprivate) fuer aktuelle libfind/find_expr() X XTue Sep 26 21:59:01 2006 Joerg Schilling X * star.c 1.281 X init_findargs() -> find_argsinit(), init_findtime() -> find_timeinit() X XTue Sep 26 17:14:37 2006 Joerg Schilling X * star.c 1.280 X include -> include/schily/* X Anpassungen fuer neue libfind X XTue Sep 26 15:57:11 2006 Joerg Schilling X * hole.c 1.46 X * extract.c 1.112 X * restore.c 1.49 X * remove.c 1.50 X * fifo.c 1.65 X * dumpdate.c 1.13 X * star_unix.c 1.84 X * create.c 1.118 X * buffer.c 1.131 X * acltext.c 1.10 X * acl_unix.c 1.29 X * fflags.c 1.14 X errno.h -> schily/errno.h X XWed Sep 13 20:32:50 2006 Joerg Schilling X * tartest.c 1.11 X * names.c 1.17 X * props.c 1.49 X * remove.c 1.49 X * volhdr.c 1.26 X * unicode.c 1.7 X * subst.c 1.8 X * restore.c 1.48 X * table.c 1.23 X * star_unix.c 1.83 X * xheader.c 1.68 X * xattr.c 1.9 X * longnames.c 1.47 X * fifo.c 1.64 X * fflags.c 1.13 X * match.c 1.8 X * movearch.c 1.30 X * hole.c 1.45 X * list.c 1.63 X * lhash.c 1.14 X * header.c 1.125 X * dumpdate.c 1.12 X * chdir.c 1.2 X * buffer.c 1.130 X * cpiohdr.c 1.18 X * extract.c 1.111 X * dirtime.c 1.23 X * defaults.c 1.9 X * device.c 1.12 X * diff.c 1.74 X * append.c 1.22 X * checkerr.c 1.14 X * create.c 1.117 X * acl_unix.c 1.28 X * acltext.c 1.9 X * props.h 1.21 X * dumpdate.h 1.9 X * star.h 1.106 X * xtab.h 1.2 X * fifo.h 1.27 X * starsubs.h 1.94 X Umstellung auf include schily/* X XWed Sep 13 19:36:10 2006 Joerg Schilling X * starsubs.h 1.95 X * dumpdate.h 1.10 X * fifo.h 1.28 X * xtab.h 1.3 X _*_H Defines an include schily/* angepasst X XWed Sep 13 19:22:27 2006 Joerg Schilling X * create.c 1.116 X Schreibfehler X XFri Jul 7 23:01:33 2006 Joerg Schilling X * star.c 1.279 X Version -> 1.5a75 X XSun Jul 2 19:37:15 2006 Joerg Schilling X * hole.c 1.44 X -force-hole schaltet nun von SEEK_HOLE auf cmpbytes() um X bad_sparse_index() neu X get_sparse_func() neu zur Performancesteigerung beim Extrakt X Alte get_sparse_func() -> get_ssparse_func() X get_ssparse_func() verhindert, daß eine defekte Lochliste zum Absturz fuehrt X get_sp_list() hat nun einen zusaetzlichen int *nsparsep Parameter X get_sp_list() erlaubt nun das Extrahieren von "Loch am Ende" mit sparse[i].sp_offset == filesize und sparse[i].sp_numbytes == 0 X get_sp_list() erkennt nun defekte GNU sparse Archive bei denen sparse[i].sp_offset nach ueber 4 GB wieder unter 4 GB springt X smk_sp_list() erkennt nun "Loecher am Ende" und behandelt die SEEK_HOLE/SEEK_DATA Ausnahmen dazu X smk_sp_list()/mk_sp_list() versuchen nicht mehr das "Loch am Ende" mit sparse[i].sp_numbytes = 1 zu verstecken X gnu_skip_extended() mit FINFO Parameter statt TCB X get_end_hole() / write_end_hole() neu um File mit Ende auf ein Loch zu erstellen X XSun Jul 2 17:03:23 2006 Joerg Schilling X * findinfo.c 1.4 X DEV_BSIZE definieren falls nicht vorhanden X XSun Jul 2 14:18:23 2006 Joerg Schilling X * fifo.c 1.63 X comerrno() -> errmsgno() damit die zweite Meldung nach "implementation botch" lesbar wird X XMon Jun 26 21:53:54 2006 Joerg Schilling X * extract.c 1.110 X gnu_skip_extended() nun mit FINFO *info Parameter statt TCB *ptb X In xt_file() func -> void_func() nach Extraktionsfehlern damit der Rest uebersprungen wird X XMon Jun 26 21:48:06 2006 Joerg Schilling X * starsubs.h 1.93 X gnu_skip_extended() nun mit FINFO *info Parameter statt TCB *ptb X XMon Jun 26 21:44:56 2006 Joerg Schilling X * star.h 1.105 X F_SP_EXTENDED/F_SP_SKIPPED neu X XSun May 28 14:55:19 2006 Joerg Schilling X * star.c 1.278 X Version -> 1.5a74 X XSun May 28 14:43:53 2006 Joerg Schilling X * acl_unix.c 1.27 X Versuch die Fehlermeldung: Operation not applicable. Cannot set ACL 'user::rwx,group::r-x,other::r-x' for 'socket' X auf Solaris zu verhindern X XSun May 28 14:41:32 2006 Joerg Schilling X * diff.c 1.73 X Verhindern, dasz beim Sparse Vergleich das open() bei named Pipes haengt X XSun May 28 14:40:29 2006 Joerg Schilling X * star.h 1.104 X is_cont() & is_a_file() neu fuer besseren -sparse test mit -diff X XSat Mar 25 12:40:43 2006 Joerg Schilling X * extract.c 1.109 X Fehlendes void_file() bei is_dir() und aehnlichem gab Probleme beim Auspacken von GNU Dumpdirs X Copyright -> 2006 X XThu Mar 2 11:57:52 2006 Joerg Schilling X * star.c 1.277 X Version -> 1.5a73 X maxdepth/mindepth walkstate initialisieren, so dasz star -find wieder geht und walkfun() nicht alles abblockt X XSun Feb 26 18:53:33 2006 Joerg Schilling X * star.c 1.276 X Version -> 1.5a72 X XSat Feb 25 23:51:10 2006 Joerg Schilling X * fifo.c 1.62 X * fifo.h 1.26 X Umstellung FIFO_IBLOCKED/FIFO_OBLOCKED -> iblocked/oblocked (separate Variablen) um einen FIFO Deadlock zu vermeiden X XSun Feb 19 22:00:07 2006 Joerg Schilling X * hole.c 1.43 X fpathconf(f, _PC_MIN_HOLE_SIZE) neu X XSat Feb 18 23:20:51 2006 Joerg Schilling X * findinfo.c 1.3 X * header.c 1.124 X Copyright -> 2006 X XSat Feb 18 22:29:10 2006 Joerg Schilling X * diff.c 1.72 X Bei D_SPARS sparse_file() rufen um Solaris 11 Sparse Check korrekt zu machen X XSat Feb 18 20:09:38 2006 Joerg Schilling X * star.c 1.275 X Copyright -> 2006 X Verson -> 1.5a71 X XSat Feb 18 18:26:10 2006 Joerg Schilling X * header.c 1.123 X rdevmajor/rdevminor nur auf Wertebereich pruefen wenn das dazugehoerige file ein Devicenode ist X XSat Feb 18 16:33:56 2006 Joerg Schilling X * create.c 1.115 X Support fuer -mindepth/-maxdepth X XTue Feb 14 02:00:40 2006 Joerg Schilling X * xattr.c 1.8 X * fifo.c 1.61 X * restore.c 1.47 X * diff.h 1.13 X * fifo.h 1.25 X Copyright -> 2006 X XSun Feb 12 20:59:19 2006 Joerg Schilling X * restore.c 1.46 X Panic: Meldung fuer lock_ino ("star-lock") unterdruecken X XSun Feb 12 20:52:48 2006 Joerg Schilling X * diff.h 1.12 X * diff.c 1.71 X * star.c 1.274 X Neue diffopt "sympath" X XWed Feb 8 01:03:43 2006 Joerg Schilling X * fifo.h 1.24 X * fifo.c 1.60 X Support fuer BeOS shard memory areas neu X XTue Feb 7 23:42:51 2006 Joerg Schilling X * fifo.h 1.23 X #include X XTue Feb 7 23:39:10 2006 Joerg Schilling X * fifo.h 1.22 X * fifo.c 1.59 X #undef FIFO ist jetzt nur noch in fifo.h X XSun Feb 5 17:01:57 2006 Joerg Schilling X * findinfo.c 1.2 X HAVE_ST_BLOCKS neu X XSun Feb 5 14:06:23 2006 Joerg Schilling X * star.c 1.273 X #include "fifo.h" wieder aktiviert wegen #undef FIFO X HAVE_DEV_TTY Test neu X XThu Feb 2 17:38:10 2006 Joerg Schilling X * xattr.c 1.7 X Umstellung auf lgetxattr()/lsetxattr()/llistxattr() X XThu Feb 2 15:47:46 2006 Joerg Schilling X * star.c 1.272 X Kompilation ohne -DUSE_FIND wieder ermoeglichen X XWed Nov 16 01:25:10 2005 Joerg Schilling X * star.c 1.271 X Version -> 1.5a70 X XWed Nov 16 01:24:41 2005 Joerg Schilling X * star.c 1.270 X getpaxH()/getpaxL()/getpaxP() neu X "Badly placed Option ... vermeiden bei mehreren -C Optionen in Folge X XWed Nov 16 01:21:23 2005 Joerg Schilling X * match.c 1.7 X -C pat=xxx funktioniert nun auch korrekt bei -x und -diff X XSun Nov 13 15:00:10 2005 Joerg Schilling X * star_unix.c 1.82 X info->f_rdev / info->f_rdevmaj / info->f_rdevmin auch bei FIFO's auf 0 setzen X XSun Nov 13 14:57:21 2005 Joerg Schilling X * extract.c 1.108 X F_BAD_META Behandlung ist nun nach -fund Behandlung X XSun Nov 13 14:55:16 2005 Joerg Schilling X * diff.c 1.70 X Bei star -diff -find ... wurde kein neuer TCB gelesen X XTue Nov 8 01:17:34 2005 Joerg Schilling X * xheader.c 1.67 X get_snumber() ruft get_xnumber() nun richtig mit inkrementiertem string Pointer wenn die Zahl mit '-' anfaengt X XSun Nov 6 16:48:35 2005 Joerg Schilling X * list.c 1.62 X info->f_uid/info->f_gid Ausgabe format String korrigiert und Cast auf Llong X XTue Nov 1 23:19:23 2005 Joerg Schilling X * create.c 1.114 X put_dir() ruft fetchdir nicht mehr bei if (!nomount || !newfs(info)) sondern nur noch bei if ((!nodesc || dodump > 0) && (!nomount || !newfs(info))) X damit wird fetchdir() nicht gerufen bei star -cD wenn nicht gleichzeitig auch -dump aktiv ist X XTue Nov 1 23:15:04 2005 Joerg Schilling X * star.c 1.269 X Verion -> 1.5a69 X star -find Support neu X XTue Nov 1 23:13:03 2005 Joerg Schilling X * create.c 1.113 X Viele Funktionen nun neu mit "sname" Parameter damit -find geht X walkfunc() fuer star -find neu X XTue Nov 1 23:05:03 2005 Joerg Schilling X * header.c 1.122 X ustar devminor nun auch extrahieren wenn devmajor[0] & 0x80 (Zuweisung info->f_rdevmin = ul fehlte) X ustar devmajor nun auch extrahieren wenn devminor[0] = 0x80 X XTue Nov 1 22:32:18 2005 Joerg Schilling X * extract.c 1.107 X * diff.c 1.69 X * starsubs.h 1.92 X read_symlink() nun mit zusaetzlichem "sname" Parameter fuer -find X XTue Nov 1 22:10:34 2005 Joerg Schilling X * star_unix.c 1.81 X stat_to_info() fuer -find neu X XTue Nov 1 22:00:29 2005 Joerg Schilling X * star.h 1.103 X INFO->f_sname neu fuer -find X XTue Nov 1 21:42:30 2005 Joerg Schilling X * starsubs.h 1.91 X findinfo() walkfunc() stat_to_info() neu X XTue Nov 1 21:39:33 2005 Joerg Schilling X * diff.c 1.68 X * list.c 1.61 X * extract.c 1.106 X Support fuer -find neu X XTue Nov 1 21:32:41 2005 Joerg Schilling X * findinfo.c 1.1 X date and time created 05/11/01 21:32:41 by joerg X XThu Oct 20 01:17:06 2005 Joerg Schilling X * star_sym.c 1.2 X star_mkvers() mit strvers[] neu X save_args(ac, av) aus main() rufen X XThu Oct 20 00:32:03 2005 Joerg Schilling X * header.c 1.121 X Wenn uidname()/gidname() einen sinnvollen Wert liefern, dann werden F_BAD_UID/F_BAD_GID wieder geloescht X XThu Oct 13 12:30:11 2005 Joerg Schilling X * names.c 1.16 X nameuid()/namegid() liefern nun immer nobody wenn der Return Wert FALSE ist X XThu Oct 13 12:11:21 2005 Joerg Schilling X * star.h 1.102 X * extract.c 1.105 X * header.c 1.120 X * xheader.c 1.66 X XF_BAD_SIZE -> F_BAD_SIZE, XF_BAD_META -> F_BAD_META X F_BAD_UID/F_BAD_GID neu X Bei F_BAD_UID/F_BAD_GID wird TSUID bzw. TSGID nicht gesetzt um nicht Files suid nobody zu machen X XThu Oct 13 11:47:11 2005 Joerg Schilling X * starsubs.h 1.90 X * volhdr.c 1.25 X * xheader.c 1.65 X get_unumber()/get_snumber() nun mit zusaetzlichem Rangecheck X XThu Oct 13 01:00:20 2005 Joerg Schilling X * header.c 1.119 X Alle wichtigen Fehlermeldungen enthalten nun die Blocknummer X XThu Oct 13 00:17:24 2005 Joerg Schilling X * xheader.c 1.64 X Alle Fehlermeldungen und Warnungen enthalten nun eine tblocks() Ausgabe X XWed Oct 12 23:57:01 2005 Joerg Schilling X * xheader.c 1.63 X get_iaray(): Test auf inode number > INO_T_MAX neu X XTue Oct 11 01:22:43 2005 Joerg Schilling X * header.c 1.118 X Max old tar (' ' left fill statt '0') fuer info->f_gid ist MAXOCTAL6 und nicht MAXOCTAL7 X XSun Oct 9 17:28:25 2005 Joerg Schilling X * xheader.c 1.62 X Signed/unsigned Unterscheidung fuer "SUN.devmajor"/"SUN.devminor"/"SCHILY.devmajor"/"SCHILY.devminor"/"SCHILY.dev" X Kommentar fuer gen_iarray() X get_iarray() umgestellt auf unsigned inode Nummern mit astoull() und zusaetzlicher Uverflowcheck X XWed Oct 5 12:44:46 2005 Joerg Schilling X * star.c 1.268 X Version -> 1.5a68 X XWed Oct 5 11:10:23 2005 Joerg Schilling X * xheader.c 1.61 X print_range(keyword, arg, len) -> xh_rangeerr(keyword, arg, len) und GLOBAL X get_number() auskommentiert und durch get_unumber() & get_snumber() ersetzt X get_xnumber() als Basisroutine fuer get_unumber() & get_snumber() mit stark erweitertem Bereichcheck X get_uid() nimmt nun get_snumber() obwohl uid nach POSIX unsigned ist X get_gid() nimmt nun get_snumber() obwohl uid nach POSIX unsigned ist X get_size() nimmt nun get_unumber() X get_realsize() nimmt nun get_unumber() X get_offset() nimmt nun get_unumber() X get_major() nimmt nun get_snumber() weil POSIX nichts ueber dev_t aussagt X get_minor() nimmt nun get_snumber() weil POSIX nichts ueber dev_t aussagt X get_dev() nimmt nun get_snumber() weil POSIX nichts ueber dev_t aussagt X get_ino() nimmt nun get_unumber() weil POSIX ino_t als unigned definiert X get_nlink() nimmt nun get_unumber weil alle realen link counts positiv sind() X XWed Oct 5 00:42:13 2005 Joerg Schilling X * volhdr.c 1.24 X get_number() -> get_unumber() & zuzaetzliche Tests auf korrekte Darstellbarkeit der Werte X XThu Sep 15 19:41:23 2005 Joerg Schilling X * starsubs.h 1.89 X get_number() Auskommentiert -> wird vorerst nicht mehr benoetigt X print_range() -> xh_rageerr() und EXPORT X get_unumber()/getsnumber() neu X XSat Sep 10 15:53:59 2005 Joerg Schilling X * star.h 1.101 X suntar_header neu X XTue Sep 6 13:57:54 2005 Joerg Schilling X * star.c 1.267 X Version -> 1.5a67 X XTue Sep 6 13:57:26 2005 Joerg Schilling X * create.c 1.112 X Bessere Name too long Meldungen bei star list= X XSat Sep 3 01:29:34 2005 Joerg Schilling X * xattr.c 1.6 X * star_unix.c 1.80 X * star.c 1.266 X * hole.c 1.42 X * extract.c 1.104 X * diff.c 1.67 X * longnames.c 1.46 X * acl_unix.c 1.26 X * create.c 1.111 X * checkerr.h 1.8 X * dirtime.c 1.22 X * checkerr.c 1.13 X checkerr=WARN|... neu X errwarnonly() fuer checkerr=WARN neu X BOOL dchangeflag -> errconfig("WARN|GROW|SHRINK *"); X XSat Sep 3 01:25:37 2005 Joerg Schilling X * suntar.c 1.17 X -I neu, -D ist nun mot errconfig("WARN|GROW|SHRINK *") implementiert X XSat Sep 3 01:10:25 2005 Joerg Schilling X * xheader.c 1.60 X * header.c 1.117 X get_xhtype() hat xhparse() mit finfo-> mit uninitialisiertem f_name & f_lname gerufen und wenn der erste Tar Header path= oder lpath= enthielt gab es einen Coredump X XSun Aug 28 21:47:13 2005 Joerg Schilling X * checkerr.c 1.12 X ec_state = __malloc() -> ec_state = __realloc(ec_state, ...) X XSun Aug 28 19:30:31 2005 Joerg Schilling X * star.c 1.265 X Version -> 1.5a66 X XSun Aug 28 18:37:31 2005 Joerg Schilling X * checkerr.c 1.11 X * star.c 1.264 X errctl= kann nun auch direkt errror control Spezifikationen als errctl= Parameter X Es koennen nun mehrere errctl= Optionen verwendet werden. X XSun Aug 28 15:55:34 2005 Joerg Schilling X * star.c 1.263 X * create.c 1.110 X * suntar.c 1.16 X * hole.c 1.41 X Suntar -D (Data change is warning only) / star -data-change-warn neu X XSun Aug 28 14:29:35 2005 Joerg Schilling X * suntar.c 1.15 X Neue Option -e (Sun star error abort exit()) X XSun Aug 28 14:17:07 2005 Joerg Schilling X * props.c 1.48 X H_BAR neu Definitionen fuer bar(1) X XSun Aug 28 14:15:17 2005 Joerg Schilling X * star.h 1.100 X #define BAR_HDRSZ TBLOCK neu X XSun Aug 28 14:14:35 2005 Joerg Schilling X * star.c 1.262 X -e Option in -xhelp xusage() neu X XSun Aug 28 14:10:38 2005 Joerg Schilling X * hole.c 1.40 X * longnames.c 1.45 X * star_unix.c 1.79 X * star.c 1.261 X * checkerr.h 1.7 X * xattr.c 1.5 X * dirtime.c 1.21 X * diff.c 1.66 X * acl_unix.c 1.25 X * checkerr.c 1.10 X * create.c 1.109 X * extract.c 1.103 X errabort() neu X Neue errctl= identifier: ABORT, ALL, DIFF X Neue Option -e (Sun star error abort exit()) X XSun Aug 28 01:22:53 2005 Joerg Schilling X * header.c 1.116 X * xheader.c 1.59 X Cstyle X XSun Aug 21 16:08:02 2005 Joerg Schilling X * header.c 1.115 X * append.c 1.21 X * xheader.c 1.58 X * starsubs.h 1.88 X * star.h 1.99 X * volhdr.c 1.23 X FINFO f_ansec/f_cnsec/f_mnsec -> long damit negative Werte bemerkt werden koennen X Neue Funktion check_xtime() in xheader.c X print_unknown()/print_range()/print_toolong() geben nun auch die Blocknummer aus X XSun Aug 21 14:50:00 2005 Joerg Schilling X * star_unix.c 1.78 X print_badnsec() und Ueberpeuefung der nanosekunden Werte neu X XSat Aug 20 17:22:42 2005 Joerg Schilling X * buffer.c 1.129 X Das Lesen von weniger als TBLOCK size ist nicht mehr ein sofortiger Abbruchgrund X XSat Aug 20 13:41:31 2005 Joerg Schilling X * star_unix.c 1.77 X setdirmodes() konvertiert nun auch von tarmode -> osmode X setmodes() addiert nun OWNER_WRITE Rechte bei Directories damit das Extrahieren von read-only dirs klappt X XFri Aug 19 11:48:28 2005 Joerg Schilling X * starsubs.h 1.87 X * volhdr.c 1.22 X * xheader.c 1.57 X get_xtime() nun auch mit len Parameter (arglen) damit print_range() korrekt funktioniert X XThu Aug 18 13:38:31 2005 Joerg Schilling X * star.c 1.260 X Version -> 1.5a65 X XThu Aug 18 13:37:34 2005 Joerg Schilling X * restore.c 1.45 X ./star-lock neu X XSun Aug 14 18:47:37 2005 Joerg Schilling X * star_unix.c 1.76 X star -x -ctime Verhalten verbessert (geht nun auch mit used in File Times) X XWed Aug 10 18:58:01 2005 Joerg Schilling X * header.c 1.114 X Schreibfehler beseitigt der beim Auspacken von ustar Archiven minor == major machte X XTue Aug 2 01:48:08 2005 Joerg Schilling X * star.c 1.259 X Version -> 1.5a64 X XTue Aug 2 01:36:47 2005 Joerg Schilling X * header.c 1.113 X Diverse Rangechecks X Korrekte Konversion von info->f_rdevmin/info->f_rdevmin/info->f_rdev nun ueber Pointer zu echtem Ulong X XMon Aug 1 13:12:51 2005 Joerg Schilling X * diff.h 1.11 X * star.c 1.258 X xtimes diffopt neu = atime,ctime,mtime,lmtime X Wenn D_MTIME nicht gesetzt ist, dann loescht der diffopts= Parser nun auch D_LMTIME X XSat Jul 30 13:38:14 2005 Joerg Schilling X * xheader.c 1.56 X wenn info->f_uid >= 0 -> gen_unumber() X wenn info->f_gid >= 0 -> gen_unumber() X bei size/offsetwerten Check Rangecheck auf < 0 X XFri Jul 29 03:18:43 2005 Joerg Schilling X * xheader.c 1.55 X * extract.c 1.102 X * star.h 1.98 X XF_BAD_SIZE / XF_BAD_META / Ullong f_llsize neu X Behandlung von Ueberlaeufen aus POSIX.1-2001 Headern nach lokalen Daten X Versuch void_file() auch bei off_t < long long korrekt zu machen X XFri Jul 29 03:10:02 2005 Joerg Schilling X * names.c 1.15 X uid_nobody / gid_nobody -> EXPORT X XWed Jul 27 02:10:54 2005 Joerg Schilling X * table.h 1.13 X * list.c 1.60 X * names.c 1.14 X * table.c 1.22 X * acl_unix.c 1.24 X * diff.c 1.65 X Copyright -> 2005 X XWed Jul 27 02:05:52 2005 Joerg Schilling X * table.h 1.12 X * table.c 1.21 X * acl_unix.c 1.23 X * list.c 1.59 X * star.h 1.97 X * header.c 1.112 X * extract.c 1.101 X * diff.c 1.64 X * star_unix.c 1.75 X FINFO f_mode / f_type -> mode_t X XWed Jul 27 01:28:06 2005 Joerg Schilling X * list.c 1.58 X * header.c 1.111 X * star.h 1.96 X f_nlink -> nlink_t X XWed Jul 27 00:51:00 2005 Joerg Schilling X * extract.c 1.100 X * star.c 1.257 X -dir-owner/-dir-group arbeiten nun vorsichtiger und beachten die sgid Semantik X XWed Jul 27 00:37:30 2005 Joerg Schilling X * star.h 1.95 X * dirtime.c 1.20 X * create.c 1.108 X _BAD_MODE/_BAD_UID/_BAD_GID -> star.h X XWed Jul 27 00:15:30 2005 Joerg Schilling X * extract.c 1.99 X * star.c 1.256 X -xdot repariert X XTue Jul 26 15:40:51 2005 Joerg Schilling X * extract.c 1.98 X * star.c 1.255 X Neue Optionen umask= dir-owner= und dir-group= X Globale Variable uid -> my_uid X XTue Jul 26 15:16:08 2005 Joerg Schilling X * acl_unix.c 1.22 X * header.c 1.110 X * names.c 1.13 X * starsubs.h 1.86 X * star.h 1.94 X * star_unix.c 1.74 X * create.c 1.107 X nameuid()/namegid()uidname()/gidname() verwenden nun uid_t/gid_t Parameter X info->f_uid/info->f_gid nun auch uid_t/gid_t X Globale Variable uid -> my_uid X XSun Jul 24 23:32:13 2005 Joerg Schilling X * create.c 1.106 X Cstyle X XSun Jul 24 18:56:41 2005 Joerg Schilling X * create.c 1.105 X flushlinks() Prototyp neu X XSun Jul 24 18:45:15 2005 Joerg Schilling X * header.c 1.109 X Schreibfehler: %lls -> %lld korrigiert X XSun Jul 24 18:44:25 2005 Joerg Schilling X * create.c 1.104 X Support fuer hard links bei star -c -Hcrc X XSun Jul 24 18:38:54 2005 Joerg Schilling X * acltext.c 1.8 X Diverse Lint Probleme beseitigt: X id in aclfromtext() initialisieren X struct passwd ps & struct group gr in aclfromtext() bei isnumeric() so plazieren, dasz die Gueltigkeit der Daten (pointer) bis zur Nutzung reicht X LOGNAME_MAX is nur 8 und reicht nicht. Neuer #define _LOGNAME_MAX_ is 32 X sprintf() nimmt nun %lld fuer uid_t und gid_t, LOGNAME_MAX (8) reichte auch nicht aus fuer int32_t X XSun Jul 24 00:05:04 2005 Joerg Schilling X * dirtime.c 1.19 X * lhash.c 1.13 X * checkerr.c 1.9 X * fifo.c 1.58 X * props.c 1.47 X * gnutar.c 1.17 X * suntar.c 1.14 X * volhdr.c 1.21 X * star_unix.c 1.73 X * xheader.c 1.54 X * cpio.c 1.16 X * buffer.c 1.128 X * star.h 1.93 X * fifo.h 1.21 X * props.h 1.20 X Copyright -> 2005 X XSat Jul 23 23:50:07 2005 Joerg Schilling X * cpiohdr.c 1.17 X Copyright -> 2005 X Schreibfehler beseitigt X XSat Jul 23 23:21:55 2005 Joerg Schilling X * starsubs.h 1.85 X * star.c 1.254 X flushlinks() fuer hardlinks bei cpio -Hcrc Format neu X XFri Jul 22 11:38:35 2005 Joerg Schilling X * cpio.c 1.15 X cpio -i ist star -xdir X XFri Jul 22 11:34:25 2005 Joerg Schilling X * dirtime.c 1.18 X Der Dirstack funktioniert nun auch richtig wenn die Direktorynamen nicht mit '/' enden - es wird nun korrekt immer ein '/' angehaengt X XFri Jul 22 00:44:13 2005 Joerg Schilling X * star.c 1.253 X Version -> 1.5a62 X XTue Jul 19 17:51:11 2005 Joerg Schilling X * fifo.h 1.20 X Semaphore zum Absichern nur aktivieren wenn usr_fifo == TRUE X XMon Jul 18 18:59:11 2005 Joerg Schilling X * starsubs.h 1.84 X * restore.c 1.44 X * extract.c 1.97 X * create.c 1.103 X Der Einbau des Supports fuer SVR4 CPIO harlink Extrakt hatte einen imp NULL pointer fuer sym_typecheck() zur Folge, nun wird der Parameter korrekt uebergeben. X XMon Jul 18 13:50:20 2005 Joerg Schilling X * star.c 1.252 X Version -> 1.5a62 X XMon Jul 18 13:49:37 2005 Joerg Schilling X * buffer.c 1.127 X Im "tar" Modus werden nun auch nicht leere Plain Files ueberschrieben X XMon Jul 18 13:23:49 2005 Joerg Schilling X * buffer.c 1.126 X fifo_hpos() kommt nun damit klar wenn stopb < startb ist und teilt die Suche in zwei Bloecke wenn der Fifo gewickelt hat X Semaphore zum Absichern von stat->cur_size & stat->cur_off X Neyes Keywort "SCHILY.volhdr.tapesize", Archive Size Test beim Restore X XMon Jul 18 13:16:07 2005 Joerg Schilling X * header.c 1.108 X EOF Warnung und Debug Meldungen enthalten nun die Blocknummer X XMon Jul 18 13:11:20 2005 Joerg Schilling X * create.c 1.102 X * fifo.h 1.19 X Cstyle X XMon Jul 18 13:08:20 2005 Joerg Schilling X * fifo.h 1.18 X * create.c 1.101 X Semaphore zum Absichern von stat->cur_size & stat->cur_off X XMon Jul 18 13:04:38 2005 Joerg Schilling X * star.h 1.92 X Neyes Keywort "SCHILY.volhdr.tapesize" X t_typeflag & t_linkflag -> Uchar weil Arrayindex X XMon Jul 18 13:03:42 2005 Joerg Schilling X * volhdr.c 1.20 X Neyes Keywort "SCHILY.volhdr.tapesize" X Support zum Zuruecklesen von Multivolume Archiven im H_XSTAR & H_XUSTAR Format X XMon Jul 18 02:06:43 2005 Joerg Schilling X * suntar.c 1.13 X tar -x ist star -xU X XFri Jul 15 02:50:11 2005 Joerg Schilling X * restore.c 1.43 X Verhinern, dasy Null Pointer in der Inode Datenbank einen Core Dump ausloesen X XSun Jul 10 18:28:37 2005 Joerg Schilling X * create.c 1.100 X * star.c 1.251 X Version -> 1.5a61 X Neue Option pkglist= fuer SPS X XSun Jul 10 17:57:37 2005 Joerg Schilling X * starsubs.h 1.83 X ngetline() neu X XSun Jul 10 17:16:02 2005 Joerg Schilling X * gnutar.c 1.16 X * create.c 1.99 X * star.c 1.250 X * lhash.c 1.12 X * restore.c 1.42 X Neue Option -read0 X XSun Jul 10 15:36:46 2005 Joerg Schilling X * create.c 1.98 X * extract.c 1.96 X * starsubs.h 1.82 X last_cpio_link() & xcpio_link() neu X extracti() neu X Unterstuetzung fuer das Entpacken von cpio CRC Archiven mit Hard Links neu X XSun Jul 10 14:52:02 2005 Joerg Schilling X * cpiohdr.c 1.16 X Hardlinks im CRC Format werden nun erlaubt X XSat Jun 11 15:14:48 2005 Joerg Schilling X * xheader.c 1.53 X * fifo.c 1.57 X * hole.c 1.39 X Cstyle X XSat Jun 11 15:14:12 2005 Joerg Schilling X * extract.c 1.95 X extracti() neu X XWed Jun 8 01:45:58 2005 Joerg Schilling X * xheader.c 1.52 X gen_iarray() korrigiert nun p relativ zu xbuf nach realloc() (war das das Problem beim inkrementellen Restore?) X XSun May 29 15:26:32 2005 Joerg Schilling X * create.c 1.97 X find_link neu X XSat May 28 22:25:29 2005 Joerg Schilling X * props.c 1.46 X * props.h 1.19 X Neues Flag PR_SV_CPIO_LINKS fuer SVr4 asc & crc cpio Format X XSat May 28 15:42:33 2005 Joerg Schilling X * hole.c 1.38 X lseek() beim "archivieren" mit -nullout vermeiden X XTue May 24 00:50:20 2005 Joerg Schilling X * hole.c 1.37 X put_sparse_func() optimiert nun die I/O Groesse und liest mehr als 512 Byte auf einmal X XSun May 22 23:04:22 2005 Joerg Schilling X * star.c 1.249 X Version -> 1.5a60 X XSun May 22 23:03:56 2005 Joerg Schilling X * hole.c 1.36 X Coredump beim Auspacken von mehr als 10016 Loechern verhindern X XSun May 22 17:49:36 2005 Joerg Schilling X * header.c 1.107 X XF_SIZE / XF_REALSIZE Behandlung korrigiert damit sparse Files > 8 GB bei POSIX.1-2001 funktionieren X XSun May 22 17:45:36 2005 Joerg Schilling X * xheader.c 1.51 X SCHILY.realsize Beschreibung konkretisiert X XSun May 22 15:21:50 2005 Joerg Schilling X * hole.c 1.35 X * create.c 1.96 X * starsubs.h 1.81 X Umbau fuer SEEK_HOLE X XTue May 10 00:56:17 2005 Joerg Schilling X * star.c 1.248 X Version -> 1.5a59 X XTue May 10 00:52:43 2005 Joerg Schilling X * star_unix.c 1.72 X * create.c 1.95 X get_acls(info) Aufruf von star_unix.c -> create.c fuer bessere Performance X XTue May 10 00:42:09 2005 Joerg Schilling X * xheader.c 1.50 X Zusaetzlicher Test auf ein Newline am Ende einer Xheader Zeile und Syntaxfehlermeldung X XTue May 10 00:38:10 2005 Joerg Schilling X * restore.c 1.41 X Neuer Debug Code X XTue May 10 00:31:54 2005 Joerg Schilling X * fflags.c 1.12 X * star_unix.c 1.71 X Workaround gehen defektes Linux durch Test auf defined(HAVE_BROKEN_EXT2_FS_H) && defined(HAVE_BROKEN_LINUX_EXT2_FS_H) X XFri Mar 25 14:27:38 2005 Joerg Schilling X * star.c 1.247 X Bessere Onlinehilfe fuer -copyhardlinks & -copysymlinks X XFri Mar 25 14:26:11 2005 Joerg Schilling X * xheader.c 1.49 X write_xhdr() setzt nun finfo.f_name damit errhidden() einen fname Parameter bekommt X XFri Mar 25 14:22:43 2005 Joerg Schilling X * checkerr.c 1.8 X errhidden() ist nun immun gegen fname == NULL X XThu Feb 17 00:18:35 2005 Joerg Schilling X * star.c 1.246 X Version -> 1.5a58 X XWed Feb 16 23:23:08 2005 Joerg Schilling X * header.c 1.106 X Cstyle X Copyright -> 2005 X XWed Feb 16 15:33:30 2005 Joerg Schilling X * fflags.c 1.11 X Gruenbacher war falsch: EXT3_JOURNAL_DATA_FL ist richtig und nicht EXT2_JOURNAL_DATA_FL X XWed Feb 16 14:46:35 2005 Joerg Schilling X * acltext.c 1.7 X Nicht fuer IS_CYGWIN kompilieren X XWed Feb 16 14:31:08 2005 Joerg Schilling X * fflags.c 1.10 X Copyright -> 2005 X XWed Feb 16 13:57:45 2005 Joerg Schilling X * fflags.c 1.9 X Support fuer Linux EXT2_JOURNAL_DATA_FL neu X XSat Feb 12 12:56:25 2005 Joerg Schilling X * acltext.c 1.6 X Kein getpwuid(uid)/getgrgid(gid) mehr bei numerischen IDs in aclfromtext() X XFri Feb 11 10:44:57 2005 Joerg Schilling X * acltext.c 1.5 X User/Group 123 wird nun auch dann korrekt behandelt wenn getpwuid()/getgrgid() nichts finden X XThu Feb 10 00:46:15 2005 Joerg Schilling X * star.c 1.245 X Version -> 1.5a57 X XThu Feb 10 00:36:00 2005 Joerg Schilling X * acltext.c 1.4 X LICENSING.NOTICE -> CDDL.Sun.txt X XWed Feb 9 07:05:29 2005 Joerg Schilling X * acltext.c 1.3 X Numerische uid/gid Felder werden bei aclfromtext() akzeptiert X XWed Feb 9 06:58:51 2005 Joerg Schilling X * acltext.c 1.2 X #include / #ifdef HAVE_SUN_ACL neu X XWed Feb 9 06:51:06 2005 Joerg Schilling X * acltext.c 1.1 X date and time created 05/02/09 06:51:06 by joerg X XTue Feb 8 00:42:30 2005 Joerg Schilling X * create.c 1.94 X Verhalten von -match-tree repariert (wirkte auch ohne pattern match) X XMon Feb 7 23:53:01 2005 Joerg Schilling X * star_sym.c 1.1 X date and time created 05/02/07 23:53:01 by joerg X XMon Feb 7 22:57:37 2005 Joerg Schilling X * star.c 1.244 X Copyright -> 2005 X Check auf Archiv Format bei star -c -acl und Abbruch wenn XF_ACL_ACCESS nicht gesetzt X XMon Feb 7 22:53:46 2005 Joerg Schilling X * dumpdate.c 1.11 X * dumpdate.h 1.8 X * restore.c 1.40 X * extract.c 1.94 X * starsubs.h 1.80 X -> 2005 X XMon Feb 7 22:36:21 2005 Joerg Schilling X * extract.c 1.93 X * starsubs.h 1.79 X * restore.c 1.39 X sym_open() mit neuem char *name Parameter fuer neues star_sym Programm X XSun Jan 30 16:40:24 2005 Joerg Schilling X * restore.c 1.38 X Text bei restore_valid == FALSE verbessert X XSun Jan 30 16:28:01 2005 Joerg Schilling X * star.c 1.243 X Version -> 1.5a56 X XSun Jan 30 16:25:07 2005 Joerg Schilling X * restore.c 1.37 X LOCAL BOOL restore_valid neu damit ein absolut leerer Dump beim Restore nicht das File star-symtable ueberschreibt X XSun Jan 30 15:40:41 2005 Joerg Schilling X * dumpdate.c 1.10 X Fix fuer ein Problem mit level 0, 1, 2, 0, 2 wobei der 2. level 2 Backup gegen level 1 statt level 0 ist X XSun Jan 16 22:41:20 2005 Joerg Schilling X * restore.c 1.36 X sym_dump() neu und mehr Stellen geben die Datenbank nach "star-symdump" aus X Support fuer -dump-cumulative / -cumulative neu X Debugging Funktionen printoneLsym()/printLsyms() neu X XSun Jan 16 15:24:46 2005 Joerg Schilling X * star.c 1.242 X Version -> 1.5a55 X Neue Option -dump-cumulative / -cumulative X XSun Jan 16 14:35:20 2005 Joerg Schilling X * dumpdate.c 1.9 X * dumpdate.h 1.7 X Erweiterung um DD_CUMULATIVE damit star -cumulative moeglich wird X XMon Nov 29 12:40:43 2004 Joerg Schilling X * restore.c 1.35 X bessere EOF Behandlung fuer ngetline() in xgetline() X XFri Nov 5 10:59:45 2004 Joerg Schilling X * restore.c 1.34 X Bessere Meldung wenn gleicher Dump Level wieder zurueckgespielt werden soll X XMon Nov 1 14:46:51 2004 Joerg Schilling X * star.c 1.241 X Version -> 1.5a54 X GCC warnung wegen nicht initialisierter Variable beseitigt X XMon Nov 1 14:46:09 2004 Joerg Schilling X * restore.c 1.33 X Alle Files in star-tmpdir loeschen wenn env STAR_DEBUG nicht vorhanden X XMon Nov 1 12:59:12 2004 Joerg Schilling X * remove.c 1.48 X Copyright -> 2004 X Besserer Kommentar X XMon Nov 1 12:19:10 2004 Joerg Schilling X * restore.c 1.32 X slashp in sym_dirprepare() war nicht initialisiert X XSun Oct 31 22:00:41 2004 Joerg Schilling X * diff.h 1.10 X * star.c 1.240 X * diff.c 1.63 X diffopts=lmtime neu X XFri Oct 29 22:01:15 2004 Joerg Schilling X * star.c 1.239 X Version -> 1.5a53 X XFri Oct 29 21:58:09 2004 Joerg Schilling X * restore.c 1.31 X sym_dirpremare() muss den '/' am Ende des Pfades beseitigen bevor _getinfo() gerufen wird, damit bei nicht Dirs nicht ENOTDIR kommt X XFri Oct 29 13:26:38 2004 Joerg Schilling X * extract.c 1.92 X MKD_DEBUG neu X same_file() mit neuem what Paramether (IS_COPY/IS_LINK) damit bei IS_LINK kein Fehler mehr generiert wird wenn ein Hardlink bereits existiert X XFri Oct 29 13:23:51 2004 Joerg Schilling X * remove.c 1.47 X RM_DEBUG neu X XWed Oct 27 18:32:24 2004 Joerg Schilling X * tartest.c 1.10 X * header.c 1.105 X /* LINTED */ wegen name[100] Zugriffen X XWed Oct 27 17:33:14 2004 Joerg Schilling X * star.c 1.238 X Neue Optionen dumpdate=name & fs-name=name fuer Filesystem Snapshots X XWed Oct 27 17:02:35 2004 Joerg Schilling X * volhdr.c 1.19 X * star.h 1.91 X GF_CWD neu fuer "SCHILY.volhdr.cwd" X XTue Oct 19 10:12:57 2004 Joerg Schilling X * star.c 1.237 X Version -> 1.5a52 X XTue Oct 19 01:28:17 2004 Joerg Schilling X * restore.c 1.30 X Besserer Kommentar fuer das stat("/etc/passwd/", ) / ENOTDIR Problem mit POSIX.1-1988/POSIX.1-2001 X XTue Oct 19 01:22:05 2004 Joerg Schilling X * restore.c 1.29 X make_adir() neu X sym_dirprepare()/sym_typecheck() koennen nun imp * veraendern X Bessere Debug Meldungen X padd_node() setzt nun die flags (z.B. I_DIR) wenn es ein alter tmp node war X sym_addrec() fuegt nun nicht mehr den dir Inhalt dazu wenn ein alter nich t DIR node existitert X sym_dirprepare() kann nun ein Disk File loeschen und eine Dir erzeugen und imp * veraendern X "star-symdump" Wird bei Panic: amnesia geschrieben X sym_typecheck() beachted nun I_DELETE in der move2tmp() Schleife X sym_typecheck() ruft nun purgeent() bei geloeschten nodes X XTue Oct 19 00:17:26 2004 Joerg Schilling X * extract.c 1.91 X * starsubs.h 1.78 X make_adir() neu X sym_dirprepare()/sym_typecheck() koennen nun imp * veraendern X XMon Oct 18 23:40:16 2004 Joerg Schilling X * diff.c 1.62 X do_void mit FALSE initialisieren damit GCC nicht warnt X XMon Oct 18 23:37:34 2004 Joerg Schilling X * header.c 1.104 X xhsize -> xhsiz wegen globaler Funktioon xhsize() X XSun Oct 17 18:55:19 2004 Joerg Schilling X * star.c 1.236 X * list.c 1.57 X Neue Option -prinodes X XThu Oct 14 01:51:08 2004 Joerg Schilling X * restore.c 1.28 X Unter Linux bringt stat("/etc/passwd/", ) ENOTDIR X XThu Oct 14 00:25:51 2004 Joerg Schilling X * diff.c 1.61 X ERweiterung der diff Tests fuer DATA wenn ein Hardlink vorliegt wird damit nicht faelschlich Datenunterschied gemeldet wird X XThu Oct 14 00:23:14 2004 Joerg Schilling X * restore.c 1.27 X Erweiterte Debugs fuer sym_typecheck() X XThu Oct 14 00:20:26 2004 Joerg Schilling X * header.c 1.103 X get_xhtype() darf nicht aus get_hdrtype() gerufen werden damit der Kompressionstest nicht einen Aufruf von get_xhtype() bewirkt X XWed Oct 13 16:00:10 2004 Joerg Schilling X * star.h 1.90 X H_TARMIN/H_TARMAX neu X XSun Oct 10 18:04:26 2004 Joerg Schilling X * restore.c 1.26 X Bessere restore dump level/date Tests X Es ist nun erlaubt nacheinander alle dumps des selben levels einzuspielen X XSun Oct 10 17:36:37 2004 Joerg Schilling X * star.c 1.235 X Version -> 1.5a51 X XSun Oct 10 16:36:04 2004 Joerg Schilling X * restore.c 1.25 X Erweiterungen um Dumps gegen den aktuellen Restore Status zu vergleichen X XSun Oct 10 14:46:29 2004 Joerg Schilling X * star.c 1.234 X * extract.c 1.90 X * fifo.c 1.56 X * hole.c 1.34 X Cstyle X XSun Oct 10 02:56:17 2004 Joerg Schilling X * star.h 1.89 X DT_FULL ist nun die hoechste Nummer und kleinere Zahlen bedeuten weniger Wert X XSun Oct 10 01:15:43 2004 Joerg Schilling X * dumpdate.h 1.6 X * dumpdate.c 1.8 X getdumptime() neu X XSun Oct 10 01:04:35 2004 Joerg Schilling X * volhdr.c 1.18 X grip->dumpdate.tv_usec / grip->refdate.tv_usec nun korrekt auf usec statt auf nsec initialisieren X XSun Oct 10 00:27:03 2004 Joerg Schilling X * starsubs.h 1.77 X * volhdr.c 1.17 X dt_type() neu X XSat Oct 9 15:06:00 2004 Joerg Schilling X * star.c 1.233 X -force-restore vor f= in opts X XSat Oct 9 15:05:11 2004 Joerg Schilling X * acl_unix.c 1.21 X * star_unix.c 1.70 X HAVE_ST_ACLCNT neu X Support Code fuer die Verwendung von axltext.c unter UnixWare X XSat Oct 9 14:42:57 2004 Joerg Schilling X * names.c 1.12 X #ifdef STAR -> #ifdef __STAR__ wegen patmatch.h X XThu Oct 7 16:54:25 2004 Joerg Schilling X * names.c 1.11 X Copyright -> 2004 X #ifdef STAR neu X XWed Oct 6 17:22:41 2004 Joerg Schilling X * star.h 1.88 X HAVE_ST_ACLCNT / f_aclcnt neu X XWed Oct 6 16:50:56 2004 Joerg Schilling X * fflags.c 1.8 X * star_unix.c 1.69 X Test auf HAVE_EXT2FS_EXT2_FS_H neu X XTue Oct 5 15:03:05 2004 Joerg Schilling X * star.c 1.232 X Version -> 1.5a50 X /etc/tardumps nicht mehr schreiben wenn ein ^C kam X Bessere Erkenning von partiellen Dumps X Neue Option -force-restore X /etc/tardumps auch schreiben wenn der Dump nur partial ist aber mit 'P' Flag X XTue Oct 5 14:59:05 2004 Joerg Schilling X * header.c 1.102 X get_xhtype() neu fuer Archiv Typ Erkennung aus "SCHILY.archtype=" X XTue Oct 5 14:57:03 2004 Joerg Schilling X * volhdr.c 1.16 X Bei H_XUSTAR wird nun (vorlaeufig) kein 'x'/'g' Header mehr per default erzeugt fuer bessere TAR Kompatibilitaet X XTue Oct 5 03:50:56 2004 Joerg Schilling X * dumpdate.c 1.7 X * dumpdate.h 1.5 X Support fuer Partielle Dumps neu X Korrektes Einruecken in /etc/tardumps auch wenn der Filename auf einem Tabstop Endet X XTue Oct 5 03:42:47 2004 Joerg Schilling X * restore.c 1.24 X Test auf (gp->dumptype != DT_FULL) neu und Abort wenn -force-restore nicht verwendet wurde X XMon Oct 4 22:22:52 2004 Joerg Schilling X * star.c 1.231 X 'scipt' -> 'script' X XMon Oct 4 18:32:13 2004 Joerg Schilling X * cpio.c 1.14 X -M usage() korrekt (nun -M mesage) X XMon Oct 4 16:11:09 2004 Joerg Schilling X * star.c 1.230 X Umbau fuer star_fat X XMon Oct 4 16:05:34 2004 Joerg Schilling X * suntar.c 1.12 X * cpio.c 1.13 X * pax.c 1.19 X * gnutar.c 1.15 X #define PTYPE_DEFAULT neu X Bessere Behandlung von DFLT_FILE fuer star vs. suntar X XMon Oct 4 15:06:11 2004 Joerg Schilling X * star.h 1.87 X Neue Programm Typen: P_STAR P_SUNTAR P_GNUTA P_PAX P_CPIO X XMon Oct 4 15:05:01 2004 Joerg Schilling X * gnutar.c 1.14 X * cpio.c 1.12 X * pax.c 1.18 X * suntar.c 1.11 X star_fat wird nun unterstuetzt X XThu Sep 30 23:29:39 2004 Joerg Schilling X * star.c 1.229 X Version -> 1.5a49 X Warnung fuer star -c list=ccc files X XWed Sep 29 23:42:07 2004 Joerg Schilling X * restore.c 1.23 X Test auf (itmp != NULL) in sym_close() gegen core dump bei leerem Tar Archiv level 1 X XTue Sep 28 01:51:19 2004 Joerg Schilling X * tartest.c 1.9 X Prototyp fuer usage() X XMon Sep 27 20:42:19 2004 Joerg Schilling X * star.c 1.228 X ptrdiff_t -> Intptr_t wegen besserer Portabilitaet X XSun Sep 26 16:48:11 2004 Joerg Schilling X * cpio.c 1.11 X Default Archiv Format von H_CPIO_BIN -> H_CPIO_ODC X XSun Sep 26 15:10:20 2004 Joerg Schilling X * star.c 1.227 X Optionsbehandlung fuer -C korrigiert (getdir() returniert bei (iftype == I_CPIO || iftype == I_PAX)) X XSun Sep 26 15:09:10 2004 Joerg Schilling X * pax.c 1.17 X Optionsbehandlung fuer -C korrigiert ("C*,... beseitigt) X artype= Option neu X XSun Sep 26 15:05:55 2004 Joerg Schilling X * cpio.c 1.10 X Optionsbehandlung fuer -C korrigiert ("C*,... beseitigt) X nblocks = 1 als korrekter Default fuer cpio X Blocksize optionen besser pruefen X bei -p wird nblocks dennoch 20 X artype= Option neu X XSun Sep 26 14:47:54 2004 Joerg Schilling X * props.c 1.45 X Ausgabe des Headertype Namens neu X XSun Sep 26 13:55:40 2004 Joerg Schilling X * buffer.c 1.125 X * fifo.c 1.55 X Umbau von buf_sync()/fifo_sync() so dass keine Daten angefuegt werden wenn der Puffer bereits ein vielfaches der gewuenschten Groesse ist X XSat Sep 25 19:06:02 2004 Joerg Schilling X * extract.c 1.89 X goto modes korrigiert X XSat Sep 25 17:01:51 2004 Joerg Schilling X * diff.c 1.60 X mit diffopts=!size wird nun auch "data" Diff Berichtet wenn info->f_size != finfo.f_size X XSat Sep 25 16:24:44 2004 Joerg Schilling X * xheader.c 1.48 X * restore.c 1.22 X * star.c 1.226 X * gnutar.c 1.13 X * cpio.c 1.9 X * pax.c 1.16 X * suntar.c 1.10 X * create.c 1.93 X * checkerr.c 1.7 X * device.c 1.11 X lint X XSat Sep 25 15:14:49 2004 Joerg Schilling X * xattr.c 1.4 X set_xattr() nur dann durchfuehren wenn (info->f_xflags & XF_XATTR) != 0 X XSat Sep 25 13:53:31 2004 Joerg Schilling X * header.c 1.101 X btos() nur kompilieren wenn DEV_MINOR_BITS > 21 (wegen lint) X XTue Sep 7 16:49:17 2004 Joerg Schilling X * star.c 1.225 X Version -> 1.5a47 X -restore verlangt nun -U X XTue Sep 7 16:44:35 2004 Joerg Schilling X * extract.c 1.88 X XXX Kommentar als Hinweis fuer Probleme mit make_symlink(info) X XTue Sep 7 16:36:24 2004 Joerg Schilling X * restore.c 1.21 X Auskommentierter Kode geloescht X XTue Sep 7 16:35:21 2004 Joerg Schilling X * restore.c 1.20 X sym_typecheck() ueberarbeitet, so dasz Symlinks und Specials geloescht werden X removefile() neu X XTue Sep 7 15:31:32 2004 Joerg Schilling X * restore.c 1.19 X padd_node() fuegt nun evt. oino und nino hash auch fuer alte nodes hinzu X oifind_node() liefert nur noch nodes bei denen i_nino != 0 ist X sym_addstat() aendert nun korrekt die Eintragung in dir Hashliste fuer i_nino X move2dir() kann nun auch Files aus dem gesamten Filesystem finden und nicht nur aus star-tmpdir X sym_open() testet nun ob star-symtable ein File ist X sym_close() loescht nun files mit Linkcount 1 sowie leere Directories aus star-tmpdir X Neue funktion fullname() X XMon Sep 6 22:27:33 2004 Joerg Schilling X * restore.c 1.18 X * table.c 1.20 X Cstyle X XMon Sep 6 22:25:30 2004 Joerg Schilling X * restore.c 1.17 X purgeent() neu X printsyms() umgestellt X XMon Sep 6 22:20:11 2004 Joerg Schilling X * restore.c 1.16 X Test ob star-tmpdir leer ist X XMon Sep 6 21:38:00 2004 Joerg Schilling X * restore.c 1.15 X Strings "star-tmpdir" & "star-symtable" nun in modul globalen Variablen X XMon Sep 6 20:13:36 2004 Joerg Schilling X * restore.c 1.14 X Umstellung von star-tmpdir/ auf star-tmpdir/# X oifind_node() neu X Alte Inode Nummer in der Datenbank auch fuer die Root Directory X "Panic: No old inode for inode %lld (%s).\n" fuer star-tmpdir und star-symtable unterdruecken X move2tmp() loescht nun Files wenn der Node schon eine Kopie in star-tmpdir hat X "Cannot open 'star-symtable'.\n" Meldung nicht mehr bringen weil das spaeter auch kommt X imap_t *isym neu X sym_inittmpdir() -> sym_initsym() X "star-symtable" escheint nun auch in der "star-symtable" X "WARNING: No old inode number for " Warnung neu X XMon Sep 6 20:01:17 2004 Joerg Schilling X * restore.h 1.3 X imap_t *i_honext neu X XMon Sep 6 20:00:48 2004 Joerg Schilling X * extract.c 1.87 X Modes & Zeiten auch setzen wenn Extraktion wegen -xdir oder -xdot erfolgt X XMon Sep 6 14:21:25 2004 Joerg Schilling X * restore.c 1.13 X Umbau auf xdebug X XMon Sep 6 13:49:40 2004 Joerg Schilling X * restore.c 1.12 X Vermeidung von goto X XMon Sep 6 13:17:29 2004 Joerg Schilling X * header.c 1.100 X Fehlermeldungen gekuerzt so dass sie auf 80 Zeichen passen X XMon Sep 6 13:06:49 2004 Joerg Schilling X * restore.c 1.11 X sym_preremove() -> sym_dirprepare() X Erste halbwegs nutzbare inkrementelle Restore Implementierung X XSun Sep 5 23:27:44 2004 Joerg Schilling X * match.c 1.6 X Cstyle X XSun Sep 5 23:26:38 2004 Joerg Schilling X * suntar.c 1.9 X * pax.c 1.15 X * cpio.c 1.8 X * gnutar.c 1.12 X /* BEGIN CSTYLED */ neu X XSun Sep 5 23:19:19 2004 Joerg Schilling X * restore.h 1.2 X #define I_DID_RENAME neu X XSun Sep 5 23:12:49 2004 Joerg Schilling X * starsubs.h 1.76 X sym_typecheck() neu X XSun Sep 5 23:12:07 2004 Joerg Schilling X * extract.c 1.86 X sym_*() Funktionen aus restore.c nun mit imap_t *imp Parameter X sym_typecheck(&finfo, &cinfo) neu falls ein neues File mit identischer inode # und Namen einen inkompatiblen Typ hat X XSun Sep 5 14:15:18 2004 Joerg Schilling X * create.c 1.92 X } while ((blocks -= n) >= 0 && i == amount && size >= 0); ---> } while ((blocks -= n) >= 0 && i > 0 && size >= 0); damit nicht Lesefehler zu "file changed size (shriked)" werden X XSun Sep 5 13:45:53 2004 Joerg Schilling X * starsubs.h 1.75 X Funktionen von restore.c nun mit imap_t * Parameter X sym_preremove() -> sym_dirprepare() X XWed Sep 1 18:02:57 2004 Joerg Schilling X * restore.c 1.10 X oifind_node() & find_node() beseitigt X XWed Sep 1 18:01:08 2004 Joerg Schilling X * restore.c 1.9 X Umbau auf restore.h X Umbau auf neue baunfoermige Variante der Datei star-symtable X if (imp->i_hash & I_DELETE) -> if (imp->i_flags & I_DELETE) (Bug beseitigt) X nfind_node() & add_node() arbeiten nun relativ zu dir Pointer X pfind_node(name) & padd_node(name, oino, nino, flags) neu X XWed Sep 1 17:49:54 2004 Joerg Schilling X * restore.h 1.1 X date and time created 04/09/01 16:49:54 by joerg X XSun Aug 29 19:45:55 2004 Joerg Schilling X * restore.c 1.8 X "star-tmpdir/." -> modifizierbaren Speicher X diverse andere Aenderungen.... X XWed Aug 18 04:33:21 2004 Joerg Schilling X * restore.c 1.7 X /star-tmpdir erzeugen X Hash Liste mit 1024 Eintraegen gibt 1000x Geschwindigkeit X sym_init() neu X /star-symtable mit 0600 erzeugen X XWed Aug 18 04:02:55 2004 Joerg Schilling X * star.c 1.224 X Version -> 1.5a45 X -xdev als Alias fuer -M neu X bei -restore wird -xdot impliziert X checkdumptype() neu X XWed Aug 18 03:59:30 2004 Joerg Schilling X * volhdr.c 1.15 X dt_name() nun GLOBAL X XWed Aug 18 03:58:41 2004 Joerg Schilling X * starsubs.h 1.74 X sym_init() neu, create_dirs() & dt_name() nun GLOBAL X XWed Aug 18 03:57:55 2004 Joerg Schilling X * extract.c 1.85 X umask() frueher initialisieren damit restore spezial Files mit behandelt werden X curfs initialisieren X sym_init(grip); neu X XWed Aug 18 03:56:34 2004 Joerg Schilling X * dumpdate.c 1.6 X * dumpdate.h 1.4 X writedumpdates() hat nun mehr Parameter und schreibt eine Meldung ob /etc/tardumps gechrieben wurde X XMon Aug 16 11:51:50 2004 Joerg Schilling X * restore.c 1.6 X dirdiskonly() aktiviert X XSun Aug 15 01:42:26 2004 Joerg Schilling X * restore.c 1.5 X Allozieren der Hash map -> sym_open() X XSat Aug 14 22:09:33 2004 Joerg Schilling X * restore.c 1.4 X Hash Tabelle fuer Filenamen mach Suchen 1000x schneller X XSat Aug 14 18:41:02 2004 Joerg Schilling X * restore.c 1.3 X vashval() neu X XTue Aug 10 02:13:28 2004 Joerg Schilling X * dumpdate.c 1.5 X Umbau auf astollb() damit die Zeit 12345.0189 korrekt gepars werden kann X XTue Jul 27 22:47:57 2004 Joerg Schilling X * match.c 1.5 X in closepattern() Platz fuer das State Array immer dann schaffen wenn (maxplen > 0) und nicht nur wenn (npat > 0) X XWed Jul 21 00:49:57 2004 Joerg Schilling X * star.c 1.223 X Copyright -> 2004 X XTue Jul 20 23:07:39 2004 Joerg Schilling X * extract.c 1.84 X Das Extrahieren von Hardlinks auf Directories geht nun X XTue Jul 20 22:31:26 2004 Joerg Schilling X * star.c 1.222 X * create.c 1.91 X Version -> 1.5a43 X Neue Option -dumpmeta, ohne -dumpmeta werden nun bei incrementellen Dumps Fileinhalte auch dann archiviert wenn nur st_ctime neu ist X XTue Jul 20 21:30:48 2004 Joerg Schilling X * create.c 1.90 X Struct pdirs neu damit (hardlink) Directory Loops erkannt werden X XTue Jul 20 21:04:05 2004 Joerg Schilling X * create.c 1.89 X put_dir() umgebaut damit unlesbare Directories mit archiviert werden koennen X XSun Jul 11 02:05:19 2004 Joerg Schilling X * tartest.c 1.8 X * buffer.c 1.124 X -> NEED_O_BINARY X XSat Jul 10 15:39:52 2004 Joerg Schilling X * extract.c 1.83 X Mehrfache Schleifen damit symlinks auf symlinks mit -copy-links funktionieren X XSat Jul 10 15:36:21 2004 Joerg Schilling X * star.c 1.221 X Version -> 1.5a42 X XSat Jul 10 13:37:15 2004 Joerg Schilling X * fifo.c 1.54 X closetape() Aufruf neu X XThu Jul 8 10:50:54 2004 Joerg Schilling X * star.c 1.220 X * create.c 1.88 X Neue Option -match-tree X XThu Jun 17 21:14:14 2004 Joerg Schilling X * gnutar.c 1.11 X * suntar.c 1.8 X * star.c 1.219 X char archive = -1 -> signed char weil 'char' unter IRIX per Default unsigned ist X XFri Jun 11 18:58:50 2004 Joerg Schilling X * buffer.c 1.123 X Schreibfehler close(tcompress_arf_save) -> fclose(compress_tarf_save X XFri Jun 11 11:50:41 2004 Joerg Schilling X * star.c 1.218 X Version -> 1.5a41 X XFri Jun 11 11:46:47 2004 Joerg Schilling X * star.c 1.217 X * extract.c 1.82 X -DCOPY_LINKS_DELAYED neu X -copyhardlinks/-copysymlinks/-copydlinks neu X XSat Jun 5 18:19:18 2004 Joerg Schilling X * buffer.c 1.122 X star -z funktioniert nun auch mit -c & DOS X XSat Jun 5 02:02:20 2004 Joerg Schilling X * props.c 1.44 X v7tar neu X XSat Jun 5 01:36:54 2004 Joerg Schilling X * table.c 1.19 X * table.h 1.11 X xtv7tar_tab[] neu X XSat Jun 5 01:33:47 2004 Joerg Schilling X * tartest.c 1.7 X setmode(fileno(stdin), O_BINARY); X XSat Jun 5 01:33:05 2004 Joerg Schilling X * star.h 1.86 X "v7tar" neu X XSat Jun 5 01:32:46 2004 Joerg Schilling X * header.c 1.99 X hdr_text() neu X "v7tar" neu X XSat Jun 5 01:32:17 2004 Joerg Schilling X * starsubs.h 1.73 X hdr_text() neu X XMon Apr 26 02:15:52 2004 Joerg Schilling X * star.c 1.216 X Version -> 1.5a40 X XMon Apr 26 02:14:05 2004 Joerg Schilling X * star_unix.c 1.68 X setmodes() vermeidet nun times/modes bei Hard Links zu setzen wenn sie auf Symlinks zeigen X XThu Apr 22 13:56:23 2004 Joerg Schilling X * star_unix.c 1.67 X #ifndef NEW_P_FLAG Code beseitigt X Copyright -> 2004 X XWed Mar 10 23:52:02 2004 Joerg Schilling X * star.c 1.215 X set_signal() nun mit __PR() Makro beim handler Parameter X XWed Mar 10 23:36:58 2004 Joerg Schilling X * star.c 1.214 X Neue Funktion set_signal() damit statt signal() auch sigsction()/sigvec() gerufen werden koennen X um Signale nicht read()/write() unterbrechen zu lassen. X XWed Mar 10 22:43:55 2004 Joerg Schilling X * fifo.c 1.53 X FIFO move Text in FIFO Statisktik verbessert X Neue Fifo Statistik fuer FIFO Fuellstand X XMon Mar 8 12:29:53 2004 Joerg Schilling X * extract.c 1.81 X Fehlerhafte Reihenfolge bein Verodern der Zugriffsrechte und der File Type Bits korrigiert X XSun Mar 7 14:04:29 2004 Joerg Schilling X * dirtime.c 1.17 X sdirmode mit #ifdef PROTOTYPES wegen short mode_t X XSun Mar 7 00:33:48 2004 Joerg Schilling X * gnutar.c 1.10 X * suntar.c 1.7 X * star.c 1.213 X * cpio.c 1.7 X * pax.c 1.14 X Version -> 1.5a39 X Neue Option -no-p (nopflag) X cpio/gnutar/pax/suntar angepasst X XSat Mar 6 22:48:45 2004 Joerg Schilling X * star_unix.c 1.66 X (info->f_mode & 07000) -> (info->f_mode & (TSUID | TSGID | TSVTX)) X XSat Mar 6 22:44:47 2004 Joerg Schilling X * extract.c 1.80 X init_umask() neu fuer neues -p Handling X Viele Aenderungen fuer neues -p Handling X XSat Mar 6 22:42:24 2004 Joerg Schilling X * dirtime.c 1.16 X #define DEBUG wieder beseitigt X XSat Mar 6 22:41:47 2004 Joerg Schilling X * star_unix.c 1.65 X Umbau fuer #define NEW_P_FLAG X Neue Funktion setdirmodes(name, mode) X Neues Makro OSMODE(tarmode) X Neue Funktion osmode(tarmode) X XSat Mar 6 22:36:13 2004 Joerg Schilling X * dirtime.c 1.15 X Stack fuer file permissions neu X sdirtimes() mit zusaetzlichem Parametern do_times und do_mode X Bessere Erkennung und Markierung ungenuzter Eintraege mit tv_usec = -1 X sdirmode(name, mode) neu X dirtimes() mit zusaetzlichem Parameter mode X Fehlerkorrektur bei Namensvergleich: auch aufhoeren wenn *np == 0 X XSat Mar 6 17:11:26 2004 Joerg Schilling X * starsubs.h 1.72 X * dirtime.h 1.3 X dirtime Prototypen sind nun nur noch in dirtime.h X dirtime Prototypen erweitert um dir mode stack Features X XFri Mar 5 23:58:52 2004 Joerg Schilling X * acl_unix.c 1.20 X * star.c 1.212 X uid -> uid_t X XTue Mar 2 18:49:16 2004 Joerg Schilling X * buffer.c 1.121 X nicht nur star uf sondern auch star rf erlaubt nun nicht leere Files als Archiv X XTue Mar 2 16:21:47 2004 Joerg Schilling X * dirtime.c 1.14 X Copyright -> 2004 X struct timeval badtime neu, ungueltige Zeit ist nun tv_usec == -1 X verbesserter Kommentar X XMon Mar 1 23:23:55 2004 Joerg Schilling X * tartest.c 1.6 X * unicode.c 1.6 X * restore.c 1.2 X * header.c 1.98 X * diff.c 1.59 X * star.h 1.85 X * fifo.h 1.17 X Cstyle X XMon Mar 1 23:16:07 2004 Joerg Schilling X * volhdr.c 1.14 X * star.c 1.211 X * extract.c 1.79 X Cstyle X Copyright -> 2004 X XMon Mar 1 23:14:44 2004 Joerg Schilling X * xheader.c 1.47 X * subst.c 1.7 X Copyright -> 2004 X XMon Mar 1 14:53:06 2004 Joerg Schilling X * star.c 1.210 X Version -> 1.5a38 X XSun Feb 29 01:27:52 2004 Joerg Schilling X * buffer.c 1.120 X eofptr bei star -u nur verwenden wenn != NULL sonst core dump bei leerem Archiv File X "Will not overwrite... Meldung nur noch bei star cf file und nicht mehr bei star uf file X XFri Feb 27 21:04:50 2004 Joerg Schilling X * diff.c 1.58 X Schreibfehler beseitigt der trotz -acl _getinfo() rief X XFri Feb 27 11:38:18 2004 Joerg Schilling X * star.c 1.209 X * diff.c 1.57 X * diff.h 1.9 X Version -> 1.5a37 X -diff Support fuer ACLs, Extended File Attributes & Extended File Flags neu X XFri Feb 27 11:36:45 2004 Joerg Schilling X * xattr.c 1.3 X Verbesserter Code damit nicht '@' fuer jedes File angezeigt wird X XTue Feb 10 01:31:18 2004 Joerg Schilling X * star.c 1.208 X Version -> 1.5a36 X XMon Dec 15 08:32:36 2003 Joerg Schilling X * buffer.c 1.119 X star -cz ... geht definitiv nicht auf DOS weil popen() Programm zuerst laeuft X XSun Nov 30 13:11:15 2003 Joerg Schilling X * buffer.c 1.118 X Erster Versuch Compress Pipes auch auf DOS/DJGPP zu implementieren X XSun Nov 30 00:01:12 2003 Joerg Schilling X * buffer.c 1.117 X #include auch fuer DJGPP X XSat Nov 29 23:33:45 2003 Joerg Schilling X * buffer.c 1.116 X #include fuer setmode(fileno, O_BIMNARY) X setmode(fileno, O_BINARY) auch fuer JDGPP X XThu Nov 20 18:25:54 2003 Joerg Schilling X * star.c 1.207 X Version -> 1.5a35 X XThu Nov 20 18:25:23 2003 Joerg Schilling X * xheader.c 1.46 X Durch Einfuehrung des "len" Parameters in gen_iarray() fing die Berechnung des "len" Wertes nicht mehr X bei 0 an sondern bei dem einkommenden Wert. Dadurch wurde (fuer den Fall dasz die Gesamtlaenge korrekt X geschaetzt wurde) der zu hohe Wert in den POSIX.1-2001 Header eingetragen. X XMon Nov 17 14:44:39 2003 Joerg Schilling X * longnames.c 1.44 X split_posix_name() prueft nun (props.pr_nflags & PR_LONG_NAMES) X name_to_tcb() prueft nun zuesaetzlich (namelen+add > props.pr_maxnamelen) X name_to_tcb() erzeugt nur noch sehr lange Namen wenn (props.pr_nflags & PR_LONG_NAMES) war ist X XMon Nov 17 12:59:46 2003 Joerg Schilling X * cpiohdr.c 1.15 X Hinweis auf MF_ADDSLASH in name_to_tcb() in longname.c X XWed Nov 12 17:33:02 2003 Joerg Schilling X * buffer.c 1.115 X cur_size/cur_off/old_size/old_off -> m_stats damit sie im shared memory stehen X fifo_hpos() -> BOOL damit sie melden kann ob kein gesetztes Bit gefunden wurde X Bei Files > FIFO size wird nun auch im -fifo Modus ein korrekter multivol cont Header geschrieben X XWed Nov 12 17:31:04 2003 Joerg Schilling X * create.c 1.87 X cur_size/cur_off -> m_stats damit sie im shared memory stehen X bei tsize > 0 duerfen Files > tsize nur dann nicht archiviert werden wenn -multivol nicht verwendet wurde X XWed Nov 12 17:28:44 2003 Joerg Schilling X * fifo.h 1.16 X cur_size/cur_off/old_size/old_off -> m_stats damit sie im shared memory stehen X XWed Nov 12 09:13:01 2003 Joerg Schilling X * buffer.c 1.114 X * fifo.c 1.52 X Bistring name ist nicht char * sondern bitstr_t * (unsigned char *) X XWed Nov 12 00:11:18 2003 Joerg Schilling X * star.c 1.206 X Version -> 1.5a34 X Setzen von dir_flags erst nach dem fifo-fork, damit echo README | star -copy list=- /tmp nicht 2x chdir("/tmp") macht X XTue Nov 11 23:39:44 2003 Joerg Schilling X * fifo.c 1.51 X mp->bmlast neu X fbit_nclear() neu X do_out() mit korrigiertem Bithandling X XTue Nov 11 23:33:04 2003 Joerg Schilling X * buffer.c 1.113 X Erster Versuch Multivol Continuation Header fuer den -fifo Fall zu schreiben X XTue Nov 11 21:45:33 2003 Joerg Schilling X * starsubs.h 1.71 X * header.c 1.97 X newvolhdr() hat nun 3 Parameter: buf, amount, do_fifo X XTue Nov 11 20:27:41 2003 Joerg Schilling X * fifo.h 1.15 X mp->bmlast neu X XTue Nov 11 01:44:49 2003 Joerg Schilling X * fifo.c 1.50 X Anlegen einer Bitmap und loeschen der Bits aus den bereits geschriebenen Bereichen X XMon Nov 10 22:09:39 2003 Joerg Schilling X * star.c 1.205 X -no-fifo aktivieren bei -print-artype X XMon Nov 10 22:06:50 2003 Joerg Schilling X * buffer.c 1.112 X * cpiohdr.c 1.14 X * header.c 1.96 X Umbauten fuer neue Option -print-artype X XMon Nov 10 22:01:58 2003 Joerg Schilling X * star.h 1.84 X Erweiterte C_* Kompressionsdefinitionen X XMon Nov 10 22:00:17 2003 Joerg Schilling X * starsubs.h 1.70 X print_hdrtype() nun mit FILE * Parameter X get_cmpname() neu X XMon Nov 10 21:59:30 2003 Joerg Schilling X * star.c 1.204 X Neue Option -print-artype und artype= X XMon Nov 10 15:03:07 2003 Joerg Schilling X * fifo.h 1.14 X Bitstrings neu X XMon Nov 10 15:02:42 2003 Joerg Schilling X * bitstring.h 1.5 X bit_init()/bit_fill()/bit_ffcs()/bit_ffss() neu X XMon Nov 10 15:01:41 2003 Joerg Schilling X * buffer.c 1.111 X marktcb() nun mit Bitmap Markierung im Falle von -multivol && -fifo X XSat Nov 8 14:16:44 2003 Joerg Schilling X * star.c 1.203 X Bessere Online Hilfe fuer -tpath X Abbruch bei level= ohne -M X XSun Nov 2 00:52:30 2003 Joerg Schilling X * tartest.c 1.5 X 2. Versuch nun mit char * statt char [] wegen K&R X XSun Nov 2 00:43:03 2003 Joerg Schilling X * tartest.c 1.4 X Initialisierungen sind nun K&R Kompatibel X XSun Nov 2 00:40:57 2003 Joerg Schilling X * pax.c 1.13 X & vor Funktion beseitigt X XSun Nov 2 00:39:55 2003 Joerg Schilling X * props.c 1.43 X Backslash beseitigt den K&R C nicht will X XSat Nov 1 23:20:07 2003 Joerg Schilling X * buffer.c 1.110 X Neue Funktion marktcb() X newvolhdr() ruft nun xbbackup()/xbrestore() X newvolhdr() hat nun Code fuer das Schreiben von multivol Headern X writeblock() returniert nun die Adresse des gechriebenen Blocks X old_size/old_off neu X XSat Nov 1 23:16:25 2003 Joerg Schilling X * volhdr.c 1.13 X put_volhdr() hat nun 2. Parameter der festlegt ob ein 'V' Header geschrieben wird X Neue Funktion put_multhdr() X XSat Nov 1 23:14:03 2003 Joerg Schilling X * header.c 1.95 X isxmagic() kommt nun auch mit 'M' headers klar denn dort ist der continuation offset auch prefix[130] X write_tcb() ruft nun marktcb() und berechnet vorher den TCB Pointer X realsize nun auch bei 'M'ultivol headern fuellen X 'M'ultivol bei 'xstar' und 'star' fuellt/liest nun auch contoffset X XSat Nov 1 22:52:15 2003 Joerg Schilling X * xheader.c 1.45 X Neue Funtionen _xbinit()/xbbackup()/xbrestore()/get_offset() X Neuer POSIX.1-2001 Tags "SCHILY.offset" X XSat Nov 1 22:49:45 2003 Joerg Schilling X * starsubs.h 1.69 X Neue Funktionen marktcb()/put_multhdr()/xbbackup()/xbrestore() X writeblock() liefert nun eine Pointeradresse zurueck X put_volhdr() nun mit BOOL putv ('V') X XSat Nov 1 22:41:28 2003 Joerg Schilling X * star.c 1.202 X Version -> 1.5a33 X put_volhdr() hat nun 2. Parameter der festlegt ob ein 'V' Header geschrieben wird X XSat Nov 1 18:31:40 2003 Joerg Schilling X * create.c 1.86 X cur_size/cur_off neu fuer 'M' multivol X XSat Nov 1 14:41:49 2003 Joerg Schilling X * star.h 1.83 X XF_OFFSET neu X XSat Nov 1 14:37:12 2003 Joerg Schilling X * props.c 1.42 X props.pr_maxnamelen fuer "ustar" nun korrekt auf 256 wegen veraenderter Abfragen in longnames.c X XWed Oct 29 15:32:29 2003 Joerg Schilling X * diff.c 1.56 X Directory Diff Code ist nun wieder erst bei -diff -vv aktiv X XWed Oct 29 15:31:52 2003 Joerg Schilling X * longnames.c 1.43 X * gnutar.c 1.9 X * buffer.c 1.109 X strcatl()/concat()/*execl() casten nun NULL im letzten Arg nach (char *)NULL X XTue Oct 21 23:48:34 2003 Joerg Schilling X * volhdr.c 1.12 X * xheader.c 1.44 X Extended header mit value len == 0 loescht nun den bisherigen Wert X XTue Oct 21 20:31:55 2003 Joerg Schilling X * props.h 1.18 X * props.c 1.41 X PR_MULTIVOL neu nund nur bei star Archive Formaten aktivieren X XTue Oct 21 20:31:01 2003 Joerg Schilling X * star.c 1.201 X Version -> 1.5a32 X -multivol geht im Create Mode nun nur noch mit star Archive Formaten X multivol stillschweigend abgeschaltet wenn -copy Modus X XMon Oct 20 14:06:00 2003 Joerg Schilling X * bitstring.h 1.4 X cstyle X XMon Oct 20 13:38:02 2003 Joerg Schilling X * bitstring.h 1.3 X _SYS_BITSTRING_H_ -> _BITSTRING_H X XMon Oct 20 13:36:28 2003 Joerg Schilling X * bitstring.h 1.2 X Umbau auf BSD-2 Lizens vom. 22.Juli 1999 William Hoskins Director, Office of Technology Licensing University of California, Berkeley X Siehe: ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change X XMon Oct 20 13:33:21 2003 Joerg Schilling X * bitstring.h 1.1 X date and time created 03/10/20 12:33:21 by joerg X XMon Oct 20 01:50:05 2003 Joerg Schilling X * star.c 1.200 X * buffer.c 1.108 X * create.c 1.85 X * diff.c 1.55 X Umstellung auf _getinfo() X XMon Oct 20 01:47:46 2003 Joerg Schilling X * restore.c 1.1 X date and time created 03/10/20 00:47:46 by joerg X XMon Oct 20 01:43:51 2003 Joerg Schilling X * extract.c 1.78 X restore.c neu X Umstellung auf _getinfo() X XMon Oct 20 01:41:25 2003 Joerg Schilling X * starsubs.h 1.68 X _getinfo() neu X restore.c neu X XMon Oct 20 01:22:26 2003 Joerg Schilling X * star_unix.c 1.64 X _getinfo() neu X XSun Oct 19 13:58:34 2003 Joerg Schilling X * acl_unix.c 1.19 X Kuerzere Zeilen fuer cstyle X XSun Oct 19 13:54:06 2003 Joerg Schilling X * acl_unix.c 1.18 X Hoffentlich letzter Versuch von A. Gruenbacher die Defekten ACL Strings von Linux zu umgehen X XThu Oct 16 15:28:01 2003 Joerg Schilling X * xheader.c 1.43 X Fehler beim Verschieben von text oder iarray nach falsch geratener Laenge beseitigt: Start nun bei xbidx+olen statt bei xbidx+llen X XThu Oct 16 00:48:59 2003 Joerg Schilling X * buffer.c 1.107 X * xheader.c 1.42 X Cstyle aenderungen X XThu Oct 16 00:16:02 2003 Joerg Schilling X * star.c 1.199 X -j auch im Compat Mode erlauben X XThu Oct 16 00:08:45 2003 Joerg Schilling X * star.c 1.198 X Version -> 1.5a31 X Neue Optionen -j, -xdot, -restore X Experimental Hinweise beseitigt X dogetwdir() Aufruf nun auch korrekterweise bei star -ctv X XThu Oct 16 00:02:42 2003 Joerg Schilling X * extract.c 1.77 X Neue Option -xdot X XWed Oct 15 01:45:50 2003 Joerg Schilling X * xheader.c 1.41 X Ullong -> Llong wegen astollb() X XWed Oct 15 01:12:14 2003 Joerg Schilling X * star.h 1.82 X info->f_dirinos/info->f_dirents neu X XWed Oct 15 01:11:15 2003 Joerg Schilling X * xheader.c 1.40 X * create.c 1.84 X * header.c 1.94 X * star_unix.c 1.63 X * starsubs.h 1.67 X * diff.c 1.54 X SCHILY.dino implementiert, gen_iarray()/get_iarray() neu, info->f_dirinos/info->f_dirents neu X XTue Oct 14 19:20:27 2003 Joerg Schilling X * diff.c 1.53 X Umbau auf neue Funktion dirdiffs() und Benutzung von cmpdir() X XTue Oct 14 19:18:22 2003 Joerg Schilling X * volhdr.c 1.11 X * dumpdate.c 1.4 X Workaround fuer FreeBSD/MacOS X broken tv_sec/time_t X XTue Oct 14 19:14:36 2003 Joerg Schilling X * starsubs.h 1.66 X Neue Funktion cmpdir() X XSat Oct 11 17:32:39 2003 Joerg Schilling X * buffer.c 1.106 X changetape() setzt nun pid != 0 damit auch von FIFO Prozess prstat() etwas ausgibt X changetape() setzt nun auch gip->volno (im shared Memory) X nextitape() ruft nun verifyvol() nach Bandwechsel ohne FIFO X nextotape() ruft nun wieder unbedingt weof() denn nextotape() wird nur im non-split multivol Mode gerufen X startvol()/newvolhdr() neu X initbuf() alloziert nun auch mit FIFO im multivol Schreibmodus 2xbufsize damit der Volheader geschrieben werden kann X writetape() hat nun einen Aufruf von changetape() der durch Erreichen von tsize= ausgeloest wird X flushbuf() hat nun Schleife ueber writebuf() falls Bandwechsel direkt am Ende kommt. X XSat Oct 11 17:22:37 2003 Joerg Schilling X * fifo.c 1.49 X pit != 0 Zuweisung zum Erzwingen einer Ausgabe in prstats() -> changetape() X startvol() Aufruf neu in do_out() zum Schreiben von Volheadern X do_in(): verifyvol() Aufruf ueberarbeitet X XSat Oct 11 14:53:20 2003 Joerg Schilling X * volhdr.c 1.10 X Ein Volheader wird nun auch geschrieben wenn tsize= ohne -multivol verwendet wird X Neuer Check auf zu grossen Volume header X XSat Oct 11 13:49:43 2003 Joerg Schilling X * header.c 1.93 X newvolhdr() Aufruf nach nextotape() X tsize= bedingter Bandwechsel ohne split File von write_tcb() -> put_tcb() damit alles fuer ein File zusammensteht X XFri Oct 10 21:06:57 2003 Joerg Schilling X * starsubs.h 1.65 X newvolhdr() neu X XFri Oct 10 18:07:45 2003 Joerg Schilling X * xheader.c 1.39 X Vorkehrungen gegen alte archive bei denen SCHILY.dir nur mit einem null Byte endet X xhsize() neu X XFri Oct 10 18:06:22 2003 Joerg Schilling X * diff.c 1.52 X Vorkehrungen gegen alte archive bei denen SCHILY.dir nur mit einem null Byte endet X XFri Oct 10 18:05:00 2003 Joerg Schilling X * starsubs.h 1.64 X startvol() & xhsize() neu X XFri Oct 10 17:59:46 2003 Joerg Schilling X * create.c 1.83 X fetchdir() len enthaelt nun auch das zweite null Byte (Listen Terminator) X XThu Oct 9 21:34:38 2003 Joerg Schilling X * volhdr.c 1.9 X verifyvol() Sucht nun auch nach 'V'olheadern zum Skippen X XThu Oct 9 00:30:03 2003 Joerg Schilling X * header.c 1.92 X Non-file-Split Multi Volume Aktionen unterbinden wenn -multivol aktiv ist X XThu Oct 9 00:27:15 2003 Joerg Schilling X * volhdr.c 1.8 X 'g' Header am Anfang eines Weiterfuehrungs Mediums bei multivol ignorieren wenn dort keine VOLHDR Info drin ist X Nach dem 'g' Header musz entweder ein 'V' oder ein 'M' Header kommen X XWed Oct 8 22:41:54 2003 Joerg Schilling X * defaults.c 1.8 X Fehlerkorrekturen: star_darchive(arname, NULL) funktioniert nun X nblocks und tsize werden korrekt in ihrer Zahlenbasis aufgesetzt X XWed Oct 8 21:59:25 2003 Joerg Schilling X * star.c 1.197 X tsize auf Tape Blockgroesse abrunden X tsize minimum check hinter das Lesen von /etc/default/*tar verschoben X XWed Oct 8 02:15:11 2003 Joerg Schilling X * volhdr.c 1.7 X grinit() beachtet nun GF_NOALLOC X Neue Funktion gipsetup() X Neue Funktion verifyvol() allerdings erst halb fertig X XWed Oct 8 01:58:38 2003 Joerg Schilling X * fifo.c 1.48 X GINFO *gip nun im shared Memory X setprops() damit es gespiegelte Properties auch im FIFO Prozess gibt X Erster Versuch nach einem Bandwechsel im Read-Modus den HEader zu verifizieren X XWed Oct 8 01:44:44 2003 Joerg Schilling X * fifo.h 1.13 X ginfo neu in m_head X XTue Oct 7 22:32:34 2003 Joerg Schilling X * xheader.c 1.38 X gipsetup() Aufruf neu X XTue Oct 7 22:31:16 2003 Joerg Schilling X * buffer.c 1.105 X buf_resume() setzt nun neuen Strukt Member stats->hdrtype (bei FIFO im shared mem) damit der fifi Prozess auch bescheid weis X XTue Oct 7 22:25:24 2003 Joerg Schilling X * header.c 1.91 X tarsum_ok() neu X buf_resume() nach hinten verschoben damit beim wiederaufwecken des FIFO Prozesses der Archivtyp bekannt ist X XTue Oct 7 22:12:21 2003 Joerg Schilling X * star.c 1.196 X Version -> 1.5a30 X XTue Oct 7 20:58:25 2003 Joerg Schilling X * fifo.h 1.12 X m_stats->hdrtype & m_head->rsize neu X XTue Oct 7 20:56:14 2003 Joerg Schilling X * starsubs.h 1.63 X changetape() nun mit donext Parameter X tarsum_ok()/gipsetup()/verifyvol()/xhparse() neu X XTue Oct 7 20:53:44 2003 Joerg Schilling X * star.h 1.81 X Neues Flag GF_NOALLOC X XTue Oct 7 01:39:08 2003 Joerg Schilling X * xheader.c 1.37 X xhparse() neu X XMon Oct 6 23:08:52 2003 Joerg Schilling X * buffer.c 1.104 X changetape() nun mit 'donext' Parameter X XMon Oct 6 21:00:48 2003 Joerg Schilling X * star.h 1.80 X GF_MINIT neu X XMon Oct 6 01:05:37 2003 Joerg Schilling X * xheader.c 1.36 X Neue Funktion gen_unumber() X gen_number() kann nun korrekt negative Zahlen ausgeben X Umstellung der meisten numerischen Ausgaben auf gen_unumber() X XSun Oct 5 03:06:30 2003 Joerg Schilling X * starsubs.h 1.62 X gen_unumber() neu X XSun Oct 5 02:12:41 2003 Joerg Schilling X * volhdr.c 1.6 X gip->volno/gip->blockoff/gip->blocksize Check auf > 0 statt != 0 X XSun Oct 5 01:41:38 2003 Joerg Schilling X * xheader.c 1.35 X Check auf non-digit im len Feld neu X Check ob '=' vor der Laenge des aktuellen Feldes kommt neu X XSun Oct 5 01:06:26 2003 Joerg Schilling X * xheader.c 1.34 X Check auf Syntax error: missing '=' X XSun Oct 5 00:01:33 2003 Joerg Schilling X * volhdr.c 1.5 X Schreibfehler korrigiert in ginit() grip->archtype -> gip->archtype X XSat Oct 4 23:07:30 2003 Joerg Schilling X * star.h 1.79 X * volhdr.c 1.4 X DT_UNKNOWN -> DT_UNKN wegen DT_UNKNOWN used in BSD X XFri Oct 3 23:20:14 2003 Joerg Schilling X * volhdr.c 1.3 X finfo.f_atime = gip->volno; bei altem star zur Uebertragung der Volume Nummer X XFri Oct 3 19:38:23 2003 Joerg Schilling X * xheader.c 1.33 X Neues include file xtab.h X get_xvolhdr()/get_release()/get_archtype() neu X get_xtime()/get_number() nun global X XFri Oct 3 19:31:45 2003 Joerg Schilling X * volhdr.c 1.2 X Volheader Management mit 'g'lobalen POSIX.1-2001 headern X XFri Oct 3 19:27:08 2003 Joerg Schilling X * star.c 1.195 X Version -> 1.5a29 X GINFO neu X Volheader Management bei dumplevel >= 0 X XFri Oct 3 18:10:28 2003 Joerg Schilling X * starsubs.h 1.61 X get_xtime()/get_number() nun global X ginit()/grinit()/priprint() neu X XFri Oct 3 18:03:09 2003 Joerg Schilling X * star.h 1.78 X GINFO neu X XFri Oct 3 16:54:36 2003 Joerg Schilling X * xtab.h 1.1 X date and time created 03/10/03 15:54:36 by joerg X XFri Oct 3 13:07:06 2003 Joerg Schilling X * starsubs.h 1.60 X hdr_name() & put_archtype() neu X put_release() -> volhdr.c X XFri Oct 3 12:54:35 2003 Joerg Schilling X * xheader.c 1.32 X put_release() -> volhdr.c X "SCHILY.archtype" neu X XF_NOTIME funktioniert nun X gen_xtime() kann nun auch andere Strings als "atime", "ctime", "mtime" X get_xtime() kann nun auch weniger als 9 Nachkommastellen (groeber als Nanosekunden) X XFri Oct 3 01:27:34 2003 Joerg Schilling X * header.c 1.90 X hdr_name() neu X XFri Oct 3 01:23:11 2003 Joerg Schilling X * dumpdate.c 1.3 X Microsekunden in /etc/tardumps aktiviert X XThu Oct 2 02:41:33 2003 Joerg Schilling X * header.c 1.89 X * starsubs.h 1.59 X * star.c 1.194 X Umstellung auf hdr_usage()/hdr_type() und htab_t X XWed Oct 1 19:34:30 2003 Joerg Schilling X * xheader.c 1.31 X gen_xtime()/gen_number()/gen_text() sind nun EXTERN; get_*() Funktionen mit klen Parameter; SCHILY.volhdr.* neu X XWed Oct 1 19:33:24 2003 Joerg Schilling X * starsubs.h 1.58 X volhdr Funktionen -> volhdr.c X gen_xtime()/gen_number()/gen_text() sind nun EXTERN X XWed Oct 1 19:32:25 2003 Joerg Schilling X * header.c 1.88 X volhdr Funktionen -> volhdr.c X XWed Oct 1 17:37:09 2003 Joerg Schilling X * volhdr.c 1.1 X date and time created 03/10/01 16:37:09 by joerg X XMon Sep 29 13:34:00 2003 Joerg Schilling X * star.c 1.193 X -no-dirslash kann nicht mit -Htar verwendet werden da der Slash die Methode zum Erkennen von dirs ist X XMon Sep 29 02:01:55 2003 Joerg Schilling X * star.c 1.192 X Besserer Kommentat in getdir() X XMon Sep 29 01:57:40 2003 Joerg Schilling X * star.c 1.191 X opts wird schreibbarer String damit man '....,?' wegpatchen kann X getdir() patcht nun '...,?' weg damit das fuer tar c4 eingefuehrte nicht mit -C (freistehend) konkurriert X 2. gettimeofday(&ddate, 0) beseitigt, damit im Volhdr die selbe Zeit steht wie in /etc/tardumps X XMon Sep 29 01:54:00 2003 Joerg Schilling X * gnutar.c 1.8 X * suntar.c 1.6 X * cpio.c 1.6 X * pax.c 1.12 X opts wird schreibbarer String damit man '....,?' wegpatchen kann X XSun Sep 28 23:25:19 2003 Joerg Schilling X * suntar.c 1.5 X * star.c 1.190 X * longnames.c 1.42 X Neue Option -no-dirslash X XSun Sep 28 23:17:01 2003 Joerg Schilling X * gnutar.c 1.7 X Sicherstellen, dasz immer "/" an Directories angehaengt werden X XSun Sep 28 23:15:36 2003 Joerg Schilling X * list.c 1.56 X Hinzufuegen eines "/" am Ende einer dir nur im -c Mode X XSun Sep 28 23:10:39 2003 Joerg Schilling X * list.c 1.55 X no_dirslash neu und Ausgabe der Directorynamen wie sie im Archiv stehen X XSun Sep 28 22:51:26 2003 Joerg Schilling X * star.c 1.189 X Version -> 1.5a28 X Neue Funktion put_release() X XSun Sep 28 22:50:50 2003 Joerg Schilling X * header.c 1.87 X Wegen der Erzeugung von 'g'lobalen P-2001 Headern wird nun 'ghdr' getestet X XSun Sep 28 22:49:41 2003 Joerg Schilling X * starsubs.h 1.57 X * xheader.c 1.30 X Neue Funktion put_release() X XSun Sep 28 22:48:10 2003 Joerg Schilling X * props.c 1.40 X * props.h 1.17 X Neues Flag PR_VU_XHDR X XSun Sep 28 17:56:12 2003 Joerg Schilling X * star.h 1.77 X init_finfo() neu X XF_POSIX neu X XSun Sep 28 17:55:10 2003 Joerg Schilling X * star.c 1.188 X star_mkvers() neu X XSun Sep 28 17:51:04 2003 Joerg Schilling X * props.c 1.39 X props.pr_xhmask Headerspezifisch initialisiert X XSun Sep 28 17:42:33 2003 Joerg Schilling X * xheader.c 1.29 X Auswertung der Maske props.pr_xhmask X XSun Sep 28 17:28:54 2003 Joerg Schilling X * xheader.c 1.28 X write_xhdr() neu X get_xtime() erlaubt nun einen Null Pointer fuer die Nanosekunden X XSun Sep 28 16:06:04 2003 Joerg Schilling X * props.h 1.16 X * props.c 1.38 X * star_unix.c 1.62 X props.pr_xdflags -> props.pr_xhdflags, props.pr_xhmask neu X XSat Sep 27 15:33:50 2003 Joerg Schilling X * star.c 1.187 X SChreibfehler vesions -> versions X XSat Sep 27 15:32:57 2003 Joerg Schilling X * create.c 1.82 X Kommentar verbessert bei telldir()/seekdir() Fehlern X XSat Sep 27 15:31:42 2003 Joerg Schilling X * gnutar.c 1.6 X -tpath Flag bei -x & -c setzen weil GNU tar eine unuebliche verbose Ausgabe macht X XSat Sep 27 15:29:01 2003 Joerg Schilling X * list.c 1.54 X star cv -tpath gibt nun nur noch den Filenamen aus X XFri Sep 26 13:43:18 2003 Joerg Schilling X * star.c 1.186 X Create Code aus main() und copy_create() zusammengefasst zu star_create() X XFri Sep 26 13:32:39 2003 Joerg Schilling X * star.c 1.185 X Fehler bei -c -t beseitigt: &oav[oac+1] -> &oav[oac] X XFri Sep 26 02:07:36 2003 Joerg Schilling X * star.c 1.184 X * create.c 1.81 X Umbau auf struct timeval bei Newer & ddate X XFri Sep 26 02:06:43 2003 Joerg Schilling X * dumpdate.c 1.2 X * dumpdate.h 1.3 X Umbau auf struct timeval X XFri Sep 26 01:49:38 2003 Joerg Schilling X * list.c 1.53 X ddate wird nicht gebraucht X XFri Sep 26 01:01:17 2003 Joerg Schilling X * star.c 1.183 X * cpio.c 1.5 X * gnutar.c 1.5 X cstyle X XThu Sep 25 15:26:08 2003 Joerg Schilling X * fifo.c 1.47 X DEBUG wieder deaktiviert X XThu Sep 25 15:19:01 2003 Joerg Schilling X * buffer.c 1.103 X writebuf() nun mit amount Parameter X flushbuf() ruft nun writebuf(bigcnt) auf X XThu Sep 25 15:14:14 2003 Joerg Schilling X * buffer.c 1.102 X Total Ausgabe in prstats() bei multivol sollte nun korrekt sein X EOT Erkennung in writetape() bei -multivol X changetape() Aufruf in writebuf()/flushbuf() X XThu Sep 25 15:12:27 2003 Joerg Schilling X * fifo.h 1.11 X Neue fifo_stats() Ausgabe fuer Block Residual moves X XThu Sep 25 15:12:10 2003 Joerg Schilling X * fifo.c 1.46 X movebytes() fuer Block Residual kann nun bis zu 'obs' gross werden X Neue fifo_stats() Ausgabe fuer Block Residual moves X changetape() bei EOT Erkennung und -multivol X XWed Sep 24 17:10:49 2003 Joerg Schilling X * buffer.c 1.101 X writebuf() kommt nun damit klar wenn writetape() einen unvollstaendigen Block schreibt (QIC EOT) X XWed Sep 24 16:42:06 2003 Joerg Schilling X * star.c 1.182 X Version -> 1.5a27 X Neue Option -qic525 X XWed Sep 24 16:41:14 2003 Joerg Schilling X * buffer.c 1.100 X Vorbereitungen fuer auto multivol bei Bandende X XMon Sep 22 15:32:00 2003 Joerg Schilling X * xheader.c 1.27 X info_xcopy() neu damit 'g' header funktionieren X XMon Sep 22 01:03:44 2003 Joerg Schilling X * fifo.c 1.45 X fifo_chtape() -> fifo_chotape() X fifo_chitape() neu X -multivol neu X XMon Sep 22 00:05:16 2003 Joerg Schilling X * buffer.c 1.99 X nexttape() -> nextotape(), fifo_chtape() -> fifo_chotape() X nextitape()/fifo_chitape() neu X -multivol neu X Check auf compression nur bei stats->volno == 1 X XSun Sep 21 23:55:35 2003 Joerg Schilling X * header.c 1.86 X nexttape() -> nextotape() X XSun Sep 21 23:50:50 2003 Joerg Schilling X * starsubs.h 1.56 X nexttape() -> nextotape(), fifo_chtape() -> fifo_chotape() X nextitape()/fifo_chitape() neu X XSun Sep 21 23:47:50 2003 Joerg Schilling X * star.c 1.181 X Bei -multivol braucht man auch /dev/tty X XSun Sep 21 23:47:26 2003 Joerg Schilling X * gnutar.c 1.4 X star kann jetzt -multivol X XSun Sep 21 13:58:13 2003 Joerg Schilling X * star.c 1.180 X -multivol neu X XSun Sep 21 13:34:30 2003 Joerg Schilling X * buffer.c 1.98 X multivol verhindert das Schreiben von logischen EOF Record beim Bandwechsel X "Cannot backspace .." Meldung nun "tape"/"medium" X Kommentar stark erweitert X XSun Sep 21 03:29:22 2003 Joerg Schilling X * fifo.c 1.44 X fifo_resume() ist nun OK X XSat Sep 20 14:58:30 2003 Joerg Schilling X * xheader.c 1.26 X snprintf() -> js_snprintf() X XSat Sep 20 14:26:09 2003 Joerg Schilling X * star.c 1.179 X star_checkopts() mit int archive (statt char) und bessere Wertebereichsueberpruefung X XSat Sep 20 14:24:29 2003 Joerg Schilling X * gnutar.c 1.3 X AUf neuer Zeile fortgesetzte Strings (ehemals von GNU tar.c) repariert X XSat Sep 20 13:51:07 2003 Joerg Schilling X * gnutar.c 1.2 X --totals -> -time, Bessere Warnungen bei nicht unterstuetzten Optionen X XSat Sep 20 13:50:16 2003 Joerg Schilling X * star.c 1.178 X comments? -bsdchdir -Z compress-program= neu X "gnutar" kann nun integriert werden X XSat Sep 20 13:15:29 2003 Joerg Schilling X * buffer.c 1.97 X -Z compress-program= -force-local neu X XSat Sep 20 04:02:38 2003 Joerg Schilling X * suntar.c 1.4 X * pax.c 1.11 X * cpio.c 1.4 X star_info() -> xxx_info() X XSat Sep 20 04:00:49 2003 Joerg Schilling X * gnutar.c 1.1 X date and time created 03/09/20 03:00:49 by joerg X XSat Sep 20 03:51:13 2003 Joerg Schilling X * starsubs.h 1.55 X * star_unix.c 1.61 X archisnull() neu X XFri Sep 19 16:17:53 2003 Joerg Schilling X * pax.c 1.10 X * cpio.c 1.3 X Umstellung auf star_helpvers()/star_checkopts() X XFri Sep 19 15:50:56 2003 Joerg Schilling X * suntar.c 1.3 X Umstellung auf get_helpvers()/star_checkopts()/star_nfiles() X XFri Sep 19 15:48:48 2003 Joerg Schilling X * star.c 1.177 X star_nfiles() neu X XFri Sep 19 15:44:49 2003 Joerg Schilling X * star.c 1.176 X star_checkopts() ist nun auch fuer suntar zu gebrauchen X XFri Sep 19 15:22:22 2003 Joerg Schilling X * star.c 1.175 X star_helpvers()/star_checkopts() neu X XFri Sep 19 14:31:39 2003 Joerg Schilling X * star.c 1.174 X Aufrufbedingungen von star_darchive() korrigiert X XFri Sep 19 14:18:35 2003 Joerg Schilling X * star.c 1.173 X -0..7 Option neu X Star erzeugt keine Archive mehr wenn nicht genug file Parameter verwendet wurden X XFri Sep 19 14:02:58 2003 Joerg Schilling X * defaults.c 1.7 X * starsubs.h 1.54 X get_stardefaults() ist nun extern X XThu Sep 18 18:13:56 2003 Joerg Schilling X * cpio.c 1.2 X SVr4 Optionen hinzugefuegt X XThu Sep 18 18:10:22 2003 Joerg Schilling X * star.c 1.172 X Verision -> 1.5a26 X getllnum aktiviert X XThu Sep 18 16:58:55 2003 Joerg Schilling X * star.c 1.171 X nodir -> noxdir (extract only) X Neues -H Format "bin" (UNIX V7 CPIO Binary) kann nun erzeugt werden X XThu Sep 18 16:57:56 2003 Joerg Schilling X * suntar.c 1.2 X * extract.c 1.76 X nodir -> noxdir (extract only) X XThu Sep 18 16:50:02 2003 Joerg Schilling X * cpiohdr.c 1.13 X * header.c 1.85 X Das Erzeugen von CPIO_BIN (UNIX V7) Archiven wird nun unterstuetzt X XThu Sep 18 16:48:44 2003 Joerg Schilling X * cpio.c 1.1 X date and time created 03/09/18 15:48:44 by joerg X XWed Sep 17 17:38:05 2003 Joerg Schilling X * longnames.c 1.41 X Aehnlich PAX Rationale bekommen ./@Long* nun TUREAD|TUWRITE Permissions X XWed Sep 17 15:56:37 2003 Joerg Schilling X * header.c 1.84 X ptb->dbuf.t_linkflag == LF_GHDR ('g') muss auch als extended Header akzeptiert werden sonst gibt es eine Endlosschleife X XWed Sep 17 15:53:43 2003 Joerg Schilling X * xheader.c 1.25 X Nach PAX Rationale bekommt der ././@PaxHeader nun TUREAD|TUWRITE Permissions X XWed Sep 17 02:40:12 2003 Joerg Schilling X * props.c 1.37 X Linkflag 'M' ist kein Xtension Header X XWed Sep 17 01:09:20 2003 Joerg Schilling X * extract.c 1.75 X get_file() arbeitet nun nach der selben Methode wie die anderen Extraktionsroutinen wenn create_dirs() oder remove_file() gerufen wurde X XWed Sep 17 00:30:34 2003 Joerg Schilling X * extract.c 1.74 X Kein unlink() mehr bei 'uncond' (-U), wenn man remove will, dann jetzt -U -remove-first X XTue Sep 16 22:16:41 2003 Joerg Schilling X * extract.c 1.73 X * starsubs.h 1.53 X * subst.c 1.6 X newer() mit 2. Parameter FINFO *cinfo X XTue Sep 16 22:08:36 2003 Joerg Schilling X * star_unix.c 1.60 X info->f_filetype = -1 zur Initialisierung damit man erkennen kann ob getingo geklappt hat X XTue Sep 16 19:27:37 2003 Joerg Schilling X * defaults.c 1.6 X getknum() erwartet Lling aber tsize ist Ullong X XTue Sep 16 16:05:30 2003 Joerg Schilling X * extract.c 1.72 X get_file() ruft nun void_file(info); bei dometa X Neue Funktion get_ofile() X XMon Sep 15 17:06:02 2003 Joerg Schilling X * pax.c 1.9 X star_defaults() hat neuen Parameter X XMon Sep 15 16:52:17 2003 Joerg Schilling X * suntar.c 1.1 X date and time created 03/09/15 15:52:17 by joerg X XMon Sep 15 16:51:55 2003 Joerg Schilling X * star.c 1.170 X Erweiterungen fuer suntar.c X XMon Sep 15 16:50:49 2003 Joerg Schilling X * defaults.c 1.5 X * starsubs.h 1.52 X getbnum()/getknum() nun Global X star_defaults() mit dfltname Parameter X star_darchive() neu X XMon Sep 15 14:18:13 2003 Joerg Schilling X * defaults.c 1.4 X open_cdrdefaults() -> open_stardefaults() X XMon Sep 15 12:33:58 2003 Joerg Schilling X * star.c 1.169 X bsdchdir Umschaltung neu X XSun Sep 14 23:48:58 2003 Joerg Schilling X * pax.c 1.8 X Umstellung auf #define STAR_MAIN & #ifndef NO_STAR_MAIN X star_info() neu X XSun Sep 14 23:48:10 2003 Joerg Schilling X * star.c 1.168 X Umstellung auf #define STAR_MAIN & #ifndef NO_STAR_MAIN X XSun Sep 14 20:59:34 2003 Joerg Schilling X * xheader.c 1.24 X Warnung wegen unbekannter Keywoerter kommen nur noch einmal X XSun Sep 14 15:34:31 2003 Joerg Schilling X * star_unix.c 1.59 X Behandlung von EINTR bei stat()/lstat() X XSun Sep 14 15:16:18 2003 Joerg Schilling X * fifo.c 1.43 X errno in swait() auf 0 setzen X XSun Sep 14 13:38:48 2003 Joerg Schilling X * create.c 1.80 X * create.c 1.79 X * cpiohdr.c 1.12 X * xheader.c 1.23 X cstyle Anpassungen X XSun Sep 14 13:34:53 2003 Joerg Schilling X * buffer.c 1.96 X cstyle X XSat Sep 13 19:48:23 2003 Joerg Schilling X * xattr.c 1.2 X #include -> #include X list -> alist wegen GCC X fillbytes() Schreibfehler beseitigt X XSat Sep 13 15:04:24 2003 Joerg Schilling X * list.c 1.52 X Support fuer Extended File Attributes X XSat Sep 13 14:30:20 2003 Joerg Schilling X * xattr.c 1.1 X date and time created 03/09/13 13:30:20 by joerg X XSat Sep 13 13:45:43 2003 Joerg Schilling X * buffer.c 1.95 X * star.h 1.76 X * checkerr.c 1.6 X * checkerr.h 1.6 X GETXATTR/SETXATTR neu X XFri Sep 12 16:52:40 2003 Joerg Schilling X * xheader.c 1.22 X * header.c 1.83 X SCHILY.xattr.* Behandlung neu X XWed Sep 10 18:24:04 2003 Joerg Schilling X * starsubs.h 1.51 X Anpassungen fuer cstyle X XWed Sep 10 17:37:01 2003 Joerg Schilling X * star_unix.c 1.58 X #ifdef USE_XATTR neu X XWed Sep 10 17:35:38 2003 Joerg Schilling X * starsubs.h 1.50 X xattr.c neu X XWed Sep 10 17:26:34 2003 Joerg Schilling X * star.c 1.167 X Version -> 1.5a25 X Optionen -xattr & -xattr-linux neu X XWed Sep 10 16:35:39 2003 Joerg Schilling X * star.h 1.75 X typedef struct star_xattr & #define XF_XATTR fuer Linux Extended File Attributes X XMon Sep 8 22:46:44 2003 Joerg Schilling X * star.c 1.166 X Version -> 1.5a24 X XMon Sep 8 22:09:15 2003 Joerg Schilling X * cpiohdr.c 1.11 X Erster extrakt Support fuer H_CPIO_BIN X XMon Sep 8 22:07:45 2003 Joerg Schilling X * props.c 1.36 X H_CPIO_BIN Support neu X XMon Sep 8 22:07:08 2003 Joerg Schilling X * header.c 1.82 X * starsubs.h 1.49 X cpio_checkswab() neu X XMon Sep 8 17:29:53 2003 Joerg Schilling X * props.c 1.35 X Vergessenes 'break' nach TAR und vor CPIO eingefuegt X XMon Sep 8 17:22:06 2003 Joerg Schilling X * cpiohdr.c 1.10 X * star.c 1.165 X * create.c 1.78 X Erster Support fuer H_CPIO_ASC/H_CPIO_ACRC, vorerst werden separate Files statt Hardlinks geschrieben X XMon Sep 8 17:17:49 2003 Joerg Schilling X * props.c 1.34 X Sysvr4 Hex CPIO format num korrekt mit MAXNONLARGEFILE und mit gesetzter props.pr_xftypetab X XMon Sep 8 16:04:53 2003 Joerg Schilling X * star.h 1.74 X Neues Flag F_CRC um CPIO crc Checksummen verzoegert zu berechnen X XMon Sep 8 13:43:49 2003 Joerg Schilling X * create.c 1.77 X Erweiterungen fuer das Schreiben von POSIX.1-1988 CPIO X XMon Sep 8 13:09:15 2003 Joerg Schilling X * star.h 1.73 X * cpiohdr.c 1.9 X read_link() Aufruf nun mit info->f_flags |= F_EXTRACT um Ueberschreiben des TCB beim Auspacken zu verhindern X XMon Sep 8 02:58:43 2003 Joerg Schilling X * cpiohdr.c 1.8 X Schreib Support fuer POSIX cpio Format X XMon Sep 8 02:57:41 2003 Joerg Schilling X * props.c 1.33 X ustar & tar koennen kein sparse, daher D_SPARS in props.pr_diffmask X XMon Sep 8 02:20:54 2003 Joerg Schilling X * starsubs.h 1.48 X Erweiterungen fuer CPIO Schreib Support X XMon Sep 8 01:37:46 2003 Joerg Schilling X * props.c 1.32 X * header.c 1.81 X * star.h 1.72 X * star.c 1.164 X Neuer Header Type "odc" X XMon Sep 8 01:00:28 2003 Joerg Schilling X * longnames.c 1.40 X Check auf namelen > props.pr_maxnamelen auch fuer CPIO X XMon Sep 8 00:58:44 2003 Joerg Schilling X * fifo.c 1.42 X * buffer.c 1.94 X FIFO und bigbuf etwas groesser machen weil llitos() bei CPIO den Puffer um ein Space ueberschreibt X XSat Sep 6 15:47:28 2003 Joerg Schilling X * buffer.c 1.93 X * header.c 1.80 X * hole.c 1.33 X peekblock()/readblock() nun mit amount Parameter um mit dem CPIO buffer wrap Problem klarzukommen X XSat Sep 6 15:26:34 2003 Joerg Schilling X * longnames.c 1.39 X * xheader.c 1.21 X * buffer.c 1.92 X get_block()/put_block() nun mit amount Parameter X XSat Sep 6 13:48:17 2003 Joerg Schilling X * header.c 1.79 X Aufruf von cpioinfo_to_tcb()/put_cpioh() neu X put_block() nun mit amount Parameter X Kommentar umgestellt X XFri Sep 5 21:41:41 2003 Joerg Schilling X * star.c 1.163 X Neuer Heaer Parameter -Hcpio X XFri Sep 5 21:38:36 2003 Joerg Schilling X * longnames.c 1.38 X name_to_tcb() tut nun nichts bei CPIO X XFri Sep 5 21:23:51 2003 Joerg Schilling X * buffer.c 1.91 X * fifo.c 1.41 X buf_sync()/fifo_sync() nun mit Parameter damit CPIO EOF Bloecke geschrieben werden koennen X XFri Sep 5 19:03:55 2003 Joerg Schilling X * props.c 1.31 X Cpio props.pr_fillc -> '0', props.pr_xftypetab wird bei H_CPIO_CHR initialisiert X XFri Sep 5 19:02:40 2003 Joerg Schilling X * table.h 1.10 X * table.c 1.18 X xtcpio_tab[] neu X XThu Sep 4 22:47:58 2003 Joerg Schilling X * cpiohdr.c 1.7 X Abort bei -c/-Hcrc Hardlinks nur noch wenn nicht im List Modus X XThu Sep 4 22:42:06 2003 Joerg Schilling X * cpiohdr.c 1.6 X Abort bei -c & -Hcrc Format wenn Link count > 1 X XThu Sep 4 22:28:27 2003 Joerg Schilling X * star.c 1.162 X Version -> 1.5a23 X XThu Sep 4 22:27:13 2003 Joerg Schilling X * header.c 1.78 X Erweiterungen fuer cpio X XThu Sep 4 22:26:06 2003 Joerg Schilling X * cpiohdr.c 1.5 X * starsubs.h 1.47 X cpio_resync() neu X XThu Sep 4 22:02:08 2003 Joerg Schilling X * cpiohdr.c 1.4 X ignoreerr fuer EOF Erkennung X XThu Sep 4 18:57:09 2003 Joerg Schilling X * longnames.c 1.37 X info->f_lname zeigt nun immer auf Speicher (von aussen sichergestellt) X ptb->dbuf.t_linkname immer kopieren X XThu Sep 4 18:56:19 2003 Joerg Schilling X * xheader.c 1.20 X info->f_lname zeigt nun immer auf Speicher (von aussen sichergestellt) X XThu Sep 4 18:55:42 2003 Joerg Schilling X * cpiohdr.c 1.3 X info->f_lname[0] = '\0' X XThu Sep 4 18:54:57 2003 Joerg Schilling X * extract.c 1.71 X * diff.c 1.51 X * list.c 1.51 X * append.c 1.20 X lname[PATH_MAX+1] fuer finfo.f_lname neu X XThu Sep 4 15:26:11 2003 Joerg Schilling X * cpiohdr.c 1.2 X Erste vollstaendige POSIX cpio extrakt Version, ASC/ACRC neu X XThu Sep 4 15:19:24 2003 Joerg Schilling X * starsubs.h 1.46 X print_hdrtype() -> EXPORT X cpiotcb_to_info() -> int X XThu Sep 4 15:05:33 2003 Joerg Schilling X * starsubs.h 1.45 X * header.c 1.77 X cpio header Funktionen nach cpiohdr.c ausgegliedert X XThu Sep 4 15:04:46 2003 Joerg Schilling X * cpiohdr.c 1.1 X date and time created 03/09/04 14:04:46 by joerg X XWed Sep 3 02:01:39 2003 Joerg Schilling X * list.c 1.50 X EOF bei tcb_to_info() genauso behandeln wie bei get_tcb() X tcb_to_info() Aufruf for finaler listnew AUsgabe nur wenn es kein CPIO Format ist X XWed Sep 3 02:00:12 2003 Joerg Schilling X * append.c 1.19 X * extract.c 1.70 X * diff.c 1.50 X EOF bei tcb_to_info() genauso behandeln wie bei get_tcb() X XWed Sep 3 01:17:54 2003 Joerg Schilling X * extract.c 1.69 X make_link() nun mit void_file() wegen CPIO Daten bei Hard links X XWed Sep 3 00:39:38 2003 Joerg Schilling X * buffer.c 1.90 X * starsubs.h 1.44 X peekblock() fuer CPIO neu X XTue Sep 2 21:17:07 2003 Joerg Schilling X * props.c 1.30 X Support fuer H_CPIO_CHR/H_CPIO_ASC/H_CPIO_ACRC X default: durch case H_UNDEF: ersetzt und neues default: mit Warnung X XTue Sep 2 21:12:50 2003 Joerg Schilling X * extract.c 1.68 X xt_file(): Erweiterung fuer nichtgeblockte CPIO Archive und fuer CPIO Padding X XTue Sep 2 21:00:26 2003 Joerg Schilling X * props.h 1.15 X Erweiterungen fuer CPIO: pr_hdrsize/pr_pad & PR_CPIO X XTue Sep 2 20:52:50 2003 Joerg Schilling X * diff.c 1.49 X Link count bei CPIO und nlink < 2 nicht mehr vergleichen X XTue Sep 2 16:04:33 2003 Joerg Schilling X * star.h 1.71 X Header Groessen fuer TAR & CPIO X XTue Sep 2 16:03:47 2003 Joerg Schilling X * starsubs.h 1.43 X * create.c 1.76 X read_link() -> EXPORT X XFri Aug 29 03:48:17 2003 Joerg Schilling X * star.c 1.161 X sparse diff in online help und man page X XThu Aug 28 22:07:13 2003 Joerg Schilling X * pax.c 1.7 X -p nutzt nun getpriv() von star -pax-p X XThu Aug 28 22:06:40 2003 Joerg Schilling X * star.c 1.160 X Neue Option -pax-p X XThu Aug 28 20:36:05 2003 Joerg Schilling X * star.c 1.159 X * list.c 1.49 X * match.c 1.4 X cstyle Ueberarbeitung X XThu Aug 28 20:18:23 2003 Joerg Schilling X * match.c 1.3 X -pax-c/-pax-n/-pax-d & prpatstats() neu X XThu Aug 28 20:17:16 2003 Joerg Schilling X * pax.c 1.6 X -c/-n freigeschaltet X XThu Aug 28 20:16:40 2003 Joerg Schilling X * star.c 1.158 X prpatstats() neu X -pax-n neu X XThu Aug 28 20:15:58 2003 Joerg Schilling X * starsubs.h 1.42 X prpatstats() neu X XThu Aug 28 16:44:10 2003 Joerg Schilling X * pax.c 1.5 X paxmatch neu X -d -> star -D X -o nun mit non-UNIX-98 Fehlermeldung X XThu Aug 28 16:42:29 2003 Joerg Schilling X * star.c 1.157 X paxmatch (-pax-match) neu X XThu Aug 28 16:40:44 2003 Joerg Schilling X * match.c 1.2 X patprefix()/issimple() & paxmatch neu X XThu Aug 28 12:51:43 2003 Joerg Schilling X * starsubs.h 1.41 X * pax.c 1.4 X * create.c 1.75 X * star.c 1.156 X pax -L && pax -H implementiert X XThu Aug 28 12:24:21 2003 Joerg Schilling X * create.c 1.74 X create() macht nun return; direkt nach gescheitertem getinfo() X XThu Aug 28 12:00:34 2003 Joerg Schilling X * pax.c 1.3 X * star.c 1.155 X getfilecount() nun mit 3. Parameter char *fmt X XThu Aug 28 02:04:20 2003 Joerg Schilling X * pax.c 1.2 X getfilecount fuer find ...| pax -w X XThu Aug 28 02:02:15 2003 Joerg Schilling X * star.c 1.154 X getfilecount() neu X swapflg = 0 bei -copy read Seite X copy_create() kann auch openlist() X docompat() checkt nun auf *tar* und verhindert so 'compat' fuer pax X XWed Aug 27 01:30:49 2003 Joerg Schilling X * pax.c 1.1 X date and time created 03/08/27 00:30:49 by joerg X XWed Aug 27 01:23:32 2003 Joerg Schilling X * star.c 1.153 X Neue Optionen -pax-ls -pax-i -pax-c -pax-L -pax-H X #if PAX .... fuer pax.c X XTue Aug 26 23:02:07 2003 Joerg Schilling X * list.c 1.48 X Umbau auf paxls und POSIX ls konforma Ausgabe X XTue Aug 26 21:41:51 2003 Joerg Schilling X * star_unix.c 1.57 X Neue Variable paxfollow (-pax-L) X XTue Aug 26 01:59:56 2003 Joerg Schilling X * list.c 1.47 X Umschaltung auf PAX Format X XTue Aug 26 00:54:28 2003 Joerg Schilling X * extract.c 1.67 X cstyle boolean continuation X XTue Aug 26 00:28:42 2003 Joerg Schilling X * subst.c 1.5 X pax_change() neu X XTue Aug 26 00:20:45 2003 Joerg Schilling X * star.h 1.70 X Interface type Definitionen neu X XSat Aug 23 21:32:05 2003 Joerg Schilling X * star.c 1.152 X YEAR, .... Definitionen -> star_unos.c X XFri Aug 22 11:29:20 2003 Joerg Schilling X * fifo.c 1.40 X Vorbereiting fuer CPIO (Reste am Ende des FIFOs < 512 Bytes werden vor den Anfang des FIFOs kopiert) X XFri Aug 22 02:03:28 2003 Joerg Schilling X * buffer.c 1.89 X new-volume-script wird nun mit naechster Volume Nummer und naechstem Archive Filenamen gerufen X XFri Aug 22 00:03:06 2003 Joerg Schilling X * star.c 1.151 X Version -> 1.5a21 X getwdir() nicht mehr machen mit -t X on_comerr(fifo_onexit()) wenn FIFO aktiv X Pattern im -copy Mode auf der Extrakt Seite deaktivieren X Abkuerzungen -ct und -c -diff X XThu Aug 21 23:53:30 2003 Joerg Schilling X * fifo.c 1.39 X Mindestens TBLOCK vor dem FIFO Platz schaffen X XThu Aug 21 19:39:56 2003 Joerg Schilling X * starsubs.h 1.40 X fifo_onexit() neu X XThu Aug 21 19:39:14 2003 Joerg Schilling X * fifo.c 1.38 X fifo_onexit() neu X fcntl(mp->gp[0], F_SETFD, 1) auf alle Pipe Fd's damit gzip nicht pipes offenhalten kann und EOF verhindert X XSat Aug 16 21:43:59 2003 Joerg Schilling X * star.c 1.150 X Version -> 1.5a20 X XSat Aug 16 21:14:45 2003 Joerg Schilling X * star.c 1.149 X -copy Option neu X -dirmode wird nicht mehr bei star -x -p impliziert X XSat Aug 16 21:05:28 2003 Joerg Schilling X * starsubs.h 1.39 X copy_create() neu X runfifo() nun mit ac, av Parametern X XSat Aug 16 21:04:43 2003 Joerg Schilling X * fifo.c 1.37 X -copy Option neu X Besserer Kommentar X prmp() printf() Formate korrigiert X Ausgabe der Flags be Sync Pipe Read Error X fifo_resume() ruft sputwakeup(mp, 'S') nur noch wenn nicht FIFO_MEOF gesetzt ist X XWed Aug 13 02:10:47 2003 Joerg Schilling X * buffer.c 1.88 X stats->parts += amount im -copy Modus X XTue Aug 12 10:58:36 2003 Joerg Schilling X * chdir.c 1.1 X date and time created 03/08/12 09:58:36 by joerg X XTue Aug 12 10:54:09 2003 Joerg Schilling X * star.c 1.148 X * starsubs.h 1.38 X chdir.c aus star.c ausgegliedert X XTue Aug 12 10:45:00 2003 Joerg Schilling X * match.c 1.1 X date and time created 03/08/12 09:45:00 by joerg X XTue Aug 12 10:44:56 2003 Joerg Schilling X * star.c 1.147 X * starsubs.h 1.37 X Pattern matching Code -> match.c X XTue Aug 12 01:22:50 2003 Joerg Schilling X * starsubs.h 1.36 X * star.c 1.146 X __malloc()/__realloc()/__savestr() -> mem.c X XWed Aug 6 23:40:35 2003 Joerg Schilling X * extract.c 1.66 X * create.c 1.73 X * list.c 1.46 X Substitute neu X XTue Aug 5 10:55:37 2003 Joerg Schilling X * star.c 1.145 X s=replstr Option neu X XTue Aug 5 10:50:33 2003 Joerg Schilling X * subst.c 1.4 X ia_change() kann nun mehr als 100 Zeichen fuer den neuen Filenamen X XTue Aug 5 10:47:30 2003 Joerg Schilling X * subst.c 1.3 X * header.c 1.76 X * starsubs.h 1.35 X ia_change() von header.c -> subst.c X XTue Aug 5 10:13:34 2003 Joerg Schilling X * subst.c 1.2 X * starsubs.h 1.34 X parsesubst() nun mit BOOL * als 2. Parameter X XTue Aug 5 02:18:54 2003 Joerg Schilling X * starsubs.h 1.33 X parsesubst()/subst() neu X XTue Aug 5 02:11:26 2003 Joerg Schilling X * subst.c 1.1 X date and time created 03/08/05 01:11:26 by joerg X XMon Jul 28 01:13:46 2003 Joerg Schilling X * extract.c 1.65 X same_file() neu und Test auf Gleichheit von Source/Destination bei hard links und Kopien X XSun Jul 27 21:02:37 2003 Joerg Schilling X * header.c 1.75 X CPIO Header Typen korrigiert X XSun Jul 27 21:01:09 2003 Joerg Schilling X * star.h 1.69 X * checkerr.h 1.5 X * buffer.c 1.87 X * checkerr.c 1.5 X E_SAMEFILE neu X XSun Jul 27 19:33:51 2003 Joerg Schilling X * xheader.c 1.19 X tcb_to_xhdr() ruft (*cp->x_func)() nun mit korrektem len Parameter X XSun Jul 27 14:50:24 2003 Joerg Schilling X * star.c 1.144 X Version -> 1.5a18 X Besserer Kommentar X -lowmem in die Online Help X XMon Jul 21 15:20:16 2003 Joerg Schilling X * extract.c 1.64 X * checkerr.h 1.4 X * checkerr.c 1.4 X * star.c 1.143 X * star.h 1.68 X * buffer.c 1.86 X Neue Option -secure-links X XFri Jul 18 16:33:13 2003 Joerg Schilling X * names.c 1.10 X * starsubs.h 1.32 X * star.c 1.142 X Version -> 1.5a17, nameinit() neu und damit UID_NOBODY/GID_NOBODY fuer unbekannte namen X XFri Jul 18 16:00:41 2003 Joerg Schilling X * buffer.c 1.85 X * checkerr.c 1.3 X * extract.c 1.63 X * star.h 1.67 X * star.c 1.141 X * checkerr.h 1.3 X Neue Option -.. und Files mit /../ werden normalerweise nicht mehr ausgepackt X XSun Jul 13 15:33:33 2003 Joerg Schilling X * defaults.c 1.3 X strsv() beseitigt X XSun Jun 22 01:46:46 2003 Joerg Schilling X * extract.c 1.62 X fflags zuruecksetzen und wieder setzen wenn hard link (wegen SF_IMMUTABLE) nicht angelegt werden kann X XSun Jun 22 01:16:36 2003 Joerg Schilling X * extract.c 1.61 X * acl_unix.c 1.17 X cstyle X XSun Jun 22 01:05:12 2003 Joerg Schilling X * fflags.c 1.7 X Korrekte Auswertung der Fehler fuer FreeBSD in set_fflags() X XSat Jun 21 15:40:12 2003 Joerg Schilling X * star.c 1.140 X Version -> 1.5a16 X XThu Jun 19 18:48:28 2003 Joerg Schilling X * star.c 1.139 X * create.c 1.72 X cstyle X XThu Jun 19 13:20:30 2003 Joerg Schilling X * create.c 1.71 X Keine Directory Namensliste mehr bei Mount Punkten und -M mit -dump X XWed Jun 18 01:14:49 2003 Joerg Schilling X * star.c 1.138 X Option -I beseitigt X XTue Jun 17 16:30:58 2003 Joerg Schilling X * create.c 1.70 X Neue Option level= X XTue Jun 17 16:16:21 2003 Joerg Schilling X * star.c 1.137 X Neue Optionen tardumps=name/-wtardumps X Bessere Behandlung des Exitcodes bei Fehlern X getenv() STAR_FIFO_SIZE -> STAR_FIFOSIZE X XTue Jun 17 16:11:33 2003 Joerg Schilling X * dumpdate.c 1.1 X date and time created 03/06/17 15:11:33 by joerg X XTue Jun 17 16:10:29 2003 Joerg Schilling X * dumpdate.h 1.2 X dumpdate()/checkdumpdates() neu X XMon Jun 16 18:36:57 2003 Joerg Schilling X * dumpdate.h 1.1 X date and time created 03/06/16 17:36:57 by joerg X XMon Jun 16 18:36:16 2003 Joerg Schilling X * starsubs.h 1.31 X __savestr() mit const char * X XSun Jun 15 16:49:45 2003 Joerg Schilling X * star.h 1.66 X Makros fuer cstyle angepasst X XSat Jun 14 22:03:43 2003 Joerg Schilling X * extract.c 1.60 X Setzen von O_DSYNC bei zu extrahierenden Files damit die Daten gleichmaesziger auf die Platte kommen X XSat Jun 14 15:48:36 2003 Joerg Schilling X * acl_unix.c 1.16 X Patch von A.Gruenbacher gegen mehrere #effective Kommentare X XThu Jun 12 14:59:02 2003 Joerg Schilling X * list.c 1.45 X * hole.c 1.32 X * star_unix.c 1.56 X * dirtime.h 1.2 X * xutimes.h 1.2 X * table.h 1.9 X * starsubs.h 1.30 X * diff.h 1.8 X * checkerr.h 1.2 X * fifo.h 1.10 X * star.h 1.65 X * props.h 1.14 X * movearch.h 1.2 X * header.c 1.74 X Umbau wegen cstyle X XThu Jun 12 14:58:22 2003 Joerg Schilling X * device.c 1.10 X * remove.c 1.46 X * props.c 1.29 X * names.c 1.9 X * fifo.c 1.36 X * movearch.c 1.29 X * lhash.c 1.11 X * fflags.c 1.6 X Copyright -> 2003 X XThu Jun 12 02:49:15 2003 Joerg Schilling X * longnames.c 1.36 X * fifo.c 1.35 X * props.c 1.28 X * lhash.c 1.10 X * table.c 1.17 X * remove.c 1.45 X * fflags.c 1.5 X * movearch.c 1.28 X * names.c 1.8 X * diff.c 1.48 X * defaults.c 1.2 X * dirtime.c 1.13 X * extract.c 1.59 X * checkerr.c 1.2 X * unicode.c 1.5 X * device.c 1.9 X * append.c 1.18 X * buffer.c 1.84 X Umbau wegen cstyle X XTue Jun 3 20:01:02 2003 Joerg Schilling X * star.c 1.136 X Optionen -no-fsync/level= neu X XTue Jun 3 19:59:58 2003 Joerg Schilling X * extract.c 1.58 X Option -no-fsync neu X XThu Apr 10 18:53:26 2003 Joerg Schilling X * star.c 1.135 X * starsubs.h 1.29 X defaults.c neu, -ldeflt neu, getnum EXPORT X XThu Apr 10 18:52:06 2003 Joerg Schilling X * defaults.c 1.1 X date and time created 03/04/10 17:52:06 by joerg X XThu Apr 10 15:19:57 2003 Joerg Schilling X * star.c 1.134 X Version -> 1.5a15 X Versuch, den Linux SSH/TCP-IP Bug zu umgehen bei dem die stderr verbose Ausgabe bei ssh host 'star -c ...' unterdrueckt wird X XSun Mar 9 13:47:33 2003 Joerg Schilling X * acl_unix.c 1.15 X Definitionen fuer SCO UnixWare neu X XSat Mar 8 18:09:58 2003 Joerg Schilling X * star_unix.c 1.55 X Umbau auf stat_ansecs(sp) Makro X XThu Mar 6 16:27:07 2003 Joerg Schilling X * acl_unix.c 1.14 X Bei Linux war beim errhidden() Aufruf eine schlieszenden Klammer zuviel X XSun Feb 23 23:42:21 2003 Joerg Schilling X * longnames.c 1.35 X * create.c 1.69 X * extract.c 1.57 X * hole.c 1.31 X * diff.c 1.47 X * dirtime.c 1.12 X * acl_unix.c 1.13 X * star_unix.c 1.54 X Umbau auf "checkerr.h" & errhidden() X XSun Feb 23 22:52:42 2003 Joerg Schilling X * star.c 1.133 X Version -> 1.5a13, Neue Option errctl= X XWed Feb 19 00:28:35 2003 Joerg Schilling X * checkerr.c 1.1 X date and time created 03/02/19 00:28:35 by joerg X XWed Feb 19 00:13:13 2003 Joerg Schilling X * checkerr.h 1.1 X date and time created 03/02/19 00:13:13 by joerg X XFri Feb 7 11:26:49 2003 Joerg Schilling X * star.c 1.132 X star -n -tpath ist nicht mehr automatisch Verbose X XSun Feb 2 16:17:29 2003 Joerg Schilling X * buffer.c 1.83 X USE_REMOTE Test Code an librmt angepasst X XSat Feb 1 20:50:15 2003 Joerg Schilling X * star.c 1.131 X Version -> 1.5a12, docompat() ueberprueft nun ob die notwendigen Argumente fuer Optionen auch vorhanden sind X XSat Feb 1 20:46:29 2003 Joerg Schilling X * xheader.c 1.18 X gen_text() verschiebt nun den Unicode text (der laenger ist) mit neuer und nicht mit alter Laenge X in get_size() reale Filesize setzen wenn noch nicht aus extended header bekannt ist damit auch non sparse files > 8 GB gehen X XSat Feb 1 20:32:40 2003 Joerg Schilling X * header.c 1.73 X Alte info->f_rsize Behandlung (bevor switch kam) geloescht X XSat Feb 1 19:50:02 2003 Joerg Schilling X * diff.c 1.46 X Bei directory diff (ext. POSIX.1-2002) eins auf Filenamen bei der Ausgabe addieren damit nich ^Aname kommt X XSun Jan 26 19:17:16 2003 Joerg Schilling X * star.c 1.130 X Version -> 1.5a11, Neue Optionen: xdebug= & -no-xheader X XSun Jan 26 19:05:31 2003 Joerg Schilling X * extract.c 1.56 X * list.c 1.44 X Neue Option xdebug=# fuer dump_info() X XSun Jan 26 19:04:51 2003 Joerg Schilling X * xheader.c 1.17 X Neue Option -no-xheader um evt. defekte Header zu ignorieren X XSun Jan 26 17:51:35 2003 Joerg Schilling X * header.c 1.72 X Mehr kommentar fuer tar formatspezifische Wandlerfunktionen X XSun Jan 26 17:44:55 2003 Joerg Schilling X * header.c 1.71 X Bugfix fuer -dump EXUSTAR sparse files > 8 GB mit neuem Flag XF_REALSIZE und SCHILY.realsize, dump_info() neu X XSun Jan 26 17:37:28 2003 Joerg Schilling X * xheader.c 1.16 X Neue Funktion get_realsize() fuer info->f_size, "size" setzt nun korrekt info->f_rsize, get_size() setzt info->f_rsize X XSun Jan 26 17:19:47 2003 Joerg Schilling X * star.h 1.64 X Neues Flag XF_REALSIZE X XSun Jan 26 17:15:38 2003 Joerg Schilling X * starsubs.h 1.28 X Neue Funktion dump_info() X XSun Jan 26 17:15:04 2003 Joerg Schilling X * hole.c 1.30 X info->f_xflags &= ~XF_SIZE zuruecksetzen bei Sparse Files - spaeteres info_to_tcb() setzt es evt. wieder X XTue Jan 21 19:01:27 2003 Joerg Schilling X * acl_unix.c 1.12 X Reparatur von defelten ACL Eintraegen im Archiv die vor der Erweiterung fuer Leerzeichen erzeugt wurden X XTue Jan 21 19:00:20 2003 Joerg Schilling X * acl_unix.c 1.11 X Support fuer Usernamen die Leerzeichen enthalten X XTue Dec 17 01:05:10 2002 Joerg Schilling X * star.c 1.129 X Version -> 1.5a10 X XTue Dec 17 00:52:23 2002 Joerg Schilling X * diff.c 1.45 X Fix fuer Coredump bei star -diff -vv -dump und unlesbarer lokaler directory X XThu Nov 14 15:47:09 2002 Joerg Schilling X * extract.c 1.55 X create_dirs() repariert: return(FALSE) bei vorhandener Direktory war falsch X make_dir() returniert fruehzeitig wenn Dir bereits existiert X XThu Nov 14 15:23:34 2002 Joerg Schilling X * acl_unix.c 1.10 X Patch von Andreas Gruenbacher wegen #effective: Kommentar Problemen bei Linux X XMon Nov 11 19:39:58 2002 Joerg Schilling X * buffer.c 1.82 X rmthostname(host, rmtspec, sizeof(host)) -> rmthostname(host, sizeof(host), rmtspec) X XSun Nov 10 20:56:47 2002 Joerg Schilling X * star.c 1.128 X Version -> 1.5a09a, signal(SIGINFO neu fuer *BSD X XSat Nov 9 05:32:55 2002 Joerg Schilling X * buffer.c 1.81 X rmtgetconn() nun mit 3. Parameter (default exit code) X XMon Nov 4 18:12:01 2002 Joerg Schilling X * fifo.c 1.34 X close(f) fuer /dev/zero nur dann wenn /dev/zero auch geoeffnet nurde X XMon Oct 21 19:06:15 2002 Joerg Schilling X * star.c 1.127 X Schreibfehler efective -> effective uid X XMon Sep 16 17:59:37 2002 Joerg Schilling X * extract.c 1.54 X Ueberarbeitung von create_dirs() mit neuer Funktion _create_dirs() damit alle Faelle behandelt werden X war noetig weil extract von /opt/schily/include/*.h zu Endlosschleife fuehrte weil /opt/schily/ root (d.h. readonly) war X XMon Sep 2 15:58:44 2002 Joerg Schilling X * create.c 1.68 X Fehlerhafte Ueberpruefung eines lseek() Return Wertes in _fileread() korrigiert. X XMon Sep 2 15:57:35 2002 Joerg Schilling X * extract.c 1.53 X create_dirs() Problem mit getinfo(name, &dinfo) && !is_dir(&dinfo) beseitigt X XMon Aug 26 15:38:38 2002 Joerg Schilling X * buffer.c 1.80 X Umbau auf librmt X XFri Aug 16 02:22:30 2002 Joerg Schilling X * star_unix.c 1.53 X symlink() Permission fuer HP-UX mit umask() realisieren X XFri Aug 16 02:21:56 2002 Joerg Schilling X * diff.c 1.44 X Ausgabe der dir inhalt Anzahl mit debug oder -vvv X XFri Aug 9 21:06:45 2002 Joerg Schilling X * fifo.c 1.33 X fifo_errno() ist nun sicher gegen mp == NULL X XFri Aug 9 12:43:33 2002 Joerg Schilling X * star.c 1.126 X Version -> 1.5a06, exit(fifo_errno()); neu, commaands Schreibfehler beseitigt X XFri Aug 9 01:31:06 2002 Joerg Schilling X * buffer.c 1.79 X -wready wartet nun 120 Sekunden X XThu Aug 8 20:18:04 2002 Joerg Schilling X * buffer.c 1.78 X * starsubs.h 1.27 X * fifo.h 1.9 X * fifo.c 1.32 X fifo_errno() neu damit Bandschreibfehler mit FIFO auch den Exit Code von Star im Vordergrund veraendern X XTue Aug 6 00:45:53 2002 Joerg Schilling X * buffer.c 1.77 X Bei -wready auch auch EBUSY testen X XWed Jul 10 23:54:47 2002 Joerg Schilling X * diff.c 1.43 X Directory diff namesliste nun korrekt wenn eine der Directory Listen laenger ist X XWed Jul 10 22:28:48 2002 Joerg Schilling X * buffer.c 1.76 X Vor Aufruf des -newvol-script's fflush(vpr) rufen damit Synchronitaet der Ausgaben existiert X XWed Jul 10 22:24:50 2002 Joerg Schilling X * star.c 1.125 X Version -> 1.5a05, /dev/tty nicht oeffnen wenn -newvol-script verwendet wurde X XWed Jun 19 20:34:50 2002 Joerg Schilling X * header.c 1.70 X Fix fuer t_prefix mit genau 155 Zeichen X XWed Jun 19 20:29:02 2002 Joerg Schilling X * tartest.c 1.3 X name/prefix -> prefix/name Bugfix X XTue Jun 18 11:42:55 2002 Joerg Schilling X * tartest.c 1.2 X Option -v neu, Signed Checksum Test, Gesamtbewertung (gut/schlecht) nun OK X XMon Jun 17 19:40:41 2002 jes X * header.c 1.69 X t_size Feld auf null setzen, wenn size > MAXOCTAL11 und Archive Format kein Base 256 kann X info_to_ustar() setzt nicht mehr info->f_rdevminor auf 0 fuer non devices weil das bereits in getinfo() passiert X XMon Jun 17 19:32:18 2002 jes X * props.c 1.27 X * props.h 1.13 X PR_BASE256 neu X XMon Jun 17 19:31:16 2002 Joerg Schilling X * star.c 1.124 X Version -> 1.5a03, Usage() mit get_progname() statt "star", addtarfile() kann nun star -cf - verstehen, diffopts=nlink ist nun erlaubt X XMon Jun 17 19:21:38 2002 Joerg Schilling X * tartest.c 1.1 X date and time created 02/06/17 18:21:38 by joerg X XFri Jun 14 21:01:52 2002 Joerg Schilling X * acl_unix.c 1.9 X Fix fuer fehlendes Komma nact Patch vom 8.3.2002 von Andreas Gruenbacher X XMon Jun 10 19:06:45 2002 Joerg Schilling X * diff.c 1.42 X diffopts=nlink aktiviert, diffopts=dir neu X XMon Jun 10 19:04:11 2002 Joerg Schilling X * create.c 1.67 X Test auf HAVE_READLINK in read_symlink() wegen OS/2 EMX X Neue Option -lowmem X put_dir() verwendet nun fetchdir() als Default anstelle von readdir() X Abbruch der Directory Schleife in put_dir() wenn telldir()/seekdir() nicht funktionieren X XMon Jun 10 18:59:27 2002 Joerg Schilling X * xheader.c 1.15 X Callback Funktion fuer tcb_to_xhdr() nun mit len Parameter X SCHILY.dir, SCHILY.ddev, SCHILY.dino neu, SCHILY.ddev/SCHILY.dino als Dummy fuer spaeter X gen_text() nun mit alen Parameter damit im Argument null Bytes sein koennen X gen_text() nun mit movebytes() damit im Argument null Bytes sin koennen X Neue Funktion get_dir() X XMon Jun 10 17:58:50 2002 Joerg Schilling X * list.c 1.43 X Long Listing gibt nun auch Linkcount aus falls bekannt X XMon Jun 10 17:57:55 2002 Joerg Schilling X * buffer.c 1.75 X setmode(fileno(tarf), O_BINARY); auch fuer die TAR Seite der compress PIPE. X XMon Jun 10 17:55:31 2002 Joerg Schilling X * unicode.c 1.4 X to_utf8l()/from_utf8l() neu X XMon Jun 10 17:54:28 2002 Joerg Schilling X * star.c 1.123 X Version -> 1.5a02, -lowmem neu, diffopts=dir neu X XMon Jun 10 17:52:12 2002 Joerg Schilling X * header.c 1.68 X tcb_to_info() initialisiert nun auch info->f_nlink und info->f_dir X XMon Jun 10 17:48:39 2002 Joerg Schilling X * diff.h 1.7 X D_DIR neu D_DEFLT nun inclusive D_NLINK X XMon Jun 10 17:47:49 2002 Joerg Schilling X * starsubs.h 1.26 X #include , Benutzung nun auch ohne star.h moeglich, unicode.c:to_utf8l()/from_utf8l() neu, fetchdir.c neu X XSun Jun 9 01:54:29 2002 Joerg Schilling X * star.h 1.63 X f_dir/f_dirlen neu X XSun Jun 9 01:51:23 2002 Joerg Schilling X * star_unix.c 1.52 X info->f_dir = NULL bei Directories, HAVE_CHOWN/HAVE_SYMLINK testen (OS/2) X XSun Jun 9 00:27:42 2002 Joerg Schilling X * buffer.c 1.74 X setmode() auch fuer OS/2 EMX X XSun Jun 9 00:26:40 2002 Joerg Schilling X * fifo.c 1.31 X DosGetSharedMem(buf,3); bei OS/2 vor erstem Zugriff auf shared memory sleep() fuer OS/2 beseititg X XSat Jun 8 14:00:54 2002 Joerg Schilling X * fifo.c 1.30 X -lowmem neu -> FIFO Size default 1 MB X XSun Jun 2 16:23:34 2002 Joerg Schilling X * create.c 1.66 X put_dir() neu eingerueckt (return wenn opendir() scheitert) X XSun Jun 2 15:42:07 2002 Joerg Schilling X * xheader.c 1.14 X xtab_t mit x_namelen fuer schnelleres lookup() X len_len() neu fuer beliebig lange strings im xheader X gen_text() vermeidet Kopieren und kann beliebig lange Strings X XSun Jun 2 15:28:48 2002 Joerg Schilling X * unicode.c 1.3 X * starsubs.h 1.25 X to_utf8() Returniert nun UTF-8 strlen() X XSat Jun 1 14:46:26 2002 Joerg Schilling X * list.c 1.42 X modstr() besser kommentiert X XTue May 28 19:37:47 2002 Joerg Schilling X * xheader.c 1.13 X xbgrow(): realloc() waechst nun mit pagesize() X gen_xtime()/gen_number() nun ohne sprintf() und daher 2x so schnell X X*************** Release 1.4 ******************* X XMon May 20 15:59:34 2002 Joerg Schilling X * buffer.c 1.73 X Cast pointerdiffs to Llong for 64 bit X XMon May 20 15:58:54 2002 Joerg Schilling X * dirtime.c 1.11 X Cast pointerdiff to int and warn for 64 bit X XMon May 20 15:58:05 2002 Joerg Schilling X * remote.c 1.39 X Avoid Integeroverflow with %.* for Pointerdiffs X XMon May 20 12:48:32 2002 Joerg Schilling X * starsubs.h 1.24 X hash_build() with size_t size Parameter X XFri May 17 13:26:28 2002 Joerg Schilling X * xheader.c 1.12 X * starsubs.h 1.23 X * star.c 1.122 X * lhash.c 1.9 X * diff.c 1.41 X * create.c 1.65 X * buffer.c 1.72 X * append.c 1.17 X __malloc() with msg Parameter X __realloc() new X malloc()/realloc() -> __malloc()/__realloc() if using commerr() X XTue May 14 21:37:38 2002 Joerg Schilling X * star.c 1.121 X Version -> 1.4 X XMon May 13 20:50:25 2002 Joerg Schilling X * buffer.c 1.71 X -silent allows to switch off compress warning, Cast pointerdiff -> int for printf X XMon May 13 20:49:22 2002 Joerg Schilling X * remote.c 1.38 X Cast pointerdiff -> int for sprintf X XSat May 11 19:24:47 2002 Joerg Schilling X * hole.c 1.29 X With Solaris ioctl _FIOAI now avoid Problemems if off+amt < 0 or off+amt > size X XSat May 11 19:19:09 2002 Joerg Schilling X * create.c 1.64 X _fileread() now avoids Problemes if off+amt < 0 or off+amt > size X XSat May 11 19:12:48 2002 Joerg Schilling X * star.h 1.62 X tarblocks() Macro now without off_t Overflow X XFri May 10 12:46:15 2002 Joerg Schilling X * create.c 1.63 X -silent/-meta new, better Check for is_tape() for Mac OS X X XFri May 10 12:27:59 2002 Joerg Schilling X * header.c 1.67 X Support for XT_META, _GTTOXT() -> _VTTOXT() X XFri May 10 00:44:12 2002 Joerg Schilling X * longnames.c 1.34 X Use Vendor Unique Longnames if F_LONGNAME/F_LONGLINK is set, to make META Files work X XThu May 9 17:40:52 2002 Joerg Schilling X * props.c 1.26 X Meta Files new, better comment X XThu May 9 17:35:17 2002 Joerg Schilling X * star.1 1.47 X Warning for meta files X XThu May 9 17:34:21 2002 Joerg Schilling X * star.c 1.120 X New Options -silent/-meta, Version -> 1.4a25 X XThu May 9 17:33:19 2002 Joerg Schilling X * table.c 1.16 X Integrate Sparse/Meta Filetypes like regular Files X XThu May 9 17:25:25 2002 Joerg Schilling X * table.h 1.8 X * table.c 1.15 X gttoxt_tab -> vttoxt_tab X XThu May 9 17:15:41 2002 Joerg Schilling X * table.c 1.14 X META Filetyp new X XSun May 5 17:09:09 2002 Joerg Schilling X * star.1 1.46 X New Option -silent X XSun May 5 17:06:53 2002 Joerg Schilling X * diff.c 1.40 X Also compare Filetyp if it is in POSIX.1-2001 header, Do not compare file content with XT_META X XSun May 5 17:00:17 2002 Joerg Schilling X * list.c 1.41 X It seems to be better to hava a special treatment for XT_META to make the listing print 'm' as Filetype to know that file content is not in the archive. X XSun May 5 16:54:51 2002 Joerg Schilling X * table.h 1.7 X XT_META new X XSun May 5 16:51:03 2002 Joerg Schilling X * star.h 1.61 X LF_EXTATT/LF_META new, fis_link()/fis_meta() is_whiteout()/is_meta() new X XThu May 2 23:23:21 2002 Joerg Schilling X * list.c 1.40 X XT_META getst same treatment as XT_LINK: if we knoe the real file type use it X XThu May 2 23:04:01 2002 Joerg Schilling X * star.1 1.45 X -dump / -meta documented X XThu May 2 23:02:40 2002 Joerg Schilling X * extract.c 1.52 X Meta File Type implemented X XThu May 2 22:24:21 2002 Joerg Schilling X * header.c 1.66 X New Warnung for GNUtar bug (Volheader) mode field is complertely nulled X XMon Apr 29 22:12:32 2002 Joerg Schilling X * xheader.c 1.11 X "SCHILY.tarfiletype" will not be used for now X XMon Apr 29 22:10:54 2002 Joerg Schilling X * header.c 1.65 X Use f_xftype from xheader except when it is XT_LINK X XMon Apr 29 22:06:28 2002 Joerg Schilling X * extract.c 1.51 X DOOR Files will be recognised and unpacked as Plain Files X XMon Apr 29 22:02:55 2002 Joerg Schilling X * hole.c 1.28 X info->f_xftype = XT_SPARSE; -> info->f_rxftype = info->f_xftype = XT_SPARSE; because XT_PARSE is own Filetyp X XMon Apr 29 22:01:21 2002 Joerg Schilling X * table.c 1.13 X exustar List (-dump) now with XT_DOOR X XMon Apr 29 21:59:44 2002 Joerg Schilling X * props.c 1.25 X Extended list of valid filetypes only with -dump X XMon Apr 29 21:54:34 2002 Joerg Schilling X * star.h 1.60 X is_door() new X XSun Apr 28 17:57:26 2002 Joerg Schilling X * list.c 1.39 X Only suppress File Type Hard Link with verbose printing, other Types are from f_xftype X XSun Apr 28 15:36:48 2002 Joerg Schilling X * star.c 1.118 X Version -> 1.4a24, -link-dirs/-dump new in usage() X XSun Apr 28 15:15:00 2002 Joerg Schilling X * hole.c 1.27 X * extract.c 1.50 X * header.c 1.64 X * star.c 1.117 X Warning: -> WARNING: X XSun Apr 28 02:06:57 2002 Joerg Schilling X * header.c 1.63 X * xheader.c 1.10 X New SCHILY.* xheader Types: SCHILY.dev/SCHILY.ino/SCHILY.nlink/SCHILY.filetype/SCHILY.tarfiletype X XSun Apr 28 01:09:52 2002 Joerg Schilling X * table.c 1.12 X * table.h 1.6 X BSD whiteout XT_WHT new, Solaris cpio acl corrected, xtexustar_tab[] new X XSun Apr 28 01:07:06 2002 Joerg Schilling X * props.c 1.24 X Enhanced List erlaubterof possible File Types for H_EXUSTAR X XSun Apr 28 01:05:13 2002 Joerg Schilling X * list.c 1.38 X Directory Hardlinks new, FileType printout using info->f_rxftype instead of info->f_xftype X XSun Apr 28 00:29:03 2002 Joerg Schilling X * star.c 1.116 X Experimental chdrtype = H_EXUSTAR for -dump X XSun Apr 28 00:25:53 2002 Joerg Schilling X * star_unos.c 1.23 X * star_unix.c 1.51 X info->f_typeflag= 0 new, info->f_rxftype = info->f_xftype new, BSD whiteout File S_IFWHT new X XSat Apr 27 21:39:07 2002 Joerg Schilling X * star.h 1.58 X f_rxftype new X XSat Apr 27 18:10:00 2002 Joerg Schilling X * create.c 1.61 X -link-dirs implemented X XSat Apr 27 18:07:24 2002 Joerg Schilling X * star.1 1.43 X -link-dirs new, -sparse Documentation extended X XThu Apr 25 01:28:52 2002 Joerg Schilling X * extract.c 1.49 X Take care of EISDIR ro remove non-empty Directories X XThu Apr 25 01:09:49 2002 Joerg Schilling X * remove.c 1.44 X Implement first version of recursive remove X XWed Apr 24 21:41:17 2002 Joerg Schilling X * table.c 1.11 X Better comment X XWed Apr 24 01:35:55 2002 Joerg Schilling X * create.c 1.60 X Printout enhanced for 'file changed size' (increased/shrunk) X XWed Apr 24 00:57:43 2002 Joerg Schilling X * star.c 1.115 X Version -> 1.4a23, verbose -> int, Support for -vv, -link-dirs new, -dump new X XWed Apr 24 00:42:33 2002 Joerg Schilling X * header.c 1.62 X * diff.c 1.39 X verbose -> int for -vv X XWed Apr 24 00:40:49 2002 Joerg Schilling X * list.c 1.37 X Support for -vv in create mode X XWed Apr 24 00:35:10 2002 Joerg Schilling X * props.c 1.23 X More comment X XWed Apr 24 00:29:34 2002 Joerg Schilling X * star.1 1.42 X Many - to \-, -v is inc type X XTue Apr 23 22:49:47 2002 Joerg Schilling X * hole.c 1.26 X Problem with virtual growing sparse Files fixed X XSat Apr 20 22:13:44 2002 Joerg Schilling X * acl_unix.c 1.8 X * extract.c 1.48 X * remote.c 1.37 X * star_unix.c 1.50 X * create.c 1.59 X Now using geterrno()/seterrno() X XFri Apr 19 23:46:54 2002 Joerg Schilling X * star_unos.c 1.22 X * star_unix.c 1.49 X set st_rdev to 0 for plain Files, dirs, ... X XSun Apr 14 16:29:59 2002 Joerg Schilling X * star.c 1.114 X Version -> 1.4a22 X XSun Apr 14 16:24:11 2002 Joerg Schilling X * star.c 1.113 X -z/-bz before b= in option string X XSun Apr 14 16:22:29 2002 Joerg Schilling X * create.c 1.58 X maxsize now is byte oriented X XWed Mar 27 00:23:13 2002 Joerg Schilling X * star.1 1.41 X * buffer.c 1.70 X * star.c 1.112 X new-volume-script= Option new X XTue Mar 26 23:55:59 2002 Joerg Schilling X * star.1 1.40 X * buffer.c 1.69 X * star.c 1.111 X f= Option now allows up to 100 Files X XSun Mar 24 13:04:29 2002 Joerg Schilling X * star.c 1.110 X Version -> 1.4a21, Short Usage corrected X XFri Mar 8 01:26:08 2002 Joerg Schilling X * acl_unix.c 1.7 X Patch from Andreas Gruenbacher for buffer conversions error with 4 ACL entries X XFri Mar 1 21:26:39 2002 Joerg Schilling X * star.c 1.109 X Version -> 1.4a19 X XFri Mar 1 21:25:09 2002 Joerg Schilling X * hole.c 1.25 X cmpbytes() -> cmpnullbytes(), read 32kB instead of 512 Bytes to increase speed X XTue Feb 26 22:47:23 2002 Joerg Schilling X * longnames.c 1.33 X copy 100 Char Linknames before filenames because there may be a return X copy 100 Char Linknames only if not case 'K' or 'x' longlink active X XSun Feb 24 21:12:59 2002 Joerg Schilling X * star.h 1.57 X t_mode Definitions T* new X XSun Feb 24 21:08:47 2002 Joerg Schilling X * star_unix.c 1.48 X HAVE_POSIX_MODE_BITS Test Code deactivated (now again standard UNIX Mode) X XSun Feb 24 21:06:51 2002 Joerg Schilling X * star_unix.c 1.47 X POSIX TAR <-> OS Mode bit convertion new X XSun Feb 24 12:37:34 2002 Joerg Schilling X * star.c 1.108 X Version -> 1.4a18, Copyright -> 2002 X XTue Feb 19 10:31:01 2002 Joerg Schilling X * header.c 1.61 X Uverflow check for octal string generation by checking fieldw X XMon Feb 11 22:42:14 2002 Joerg Schilling X * extract.c 1.47 X newer label -> isnewer for K&R C X XSun Feb 10 20:48:04 2002 Joerg Schilling X * extract.c 1.46 X Loop around fsync() and test for EINVAL/EINTR X XSat Jan 19 17:57:10 2002 Joerg Schilling X * fflags.c 1.4 X True64 has chflags() but no #define UF_SETTABLE X XMon Jan 14 21:59:03 2002 Joerg Schilling X * star_unix.c 1.46 X * Makefile 1.20 X * xheader.c 1.9 X * header.c 1.60 X * star.c 1.107 X * starsubs.h 1.22 X Support for extended file flags new X XMon Jan 14 21:51:27 2002 Joerg Schilling X * star.1 1.39 X -xfflags Option new, Documenting problems with -fxxx & -fifo X XMon Jan 14 21:31:42 2002 Joerg Schilling X * fflags.c 1.3 X If setting of all flags does not work, try if it works witout the ohne root only flags X XSun Jan 13 23:13:20 2002 Joerg Schilling X * header.c 1.59 X Correctly Masking uid/gid for otar/ustar X XSun Jan 13 19:26:07 2002 Joerg Schilling X * fflags.c 1.2 X first working Version X XWed Jan 9 11:27:30 2002 Joerg Schilling X * fflags.c 1.1 X date and time created 02/01/09 11:27:30 by joerg X XSun Jan 6 20:09:36 2002 Joerg Schilling X * star.c 1.106 X Version -> 1.4a16, gnutar comment enhanced X XSun Jan 6 19:40:36 2002 Joerg Schilling X * star.1 1.38 X Optionstexts reworked. X XSun Jan 6 00:13:30 2002 Joerg Schilling X * star.1 1.37 X -S ... -z alphabetically towards the front X XSun Jan 6 00:00:50 2002 Joerg Schilling X * star.1 1.36 X -i ... -remove-recursive alphabetically towards the front X XSat Jan 5 12:47:00 2002 Joerg Schilling X * star.1 1.35 X -block-numer -copylinks -ctime -D -d ... H= alphabetically towards the front X XThu Jan 3 21:46:47 2002 Joerg Schilling X * star.1 1.34 X -/ -atime -acl -ask_remove -B -bz -C alphabetically towards the front X XTue Jan 1 23:43:42 2002 Joerg Schilling X * star.c 1.105 X Version -> 1.4a15 X XTue Jan 1 21:19:39 2002 Joerg Schilling X * star.1 1.33 X EXAMPLES/FILES/SEE ALSO/DIAGNOSTICS/NOTES/LIMITATIONS/BUGS reworked X XTue Jan 1 20:19:51 2002 Joerg Schilling X * fifo.c 1.29 X * buffer.c 1.68 X * star.c 1.104 X * header.c 1.58 X Now using exprstats() and calling checkerrs() in exprstats() X XTue Jan 1 20:08:47 2002 Joerg Schilling X * header.c 1.57 X Now implementing POSIX conformant usage of the Size Field X XFri Dec 28 13:44:05 2001 Joerg Schilling X * star.1 1.32 X Hinr for multi volume support in tsize= X XFri Dec 28 01:49:16 2001 Joerg Schilling X * star.c 1.103 X blocks= & b= now supports mutiplyers (like bs= ) X XFri Dec 28 01:41:59 2001 Joerg Schilling X * star.1 1.31 X blocks= Option now also mentions POSIX limits, bs= directly after blocks= Doc X XFri Dec 28 00:23:47 2001 Joerg Schilling X * star.1 1.30 X Man Page inclusive command description reworked, -dirmode new, H=headertype reworked X XThu Dec 27 23:13:30 2001 Joerg Schilling X * buffer.c 1.67 X Komment for O_BINARY and O_TRUNC X XThu Dec 27 19:23:52 2001 Joerg Schilling X * star.c 1.102 X Version -> 1.4a14, -p -> -p/-dirmode, If av[0] == tar -> xustar Format X XThu Dec 27 19:14:13 2001 Joerg Schilling X * star_unos.c 1.21 X * star_unix.c 1.45 X dirmode -> pflag (in extract mode) to allow -p to be separated from -dirmode X XWed Dec 19 23:51:30 2001 Joerg Schilling X * fifo.c 1.28 X * star.c 1.101 X fifo_exit() enhanced so that FIFO backgroundprocess may be shut down (TAR File is much longer than it should be logically: star hangs at end) X XTue Dec 18 23:54:15 2001 Joerg Schilling X * longnames.c 1.32 X * header.c 1.56 X Supporting Linknames with exactly 100 chars X XMon Dec 17 23:52:56 2001 Joerg Schilling X * star.1 1.29 X Hint for unsupported ACLs removed X XSun Dec 16 17:34:17 2001 Joerg Schilling X * star.1 1.28 X * star_unix.c 1.44 X New Option -acl X XSun Dec 16 16:39:14 2001 Joerg Schilling X * star.c 1.100 X Version -> 1.4a13, New Option -acl, Preparing for better TAR compatibility (e.g. -l Option) X XSun Dec 16 16:16:11 2001 Joerg Schilling X * header.c 1.55 X POSIX.1-200x -> POSIX.1-2001, f_offset -> f_contoffset because of SCO OpenServer Makro in file.h X XSun Dec 16 16:11:09 2001 Joerg Schilling X * star.1 1.27 X * fifo.c 1.27 X Reducing default FIFO Size to 4MB on Linux only if mmap() is not present X XSun Dec 16 16:10:24 2001 Joerg Schilling X * create.c 1.57 X Hardlinks bekommen size == 0 wie in POSIX-1003.1-1990 verlangt X XSun Dec 9 17:19:10 2001 Joerg Schilling X * xheader.c 1.8 X POSIX.1-200x -> POSIX.1-2001 X XSun Dec 9 17:10:45 2001 Joerg Schilling X * extract.c 1.45 X option -block-number now also works extract mode X XFri Dec 7 21:30:37 2001 Joerg Schilling X * movearch.c 1.27 X * longnames.c 1.31 X * star.h 1.56 X * star.c 1.99 X * props.h 1.12 X * star.1 1.26 X * props.c 1.22 X POSIX.1-200x -> POSIX.1-2001 X XWed Dec 5 23:03:20 2001 Joerg Schilling X * star_unix.c 1.43 X File flags (-nodump) Support for Linux new X XWed Dec 5 20:50:27 2001 Joerg Schilling X * extract.c 1.44 X Better comment for copy_file in do_symlink, emul_link()/emul_symlink() started X XWed Dec 5 20:47:28 2001 Joerg Schilling X * star.h 1.55 X New Flag XF_FFLAGS X XWed Dec 5 20:46:35 2001 Joerg Schilling X * star.1 1.25 X New Options -nodump/-hardlinks/-symlinks, extension for bs=, New properties of tsize=/maxsize= X XWed Dec 5 20:40:03 2001 Joerg Schilling X * star.c 1.98 X New short Usage Funktion susage() X getnum() now using Llong X getnum() now understands '.' as 1x Mult X New Functions getbnum()/getknum() X -tsize/maxsize= now with getbnum()/getknum() with default to old behavior X XWed Dec 5 20:26:02 2001 Joerg Schilling X * star.c 1.97 X Version -> 1.4a11, new Optionen -nodump/-hardlinks/-symlinks, Usage now also with -version/-debug/-refresh X XMon Dec 3 19:28:43 2001 Joerg Schilling X * list.c 1.36 X * star.h 1.53 X f_offset -> f_contoffset because of SCO OpenServer Macro in file.h X XMon Dec 3 19:27:29 2001 Joerg Schilling X * star.h 1.54 X * create.c 1.56 X -nodump / F_NODUMP new X XMon Dec 3 19:24:14 2001 Joerg Schilling X * acl_unix.c 1.6 X #ifdef ENOSYS new, if removing ACL and POSIX ACLs xstats.s_setacl++ instead of xstats.s_badacl++ X XSat Dec 1 22:09:49 2001 Joerg Schilling X * star_unos.c 1.20 X * star_unix.c 1.42 X * star.h 1.52 X File flags for BSD-4.4 Support new in finfo X XWed Nov 28 23:39:53 2001 Joerg Schilling X * extract.c 1.43 X Better error messages for links X XWed Nov 28 16:14:49 2001 Joerg Schilling X * star_unix.c 1.41 X HAVE_SETTIMEOFDAY for BeOS and #define utimes __nothing__ because of defect BeOS Prototyp X XSun Nov 25 17:41:30 2001 Joerg Schilling X * acl_unix.c 1.5 X Try to handle ENOTSUP on Linux if the FS does not support ACLs X XSun Nov 25 17:17:05 2001 Joerg Schilling X * star.1 1.24 X * buffer.c 1.66 X * star.c 1.96 X * list.c 1.35 X * create.c 1.55 X New Option -block-number X XSun Nov 25 17:00:50 2001 Joerg Schilling X * star.1 1.23 X ACLs documented, New bs= Multiplyer 'g' X XSun Nov 25 15:47:51 2001 Joerg Schilling X * diff.c 1.38 X Volhdr may not be diff'ed X XSun Nov 11 22:12:33 2001 Joerg Schilling X * acl_unix.c 1.4 X Symlinks have no ACLs on Solaris or POSIX X XSun Nov 11 18:02:13 2001 Joerg Schilling X * buffer.c 1.65 X * remote.c 1.36 X Test HAVE_RCMD new X XThu Nov 8 16:33:58 2001 Joerg Schilling X * acl_unix.c 1.3 X Better error messages, base_acl() also for Solaris, default ACL Problem for FreeBSD removed X XThu Nov 8 11:56:25 2001 Joerg Schilling X * star_unix.c 1.40 X * acl_unix.c 1.2 X HAVE_ACL (always) -> HAVE_ANY_ACL because of Clash with Sun acl() X XThu Nov 8 11:55:28 2001 Joerg Schilling X * star.h 1.51 X #undef isdigit for HP-UX X XThu Nov 8 00:06:56 2001 Joerg Schilling X * star.c 1.95 X Version -> 1.4a07 X XWed Nov 7 23:21:15 2001 Joerg Schilling X * acl_unix.c 1.1 X date and time created 01/11/07 23:21:15 by joerg X XWed Nov 7 20:14:53 2001 Joerg Schilling X * star_unix.c 1.39 X Enhancements for ACLs, Cast to int for st_rdev in switch for S_IFNAM because of compiler Warnung, X NEW_P_FLAG prepared X XWed Nov 7 20:10:21 2001 Joerg Schilling X * xheader.c 1.7 X Enhancements for ACLs X XWed Nov 7 20:05:38 2001 Joerg Schilling X * Makefile 1.19 X * starsubs.h 1.21 X New File acl_unix.c X XWed Nov 7 20:04:52 2001 Joerg Schilling X * buffer.c 1.64 X * star.h 1.50 X New xstats fields xstats.s_getaclerrs/xstats.s_badacl/xstats.s_setacl X XTue Nov 6 22:52:55 2001 Joerg Schilling X * Makefile 1.18 X * list.c 1.34 X * star.h 1.49 X Enhancements for ACLs X XTue Nov 6 22:51:31 2001 Joerg Schilling X * diff.c 1.37 X Abort if we cannot allow diffbuf, Hint for missinfg ACL diff X XTue Oct 30 22:56:30 2001 Joerg Schilling X * remote.c 1.35 X rmtxstatus() -> LLong X XMon Oct 29 18:50:51 2001 Joerg Schilling X * xheader.c 1.6 X * star.c 1.94 X * remote.c 1.34 X * hole.c 1.24 X * fifo.c 1.26 X * device.c 1.8 X * buffer.c 1.63 X * table.c 1.10 X -> statdefs.h, avoid sys/types.h X XSat Oct 27 15:23:47 2001 Joerg Schilling X * remote.c 1.33 X Test for HAVE_NETDB_H for rcmd() in remote.c X XSat Oct 27 15:22:46 2001 Joerg Schilling X * buffer.c 1.62 X Test for HAVE_NETDB_H for rcmd() in remote.c, Test for HAVE_FORK X XSat Oct 27 15:10:06 2001 Joerg Schilling X * fifo.c 1.25 X Test for HAVE_FORK new X XWed Oct 10 18:02:44 2001 Joerg Schilling X * star.c 1.93 X number() now accepts 'g' for Giga X XWed Oct 10 18:01:36 2001 Joerg Schilling X * remote.c 1.32 X rmtaborted() now by default returns EPIPE (to help for sdd -noerror) X XTue Oct 9 01:36:07 2001 Joerg Schilling X * star_unix.c 1.38 X sys/types.h & sys/stat.h -> statdefs.h X XThu Sep 27 02:49:37 2001 Joerg Schilling X * buffer.c 1.61 X * dirtime.c 1.10 X * star_unos.c 1.19 X * star_unix.c 1.37 X * star.h 1.48 X New sumerror messages for xstats.s_settime/xstats.s_setmodes X XThu Sep 27 00:51:02 2001 Joerg Schilling X * extract.c 1.42 X Bugfix for double mkfifo after make_fifo() has been added (File exists ...) X XThu Sep 27 00:46:11 2001 Joerg Schilling X * create.c 1.54 X checkdirexclude() reworked X XWed Aug 22 22:04:33 2001 Joerg Schilling X * star.c 1.92 X Version -> 1.4a06 X XWed Aug 22 22:03:30 2001 Joerg Schilling X * Makefile 1.17 X xheader.c/unicode.c/movearch.[hc] new, cpmodes new X XWed Aug 22 21:59:30 2001 Joerg Schilling X * star.1 1.22 X Removed a hint htat -r/-u are non-funktional X XWed Aug 22 01:19:37 2001 Joerg Schilling X * props.c 1.21 X Put atime/ctime in default diff mask for pax Format X XTue Aug 21 16:56:48 2001 Joerg Schilling X * xheader.c 1.5 X sprintf() -> js_sprintf() X XTue Aug 21 14:47:47 2001 Joerg Schilling X * star.1 1.21 X POSIX.1-200x Enhancements documented X XTue Aug 21 14:37:27 2001 Joerg Schilling X * header.c 1.54 X GCC mbracket warning removed X XTue Aug 21 14:24:37 2001 Joerg Schilling X * header.c 1.53 X Support for extended POSIX header X pax/exustar/suntar new X X XTue Aug 21 02:40:15 2001 Joerg Schilling X * props.c 1.20 X 'X' typeflag now only for suntar X XTue Aug 21 02:37:25 2001 Joerg Schilling X * xheader.c 1.4 X Short Name for extended header -> "././@PaxHeader" X XTue Aug 21 01:23:58 2001 Joerg Schilling X * list.c 1.33 X * append.c 1.16 X Nanoseconds implementiert X XTue Aug 21 01:13:40 2001 Joerg Schilling X * diff.c 1.36 X Nanosecond usage prepared X XMon Aug 20 20:16:06 2001 Joerg Schilling X * props.c 1.19 X Support for extended POSIX header X XMon Aug 20 19:07:46 2001 Joerg Schilling X * star.h 1.47 X * star.c 1.91 X * props.h 1.11 X * xheader.c 1.3 X Support for Sun tar X XMon Aug 20 02:57:32 2001 Joerg Schilling X * xheader.c 1.2 X addslash fuer gen_text() damit dirs wir immer funktionieren X XSun Aug 19 23:43:14 2001 Joerg Schilling X * props.h 1.10 X Support for extended POSIX header X pr_unsuptype()/pr_validtype()/pr_isxheader() new X XSun Aug 19 23:39:39 2001 Joerg Schilling X * starsubs.h 1.20 X info_to_xhdr() -> void X XSun Aug 19 23:38:48 2001 Joerg Schilling X * star_unix.c 1.36 X F_NSECS new X XSun Aug 19 23:38:13 2001 Joerg Schilling X * star.h 1.46 X MAXINT32 & F_NSECS new X XSun Aug 19 23:36:50 2001 Joerg Schilling X * longnames.c 1.30 X * create.c 1.53 X Support fuer extended POSIX header X XSun Aug 19 23:32:05 2001 Joerg Schilling X * xheader.c 1.1 X date and time created 01/08/19 22:32:05 by joerg X XSat Aug 18 00:54:28 2001 Joerg Schilling X * unicode.c 1.2 X from_utf8() now with *to = 0 X XSat Aug 18 00:51:41 2001 Joerg Schilling X * create.c 1.52 X is_unsuptype() -> pr_unsuptype() X XSat Aug 18 00:46:43 2001 Joerg Schilling X * star.h 1.45 X XF_NOTIME new, is_unsuptype -> pr_unsuptype() X XWed Aug 15 22:24:35 2001 Joerg Schilling X * header.c 1.52 X filltcb()/movetcb() new X tblocks() -> Llong X llotoa() -> llitos(), astollo() -> stolli() X otoa() -> litos(), astoo() -> stoli() X astob() -> stob(), astollb() -> stollb(), btos() -> btos(), llbtoa() -> llbtos() X XWed Aug 15 22:04:57 2001 Joerg Schilling X * star.c 1.90 X * star.h 1.44 X H_EXUSTAR new X XWed Aug 15 22:01:16 2001 Joerg Schilling X * longnames.c 1.29 X * hole.c 1.23 X llotoa() -> llitos(), astollo() -> stolli() X XWed Aug 15 22:00:11 2001 Joerg Schilling X * star_unos.c 1.18 X * star_unix.c 1.35 X info->f_xflags new X XWed Aug 15 21:56:34 2001 Joerg Schilling X * starsubs.h 1.19 X filltcb()/movetcb() new X tblocks() -> Llong X xheader.c & unicode.c new X llotoa() -> llitos(), astollo() -> stolli() X XTue Aug 14 17:50:12 2001 Joerg Schilling X * unicode.c 1.1 X date and time created 01/08/14 16:50:12 by joerg X XTue Aug 14 17:44:31 2001 Joerg Schilling X * list.c 1.32 X Now using movetcb(), info->f_typeflag new X XTue Aug 14 17:21:22 2001 jes X * fifo.h 1.8 X * buffer.c 1.60 X stats->blocks/stats->parts -> Llong, tblocks() -> Llong X XTue Aug 14 17:18:22 2001 Joerg Schilling X * star.c 1.89 X * create.c 1.51 X tsize -> Ullong, maxsize -> Ullong, Newer -> time_t X XTue Aug 14 16:50:45 2001 Joerg Schilling X * extract.c 1.41 X Lokal Variable tsize -> tasize X XTue Aug 14 16:37:51 2001 Joerg Schilling X * fifo.h 1.7 X * buffer.c 1.59 X stats->nblocks new, tblocks() now tries to avoid integer overflows X XTue Aug 14 02:25:52 2001 Joerg Schilling X * star.h 1.43 X MAXOCTAL #defines for 8/12 Byte fields X better GNU tar Header description X GNU tar POSIX Bug description with History X Better BAR Header description X f_xflags/f_typeflag new X f_xflags #define's X XMon Aug 13 01:00:09 2001 Joerg Schilling X * buffer.c 1.58 X movetcb() new X XSun Aug 12 23:51:01 2001 Joerg Schilling X * longnames.c 1.28 X * hole.c 1.22 X Now uses filltcb() X XSun Aug 12 23:49:56 2001 Joerg Schilling X * create.c 1.50 X * buffer.c 1.57 X filltcb() -> buffer.c to make if globally usable X XSun Aug 12 15:09:06 2001 Joerg Schilling X * longnames.c 1.27 X Comment for file size == strlen corrected X XSun Aug 12 14:34:09 2001 Joerg Schilling X * create.c 1.49 X * append.c 1.15 X * buffer.c 1.56 X * longnames.c 1.26 X Copyright String with 2001 X XSun Aug 12 14:24:02 2001 Joerg Schilling X * longnames.c 1.25 X movearch.c created & more universal code in movearch.c X XSun Aug 12 14:22:38 2001 Joerg Schilling X * movearch.c 1.26 X More universal code for longnames.c & xheader.c X XSun Aug 12 14:21:55 2001 Joerg Schilling X * movearch.h 1.1 X date and time created 01/08/12 13:21:55 by joerg X XSun Aug 12 14:21:06 2001 Joerg Schilling X * movearch.c 1.25 X Made from longanmes.c X XThu Aug 2 01:32:11 2001 Joerg Schilling X * remote.h 1.7 X * remote.c 1.31 X rmthostname() Parameter filename -> rmtspec X XTue Jul 31 02:48:10 2001 Joerg Schilling X * star.c 1.88 X * star.h 1.42 X * header.c 1.51 X H_CPIO -> H_CPIO_BASE, H_PAX new X XMon Jul 23 20:48:08 2001 Joerg Schilling X * star.h 1.41 X POSIX-200x extended header typeflags X XMon Jul 23 20:47:30 2001 Joerg Schilling X * buffer.c 1.55 X Check for autodecompression only if not -cflag X XMon Jul 23 15:54:13 2001 Joerg Schilling X * header.c 1.50 X * remove.c 1.43 X * create.c 1.48 X * extract.c 1.40 X * append.c 1.14 X * star_unix.c 1.34 X * diff.c 1.35 X printf() -> fprintf(vpr, ...) because of tarf == stdout X XSat Jul 21 10:09:38 2001 Joerg Schilling X * Makefile 1.16 X remove.c new, parameterized rel: Target X XFri Jul 20 11:57:03 2001 Joerg Schilling X * star_unos.c 1.17 X * star_unix.c 1.33 X make checkarch() better X XFri Jul 20 11:56:21 2001 Joerg Schilling X * buffer.c 1.54 X always call checkarch() to make star -cz work again (Bug since star-1.4a02) X XThu Jul 19 18:03:14 2001 Joerg Schilling X * star.c 1.87 X Version -> 1.4a04 X XThu Jul 19 17:52:28 2001 Joerg Schilling X * props.h 1.9 X * table.h 1.5 X * table.c 1.9 X * props.c 1.18 X xttoname_tab[] XT_ to named file type text table new, X xt*tar_tab[] with BOOL content to tell whether a file can be represented in a format X XThu Jul 19 01:49:38 2001 Joerg Schilling X * create.c 1.47 X Use is_unsuptype() for files that cannot be dumped X XThu Jul 19 01:47:17 2001 Joerg Schilling X * star_unos.c 1.16 X * star_unix.c 1.32 X correctly set info->f_xftype using switch statement for all file types X XThu Jul 19 01:19:33 2001 Joerg Schilling X * star.h 1.40 X Better comment & is_unsuptype() Makro new X XThu Jul 19 01:16:57 2001 Joerg Schilling X * star.1 1.20 X Better documentation for remote Syntax X XThu Jul 19 01:04:27 2001 Joerg Schilling X * buffer.c 1.53 X Changed to use new remote.c X XTue Jul 17 12:56:06 2001 Joerg Schilling X * remote.h 1.6 X * remote.c 1.30 X debug -> LOCAL rmt_debug, rmtdebug() new X XTue Jul 17 12:48:02 2001 Joerg Schilling X * remote.h 1.5 X * remote.c 1.29 X rmtfilename()/rmthostname() new X XFri Jul 13 00:04:36 2001 Joerg Schilling X * remove.c 1.42 X Return TRUE on successful unlink(file) X XThu Jul 12 18:57:23 2001 Joerg Schilling X * remote.h 1.4 X * remote.c 1.28 X Make struct mtget a Parameter in rmtstatus() -> no more static data X XThu Jul 12 18:12:19 2001 Joerg Schilling X * remote.c 1.27 X Check for data overflow from rmt Server in rmtread(), X Check if amount of data != sizeof(mts) in rmtstatus(), X rmtgetline() with better debug message X XThu Jul 12 01:51:40 2001 Joerg Schilling X * remote.h 1.3 X * remote.c 1.26 X Definitions for RMT Protocol Version 1 -> remote.h X XThu Jul 12 01:22:02 2001 Joerg Schilling X * remove.c 1.41 X Prepare the implementaion of -remove-recursive X XThu Jul 12 01:20:05 2001 Joerg Schilling X * star.c 1.86 X Remove "Not Implemented" message for -remove-recursive X XThu Jul 12 00:56:45 2001 Joerg Schilling X * remote.c 1.25 X call (void)rmtioctl(fd, -1, 0); only if open() suceeded X XWed Jul 11 17:49:54 2001 Joerg Schilling X * remove.c 1.40 X Cygwin workaround for rmdir() Bug in B20 removed X XWed Jul 11 00:54:54 2001 Joerg Schilling X * buffer.c 1.52 X Add ':' past WARNING X XWed Jul 11 00:54:28 2001 Joerg Schilling X * star.1 1.19 X -F -FF... better comment X XWed Jul 11 00:53:58 2001 Joerg Schilling X * create.c 1.46 X make-F -FF... fit to BSD tar X XTue Jul 10 23:41:25 2001 Joerg Schilling X * header.c 1.49 X * props.c 1.17 X ULL past unsigned long long constants X XTue Jul 10 23:39:22 2001 Joerg Schilling X * hole.c 1.21 X & vor Array beseitigt X XTue Jul 10 22:34:28 2001 Joerg Schilling X * remove.c 1.39 X * starsubs.h 1.18 X * extract.c 1.39 X remove_file() from extract.c -> remove.c X XSun Jul 8 22:39:38 2001 Joerg Schilling X * create.c 1.45 X fillbytes() -> filltcb() for better Performance X XSun Jul 8 22:32:50 2001 Joerg Schilling X * star.c 1.85 X -h Option as in BSD tar, X Version -> 1.4a03, X better comment before docompat() X XSun Jul 8 22:28:10 2001 Joerg Schilling X * fifo.c 1.24 X Default Fifosize -> 8 MB except Linux & sun3, X lock FIFO in memory if root X XSun Jul 8 22:22:22 2001 Joerg Schilling X * star.h 1.39 X ldummy in TCB union for alignement X XFri Jul 6 01:04:56 2001 Joerg Schilling X * header.c 1.48 X Better XUSTAR recognition X XThu Jul 5 03:47:34 2001 Joerg Schilling X * buffer.c 1.51 X Check for compression only when not in -create mode ... X XThu Jul 5 03:25:02 2001 Joerg Schilling X * buffer.c 1.50 X ffileread(tarf) -> _niread(fileno(tarf)), X ffilewrite(tarf) -> _niwrite(fileno(tarf), X fseek(tarf) -> lseek(fileno(tarf)) X XWed Jul 4 23:50:19 2001 Joerg Schilling X * remote.c 1.24 X read() -> _niread(), write() -> _niwrite() X XTue Jul 3 00:32:25 2001 Joerg Schilling X * buffer.c 1.49 X Automatic recognition of compression and use of the decompression if the archive is a file X XTue Jul 3 00:31:26 2001 Joerg Schilling X * fifo.c 1.23 X fifo_exit() now checks mp pointer before use because comerr() without FIFO caused Core X XTue Jul 3 00:30:33 2001 Joerg Schilling X * star.c 1.84 X * star_unos.c 1.15 X * star_unix.c 1.31 X tape_isreg new X XMon Jul 2 02:48:48 2001 Joerg Schilling X * header.c 1.47 X * starsubs.h 1.17 X get_hdrtype() -> EXPORT, get_compression() new X XMon Jul 2 01:26:14 2001 Joerg Schilling X * star.h 1.38 X Define compressionstypes X XMon Jul 2 00:30:41 2001 Joerg Schilling X * header.c 1.46 X Automatic recognition and swich to signed checksum X XSun Jul 1 15:23:07 2001 Joerg Schilling X * create.c 1.44 X Clear reminder of a file (up to 512 byte) to make gzip work more effective X XSun Jul 1 15:18:43 2001 Joerg Schilling X * remove.c 1.38 X * extract.c 1.38 X Volheader with size != null now corectly skipped X XSun Jul 1 15:12:43 2001 Joerg Schilling X * props.c 1.16 X Max USTAR Filesize is 8 GB-1 and not 8 GB-2 X XSun Jul 1 15:07:56 2001 Joerg Schilling X * star.h 1.37 X isupper with #undef (already bereits defined on HP-UX) X XFri Jun 29 00:47:43 2001 Joerg Schilling X * header.c 1.45 X Support for Largefiles X XThu Jun 28 23:47:31 2001 Joerg Schilling X * hole.c 1.20 X Support for Largefiles X XThu Jun 28 23:46:24 2001 Joerg Schilling X * Makefile 1.15 X LARGEFILES new X XThu Jun 28 23:43:21 2001 Joerg Schilling X * starsubs.h 1.16 X neue ll functions in header.c X XThu Jun 28 23:38:42 2001 Joerg Schilling X * props.h 1.8 X * props.c 1.15 X * create.c 1.43 X props.pr_maxsize new X XWed Jun 27 23:44:55 2001 Joerg Schilling X * star.h 1.36 X NODEV past #include sys/param.h, #include sys/param.h with #ifdef X XWed Jun 27 19:53:38 2001 Joerg Schilling X * remote.c 1.23 X * remote.h 1.2 X * star.h 1.35 X * buffer.c 1.48 X * starsubs.h 1.15 X * star_unos.c 1.14 X * star_unix.c 1.30 X * star.c 1.83 X * movearch.c 1.24 X * list.c 1.31 X * longnames.c 1.24 X * remove.c 1.37 X * extract.c 1.37 X * diff.c 1.34 X * create.c 1.42 X Support for largefiles X XTue Jun 26 17:46:23 2001 Joerg Schilling X * table.c 1.8 X * star_unix.c 1.29 X * star_unos.c 1.13 X * star.h 1.34 X * star.c 1.82 X * hole.c 1.19 X * header.c 1.44 X * fifo.c 1.22 X * create.c 1.41 X * buffer.c 1.47 X * append.c 1.13 X curfs: Ulong -> dev_t, Lint messages reduced X X*************** Release 1.3.1 ******************* X XWed Jun 20 23:31:36 2001 Joerg Schilling X * star.c 1.81 X Version -> 1.3.1 X XMon Apr 30 20:05:49 2001 Joerg Schilling X * star_unix.c 1.28 X Fehler mit _FIOSATIME beseitigt der durch Umstellung auf nanosekunden entstand (tv_usec > 1000000) X X*************** Release 1.3 ******************* X XSat Apr 14 15:28:35 2001 Joerg Schilling X * star.c 1.80 X Version -> 1.3 X XSat Apr 14 13:26:35 2001 Joerg Schilling X * star.c 1.79 X set back UID only if euid != uid for AIX X XSun Apr 8 00:18:11 2001 Joerg Schilling X * list.c 1.30 X Listing print for Files without Group Execution bit now 'l' X XSat Apr 7 23:31:11 2001 Joerg Schilling X * list.c 1.29 X Major/Minor now unsigned for FreeBSD X XSat Apr 7 13:06:01 2001 Joerg Schilling X * append.c 1.12 X * create.c 1.40 X * diff.c 1.33 X * list.c 1.28 X * extract.c 1.36 X Warning for nsec introduction in future X XSat Apr 7 12:25:49 2001 Joerg Schilling X * star_unix.c 1.27 X * star_unos.c 1.12 X * dirtime.c 1.9 X * header.c 1.43 X * star.h 1.33 X info->f_*time from Ulong -> time_t, info->f_spare? -> info->f_*nsec X XSat Apr 7 01:42:10 2001 Joerg Schilling X * star.1 1.17 X * star.c 1.78 X Options from '_' to '-', -onull now alias for -nullout X XSat Apr 7 01:36:44 2001 Joerg Schilling X * buffer.c 1.46 X * extract.c 1.35 X * diff.c 1.32 X * list.c 1.27 X time.h/timedefs.h -> star.h X XSun Mar 4 17:40:02 2001 Joerg Schilling X * star.c 1.77 X Version -> 1.3a10, Copyright 2001 X XSun Feb 25 21:52:49 2001 Joerg Schilling X * star_unix.c 1.26 X Now using utimdefs.h X XSun Feb 25 13:13:07 2001 Joerg Schilling X * fifo.c 1.21 X Now using mmapdefs.h X XFri Feb 23 17:34:45 2001 Joerg Schilling X * fifo.c 1.20 X Support for mmap() on Apollo Domain/OS with mmap(0, &size, ...) X XFri Feb 16 00:45:11 2001 Joerg Schilling X * header.c 1.42 X New comment for Char past digit in octal number X XFri Feb 16 00:42:18 2001 Joerg Schilling X * create.c 1.39 X Skip empty lines in file from list= X XFri Feb 16 00:39:07 2001 Joerg Schilling X * device.c 1.7 X Support for dev_t > 32 Bits X XMon Jan 15 01:19:01 2001 Joerg Schilling X * fifo.c 1.19 X %x -> %p Format X XWed Nov 15 22:48:21 2000 Joerg Schilling X * mtio.h 1.2 X Restructured, Definitions for ioctl's X XWed Nov 15 22:27:16 2000 Joerg Schilling X * star.1 1.16 X Typo removed X XWed Nov 15 09:18:16 2000 Joerg Schilling X * star.c 1.76 X -> 1.3a9 X XWed Nov 15 01:37:16 2000 Joerg Schilling X * star_unix.c 1.25 X HAS_FILIO -> HAVE_SYS_FILIO_H (was a typo) X XMon Nov 13 00:06:33 2000 Joerg Schilling X * star.c 1.75 X Using new patmatch() with state[] array for Patterns with unlimited length X XSun Nov 12 17:24:46 2000 Joerg Schilling X * buffer.c 1.45 X * starsubs.h 1.14 X * remote.c 1.22 X remote.h from starsubs.h X XSun Nov 12 17:23:06 2000 Joerg Schilling X * remote.h 1.1 X date and time created 00/11/12 17:23:06 by joerg X XThu Nov 9 10:51:17 2000 Joerg Schilling X * extract.c 1.34 X make_copy()/copy_file()/make_fifo() new X create_dirs() now checks if orig file (on disk) has different file type X XThu Nov 9 09:36:55 2000 Joerg Schilling X * buffer.c 1.44 X Printf-like Formate aufgeraeumt, Weitergabe von O_CREAT an remote.c (wird dort behandelt). X XThu Nov 9 09:31:36 2000 Joerg Schilling X * starsubs.h 1.13 X * header.c 1.41 X * create.c 1.38 X * fifo.c 1.18 X * longnames.c 1.23 X Printf-like Formats reworked X XThu Nov 9 09:25:23 2000 Joerg Schilling X * append.c 1.11 X Hash code allows append mode for star X XThu Nov 9 09:22:16 2000 Joerg Schilling X * remote.c 1.21 X Mask Open Modes with O_ACCMODE in numeric mode X XThu Nov 9 09:19:33 2000 Joerg Schilling X * star.1 1.15 X Hints for open Modes & Schily rmt X XThu Nov 9 08:58:17 2000 Joerg Schilling X * fifo.h 1.6 X #undef FIFO if no FIFO possible X XTue Oct 31 14:09:01 2000 Joerg Schilling X * fifo.c 1.17 X FIFO for OS/2 X XFri Aug 11 00:18:49 2000 Joerg Schilling X * remote.c 1.20 X O_TEXT new X No more global static data X Prevent buffer overflow on rmtuser X XThu Aug 10 22:07:00 2000 Joerg Schilling X * buffer.c 1.43 X Host -> 128 Bytes, prevent buffer overflow in host X XThu Aug 10 11:20:41 2000 Joerg Schilling X * remote.c 1.19 X Now using js_snprintf(), Use String Open modes as in GNU rmt X XTue Aug 8 17:43:15 2000 Joerg Schilling X * remote.c 1.18 X "S" command now without "\n" X send I-1\n0\n after open to inform /etc/rmt about our version X all Members from struct mtget now in autoconf X Mapp all Opcodes 0..7 for Linux X rmtstatus() now returns NULL on error. X XSun Aug 6 01:47:10 2000 Joerg Schilling X * remote.c 1.17 X rmtgetstatus() now fetches as many bytes as available from peer X XSun May 7 17:54:24 2000 Joerg Schilling X * device.c 1.6 X * lhash.c 1.8 X * dirtime.c 1.8 X * star_unos.c 1.11 X * buffer.c 1.42 X * star_unix.c 1.24 X * longnames.c 1.22 X * diff.c 1.31 X * hole.c 1.18 X * props.c 1.14 X * fifo.c 1.16 X * remote.c 1.16 X * create.c 1.37 X * list.c 1.26 X * header.c 1.40 X * star.c 1.74 X #include X XSun May 7 17:44:32 2000 Joerg Schilling X * star.c 1.73 X #include "fifo.h" for #undef FIFO when features are missing X XThu Feb 10 01:24:29 2000 Joerg Schilling X * buffer.c 1.41 X #ifdef USE_REMOTE new X XThu Feb 10 01:23:49 2000 Joerg Schilling X * star_unix.c 1.23 X #ifdef HAVE_ST_BLOCKS new X XThu Feb 10 01:21:55 2000 Joerg Schilling X * remote.c 1.15 X #define USE_REMOTE removed and -> Makefile X XThu Feb 10 01:20:51 2000 Joerg Schilling X * star.c 1.72 X #define __XDEV__ for new device.h X CPU/VENDOR/OS with -version X -refresh as alias for -refesh_old_files X XThu Feb 10 01:19:18 2000 Joerg Schilling X * header.c 1.39 X * device.c 1.5 X #define __XDEV__ for new device.h X XThu Feb 10 01:16:27 2000 Joerg Schilling X * star.h 1.32 X is_fifo() Makro new X max/min #undef for QNX X XSun Dec 19 15:48:20 1999 Joerg Schilling X * create.c 1.36 X * starsubs.h 1.12 X open Paramter clash for Linux removed X XSun Nov 21 01:00:26 1999 Joerg Schilling X * fifo.c 1.15 X Support for OS/2 shared memory X XFri Nov 12 12:42:27 1999 Joerg Schilling X * header.c 1.38 X rdevmin ist only 7 bytes in mod 256, rdevvmin -> 0 for non devices for maximum POSIX compatibility X XFri Nov 12 12:30:54 1999 Joerg Schilling X * star.c 1.71 X -copylinks new X XTue Sep 14 19:56:16 1999 Joerg Schilling X * header.c 1.37 X astob()/btoa() new X -i now works again although better messages about tar type have been introduced X write 7 bytes into 8 Byte fieds with USTAR X -modebits allows to have more than 12 Bits into t_mode X DEV_MINOR_NONCONTIG new X -hpdev allows to have 24 Bits in devminor like the HP method X base 256 allows 32 Bits in devminor X XTue Sep 14 19:18:08 1999 Joerg Schilling X * star_unix.c 1.22 X Now using local lokale major()/minor() Macros X New function snulltimes() X XTue Sep 14 18:45:45 1999 Joerg Schilling X * star.c 1.70 X -hpdev/-modebits new X XTue Sep 14 14:11:01 1999 Joerg Schilling X * extract.c 1.33 X xt_file() modified to make ret == -1 with hard errors X Now calling snulltimes() if an extraction error occurred X Now calling fsync() before calling fclose() for NFS consistence X XTue Sep 14 14:06:19 1999 Joerg Schilling X * starsubs.h 1.11 X * buffer.c 1.40 X * longnames.c 1.21 X * hole.c 1.17 X * diff.c 1.30 X * buffer.c 1.39 X Modified for changes in function xt_file(), new function die() X XWed Sep 8 01:06:54 1999 Joerg Schilling X Hack to avoid gcc inuninitialized err X XSun Aug 22 14:26:41 1999 Joerg Schilling X * buffer.c 1.38 X Now handling EFBIG (write() == 0) and fifoexit() new to avoid error message if another message was already pringed X XSun Aug 22 14:21:30 1999 Joerg Schilling X * fifo.c 1.14 X * fifo.h 1.5 X * starsubs.h 1.10 X fifo_exit()/FIFO_EXIT new X XTue Jul 13 10:50:26 1999 Joerg Schilling X * header.c 1.36 X Typo in get_volhdr() Prototype. X XTue Jul 13 08:14:10 1999 Joerg Schilling X * extract.c 1.32 X * star.1 1.14 X * star.c 1.69 X New Option -refresh_old_files X XTue Jul 13 01:41:49 1999 Joerg Schilling X * star.h 1.31 X HAVE_LONGLONG instead of SVR4 X XFri Jun 18 02:50:06 1999 Joerg Schilling X * extract.c 1.31 X DOS Filesystem time workaround always active because a DOS FS X may also bei present on UNIX X XFri Jun 18 02:44:19 1999 Joerg Schilling X * list.c 1.25 X Paranoia while copying filenames: clear PATH_MAX index. X XFri Jun 18 02:40:21 1999 Joerg Schilling X * star.h 1.30 X PATH_MAX now is minimal 1024 X XFri Jun 18 02:38:40 1999 Joerg Schilling X * longnames.c 1.20 X get_tcb() past void_file() on extract if Filename too long X XFri Jun 18 02:31:50 1999 Joerg Schilling X * create.c 1.35 X fileopen() with "b" Binary for DOS, test for HAVE_SEEKDIR X XTue Jun 15 01:33:26 1999 Joerg Schilling X * diff.h 1.6 X common long diffopts -> extern long diffopts X XTue Jun 15 01:32:30 1999 Joerg Schilling X * star.c 1.68 X common diffopts -> int difftopts (data) X XTue Jun 15 01:31:50 1999 Joerg Schilling X * remote.c 1.14 X common int debug -> extern BOOL debug X XTue Jun 15 01:31:00 1999 Joerg Schilling X * props.c 1.13 X debug int -> BOOL X XTue Jun 15 01:30:02 1999 Joerg Schilling X * fifo.c 1.13 X debug int -> BOOL, shmflag common -> extern X XSun Jun 6 17:30:00 1999 Joerg Schilling X * star_unix.c 1.21 X #ifndef S_IFLNK -> #ifndef HAVE_LSTAT, #ifndef SVR4 -> #ifndef HAVE_LCHOWN X XSun Jun 6 17:27:30 1999 Joerg Schilling X * star_unix.c 1.20 X Workaround for DOS problem with set time & Read Only Files X XSun May 2 16:36:12 1999 Joerg Schilling X * star_unix.c 1.19 X Now using S_IS???() macros X XSun May 2 16:34:06 1999 Joerg Schilling X * extract.c 1.30 X Timestamp for DOS is always modulo 2 X Workaround for ENOTEMPTY & GYGWIN32 when doing rmdir(file) X XSun May 2 16:32:26 1999 Joerg Schilling X * buffer.c 1.37 X O_BINARY & "b" for DOS X XSun May 2 03:26:40 1999 Joerg Schilling X * extract.c 1.29 X To allow DOS use "b" for fileopen() X Do not remove '/' for symlinks X XSun May 2 03:25:58 1999 Joerg Schilling X * diff.c 1.29 X For DOS, use "b" for fileopen() X XSat Feb 6 19:05:38 1999 Joerg Schilling X * header.c 1.35 X Compress/gzip recognition and printout if an unknown format is found X XMon Jan 25 21:18:48 1999 Joerg Schilling X * extract.c 1.28 X Typo in Parameter X XSun Jan 24 14:42:54 1999 Joerg Schilling X * starsubs.h 1.9 X * header.c 1.34 X * extract.c 1.27 X Check VOLHDR on extract. X XSun Jan 24 14:32:39 1999 Joerg Schilling X * star.1 1.13 X New option -bz. X XSun Jan 24 14:31:47 1999 Joerg Schilling X * star.c 1.66 X * buffer.c 1.35 X New option -bz, Check VOLHDR on extract. X XSat Nov 21 13:50:51 1998 Joerg Schilling X * star_unix.c 1.18 X * star.c 1.65 X * header.c 1.33 X * device.c 1.4 X #include for #include and SCO X XSat Nov 21 13:47:59 1998 Joerg Schilling X * star.c 1.64 X call closepattern() if -c und !cflag in match() to allow pat= to X work with -c flag X XSun Nov 15 19:26:23 1998 Joerg Schilling X * header.c 1.32 X Warning for partial EOF Blocks (only 1 EOF block) X XFri Nov 13 00:02:08 1998 Joerg Schilling X * header.c 1.31 X Workaround for ptb->dbuf.t_name[NAMSIZ] == '\0' (buggy Sun tar) X XTue Nov 10 00:29:08 1998 Joerg Schilling X * create.c 1.34 X Don't use get_block() to allocate TCB buffer if -p Flag & directory X XSun Nov 8 18:31:09 1998 Joerg Schilling X * star.h 1.29 X New descrition on how to recognise xstar archives X XSun Nov 8 01:18:35 1998 Joerg Schilling X * star.1 1.12 X -h Option removed X XSun Nov 8 00:43:31 1998 Joerg Schilling X * header.c 1.30 X isxmagic() enhanced X force t_prefix[130] = '\0' for xstar X XSun Nov 8 00:00:06 1998 Joerg Schilling X * create.c 1.33 X _fileopen()/_fileread() new X put_file(FILE *) -> put_file(int *) X XSat Nov 7 23:59:01 1998 Joerg Schilling X * hole.c 1.16 X * starsubs.h 1.8 X _fileopen()/_fileread() new X put_file(FILE *) -> put_file(int *) X put_sparse(FILE *) -> put_sparse(int *) X XSat Nov 7 21:20:10 1998 Joerg Schilling X * starsubs.h 1.7 X * star_unix.c 1.17 X rs_acctime(FILE *f, ...) -> rs_acctime(int fd, ...) X XSat Nov 7 18:09:39 1998 Joerg Schilling X * fifo.c 1.12 X USE_SHM -> USE_USGSHM (similar to cdrecord) X XSat Nov 7 18:06:12 1998 Joerg Schilling X * star.c 1.63 X Converted to use dirdefs.h/maxpath.h/getcwd.h X USE_SHM -> USE_USGSHM (similar to cdrecord) X usage() for bad Compat Option X XSat Nov 7 17:55:32 1998 Joerg Schilling X * star.h 1.28 X star_ext_header -> xstar_ext_header X xstar_in_header better modeled similar to xstar_header (t_prefix[]) X XSun Sep 13 18:22:33 1998 Joerg Schilling X * create.c 1.32 X * extract.c 1.26 X * header.c 1.29 X * list.c 1.24 X * star_unix.c 1.16 X * diff.c 1.28 X Converted to use dirdefs.h X XSun Sep 13 17:02:56 1998 Joerg Schilling X * extract.c 1.25 X Recognition of unexpected end of archive even if amount % 512 != 0 X EEXIST now yields to removes the File in get_file() X XSun Sep 13 16:23:21 1998 Joerg Schilling X * star_unix.c 1.15 X * buffer.c 1.34 X BSD4_2 define removed X XSun Sep 13 16:19:20 1998 Joerg Schilling X * buffer.c 1.33 X converted to use vadefs.h X XMon Aug 10 23:42:03 1998 Joerg Schilling X * star.c 1.62 X backtape() call new to allow -u & -r X -u/-r enabled X no_fifo = TRUE for -u/-r X D_SPARSE/sparse new for -diff X H_XUSTAR new X XMon Aug 10 23:39:34 1998 Joerg Schilling X * header.c 1.28 X H_XUSTAR without "tar" magic new X hdrtxt[] enhanced for H_XUSTAR X isxmagic() new X XMon Aug 10 04:06:27 1998 Joerg Schilling X * starsubs.h 1.6 X markeof() / backtape() / mtioctl() / mtseek() / update_newer() new X XMon Aug 10 04:05:01 1998 Joerg Schilling X * buffer.c 1.32 X markeof() / backtape() / mtioctl() / mtseek() new X syncbuf() corrected X -nullout enhanced for -rflag/-uflag X XMon Aug 10 03:46:56 1998 Joerg Schilling X * diff.c 1.27 X D_TYPE if Statement remodeled to make it more readable X D_SPARS new X Don't evaluate D_SIZE for hard links X XMon Aug 10 03:42:59 1998 Joerg Schilling X * star.h 1.27 X H_XUSTAR new X comment for recognition of xstar X XMon Aug 10 03:41:43 1998 Joerg Schilling X * props.c 1.12 X H_XUSTAR new X XMon Aug 10 03:41:15 1998 Joerg Schilling X * create.c 1.31 X checkdirexclude() / checkexclude() new X xstats Support new X uflag / update_newer() Support new X XSun Aug 9 20:41:36 1998 Joerg Schilling X * hole.c 1.15 X change from fileseek() -> lseek() to fix Sparse Problems on FreeBSD & Linux X XSun Aug 9 16:42:24 1998 Joerg Schilling X * diff.h 1.5 X new Option D_SPARS X XSun Aug 9 14:52:15 1998 Joerg Schilling X * longnames.c 1.19 X s_toolong Increment for cannot split correctly moved to coditional part. X XThu Jul 30 00:22:10 1998 Joerg Schilling X * fifo.h 1.4 X lastsize new for append Option X XMon Jul 6 02:09:37 1998 Joerg Schilling X * star.c 1.61 X copt[] -> *copt for K&R automatic Vars X XSun Jul 5 23:05:38 1998 Joerg Schilling X * header.c 1.27 X numeric now works in create Mode too X XSun Jul 5 23:02:47 1998 Joerg Schilling X * names.c 1.7 X Cachesize enhanced from 1 -> 16 and new Code X XSun Jul 5 21:48:12 1998 Joerg Schilling X * star.c 1.60 X filename() new X -F Option new X checkerrs() new X -w Option in Usage X av[0] == "tar" now uses xstar Format as default X XSun Jul 5 21:36:25 1998 Joerg Schilling X * hole.c 1.14 X * diff.c 1.26 X * extract.c 1.24 X * longnames.c 1.18 X xstats new X XSun Jul 5 21:14:38 1998 Joerg Schilling X * buffer.c 1.31 X checkerrs() new X Allow overwriting of empty files in compat mode (tar cf ) X XSun Jul 5 21:05:29 1998 Joerg Schilling X * starsubs.h 1.5 X checkerrs() and filename() new X XSun Jul 5 20:35:49 1998 Joerg Schilling X * star.h 1.26 X struct star_stats enhanced X XThu Jul 2 23:12:58 1998 Joerg Schilling X * star.c 1.59 X nameprefix() nee X namefound() new X addarg() new X addfile() new X File selection for Extraction now compatible to old tar X XThu Jul 2 21:45:39 1998 Joerg Schilling X * list.c 1.23 X * extract.c 1.23 X * diff.c 1.25 X * create.c 1.30 X * append.c 1.10 X npat -> havepat X XThu Jul 2 01:54:31 1998 Joerg Schilling X * star.h 1.25 X * lhash.c 1.7 X * remote.c 1.13 X * longnames.c 1.17 X * list.c 1.22 X * hole.c 1.13 X * header.c 1.26 X * fifo.c 1.11 X * extract.c 1.22 X * create.c 1.29 X * buffer.c 1.30 X * star.c 1.58 X BAD -> EX_BAD X XThu Jul 2 01:35:33 1998 Joerg Schilling X * header.c 1.25 X Print warning if found more than 12 Bits in mode Feld X XThu Jul 2 01:33:37 1998 Joerg Schilling X * star.c 1.57 X include getargs.h X __malloc()/__savestr() new X docompat() for old option syntax new X fcompat new X -version pption new X -h Option removed X -w Option new X av[0] == "ustar" fixed X av[0] == "tar" new X XMon Jun 29 21:37:07 1998 Joerg Schilling X * buffer.c 1.29 X fcompat new (Option compat for old tar) X XMon Jun 29 21:36:27 1998 Joerg Schilling X * starsubs.h 1.4 X __malloc()/__savestr() new X XWed Jun 24 19:41:04 1998 Joerg Schilling X * star.1 1.11 X _FIOAI Bug description removed X X*************** Release 1.2 ******************* X XTue Jun 23 03:00:40 1998 Joerg Schilling X * hole.c 1.12 X Support for sun ioctl() _FIOAI X XTue Jun 23 02:48:38 1998 Joerg Schilling X * star.h 1.24 X Enhanced comment for F_HAS_NAME X XTue Jun 23 02:47:07 1998 Joerg Schilling X * list.c 1.21 X If -listnew is specified, svae Linkname X If -listnew only try to list file if a file was really found X XTue Jun 23 02:40:44 1998 Joerg Schilling X * header.c 1.24 X If F_HAS_NAME is set retain f_lname and don't read LF_LONGLINK/LF_LONGNAME to retain f_name too X XSun Apr 5 17:02:49 1998 Joerg Schilling X * star_unix.c 1.14 X Add 2nd chmod() past chown() if the suid/sgid/svtx Bit is set for Linux X XSat Dec 6 01:48:47 1997 Joerg Schilling X * buffer.c 1.28 X Fix problem that caused Coredump without fifo on -nullout X XSun Nov 9 15:27:23 1997 Joerg Schilling X * star.1 1.10 X -dodesc option new X _FIOAI Documented X XSun Nov 9 15:26:18 1997 Joerg Schilling X * star.c 1.56 X Do dochdir() on listfile= too. X XTue Jun 24 11:06:15 1997 Joerg Schilling X * buffer.c 1.27 X Don't call checkarch() if -nullout to avoid core dump X XSun Jun 22 19:33:14 1997 Joerg Schilling X * star.c 1.55 X New Option -dodesc X X*************** Release 1.1 ******************* X XSun Jun 15 19:11:04 1997 Joerg Schilling X * star.1 1.9 X Additions for Release 1.1 X XSun Jun 15 19:10:17 1997 Joerg Schilling X * star.h 1.23 X is_bdev() is_cdev() & is_dev() new, struct star_stats started X XSun Jun 15 19:09:28 1997 Joerg Schilling X * star.c 1.54 X -C flag correct and complete implementation X -z flag, -xdir flag X xstats struct new X NPAT from 10 to 100 X #include for MAXPAT X tape_dev & tape_ino for archive recogniction X getdir() new, dogetwdir() new, dochdir() new, closepattern() new X H_USTAR is default if av[0] == "ustar" X getenv("STAR_FIFO_SIZE") X addpattern() stores dir & allocates aux array X wait() as loop X closetape for -z flag X XSun Jun 15 17:50:35 1997 Joerg Schilling X * diff.c 1.24 X Need to test ino *and* dev for hard links X XSun Jun 15 15:49:06 1997 Joerg Schilling X * star_unix.c 1.13 X checkarch() new to prevent archive file to be archived X XSun Jun 15 15:26:38 1997 Joerg Schilling X * header.c 1.23 X Better EOF handling (text for GNU tar) X XSun Jun 15 15:20:22 1997 Joerg Schilling X * diff.c 1.23 X Compare filetype only if no hardlink or star format X Compare rdev only for char/blk device X XSat Jun 14 20:03:12 1997 Joerg Schilling X * extract.c 1.21 X -xdir flag new X remove_first new, force_remove new, ask_remove new X isfirst in remove_file() X XSat Jun 14 18:54:12 1997 Joerg Schilling X * starsubs.h 1.3 X checkarch() new X XSat Jun 14 18:46:59 1997 Joerg Schilling X * buffer.c 1.26 X verbose print modified for -z flag X checkarch() new X activate multblk (-B) for -z flag X XSat Jun 14 16:53:44 1997 Joerg Schilling X * create.c 1.28 X is_tape() new, archiv will not be dumped anymore X XSat Jun 14 16:28:41 1997 Joerg Schilling X * fifo.c 1.10 X initfifo corrected: don't call mkshm()/mkshare() twice if both USE_* activ X XSat Jun 14 16:09:09 1997 Joerg Schilling X * list.c 1.20 X verbode print output file now extern variable for -z flag X XMon Jun 9 21:37:57 1997 Joerg Schilling X * buffer.c 1.25 X -z gzip Compression new X XFri Jun 6 00:02:37 1997 Joerg Schilling X * header.c 1.22 X * buffer.c 1.24 X * create.c 1.27 X * hole.c 1.11 X * star.c 1.53 X New Option -nullout X XTue Jun 3 03:15:15 1997 Joerg Schilling X * star.c 1.52 X New Options -force_remove -ask_remove -remove_first -remove_recursive X XTue Jun 3 01:57:55 1997 Joerg Schilling X * dir.h 1.4 X SVR4 -> HAVE_DIRENT_H X XSun Jun 1 16:16:18 1997 Joerg Schilling X * props.c 1.11 X include mconfig.h X XSun Jun 1 16:16:17 1997 Joerg Schilling X * append.c 1.9 X include mconfig.h X XFri May 30 01:12:08 1997 Joerg Schilling X * longnames.c 1.16 X Avoid strcatl() for speed X f_name/f_lname bug and bug with non-initialized m_add X XFri May 30 01:00:40 1997 Joerg Schilling X * hole.c 1.10 X If sparse_in_hdr == 0 extended is always true X EDEBUG '(', TCB local if allocated Block is in buffer X XFri May 30 00:50:23 1997 Joerg Schilling X * extract.c 1.20 X remove_file() core dump if not called interactiv (-I). X XFri May 30 00:43:48 1997 Joerg Schilling X * names.c 1.6 X avoid strncpy() by inserting a NULL bytes into the string X XFri May 30 00:35:42 1997 Joerg Schilling X * star.c 1.51 X file_raise() uses global flag X XFri May 30 00:23:38 1997 Joerg Schilling X * create.c 1.26 X createi() with namlen, fileopen() without "u", file_raise() now global in main() X XFri May 30 00:10:37 1997 Joerg Schilling X * diff.c 1.22 X Do not compare filetype on hardlinks X XSun May 11 17:52:24 1997 Joerg Schilling X * extract.c 1.19 X fileread() -> ffileread(), filewrite() -> ffilewrite() X XSun May 11 17:52:23 1997 Joerg Schilling X * hole.c 1.9 X fileread() -> ffileread(), filewrite() -> ffilewrite() X XSun May 11 17:52:23 1997 Joerg Schilling X * diff.c 1.21 X fileread() -> ffileread(), filewrite() -> ffilewrite() X XSun May 11 17:52:22 1997 Joerg Schilling X * create.c 1.25 X fileread() -> ffileread(), filewrite() -> ffilewrite() X XSat May 10 22:51:48 1997 Joerg Schilling X * header.c 1.21 X strcpy() -> inline byte copy X XFri May 9 21:25:18 1997 Joerg Schilling X * longnames.c 1.15 X NAMSIZ -> props.pr_maxsname/props.pr_maxslname X XFri May 9 21:25:17 1997 Joerg Schilling X * create.c 1.24 X NAMSIZ -> props.pr_maxsname/props.pr_maxslname X XFri May 9 21:24:58 1997 Joerg Schilling X * header.c 1.20 X NAMSIZ -> props.pr_maxsname/props.pr_maxslname X devmajor/devminor for GNU tar only if CHR/BLK X XFri May 9 17:38:02 1997 Joerg Schilling X * header.c 1.19 X If F_TCB_BUF Flag is true TCB must be copied X XFri May 9 17:26:09 1997 Joerg Schilling X * create.c 1.23 X TCB allocated from buffer if namelen < props.pr_maxsname X XFri May 9 17:09:52 1997 Joerg Schilling X * buffer.c 1.23 X get_block() & put_block() new X XFri May 9 17:07:49 1997 Joerg Schilling X * props.h 1.7 X * props.c 1.10 X pr_maxsname & pr_maxslname new, pr_fillc to the top X XFri May 9 17:07:49 1997 Joerg Schilling X * starsubs.h 1.2 X get_block() & put_block() new X XFri May 9 16:59:56 1997 Joerg Schilling X * star.h 1.22 X F_TCB_BUF & F_ADDSLASH new X XFri May 9 16:58:15 1997 Joerg Schilling X * longnames.c 1.14 X Bug that caused very long directory names from command line to overwrite the stack (av[i+1) X XFri May 9 00:51:57 1997 Joerg Schilling X * create.c 1.22 X hashlist for linklist, cr_file() needs one read() less, fileopen() only if siz > 0 X XThu May 8 23:42:28 1997 Joerg Schilling X * header.c 1.18 X checksum() faster, strncpy(..."00") becomes two assignements, otoa() faster X XThu May 8 21:40:42 1997 Joerg Schilling X * props.h 1.6 X * props.c 1.9 X pr_fillc new X XThu May 8 21:28:36 1997 Joerg Schilling X * star.c 1.50 X -I usage better readable X XFri May 2 23:43:22 1997 Joerg Schilling X * diff.c 1.20 X Option -tpath also for -diff X X*************** Release 1.0 ******************* X XTue Apr 29 00:52:53 1997 Joerg Schilling X * extract.c 1.18 X Bug in remove_file() that caused infinite loops with no permission to remove X XMon Apr 28 03:41:54 1997 Joerg Schilling X * star.1 1.8 X Type, new Options -wready and -tpath, Section LIMITATIONS X XMon Apr 28 02:54:23 1997 Joerg Schilling X * list.c 1.19 X Problem with Posix-Compatibility of new format.c (info->f_?maxlen == 0) X XMon Apr 28 02:02:09 1997 Joerg Schilling X * hole.c 1.8 X * props.c 1.8 X SPARSE_IN_HDR for star/xstar is now 0 X XMon Apr 28 01:58:55 1997 Joerg Schilling X * props.h 1.5 X * props.c 1.7 X New Props Member: sparse_in_hdr X XMon Apr 28 01:52:30 1997 Joerg Schilling X * fifo.c 1.9 X Comment for shmat() X XMon Apr 28 00:44:26 1997 Joerg Schilling X * star.h 1.21 X Better comment X XSun Apr 27 23:54:23 1997 Joerg Schilling X * star.c 1.49 X * list.c 1.18 X New Option -tpath X XSun Apr 27 23:53:16 1997 Joerg Schilling X * fifo.h 1.3 X * buffer.c 1.22 X stats->blocksize new: the display was wrong if blocksize < bigsize and we were using the fifo X XSun Apr 27 20:06:24 1997 Joerg Schilling X * buffer.c 1.21 X New option -wready, fileread() -> ffileread() X XSun Apr 27 20:05:40 1997 Joerg Schilling X * star.c 1.48 X New option -wready X XSun Apr 27 19:54:10 1997 Joerg Schilling X * extract.c 1.17 X New function remove_file() X XMon Jan 27 18:57:50 1997 Joerg Schilling X * create.c 1.21 X rs_acctime() only if f != NULL (otherwise coredump) X XSun Jan 26 19:35:42 1997 Joerg Schilling X * fifo.c 1.8 X _SC_PAGE_SIZE definition -> unixstd.h X XWed Nov 27 23:29:15 1996 Joerg Schilling X * fifo.c 1.7 X USE_SHM now default. No more Problemes if mmap() is not properly working. X XWed Nov 27 23:13:40 1996 Joerg Schilling X * extract.c 1.16 X directories now are not extracted if they are not more recent X same_symlink() new (symlink will not be extracted if it points to the same name but is newer) X XWed Jun 26 11:59:47 1996 Joerg Schilling X * device.c 1.2 X K&R C (does not grok 1234U constants) X XWed Jun 26 11:50:53 1996 Joerg Schilling X * mtio.h 1.1 X date and time created 96/06/26 10:50:53 by joerg X XWed Jun 26 11:47:44 1996 Joerg Schilling X * star_unix.c 1.12 X info->f_rdev handling now OK (no more getting negative) X XWed Jun 26 11:45:45 1996 Joerg Schilling X * star.c 1.47 X SIGDEFER new X XWed Jun 26 11:45:12 1996 Joerg Schilling X * remote.c 1.12 X SIGDEFER new, local & remote user corrected in rmtgetconn(), several #defines in struct mtget X XWed Jun 26 11:43:39 1996 Joerg Schilling X * header.c 1.17 X Old Code from get_hdrtype() removed X XThu Jun 13 22:10:33 1996 Joerg Schilling X * xutimes.h 1.1 X date and time created 96/06/13 21:10:33 by joerg X XThu Jun 13 22:07:38 1996 Joerg Schilling X * dirtime.h 1.1 X date and time created 96/06/13 21:07:38 by joerg X XThu Jun 13 22:05:18 1996 Joerg Schilling X * starsubs.h 1.1 X date and time created 96/06/13 21:05:18 by joerg X XThu Jun 13 22:02:15 1996 Joerg Schilling X * device.c 1.1 X date and time created 96/06/13 21:02:15 by joerg X XThu Jun 13 21:49:59 1996 Joerg Schilling X * star_unix.c 1.11 X switch cast -> int & utimes() -> sutimes() X XThu Jun 13 21:47:46 1996 Joerg Schilling X * table.h 1.3 X S_IFSHAD * cpio acl X XFri May 31 01:26:08 1996 Joerg Schilling X * star_unix.c 1.10 X * header.c 1.16 X Now using dev_*() Macros X XFri May 31 00:58:10 1996 Joerg Schilling X * star.c 1.46 X dev_init() new X XTue May 28 23:02:05 1996 Joerg Schilling X * extract.c 1.14 X Now using Prototypes X XTue May 28 22:58:41 1996 Joerg Schilling X * star_unix.c 1.9 X Now using Prototypes & sdirtimes() & sutimes() & sxsymlink() new with info Pointer X XMon May 27 14:06:55 1996 Joerg Schilling X * star.h 1.19 X Type modifications for ANSI Prototypes X XMon May 27 14:06:00 1996 Joerg Schilling X * table.h 1.2 X Multiplexed char, multiplexed block & Solaris Door new X XMon May 27 14:03:42 1996 Joerg Schilling X * star.c 1.45 X * remote.c 1.11 X * props.c 1.5 X * names.c 1.4 X * longnames.c 1.12 X * list.c 1.16 X * lhash.c 1.5 X * hole.c 1.6 X * header.c 1.15 X * fifo.c 1.5 X * append.c 1.7 X * buffer.c 1.19 X * create.c 1.19 X Now using Prototypes X XMon May 27 13:47:34 1996 Joerg Schilling X * dirtime.c 1.6 X Now using Prototypes && sdirtimes() new with info pointer X XMon May 27 13:46:12 1996 Joerg Schilling X * diff.c 1.18 X Now using Prototypee && parenthesis bug on D_TYPE removed X XFri Apr 5 22:50:51 1996 Joerg Schilling X * star_unix.c 1.8 X #endif lint -> #endif for ANSI, mconfig.h X __hpux added for 1024 Bytes st_blocksize X HAVE_UTIMES, HAVE_UTIME_H new, utimes simulation new X XFri Apr 5 22:40:14 1996 Joerg Schilling X * star.c 1.44 X #endif lint -> #endif for ANSI, HAVE_SETREUID, HAVE_SETEUID new X XFri Apr 5 22:35:31 1996 Joerg Schilling X * remote.c 1.10 X #endif lint -> #endif for ANSI, HAVE_SYS_MTIO_H, HAVE_MTGET_DSREG, MTxxx > 7 in #ifdef X XFri Apr 5 21:37:56 1996 Joerg Schilling X * star.h 1.18 X f_spare* not even for BSD4_2 X XFri Apr 5 21:36:48 1996 Joerg Schilling X * fifo.c 1.4 X #endif lint -> #endif for ANSI, _SC_PAGE_SIZE (HP/UX & OSF), MAP_ANONYMOUS (HP/UX) X XFri Apr 5 20:55:38 1996 Joerg Schilling X * lhash.c 1.4 X #endif lint -> #endif for ANSI, mconfig.h -> HAVE_STDLIB_H X XFri Apr 5 20:50:13 1996 Joerg Schilling X * header.c 1.14 X #endif lint -> #endif for ANSI, f_spare* not even for BSD4_2 X XSat Dec 30 01:06:51 1995 Joerg Schilling X * extract.c 1.13 X * dirtime.c 1.5 X * create.c 1.18 X * buffer.c 1.18 X * props.c 1.4 X * table.c 1.6 X * names.c 1.3 X * longnames.c 1.11 X * hole.c 1.5 X * diff.c 1.17 X * append.c 1.6 X * list.c 1.15 X #endif lint -> #endif for ANSI X XWed May 24 23:42:05 1995 Joerg Schilling X * header.c 1.13 X create info->f_rdev even for star format from f_rdevmaj & f_rdevmin X XWed May 24 17:22:34 1995 Joerg Schilling X * extract.c 1.12 X make_dir() to allow ANSI (dirs without '/' on the end) X XWed May 24 14:42:35 1995 Joerg Schilling X * dirtime.c 1.4 X Several changes to allow ANSI (dirs without '/' on the end) X XMon May 22 03:27:43 1995 Joerg Schilling X * Makefile 1.13 X gnulib for long long on sun3 X XMon May 22 03:23:54 1995 Joerg Schilling X * create.c 1.17 X nowarn var X XMon May 22 03:22:06 1995 Joerg Schilling X * create.c 1.16 X ulong -> Ulong, l_nlink < 0 testing X XMon May 22 03:18:10 1995 Joerg Schilling X * star.c 1.43 X * longnames.c 1.10 X * list.c 1.14 X * header.c 1.12 X ulong -> Ulong X XMon May 22 03:13:44 1995 Joerg Schilling X * buffer.c 1.17 X prstats() now using long long X XMon May 22 03:11:47 1995 Joerg Schilling X * star.h 1.16 X ulong -> Ulong, long long new X XMon May 22 00:52:37 1995 Joerg Schilling X * star_unix.c 1.6 X ulong -> Ulong, chown() -> lchown() X XMon May 22 00:50:23 1995 Joerg Schilling X * Makefile 1.12 X -Dchown=lchown for SVR4 removed X XSat May 20 20:52:23 1995 Joerg Schilling X * star.c 1.42 X patmatch() -> unsigned char X XSat May 20 20:17:47 1995 Joerg Schilling X * header.c 1.11 X t_name[NAMSIZ] = '\0' Hack moved to the back, for using t_uid on Solaris tar. X XMon Apr 24 18:31:18 1995 Joerg Schilling X * star.c 1.41 X hdrtype default: H_XSTAR, -qic250 Option, -T option, Signalhandler even for extract X XMon Apr 24 18:30:38 1995 Joerg Schilling X * star.1 1.7 X -T Option, -qic250 Option X XMon Apr 24 18:28:43 1995 Joerg Schilling X * header.c 1.10 X extern char *strcatl(); removed for ... Prototyp in standard.h X XTue Apr 18 17:02:29 1995 Joerg Schilling X * star.1 1.6 X -p Option in create (directories last) & SIGNALS X XTue Apr 11 18:41:37 1995 Joerg Schilling X * star.1 1.5 X description for ./ handling X XTue Apr 11 18:28:41 1995 Joerg Schilling X * star.1 1.4 X Several enhancements for FEATURES & Pathnames X XFri Apr 7 01:23:18 1995 Joerg Schilling X * longnames.c 1.9 X raise() -> raisecond() X XFri Apr 7 01:05:00 1995 Joerg Schilling X * create.c 1.15 X _FIOSATIME with rs_acctime() new. X XFri Apr 7 00:49:47 1995 Joerg Schilling X * star_unix.c 1.5 X rs_acctime new X XFri Apr 7 00:47:35 1995 Joerg Schilling X * star.c 1.40 X Typo in -help X XWed Apr 5 21:53:07 1995 Joerg Schilling X * star.1 1.3 X Minor changes X XTue Apr 4 18:18:19 1995 Joerg Schilling X * star.1 1.2 X First release of the man page X XTue Apr 4 07:09:28 1995 Joerg Schilling X * star.1 1.1 X date and time created 95/04/04 06:09:28 by joerg X XWed Mar 1 01:51:30 1995 Joerg Schilling X * create.c 1.14 X errno -> 0 und geterrno() around telldir() und seekdir() for recognition Bug in seek on Directory in Filesystemcode (/dev/fd) X XWed Mar 1 01:46:47 1995 Joerg Schilling X * star.c 1.39 X * remote.c 1.9 X signal() -> sigset() in SVR4 (reliable) X XWed Mar 1 01:45:47 1995 Joerg Schilling X * fifo.c 1.3 X loop around read() in swait() for EINTR in SVR4 X XThu Feb 16 14:57:51 1995 Joerg Schilling X * buffer.c 1.16 X swabbytes() into libschily X XSat Feb 11 23:12:15 1995 Joerg Schilling X * star.c 1.38 X * buffer.c 1.15 X new Option -fifostats X XSat Feb 11 22:08:01 1995 Joerg Schilling X * star_unix.c 1.4 X * header.c 1.9 X SYS5_4 -> SVR4 new define X XSat Feb 11 22:04:43 1995 Joerg Schilling X * dir.h 1.2 X sys/dir.h -> dirent.h for SVR4 X XSat Feb 11 21:58:52 1995 Joerg Schilling X * remote.c 1.8 X extern int errno; -> #include , find() -> strchr(), signalhandler with arg for SVR4 X XSat Feb 11 21:56:10 1995 Joerg Schilling X * star.c 1.37 X setreuid(-1, getuid()) -> seteuid(getuid()), find() -> strchr(), signalhandler with arg for SVR4 X XSat Feb 11 21:53:03 1995 Joerg Schilling X * star_unix.c 1.3 X extern int errno; -> #include X XSat Feb 11 21:19:35 1995 Joerg Schilling X * fifo.c 1.2 X getdtablesize() -> sysconf(_SC_OPEN_MAX), roundup local for SVR4 & bzero() -> fillbytes() X XSat Feb 11 21:18:10 1995 Joerg Schilling X * create.c 1.13 X getdtablesize() -> sysconf(_SC_OPEN_MAX) for SVR4 X XSat Feb 11 21:12:41 1995 Joerg Schilling X * buffer.c 1.14 X find() -> strchr() X XFri Feb 10 15:58:55 1995 Joerg Schilling X * list.c 1.13 X * append.c 1.5 X * extract.c 1.11 X * diff.c 1.16 X finfo init with fillbytes (for f_flags * F_HAS_NAME) X XFri Feb 10 15:41:17 1995 Joerg Schilling X * diff.c 1.15 X abs_path & skip_slash() slightly modified X XFri Feb 10 15:40:48 1995 Joerg Schilling X * extract.c 1.10 X abs_path & skip_slash() new but mot jet ready X XFri Feb 10 15:35:43 1995 Joerg Schilling X * create.c 1.12 X abs_path & skip_slash() prepared X XFri Feb 10 02:13:00 1995 Joerg Schilling X * star.c 1.36 X chdrtype was without -H-Flag for -create modified X XFri Feb 10 00:43:39 1995 Joerg Schilling X * remote.c 1.7 X RMT_VERSION 1 Commands X XWed Nov 23 20:13:56 1994 Joerg Schilling X * star.c 1.35 X * diff.c 1.14 X New var abs_path X XWed Nov 23 03:52:04 1994 Joerg Schilling X * header.c 1.8 X oldtar var removed & hdrtype display new X XTue Nov 22 16:32:25 1994 Joerg Schilling X * star.h 1.1 X hdrtxt[] in header.c new X XTue Nov 22 16:31:38 1994 Joerg Schilling X * star.c 1.34 X oldtar var removed X XMon Nov 21 20:13:37 1994 Joerg Schilling X * star.c 1.33 X oldtar handling new X XMon Nov 21 19:55:41 1994 Joerg Schilling X * star.h 1.13 X PATH_MAX Macro modified X XMon Nov 21 19:43:31 1994 Joerg Schilling X * Makefile 1.10 X fifo.c new X XMon Nov 21 19:31:26 1994 Joerg Schilling X * buffer.c 1.13 X * star.c 1.32 X Modified for fifo X XMon Nov 21 19:30:24 1994 Joerg Schilling X * header.c 1.7 X swabbytes modified for Fifo & check == 0 (correct EOF recognition) X Volheader Hack for list Module (save name[NAMESIZ] & linkname[NAMSIZ]) X XMon Nov 21 17:47:47 1994 Joerg Schilling X * hole.c 1.4 X sparse Option X XMon Nov 21 17:40:03 1994 Joerg Schilling X * fifo.c 1.1 X date and time created 94/11/21 17:40:03 by joerg X XMon Nov 21 15:55:22 1994 Joerg Schilling X * star.h 1.12 X xstar Format X XMon Nov 21 13:14:27 1994 Joerg Schilling X * diff.c 1.13 X limit transfer size in cmp_file to bigsize == allocated diff buf X XMon Nov 21 13:12:47 1994 Joerg Schilling X * remote.c 1.6 X better errno display X XMon Nov 21 12:12:35 1994 Joerg Schilling X * fifo.h 1.1 X date and time created 94/11/21 12:12:35 by joerg X XSat Nov 19 17:04:42 1994 Joerg Schilling X * props.h 1.3 X * props.c 1.3 X VOLHDR new X XSat Nov 19 16:57:37 1994 Joerg Schilling X * extract.c 1.9 X Changes for fifo X keep_old Flag & Volhdr X XSat Nov 19 16:54:15 1994 Joerg Schilling X * create.c 1.11 X Changes for fifo X LNKTYPE Bug X XSat Nov 19 16:48:59 1994 Joerg Schilling X * list.c 1.12 X * longnames.c 1.8 X New functionality for tcb_to_name X XSat Nov 19 15:30:55 1994 Joerg Schilling X * remote.c 1.5 X Bug when reading 0 Bytes X XSat Nov 12 18:01:09 1994 Joerg Schilling X * diff.c 1.12 X cmp_sparse X XFri Nov 11 13:57:27 1994 Joerg Schilling X * props.c 1.2 X * props.h 1.2 X several new Flags (LONG NAMES, SPARSE ...) X XFri Nov 11 13:55:13 1994 Joerg Schilling X * header.c 1.6 X better checksum X better Tar recognition X SPARSE & xstar Format X XFri Nov 11 13:52:56 1994 Joerg Schilling X * create.c 1.10 X list_tcb -> list_file without TCB Parameter & SPARSE & X cr_file with new Parameter X better recognition for File changed size X XFri Nov 11 13:41:03 1994 Joerg Schilling X * extract.c 1.8 X list_tcb -> list_file without TCB Parameter & SPARSE Files X XFri Nov 11 13:39:11 1994 Joerg Schilling X * longnames.c 1.7 X tcb_undo_split & cr_file with new Parameter X XFri Nov 11 13:37:54 1994 Joerg Schilling X * star.c 1.31 X new Header Type xstar X XFri Nov 11 13:37:01 1994 Joerg Schilling X * diff.c 1.11 X * list.c 1.11 X * append.c 1.4 X list_tcb -> list_file without TCB Parameter X XMon Oct 31 22:38:41 1994 Joerg Schilling X * header.c 1.5 X put_tcb new and better X create gnutar too X XMon Oct 31 22:35:51 1994 Joerg Schilling X * diff.c 1.10 X omit call to name_to_tcb() X XMon Oct 31 22:34:57 1994 Joerg Schilling X * longnames.c 1.6 X name_to_tcb interface new X add "/" even on very long Filenames X XMon Oct 31 22:32:36 1994 Joerg Schilling X * create.c 1.9 X name_to_tcb interface new X XMon Oct 31 18:52:05 1994 Joerg Schilling X * create.c 1.8 X Longname handling new X long name dirs corrected X XMon Oct 31 18:50:58 1994 Joerg Schilling X * longnames.c 1.5 X Longname handling new X XMon Oct 31 18:49:46 1994 Joerg Schilling X * star.c 1.30 X sparse option X XMon Oct 31 18:00:32 1994 Joerg Schilling X * star.h 1.11 X * star_unix.c 1.2 X info->f_flags new X XMon Oct 31 14:47:03 1994 Joerg Schilling X * table.c 1.5 X xttost (xt to star) table corrected X Index 20-32 is not always F_SPEC X XMon Oct 31 14:45:06 1994 Joerg Schilling X * star.c 1.29 X Uname & Gname diff X Several mods for very long Filenames X XMon Oct 31 14:42:11 1994 Joerg Schilling X * diff.h 1.3 X UNAME & GNAME Option X XMon Oct 31 14:41:38 1994 Joerg Schilling X * header.c 1.4 X * longnames.c 1.4 X * list.c 1.10 X * hole.c 1.3 X * extract.c 1.7 X * diff.c 1.9 X * create.c 1.7 X * append.c 1.3 X Several mods for very long Filenames X XMon Oct 31 14:39:09 1994 Joerg Schilling X * Makefile 1.9 X props.c & props.h for gnutar & very long Filenames X XMon Oct 31 14:37:46 1994 Joerg Schilling X * props.h 1.1 X date and time created 94/10/31 14:37:46 by joerg X XMon Oct 31 14:37:45 1994 Joerg Schilling X * props.c 1.1 X date and time created 94/10/31 14:37:45 by joerg X XThu Oct 27 22:17:18 1994 Joerg Schilling X * create.c 1.6 X empty unreadable Files now on tape X XWed Oct 26 15:26:51 1994 Joerg Schilling X * Makefile 1.8 X include Path corrected (star/new -> star) X XWed Oct 26 14:29:29 1994 Joerg Schilling X * header.c 1.3 X New Filetype system with Tables (remove rest if tested enough) X XSat Oct 8 13:14:10 1994 Joerg Schilling X * diff.c 1.8 X first read tcb then mod diffopts to avoid wrong atime & ctime comparison with ustar & oldtar X XFri Oct 7 23:05:14 1994 Joerg Schilling X * table.c 1.4 X xttost_tab corrected X XFri Oct 7 22:53:57 1994 Joerg Schilling X * table.c 1.3 X Several Filetypes mapped to S_IFREG, mappt for non existence X XFri Oct 7 21:15:45 1994 Joerg Schilling X * table.c 1.2 X xttous_tab socket from \0 -> REGTYPE X XFri Oct 7 14:28:45 1994 Joerg Schilling X * header.c 1.2 X bar & more cpio recognition X Record Numberprintf on errors X First ustar create Support X star_unix.c extracted X devminorbits for SYSV support X XFri Oct 7 14:25:25 1994 Joerg Schilling X * Makefile 1.7 X star_unix.c from header.c X XFri Oct 7 14:14:03 1994 Joerg Schilling X * table.c 1.1 X date and time created 94/10/07 14:14:03 by joerg X XFri Oct 7 14:13:59 1994 Joerg Schilling X * table.h 1.1 X date and time created 94/10/07 14:13:59 by joerg X XFri Oct 7 14:09:31 1994 Joerg Schilling X * star_unix.c 1.1 X date and time created 94/10/07 14:09:31 by joerg X XTue Oct 4 23:44:41 1994 Joerg Schilling X * star.h 1.10 X New archive types & minorbits for SYSV & bar header & f_xftype X XTue Oct 4 23:42:12 1994 Joerg Schilling X * list.c 1.9 X table.h new X XTue Oct 4 22:41:43 1994 Joerg Schilling X * extract.c 1.6 X xsymlink for SET_CTIME (in ..._unix.c) X XTue Oct 4 01:04:21 1994 Joerg Schilling X * dirtime.c 1.3 X SET_CTIME define & new Option X XTue Oct 4 00:32:34 1994 Joerg Schilling X * Makefile 1.6 X header.c from star.c extracted & table.c new X XTue Oct 4 00:24:23 1994 Joerg Schilling X * list.c 1.8 X acctime & ctime in Listing && New Filetyp handling with table X XTue Oct 4 00:10:20 1994 Joerg Schilling X * star.c 1.28 X New Option -H (header type) & prstats with signals & SIGQUIT only statistics X XTue Oct 4 00:05:07 1994 Joerg Schilling X * longnames.c 1.3 X -oldtar now again correctly displays: name too long X XTue Oct 4 00:03:10 1994 Joerg Schilling X * buffer.c 1.12 X tblocks() now using new var "reading" for read/write X XMon Jun 13 00:48:49 1994 Joerg Schilling X * star.c 1.27 X header.c extracted X XMon Jun 13 00:45:09 1994 Joerg Schilling X * create.c 1.5 X curfs -> ulong X XWed Jun 8 20:05:34 1994 Joerg Schilling X * star.c 1.26 X hack for major/minor (SysV) X XWed Jun 8 19:39:04 1994 Joerg Schilling X * Makefile 1.5 X hole.c & longnames.c X XWed Jun 8 19:39:04 1994 Joerg Schilling X * star.c 1.25 X f_rdevmaj & f_rdevmin & rdev diffopt X XWed Jun 8 19:34:17 1994 Joerg Schilling X * list.c 1.7 X * star.h 1.9 X f_rdevmaj & f_rdevmin X XTue Jun 7 15:46:47 1994 Joerg Schilling X * diff.h 1.2 X * diff.c 1.7 X rdev diffopt X XMon Jun 6 20:30:20 1994 Joerg Schilling X * star.c 1.24 X setreuid(-1,getuid()) allows star suid root for remote dump X XMon Jun 6 20:29:15 1994 Joerg Schilling X * buffer.c 1.11 X openremote extracted X XMon Jun 6 18:05:14 1994 Joerg Schilling X * diff.c 1.6 X * star.c 1.23 X Display bug uname/gname on not mappable id's corrected for diff.c X XFri Jun 3 15:40:13 1994 Joerg Schilling X * remote.c 1.4 X SO_SNDBUF & SO_RCVBUF in #ifdef X XTue Dec 21 06:42:21 1993 Joerg Schilling X * diff.c 1.5 X avoid permission denied on f_size == 0 && debug changes X XFri Dec 3 01:28:30 1993 Joerg Schilling X * diff.c 1.4 X Listfile option corrected X XThu Dec 2 14:36:05 1993 Joerg Schilling X * list.c 1.6 X New Option -newest_file && Display bug (id) for -newest corrected X XThu Dec 2 14:35:17 1993 Joerg Schilling X * star.c 1.22 X New Option -newest_file X XThu Dec 2 14:34:10 1993 Joerg Schilling X * extract.c 1.5 X setmodes not for -to_stdout X XTue Nov 30 21:21:04 1993 Joerg Schilling X * star.c 1.21 X -qic120 tape vloume size corrected X XThu Nov 25 14:58:12 1993 Joerg Schilling X * star.c 1.20 X * buffer.c 1.10 X -no_statistics option X XSun Oct 17 22:39:55 1993 Joerg Schilling X * star.c 1.19 X bs= option X XSat Oct 16 21:54:54 1993 Joerg Schilling X * star.c 1.18 X * extract.c 1.4 X -to_stdout flag X XFri Oct 15 12:47:43 1993 Joerg Schilling X * star.c 1.17 X -qicxxx options documented X XThu Oct 14 15:09:32 1993 Joerg Schilling X * star.c 1.16 X -numeric option X XThu Oct 14 15:09:14 1993 Joerg Schilling X * list.c 1.5 X -numeric option X XThu Oct 14 14:49:57 1993 Joerg Schilling X * list.c 1.4 X * star.c 1.15 X * star.h 1.8 X Uname/Gname display in list X XWed Oct 13 17:58:17 1993 Joerg Schilling X * star.c 1.14 X set rsize to 0 only for LNKTYPE & DIRTYPE X XWed Oct 13 15:42:02 1993 Joerg Schilling X * star.c 1.13 X * star.h 1.7 X * longnames.c 1.2 X Header recognition new X XWed Oct 13 14:27:33 1993 Joerg Schilling X * star.h 1.6 X gnutar definitions added X XWed Oct 13 14:26:02 1993 Joerg Schilling X * star.c 1.12 X MIN macro -> MINUTE X XTue Oct 12 23:03:13 1993 Joerg Schilling X * hole.c 1.2 X ommit info->f_size comparison X XTue Oct 12 17:50:38 1993 Joerg Schilling X * star.c 1.11 X force_hole option moved before f= option to work correctly X XTue Oct 12 17:23:48 1993 Joerg Schilling X * star.c 1.10 X omagic -> stmagic & -force_hole X XTue Oct 12 17:22:57 1993 Joerg Schilling X * star.h 1.5 X ustar header added X XTue Oct 12 17:16:49 1993 Joerg Schilling X * extract.c 1.3 X -force_hole option X XTue Oct 12 17:15:35 1993 Joerg Schilling X * hole.c 1.1 X date and time created 93/10/12 17:15:35 by joerg X XTue Oct 12 11:15:07 1993 Joerg Schilling X * remote.c 1.3 X remote status -> debugging X XTue Oct 12 01:04:10 1993 Joerg Schilling X * buffer.c 1.9 X correct buffersize & better error messages X XTue Oct 12 01:02:35 1993 Joerg Schilling X * star.c 1.9 X initbuf & opentape reversed (for remote.c) X XMon Oct 11 16:06:19 1993 Joerg Schilling X * buffer.c 1.8 X -time option X XMon Oct 11 16:06:06 1993 Joerg Schilling X * star.c 1.8 X -time option X XFri Oct 8 23:36:55 1993 Joerg Schilling X * longnames.c 1.1 X date and time created 93/10/08 23:36:55 by joerg X XFri Oct 8 21:38:17 1993 Joerg Schilling X * buffer.c 1.7 X cnt == 0 -> bigcnt == 0 in read.. X XFri Oct 8 16:11:36 1993 Joerg Schilling X * create.c 1.4 X * extract.c 1.2 X * diff.c 1.3 X * dirtime.c 1.2 X long Filenames X XFri Oct 8 15:45:04 1993 Joerg Schilling X * star.c 1.7 X signed_checksum flag & long Filenames X XFri Oct 8 15:21:52 1993 Joerg Schilling X * lhash.c 1.3 X long Filenames X XFri Oct 8 15:21:00 1993 Joerg Schilling X * list.c 1.3 X vprint using fprintf & long Filenames X XFri Oct 8 15:15:33 1993 Joerg Schilling X * names.c 1.2 X namelen added X XFri Oct 8 15:14:41 1993 Joerg Schilling X * remote.c 1.2 X debug flag X XFri Oct 8 14:33:50 1993 Joerg Schilling X * buffer.c 1.6 X excomerrno X XFri Oct 8 13:05:50 1993 Joerg Schilling X * star.h 1.4 X * append.c 1.2 X long Filenames X XFri Oct 8 12:56:14 1993 Joerg Schilling X * buffer.c 1.5 X debug flag & excomerr X XMon Sep 27 15:23:16 1993 Joerg Schilling X * Makefile 1.4 X names.c remote.c diff.c X XMon Sep 27 15:22:48 1993 Joerg Schilling X * names.c 1.1 X date and time created 93/09/27 15:22:48 by joerg X XMon Sep 27 15:21:30 1993 Joerg Schilling X * remote.c 1.1 X date and time created 93/09/27 15:21:30 by joerg X XMon Sep 27 15:20:56 1993 Joerg Schilling X * buffer.c 1.4 X remote first try X XMon Sep 27 15:20:25 1993 Joerg Schilling X * diff.c 1.2 X diff.h & diffopts X XMon Sep 27 15:19:45 1993 Joerg Schilling X * diff.h 1.1 X date and time created 93/09/27 15:19:45 by joerg X XMon Sep 27 15:18:19 1993 Joerg Schilling X * star.c 1.6 X diff option added X XSat Aug 7 15:18:57 1993 Joerg Schilling X * Makefile 1.3 X append.c cmpbytes.c diff.c new X XSat Aug 7 15:17:16 1993 Joerg Schilling X * diff.c 1.1 X date and time created 93/08/07 14:17:16 by joerg X XSat Aug 7 15:16:29 1993 Joerg Schilling X * append.c 1.1 X date and time created 93/08/07 14:16:29 by joerg X XSat Aug 7 15:15:36 1993 Joerg Schilling X * star.c 1.5 X -C flag, ([r/u]flag started) -nochown Headertype recognition started X XSat Aug 7 15:09:27 1993 Joerg Schilling X * buffer.c 1.3 X Blocksize recognition & DO8 Macro X XSat Aug 7 15:08:21 1993 Joerg Schilling X * list.c 1.2 X New Option -listnew X XSat Aug 7 15:06:32 1993 Joerg Schilling X * star.h 1.3 X TSWMAGIC corrected & Headertype recognition X XMon Nov 16 16:25:41 1992 Joerg Schilling X * create.c 1.3 X intr() in createlist() X XMon Nov 2 00:20:52 1992 Joerg Schilling X * star.c 1.4 X Usage & read ANSI as old tar X XMon Nov 25 11:21:17 1991 Joerg Schilling X * star.c 1.3 X Timestamp File X XMon Feb 25 01:21:00 1991 Joerg Schilling X * create.c 1.2 X closedir for createi(dir) X XSat Feb 9 20:21:10 1991 Joerg Schilling X * buffer.c 1.2 X Multiple tapes X XThu Jan 31 17:20:19 1991 Joerg Schilling X * buffer.c 1.1 X date and time created 91/01/31 17:20:19 by joerg X XTue May 30 12:01:59 1989 Joerg Schilling X * star.c 1.2 X star divided into (star extract list create) X... X XSCCS revision info lost X XFirst full version made in 1985 END-of-star-1.6/Changelog echo x - star-1.6/.clean sed 's/^X//' >star-1.6/.clean << 'END-of-star-1.6/.clean' X#!/bin/sh Xrm -rf */OBJ */*/OBJ libs/* incs/* Xrm -f core */core */*/core Xrm -f .EDT* */.EDT* */*/.EDT* Xrm -f .vedt* */.vedt* */*/.vedt* Xrm -f *.bak */*.bak */*/*.bak Xrm -f */tags */*/tags Xrm -f */TAGS */*/TAGS Xrm -rf proto/* packages/* X Xif [ -f .links ]; then X rm -f `cat .links` Xfi END-of-star-1.6/.clean echo x - star-1.6/AN-1.5 sed 's/^X//' >star-1.6/AN-1.5 << 'END-of-star-1.6/AN-1.5' XStar is the fastest tar archiver for UNIX X XStar has many improvements compared to other tar Ximplementations (including gnu tar). See below for a short description Xof the highlight of star. X XStar is located on: X Xftp://ftp.berlios.de/pub/star X XChanges since star-1.4: X X/*--------------------------------------------------------------------------*/ XBetween star-1.4 and star-1.5, there have been more changes than in the Xwhole life of star untill star-1.4. X XImportant changes as an overview: X X- Changed license from GPL to CDDL X X- There are really many new features and the codesize was doubled X X- star now includes code to emulate different Command line interface types. X The following CLI are currently implemented: X X - star -> the classical star CLI X X - suntar -> the UNIX SUSv2 OpenGroup standard CLI with Sun X enhancements X X - cpio -> the UNIX SUSv2 OpenGroup standard CLI with SVr4 X enhancements X X - pax -> the POSIX.1-2001 standard CLI X X - gnutar -> the CLI from GNU tar 1.14 X X The command lind interface is automatically selected from argv[0]. X X- True and reliable incremental backup/restore has been implemented using X the basic ideas from ufsdump/ufsrestore. Whether a file gets archived X on an incremental depends on the dump level and the time of the last X incremental or full backup. Whether a file needs to be renamed or X removed while restoring incrementals depends on the data in a database X that is created for the period of time of the incremental restore. The X database contains file names as well as old and new inode numbers. X X- A configurable error control mechanism allows to selectively ignore X certain problems. X X- Star now implements a fast and reliable -copy option. X X- Star now implements true and efficient Sparse file support for X Solaris 11 (and Solaris 10 updates). X X- Star now implements reliable multi-volume support with automated tape X end/size recognition X X- Star now uses "libfind" and thus allows to use find(1) syntax in star X command lines. X X- New program "tartest" reads TAR archives from "stdin" and prints X a list of non-compliances with POSIX.1-1990 X X Call e.g. X tar cf - | tartest X X To check your favorite TAR implementation against POSIX.1-1990 X X X/*--------------------------------------------------------------------------*/ XAll changes in a fine grained list: X X- Significant speed up for creating POSIX.1-2001 extended TAR headers X X When star creates archives with POSIX.1-2001 extended TAR headers, X it needs to create twice as many TAR headers as with 'classic' TAR X archives. In addition the POSIX.1-2001 meta information needs to be X coded. X X While it is impossible to speed up the creation of the additional X TAR headers, the coding of the POSIX.1-2001 meta information has now X been implemented in a way that now only spends half of the time X compared to the time used up by star-1.4 X X- Speed up the recognition of POSIX.1-2001 extended header tags X X- Diff code now is able to compare the number of hard links to X a file if the archive is in -dump (exeustar) format. X X- List code now includes hard link count in the long listing if the X archive is in -dump (exeustar) format. X X This allows to see the difference in the number of hard links X in diff mode if the archive is in POSIX.1-2001 extended -dump X (exeustar) format. X X- Diff code now is able to compare the directory content if the X archive is in -dump (exeustar) format. X X This allows star to tell whether the target directory on disk X includes more files than the archive. This property is X needed in incremental restore mode to remove files that X have been removed between incremental dumps. X X NEW FEATURE: you now can compare two directory trees on disk X with only one run of star by calling: X X star -C fromdir -c -dump . | star -C todir -diff -v X X or X X star -C fromdir -c -dump . | star -C todir -diff -vv X X Star will now even complain if the directory 'todir' contains X more files than the directory 'fromdir'. X X- New diffopt= 'dir' to tell star whether to compare or X dir content if the archive is in -dump (exeustar) format. X X- Enhanced autoconf code for OS/2 X X- Add socket lib definition to RULES to allow networking programs X to work X X- Check whether readlink() is present to allow compilation on OS/2 X X- Check whether symlink() is present to allow compilation on OS/2 X X- Check whether chown() is present to allow compilation on OS/2 X X- fexec.c in libschily now uses ';' as PATH Environment delimiter X for EMX to allow path search to work on OS/2 too. X X- Call setmode(stdin/stdout, O_BINARY) on OS/2 EMX too. X X- Now call setmode(pipe, O_BINARY) on _both_ sides of the compress pipe. X This should affect OS/2 _and_ Cygwin. X X- Work around a OS/2 EMX bug that causes star to dump core if the X FIFO code correctly closes the unused parts of the pipes that X are used o synchronize the cache. X X This was caused by attaching the shared memory segment too late X to the child process. X X- In create mode try always to avoid to need to call X X telldir()/closedir()/opendir()/seekdir() X X by reading the directory content into allocated memory. X This may cause problems on systems that are low with memory. X This is implemented in the new function fetchdir(). X X- New option -lowmem to tell star to behave as before. X With -lowmem is used, star does not malloc() the dir content X and defaults to 1 MB FIFO size (see above) X X- include the directory content (names and inode numbers) in the X extended POSIX.1-2001 header if in -dump mode. X X Star uses a vendor unique extended POSIX.1-2001 header tag named X X SCHILY.dir X X The tags X X SCHILY.ddev X SCHILY.dino X X are used with incremental dumps. They are used only if the dump level X is greater than 0. They are neded to allow star in incremental restore X mode to know which files have been removed before the tape has X completely passed. For this reason, star will be able X to do incremental restores even if the filesystem is nearly full. X X X- Fixed a bug introduced by applying a patch from 8.3.2002 X from Andreas Gruenbacher X X The bug caused a needed ',' to be omited from the ACL string X in extract mode if the target platform did not have named entries X in the passwd file and the ACL string was converted to use the X numeric user id instead. X X- Fixed a bug that caused star to complain X X "star: Cannot handle multi volume archives from/to stdin/stdout." X X if called "star -c f=- ..." or "star cf - ...". X X- Fixed a bug that did not allow it to specify the keyword "nlink" with the X diffopts= option. Old star versions did not implement this option and thus X it has been forbidden before. X X- Make sure that Base 256 coding is only used in the "classical tar headers" X if the receiving archive format will understand it. X X X- Fixed a bug in star that caused star to create wrong filenames if the X POSIX.1-1990 file name prefix was exactly 155 chars _and_ the X reserved field in the TAR header that directly follows the prefix X field included non-null characters. X X- Call fflush(vpr) before executing volume change script X to sync output from star with output from the script. X Thanks to a hint from Abramo Bagnara X X- Do not open /dev/tty in case that a volume change script X has been specified. This allows star to be called from X a cron script. X X- Fix a minor bug in the new diff code. The bug caused that X star -diff -vv used on TAR archives created with -dump X not to print all directory differences. X X - If one of both (the dir in the archive or the dir on X disk) was empty no file list was printed X X - If one of the sorted lists was longer than the other X starting from some point, the rest of filenames X was not printed. X X The pure fact that the directories were different however X was always printed. X X- New directory 'testscrips/' with data for the program 'tartest'. X X- A 20 year old extension has been removed from libschily/format.c X This caused printf() to interpret %X as %lX. This caused noticable X problems on IA-64. It should have created problems on True64 X and on 64 bit Sparc programs too but was not directly visible X due to a different stack content. X X- #elif removed to avoid GCC-3.x warnings X X- several new autoconf tests for 'struct mtget' members X X- remote tape client code now uses a new abstract 'struct rmtget' X to avoid that 'mt status' for a remote tape drive depends on X the least common denominator from both (local and remote) systems. X X- -wready option now also looks for EBUSY which allows X to use star and mt to wait for remote tape drive to become X ready again. This option should be used if you like to do a series X of backups as it may be that writing the EOF mark blocks X the tape for a while. X X- -wready now waits up to 120 seconds for the tape drive to X become ready X X- star manpage enhanced to reflect the new sense for -wready X X- With FIFO enabled (default since 1994) star is now able to X exit() with a correct exit code != 0 if a write error occurs X on the tape. Due to a missing feature, star did exit(0) if the X fifo was active. X X- star man page enhanced to mention the new diff properties that X are present when using the -dump option. X X- Remote tape client code has been made a bit faster (5-10%) X X- Remote tape client code now includes a new interface for an X abstract 'struct mtget'. This allows the mt program to work X more smoothly when issuing a remote status command. X X Before the result was caused by the least common denominator X of both, the local and the remote system. With the enhancements, X the outout of the mt program with the 'status' opcode only depends X on the properties of the remote system where the tape is connected X to. X X- mt program now also supports -wready option X X- mt program has new opcode 'nop' to allow mt to be used X as stand alone program to wait for a tape to become ready X by calling "mt -wready nop" X X- mt program now supports the new abstract remote tape interface X for struct mtget. X X- Remote MT client code moved into 'librmt'. X I also modified the code in a way that allows to compile librmt X in a way that does not need libschily in order to work if the X OS is at least UNIX-98 compliant. X X This makes it possible to use a complete portable remote tape access X solution in any application. X X If someone is interested to get a BSD licensed version of librmt X please contact me! X X- Special support for an ndocumented but unfortunately important X "feature" for symlinks on HP-UX. X X Now star tries to retain the permissions of a symlink by X setting umask() before creating the symklink. X X- Fixed a bug in _fileread() that caused a lseek() return code X not to be evaluated correctly. X X- Fixed a bug in create_dirs() that may have caused incorrect behavior X when a non-directory should be converted into a directory. X X- Fixed a bug in create_dirs() that caused an endless loop if trying X to extract e.g. X X dir1/dir2/file X X When X X dir1 X X Exists and may not be written to. X X X- Auto-create dependencies for HP-UX bundled C-compiler X X- Auto-create dependencies for AIX C-compiler X X- Reworked 'librmt' now allows to use star in remote mode without X being installed suid root. X X To force star to use rsh(1) instead of rcmd(3), use X X env RSH=rsh star ... X X To tell star to use a different RMT server, call X X env RMT=/path/to/rmt star .... X X NOTE: Transfer speed is much slower if star does not use rcmd(3) X in root mode to establish the remote connection. If you like to X do fast, always make sure to be root or install star suid root. X X For late 2002, we know that the following programs X are broken and do not implement signal handling correctly: X X rsh on SunOS-5.0...SunOS-5.9 X ssh from ssh.com X ssh from openssh.org X X Sun already did accept a bug report for 'rsh'. Meanwhile it could X help to call setsid() if we are running under X so the ssh X X pop up for passwd reading will work. X X For Solaris the following Bug requests are open: X X rsh/rlogin 4776756 X sun ssh 4777436 X X The source from OpenSSH.org has been fixed on Monday 11.11.2002. X X Due to the signal handling bug, star will die if you try to type X ^\ (SIGQUIT) to get an intermediate status summary. Star will X also not be able to write the current file to a logical end before X stopping because it received a SIGINT - this will result in X archives with a defective logical structure. X X X- Reworked 'librmt' allows to use ssh(1) to be used for remote tape X access. Use X env RSH=ssh star .... X or X env RSH=/usr/bin/ssh star .... X to tell star to use the secure shell to establish a remote tape X connection. Note that using the secure shell causes the transfer X speed to be significantly lower than for the default case where X a suid root star used rcmd(3) to set up the connection. X X X- Man pages for librmt new. X X- Include a patch from Andreas Gruenbacher to fix a problem with X illegal ACL comments in linux tar archives that caused star X to be unable to extract the archive. X X- Add support for *BSD SIGINFO (SIGINFO has been added by BSD in 1990) X We do support intermediate status printing much longer but triggered X by SIGQUIT (^\). X X- Major rework for "rmt" man page X X- Make "rmt" return the string "PIPE" if "stdin" is connected to a pipe. X This allows to use ssh(1) for the remote tape interface. X X- changes to reflect new interfaces of 'librmt'. X X- 'mt' command renamed to 'smt' to allow it to be installed as X alternate mt program to be used for backup purposes X X- follow the strange POSIX rules for the strerror() behavior X X- Support for sparc64-freebsd X X- Try to work around a bug in OpenBSD. X OpenBSD defines EOF in ctype.h but POSIX only mentions an EOF definition X for stdio.h. If we include ctype.h before schily.h on OpenBSD while X stdio.h has not been included, this will fail. X X- Support for BSDi version 4.x X X- Support for i786-cygwin32_nt X X- RMT program now supports IPv6 X X- Fix a bug that caused star to dump core with star -diff -vv X if the archive has been created with star -c -dump and the X target directory in the filesystem was not readable. X X- Fixed a bug that caused star to be unable to correctly deal with X ACLs where the user or group name contains spaces. X X- Workaround for reading rotten archives caused by above bug. X X- Fixed a bug that caused star to create broken archives if X the POSIX.1-2001 extended format is used for sparse files > 8 GB. X For this reason, a new extended header tag SCHILY.realsize has X been added. X X- New option -no-xheader disables PORIX.1-2001 extended headers X regardless of the archiveformat. This may help to read archives X that have been created with previous versions of star if there X is a sparse file > 8 GB in the archive. X X- New Option xdebug= # X Currently star xdebug=1 tells star tu print a dump of the internal X datatructures for every file ifin list or extract mode. X X- Allow floating point printing on OS/2. This has been possible X since 11/2001 but OS/2 has been forgotten. X X- Correct OS/2 ranlib handling X X- New architecture 9000-831-hp X X- Include +DAportable in HP-UX cc options X X- Reordered and restructured librmt code to allow compilation on OS/2 X and hopefully other OS like BeOS X X- Fixed a bug that caused star to print '^Aname' instead of 'name' X in extended directory diff mode. X X- Fixed a bug that caused star to dump core on UNIX-98 TAR compat mode X with e.g. 'star cbv' because star did not check for the missing arg to X the -b option. X X- Fixed a bug in POSIX.1-2002 mode (SCHILY dir namelist extension) that X resulted in wrong directory name lists (used for diff mode only) if X the directory contained japanese filenames. The bug was present because X star did not move enough space if the filename length changed when X converting to Unicode. X X- Fixed a typo (R_RDONLY instead of O_RDONLY) in fctldefs.h X X- Support for macppc-netbsd-cc NetBSD on MAC HW. X X- Fixed a minor typo in the star man page. X Thanks to Eric Raymond X X- 'star -n -tpath ...' now only prints the pathnames to allow X to use the output directly in scripts. If you like the old X behavior, use 'star -nv ...' X X- Better autoconfiguration for librmt and its users yields in better X compilation and portability results for OS that do not support the X needed internet features for remote tape support. X X- mt.c adopted to the better autoconf support in librmt X X- New option errctl= name X Use the file name as error control file. The reason X for using an error control file is to make star quiet X about error conditions that are known to be irrelevant X on the quality of the archive or restore run. A typical X reason to use error control is to suppress warnings X about growing log files while doing a backup on a life X file system. X X The list of error conditions to be handled may use one X or more (in this case separated by a '|' character) X identifiers from the list below: X X ABORT If this meta condition is included in an X error condition, star aborts (exits) as X soon as possible after this error condition X has been seen instead of making star quiet X about the condition. This error condition X flag may only be used together with at X another error condition or a list of error X conditions (separated by a '|' character). X X WARN If this meta condition is included in an X error condition, star prints the warning X about the error condition but the error X condition does not affect the exit code of X star and the error statistics (which is X printed to the end) does not include the X related errors. This error condition flag X may only be used together with at another X error condition or a list of error condi- X tions (separated by a '|' character). The X WARN meta condition has a lower precedence X than ABORT. X X DIFF Suppress output in case that star -diff did X encounter any differences. X X ALL This is a shortcut for all error conditions X below. X X STAT Suppress warnings that star could not X stat(2) a file. X X GETACL Suppress warnings about files on which star X had problems to retrieve the ACL informa- X tion. X X OPEN Suppress warnings about files that could X not be opened. X X READ Suppress warnings read errors on files. X X WRITE Suppress warnings write errors on files. X X READLINK Suppress warnings readlink(2) errors on X symbolic links. X X GROW Suppress warnings about files that did grow X while they have been archived. X X SHRINK Suppress warnings about files that did X shrink while they have been archived. X X MISSLINK Suppress warnings about files for which X star was unable to archive all hard links. X X NAMETOOLONG Suppress warnings about files that could X not be archived because the name of the X file is too long for the archive format. X X FILETOOBIG Suppress warnings about files that could X not be archived because the size of the X file is too big for the archive format. X X SPECIALFILE Suppress warnings about files that could X not be archived because the file type is X not supported by the archive format. X X GETXATTR Suppress warnings about files on that star X could not retrieve the extended file attri- X bute information. X X SETTIME Suppress warnings about files on that star X could not set the time information during X extraction. X X SETMODE Suppress warnings about files on that star X could not set the access modes during X extraction. X X SECURITY Suppress warnings about files that have X been skipped on extraction because they X have been considered to be a security risk. X This currently applies to all files that X have a '/../' sequence inside when -.. has X not been specified. X X LSECURITY Suppress warnings about links that have X been skipped on extraction because they X have been considered to be a security risk. X This currently applies to all link names X that start with '/' or have a '/../' X sequence inside when -secure-links has been X specified. In this case, star tries to X match the link name against the pattern in X the error control file. X X SAMEFILE Suppress warnings about links that have X been skipped on extraction because source X and target of the link are pointing to the X same file. If star would not skip these X files, it would end up with removing the X file completely. In this case, star tries X to match the link name against the pattern X in the error control file. X X BADACL Suppress warnings access control list X conversion problems. X X SETACL Suppress warnings about files on that star X could not set the ACL information during X extraction. X X SETXATTR Suppress warnings about files on that star X could not set the extended file attribute X information during extraction. X X If a specific error condition is ignored, then the error X condition is not only handled in a silent way but also X excluded from the error statistics that are printed at the X end of the star run. X X Be very careful when using error control as you may ignore X any error condition. If you ignore the wrong error condi- X tions, you may not be able to see real problems anymore. X X A typical error control file line might look this way: X X GROW */log/#[^/].log X X X- Typo in DEFAULTS files fixed X X- Better Next STep support: X X - Some workarounds for broken unistd.h X X - -lkvm removed from Next Step config. X X - waitdefs.h fixed for very old BSD based systems (~ 1980) X like Next STep X X - fixed typo in fctldefs.h R_RDONLY -> O_RDONLY X X- Better Portability for SCO UnixWare X X - New platforms i486, i586, Pentium III, Pentium Pro X X - Let strdefs.h also include strings.h for strcasecmp() X X - Support for missing struct sockaddr_storage X X - Support for broken wait3() (returns wrong timings) X X - Changed broken portability Prototype support in libfile X to use 'makefiles / prototype.h' based system X X - Changed fileopen() and filereopen() to avoid fdopen() X problems (does not accept mode string that does not X match fd flags) X X- Change autoconf/statdefs.h to support nanosecond support for SCO X UnixWare and FreeBSD X X- Call conf/mkdep-sco.sh via sh to be independent from 'x' bit. X X- starting to port ACL support to SCO UnixWare (not yet ready) X X- Removed option -I in preparation for using it in a different way X in future releases. X X- Trying to make the source get accepted by 'cstyle'. X X- changed conf/cc-config.sh to check for a bad PATH set up X (e.g. /usr/ucb before /opt/SUNWspro/bin) which would cause X problems to use cc on Solaris. X X- Second fix from Andreas Grünbacher for #default comments X in ACLs now also works correctly with multiple #default comments. X X- Warning: Environment STAR_FIFO_SIZE changed to STAR_FIFOSIZE X This is to make star and cdrecord behave similar. X X- Star now reads a file /etc/default/star for default parameters. X Currently implemented are: X X STAR_FIFOSIZE= X and X STAR_FIFOSIZE_MAX= X X STAR_FIFOSIZE= sets the FIFO size if no fs= option has been specified X STAR_FIFOSIZE_MAX= limits the FIFO size even if a fs= option has been specified X X- Try to avoid that the verbose or diagnostic messages are X sometimes lost if called on Linux via "ssh". Unfortunately, X this does not always help. If you like to make sure that X nothing gets lost, call: ssh host "star .... ; sleep 10" X X NOTE: The basic problem is caused ba a Linux bug X X X- Star now opens a file that is going to be extracted with O_DSYNC. X Thanks to a hint from Frank Batschulat from the Solaris filesystem X kernel team. X X On operating systems with a decent buffer cache implementation X (like Solaris), this speeds up extraction of many small or medium X sizes files (e.g. a Linux kernel TAR archive) by approx. 20% X On Linux, this change unfortunately is ineffective. X X X- New option -no-fsync to avoid calling fsync(2) for each file X if in extract mode. X X This helps to increase extraction speed on operating systems X with badly implemented buffer cache (e.g. Linux). X X Note that using this option may be dangerous as star will not X even be able to detect if a file could not be extracted correctly X if it has been called with -no-fsync X X Background information: X X Calling fsync(2) in star's extract mode has been introduced in 1999. X As star is developed on Solaris and on Solaris the performance degradation X that is caused by calling fsync(2) is close to imperceptible, no X performance tests have been made for this feature until recently. X X A few weeks ago, some people reported that GNU tar is much faster X than star when extracting files. X X Doing performance tests by extracting linux kernel TAR archives X leads to the following results: X X - Extraction on Solaris without calling fsync(2) did speed up X by ~ 40% compared to the standard case with calling fsync(2). X X - After O_DSYNC has been introduced, the speed difference X (compared to extraction without fsync) reduced to ~ 20% X X Extraction of a recent 2.4 Linux developer kernel archive X took 50 seconds with star's default that calls fsync and X 42 seconds with star -no-fsync (56 seconds with star-1.5a14) X X - On Linux (depending on filesystem type and disk type) X extraction without calling fsync(2) is 3x to 8x faster X than with the standard case that includes calling fsync. X X Star is developed for best possible data integrity while GNU tar X does not seem to care about data integrity. The fact that GNU tar X on Linux is much faster (for extraction) than star is no reason X to blame star but a reason to blame the quality of the Linux X buffer cache. Star will not change its default to a method that X gives less data integrity just to speed up compared to GNU tar. X X The Solaris kernel is developed for best speed with guaranteed X data integrity while the Linux kernel is developed for best speed X without caring for data integrity. If you like that star will X speed up in the star default (secure) mode, send a message to the X Linux kernel developers team and request a change that gives a X better behaviour of the Linux buffer cache. X X- New option level= # to set the current incremental dump level X X- New option tardumps=name to set file name for tar dump dates X file. This file is similar to the file /etc/dumpdates that X is manages by ufsdump. X X- New option -wtardumps to tell star update file for tar dump X dates if in dump mode. X X If you like to experiment with the new incremental dump features, X you should start this way: X X Create a level 0 dump: X X star -cM -dump -sparse level=0 -wtardumps -C /usr . X X Create a level 1 dump: X X star -cM -dump -sparse level=1 -wtardumps -C /usr . X X If you do not have files that changed the type, no files that X have been removed and no files that have been renamed, X star would already be able to do incremental restores. X X X- Better handling for the exitcode for star (needed for dump X handling). X X- Allow 'smt' to understand that EACCES for read-only open may X not be caused by a write protected tape but rather by access X problems for a remote tape drive. X X- Do no more archive the list of files in a directory X (usually done with -dump) if this directory is a mount X point and star has been told not to cross mount points. X X We cannot use the real content of the underlying dir X anyway and the content of the mounted FS makes no sense. X X Conclusion: try to use a filesystem snapshot whenever X possible. X X- Fixed a problem when extracting extended file flags on FreeBSD X Thanks to Marius Strobl X X- Added a workaround for permission problems when trying to extract X hard links to immutable files by resetting the flags, creating the link X and later restoring the flags. X Thanks to Marius Strobl X X- made handlecond()/raisecond() portable in libschily X X- Extended README.hpux to mention how to compile in 64 bit mode. X X- Added a security check for "/../" in the path for the "rmt" X program that helps to prevent user from opening /dev/../etc/passwd X in case there is no /etc/default/rmt X X- Add a security check in star's extract mode. X Files containing /../ will be skipped by default. X Exceptions are -w or -.. (the latter is a new option) has been specified X X- New option -.. to tell star that extracting files containing /../ in X the path name is OK. X X- New option -secure-links to tell star to skip hard links and symbolic links X that have a link name starting with / or contain "/../" in the link name. X Note that it is impossible for a tar implementation to prevent any X possible exploit. It is the duty of the user to act carefully. X For this reason, -secure-links has not made the default behavior. It cannot X work 100% correctly but it gives a wrong feeling of security. X X- New error control tag SAMEFILE allows to check for links where source/destination X point to the same file. X X- Added SECURITY & LSECURITY error control to the man page. X X- Fixed a bug that caused star to use a wrong length for extended TAR headers. X As a result if this bug, a wrong UTF-8 -> ISO-8859 coding could occur. X X- Added a test that prevents that star would remove a file if the tar archive X contains a had link to the file itself. X X 0 -rw-r--r-- root/root Jul 25 20:06 2003 f1 X 0 Hrw-r--r-- root/root Jul 25 20:06 2003 f1 link to f1 X X If the archive is hand crafted and the file itself has been removed, X it would have been possible to remove close to any file if the caller of star X has the needed permissions. X X- Added a test that check whether source/destination are the same when copying X a instead of making a hard link. This prevents star from removing the file X by accident. X X- New option -s replstr implements 'ed' like pattern substitutions X as documented for 'pax'. X X- Intercative (manual) renaming now allows longer file names than 100 X characters to be typed in. X X- -p does no longer imply -dirmode if in create mode. If you like to X have the old behavior, call star -c -dirmode .... instead X X- New option -copy X X This option allows three new operation modes: X X - Without other commands: X Copying files and directory trees to a target directory X in a very efficient way. X The last file type argument is a target directory. X X star -copy -time -sparse -acl -p source_dir | files target_dir X X - In conjunction with the -diff command: X Comparing two directory trees in a very efficient way X The last file type argument is a target directory. X X star -copy -time -sparse -acl -diff -v diffopts=... source_dir | files target_dir X X X X - In conjunction with the -t command: X A way to get a one pass tar like listing. X In this case all file type arguments are use to list. X X star -copy -tv source_dir | files X X X- Several small bugs in the FIFO have been fixed. These bugs did only affect the X new -copy mode. X X X- Debugging via command line arguments (rmt debugfile) has been disabled X for security reasons. X X- Allow shorthands for X X star -copy -t -v -> star -ctv X star -copy -diff -> star -c -diff X X- Do not try to get current working directory if star -tv -C dir X has been called X X- Make FIFO code mark the sync pipe files "close on exec" so a bzip/gzip X will not inherit them and prevent the FIFO from detecting the death X of the other side X X- Call on_comerr() with fifo_exit() routine so an arborted star will not X leave the FIFO process and the bzip/gzip process after it did die. X X- Call new volume script with two parameters: X X 1 the next volume number X 2 the file name of the next volume X X- Better man page for -no-fsync now better describes Linux kernel implementation X design flaws (that make programs that like to grant data integrity slow), X and gives hints when using -no-fsync may speed up things on Linux on expense X of data integrity. X X- Better man page for for tar archive format description X X- New command 'spax' implements a POSIX.1 pax style command line interface X on top of star. The command is basically SUSv2/UNIX-98 X X The following extensions from SVSv3 / POSIX.1-2001 are implemented: X X - The options -H and -L X X - Support for the PSOX.1-2001 extended TAR header format X called 'pax'. This makes 'spax' the first pax like command that X supports this infinitely extensible and highly portable archive X format. X X The following limitations currently apply: X X - No support for the -l option (create hard links if possible X in copy mode). X X - The privileges option -pa is ignored X X - The privileges option -pm will not only not set the mtime X but also not set the atime in extract and copy mode. X X - without -po SUID/SGID permission bits are not masked off. X X - Pattern matching for command line type args is not yet POSIX/PAX X compliant. It should emulate the shell's way of matching file names X where '/' is not part of the pattern and each path name component X needs to match separately, but it treats a filename like an unstructured X piece of text. X X Although there are several limitations, spax should be POSIX compliant enough X for the everyday work. X X Rationale: spax only implements a limited set of options to grant best POSIX X compliance. Anything you can do with spax may also be done with star. To be able X to do this, a new set of options has been added to star for this reason. X X- New options in star: X X -pax-ls Switch to POSIX ls/pax style listing X X -pax-match Allow patterns in file type arguments X X -pax-c Invert matching from file type arguments X X -pax-n Allow only one match per pattern X X -pax-i PAX style interactive mode X X -pax-p PAX style privileges option setup X X -pax-L Follow all symbolic links (PAX/POSIX style) X X -pax-H Follow cmd line symbolic links (PAX/POSIX style) X X- list= option now also works on -copy mode X X- Support for POSIX.1-1988 CPIO archive format. X Two new formats are available: X X cpio The POSIX.1-1988 CPIO format X X odc This is what SYSvR4 cpio -Hodc understands X Unfortunately SYSvR4 cpio is not fully POSIX.1-1988 X compliant. X X- Support for SYSvR4 CPIO ASC and ACRC formats X (cpio -o -c or cpio -o -Hcrc). X The checksum with -Hcrc is ignored in extract mode. X X The star header format names are: X X asc Equals to what SYSvR4 cpio -c creates X X crc Equals to what SYSvR4 cpio -Hcrc creates X X- Limited extract support for UNIX.V7 binary CPIO archives. X X- Do not do sparse file checking in -diff mode if the archive X format does not support to archive sparse files. X X- Fixed a typo on the property set up that caused star to print X incorrect bad checksum messages in some cases. X X- First support for Linux extended file attributes. X Thanks to Andreas Grünbacher for the X first implementation. X X Note that this implementation is not generic enough to cover X more general Extended File Attribute implementations as found on X Solaris. The current implementation thus may go away in the future X if star implements support for Solaris Extended File Attributes. X X- If a archive contains Extended File Attributes, then a long listing X will show up a '@' after the permission mode string. X X- New error control attributes: "GETXATTR" & "SETXATTR" X X- Star is now able to create old binary CPIO archives. X Note that star always creates binary CPIO archives in network byte order. X Other cpio implementations create binary archives in host byte order. X Use star -Hbin to create old binary CPIO archives. X X- Messages about unknown POSIX.1-2001 extended header keywords are now X printed only once. X X- New program "suntar" should behave exactly like /bin/tar on Solaris X X- New program "scpio". This program is SUSv2 cpio compliant except that the X -l option is not yet supported. X It is also SVr4 cpio compliant which a few exceptions X X- defaults.c now is able check for archive entries in /etc/default/tar X Currently only used from suntar.c X X- Set errno = 0 before FIFO sync pipe read to suppress wrong error message X in case star is aborted. X X- star.c now has a new option (not yet a flag) to allow -C to work like X it does in old BSD tar. This is used by suntar.c X X- Special option parsing for Solaris tar (suntar.c) has been added to docompat() X X- Handle EINTR for stat()/lstat() in getinfo() X X- New man page for the star archive format X X- -U does no longer unconditionally remove the target (it has never been X documented anyway). If you like the old behavior, call star -U -remove-first X X- The exception handling for missing directories and existing files that need to X be removed is now the same if the target is a plain file. In previous X versions of star, plain files have been handled differently. X X- Fixed a bug that caused star to hang if an GNU tar 'M' header was seen. X This was because 'M' did incorrectly make it into the list of extended header X type flags. X X- Following POSIX PAX Rationale ././@PaxHeader now has TUREAD|TUWRITE Permissions X Thanks to a hint from Glen Fowler gsf@research.att.com X X- GNU Long names and GNU Long links now also follow the TUREAD|TUWRITE Permission X rule. X X- star now does no longer hang if a POSIX.1-2001 extended 'g' header is encountered. X Thanks to a hint from Glen Fowler gsf@research.att.com X X- New program 'gnutar' should behave exactly like GNU tar except that it X writes POSIX.1-1988 TAR archives by default and that it automatically understands X all archive formats that are used on UNIX. It of course also auto detects and X uses de-compression. If you like to replace GNU tar on a linux system, X you may do: X su X cd /bin X mv tar gtar X cp opt/schily/bin//gnutar tar X X The intention of this program is to allow Linux users to migrate to a X tar implementation that honors POSIX standards while still being able to X read old non-standard GNU tar archives and staying with the old GNU tar X command line syntax. X X If you discover a problem that is caused with deviations to the real GNU tar X or caused by missing features, please send me a mail. X X If you are unhappy with this "gnutar" please keep in mind that it took only X 8 hour to write this gnutar.c If you are able to emulate star from another X tar implementation in less than 8 hours, give me a call! X X- suntar/spax/scpio now use a unique function to check if the used options are X useful. X X- star now also understands -0 .. -7 as a shorthand for archive entries that X are inside the file /etc/default/tar or /etc/default/star may be used. X X- New option -Z calls 'compress' X X- New option compress-program=name calls 'name' as compress program. X Use instead of -Z, -z & -bz X X- New option -bsdchdir. X Star by default stays in a directory that has been selected via a C= X option. With -bsdchdir in effect, star changes back to the directory X from where star has been started directly after the next file type arg. X X- Star now checks if it has been called with enough parameters. X If the new check believes that star would otherwise have written amn empty X archives, it writes an error message and aborts. Please test! As this X may be buggy. X X- Fixed a bug introduced by the XATTR patch from Andreas Grünbacher: X Changed snprintf() -> js_snprintf() to allow compilation on systems without X snprintf() X X- The 'Total' statistics that are printed during a media change are now correct X X- New option -multivol X If -multivol is in effect, no logical TAR eof marker is written before the X medium is changed. In read/extract mode, a hard EOF condition causes star X to ask for the next medium. X X Warning: do not expect that the current implementation will X not change. It may be that future versions of star will not deal X as expected with the multi volume archives from this version of star. X X The current multi volume implementation is the first step towards a universal X multi-volume implementation. I am looking for volunteers who like to test X and to help with the implementation. X X- Star now supports reading 'g'lobal POSIX.1-2001 extended headers X X- Star now creates a 'g'lobal POSIX.1-2001 extended header with a X "SCHILY.release" tag if an archive type has been selected that X would otherwise use SCHILY.* "vendor" specific POSIX extensions. X The content is the release string that is used with star -version X X- First attempt to support multi volume writing with automated tape-end X recognition. To use this method of multi volume support, call X star -multi-volume ... and don't specify tsize= X To read the tapes back, you also need -multi-volume X X IMPORTANT: The current implementation is an intermediate state of the X implementation. There is absolutely no check if the 'next' medium X is the right continuation for the current medium. The next version of X star will use specific volume information in a 'g'lobal POSIX.1-2001 X extended header to insure that the right medium is used. X X Please test if the method to detect the EOT condition works for your X platform and your Tape Drive and report problems! X X X- Trying to correct the 'Total' numbers that are printed from the star X statistics. This is only printed in multi volume mode. X X- New option -qic525 includes size information for QIC525 tapes. X X- -newer now uses a time stamp with microsecond resolution (microseconds X are not yet used). X X- Dump date management now includes a time stamp with microsecond resolution X (microseconds are not yet used). X X- Star now does no longer emit extensions to POSIX.1-2001 if called with -Hpax X If you like to create the Star specific extensions, use star -Hexustar X X This causes "vendor" specific SCHILY.* extensions to be omitted if X "pax" archive format has been selected. The effect from this change is X that e.g. star -Hpax -c -acl ..... will no longer archive ACL entries. X This is how it has been documented since the last two years. X X star -Hpax is now a vanilla POSIX.1-2001 format X X- -bsdchdir now works correctly for file type arguments that are not preceded X with a -C option X X- star -c and star -copy now use a common code for the create side of the X task. X X- star -version as well as scpio -version, spax -version, suntar --version X and gnutar --version now print a modified version string that makes it X obvious that 'star' based software is used. X X- new star option -no-dirslash suppresses to add a "/" to directory names X X- suntar now supports -P via -no-dirslash X X- star now prints directory names in the same way as they are used for the X archive. If the archive appends "/" to directory names, then a "/" shows X up in listings too. X X- 'gnutar' verbose printing in -x and -c mode now looks as if star -tpath X has been called X X- Dump date archive management does now deal with microseconds. X X- Star man page now describes the Dump date archive format. X X- Star archive format man page now includes the new Volume header tags X that are used with the 'g'lobal POSIX.1-2001 extended tar headers. X X- The archive type name handling has been unified with a globally used X table. X X- A new global volume header data structure has been introduced. X X- The time stamp read function for 'x'tended POSIX.1-2001 tar headers X now also deals with a sub second granularity that is less than nanoseconds. X X- Many SCHILY.volhdr.* extended POSIX.1-2001 tar header tags have been X added. X X- A SCHILY.archtype tag has been introduced. This tag allows to X reliability detect archive formats that are based on clean "vendor unique" X POSIX.1-2001 "pax" format enhancements. X X XIntroducing a reliable multi-volume mode. XThe reliability comes from new volume header tags that allow to verify Xthe correct volume in read back mode. X Xstar tsize=xxx -c .... does multi-volume without splitting files across X volumes. The resultant archives are independent X and cannot be read back by a single star run. X This feature is in star since the last 10 years. X Xstar -multivol does multi volume triggered by EOT conditions. X Files may be split across volumes. The resultant X archives should be read back by a single star run. X This is new X Xstar -multivol tsize=xxx -c ... does multi volume with a limited medium size. X Files may be split across volumes. The resultant X archives should be read back by a single star run. X This is new X XThe reliable multi volume mode only works if the tape record size (usually 10 kB) Xis not smaller than the volume header; so reading the first tape record allows Xto verify a volume. X XA future star version will add Multi volume continuation headers that allow to Xstart a multi volume extract past volume #1. This may be needed if a tape has Xbecome unreadable and allows to continue extraction past the bad medium. XTo do this with the current star release you would need to call "star -i ..." Xto skip over "bad" archive headers as the archive (if starting with the end of a Xsplit file) does yet contain a pointer the the next valid archive header. X XThe fact that the multi volume continuation headers have not yet been implemented Xis not considered to be a real problem as GNU tar for the last 10 years only has Xa broken implementation of multi volume continuation headers. GNU tar rejects Xto accept 1-5% of the continuation volumes due to a conceptional bug. XThe current star release however, is able to read back those archives as star Xdoes not try to verify GNU tar multi volume continuation headers but only skips Xthem. X X X- Better syntax checks for POSIX.1-2001 extended headers. X Now that there is a second POSIX.1-2001 aware tar implementation X (from AT&T research), we need to take more care when reading POSIX.1-2001 X archives as other worse implementations may occur in the future. X X- The decimal number output routine for POSIX.1-2001 headers is now able to X convert negative numbers. X X- A new routine for outputting unsigned decimal numbers in POSIX.1-2001 headers X has been introduced. X X- Star archive format man page updated: SCHILY.acl.* and SCHILY.xattr.* X documented. Added a note that there is not yet a documentation for X SCHILY.fflags X X- Change tape routine enhanced so that it is able to change to the same tape X drive in case a wrong media has been inserted when trying to read back multi X volume archives. X X- Some new precautions have been taken to put more variables into the shared X memory. This is needed so that some additional information that is fetched X after the fifo did fork may be used from the other process. X X- Verify volume headers after a media change in multi volume mode. X X- fixed three bugs in the routine that reads /etc/default/*tar X -0 .. -7 abstract archive names. X - star did not read /etc/default/star at all X - tsize & block size entries have been used with wrong multipliers X X- Man page enhanced for the new multi volume properties: X X star -c tsize=xxx creates multi volume archives that may be read back each X separately. Files are not split across volumes. X X star -c -multivol or star -c tsize=xxx -multivol splits files across volumes X and the resultant media must be read back in one star run. X X- tsize is now silently rounded down to a multiple of the tape block size. X X- Tape change in write mode now writes a POSIX.1-2001 based volume header that X is used for media verification. X X- Fixed a bug in the old multi volume mode (where files are not split across X volumes) that caused extended headers to be written to the old volume X and the related file to be written to the new volume. X X X- The POSIX.1-2001 based dump dir values have been slightly modified: X Old star versions did only contain a single null byte at the end of the record. X New star versions have two null bytes at the end of the record and the X second null byte is counted in the length value. Old archives may be read back X with new star versions. The new method is more "correct" as the second null X byte is a "end of list" null byte that has been created by fetchdir(). X The single null byte in old archives was the null byte for the last string and X not the "list of strings" terminator. X X- The SCHILY.dino keyword (planned 1.5 years ago) has been implemented. X This keyword helps to implement better true incremental dump support. X It is needed to detect file renaming on file systems that don't change X st_ctime on a rename(2) operation (e.g. ReiserFS on Linux). X X If SCHILY.dino is present, the algorithm for the incremental restore X is much simpler. X X- A new reusable function to compare directory contents has been implemented. X This is needed to implement incremental restores. X X- A workaround for a FreeBSD/MacOS X bug in struct timeval.tv_sec vs. time_t X has been implemented. X X- A new option -restore in preparation for the planned incremental restore X has been introduced. X X- A new option -xdot has been introduced to help to avoid the message X "star: current './' newer." X when calling X star -copy -C from_dir . to_dir X X- A new option -j as an alternative to -bz has been introduced. X This is mainly to help GNU tar users to convert as GNU tar did not follow X our -bz option when it introduced bzip2 compression. X X- Fixed a bug that caused star to complain about a NULL directory name X when calling: X star -ctv -C some_dir . X X- Fixed a bug that caused the wrong POSIX.1-2001 xheader tag content to X be moved if the length of the length field had been guessed wrong. X Move started at new offset but should start at old offset. X This was a serious bug that could cause corruption in extended headers X if non US-ascii characters appeared inside filenames. X X- Hopefully last "fix" from Andreas Grünbacher to work around a problem X with defective ACL texts in tar archives created on Linux. X X- align_test modified to make some vars static. X This was needed to work around MacOS X name space pollution and a linker bug X X- -multivol in create mode now is only allowed with star formats. X X- New function _getinfo() introduced for all simple stat() purposes. X The background is that getinfo() may allocate memory if it looks for ACLs X or extended file attributes. X X- Extended header information is now deleted according to the POSIX.1-2001 X standard if the length of the value string is 0. X X- The star archive format man page has been massively enhanced. X This man page is far from being complete but it is now more complete than X archive format man pages for other tar implementations. X X- Fixed a bug that is caused by the fact that you need to break clean X layering in order to implement EOT induced media change. X X If a data section from a POSIX.1-2001 extended TAR header was hit by a X medium change, then the content of the original extended header data was X overwritten by the data from the volume header. X X Star now implements a two level stack for the xheader data. X X- Fixed a bug with several calls to execl(2) that could cause problems on X architectures where sizeof(int) != sizeof(char *). This is usually the X case for 64 bit compilations. As the number of parameters actually used X was 7, the problem was not only present on IA64 systems but also on 64 bit X Sparc compilations as Sparc allows to pass only 6 parapeters via X registers. X X Note that his is a problem caused by the bad C-99 documentation. A pointer X constant is not a pointer! and the C-compiler is unable to do automatic X type conversion for varargs parameters. All varargs functions are affected X that detect the end of a var arg list via a null pointer. X X Thanks to Christian Weisgerber for reporting. X X X- First step towards reliable support for starting to read back multi volume X archives past volume #0. Star now writes multi volume continuation headers X for split files if called with -no-fifo. The FIFO case is much more complex X and will be implemented in a later version. X X- New POSIX.1-2001 header tag "SCHILY.offset" is used for multi volume continuation X offsets. X X- Introducing an enhanced version of the BSD bitstring library for X implementing multi volume continuation headers in the -fifo case. X X- First attempt to implement multi volume continuation headers X for the default star case when -fifo is in effect. X X This is done by managing a bit map for blocks that hold a valid X TAR header. X X- Better readable output when star does automatic decompression. X X- Fixed the recognition of 'packed' archives. X X- Added support to detect 'pkzip' compressed archives. X X- New option -print-artype prints compression and archive type on a single X line and exits. X X- Introducing a new option artype=headertype as alias for H=headertype X Note that POSIX.1-2001 defines a command independent option -H X to follow symbolic links encountered on the command line. X Star currently still follows the idea introduced with SVr4 cpio in 1989 X -H headertype, but it may in future try to follow the POSIX.1-2001 ideas. X X I am currently thinking about a second new (short) option -A headertype X please comment! X X- Require the -M option for dumps with level= X X- Better documentation for the -tpath option X X- Try to fix a problem in the copy mode with: X echo README | star -copy list=- /tmp X X where both the read and the write process did a chdir("/tmp"). X Thanks to Rasmus Hahn X X- Fixed a bug that caused star to reject files > tape volume size X set by tsize= even with -multivol active. X X- If a file name is too long for the current archive format or cannot be split X in POSIX.1-1988 flavor, now exactly one error message is printed. X X- Better error message when star rejects to create an empty archive (no file type args) X X- Fixed a bug that caused star to dump core with command lines like: X star -c -diff -C /tmp . /etc X X- New makerules for DOS/DJGPP X X- Change fetchdir.c not to use DIR*->d_ino for DJGPP X X- Call setmode(file no, O_BINARY) also for DJGPP for files where binary operation X is needed. X X- First attempt to implement build in compression pipes for DJGPP to allow X star -xz .... X X- Changed rmt.c so it compiles to a dummy program on DOS/DJGPP X X- Thanks to Alex Kopylov reanimatolog@yandex.ru for the help with the DOS/DJGPP port. X X Note that in order to compile star on DOS/DJGPP you need smake-1.2a21 or newer. X GNU make does not seem to work for a DOS compilation. Note that you need to read X X- install-sh now knows about platforms that allow to give away files (like X SCO UNIX); it will no longer leave undeletable (by non-root users) files in /tmp X if not called by root. X X- Support for calling 'smake install' on systems that use a '.exe' suffix for X executable files has been added. X X- Fixed a bug with Extended File Attribute handling that caused the '@' X XFA indicator to be displayed for every file. X Thanks to Leland Lucius (llucius@tiny.net) for his patch. X X- Added support for "diffing" ACLs. X Thanks to Leland Lucius (llucius@tiny.net) for his demo implementation. X X You need to call star -diff -acl ... and use an archive that contains X ACLs if you like to compare ACLs. X X- Added support for "diffing" Extended File Attributes. X Thanks to Leland Lucius (llucius@tiny.net) for his demo implementation. X X You need to call star -diff -xattr ... and use an archive that contains X Extended File Attributes if you like to compare Extended File Attributes. X X- Added support for "diffing" Extended File Flags. X X You need to call star -diff -xfflags ... and use an archive that contains X Extended File Flags if you like to compare Extended File Flags. X X- mconfig.h now supports make COPTX=-DNO_FORK & COPTX=-DNO_VFORK X X- librmt and the rmt server have been enhanced to allow long file names up X to 4096 bytes. X X The historic rmt interface has not been designed to be used with plain files X and thus file names have traditionally been limited to 64 characters. X Note that in order to be able to use long file names with remote tape X connections you _definitely_ need to use the rmt server that comes with star. X X- Fix a bug that caused ':> /tmp/empty; star -u f=/tmp/empy ....' to dump core. X X- Do not abort with "Will not overwrite non empty files in compat mode... X if called with star uf /tmp/file. We will later check if this is a real tar X archive so there is no problem in this case. X X- snprintf() in libschily modified to match SVSv3 (POSIX.1-2001) X X- Fixed a minor bug that caused star to complain about "star rf filename ..." X when "filename" was not an empty file. X X- The handling ot the -p option has been massively changed. X X The old way was to always extract file permissions and to extract directory X permissions with -p. X X The new way is to extract file/directory permissions for new files modified X by the umask if -p has not been specified old files/directories keep their X old modes. It -p has been specified, permissions for files and directories X are restored to the values from the archive disregarding the umask. X X If star is called by root, -p is implied. X X- New option -no-p to avoid automatic activation of -p in case star X has been called by root. X X- The directory stack code has been enhanced to allow to do delayed restores X of directory permissions. This finally allows to extract "read only" X directories from an archive. Star will never grant more permissions to X other users while doing this. X X- Fixed a minor bug in rmt.c in the handling of too long file names. X The only result of the bug has been that in case of too long file names X the protocol may have been screwed up. X X- cpio now by default restores all permission (like star -p). X X- Better printout for the FIFO block remainder moving statistics with X -fifostats X X- New FIFO statistics print current FIFO fill ratio in addition. X To check current FIFO fill ratio, just hit ^\ (or ^T on FreeBSD). X X- Try to use sigaction()/sigvec() instead of signal() to be able to X set up restartable syscalls. X X- Try to avoid setting times/modes for targets of hard links if the X file type of the hard link is unknown by the archive but really X is a hard link to a symlink. X X Note that you should avoid to create portable archives that contain X hard links to symlinks. Hardlinks to symlinks are not mandatory by X POSIX and implementation specific. For backups, it makes sense to X use star's dump format; with star's dump format, hard links to X symlinks have already been handled correctly before this fix because X star then knows the file type of a target from a hard link. X X Star's dump format is used with star -copy, so star -copy has not been X affected. X X- star -cz and similar now also work on DOS/DJGPP X Thanks to Alex Kopylov X X- New supported format "v7tar" allows to create tar archives with X UNIX V7 restrictions: X X - Only plain files and hard links (no directories and symlinks) X X - Only files < 2 GB. X X- tartest now sets stdin into binary mode (needed on DOS and similar). X Thanks to Alex Kopylov X X- New options -copyhardlinks/-copysymlinks/-copydlinks for improved X link copy support. The code has been developed after an idea from X Alex Kopylov X X- New option -match-tree X X If in create mode a pattern did not match a directory, star did always X still recursively scan the content of this directory as complex patterns X could allow files inside the directory tree to match. X X Using -match-tree now allows to efficiently exclude whole trees from X scanning. This helps to avoid scannings directory trees that are on remote X file systems or contain excessive bad blocks. X X- Correctly deal with chars that are by default unsigned on IRIX. X This fixes a bug that caused star to output the following error text: X errmsgno(EX_BAD, "Bad Option: -%c.\n", archive); X X- The options -copyhardlinks/-copysymlinks/-copydlinks have been improved X to be able to copy symbolic links to files that appear later on the archive X and to symbolic links to symbolic links. X The code has been proposed by Alex Kopylov X X- Close the tape too, when the FIFO is used. X X- New option -dumpmeta X X Without this new option, star in incremental dump mode now also X archives file content if only st_ctime of a file is newer. X This prevents star from omitting the file content for new files X that have been created with old date (st_mtime is older than st_ctime). X X- star now does no longer loop if there is a loop in the directory X structure (e.g. from a hard link to a directory). Star did not loop X before in case the -link-dirs option has been specified. Now star X does not loop even if -link-dirs is not in use. X X- Added forgotten code so star is now able to extract hard links to X directories even when the archive is in star's dump format. X X- star now also archives unreable directories (but of course without X content). X X- New make file rules for Win32/Mingw X X- setmode(f, O_BINARY) extended for Win32/Mingw X X- star -restore is now 1000x faster than before X X- First attempt to start dealing with the incremental dump information X in the archives while in -restore mode. X X- New option -xdev as alias for -M X X- -restore now implies -xdot X X- The SCHILY.volhdr.dumptype= header has been activated. X X If the -C option in a dump run is referring to a root directory of X a file system, the resulting dump ps called a "full dump". X If the -C option in a dump run is not referring to a root directory of X a file system, the resulting dump ps called a "partial dump". X X- /etc/tardumps is now only written if the dump is a "full dump". X X- star now writes a message after /etc/tardumps has been written. X X- /star-tmpdir is now created in -restore mode X X- sym_init() adds new consistency checks in -restore mode X X- /star-symtable now is created with mode 0600 X X- libschily's stdio now uses #include "schilyio.h" instead of "io.h" X X- Warning for GNU make problems added X X- Fixed a security bug in remote tape support librmt/remote.c (the RMT client). X X- Incremental restore has been implemented. This makes star the first X true incremental backup system that is TAR based and that passes basic X verification tests for: X X - Removed files X X - Removed directories X X - Renamed files X X - File removed and new file of different type created with the X same name. This may include the fact that the inode number X of the new file is the same as with the old file. X X - Renamed directories X X Note that it is unclear whether star can handle renamed hard links X to directories. X X Please test and report. Star will write messages for unexpected problems. X X X To create a level 0 dump: X X star -cM -dump -sparse -acl -link-dirs -level=0 -wtardumps f= -C / . X X To create a level 1 dump: X X star -cM -dump -sparse -acl -link-dirs -level=1 -wtardumps f= -C / . X X To extract a level 0 dump: X X cd / X star -xpU -restore f= X X To extract a level 1 dump: X X cd / X star -xpU -restore f= X X Notes: X X - You need to use the -M/-xdev option as star X currently only allows to dump a single filesystem at a time. X X - You may do the restore only to a single filesystem X (no sub mounts allowed) X X - The filesystem where you start the restore needs to be X empty (except for lost+found) X X - star does not yet remove files that have been X removed between incremental dumps. Files that have been X removed between incremental dumps are moved to the X directory star-tmpdir. Before you start to extract the next X incremental, you need to remove all files in star-tmpdir. X X - Star now correctly sets up permissions, time stamps and owners X for directories that have been extracted because -xdir or -xdot X has been specified. X X - Star now correctly reports read error on files in create mode. X Before, star did report that the file did change size (shrink). X X X- New rule file x86_64-linux-gcc.rul allows compilation on AMD-64 systems X without automake enabled make programs like 'smake'. X X- Several changes to make 'lint' happy. X X- Make star report different data in any case where the size of the X file in the archive differs from the size of the file on disk. X X- Set Linux xattr only in case that the archive did contain xattr X values for the current file. X X- The algorithm used to fill up the archive to a specific block size X has been corrected. This mainly causes scpio to behave more correctly X and to create archives of the mininum possible size. X X- scpio and spax now also support the archive=header option (like star). X X- scpio now correctly supports the SVr4 -C option. X X- The default archive format used by scpio has been changed to -Hodc. X This is more POSIX 1003.1-1988 compliant and also gives better X compatibility than the -H bin format (used before and used by SVr4) X which has byte order problems. X X- The output with the -debug option now prints the archive format in X text version and not only in the star specific internal numeric value. X X- Manual page for scpio new (based on the Open Group Standard and with X permission of the Open Group). X X- First version of a manual page for spax new (based on the IEEE / X Open Group Standard and with permission of the IEEE / Open Group). X X- Manual page for gnutar new X X- Manual page for suntar new X X- smt now correctly opens the tape drive for the "load" command. X X- Added a note related to the extended file flag design bug on Linux X to the star man page. X X- Star now aborts if you call star -c list=xxx files X as it does not use the "files" argument. X X- Added a usage() prototype to tartest.c X X- Star now allows "partial" dumps to update the data base file X /etc/tardumps. Partial dump entries are marked with a 'P' X directly after the dump level. X X- New option -force-restore tells star to accept partial dumps X in restore mode. Note that with partial dumps, there is no X guarantee that renamed files are handled correctly during X incremental restores. X X- Star now evaluates the SCHILY.archtype= entry of the first X POSIX.1-2001 extended header to get the archive type. X X- As star (in the FAT binary variant) now defaults to the "suntar" X behavior (which is closer to the historical tar than the "star" X behavior), star no longer writes a 'g' header by default to X have better compatibility with historical tar implementations. X X- The star man page has been enhanced by a "INCREMENTAL BACKUPS" X and a "INCREMENTAL RESTORES" section. X X- Man Page for scpio completed. X X- Star now checks whether the incremental restore procedure is done X using the right order of incremental dumps. X X- Better man page for star for incremental dumps/restores X X- Reading the star volume header from incremental dumps now results X in the correct microsecond values. Before tv_usec has been assigned X to the nanosecond value. X X- Better autoconf tests for ACLs X X- New option -force-restore now finally works. X X- Added a workaround for a Linux kernel developer Bug: X Old Linux Kernels have X New Linux Kernels have a broken and a usable X X X- Better config.* for IBM s390 machines X X- Changed librmt/remote.c to make star compile again on HP-UX. X X- Correct a side effect of a recent star -diff modification. X Star now does not try to compare a hardlink (with size 0 on the archive) X against the data of a disk file. X X- Fixed a bug introduced with the new enhanced archive type recognition X that evaluates the SCHILY.archtype keyword in a POSIX.1-2001 extended header. X X The error message was: X star: Syntax error in extended header: non digit in len. X X- more debugs for star -restore. Use smake COPTX=-DRES2_DEBUG X to activate this code. X X- sym_dirprepare()/sym_typecheck() may now modify imp * X X- Better restore warning messages X X- padd_node() now sets flags (e.g. I_DIR) for old tmp nodes X X- sym_addrec() no longer adds dir content into files that need to be X removed in favor of a dir of the same name. X X- sym_dirprepare() now may remove files that turned into a dir X sym_dirprepare() then also returns a modified imp * pointer X X- Write a file "star-symdump" with "Panic: amnesia ..." X The file "star-symdump" contains the current database status. X X- sym_typecheck() now honors I_DELETE in move2tmp() loop X X- sym_typecheck() now calls purgeent() for removed files. X X- Initialize do_void = FALSE; in diff.c to make GCC happy. X X- New option -prinodes prints inode number from archive if present if X star is called with -tv X X- Added /* LINTED */ comments to some files to tell people and lint that X there is no out of bounds array indexing. X X- New options fs-name= name & dumpdate= name help using star with X file system snapshots. X X fs-name= allows to have the right FS name in the archive and X in /etc/tardumps X X dumpdate= allows to have the right timestamp in the archive and X in /etc/tardumps X X- Man page now includes an example on how to create incremental backups X using file system snapshots X X- New keyword "SCHILY.volhdr.cwd" is used for the real working directory X with incremental backups when fs-name= name is used. X X- New diff option "lmtime" allows star to exclude checking the mtimes X for symbolic links only. X X- Star now automatically removes all files from ./star-tmpdir if in X incremental restore mode and the environment variable "STAR_DEBUG" X is not present. X X- New Option -dump-cumulative/-cumulative allows star to be used X to synchronize filesystems in an efficient way. X X- Man page enhenced to describe how to use star to synchronize X filesystems. X X- Star now writes a file ./star-symdump if a problem is detected that X will result in a coredump X X- spax man page now competely converted from the text file format X from The Open Group to 'troff'. X X- New program star_sym to convert star's incremental restore database X into a human readable format for better debugging of incremental X restore related problems. X X- star now checks whether the selected archive format supports X ACLs if called in create mode with -acl. X X- Fixed a bug that caused star -match-tree to behave incorrectly X if no pattern matching was involved. X X- Changed license from GPL to CDDL X X- Included acltext.c from OpenSolaris sources. This allows star to X support ACLs on Solaris systems that are older than Solaris 9. X X- acltext.c modified to allow star to extract Tar Archives with ACLs X on machines that do not have a uname to uid & gname to gid database X for the users in the archive. Star in this case extracts ACL X users/groups by numeric id. X X- Add acltext.c to star_fat.mk X X- Make star_fat the default. Previously, star, suntar, gnutar, scpio X and spax have been different binaries. X X- Added support for the Linux EXT2_JOURNAL_DATA_FL file flag. X See man chattr ('j' flag). X X- Do not compile acltext.c on Cygwin. X X- Added debug code to restore.c to help finding the minor bug in the X incremental restore code. X X- Try to avoid a core dump when checkerr() is called with a NULL ptr X file name. X X- fetching ACL info via get_acls(info) has been moved to create.c X to speed up the archiving process. X X- Broken error message string on restore.c fixed X X- Better syntax checking and messages for POSIX.1-2001 extended tar X headers: we now check whether each record ends with a \n X X- Workaround for an old broken /bin/sh found on BSDi X X- Workaround for chmod being in /usr/sbin on BSDi X X- make DESTDIR=/some/path install is now supported X X- Autoconf test for broken Linux Kernel include file X and workaround for the unwillingness of the Linux Kernel Maintainers X to fix their bugs. X X- Added support for the SEEK_HOLE / SEEK_DATA feature of current X Solaris development releases. This allows to implement efficient X support for sparse (holey) files. Note that star did implement X a similar improvement this for Solaris-2.3 .. Solaris-2.5.1 but X the related call did disappear with Solaris-2.6 X X- Fixed a bug that caused star to list the size of the file in the X archive instead of the real size in case sparse file handling was X done in POSIX.1-2001 mode and the file size was greater than 8 GB. X X- star.4 extended to mention that a "SCHILY.realsize" keyword needs X to be after any "size" keyword. X X- Fixed a bug that caused star to dump core while extracting a file X with more than 10016 holes. X X- The function to read the data from sparse files has been X optimized. The speed for archiving sparse files has been X enhanced by approx. 50%, it is now nearly 2x the speed from ufsdump. X X- Avoid unneeded lseek() calls for sparse files in -onull mode. X X- Support for extracting hard links in the SVr4 cpio CRC archive format X has been added. X X- Fixed a bug in xheader.c that caused star to write to a wrong buffer X addres after a realloc() while archiving inode # lists for directory X content. X X As the probability for calling realloc() for this task is extremely X low, the problem did hit during dayly incremental backups once every X three months. X X It seems that we did now fix the last known problem with incremental X backup/restore with star. X X Thanks to: Roland Friedwagner X X- New autoconf checks for OS (Linux) madness (broken kernel include files). X X- New option -read0 as a counterpart for gfind -print0 is used when reading X filenames with the list= option. Note that it is better to just use the X built in -find code in star... X X- New option pkglist= (which is an unstable internal interface for the X Schily Source Package System SPS). It allows to overwrite permissions X and uid/gid for files. The file used with pkglist contains a list X if file names (each on a separate line). The format is: X X filename permission uname gname X X e.g. Makefile 0444 root bin X X All field that should not overwrite the values from stat(2) may be replaced X by '?', e.g. Makefile ? root bin X X- Multi Volume support has been completed: X X - Star now supports to read back multvol archives in X H_XSTAR & H_XUSTAR Format X X - Star now more completely evaluates the header bitmap X of the FIFO to find the "nearest next header". X This helps to see more files when starting to read back X a multi vol archive on a volume > #1 X X - Star now includes support to protect a critical section X in the volume media change code. The variable that is X shared between the archive process and the write process X to tell the write process where the next header past a large X file will be can no longer be modified by the archiver X process while the tape process checks the content of the X variable and the FIFO bitmap. X X- New keyword "SCHILY.volhdr.tapesize" allows star to verify the X archive volume size on read back. X X- Warnings and debug messages related to EOF recognition now X contain archive block numbers. X X- Avoid star core dumpd in incremental restore mode when the X inode database is corrupted and causes NULL pointers inside X star's data. X X- For suntar & tar, tar -x is now star -xU X X- Unconditionally overwrite non-empty plain files if the "tar" X command line interface is active. This is not true if star X is called as "star" or "ustar". X Note that while this gives full compatibility to historical X tar implementations, it may allow people to accidentally X overwrite random files from miss typed command lines as X the tar command line syntax is error prone. X X- Autoconf now correctly detects contiguous vs. non-contiguous X device Major/Minor numbers when compiling for 64 bit CPUs. X X X- The -copy option has been documented in the EXAMPLES section X of star's man page. X X- The star directory stack (delayed time/mode setting) now also X works correctly when the directory names in the archive do X not end with a '/'. X X- scpio now includes "star -xdir" as the classic UNIX cpio program X always unconditionally extracts directories. X X- Several bugs in acltext.c fixed: X X - it did assume that a uname / gname fits into 8 chars X X - it did assume that a numerical uid/gid value fits into 8 chars X X - The variable id was not always initialized. X X- Fixed a typo in a printf format string that could cause core dumps. X X- Star man page now mentions the new efficient support for archiving X sparse files on Solaris 11 X X- nameuid()/namegid()uidname()/gidname() converted to use X uid_t/gid_t as parameter X X- Struct FINFO converted to use uid_t/gid_t for f_uid / f_gid X X- Struct FINFO converted to use nlink_t for f_nlink X X- Struct FINFO converted to use mode_t for f_mode X X- Struct FINFO converted to use mode_t for f_type X X- Fixed the option -xdot to work correctly for archives that X do not start with a "." or "./" entry. X X- Star now includes code to allow to skip large files (>= 2 GB) X on non largefile aware systems. In order to allow this, a X C-compiler is needed that supports the type 'long long'. X X- Range checking for selected parts of the TAR header X X- Star now takes more care for converting numbers in the X historical tar header. X X- Range checking for POSIX.1-2001 headers. If a critical type X overflows on extraction, the file is marked for having bad meta X data and skipped. X X- In case of uid/gid overflows on extract, star now maps the X overflowing id to nobody to avoid assigning the files to arbitrary X users. X X- diffopts=lmtime is now implemented in a less confusing way. X The man page now describes the behavior correctly. X X- New diff option "xtimes" as an alias to times+lmtime. X X XNew Options for SchilliX & SPS: X X- New option umask=mask option allows to set the umask that is used X by star. This allows to e.g. control the permissions of X directories that are created as intermediate directories. X X- New option dir-owner=user allows to set the owner used for X directories that are created as intermediate directories. X This only works if star is run as root. X X- New option dir-group=group allows to set the owner used for X directories that are created as intermediate directories. X This only works if star is run as root. X X X X- Workaround for a /usr/ucb/tr related endless loop that could X cause gmake (not smake) to hang on Solaris if /usr/ucb/ is in X PATH before /usr/bin/ X X- star -x -ctime now also works with POSIX.1-2001 tar extensions X that include usec time stamps. Note that although star tries to X correct the time spent in syscalls, there is still a tendency X that the system time will be a bit too slow while star -x -ctime X is running. X X- Makefiles fixed so that 'make CCOM=cc64' will even work on a X maiden (just unpacked) source tree. X X- Better template 'rmt.dfl' for /etc/default/rmt X X- Better template 'star.dfl' for /etc/default/star X X- The star man page now lists the exit codes for star X X- star now creates a file 'star-lock' in the root directory X of a filesystem, if while restore operation is in progress. X This prevents star from being run more than once (e.g. X from a cron script). X X- get_xtime() fixed so that the print_range() function knows X the len of the xheader argument. X X- Trying to find a workaround for a bug found on Solaris that X caused a negative nanosecond value to be returned for st_mtime. X X- Do no longer immediately abort if less that 512 bytes are read X from an archive. X X- Finally support extracting files into directories that X are maked "read only" in the archive. X X X- A new option -e has been introduced (similar to Sun tar's -e). X It is equivalent to a errctl file that has: X X ABORT|ALL|DIFF * X X in the last line. X X- New error exit code -3 (253) is used if star exits because of -e X or the ABORT error control condition. X X- New star option -data-change-warn (suntar -e) causes star not to X exit with a non-zero exit code in case the size of a file changes X while it is being archives. X X- suntar now supports the -e option X X- suntar now supports the -D option X X- Star now allows to specify more than one errctl= option. X X- Star now allows to have the error control definitions to be the X parameter of a errctl= option. Every errctl= parameter looks X like a single file from the error control file. X X X- The errctl= feature now allows anything that may be desired in X order to control the error related behavior of star. X X- errctl.c now calls realloc() instead of malloc() is the length X of the longest pattern did increase. This avoids a small memory leak. X X- The star -data-change-warn (suntar -D) option is now implemented via X errctl="WARN|GROW|SHRINK *" X X- Avoid core dumps that did occur when star was reading POSIX.1-2001 X "pax" archives created by simple tar implementations (like GNU tar-1.15.1) X that do not create 'g'-type headers and thus may create a path= X or lpath= entry in the first tar header that is an extended header. X X- star.1 man page now gives better hints that -multivol and -w are X interactive options that cannot be used in non-interactive X scenarios like cron. X X- star.1 man page now includes a warning about the possibility to X overwrite files outside the current directory tree if the directory X is not empty before starting the restore. X X- star.4 man page now correctly describes signed/unsigned and bit width X requirements for the integer types in the extended header. X X- Sun Tar header added to star.h this is in preparation for supporting X the (limited) multi volume features of Sun tar. X X- Better range checks for the star's volume header fields in the X POSIX.1-2001 extended tar header. X X- Using now unsigned ints for the star's volume header fields in the X POSIX.1-2001 extended tar header. X X- Carefully using and checking for signed/unsigned numbers in all X numeric field of the POSIX.1-2001 extended tar header. X X- Signed/unsigned discrimination for X "SUN.devmajor"/"SUN.devminor"/"SCHILY.devmajor"/"SCHILY.devminor"/"SCHILY.dev" X added in create mode. X X- get_iarray() is now using astoull() for inode numbers X X- New test in get_iarray() for inode number > INO_T_MAX X X- Now all error messages related to POSIX.1-2001 extended tar headers X include the archive block number. X X- Flags XF_BAD_SIZE -> F_BAD_SIZE, XF_BAD_META -> F_BAD_META X X- New Flags F_BAD_UID/F_BAD_GID X X- If a bad uid or gid is detected and the uig/gid is set to nobody, X then the file is no longer made suid nobody or sgid nobody. X X- utypes.h now includes MIN/MAX #defines for all basic OS types. X X- New autoconf tests for major_t / minor_t X X- put_dir() now no longer calls fetchdir() if (!nomount || !newfs(info)) X but if ((!nodesc || dodump > 0) && (!nomount || !newfs(info))) X This avoids calling fetchdir() with star -cD but only if star -cD -dump. X X- Star man page now warns to use -restore in case that a user only X likes to extract a single file but is not going to start a complete X incremental restore. X X- The program star_sym now includes a version number X X- Two powerful programs (star & sfind) announce their marriage that X results in a feature enhanced star. X X This code integration was originally planned for the star-1.6 X development cycle, but it turned out that it is possible to X implement a subset of the full set of features without causing X any harm to the rest of the code as long as the find code is X not actually used. X X To the beginning of the 1980's, AT&T included a simplified cpio X implementation to find(1) but this venture did not result in added X value (there was only a minor speed up by avoiding a second stat(2) X for every file) and the cpio archive format is outdated since a while. X X As a side effect, the functionality of the find(1) program is X now available as a library implementation. X X BTW: Although the sfind(1) source is written more cleanly than the X UNIX find(1) source, it did take more time to create the library X code from the original sfind(1) source than it took to write sfind X from scratch. X X The integrated find code has been enhanced compared to the X standard sfind(1) code by the following primary operators: X X -chgrp X The primary always evaluates as true; it sets the X group of the file to gname. X X -chmod X The primary always evaluates as true; it sets the X permissions of the file to mode. Octal and symbolic X permissions are accepted for mode as with chmod(1). X X Note that this version of star does not yet implement X the 'X' character from chmod(1), but future versions of X star will add support for 'X' permission mods. X X Meanwhile you could use something like: X X star -c -find . ( -type d -chmod a=rx -o -chmod a=r ) X X -chown X The primary always evaluates as true; it sets the X owner of the file to uname. X X -false X The primary always evaluates as false; it allows X to make the result of the full expression different X from the result of a part of the expression. X X -true X The primary always evaluates as true; it allows to X make the result of the full expression different X from the result of a part of the expression. X X The first three operators allow to modify the file meta data X between the time when star fetches the meta data from the X filesystem or from the archive and the time when star evaluates X the file meta data while adding the file to the archive or X extracting the file to the filesystem. X X The last two operators make it more convenient to use find(1) X expressions to control an archiver like star. X X The basic idea behind the find(1) integration is: X X Define a find expression and let star evaluate the expression X for every file as the first possible "filter" operation. X If the "find expression" returns TRUE for the current file, X this file is either archived, extracted, diffed or listed X as usual. X If the "find expression" returns FALSE for the current file, X the file is skipped. X X Note that the find primaries -chgrp/-chown/-chmod modify X the file meta data as a side effect. X X- New option -find acts as a separator between the "star" command line X interface and the "sfind" command line interface. X X To the left of the -find option, star accepts well known X star options from the past. X X To the right of the -find option, star expects a list of path X names followed by a find(1) expression. X X As with future star-1.6 versions of star, star will allow more X new features, it is possible to omit the find(1) expression. X This results in the same behavior as if X X star ... -find -true X X had been specified. X X For more information, check the star and the sfind man page. X X Star currently suffers from the following problems: X X - If the archive is stdin or stdout, star redefines X stdin or stdout. As 'find -exec ...' propagates X stdin/stdout/stderr to the called program, this X causes unplanned problems. X X - If the archive is stdout, star redefines stdout. X As 'find -print', 'find -printnnl' and 'find -ls' X outputs to stdout, this also caused unplanned problems. X X - Find primaries like '-linkedto' cannot be implemented in X extract/list mode as they need to wo preparation work X on the local filesystem that cannot be converted to X work on an archive. X X - find options like -H -L -P are not yet implemented X in star -find mode X X X- New files: libfind/* X X- LLONG_MIN/LLONG_MAX/ULLONG_MAX definitions added X X- Added support for 64 Bit compiling on Solaris using X X smake CCOM=cc64 X X- Autoconf test for declaration extern stat() / extern lstat() added. X X- star -find -chmod now supports the symbolic mode character 'X' X X- star -tv now uses correct type casting for st_uid/st_gid with X printf() calls X X- Star -x -C dir pat=pattern now works as documented X X- Star -x -C dir1 -C dir2 now works as expected X X- star man page now documents problems with reused file descriptors X from star < file, star list=- and star -find -exec or -ls X X- star -pax-H -pax-L -pax-P now also sets find tree walker options. X X- Star now sets rdevmajor & rdevminor to 0 if the file is off type X FIFO. This is to avoid range check warnings in extract mode. X X- Add a workaround for star -find when it is crossing a automounter X mount point. Before the fix was added, star -find did complain X of not being able to chdir .. because descending into the mount X point would change st_dev/st_ino for the mount point. X X- star -x -find -exec does no longer complain of not being able to X chdir home X X- star -c -find dir1 dir2 does no longer complain of not being able X to find dir2 X X- New diffopts= tag: "sympath" checks whether symlink targets X are characterwise equal. The old "symlink" tag now only checks X whether the symlink targets are pointing to the same file. X X- Support for sfind -maxdepth & -mindepth has been added in create X mode X X- Support for BeOS/Zeta shared memory using create_area() has been X added. X X- Make star compile again on BeOS/Zeta X X- Make star compile on DragonFly BSD in case gnumake is used. X X- Star now reads answers from stderr on OS like BeOS that do X not support /dev/tty X X- Support for compilation in 64 bit mode on Solaris added X X- Added support for Sparc T1000 & T2000 systems (Niagara) X X- Support for fine grained privileges from Solaris 10 added. X X- Added support for armv5teb-linux X X- Default install user/groups changed for Cygwin & MacOS X X X- Autoconf tests for /dev/tty, /dev/null & /dev/zero X X- Now using l*attr() functions from the Linux extended attribute X interface. This fixes a bug introduced by the author of the X related code in Linux. X X- Make star not print a Panic: Messahe for lock_ino ("star-lock") in X incremental restore mode. X X- star -diff now uses the same sparse test (using SEEK_HOLE) as X create.c uses. X X- star -diff fixed for directory diff checks X Before, star did not find both (archive & disk) differences if the X number if directories were identical and the last entries were X different. X Note that this bug did not affect incremental backups or restores! X X- Star no longer checks the devmajor/devminor values for being inside X the allowed range (in restore mode) in case the related file is not X a device node. This helps to unpack some older archives. X X- Added code to support unfixed (Sun Solaris) kernels that do not X handle SEEK_HOLE in a way compatible to older OS revisions. X X- Tring to fix a FIFO deadlock bug that happens on very fast multi X CPU systems. You should have at least a dual Opteron to suffer X from this bug. X X The new carefully modified algorithm looks more safe. X X- Added a workaround for GNU tar archives with "dumpdirs" that X violate the tar structuring rules. X X Note that star will never try to incrementally restore GNU tar X "incremental" archives as not even GNU tar is able to do this X correctly and as it is questionable whether this is possible at all. X X- Added Support for "mips64" in the makefile system. X X- Try to add a workaround for the this error message: X X star: Operation not applicable. Cannot set ACL 'user::rwx,group::r-x,other::r-x' for 'socket'. X X which happens e.g. when extracting with -acl and the "file" is a socket. X X- Better man page now tells people that the tsize= option refers to the X uncompressed archive size. X X- Better documentation for the algorithm used in incremental restore mode. X X- Support for i386-darwin (Intel MacOS X) added X X- Decrease the CPU time needed to extract sparse files. X On a slow CPU, this could double the extract speed. X X- Better work around for skipping sparse files in GNU tar archives X that violate the tar structuring rules. X X- Star now skips the rest of a file in the archive if a write X error occurs during extract. X X- Star now supports to archive and extract sparse file that end X on a hole. X X WARNING: older star versions are unable to correctly extract X files that end on a hole. Star will ignore the last hole and not X extract it. X X- Star now honors the -force-hole option in create mode and uses X the "scan hole" function instead of using SEEK_HOLE/SEEK_DATA X to retrieve the hole positions of sparse files. X X- Added a workaround to prevent star from dumping core while trying X to extract sparse files > 4 GB created with broken GNU tar. X X NOTE: All GNU tar versions before 1.15.91 are seriously broken X and will create defective archives from sparse files > 4 GB. X X Star will now skip the defective files from the archive and X print the following warning: X X star: Bad sparse data: offset 61198336, numbytes 480768 at idx 30609. X star: Current write position is 4333572096. X star: Skipping 'sparse-file.bin' sorry ... X star: WARNING: 'sparse-file.bin' is damaged X X- New test added whether dirent->d_ino exists. This was not true for X __DJGPP__ and seems also be false for newer __CYGWIN__ versions. X X- fetchdir() now calls lstat() in case that dirent->d_ino does not exist. X This is slow but this is a Cygwin problem. X X- A better error message was added to fifo.c for a rare case that only seems X to happen on Linux. X X- find.c now defines DEV_BSIZE to 512 in case it is not defined. X X- findinfo.c now defines DEV_BSIZE to 512 in case it is not defined. X X- The makefilesystem has been revised to allow compilation on SFU (Services X for UNIX on MS-WIN - also known as Interix UNIX) and with MSVC. X X X- The basic "fat" star binary is now named "star" again (was X "star_fat" before). X X- Rename all *printf() calls to js_*printf() X X- Make sure that star x dir/ will not print "Pattern 'dir/' did not match" X although there was a match. X X- New C++ enhanced makefile system X X- Makefilesystem now starts to support dynamic libraries. X use X smake LIMKMODE=dynamic X X to build a share library version of this project X X- All include files have been moved to include/schily/* X X- New autoconf test for C99 compliant isinf()/isnan() X X- Fixed a typo in fconv.c that caused problems on IBM AIX5. X X- New pthread autoconf tests X X- New autoconf tests for strncpy()/strlcpy() X X- added snprintf.c to libschily to make star compile again on X old operating systems. X X- Added calls to walkopen()/walkgethome() as well as X walkhome()/walkclose()/free(walkstate.twprivate) X for recent libfind/find_expr() X X- New enhanced libfind X X- Allow 4 GB (instead of 2 GB) for CPIO asc/crc archives. X X- Fixed a problem from uninitialized data while extracting sparse files. X X- Fixed a problem on platforms without pathconf while extracting sparse files. X X- star -u now removes a slash at the end of a file/directory name before X it compares pathnames. X X- Initialize f_namelen and f_lnamelen in extract mode before filling X FINFO from tcb. X X- mem.c moved into libschily X X- Try to avoid an exception during autoconf that happens with the MS C-compiler X cl and is caused by a bug in MS's implementation of "access()". X X- Do not print error messages if X acl(info->f_name, GETACLCNT, 0, NULL) returns ENOSYS X This is the case for e.g. ZFS. X X- Do no longer print wrong numbers in the statistics in case that X star reported a smaller blocksize than the expected block size. X X- The test for incorrect sparse lists (broken sparse tar archives) X has been enhanced to match more problem cases. X X- Tar header recognition procedure enhanced. Star no longer believes X that a valid tar header may have a zero checksum field. X X- Fixed a bug reported by John Groenveld that caused star to extract X some sparse files with Jan 1st 1970 although they have been OK. X X- Better (more correct) computing of signed checksums. X X- star now warns if someone tries to "update" a compressed archive. X This is not possible X X- Better error messages for corrupted (edited) /etc/tardump files. X X- bitstring.h corrected to avoid GCC warnings X X- libfind now supports "Solaris event ports" via "-type P" X X- Avoid a core dump in libfind caused by probably uninitialized data X when using -exec ... {} + X X- libfind now does much less calls to exit() making libfind more X of a real library X X- Take care about the fact that uid_t and gid_t may be less than "int", X e.g. short. X X- Several fixes in the man page spax.1 (thanks to Eric Raymond for the X hints) X X- Some typo fixes in the star.1 man page X X- Workaround for a Mac OS X linker bug X X- /usr/src/linux/include is no longer included if it contains X broken include files. X X Please send a bug report to the Linux Kernel maintainers in case X that the makefile system reports broken Linux kernel include files. X X- No longer using -ztext linker option for creating shared libs with GCC X as GCC does not create 100% correct binaries and this would abort X the process of creating a shared library. X X- New autoconf tests for POSIX compliant time functions in libc X X- GCC Warning setup no longer includes -Wtraditional X X- Cast 3rd parameter from open() to mode_t. This is needed as X open() is a varargs function. X X- New targets "html" and "htmlx" for Manual page makefiles X allows to convert man pages using "man2html" X X- Dynamic libraries are now supported for Mac OS X X X- Support for WIN-NT-5.2 (MS-Windows 2003) added to the makefile system X X- Better setup for the environment variables that are needed for the X Microsoft "cl" compiler. X X NOTE: The current setup is for "english" versions of MS-WIN. X You may need to edit the files DEFAULTS/vc6-setup or DEFAULTS/vc7-setup X depending on your locale version and the "c"-compiler version you X are using. X X- Prevent MSVC ("cl") from creating silly messages X like: "... Consider using strerror_s instead." X X- Prevent MSVC ("cl") from complaining about deprecated X option "-ofilename" X X- smake CCOM=xx will now result in writing DEFCCOM=xx into incs/Dcc. X if this is done on the initial make run. X conf/cc-config.sh now has one additional parameter X X- Include $(DEFLTSROOT)/$(DEFLTSDIR)/$(VCSETUP) from X DEFAULTS/Defaults.cygwin32_nt already to allow the script X conf/cc-config.sh to detect that "cl" is working. X X- DEFAULTS/vc7-setup & DEFAULTS/vc6-setup now set X .NOWARN: := to tell smake-1.2a41 or newer not to warn X about a nonportable assignment (we do X not have a UNIX "make" in Cygwin). X X- smake COPTX=-DNO_LARGEFILES now allows to compile in non-largefile mode X X- configure now checks for ctime cftime ascftime strftime and X for libresolv and whether /bin/sh is bash X X- New include file schily/wchar.h X X- New include file schily/schilyp.h X X- Typo in schily/param.h fixed X X- getnum()/getllnum() & gettnum()/getlltnum() have been moved to libschily X X- printf()/fprintf()/sprintf()/snprintf() have been removed from libschily X we now use js_*printf() instead. X X- The makefile system no longer adds -I. to the standard include search path X X- New function dfetchdir() X X- getargs() now accepts '+' in longopt= X X- remove libxxx.so link before trying to create it X X- Allow a mixture of static and dynamic libraries to link against X a program X X- new option -lzo to support "lzop" compression X X- new option -7z to support "p7zip" compression X X- Libfind is now close from the final state X X- Added README file to the directory libfind/ that help to learn how X to create a complete find(1) command, a "bsh" find builtin and a X ksh93 find builtin using libfind. X X- Libfind Version is now 1.3 X X- libfind has been restructured to allow it to be used as builtin function X inside shells like e.g. "bsh" and "ksh93". X X- libfind now allows I/O redirection (needed for shell builtins). X X- libfind now may be told to check for abort situations (needed for X shell builtins in order to check for abort on ^C). X X- New function find_free() X X- Libfind no longer leaks memory if called with a commandline with X syntax errors. X X- Added autoconf platform recognition code for Intel MacOS X X X- New autoconf test for struct timeval in sys/time.h X X- New autoconf test for struct timezone in sys/time.h X X- Changed include/schily/time.h to depend on the X new autoconf #defines HAVE_STRUCT_TIMEVAL and X HAVE_STRUCT_TIMEZONE X X- The Schily makefile system is now also passing OS X specific #defines to "configure". X X- New Schily makefile system Target shell allows to X call "make shell" in order to get a shell with exactly X the same environment as the compilers will see from X the makefile system. This helps testing. X X- New autoconf test checks whether we need to call X "xx.exe" on a platform. This is needed in order to X be able to call the Microsoft compiler from the X SFU (Services for UNIX) environment. X X- It is now possible to call the Microsoft compiler X from SFU. In order to do this, call "smake CCOM=cl" X X If this does not work, you may need to change the X file DEFAULTS/vc7-interix-setup X X- Fixed a bug in names.c that caused nameinit() to go into an endless X recursion and dump core if there is no "nobody" in /etc/passwd. X This bug has been introduced recently. X X- star is now able to correctly deal with default ACLs on Linux X this is because star now is happy with 3 ACL entries in the default X ACL list. X X- New macro OSVERSION implemented in the schily makefilesystem X X- Better support for the "html" and "htmlx" targets X that are used to create html versions of the man pages X X- Support for SCO-OpenServer 6.x was added to the makefile system X X- Support for pentium-4-unixware-cc.rul & pentium-4-unixware-gcc.rul X was added X X- Support to suppress the echo for the filename with cl.exe X was added to the makefile system. X X- Better SFU (Interix) support X X- libiconv autoconf support was added X X- Support for the SFU extended fields in struct utsname was added X X- On FreeBSD, /usr/local/include and /usr/local/lib is now searched. X This is needed for gettext()/iconv() X X- Updated man pages for librmt X X- Updated file README X X- Updated file STARvsGNUTAR X X- Include #ifdef S_IFLNK and similar to find_list.c in order to X make it work on platforms that do not implement all file types. X X X- Corrected some typos that caused star not to use O_DSYNC X in extract mode. X X- Trying to better work around some broken Linux kernel include files. X Thanks to a hint from Michael Teichgräber X X- "suntar" now supports the artype=headertype option X X- "suntar" now supports the Sun tar -E option X X- "suntar" now supports the Sun tar -k option X X- "suntar" now supports the Sun tar -P option X X- "suntar" now supports the Sun tar -T option as dummy X X- star/gnutar/suntar now support the new -X option. X X- Set the option string for the non "star" CLI to make getfiles() X work correctly. X X- star no longer prints this warning: X X "Notice: link_file: '%s' from/to identical, skipping ...\n" X X if -force-remove has been specified. This has been done in X order better emulate the behavior of "suntar". X X- New option -keep-nonempty-dirs prevents star from complaining X about trying to remove non-empty directories with -remove-first X in case that -remove-recursive has not been specified. X X- New star option -install emulates the behavior of the install(1) X program and allows to implement the extract behavior of cpio. X X- suntar -x is now star -xU -force-remove -remove-first -keep-nonempty-dirs -no-fsync X X- New "suntar" option --do-fsync to switch on synchronous writes. X X- scpio -iu is now star -xpU -xdir -install -force-remove -remove-recursive -no-fsync X X- New "scpio" option --do-fsync to switch on synchronous writes. X X- Support for SunStudio 12 on Linux was added. X Call "make CCOM=suncc", but note that you then X will not be able to compile Linux specific functions like X support for ext2 file flags. This does not work because the X related include files are not written in clean C. X X- Added a workaround to config.guess to get correct X platform names from "configure" even thogh suncc X does not #define __ELF__ X X- Linux specific autoconf tests are not only executed on Linux X based platforms X X- In order to allow star to compile on broken Linux platforms X with broken Linux kernel include files, the autoconfiguration X now has been restructured to disable support for ext2 file flags X in case that the local include files are broken. X X You may still try: "smake COPTX=-DTRY_EXT2_FS'" X and check whether this results in a working binary, but X due to the Linux kernel bugs, star now defaults to compile X before trying to support features that depend on broken X include files. X X- Include "install" support (to /usr/share/doc/star) for the X README files. X X- Added sample files for /etc/default/star and /etc/default/rmt X X- Avoid to print statistics that mention xxx blocks + -1bytes X written in case of write errors to the tape. X X X- Added Support to create Blastwave SVr4 packages. X To create a Blastwave package, call: X X .clean X smake -f Mcsw X X You need the program "fakeroot" and will find the results X in packages/ X X Note that this source tree will allow you to create the package X CSWstar but not the packages CSWschilybase and CSWschilyutils X on which CSWstar depends. X X X- Added a note to README.compile on how to work around a problem X in /usr/include/linux/types.h that prevents to compile cdrtools X on Linux using the Sun Studio compiler. X X- Fixed a typo in RUES/rules.hlp X X- make install now supports a "static" compile enviromnent X for HP-UX. X X- New POSIX enhanced getargs() command line parser. X X- Some small typo fixes in the star man page X X- Make sure that in case of incremental dumps, star writes at X least the directory "." even if the incremental dump would be X otherwise empty. X X- Allow to call star -xpU -restore -force-restore X to force restoring the next level dump. This is needed in case that X the previous dump was empty and star did reject to restore it. X X- Some small typo fixes in the rmt man page X X- The profiled libraries now have names that do no longer end in _p.a X To create a profiled version of a command, do something like this: X X cd star X smake clean X smake COPTX=-xpg LXOPTX=-xpg LINKMODE=profiled X X For GCC use: X X cd star X smake clean X smake COPTX=-pg LXOPTX=-pg LINKMODE=profiled X X- libschily::*bytes.c have now better comment. X X X- smake COPTX=-DNO_LARGEFILES now allows to compile in non-largefile mode X X- Star no longer removes and re-creates identical symlinks and special files X in restore mode. This avoids that the time stamps for the parent directory X are updated and cause time stamp deviations in some cases in incremental X restore mode. X X- Star now implements a better update method for the file "star-symtable". X This avoids that only an incomplete "star-symtable" file is present in X case that the operating system crashes at the time star writes the data X base. X X- treewalk() now initializes struct stat in the WALK_NOSTAT case in a X basic way. X X- star -diff -sparse no longer compares "sparseness" for hardlinks if X there is no data for the file in the archive. X X- Use a page aligned buffer too in the -no-fifo case to speed up X star a bit in the non-default -no-fifo case. X X- Use the standard big buffer for reading data related to the X compression auto-detection. X X- scpio now prints the cpio message "xxx blocks" instead of the X star statistics line. X X Note that both Sun cpio and GNU cpio print wrong numbers for X tar archives. Star prints the number of 512 byte blocks that X make a complete minimal tar archive including both zero X EOF blocks. X X- new option -cpio-statistics allows star to switch to the X CPIO style statistics output. X X- new option -xmeta allows to "extract" meta files from a star X archive that has been created with "star -c -meta". This option X mainly exists to allow people to give away long list of filenames X for debugging purposes without including the file content. It helps X e.g. to debug problems in mkisofs that are a result of specific X filenames. X X- New option -link-data allows star to add data to hard links in X archives. This is currently just a first step and only works X with the H=exustar archive format. Note that before POSIX.1-2001 X there was no permission to add data to a hard-link type tar header. X X- Abort star in case that "star ... dumplevel=" has been used together X with list= or -find. This will not result in useful incremental X backups and must be prevented to protect people. X X- Do record locking on the file /etc/tardumps to protect updates X against multiple simultaneous incremental star backups. X Thanks to a hint from Jean-Louis Martineau X X- star_sym/Makefile now includes $(LIB_INTL) X X- Upgrade to a newer schily makefile system X X- Catch the case star -f /dev/stdout and still allow star X to avoid adding the archive file to the archive. X X- New diffopts=symperm feature allows to exclude comparing X permissions with symlinks X X- move getperm() from libfind to libschily X X- Added a rule to the makefilesystem to auto-create the directory ./incs X which was the only "empty" directory without creation rule. Thanks to a hint X from Michael Prokop X X- star -version now prints the compile options. This helps to find out whether X e.g. ACL support is included. As Linux distributions usually install non X developer friendly, this is a common problem on Linux. X X- Star has been prepareed for a future POSIX.1-2001 extended tar header keyword X "SCHILY.acl.type" that is needed in future when ZFS ACLs support is added. X X- The suntar ("tar") command line interface now switches to artype=exustar X if the -p (archive ACLs) option has been specified. X X- Star in incremental dump mode now compares whether info->f_mtime >= Newer.tv_sec X instead of info->f_mtime > Newer.tv_sec to avoid race conditions. Thanks X to a hint from Lasse Kliemann. X XTODO: X X - Complete the man page for spax X X - Implement multi volume continuation headers that work for X files > 8 GB where the last tar header X (a POSIX.1-2001 'x'-header) was split across volumes. X In this case, if only POSIX compliant TAR features are allowed, X the extracting TAR would not be able to correctly skip the X large file as it does not know the content of the POSIX.1-2001 X 'x'-header. For this reason, later star versions need to implement X a method to create multi volume continuation (skip) headers that X include the size of the split POSIX.1-2001 'x'-header and the X size of the following large file. X X Note that even with this method we would need a new method X (different from the current bitmap) to deal with multi volume X continuation headers for split files in case the FIFO in star X may be larger than 8 GB. X X - Implement a autoconf extension to to deal with Linux with XFS X where not all ACL handling is inside -lacl ??? is this still true? X XRevision history (short) X X1982 First version on UNOS (extract only) X1985 Port to UNIX (fully functional version) X1985 Added pre Posix method of handling special files/devices X1986 First experiments with fifo as external process. X1993 Remote tape access X1993 diff option X1994 Fifo with shared memory integrated into star X1994 Very long filenames and sparse files X1994 Gnutar and Ustar(Posix.1-1988) handling added X1994 Xstar format (extended Posix.1-1988) defined and introduced X1995 Ported to many platforms X1999 Support for Win32 (Cygwin) X1999 base 256 support to overcome limitation with octal fields X2001 Large file support X2001 Support for POSIX.1-2001 extended headers X2001 Support for ACLs in POSIX.1-2001 extended headers X2002 Support for extended file flags in POSIX.1-2001 extended headers X2002 Support for extended inode meta data and meta files X2003 Error control added to allow to selectively ignore error contitions X2003 ED like pattern based file name substitution with -s '/from/to/[gp]' X2003 Efficient built in -copy mode X2003 Basic support for incremental dumps (incremental restore not yet ready) X2003 CPIO archive support X2003 New command 'spax' for POSIX.1 command line compatibility. X2003 New command 'scpio' for SUSv2 command line compatibility. X2003 New command 'suntar' for Solaris command line compatibility. X2003 New command 'gnutar' for GNU tar command line compatibility. X2003 Support for reliable multi-volume archives with media size detection X2005 Support for full and incremental dumps and restores. X2005 The find(1) code has been integrated and allows to use find on archives X XSupported platforms: X XVirtually any! Known to work: X XSunOS 4.x, Solaris (SunOS 5.x), Linux, XHP-UX, DG/UX, IRIX, AIX, FreeBSD, NetBSD, OpenBSD, XOSF-1, True-64, QNX, BeOS, Apollo Domain/OS, Next-STep, XOS/2, SCO-openserver, SCO-unixware, Caldera OpenUnix, XCygwin (Win32), Sony NewsOS, BSDi (BSD/OS), QNX, XApple Rhapsody, MacOS X, AmigaOS, GNU Hurd X XJoerg X X------------------------------------------------------------- XStar is the fastest known implementation of a tar archiver. X XStar development started 1982, the first complete implementation has Xbeen done in 1985. I never did my backups with other tools than star. X XIts main advantages over other tar implementations are: X X fifo - keeps the tape streaming. X This gives you faster backups than X you can achieve with ufsdump, if the X size of the filesystem is > 1 GByte. X X remote tape support - a fast RMT implementation that has no X probems to saturate a 100 Mb/s network. X X accurate sparse files - star is able to reproduce holes in sparse X files accurately if the OS includes X the needed support functions. This is X currently true for Solaris-2.3 to X Solaris-2.5.1 X X pattern matcher - for a convenient user interface X (see manual page for more details). X To archive/extract a subset of files. X X sophisticated diff - user tailorable interface for comparing X tar archives against file trees X This is one of the most interesting parts X of the star implementation. X X no namelen limitation - Pathnames up to 1024 Bytes may be archived. X (The same limitation applies to linknames) X This limit may be expanded in future X without changing the method to record X long names. X X deals with all 3 times - stores/restores all 3 times of a file X (even creation time) X With POSIX.1-2001 the times are in nanosecond X granularity. X Star may reset access time after doing X backup. On Solaris this can be done without X changing the ctime. X X does not clobber files - more recent copies on disk will not be X clobbered from tape X This may be the main advantage over other X tar implementations. This allows X automatically repairing of corruptions X after a crash & fsck (Check for differences X after doing this with the diff option). X X automatic byte swap - star automatically detects swapped archives X and transparently reads them the right way X X automatic format detect - star automatically detects several common X archive formats and adopts to them. X Supported archive types are: X Old tar, gnu tar, ansi tar, star, X POSIX.1-2001 PAX, Sun's Solaris tar. X X X automatic compression detect - star automatically detects whether the X archive is compressed. If it has been X compressed with a compression program that X is compatible to decompression with "gzip" X or "bzip2", star automatically activates X decompression. X X fully ansi compatible - Star is fully ANSI/Posix 1003.1 compatible. X See README.otherbugs for a complete X description of bugs found in other tar X implementations. Star is the first tar X implementation that supports POSIX.1-2001. X X support for ACLs and file flags - star supports Access Control Lists X and extended file flags (as found on FreeBSD X and Linux). Support to archive and restore X other file properties may be easily added. X X support for all inode metadata - star supports to put all inode X metadata on the archive. This allows future X versions of star to perform true X incremental dumps. X X sophisticated error control - allows to tell star which error types X should be ignored for wich file name pattern. X This allows to write backup scripts that give X no error messages for all problems that are X tolerable (e.g. growing log files). X X ED like filename substitution - star supports automated pattern rule based X file name substitution as documented for 'pax'. X X A fast built in -copy mode - allows to make fast and accurate copies and X directory tree comparisons. X X Integrated find(1) code - allows many interesting new features that would X be possible with a separate find call. X XHave a look at the manual page, it is included in the distribution. X END-of-star-1.6/AN-1.5 echo x - star-1.6/STATUS.alpha sed 's/^X//' >star-1.6/STATUS.alpha << 'END-of-star-1.6/STATUS.alpha' XThis is the actual snapshot of the star-1.5 release. END-of-star-1.6/STATUS.alpha echo x - star-1.6/AN-1.2 sed 's/^X//' >star-1.6/AN-1.2 << 'END-of-star-1.6/AN-1.2' XNewsgroups: comp.unix.admin,comp.unix.misc,alt.os.linux,alt.sys.sun,bln.comp.sun,bln.comp.unix,comp.os.linux.development.apps,comp.os.linux.misc,comp.sys.hp.apps,comp.sys.hp.misc,comp.sys.sgi.admin,comp.sys.sgi.apps,comp.sys.sgi.misc,comp.sys.sun.admin,comp.sys.sun.apps,comp.sys.sun.misc,comp.unix.aix,comp.unix.bsd.freebsd.misc,comp.unix.bsd.netbsd.misc,comp.unix.solaris,de.comp.os.linux.misc,de.comp.os.unix,linux.dev.admin,linux.dev.apps,maus.os.linux,maus.os.linux68k,maus.os.unix,uk.comp.os.linux XSubject: Star-1.2 source has been released X XStar is the fastest tar archiver for UNIX X XStar has many improvements compared to other tar Ximlementations (including gnu tar). See below for a short description Xof the highlight of star. X XStar is located on: X Xftp://ftp.fokus.gmd.de/pub/unix/star X XThis release is mostly a bugfix release and now gives a Xnew stable base release in preparation of future changes. X XChanges since star-1.1: X X Fixed some problems with the -z option X Fixed some oddities with the -listnew option X Fixed a bug that caused a coredump with -nullout X Added support for the different behavior of the chown() syscall X in Linux that caused problems with extracting X suid root files on Linux X Allow the -C option to work with the listfile= option too X New option -dodesc X Added the code to use the _FIOAI ioctl on Solaris to speed up X archiving sparse files > 200 times. You need a hacked X ufs filesystem in order to use this on Solaris 2.6 X ftp://ftp.fokus.gmd.de/pub/unix/kernel/ufs X X XRevision history (short) X X1982 First version on UNOS (extract only) X1985 Port to UNIX (fully funtional version) X1985 Added pre Posix method of handling special files/devices X1986 First experiments with fifo as external process. X1993 Remote tape access X1993 diff option X1994 Fifo with shared memory integrated into star X1994 Very long filenames and sparse files X1994 Gnutar and Ustar(Posix) handling added X1994 Xstar format (extended Posix) defined and introduced X1995 Ported to many platforms X XSupported platforms: X XSunOS 4.x, Solaris (SunOS 5.x), Linux, HP-UX, DG/UX, IRIX, AIX, FreeBSD, NetBSD X XJoerg X X------------------------------------------------------------- XStar is the fastest known implementation of a tar archiver. XStar is able to make backups with more than 12MB/s if the Xdisk and tape drive support such a speed. This is more than Xdouble the speed that ufsdump will get. XAmpex got 13.5 MB/s with their new DLT tape drive. XUfsdump got a maximum speed of about 6MB/s with the same hardware. X XStar development started 1982, development is still in progress. XThe current version of star is stable and XI never did my backups with other tools than star. X XIts main advantages over other tar implementations are: X X fifo - keeps the tape streaming. X This gives you faster backups than X you can achieve with ufsdump, if the X size of the filesystem is > 1 GByte. X X pattern matcher - for a convenient user interface X (see manual page for more details). X To archive/extract a subset of files. X X sophisticated diff - user tailorable interface for comparing X tar archives against file trees X This is one of the most interesting parts X of the star implementation. X X no namelen limitation - Pathnames up to 1024 Bytes may be archived. X (The same limitation applies to linknames) X This limit may be expanded in future X without changing the method to record long names. X X deals with all 3 times - stores/restores all 3 times of a file X (even creation time) X may reset access time after doing backup X X does not clobber files - more recent copies on disk will not be X clobbered from tape X This may be the main advantage over other X tar implementations. This allows X automatically repairing of corruptions X after a crash & fsck (Check for differences X after doing this with the diff option). X X automatic byte swap - star automatically detects swapped archives X and transparently reads them the right way X X automatic format detect - star automatically detects several common X archive formats and adopts to them. X Supported archive types are: X Old tar, gnu tar, ansi tar, star. X X fully ansi compatible - Star is fully ANSI/Posix 1003.1 compatible. X See README.otherbugs for a complete description X of bugs found in other tar implementations. X XHave a look at the manual page, it is included in the distribution. X XAuthor: X XJoerg Schilling XSeestr. 110 XD-13353 Berlin XGermany X XEmail: joerg@schily.isdn.cs.tu-berlin.de, js@cs.tu-berlin.de X schilling@fokus.gmd.de X XPlease mail bugs and suggestions to me. END-of-star-1.6/AN-1.2 echo x - star-1.6/COMPILE sed 's/^X//' >star-1.6/COMPILE << 'END-of-star-1.6/COMPILE' X# @(#)README.compile 1.40 18/09/17 Copyright 1997-2018 J. Schilling X XShort overview for those who don't read manuals: X X Calling configure manually is outdated because this is a task of the X makefile system. X X There is no 'configure', simply call 'make' on the top level X directory. X X ***** X If you do not have a recent "smake" on your machine, you may first X need to compile and install a recent "smake". X X In order to get a recent "smake" source, it is recommended to fetch X the "schilytools" tarball. If your local make program is not able to X automatically compile a bootstrap smake program in the "psmake" X directory from "schilytools", please read the file "BOOTSTRAP". X ***** X X X ***** If this does not work for you, read the rest if this file ***** X ***** If you have any problem, also first read the topic specific ***** X ***** README.* files (e.g. README.linux for Linux problems). ***** X X All results in general will be placed into a directory named X OBJ// in the current projects leaf directory. X X You **need** either the Schily "smake" program, the SunPRO make X that is included in "schilytools" and typically installed in X /opt/schily/bin/make and /opt/schily/bin/dmake, the SunPRO make X from /usr/bin/make (SunOS 4.x) or /usr/ccs/bin/make (SunOS 5.x) X or GNU make to compile this program. Read READMEs/README.gmake for X more information on gmake and a list of the most annoying bugs in gmake. X X All other make programs are either not smart enough or have bugs. X X My "smake" source is at: X X https://sourceforge.net/projects/s-make/files/ X X It is easy to compile and doesn't need a working make program X on your machine. If you don't have a working "make" program on the X machine where you like to compile "smake" read the file "BOOTSTRAP". X X If you have the choice between all three make programs, the X preference would be X X 1) smake (preferred) X 2) Schily SunPRO make (preferred over (3)) X 3) SunPRO make X 4) GNU make (this is the last resort) X X Important notice: "smake" that comes with SGI/IRIX will not work!!! X This is not the Schily "smake" but a dumb make program from SGI. X X ***** If you are on a platform that is not yet known by the ***** X ***** Schily makefilesystem you cannot use GNU make. ***** X ***** In this case, the automake features of smake are required. ***** X X Note that GNU make has major bugs on various platforms and thus cannot X be used at all on VMS and OS/2. GNU make on Cygwin causes problems X because it does not deal with spaces and newlines correctly. X X Please read the README's for your operating system too. X X WARNING X Do not use 'mc' to extract the tar file! X All mc versions before 4.0.14 cannot extract symbolic links correctly. X X The versions of WinZip that support tar archives cannot be used either. X The reason is that they don't support symbolic links. X Star and Gnutar do support symbolic links even on win32 systems. X To support symbolic links on win32, you need to link with the X Cygwin32 POSIX library. X X To unpack an archive, use: X X gzip -d < some-arch.tar.gz | tar xpf - X X Replace 'some-arch.tar.gz' by the actual archive name. X X If your platform does not support hard links or symbolic links, you X first need to compile "star" and then call: X X star -xp -copy-links < some-arch.tar.gz X X If your platform does not support hard links but supports X symbolic links, you only need to call the command above once. X If your platform does not support symbolic links, you need to call X the command twice because a symbolic link may occur in the archive X before the file it points to. X X X XHere comes the long form: X X XPREFACE: X X Calling configure manually is outdated because this is a task of the X makefile system. X X You don't have to call configure with this make file system. X X Calling 'make' or 'make all' on the top level directory will create X all needed targets. Calling 'make install' will install all needed X files. X X This program uses a new makefilesystem, introduced in 1993. This X makefilesystem uses techniques and ideas from the 1980s and 1990s, X is designed in a modular way and allows sources to be combined in a X modular way. For mor information on the modular features read X README.SSPM. X X The makefilesystem is optimized for a program called 'smake' X Copyright 1985 by Jörg Schilling, but SunPro make (the make program X that comes with SunOS >= 4.0 and Solaris) as well as newer versions X of GNU make will work also. BSDmake could be made working, if it X supports pattern matching rules correctly. X X The makefile system allows simultaneous compilation on a wide X variety of target systems if the source tree is accessible via NFS. X X XFinding Compilation Results: X X To allow simultaneous compilations, all binaries and results of a X 'compilation' in any form are placed in sub-directories. This includes X automatically generated include files. Results will in general be X placed into a directory named OBJ// in the current project's X leaf directory, libraries will be placed into a directory called X libs// that is located in the source tree root directory. X X will be something like 'sparc-sunos5-cc' X X This is the main reason why simultaneous compilation is possible on X all supported platforms if the source is mounted via NFS. X X XHow to compile: X X To compile a system or sub-system, simply enter 'smake', 'dmake', 'make' X or 'Gmake'. Compilation may be initialized at any point of the source X tree of a system. X X WARNING: If compilation is started in a sub tree, only all objects X in that sub tree will be made. This usually excludes needed libraries. X NOTE: Compilation may not be started in a subdirectory unless a make X call from inside the directory "inc" has been run before. X X NOTE: The "schilytools" source tree and the "smake" source tree come X with a "smake" bootstrap environment that uses Makefile as a trampoline X and SMakefile as the major makefile in the project root directory. X If you like to use a make program other than smake from the project X root directory without the bootstrap trampoline, use X "$MAKE -f SMakefile", e.g. X X dmake -f SMakefile X X On sub directories, "-f SMakefile" is neither needed nor useful. X X Add other command line options or command line parameter if needed. X X XHow to compile in parallel mode: X X The smake program does not yet support parallel compilation. X X The dmake program supports parallel compilation. If you like the X default number of parallel jobs, just call 'dmake'. If you like X a different number, call 'dmake -j #', where # is the number of X parallel jobs. X X Note that dmake collects the output from different jobs and prints X them in a way that does not interleave. For the Schily variant of X the dmake program, the Schily Makefilesystem by default disables the X job headers in the output. If you like to see them, call: X X dmake DMAKE_OUTPUT_MODE=TXT1 X X The gmake program supports parallel mode, but does not separate the X output. If you get error or warning messages, you usually will be X confused by the mixture of the output. Recent gmake versions added X an option to separate the output from various jobs. Have a look X at the man page. X X XHow to install results: X X To install the product of a compilation in your system, call: X X smake install X X at top level. The binaries will usually be installed in X /opt/schily/bin. The directory /opt// has been agreed X on by all major UNIX vendors in 1989. Unfortunately, still not all X vendors follow this agreement. X X If you want to change the default installation directory, edit the X appropriate (system dependent) files in the DEFAULTS directory X (e.g. DEFAULTS/Defaults.sunos5). X X ***** If "smake install" doesn't do anything, you are on a broken ***** X ***** File System. Remove the file INSTALL in this case (the FS ***** X ***** does not handle upper/lower case characters correctly). ***** X ***** This is true for all DOS based filesystems and for Apple's ***** X ***** HFS+ filesystem. ***** X X XUsing a different installation directory: X X If your system does not yet use the standard installation path in X X /opt/ X X or if you don't like this installation directory, you can easily X change the installation directory. You may edit the DEFAULTS file X for your system and modify the macro INS_BASE. X X You may use a different installation directory without editing the X DEFAULTS files. If you like to install everything in the deprecated path X /usr/local, the next paragraph describes the procedure. X X If your make program supports to propagate make macros to sub make programs X which is the case for recent smake releases as well as for a recent gnumake: X X smake INS_BASE=/usr/local install X or X gmake INS_BASE=/usr/local install X X If your make program doesn't propagate make macros (e.g. SunPRO make), X call: X X env INS_BASE=/usr/local make -e install X X Note that INS_BASE=/usr/local needs to be specified for every operation X that compiles or links programs, as the path may be stored inside the X binaries. X X The location for the root specific configuratin files is controlled X via the INS_RBASE= make macro. The default vaulue for this macro is "/". X If you like to install global default configuration files into X /usr/local/etc instead of /etc, you need to spefify INS_RBASE=/usr/local X X Note that some binaries have $(INS_BASE) and $(INS_RBASE) compiled into. X If you like to like to modify the compiled-in path values, call: X X smake clean X smake INS_BASE=/usr/local INS_RBASE=/usr/local X X XSetting up a different Link mode: X X The following link modes are available: X X static statical linking as in historical UNIX X X dynamic dynamic linking as introduced by SunOS X in 1987, Microsoft's DLLs, ... X The knowledge on how to achieve this for X a particular platform is hidden in the X makefile system. X X profiled Linking against profiled libraries. X Profiled libraries are prepared for the X use with "gprof" (introduced by BSD in the X late 1970s). X X The makefile system sets up a default linkmode in the patform X related defaults file (typically in the file DEFAULTS/Defaults.) X in the projects root directory. This is done with the entry: X X DEFLINKMODE= X X A different linkmode may be selected at compile/link time by e.g. calling: X X smake LINKMODE=dynamic X X If there are already existing binaries, call: X X smake relink LINKMODE=dynamic X X instead. X X XCompiling a different ELF RUNPATH into the binaries: X X In order to allow binaries to work correctly even if the shared X libraries are not in the default search path of the runtime linker, X a RUNPATH needs to be set. X X The ELF RUNPATH is by default derived from $(INS_BASE). If you like to X set INS_BASE=/usr and create binaries that do not include a RUNPATH at all, X call: X X smake relink RUNPATH= X X XUsing a different man path prefix: X X Manual pages are by default installed under: X X $(INS_BASE)/$(MANBASE)/man X and MANBASE=share X X If you like a different prefix for man pages, call: X X smake DEFMANBASE=something install X X to install man pages into $(INS_BASE)/something/man/* X X If you like to install man pages under $(INS_BASE)/man/*, call X X smake DEFMANBASE=. install X XInstalling stripped binaries: X X If you like to install stripped binaries via "smake install", call: X X smake STRIPFLAGS=-s install X X This calls "strip" on every final install path for all executable X binaries. X XInstalling to a prototype directory to implement package creation staging: X X If you like to create a prototype directory tree that is used as an X intermediate store for package creation, use the DESTDIR macro: X X smake INS_BASE=/usr/local DESTDIR=/tmp install X X This will compile in "/usr/local" as prefix into all related binaries X and then create a usr/local tree below /tmp (i.e. /tmp/usr/local). X X Note that you need to call "smake clean" before in case that the code X was previously compiled with different defaults with regards to INS_BASE X XSetting different default directory permissions for install directories: X X All directories that are created by the Schily makefile system in the X target directory path when X X smake install X X is called system use a special default 022 that is in DEFINSUMASK= X This causes all directories in the target install path to be created X with 0755 permissions. X X All other directories that are created by the Schily makefile system X use a single global default 002 that is in DEFUMASK= X X If you like to create install directories with e.g. 0775 permissions, X call: X X smake DEFINSUMASK=002 install X XUsing a different C compiler: X X The *compiler family* is configured via the CCOM= make macro. This X selects a whole set of related macros that are needed to support a X specific compiler family. X X The *compiler family* usually defines a C compiler and a related X C++ compiler. X X If the configured default compiler family is not present on the current X machine, the makefilesystem will try an automatic fallback to GCC. For X this reason, in most cases, you will not need to manually select a X compiler. X X The default compiler family can be modified in the files in the X DEFAULT directory. If you want to have a different compiler family X for one compilation, call: X X make CCOM=gcc X or X make CCOM=cc X X This works even when your make program doesn't propagate make macros. X X XCreating 64 bit executables on Solaris: X X Simply call: X X make CCOM=gcc64 X or X make CCOM=cc64 X X It is not clear if GCC already supports other platforms in 64 bit mode. X As all GCC versions before 3.1 did emit hundreds of compilation X warnings related to 64 bit bugs when compiling itself, so there may be X other platforms are not supported in 64 bit mode. X XCreating executables using the Sun Studio compiler on Linux: X X Simply call: X X make CCOM=suncc X X If the compilation does not work, try: X X mkdir /opt/sunstudio12/prod/include/cc/linux X cp /usr/include/linux/types.h /opt/sunstudio12/prod/include/cc/linux X X Then edit /opt/sunstudio12/prod/include/cc/linux/types.h and remove all X lines like: "#if defined(__GNUC__) && !defined(__STRICT_ANSI__)" X as well as the related #endif. X XCreating executables using the clang compiler: X X Simply call: X X make CCOM=clang X X And in order to intentionally create 32 bit or 64 bit binaries, call: X X make CCOM=clang64 X or X make CCOM=clang64 X X XUsing a different compiler binary name: X X Call: X X make CC=/opt/instrumented/bin/cc X X Note that all knowledge about the options of a compiler is derived X from the CCOM= variable, so if you like to use an instrumented gcc X variant, you may like to call: X X make CCOM=gcc CC=fluffy-gcc X X You may use CC="fluffy-gcc fluffy-gcc-specific options" if you like X to enforce specific options with the compiler. See hints on cross X compilation below. X XAvoiding to compile C++ based projects: X X Call: X make C++BUILD=off X X XGetting help from the make file system: X X For a list of targets call: X X make .help X X .help is a special target that prints help for the makefile system. X X XGetting more information on the make file system: X X The man page makefiles.4 located in man/man4/makefiles.4 contains X the documentation on general use and for leaf makefiles. X X The man page makerules.4 located in man/man4/makerules.4 contains X the documentation for system programmers who want to modify X the make rules of the makefile system. X X For further information read X X http://sf.net/projects/schilytools/files/makefiles/PortableSoftware.ps.gz X X XHints for compilation: X X The makefile system is optimized for 'smake'. Smake will give the X fastest processing and best debugging output. X X SunPro make will work as is. GNU make need some special preparation. X X Read READMEs/README.gmake for more information on gmake. X X To use GNU make create a file called 'Gmake' in your search path X that contains: X X #!/bin/sh X MAKEPROG=gmake X export MAKEPROG X exec gmake "$@" X X and call 'Gmake' instead of gmake. On Linux, there is no gmake, the X program installed as 'make' on Linux is really a gmake. X X 'Gmake' and 'Gmake.linux' are part of this distribution. X X Some versions of gmake are very buggy. There are e.g. versions of gmake X on some architectures that will not correctly recognize the default X target. In this case, call 'make all' or '../Gmake all'. X X Note that pseudo error messages from gmake similar to: X X gmake[1]: Entering directory `cdrtools-1.10/conf' X ../RULES/rules.cnf:58: ../incs/sparc-sunos5-cc/Inull: No such file or directory X ../RULES/rules.cnf:59: ../incs/sparc-sunos5-cc/rules.cnf: No such file or directory X X are a result of a bug in GNU make. The make file system itself is X correct (as you could prove by using smake). X If your gmake version still has this bug, send a bug report to: X X "Paul D. Smith" X X He is the current GNU make maintainer. X X If you like to use 'smake', please always compile it from source. X The packages are located on: X X https://sourceforge.net/projects/s-make/files/alpha/ X X Smake has a -D flag to see the actual makefile source used X and a -d flag that gives easy to read debugging info. Use smake -xM X to get a makefile dependency list. Try smake -help X X XCompiling the project using engineering defaults: X X The defaults found in the directory DEFAULTS are configured to X give minimum warnings. This is made because many people will X be irritated by warning messages and because the GNU C compiler X will give warnings for perfectly correct and portable C code. X X If you want to port code to new platforms or do engineering X on the code, you should use the alternate set of defaults found X in the directory DEFAULTS_ENG. X You may do this permanently by renaming the directories or X for one compilation by calling: X X make DEFAULTSDIR=DEFAULTS_ENG X X Note however, that some GCC versions print a lot of wrong warnings X in this mode. Well known problems with GCC warnings are: X X - The recursive printf format "%r" that is in use since ~ 1980 X is not supported and causes a lot of incorrect warnings as X GCC does not know that "%r" takes 2 parameters. X X - The standard C construct "(void) read(fd, buf, sizeof (buf))" X is flagged by some versions of GCC even though the void cast X is a clear expression of the fact that the return code from read X is intentionally ignored. This may cause many useless warnings X for last resort error messages used in programs. X X XCompiling the project to allow debugging with dbx/gdb: X X If you like to compile with debugging information for dbx or gdb, X call: X X make clean X make COPTX=-g LDOPTX=-g X X If your debugger does not like optimized binaries, call something X like: X X make "COPTX=-g -xO0" LDOPTX=-g X or X make "COPTX=-g -O0" LDOPTX=-g X X depending on the option system used by your C compiler. X X XCompiling the project to allow performance monitoring with gprof from BSD: X X If you like to compile for performance monitoriing with gprof, X call: X X make clean X make COPTX=-xpg LDOPTX=-xpg LINKMODE=profiled X X or X make COPTX=-pg LDOPTX=-pg LINKMODE=profiled X X depending on the option system used by your C compiler. X X XCreating Blastwave packages: X X Call: X .clean X smake -f Mcsw X X You need the program "fakeroot" and will find the results X in packages/. X X Note that a single program source tree will allow you to create X packages like CSWstar but not the packages CSWschilybase and X CSWschilyutils on which CSWstar depends. X X X X X If you want to see an example, please have a look at the "star" X source. It may be found on: X X http://sourceforge.net/projects/s-tar/files/ X X Have a look at the manual page, it is included in the distribution. X Install the manual page with X X make install first and include /opt/schily/man in your MANPATH X X Note that some systems (e.g. Solaris 2.x) require you either to call X /usr/lib/makewhatis /opt/schily/man or to call X X man -F X X XCompiling in a cross compilation environment: X X The Schily autoconf system has been enhanced to support cross X compilation. Schily autoconf is based on GNU autoconf-2.13 and X GNU autoconf does not support cross compilation because it needs X to run scripts on the target system for some of the tests. X X The "configure" script that is delivered with the Schily makefile X system runs more than 770 tests and approx. 70 of them need to be X run on the target system. X X The Schily autoconf system now supports a method to run these ~70 X tests natively on a target system. You either need a target machine X with remote login features or you need an emulator with a method to X copy files into the emulated system and to run binaries on the X emulated system as e.g. the Android emulator. X X We currently deliver three scripts for "remote" execution of X programs on the target system: X X runrmt_ssh runs the commands remove via ssh X runrmt_rsh runs the commands remove via rsh X runrmt_android runs the commands remove via the debug bridge X X If you need to remotely run programs on a system that is not X supported by one of there three scripts, you need to modify one X of them to match your needs. X X To enable Cross Compilation use the following environment variables: X X CONFIG_RMTCALL= Set up to point to a script that does X the remote execution, e.g.: X X CONFIG_RMTCALL=`pwd`/conf/runrmt_ssh X X CONFIG_RMTHOST= Set up to point to your remote host, e.g.: X X CONFIG_RMTHOST=hostname X or X CONFIG_RMTHOST=user@hostname X X use a dummy if you like to use something X like the Android emulator. X X CONFIG_RMTDEBUG= Set to something non-null in order to X let the remote execution script mark X remote comands. This will result in X configure messages like: X X checking bits in minor device number... REMOTE 8 X X If you cannot run commands on the target X platform, you may set: X X CONFIG_RMTDEBUG=true X CONFIG_RMTCALL=: X X carefully watch for the "REMOTE" flagged test X output and later manually edit the file: X X incs//xconfig.h X X Do not forget to manually edit the files: X X incs//align.h X and X incs//avoffset.h X X Note that smake includes automake features that automatically X retrieve system ID information. For this reason, you need to overwrite X related macros from the command line if you like to do a X cross compilation. X X Related make macros: X X K_ARCH= # (sun4v) Kernel ARCH filled from uname -m / arch -k X M_ARCH= # (sun4) Machine filled from arch X P_ARCH= # (sparc) CPU ARCH filled from uname -p / mach X OSNAME= # sunos, linux, .... X OSREL= # 5.11 X OSVERSION= # snv_130 X CCOM= # generic compiler name (e.g. "gcc") X CC= # compiler to call (name for binary) X CC_COM= # compiler to call (name + basic args) X X ARCH= overwrites M_ARCH and P_ARCH X X It is usually suffucient to set ARCH and OSNAME. X X In order to use a cross compiler environment instead of a native compiler, X set the make macro CC_COM or CC to something different than "cc". X X If you are on Linux and like to compile for Android, do the following: X X 1) set up CC acording to the instructions from the cross compiler X tool chain. Important: you need to read the information for your X tool chain. A working setup may look similar to: X X NDK=/home/joerg/android-ndk-r7 X SYSROOT=\$NDK/platforms/android-14/arch-arm X CC="\$NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc --sysroot=\$SYSROOT" X export NDK X export SYSROOT X export CC X X X 2) set environment variables CONFIG_RMTCALL / CONFIG_RMTHOST, e.g.: X setenv CONFIG_RMTCALL `pwd`/conf/runrmt_android X setenv CONFIG_RMTHOST NONE X X 3) call smake: X X smake ARCH=armv5 OSNAME=linux CCOM=gcc "CC_COM=$CC" X X or X X smake ARCH=armv5 OSNAME=linux CCOM=gcc "CC=$CC" X X XCompiling with the address sanitizer: X X Be careful with a compiler enhancement called "addess sanitizer". X X First a note: the address sanitizer needs a lot of memory when in X 64-bit mode. For this reason, it is recommended to run the tests X in 32-bit mode as it may be impossible to provide a sufficient amount X of memory for the 64-bit mode. X X 1) The address sanitizer may cause autoconf to behave incorrectly in X case that the compiler options used by the "configure" run include the X address sanitizer. It seems that in addition, the address sanitizer X adds more libraries to the link list and as a result prevents X the correct autoconf decision on whether a specific library from X a "configure" test is needed by some binaries. X X If you are not sure about the current state of the source tree, start X with calling: X X ./.clean X X in the top level source directory. This makes the source tree to behave X as if if was recently unpacked from the tar archive. X X Then run run e.g.: X X cd inc/ X smake CCOM=gcc32 X cd .. X X to prepare the auto-configuration without using the address sanitizer. X This special treatment is needed as the assumptions in the address X sanitizer would not allow us to run the autoconfiguration code X correctly. X X 2) The address sanitizer by default ignores installed SIGSEGV handlers X and thus ignores the intention of the author of the code. X X The correct behavior may be switched on via setting the environment X variable: X X ASAN_OPTIONS=allow_user_segv_handler=true X X As a redult, the command line to compile the code after the X auto-configuration has been done as mentioned above is: X X ASAN_OPTIONS=allow_user_segv_handler=true smake CCOM=gcc32 COPTX="-g -O0 -fsanitize=address" LDOPTX="-g -fsanitize=address" X X 3) If you are on Linux, do not forget to call "ulimit -c unlimited", X before calling the binary. This is needed as the default on Linux is X not to create a core file. X X 4) Set the environment ASAN_OPTIONS= for the execution of the binary X to control the behavior of the Address Sanitizer while the binary X is run. X X If you like to disable the memory leak detection because your program X is a short running program that intentionally does not free() resources X before calling exit(), use: X X ASAN_OPTIONS=allow_user_segv_handler=true:detect_leaks=0 X X If you also like to get a core dump on error to debug, you may like X to use: X X ASAN_OPTIONS=allow_user_segv_handler=true:detect_leaks=0:abort_on_error=1 X X Note that the Address Sanitizer disables the creation of a core file X for 64 bit binaries as the tables used by the Address Sanitizer may X cause the core file to have a size of 16 TB. X X XCompiling with the "Americal fuzzy lop": X X Follow the instruction from above for the address sanitizer, but X use this command line to call the compiler: X X ASAN_OPTIONS=allow_user_segv_handler=true AFL_HARDEN=1 AFL_USE_ASAN=1 smake CC=afl-gcc CCOM=gcc32 X X XAuthor: X XJoerg Schilling XSeestr. 110 XD-13353 Berlin XGermany X XEmail: joerg.schilling@fokus.fraunhofer.de, joerg@schily.net X XPlease mail bugs and suggestions to me. END-of-star-1.6/COMPILE echo x - star-1.6/PORTING sed 's/^X//' >star-1.6/PORTING << 'END-of-star-1.6/PORTING' X# @(#)PORTING 1.7 18/09/17 Copyright 1997-2018 J. Schilling X XPorting FAQ for SING (Schily Is Not Gnu) utilities. X X- The base for porting is the makefile system. X Always look into: X X https://sourceforge.net/projects/schilytools/files/makefiles/ X X for a version that might be newer than the one used X inside the program that should be ported. X X If you want to know more about the makefile system, X read the man pages makefiles4 and makerules.4, X they are located in man/man4/* X X to convert a manpage troff->postscript use: X gtroff -man file.tr | grops > file.ps X X to convert a manpage troff->Terminal use: X nroff -man file.tr | more -s X X X- To be able to use the makefile system, you need a X make program that meets the minimum requirements X for a make program (see makerules(4) man page) X Currently, the following make programs meet this X minimum requirements: Smake (my program), SunPro Make and Gmake X X A good idea is to first compile 'smake' if you don't X have it already. X X The smake source can be found on: X X https://sourceforge.net/projects/s-make/files/ X or X https://sourceforge.net/projects/s-make/files/alpha/ X X for the most recent version. X X- To be able to use the makefile system with gmake, X the operating system must have a command named 'uname'. X If not, you have to provide it as a shell script. X X X1) If you are using smake release 1.1 or newer and X a recent makefile system, the next step should be done X automagically (smake-1.1 or newer implement a -version X option to retrieve the version number). X X If you are using gmake, you need to do this by hand. X X First step for adding a new architecture is creating X the appropriate rule files in the RULES directory: X X RULES/os-{newos}.id For OS identification X RULES/os-{newos}.def For OS definition (man style) X RULES/{newarch}-{newos}-cc.rul X RULES/{newarch}-{newos}-gcc.rul X X And create a file: X X DEFAULTS/Defaults.{newos} X X Have a look in similar files for a template. X X If the files hae been generated automagically by smake, X please check the content and mail me a working set for your OS. X X2) All C-porting control is located in include/mconfig.h X and in the file incs/{newarch}-{newos}-{cc!gcc}/xconfig.h X The later file is created automatically using GNU X configure. The File conf/xconfig.h.in contains all X templates and comments for the various things that are tested. X X In any case, it is recommended to carefully watch the X outout from the 'configure' run (which is automatically X started from within 'make'). You may also wish to check all X files that are created in the directory X incs/{newarch}-{newos}-{cc!gcc}/ X X3) Everything should compile now. X If not, try to hack the files and mail me your problems. X X You should have a closer look at the sources as it may be that X the first attempt to port a utility will not support X all possible features of the new OS. X If your OS supportes these features in a non standard way, X you need to hack conf/configure.in and the source and add X support for the non standard behaviour of your OS. X X This is definitely recommended if you want to port programs X like 'cdrecord' 'star' and similar which need fork(2) and X mmap(2) or setprioriry(2) or if you check programs on X non POSIX operating systems like W95/W98/WNT OS/2 and X similar. X X XNotice for porting tools, that use the SCSI library libscg: X XI) Cdrecord should compile at this moment if you are using X a new architecture. The SCSI transport however will not work. X Check this! X X All files that contain low level code for SCSI transport are X located in the directory libscg/ X XII) Implementing a SCSI Transport Layer for your architecture: X X You need to add a new block into scsihack.c that will add X support for your OS. Copy the block: X X #ifdef __NEW_ARCHITECTURE X #define SCSI_IMPL /* We have a SCSI implementation for XXX */ X /* X * Add new hacks here X */ X #include "scsi-new-arch.c" X #endif X X and rename __NEW_ARCHITECTURE to reflect your new architecture. X X Add a new file that will be called scsi-{newarch}.c X Have a look into scsi-linux-sg.c for a template how to do this. X X More hints for writing the needed SCSI low level transport functions X is in: X X http://sourceforge.net/projects/cdrtools/files/READMEs/README.scsi-IF X X4) Test your ported program. X X5) You may check other programs from me to see if everything compiles X and works. X X6) Send me your changes X XJoerg Schilling X Xjoerg.schilling@fokus.fraunhofer.de Xjoerg@schily.net END-of-star-1.6/PORTING echo x - star-1.6/BUILD sed 's/^X//' >star-1.6/BUILD << 'END-of-star-1.6/BUILD' X# @(#)README.compile 1.40 18/09/17 Copyright 1997-2018 J. Schilling X XShort overview for those who don't read manuals: X X Calling configure manually is outdated because this is a task of the X makefile system. X X There is no 'configure', simply call 'make' on the top level X directory. X X ***** X If you do not have a recent "smake" on your machine, you may first X need to compile and install a recent "smake". X X In order to get a recent "smake" source, it is recommended to fetch X the "schilytools" tarball. If your local make program is not able to X automatically compile a bootstrap smake program in the "psmake" X directory from "schilytools", please read the file "BOOTSTRAP". X ***** X X X ***** If this does not work for you, read the rest if this file ***** X ***** If you have any problem, also first read the topic specific ***** X ***** README.* files (e.g. README.linux for Linux problems). ***** X X All results in general will be placed into a directory named X OBJ// in the current projects leaf directory. X X You **need** either the Schily "smake" program, the SunPRO make X that is included in "schilytools" and typically installed in X /opt/schily/bin/make and /opt/schily/bin/dmake, the SunPRO make X from /usr/bin/make (SunOS 4.x) or /usr/ccs/bin/make (SunOS 5.x) X or GNU make to compile this program. Read READMEs/README.gmake for X more information on gmake and a list of the most annoying bugs in gmake. X X All other make programs are either not smart enough or have bugs. X X My "smake" source is at: X X https://sourceforge.net/projects/s-make/files/ X X It is easy to compile and doesn't need a working make program X on your machine. If you don't have a working "make" program on the X machine where you like to compile "smake" read the file "BOOTSTRAP". X X If you have the choice between all three make programs, the X preference would be X X 1) smake (preferred) X 2) Schily SunPRO make (preferred over (3)) X 3) SunPRO make X 4) GNU make (this is the last resort) X X Important notice: "smake" that comes with SGI/IRIX will not work!!! X This is not the Schily "smake" but a dumb make program from SGI. X X ***** If you are on a platform that is not yet known by the ***** X ***** Schily makefilesystem you cannot use GNU make. ***** X ***** In this case, the automake features of smake are required. ***** X X Note that GNU make has major bugs on various platforms and thus cannot X be used at all on VMS and OS/2. GNU make on Cygwin causes problems X because it does not deal with spaces and newlines correctly. X X Please read the README's for your operating system too. X X WARNING X Do not use 'mc' to extract the tar file! X All mc versions before 4.0.14 cannot extract symbolic links correctly. X X The versions of WinZip that support tar archives cannot be used either. X The reason is that they don't support symbolic links. X Star and Gnutar do support symbolic links even on win32 systems. X To support symbolic links on win32, you need to link with the X Cygwin32 POSIX library. X X To unpack an archive, use: X X gzip -d < some-arch.tar.gz | tar xpf - X X Replace 'some-arch.tar.gz' by the actual archive name. X X If your platform does not support hard links or symbolic links, you X first need to compile "star" and then call: X X star -xp -copy-links < some-arch.tar.gz X X If your platform does not support hard links but supports X symbolic links, you only need to call the command above once. X If your platform does not support symbolic links, you need to call X the command twice because a symbolic link may occur in the archive X before the file it points to. X X X XHere comes the long form: X X XPREFACE: X X Calling configure manually is outdated because this is a task of the X makefile system. X X You don't have to call configure with this make file system. X X Calling 'make' or 'make all' on the top level directory will create X all needed targets. Calling 'make install' will install all needed X files. X X This program uses a new makefilesystem, introduced in 1993. This X makefilesystem uses techniques and ideas from the 1980s and 1990s, X is designed in a modular way and allows sources to be combined in a X modular way. For mor information on the modular features read X README.SSPM. X X The makefilesystem is optimized for a program called 'smake' X Copyright 1985 by Jörg Schilling, but SunPro make (the make program X that comes with SunOS >= 4.0 and Solaris) as well as newer versions X of GNU make will work also. BSDmake could be made working, if it X supports pattern matching rules correctly. X X The makefile system allows simultaneous compilation on a wide X variety of target systems if the source tree is accessible via NFS. X X XFinding Compilation Results: X X To allow simultaneous compilations, all binaries and results of a X 'compilation' in any form are placed in sub-directories. This includes X automatically generated include files. Results will in general be X placed into a directory named OBJ// in the current project's X leaf directory, libraries will be placed into a directory called X libs// that is located in the source tree root directory. X X will be something like 'sparc-sunos5-cc' X X This is the main reason why simultaneous compilation is possible on X all supported platforms if the source is mounted via NFS. X X XHow to compile: X X To compile a system or sub-system, simply enter 'smake', 'dmake', 'make' X or 'Gmake'. Compilation may be initialized at any point of the source X tree of a system. X X WARNING: If compilation is started in a sub tree, only all objects X in that sub tree will be made. This usually excludes needed libraries. X NOTE: Compilation may not be started in a subdirectory unless a make X call from inside the directory "inc" has been run before. X X NOTE: The "schilytools" source tree and the "smake" source tree come X with a "smake" bootstrap environment that uses Makefile as a trampoline X and SMakefile as the major makefile in the project root directory. X If you like to use a make program other than smake from the project X root directory without the bootstrap trampoline, use X "$MAKE -f SMakefile", e.g. X X dmake -f SMakefile X X On sub directories, "-f SMakefile" is neither needed nor useful. X X Add other command line options or command line parameter if needed. X X XHow to compile in parallel mode: X X The smake program does not yet support parallel compilation. X X The dmake program supports parallel compilation. If you like the X default number of parallel jobs, just call 'dmake'. If you like X a different number, call 'dmake -j #', where # is the number of X parallel jobs. X X Note that dmake collects the output from different jobs and prints X them in a way that does not interleave. For the Schily variant of X the dmake program, the Schily Makefilesystem by default disables the X job headers in the output. If you like to see them, call: X X dmake DMAKE_OUTPUT_MODE=TXT1 X X The gmake program supports parallel mode, but does not separate the X output. If you get error or warning messages, you usually will be X confused by the mixture of the output. Recent gmake versions added X an option to separate the output from various jobs. Have a look X at the man page. X X XHow to install results: X X To install the product of a compilation in your system, call: X X smake install X X at top level. The binaries will usually be installed in X /opt/schily/bin. The directory /opt// has been agreed X on by all major UNIX vendors in 1989. Unfortunately, still not all X vendors follow this agreement. X X If you want to change the default installation directory, edit the X appropriate (system dependent) files in the DEFAULTS directory X (e.g. DEFAULTS/Defaults.sunos5). X X ***** If "smake install" doesn't do anything, you are on a broken ***** X ***** File System. Remove the file INSTALL in this case (the FS ***** X ***** does not handle upper/lower case characters correctly). ***** X ***** This is true for all DOS based filesystems and for Apple's ***** X ***** HFS+ filesystem. ***** X X XUsing a different installation directory: X X If your system does not yet use the standard installation path in X X /opt/ X X or if you don't like this installation directory, you can easily X change the installation directory. You may edit the DEFAULTS file X for your system and modify the macro INS_BASE. X X You may use a different installation directory without editing the X DEFAULTS files. If you like to install everything in the deprecated path X /usr/local, the next paragraph describes the procedure. X X If your make program supports to propagate make macros to sub make programs X which is the case for recent smake releases as well as for a recent gnumake: X X smake INS_BASE=/usr/local install X or X gmake INS_BASE=/usr/local install X X If your make program doesn't propagate make macros (e.g. SunPRO make), X call: X X env INS_BASE=/usr/local make -e install X X Note that INS_BASE=/usr/local needs to be specified for every operation X that compiles or links programs, as the path may be stored inside the X binaries. X X The location for the root specific configuratin files is controlled X via the INS_RBASE= make macro. The default vaulue for this macro is "/". X If you like to install global default configuration files into X /usr/local/etc instead of /etc, you need to spefify INS_RBASE=/usr/local X X Note that some binaries have $(INS_BASE) and $(INS_RBASE) compiled into. X If you like to like to modify the compiled-in path values, call: X X smake clean X smake INS_BASE=/usr/local INS_RBASE=/usr/local X X XSetting up a different Link mode: X X The following link modes are available: X X static statical linking as in historical UNIX X X dynamic dynamic linking as introduced by SunOS X in 1987, Microsoft's DLLs, ... X The knowledge on how to achieve this for X a particular platform is hidden in the X makefile system. X X profiled Linking against profiled libraries. X Profiled libraries are prepared for the X use with "gprof" (introduced by BSD in the X late 1970s). X X The makefile system sets up a default linkmode in the patform X related defaults file (typically in the file DEFAULTS/Defaults.) X in the projects root directory. This is done with the entry: X X DEFLINKMODE= X X A different linkmode may be selected at compile/link time by e.g. calling: X X smake LINKMODE=dynamic X X If there are already existing binaries, call: X X smake relink LINKMODE=dynamic X X instead. X X XCompiling a different ELF RUNPATH into the binaries: X X In order to allow binaries to work correctly even if the shared X libraries are not in the default search path of the runtime linker, X a RUNPATH needs to be set. X X The ELF RUNPATH is by default derived from $(INS_BASE). If you like to X set INS_BASE=/usr and create binaries that do not include a RUNPATH at all, X call: X X smake relink RUNPATH= X X XUsing a different man path prefix: X X Manual pages are by default installed under: X X $(INS_BASE)/$(MANBASE)/man X and MANBASE=share X X If you like a different prefix for man pages, call: X X smake DEFMANBASE=something install X X to install man pages into $(INS_BASE)/something/man/* X X If you like to install man pages under $(INS_BASE)/man/*, call X X smake DEFMANBASE=. install X XInstalling stripped binaries: X X If you like to install stripped binaries via "smake install", call: X X smake STRIPFLAGS=-s install X X This calls "strip" on every final install path for all executable X binaries. X XInstalling to a prototype directory to implement package creation staging: X X If you like to create a prototype directory tree that is used as an X intermediate store for package creation, use the DESTDIR macro: X X smake INS_BASE=/usr/local DESTDIR=/tmp install X X This will compile in "/usr/local" as prefix into all related binaries X and then create a usr/local tree below /tmp (i.e. /tmp/usr/local). X X Note that you need to call "smake clean" before in case that the code X was previously compiled with different defaults with regards to INS_BASE X XSetting different default directory permissions for install directories: X X All directories that are created by the Schily makefile system in the X target directory path when X X smake install X X is called system use a special default 022 that is in DEFINSUMASK= X This causes all directories in the target install path to be created X with 0755 permissions. X X All other directories that are created by the Schily makefile system X use a single global default 002 that is in DEFUMASK= X X If you like to create install directories with e.g. 0775 permissions, X call: X X smake DEFINSUMASK=002 install X XUsing a different C compiler: X X The *compiler family* is configured via the CCOM= make macro. This X selects a whole set of related macros that are needed to support a X specific compiler family. X X The *compiler family* usually defines a C compiler and a related X C++ compiler. X X If the configured default compiler family is not present on the current X machine, the makefilesystem will try an automatic fallback to GCC. For X this reason, in most cases, you will not need to manually select a X compiler. X X The default compiler family can be modified in the files in the X DEFAULT directory. If you want to have a different compiler family X for one compilation, call: X X make CCOM=gcc X or X make CCOM=cc X X This works even when your make program doesn't propagate make macros. X X XCreating 64 bit executables on Solaris: X X Simply call: X X make CCOM=gcc64 X or X make CCOM=cc64 X X It is not clear if GCC already supports other platforms in 64 bit mode. X As all GCC versions before 3.1 did emit hundreds of compilation X warnings related to 64 bit bugs when compiling itself, so there may be X other platforms are not supported in 64 bit mode. X XCreating executables using the Sun Studio compiler on Linux: X X Simply call: X X make CCOM=suncc X X If the compilation does not work, try: X X mkdir /opt/sunstudio12/prod/include/cc/linux X cp /usr/include/linux/types.h /opt/sunstudio12/prod/include/cc/linux X X Then edit /opt/sunstudio12/prod/include/cc/linux/types.h and remove all X lines like: "#if defined(__GNUC__) && !defined(__STRICT_ANSI__)" X as well as the related #endif. X XCreating executables using the clang compiler: X X Simply call: X X make CCOM=clang X X And in order to intentionally create 32 bit or 64 bit binaries, call: X X make CCOM=clang64 X or X make CCOM=clang64 X X XUsing a different compiler binary name: X X Call: X X make CC=/opt/instrumented/bin/cc X X Note that all knowledge about the options of a compiler is derived X from the CCOM= variable, so if you like to use an instrumented gcc X variant, you may like to call: X X make CCOM=gcc CC=fluffy-gcc X X You may use CC="fluffy-gcc fluffy-gcc-specific options" if you like X to enforce specific options with the compiler. See hints on cross X compilation below. X XAvoiding to compile C++ based projects: X X Call: X make C++BUILD=off X X XGetting help from the make file system: X X For a list of targets call: X X make .help X X .help is a special target that prints help for the makefile system. X X XGetting more information on the make file system: X X The man page makefiles.4 located in man/man4/makefiles.4 contains X the documentation on general use and for leaf makefiles. X X The man page makerules.4 located in man/man4/makerules.4 contains X the documentation for system programmers who want to modify X the make rules of the makefile system. X X For further information read X X http://sf.net/projects/schilytools/files/makefiles/PortableSoftware.ps.gz X X XHints for compilation: X X The makefile system is optimized for 'smake'. Smake will give the X fastest processing and best debugging output. X X SunPro make will work as is. GNU make need some special preparation. X X Read READMEs/README.gmake for more information on gmake. X X To use GNU make create a file called 'Gmake' in your search path X that contains: X X #!/bin/sh X MAKEPROG=gmake X export MAKEPROG X exec gmake "$@" X X and call 'Gmake' instead of gmake. On Linux, there is no gmake, the X program installed as 'make' on Linux is really a gmake. X X 'Gmake' and 'Gmake.linux' are part of this distribution. X X Some versions of gmake are very buggy. There are e.g. versions of gmake X on some architectures that will not correctly recognize the default X target. In this case, call 'make all' or '../Gmake all'. X X Note that pseudo error messages from gmake similar to: X X gmake[1]: Entering directory `cdrtools-1.10/conf' X ../RULES/rules.cnf:58: ../incs/sparc-sunos5-cc/Inull: No such file or directory X ../RULES/rules.cnf:59: ../incs/sparc-sunos5-cc/rules.cnf: No such file or directory X X are a result of a bug in GNU make. The make file system itself is X correct (as you could prove by using smake). X If your gmake version still has this bug, send a bug report to: X X "Paul D. Smith" X X He is the current GNU make maintainer. X X If you like to use 'smake', please always compile it from source. X The packages are located on: X X https://sourceforge.net/projects/s-make/files/alpha/ X X Smake has a -D flag to see the actual makefile source used X and a -d flag that gives easy to read debugging info. Use smake -xM X to get a makefile dependency list. Try smake -help X X XCompiling the project using engineering defaults: X X The defaults found in the directory DEFAULTS are configured to X give minimum warnings. This is made because many people will X be irritated by warning messages and because the GNU C compiler X will give warnings for perfectly correct and portable C code. X X If you want to port code to new platforms or do engineering X on the code, you should use the alternate set of defaults found X in the directory DEFAULTS_ENG. X You may do this permanently by renaming the directories or X for one compilation by calling: X X make DEFAULTSDIR=DEFAULTS_ENG X X Note however, that some GCC versions print a lot of wrong warnings X in this mode. Well known problems with GCC warnings are: X X - The recursive printf format "%r" that is in use since ~ 1980 X is not supported and causes a lot of incorrect warnings as X GCC does not know that "%r" takes 2 parameters. X X - The standard C construct "(void) read(fd, buf, sizeof (buf))" X is flagged by some versions of GCC even though the void cast X is a clear expression of the fact that the return code from read X is intentionally ignored. This may cause many useless warnings X for last resort error messages used in programs. X X XCompiling the project to allow debugging with dbx/gdb: X X If you like to compile with debugging information for dbx or gdb, X call: X X make clean X make COPTX=-g LDOPTX=-g X X If your debugger does not like optimized binaries, call something X like: X X make "COPTX=-g -xO0" LDOPTX=-g X or X make "COPTX=-g -O0" LDOPTX=-g X X depending on the option system used by your C compiler. X X XCompiling the project to allow performance monitoring with gprof from BSD: X X If you like to compile for performance monitoriing with gprof, X call: X X make clean X make COPTX=-xpg LDOPTX=-xpg LINKMODE=profiled X X or X make COPTX=-pg LDOPTX=-pg LINKMODE=profiled X X depending on the option system used by your C compiler. X X XCreating Blastwave packages: X X Call: X .clean X smake -f Mcsw X X You need the program "fakeroot" and will find the results X in packages/. X X Note that a single program source tree will allow you to create X packages like CSWstar but not the packages CSWschilybase and X CSWschilyutils on which CSWstar depends. X X X X X If you want to see an example, please have a look at the "star" X source. It may be found on: X X http://sourceforge.net/projects/s-tar/files/ X X Have a look at the manual page, it is included in the distribution. X Install the manual page with X X make install first and include /opt/schily/man in your MANPATH X X Note that some systems (e.g. Solaris 2.x) require you either to call X /usr/lib/makewhatis /opt/schily/man or to call X X man -F X X XCompiling in a cross compilation environment: X X The Schily autoconf system has been enhanced to support cross X compilation. Schily autoconf is based on GNU autoconf-2.13 and X GNU autoconf does not support cross compilation because it needs X to run scripts on the target system for some of the tests. X X The "configure" script that is delivered with the Schily makefile X system runs more than 770 tests and approx. 70 of them need to be X run on the target system. X X The Schily autoconf system now supports a method to run these ~70 X tests natively on a target system. You either need a target machine X with remote login features or you need an emulator with a method to X copy files into the emulated system and to run binaries on the X emulated system as e.g. the Android emulator. X X We currently deliver three scripts for "remote" execution of X programs on the target system: X X runrmt_ssh runs the commands remove via ssh X runrmt_rsh runs the commands remove via rsh X runrmt_android runs the commands remove via the debug bridge X X If you need to remotely run programs on a system that is not X supported by one of there three scripts, you need to modify one X of them to match your needs. X X To enable Cross Compilation use the following environment variables: X X CONFIG_RMTCALL= Set up to point to a script that does X the remote execution, e.g.: X X CONFIG_RMTCALL=`pwd`/conf/runrmt_ssh X X CONFIG_RMTHOST= Set up to point to your remote host, e.g.: X X CONFIG_RMTHOST=hostname X or X CONFIG_RMTHOST=user@hostname X X use a dummy if you like to use something X like the Android emulator. X X CONFIG_RMTDEBUG= Set to something non-null in order to X let the remote execution script mark X remote comands. This will result in X configure messages like: X X checking bits in minor device number... REMOTE 8 X X If you cannot run commands on the target X platform, you may set: X X CONFIG_RMTDEBUG=true X CONFIG_RMTCALL=: X X carefully watch for the "REMOTE" flagged test X output and later manually edit the file: X X incs//xconfig.h X X Do not forget to manually edit the files: X X incs//align.h X and X incs//avoffset.h X X Note that smake includes automake features that automatically X retrieve system ID information. For this reason, you need to overwrite X related macros from the command line if you like to do a X cross compilation. X X Related make macros: X X K_ARCH= # (sun4v) Kernel ARCH filled from uname -m / arch -k X M_ARCH= # (sun4) Machine filled from arch X P_ARCH= # (sparc) CPU ARCH filled from uname -p / mach X OSNAME= # sunos, linux, .... X OSREL= # 5.11 X OSVERSION= # snv_130 X CCOM= # generic compiler name (e.g. "gcc") X CC= # compiler to call (name for binary) X CC_COM= # compiler to call (name + basic args) X X ARCH= overwrites M_ARCH and P_ARCH X X It is usually suffucient to set ARCH and OSNAME. X X In order to use a cross compiler environment instead of a native compiler, X set the make macro CC_COM or CC to something different than "cc". X X If you are on Linux and like to compile for Android, do the following: X X 1) set up CC acording to the instructions from the cross compiler X tool chain. Important: you need to read the information for your X tool chain. A working setup may look similar to: X X NDK=/home/joerg/android-ndk-r7 X SYSROOT=\$NDK/platforms/android-14/arch-arm X CC="\$NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc --sysroot=\$SYSROOT" X export NDK X export SYSROOT X export CC X X X 2) set environment variables CONFIG_RMTCALL / CONFIG_RMTHOST, e.g.: X setenv CONFIG_RMTCALL `pwd`/conf/runrmt_android X setenv CONFIG_RMTHOST NONE X X 3) call smake: X X smake ARCH=armv5 OSNAME=linux CCOM=gcc "CC_COM=$CC" X X or X X smake ARCH=armv5 OSNAME=linux CCOM=gcc "CC=$CC" X X XCompiling with the address sanitizer: X X Be careful with a compiler enhancement called "addess sanitizer". X X First a note: the address sanitizer needs a lot of memory when in X 64-bit mode. For this reason, it is recommended to run the tests X in 32-bit mode as it may be impossible to provide a sufficient amount X of memory for the 64-bit mode. X X 1) The address sanitizer may cause autoconf to behave incorrectly in X case that the compiler options used by the "configure" run include the X address sanitizer. It seems that in addition, the address sanitizer X adds more libraries to the link list and as a result prevents X the correct autoconf decision on whether a specific library from X a "configure" test is needed by some binaries. X X If you are not sure about the current state of the source tree, start X with calling: X X ./.clean X X in the top level source directory. This makes the source tree to behave X as if if was recently unpacked from the tar archive. X X Then run run e.g.: X X cd inc/ X smake CCOM=gcc32 X cd .. X X to prepare the auto-configuration without using the address sanitizer. X This special treatment is needed as the assumptions in the address X sanitizer would not allow us to run the autoconfiguration code X correctly. X X 2) The address sanitizer by default ignores installed SIGSEGV handlers X and thus ignores the intention of the author of the code. X X The correct behavior may be switched on via setting the environment X variable: X X ASAN_OPTIONS=allow_user_segv_handler=true X X As a redult, the command line to compile the code after the X auto-configuration has been done as mentioned above is: X X ASAN_OPTIONS=allow_user_segv_handler=true smake CCOM=gcc32 COPTX="-g -O0 -fsanitize=address" LDOPTX="-g -fsanitize=address" X X 3) If you are on Linux, do not forget to call "ulimit -c unlimited", X before calling the binary. This is needed as the default on Linux is X not to create a core file. X X 4) Set the environment ASAN_OPTIONS= for the execution of the binary X to control the behavior of the Address Sanitizer while the binary X is run. X X If you like to disable the memory leak detection because your program X is a short running program that intentionally does not free() resources X before calling exit(), use: X X ASAN_OPTIONS=allow_user_segv_handler=true:detect_leaks=0 X X If you also like to get a core dump on error to debug, you may like X to use: X X ASAN_OPTIONS=allow_user_segv_handler=true:detect_leaks=0:abort_on_error=1 X X Note that the Address Sanitizer disables the creation of a core file X for 64 bit binaries as the tables used by the Address Sanitizer may X cause the core file to have a size of 16 TB. X X XCompiling with the "Americal fuzzy lop": X X Follow the instruction from above for the address sanitizer, but X use this command line to call the compiler: X X ASAN_OPTIONS=allow_user_segv_handler=true AFL_HARDEN=1 AFL_USE_ASAN=1 smake CC=afl-gcc CCOM=gcc32 X X XAuthor: X XJoerg Schilling XSeestr. 110 XD-13353 Berlin XGermany X XEmail: joerg.schilling@fokus.fraunhofer.de, joerg@schily.net X XPlease mail bugs and suggestions to me. END-of-star-1.6/BUILD echo x - star-1.6/INSTALL sed 's/^X//' >star-1.6/INSTALL << 'END-of-star-1.6/INSTALL' X# @(#)README.compile 1.40 18/09/17 Copyright 1997-2018 J. Schilling X XShort overview for those who don't read manuals: X X Calling configure manually is outdated because this is a task of the X makefile system. X X There is no 'configure', simply call 'make' on the top level X directory. X X ***** X If you do not have a recent "smake" on your machine, you may first X need to compile and install a recent "smake". X X In order to get a recent "smake" source, it is recommended to fetch X the "schilytools" tarball. If your local make program is not able to X automatically compile a bootstrap smake program in the "psmake" X directory from "schilytools", please read the file "BOOTSTRAP". X ***** X X X ***** If this does not work for you, read the rest if this file ***** X ***** If you have any problem, also first read the topic specific ***** X ***** README.* files (e.g. README.linux for Linux problems). ***** X X All results in general will be placed into a directory named X OBJ// in the current projects leaf directory. X X You **need** either the Schily "smake" program, the SunPRO make X that is included in "schilytools" and typically installed in X /opt/schily/bin/make and /opt/schily/bin/dmake, the SunPRO make X from /usr/bin/make (SunOS 4.x) or /usr/ccs/bin/make (SunOS 5.x) X or GNU make to compile this program. Read READMEs/README.gmake for X more information on gmake and a list of the most annoying bugs in gmake. X X All other make programs are either not smart enough or have bugs. X X My "smake" source is at: X X https://sourceforge.net/projects/s-make/files/ X X It is easy to compile and doesn't need a working make program X on your machine. If you don't have a working "make" program on the X machine where you like to compile "smake" read the file "BOOTSTRAP". X X If you have the choice between all three make programs, the X preference would be X X 1) smake (preferred) X 2) Schily SunPRO make (preferred over (3)) X 3) SunPRO make X 4) GNU make (this is the last resort) X X Important notice: "smake" that comes with SGI/IRIX will not work!!! X This is not the Schily "smake" but a dumb make program from SGI. X X ***** If you are on a platform that is not yet known by the ***** X ***** Schily makefilesystem you cannot use GNU make. ***** X ***** In this case, the automake features of smake are required. ***** X X Note that GNU make has major bugs on various platforms and thus cannot X be used at all on VMS and OS/2. GNU make on Cygwin causes problems X because it does not deal with spaces and newlines correctly. X X Please read the README's for your operating system too. X X WARNING X Do not use 'mc' to extract the tar file! X All mc versions before 4.0.14 cannot extract symbolic links correctly. X X The versions of WinZip that support tar archives cannot be used either. X The reason is that they don't support symbolic links. X Star and Gnutar do support symbolic links even on win32 systems. X To support symbolic links on win32, you need to link with the X Cygwin32 POSIX library. X X To unpack an archive, use: X X gzip -d < some-arch.tar.gz | tar xpf - X X Replace 'some-arch.tar.gz' by the actual archive name. X X If your platform does not support hard links or symbolic links, you X first need to compile "star" and then call: X X star -xp -copy-links < some-arch.tar.gz X X If your platform does not support hard links but supports X symbolic links, you only need to call the command above once. X If your platform does not support symbolic links, you need to call X the command twice because a symbolic link may occur in the archive X before the file it points to. X X X XHere comes the long form: X X XPREFACE: X X Calling configure manually is outdated because this is a task of the X makefile system. X X You don't have to call configure with this make file system. X X Calling 'make' or 'make all' on the top level directory will create X all needed targets. Calling 'make install' will install all needed X files. X X This program uses a new makefilesystem, introduced in 1993. This X makefilesystem uses techniques and ideas from the 1980s and 1990s, X is designed in a modular way and allows sources to be combined in a X modular way. For mor information on the modular features read X README.SSPM. X X The makefilesystem is optimized for a program called 'smake' X Copyright 1985 by Jörg Schilling, but SunPro make (the make program X that comes with SunOS >= 4.0 and Solaris) as well as newer versions X of GNU make will work also. BSDmake could be made working, if it X supports pattern matching rules correctly. X X The makefile system allows simultaneous compilation on a wide X variety of target systems if the source tree is accessible via NFS. X X XFinding Compilation Results: X X To allow simultaneous compilations, all binaries and results of a X 'compilation' in any form are placed in sub-directories. This includes X automatically generated include files. Results will in general be X placed into a directory named OBJ// in the current project's X leaf directory, libraries will be placed into a directory called X libs// that is located in the source tree root directory. X X will be something like 'sparc-sunos5-cc' X X This is the main reason why simultaneous compilation is possible on X all supported platforms if the source is mounted via NFS. X X XHow to compile: X X To compile a system or sub-system, simply enter 'smake', 'dmake', 'make' X or 'Gmake'. Compilation may be initialized at any point of the source X tree of a system. X X WARNING: If compilation is started in a sub tree, only all objects X in that sub tree will be made. This usually excludes needed libraries. X NOTE: Compilation may not be started in a subdirectory unless a make X call from inside the directory "inc" has been run before. X X NOTE: The "schilytools" source tree and the "smake" source tree come X with a "smake" bootstrap environment that uses Makefile as a trampoline X and SMakefile as the major makefile in the project root directory. X If you like to use a make program other than smake from the project X root directory without the bootstrap trampoline, use X "$MAKE -f SMakefile", e.g. X X dmake -f SMakefile X X On sub directories, "-f SMakefile" is neither needed nor useful. X X Add other command line options or command line parameter if needed. X X XHow to compile in parallel mode: X X The smake program does not yet support parallel compilation. X X The dmake program supports parallel compilation. If you like the X default number of parallel jobs, just call 'dmake'. If you like X a different number, call 'dmake -j #', where # is the number of X parallel jobs. X X Note that dmake collects the output from different jobs and prints X them in a way that does not interleave. For the Schily variant of X the dmake program, the Schily Makefilesystem by default disables the X job headers in the output. If you like to see them, call: X X dmake DMAKE_OUTPUT_MODE=TXT1 X X The gmake program supports parallel mode, but does not separate the X output. If you get error or warning messages, you usually will be X confused by the mixture of the output. Recent gmake versions added X an option to separate the output from various jobs. Have a look X at the man page. X X XHow to install results: X X To install the product of a compilation in your system, call: X X smake install X X at top level. The binaries will usually be installed in X /opt/schily/bin. The directory /opt// has been agreed X on by all major UNIX vendors in 1989. Unfortunately, still not all X vendors follow this agreement. X X If you want to change the default installation directory, edit the X appropriate (system dependent) files in the DEFAULTS directory X (e.g. DEFAULTS/Defaults.sunos5). X X ***** If "smake install" doesn't do anything, you are on a broken ***** X ***** File System. Remove the file INSTALL in this case (the FS ***** X ***** does not handle upper/lower case characters correctly). ***** X ***** This is true for all DOS based filesystems and for Apple's ***** X ***** HFS+ filesystem. ***** X X XUsing a different installation directory: X X If your system does not yet use the standard installation path in X X /opt/ X X or if you don't like this installation directory, you can easily X change the installation directory. You may edit the DEFAULTS file X for your system and modify the macro INS_BASE. X X You may use a different installation directory without editing the X DEFAULTS files. If you like to install everything in the deprecated path X /usr/local, the next paragraph describes the procedure. X X If your make program supports to propagate make macros to sub make programs X which is the case for recent smake releases as well as for a recent gnumake: X X smake INS_BASE=/usr/local install X or X gmake INS_BASE=/usr/local install X X If your make program doesn't propagate make macros (e.g. SunPRO make), X call: X X env INS_BASE=/usr/local make -e install X X Note that INS_BASE=/usr/local needs to be specified for every operation X that compiles or links programs, as the path may be stored inside the X binaries. X X The location for the root specific configuratin files is controlled X via the INS_RBASE= make macro. The default vaulue for this macro is "/". X If you like to install global default configuration files into X /usr/local/etc instead of /etc, you need to spefify INS_RBASE=/usr/local X X Note that some binaries have $(INS_BASE) and $(INS_RBASE) compiled into. X If you like to like to modify the compiled-in path values, call: X X smake clean X smake INS_BASE=/usr/local INS_RBASE=/usr/local X X XSetting up a different Link mode: X X The following link modes are available: X X static statical linking as in historical UNIX X X dynamic dynamic linking as introduced by SunOS X in 1987, Microsoft's DLLs, ... X The knowledge on how to achieve this for X a particular platform is hidden in the X makefile system. X X profiled Linking against profiled libraries. X Profiled libraries are prepared for the X use with "gprof" (introduced by BSD in the X late 1970s). X X The makefile system sets up a default linkmode in the patform X related defaults file (typically in the file DEFAULTS/Defaults.) X in the projects root directory. This is done with the entry: X X DEFLINKMODE= X X A different linkmode may be selected at compile/link time by e.g. calling: X X smake LINKMODE=dynamic X X If there are already existing binaries, call: X X smake relink LINKMODE=dynamic X X instead. X X XCompiling a different ELF RUNPATH into the binaries: X X In order to allow binaries to work correctly even if the shared X libraries are not in the default search path of the runtime linker, X a RUNPATH needs to be set. X X The ELF RUNPATH is by default derived from $(INS_BASE). If you like to X set INS_BASE=/usr and create binaries that do not include a RUNPATH at all, X call: X X smake relink RUNPATH= X X XUsing a different man path prefix: X X Manual pages are by default installed under: X X $(INS_BASE)/$(MANBASE)/man X and MANBASE=share X X If you like a different prefix for man pages, call: X X smake DEFMANBASE=something install X X to install man pages into $(INS_BASE)/something/man/* X X If you like to install man pages under $(INS_BASE)/man/*, call X X smake DEFMANBASE=. install X XInstalling stripped binaries: X X If you like to install stripped binaries via "smake install", call: X X smake STRIPFLAGS=-s install X X This calls "strip" on every final install path for all executable X binaries. X XInstalling to a prototype directory to implement package creation staging: X X If you like to create a prototype directory tree that is used as an X intermediate store for package creation, use the DESTDIR macro: X X smake INS_BASE=/usr/local DESTDIR=/tmp install X X This will compile in "/usr/local" as prefix into all related binaries X and then create a usr/local tree below /tmp (i.e. /tmp/usr/local). X X Note that you need to call "smake clean" before in case that the code X was previously compiled with different defaults with regards to INS_BASE X XSetting different default directory permissions for install directories: X X All directories that are created by the Schily makefile system in the X target directory path when X X smake install X X is called system use a special default 022 that is in DEFINSUMASK= X This causes all directories in the target install path to be created X with 0755 permissions. X X All other directories that are created by the Schily makefile system X use a single global default 002 that is in DEFUMASK= X X If you like to create install directories with e.g. 0775 permissions, X call: X X smake DEFINSUMASK=002 install X XUsing a different C compiler: X X The *compiler family* is configured via the CCOM= make macro. This X selects a whole set of related macros that are needed to support a X specific compiler family. X X The *compiler family* usually defines a C compiler and a related X C++ compiler. X X If the configured default compiler family is not present on the current X machine, the makefilesystem will try an automatic fallback to GCC. For X this reason, in most cases, you will not need to manually select a X compiler. X X The default compiler family can be modified in the files in the X DEFAULT directory. If you want to have a different compiler family X for one compilation, call: X X make CCOM=gcc X or X make CCOM=cc X X This works even when your make program doesn't propagate make macros. X X XCreating 64 bit executables on Solaris: X X Simply call: X X make CCOM=gcc64 X or X make CCOM=cc64 X X It is not clear if GCC already supports other platforms in 64 bit mode. X As all GCC versions before 3.1 did emit hundreds of compilation X warnings related to 64 bit bugs when compiling itself, so there may be X other platforms are not supported in 64 bit mode. X XCreating executables using the Sun Studio compiler on Linux: X X Simply call: X X make CCOM=suncc X X If the compilation does not work, try: X X mkdir /opt/sunstudio12/prod/include/cc/linux X cp /usr/include/linux/types.h /opt/sunstudio12/prod/include/cc/linux X X Then edit /opt/sunstudio12/prod/include/cc/linux/types.h and remove all X lines like: "#if defined(__GNUC__) && !defined(__STRICT_ANSI__)" X as well as the related #endif. X XCreating executables using the clang compiler: X X Simply call: X X make CCOM=clang X X And in order to intentionally create 32 bit or 64 bit binaries, call: X X make CCOM=clang64 X or X make CCOM=clang64 X X XUsing a different compiler binary name: X X Call: X X make CC=/opt/instrumented/bin/cc X X Note that all knowledge about the options of a compiler is derived X from the CCOM= variable, so if you like to use an instrumented gcc X variant, you may like to call: X X make CCOM=gcc CC=fluffy-gcc X X You may use CC="fluffy-gcc fluffy-gcc-specific options" if you like X to enforce specific options with the compiler. See hints on cross X compilation below. X XAvoiding to compile C++ based projects: X X Call: X make C++BUILD=off X X XGetting help from the make file system: X X For a list of targets call: X X make .help X X .help is a special target that prints help for the makefile system. X X XGetting more information on the make file system: X X The man page makefiles.4 located in man/man4/makefiles.4 contains X the documentation on general use and for leaf makefiles. X X The man page makerules.4 located in man/man4/makerules.4 contains X the documentation for system programmers who want to modify X the make rules of the makefile system. X X For further information read X X http://sf.net/projects/schilytools/files/makefiles/PortableSoftware.ps.gz X X XHints for compilation: X X The makefile system is optimized for 'smake'. Smake will give the X fastest processing and best debugging output. X X SunPro make will work as is. GNU make need some special preparation. X X Read READMEs/README.gmake for more information on gmake. X X To use GNU make create a file called 'Gmake' in your search path X that contains: X X #!/bin/sh X MAKEPROG=gmake X export MAKEPROG X exec gmake "$@" X X and call 'Gmake' instead of gmake. On Linux, there is no gmake, the X program installed as 'make' on Linux is really a gmake. X X 'Gmake' and 'Gmake.linux' are part of this distribution. X X Some versions of gmake are very buggy. There are e.g. versions of gmake X on some architectures that will not correctly recognize the default X target. In this case, call 'make all' or '../Gmake all'. X X Note that pseudo error messages from gmake similar to: X X gmake[1]: Entering directory `cdrtools-1.10/conf' X ../RULES/rules.cnf:58: ../incs/sparc-sunos5-cc/Inull: No such file or directory X ../RULES/rules.cnf:59: ../incs/sparc-sunos5-cc/rules.cnf: No such file or directory X X are a result of a bug in GNU make. The make file system itself is X correct (as you could prove by using smake). X If your gmake version still has this bug, send a bug report to: X X "Paul D. Smith" X X He is the current GNU make maintainer. X X If you like to use 'smake', please always compile it from source. X The packages are located on: X X https://sourceforge.net/projects/s-make/files/alpha/ X X Smake has a -D flag to see the actual makefile source used X and a -d flag that gives easy to read debugging info. Use smake -xM X to get a makefile dependency list. Try smake -help X X XCompiling the project using engineering defaults: X X The defaults found in the directory DEFAULTS are configured to X give minimum warnings. This is made because many people will X be irritated by warning messages and because the GNU C compiler X will give warnings for perfectly correct and portable C code. X X If you want to port code to new platforms or do engineering X on the code, you should use the alternate set of defaults found X in the directory DEFAULTS_ENG. X You may do this permanently by renaming the directories or X for one compilation by calling: X X make DEFAULTSDIR=DEFAULTS_ENG X X Note however, that some GCC versions print a lot of wrong warnings X in this mode. Well known problems with GCC warnings are: X X - The recursive printf format "%r" that is in use since ~ 1980 X is not supported and causes a lot of incorrect warnings as X GCC does not know that "%r" takes 2 parameters. X X - The standard C construct "(void) read(fd, buf, sizeof (buf))" X is flagged by some versions of GCC even though the void cast X is a clear expression of the fact that the return code from read X is intentionally ignored. This may cause many useless warnings X for last resort error messages used in programs. X X XCompiling the project to allow debugging with dbx/gdb: X X If you like to compile with debugging information for dbx or gdb, X call: X X make clean X make COPTX=-g LDOPTX=-g X X If your debugger does not like optimized binaries, call something X like: X X make "COPTX=-g -xO0" LDOPTX=-g X or X make "COPTX=-g -O0" LDOPTX=-g X X depending on the option system used by your C compiler. X X XCompiling the project to allow performance monitoring with gprof from BSD: X X If you like to compile for performance monitoriing with gprof, X call: X X make clean X make COPTX=-xpg LDOPTX=-xpg LINKMODE=profiled X X or X make COPTX=-pg LDOPTX=-pg LINKMODE=profiled X X depending on the option system used by your C compiler. X X XCreating Blastwave packages: X X Call: X .clean X smake -f Mcsw X X You need the program "fakeroot" and will find the results X in packages/. X X Note that a single program source tree will allow you to create X packages like CSWstar but not the packages CSWschilybase and X CSWschilyutils on which CSWstar depends. X X X X X If you want to see an example, please have a look at the "star" X source. It may be found on: X X http://sourceforge.net/projects/s-tar/files/ X X Have a look at the manual page, it is included in the distribution. X Install the manual page with X X make install first and include /opt/schily/man in your MANPATH X X Note that some systems (e.g. Solaris 2.x) require you either to call X /usr/lib/makewhatis /opt/schily/man or to call X X man -F X X XCompiling in a cross compilation environment: X X The Schily autoconf system has been enhanced to support cross X compilation. Schily autoconf is based on GNU autoconf-2.13 and X GNU autoconf does not support cross compilation because it needs X to run scripts on the target system for some of the tests. X X The "configure" script that is delivered with the Schily makefile X system runs more than 770 tests and approx. 70 of them need to be X run on the target system. X X The Schily autoconf system now supports a method to run these ~70 X tests natively on a target system. You either need a target machine X with remote login features or you need an emulator with a method to X copy files into the emulated system and to run binaries on the X emulated system as e.g. the Android emulator. X X We currently deliver three scripts for "remote" execution of X programs on the target system: X X runrmt_ssh runs the commands remove via ssh X runrmt_rsh runs the commands remove via rsh X runrmt_android runs the commands remove via the debug bridge X X If you need to remotely run programs on a system that is not X supported by one of there three scripts, you need to modify one X of them to match your needs. X X To enable Cross Compilation use the following environment variables: X X CONFIG_RMTCALL= Set up to point to a script that does X the remote execution, e.g.: X X CONFIG_RMTCALL=`pwd`/conf/runrmt_ssh X X CONFIG_RMTHOST= Set up to point to your remote host, e.g.: X X CONFIG_RMTHOST=hostname X or X CONFIG_RMTHOST=user@hostname X X use a dummy if you like to use something X like the Android emulator. X X CONFIG_RMTDEBUG= Set to something non-null in order to X let the remote execution script mark X remote comands. This will result in X configure messages like: X X checking bits in minor device number... REMOTE 8 X X If you cannot run commands on the target X platform, you may set: X X CONFIG_RMTDEBUG=true X CONFIG_RMTCALL=: X X carefully watch for the "REMOTE" flagged test X output and later manually edit the file: X X incs//xconfig.h X X Do not forget to manually edit the files: X X incs//align.h X and X incs//avoffset.h X X Note that smake includes automake features that automatically X retrieve system ID information. For this reason, you need to overwrite X related macros from the command line if you like to do a X cross compilation. X X Related make macros: X X K_ARCH= # (sun4v) Kernel ARCH filled from uname -m / arch -k X M_ARCH= # (sun4) Machine filled from arch X P_ARCH= # (sparc) CPU ARCH filled from uname -p / mach X OSNAME= # sunos, linux, .... X OSREL= # 5.11 X OSVERSION= # snv_130 X CCOM= # generic compiler name (e.g. "gcc") X CC= # compiler to call (name for binary) X CC_COM= # compiler to call (name + basic args) X X ARCH= overwrites M_ARCH and P_ARCH X X It is usually suffucient to set ARCH and OSNAME. X X In order to use a cross compiler environment instead of a native compiler, X set the make macro CC_COM or CC to something different than "cc". X X If you are on Linux and like to compile for Android, do the following: X X 1) set up CC acording to the instructions from the cross compiler X tool chain. Important: you need to read the information for your X tool chain. A working setup may look similar to: X X NDK=/home/joerg/android-ndk-r7 X SYSROOT=\$NDK/platforms/android-14/arch-arm X CC="\$NDK/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-gcc --sysroot=\$SYSROOT" X export NDK X export SYSROOT X export CC X X X 2) set environment variables CONFIG_RMTCALL / CONFIG_RMTHOST, e.g.: X setenv CONFIG_RMTCALL `pwd`/conf/runrmt_android X setenv CONFIG_RMTHOST NONE X X 3) call smake: X X smake ARCH=armv5 OSNAME=linux CCOM=gcc "CC_COM=$CC" X X or X X smake ARCH=armv5 OSNAME=linux CCOM=gcc "CC=$CC" X X XCompiling with the address sanitizer: X X Be careful with a compiler enhancement called "addess sanitizer". X X First a note: the address sanitizer needs a lot of memory when in X 64-bit mode. For this reason, it is recommended to run the tests X in 32-bit mode as it may be impossible to provide a sufficient amount X of memory for the 64-bit mode. X X 1) The address sanitizer may cause autoconf to behave incorrectly in X case that the compiler options used by the "configure" run include the X address sanitizer. It seems that in addition, the address sanitizer X adds more libraries to the link list and as a result prevents X the correct autoconf decision on whether a specific library from X a "configure" test is needed by some binaries. X X If you are not sure about the current state of the source tree, start X with calling: X X ./.clean X X in the top level source directory. This makes the source tree to behave X as if if was recently unpacked from the tar archive. X X Then run run e.g.: X X cd inc/ X smake CCOM=gcc32 X cd .. X X to prepare the auto-configuration without using the address sanitizer. X This special treatment is needed as the assumptions in the address X sanitizer would not allow us to run the autoconfiguration code X correctly. X X 2) The address sanitizer by default ignores installed SIGSEGV handlers X and thus ignores the intention of the author of the code. X X The correct behavior may be switched on via setting the environment X variable: X X ASAN_OPTIONS=allow_user_segv_handler=true X X As a redult, the command line to compile the code after the X auto-configuration has been done as mentioned above is: X X ASAN_OPTIONS=allow_user_segv_handler=true smake CCOM=gcc32 COPTX="-g -O0 -fsanitize=address" LDOPTX="-g -fsanitize=address" X X 3) If you are on Linux, do not forget to call "ulimit -c unlimited", X before calling the binary. This is needed as the default on Linux is X not to create a core file. X X 4) Set the environment ASAN_OPTIONS= for the execution of the binary X to control the behavior of the Address Sanitizer while the binary X is run. X X If you like to disable the memory leak detection because your program X is a short running program that intentionally does not free() resources X before calling exit(), use: X X ASAN_OPTIONS=allow_user_segv_handler=true:detect_leaks=0 X X If you also like to get a core dump on error to debug, you may like X to use: X X ASAN_OPTIONS=allow_user_segv_handler=true:detect_leaks=0:abort_on_error=1 X X Note that the Address Sanitizer disables the creation of a core file X for 64 bit binaries as the tables used by the Address Sanitizer may X cause the core file to have a size of 16 TB. X X XCompiling with the "Americal fuzzy lop": X X Follow the instruction from above for the address sanitizer, but X use this command line to call the compiler: X X ASAN_OPTIONS=allow_user_segv_handler=true AFL_HARDEN=1 AFL_USE_ASAN=1 smake CC=afl-gcc CCOM=gcc32 X X XAuthor: X XJoerg Schilling XSeestr. 110 XD-13353 Berlin XGermany X XEmail: joerg.schilling@fokus.fraunhofer.de, joerg@schily.net X XPlease mail bugs and suggestions to me. END-of-star-1.6/INSTALL echo c - star-1.6/conf mkdir -p star-1.6/conf > /dev/null 2>&1 echo x - star-1.6/conf/Makefile sed 's/^X//' >star-1.6/conf/Makefile << 'END-of-star-1.6/conf/Makefile' X#ident @(#)Makefile 1.6 07/10/24 X########################################################################### X# Written 1998 by J. Schilling X########################################################################### X# Makefile for local dynamic configuration X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XCONFFILES= Inull rules.cnf xconfig.h X XPCONFFILES= $(CONFFILES:%=$(OINCSDIR)/%) X X_INSMODEI= $(_UNIQ)$(INSMODE) X__INSMODEI= $(_INSMODEI:$(_UNIQ)=$(INSMODEF)) XINSMODEI= $(__INSMODEI:$(_UNIQ)%=%) X XINSDIR= include/schily/$(OARCH) XTARGET= xconfig.h XPTARGET= ../incs/$(OARCH)/xconfig.h X Xall: config X Xclobber: X $(RM_F) $(PCONFFILES) X Xdistclean: X $(RM) $(RM_RF) $(PCONFFILES) \ X .vedtmp* *.bak OBJ/* \ X $(SRCROOT)/libs/* $(SRCROOT)/incs/* X XXMK_FILE= xconfig.mk X X########################################################################### X# Now done in rules.top X#include $(SRCROOT)/$(RULESDIR)/rules.cnf Xinclude $(SRCROOT)/$(RULESDIR)/rules.ins X########################################################################### X XOTHERTARGETS= clean ibins depend rmdep \ X TAGS tags rmtarget relink X X$(OTHERTARGETS): X @echo "$@: nothing to make" END-of-star-1.6/conf/Makefile echo x - star-1.6/conf/makeinc sed 's/^X//' >star-1.6/conf/makeinc << 'END-of-star-1.6/conf/makeinc' X#!/bin/sh X# X# @(#)makeinc 1.8 14/03/24 Copyright 1998-2014 J. Schilling X########################################################################### X# Copyright 1998-2014 by J. Schilling X########################################################################### X# X# Automake script for the Schily (SING) makefile system X# X########################################################################### X# X# Creates the following files: X# X# ./RULES/os-sunos.id included first after mk-$(XMAKEPROG).id X# ./RULES/os-sunos.def included next after RULES/os-sunos.id X# ./DEFAULTS/Defaults.sunos included after RULES/os-sunos.def X# Now incs/Dcc.$(PARCH)$(-O_ARCH) is X# included in parparation of the next X# file. This may call conf/cc-config.sh X# ./RULES/sun4c-sunos-gcc.rul included after DEFAULTS/Defaults.sunos X# X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XMAILADDR=joerg.schilling@fokus.fraunhofer.de X X########################################################################### X# Option processing X########################################################################### Xcase $1 in X X-r) X shift X SRCROOT=$1 X shift X ;; Xesac X Xif [ $# -lt 1 ]; then X echo 'Usage: makeinc [-r srcroot] filename' 1>&2 X exit 1 Xfi X X########################################################################### X# Find SRCROOT if not specified via option X########################################################################### Xif [ .$SRCROOT = . ]; then X SRCROOT=. X loop=1 X while [ $loop -lt 100 ]; do X if [ ! -d $SRCROOT ]; then X # Abort on ENAMETOOLONG X break X fi X if [ -r $SRCROOT/RULES/rules.top ]; then X break X fi X if [ "$SRCROOT" = . ]; then X SRCROOT=".." X else X SRCROOT="$SRCROOT/.." X fi X loop="`expr $loop + 1`" X done X if [ ! -r $SRCROOT/RULES/rules.top ]; then X echo "Cannot find SRCROOT directory" 1>&2 X exit 1 X fi Xfi X X########################################################################### X# Real start of automake script X########################################################################### Xecho 'NOTICE: Automake script called' Xif [ -r $1 ]; then X echo "WARNING: requested file '$1' already exists" X exit Xfi Xecho "IMPORTANT: Please report your architecture to $MAILADDR" Xecho Xecho "Trying to create missing rule file '$1'" Xsleep 1 Xecho X X# X# Compiler for platforms we do not yet know. X# $CC is only used with *Defaults.*) X# XCC=cc Xgcc -v 2> /dev/null && CC=gcc XARG_CC=$CC Xecho "CC: $CC" X X# X# Call $CC and try to find out whether it might be "gcc" or "clang". X# XCC_V=`eval "$CC -v > /dev/null" 2>&1` XGCC_V=`echo "$CC_V" | grep -i gcc-version ` XCLANG_V=`echo "$CC_V" | grep -i clang ` X Xif [ ".$GCC_V" != . ]; then X if eval "gcc -v 2> /dev/null" 2>/dev/null; then X CC="gcc" X fi Xelif [ ".$CLANG_V" != . ]; then X if eval "clang -v 2> /dev/null" 2>/dev/null; then X CC="clang" X fi Xfi X# X# Check whether "cc" or "gcc" are emulated by another compiler X# Xif [ "$CC" != "$ARG_CC" ]; then X echo "$ARG_CC is $CC" Xfi X XMANSTYLE=sysv Xif [ -r /usr/man/*man7*/man.* -o -r /usr/share/man/*man7*/man.* \ X -o -r /usr/man/*man7*/mandoc.* -o -r /usr/share/man/*man7*/mandoc.* \ X -o -r /usr/man/*man7*/ascii* -o -r /usr/share/man/*man7*/ascii* ]; then X MANSTYLE=bsd Xfi Xecho "MANSTYLE: $MANSTYLE" X X case $1 in X X *os-*.id) X echo $1 X OSNAME=`echo $1 | sed -e 's;\(.*\)os-\(.*\)\.id;\2;'` X echo '###########################################################################' > $1 X echo "# OS specific MACRO definitions for $OSNAME" >> $1 X echo "# This file is auto generated and may be wrong" >> $1 X echo '###########################################################################' >> $1 X echo "O_ARCH= $OSNAME" >> $1 X echo '-O_ARCH= -$(O_ARCH)' >> $1 X ;; X X *os-*.def) X echo $1 X OSNAME=`echo $1 | sed -e 's;\(.*\)os-\(.*\)\.def;\2;'` X echo '###########################################################################' > $1 X echo "# Global os definitions for $OSNAME" >> $1 X echo "# This file is auto generated and may be wrong" >> $1 X echo '###########################################################################' >> $1 X echo "MANSTYLE= $MANSTYLE" >> $1 X ;; X X *Defaults.*) X echo $1 X OSNAME=`echo $1 | sed -e 's;\(.*\)\.\(.*\);\2;'` X echo '###########################################################################' > $1 X echo "# global definitions for $OSNAME Systems" >> $1 X echo "# This file is auto generated and may be wrong" >> $1 X echo '###########################################################################' >> $1 X if [ "$CC" = clang ]; then X cat $SRCROOT/TEMPLATES/Defaults.clang >> $1 X elif [ "$CC" = gcc ]; then X cat $SRCROOT/TEMPLATES/Defaults.gcc >> $1 X else X cat $SRCROOT/TEMPLATES/Defaults.xcc >> $1 X fi X echo >> $1 X echo '###########################################################################' >> $1 X echo "# Do compilattion with minimal warnings" >> $1 X echo '###########################################################################' >> $1 X echo "CWARNOPTS=" >> $1 X ;; X X *-*-cc*.rul | \ X *-*-gcc*.rul | \ X *-*-clang*.rul) X ARCH=`echo $1 | sed -e 's;\(.*\)/\(.*\)-\(.*\)-\(.*\).rul;\2;'` X OSNAME=`echo $1 | sed -e 's;\(.*\)/\(.*\)-\(.*\)-\(.*\).rul;\3;'` X CCOM=`echo $1 | sed -e 's;\(.*\)/\(.*\)-\(.*\)-\(.*\).rul;\4;'` X DIR=`echo $1 | sed -e "s;\(.*\)/$ARCH-$OSNAME-$CCOM.rul;\1;"` X echo "ARCH: $ARCH" X echo "OSNAME: $OSNAME" X echo "CCOM: $CCOM" X echo "DIR: $DIR" X echo $1 X echo "Trying to find similar architecture for '$1'" X similar=`ls $DIR/*-$OSNAME-$CCOM.rul 2>/dev/null| head -1` X SARCH=`echo $similar | sed -e "s;\(.*\)/\(.*\)-$OSNAME-$CCOM.rul;\2;"` X X if [ .$similar != . ]; then X echo 'Found similar architecture ' "'$similar'" X echo 'creating symlink:' ln -s $SARCH-$OSNAME-$CCOM.rul $1 X echo "Please send a mail to $MAILADDR to report whether this works or not" X sleep 10 X ln -s $SARCH-$OSNAME-$CCOM.rul $1 || cp $SARCH-$OSNAME-$CCOM.rul $1 X exit X else X echo '###########################################################################' > $1 X echo "# global definitions for $OSNAME Systems" >> $1 X echo "# This file is auto generated and may be wrong" >> $1 X echo '###########################################################################' >> $1 X X if [ $CCOM = clang -o $CCOM = clang32 -o $CCOM = clang64 ]; then X echo 'Using generic CLANG machine configuration file' X cat $SRCROOT/TEMPLATES/temp-$CCOM.rul >> $1 X elif [ $CCOM = gcc -o $CCOM = gcc32 -o $CCOM = gcc64 ]; then X echo 'Using generic GCC machine configuration file' X cat $SRCROOT/TEMPLATES/temp-$CCOM.rul >> $1 X else X echo 'Using generic dumb cc machine configuration file' X cat $SRCROOT/TEMPLATES/temp-xcc.rul >> $1 X fi X fi X ;; X X ####################################################################### X # This entry is not really needed... X ####################################################################### X *TARGETS/Targetdirs*) X echo "Linking $1 to $SRCROOT/TARGETS/Targetdirs" X ln -s Targetdirs $1 X ;; X *) X echo "Unknown rule to build: '$1'." X exit 1 X ;; X X esac X Xecho "Please send a mail to $MAILADDR to report whether this works or not" Xsleep 10 END-of-star-1.6/conf/makeinc echo x - star-1.6/conf/install-sh sed 's/^X//' >star-1.6/conf/install-sh << 'END-of-star-1.6/conf/install-sh' X#! /bin/sh X# X# @(#)install-sh 1.11 09/01/29 1999-2009 J. Schilling X# X# install - install a program, script, or datafile X# This comes from X11R5 (mit/util/scripts/install.sh). X# Mods to make install-sh behave reasonable when called by X# non root user by J. Schilling X# X# Copyright 1991 by the Massachusetts Institute of Technology X# Copyright 1999-2009 by J. Schilling X# X# Permission to use, copy, modify, distribute, and sell this software and its X# documentation for any purpose is hereby granted without fee, provided that X# the above copyright notice appear in all copies and that both that X# copyright notice and this permission notice appear in supporting X# documentation, and that the name of M.I.T. not be used in advertising or X# publicity pertaining to distribution of the software without specific, X# written prior permission. M.I.T. makes no representations about the X# suitability of this software for any purpose. It is provided "as is" X# without express or implied warranty. X# X# Calling this script install-sh is preferred over install.sh, to prevent X# `make' implicit rules from creating a file called install from it X# when there is no Makefile. X# X# This script is compatible with the BSD install script, but was written X# from scratch. It can only install one file at a time, a restriction X# shared with many OS's install programs. X X# on BSDi chown is in /usr/sbin X XPATH="${PATH}:/usr/sbin" X X# set DOITPROG to echo to test this script X X# Don't use :- since 4.3BSD and earlier shells don't like it. Xdoit="${DOITPROG-}" X X X# put in absolute paths if you don't have them in your path; or use env. vars. X Xmvprog="${MVPROG-mv}" Xcpprog="${CPPROG-cp}" Xchmodprog="${CHMODPROG-chmod}" Xchownprog="${CHOWNPROG-chown}" Xchgrpprog="${CHGRPPROG-chgrp}" Xstripprog="${STRIPPROG-strip}" Xrmprog="${RMPROG-rm}" Xmkdirprog="${MKDIRPROG-mkdir}" X Xtransformbasename="" Xtransform_arg="" Xinstcmd="$mvprog" Xchmodcmd="$chmodprog 0755" Xchowncmd="" Xchgrpcmd="" Xstripcmd="" Xrmcmd="$rmprog -f" Xmvcmd="$mvprog" Xsrc="" Xdst="" Xdir_arg="" Xnoclobber="" X X# X# Check if we are 'root' to avoid chown as non root user X# Xrootflag=FALSE Xdstdir=/tmp/xd.$$ Xdsttmp=${dstdir}/xx.$$ Xtrap "rm -f ${dsttmp}; rm -rf ${dstdir}" 0 Xmkdir ${dstdir} X${chmodcmd} ${dstdir} Xecho > ${dsttmp} X${chownprog} root ${dsttmp} 2> /dev/null && ${chmodcmd} ${dsttmp} 2> /dev/null && rootflag=TRUE X# X# Win95 has no user 'root' and chown succeeds always. X# Unfortunately, there is also no user 'bin' and chown complains about X# user 'bin' being non-existant. X# Check if the file is now really owned by 'root' to avoid the Win95 probems X# Xif [ $rootflag = TRUE ]; then X ls -l ${dsttmp} 2> /dev/null | grep root > /dev/null || rootflag=FALSE Xfi Xrm -f ${dsttmp} Xrm -rf ${dstdir} X Xwhile [ x"$1" != x ]; do X case $1 in X -help) X echo "Usage: install-sh [options] srcfile dstfile" X echo " install-sh [options] srcfile dstdir" X echo " install-sh [options] -d dstdir" X echo "Options:" X echo " -c copy srcfile rather than renaming it" X echo " -d dir create dir" X echo " -noclobber do not replace existing files" X echo " -m mode install new files with 'mode'" X echo " -o owner install new files with 'owner'" X echo " -g group install new files with 'group'" X echo " -s strip file after installing" X echo " -t=sed-cmd sed command to transform the basename" X echo " -b=suff file name suffix for -t" X exit X continue;; X X -c) instcmd="$cpprog" X shift X continue;; X X -d) dir_arg=true X shift X continue;; X X -noclobber) noclobber=true X shift X continue;; X X -m) chmodcmd="$chmodprog $2" X Asuidflag=FALSE X Ssuidflag=FALSE X if [ $rootflag = FALSE ] ; then X echo "$2" | grep '[1-7][0-7][0-7][0-7]$' > /dev/null && Asuidflag=TRUE X echo "$2" | grep '[st]' > /dev/null && Ssuidflag=TRUE X fi X if [ $Asuidflag = TRUE ]; then X nmode=`echo "$2" | sed 's/\(.*\)\([0-7][0-7][0-7]\)/\2/'` X chmodcmd="$chmodprog $nmode" X echo "install: -m option with suid/sticky available only to root -- ignored" X fi X if [ $Ssuidflag = TRUE ]; then X nmode=`echo "$2" | sed 's/\(.*\)/\1,a-st/'` X chmodcmd="$chmodprog $nmode" X echo "install: -m option with suid/sticky available only to root -- ignored" X fi X shift X shift X continue;; X X -o) if [ $rootflag = TRUE ] X then X chowncmd="$chownprog $2" X else X echo "install: -o option available only to root -- ignored" X fi X shift X shift X continue;; X X -g) if [ $rootflag = TRUE ] X then X chgrpcmd="$chgrpprog $2" X else X echo "install: -g option available only to root -- ignored" X fi X shift X shift X continue;; X X -s) stripcmd="$stripprog" X shift X continue;; X X -t=*) transformarg=`echo $1 | sed 's/-t=//'` X shift X continue;; X X -b=*) transformbasename=`echo $1 | sed 's/-b=//'` X shift X continue;; X X *) if [ x"$src" = x ] X then X src=$1 X else X # this colon is to work around a 386BSD /bin/sh bug X : X dst=$1 X fi X shift X continue;; X esac Xdone X Xif [ x"$src" = x ] Xthen X echo "install: no input file specified" X exit 1 Xelse X true Xfi X Xif [ x"$dir_arg" != x ]; then X dst=$src X src="" X X if [ -d $dst ]; then X instcmd=: X else X instcmd=mkdir X fi Xelse X X# Waiting for this to be detected by the "$instcmd $src $dsttmp" command X# might cause directories to be created, which would be especially bad X# if $src (and thus $dsttmp) contains '*'. X X if [ -f $src -o -d $src ] X then X true X else X echo "install: $src does not exist" X exit 1 X fi X X if [ x"$dst" = x ] X then X echo "install: no destination specified" X exit 1 X else X true X fi X X# If destination is a directory, append the input filename; if your system X# does not like double slashes in filenames, you may need to add some logic X X if [ -d $dst ] X then X dst="$dst"/`basename $src` X else X true X fi Xfi X X## this sed command emulates the dirname command Xdstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` X X# Make sure that the destination directory exists. X# this part is taken from Noah Friedman's mkinstalldirs script X X# Skip lots of stat calls in the usual case. Xif [ ! -d "$dstdir" ]; then XdefaultIFS=' X' XIFS="${IFS-${defaultIFS}}" X XoIFS="${IFS}" X# Some sh's can't handle IFS=/ for some reason. XIFS='%' Xset - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` XIFS="${oIFS}" X Xpathcomp='' X Xwhile [ $# -ne 0 ] ; do X pathcomp="${pathcomp}${1}" X shift X X if [ ! -d "${pathcomp}" ] ; X then X $mkdirprog "${pathcomp}" X else X true X fi X X pathcomp="${pathcomp}/" Xdone Xfi X Xif [ x"$dir_arg" != x ] Xthen X $doit $instcmd $dst && X X if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && X if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && X if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && X if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi Xelse X X# If we're going to rename the final executable, determine the name now. X X if [ x"$transformarg" = x ] X then X dstfile=`basename $dst` X else X dstfile=`basename $dst $transformbasename | X sed $transformarg`$transformbasename X fi X X# don't allow the sed command to completely eliminate the filename X X if [ x"$dstfile" = x ] X then X dstfile=`basename $dst` X else X true X fi X X# Check whether we might clobber an existing file X X if [ "$noclobber" -a -r "$dstdir/$dstfile" ]; then X echo "File '$dstdir/$dstfile' exists" X echo "Will not overwrite '$dstdir/$dstfile'." X exit X fi X X# Make a temp file name in the proper directory. X X dsttmp=$dstdir/#inst.$$# X X# Move or copy the file name to the temp name X X $doit $instcmd $src $dsttmp && X X trap "rm -f ${dsttmp}" 0 && X X# and set any options; do chmod last to preserve setuid bits X X# If any of these fail, we abort the whole thing. If we want to X# ignore errors from any of these, just make sure not to ignore X# errors from the above "$doit $instcmd $src $dsttmp" command. X X if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && X if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && X if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && X if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && X X# Now rename the file to the real destination. X X $doit $rmcmd -f $dstdir/$dstfile && X $doit $mvcmd $dsttmp $dstdir/$dstfile X Xfi && X X Xexit 0 END-of-star-1.6/conf/install-sh echo x - star-1.6/conf/src-get sed 's/^X//' >star-1.6/conf/src-get << 'END-of-star-1.6/conf/src-get' X#!/bin/sh X# @(#)src-get 1.21 09/12/22 Copyright 2005-2009 J. Schilling X########################################################################### X# Written 2005-2009 by J. Schilling X########################################################################### X# A source package controlling system which should behave similar to X# the Debian apt-get command. X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X X# X# Set up server URL for package description files. X# Must have a slash at the end. X# Xserver_url=http://sps.berlios.de/pkg/testing/ X X# X# If you do not have write access to a server, you may set up a local copy X# X#server_url=file:///tmp/pkg/ X X# X# Set up default pager. X# XPAGER=${PAGER-more} X X# X# Set up default wget. X# XWGET=${WGET-sh_wget} X Xcase $PATH in X */usr/sfw/bin*) X ;; X *) X if [ -d /usr/sfw/bin ]; then X XPATH=/usr/sfw/bin:${XPATH-} X fi X ;; Xesac X XPATH=${XPATH-}${PATH} X Xusage() { X echo "Usage: src-get [cmd] [target]..." X echo "Possible commands are:" X echo " init initialize skeleton makefile system in empty directory" X echo " setup setup platform dependent build commands in bins//*" X echo " install install a source package" X echo " list list installable packages" X echo " shell start a SHELL with a clean environment" X echo " compile do a full compilation from SRCROOT with a clean environment" X echo " version print the 'srg-get' version" X} X Xif [ $# -lt 1 ]; then X usage X exit 1 Xfi Xcmd=$1 Xshift X Xcase "$cmd" in X *version*) X ;; X X *) X echo "cmd: $cmd" X echo "args: $@" X ;; Xesac X Xexcode=255 Xtrap 'rm -rf /tmp/.d.$$; if [ -f ./$do_wget_file ]; then rm -f ./$do_wget_file; fi; exit 1' 1 2 15 Xtrap 'rm -rf /tmp/.d.$$; exit $excode' 0 X XZIP_SUFFIX= XZIP=cat XUNZIP=cat X Xif bzip2 --help > /dev/null 2>&1; then X UNZIP="bzip2 -d" X ZIP=bzip2 X ZIP_SUFFIX=.bz2 Xelif gzip --help > /dev/null 2>&1; then X UNZIP="gzip -d" X ZIP=gzip X ZIP_SUFFIX=.gz Xfi X Xget_srcroot() { X SRCROOT=. X loop=1 X while [ $loop -lt 100 ]; do X if [ ! -d $SRCROOT ]; then X # Abort on ENAMETOOLONG X break X fi X if [ -r $SRCROOT/RULES/rules.top ]; then X break X fi X if [ "$SRCROOT" = . ]; then X SRCROOT=".." X else X SRCROOT="$SRCROOT/.." X fi X loop="`expr $loop + 1`" X done X if [ ! -r $SRCROOT/RULES/rules.top ]; then X echo "Cannot find SRCROOT directory" 1>&2 X return 1 X fi X return 0 X} X Xcd_srcroot() { X if [ ".$SRCROOT" = ".$NO_SRCROOT" ]; then X echo "SRCROOT not known." 1>&2 X exit 1 X fi X cd "$SRCROOT" || (echo "Cannot chdir to $SRCROOT" 1>&2; exit 1) X SRCROOT=. X} X Xset_binspath() { X PWD=`pwd` X if [ "$SRCROOT" = . ];then X PATH="${PWD}/${BINS}:${PWD}/conf:${PATH}" X else X PATH="${PWD}/${SRCROOT}/${BINS}:${PWD}/${SRCROOT}/conf:${PATH}" X fi X export PATH X unset PWD X} X Xget_bins() { X if [ ".$SRCROOT" = ".$NO_SRCROOT" ]; then X return 1 X fi X OARCH=`${SRCROOT}/conf/oarch.sh` X BINS=bins/"$OARCH" X} X Xneed_mfs() { X if [ ! -r ${SRCROOT}/RULES/rules.top ]; then X echo "A makefile system is not installed." 1>&2 X echo "Run 'src-get init' first." 1>&2 X exit 1 X fi X} X Xcheck_bins() { X if [ -r ${SRCROOT}/${BINS}/bzip2 -a \ X -r ${SRCROOT}/${BINS}/gzip -a \ X -r ${SRCROOT}/${BINS}/lndir -a \ X -r ${SRCROOT}/${BINS}/patch -a \ X -r ${SRCROOT}/${BINS}/smake -a \ X -r ${SRCROOT}/${BINS}/star -a \ X -r ${SRCROOT}/${BINS}/wget ]; then X if [ "$WGET" = sh_wget ]; then X WGET="wget --passive-ftp" X fi X return 0 X fi X return 1 X} X Xneed_bins() { X need_mfs X get_bins X if check_bins; then X return 0 X else X echo "Setup for $OARCH not yet done." 1>&2 X echo "Run 'src-get setup' first." 1>&2 X exit 1 X fi X} X X Xsh_wget() { X excode=255 X X if [ $# -lt 1 ]; then X echo "Usage: wget.sh URL" 1>&2 X echo "Only ftp:// type URLs are supported" 1>&2 X return 1 X fi X X wget_url="$1" X wget_rest=`echo "$wget_url" | sed -e 's,^ftp://,,'` X if [ "$wget_url" = "$wget_rest" ]; then X echo "Unsupported protocol in" "$wget_url" 1>&2 X return 1 X fi X wget_host=`echo "$wget_rest" | sed -e 's,/.*,,'` X wget_file=`echo "$wget_rest" | sed -e 's,^[^/]*/,,'` X wget_dname=`echo "$wget_file" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` X wget_fname=`echo "$wget_file" | sed -e 's,.*/,,'` X X mkdir /tmp/.d.$$ X cat <<- EOF > /tmp/.d.$$/.netrc X machine "$wget_host" login ftp password wget.sh@Makefiles.Schily.build X EOF X chmod 600 /tmp/.d.$$/.netrc X X HOME=/tmp/.d.$$ ftp "$wget_host" <<- EOF X bin X passive on X cd "$wget_dname" X dir "$wget_fname" X hash on X verbose on X get "$wget_fname" X bye X EOF X excode=$? X rm -fr /tmp/.d.$$ X return $excode X} X Xdo_wget() { X do_wget_url="$1" X case "$1" in X file:///*) X do_wget_rest=`echo "$do_wget_url" | sed -e 's,^file://,,'` X do_wget_file=`echo "$do_wget_url" | sed -e 's,.*/,,'` X rm -rf "$do_wget_file" X cp "$do_wget_rest" "$do_wget_file" X return $? X ;; X esac X loop=0 X wget_retries=10 X while [ $loop -lt $wget_retries ]; do X do_wget_file=`echo "$do_wget_url" | sed -e 's,.*/,,'` X rm -rf "$do_wget_file" X $WGET "$do_wget_url" X X if [ -f "$do_wget_file" ]; then X break X fi X echo X echo Retrying in 10 seconds X sleep 10 X loop="`expr $loop + 1`" X done X if [ $loop -ge $wget_retries ]; then X echo "Wget retry count exhausted - giving up." 1>&2 X exit 1 X fi X do_wget_file= X} X Xget_catalog() { X mkdir -p src-list X cd src-list X rm -f catalog X do_wget ${server_url}catalog X cd .. X} X Xdo_dep() { X deps="$@" X X if [ ."$@" = . ]; then X return X fi X echo "Fetching dependencies: $deps" X src-get install $deps X} X Xdo_patch() { X ( X cd $1 X if [ -r patches/patch.sh ]; then X patches/patch.sh X fi X ) X} X Xdo_install() { X target="$1" X echo "Searching for target:" $target X mkdir -p src-list X cd src-list X # target already installed? X #rm $target X TGT=`grep "$target" < ../src-list/catalog` X #echo TGT $TGT X nmatches=`echo "$TGT" | wc -w` X #echo MATCHES $nmatches X if [ $nmatches = 0 ]; then X echo "No matching source for" $target X exit X fi X if [ $nmatches -gt 1 ]; then X echo "Too many matching sources for" $target X echo "Select one from:" $TGT X exit X fi X echo "Matching target: " "$TGT" X # X # Retrieve Target desciption file that contains: X # X # PKG= The URL of the tar archive containing the wrappers X # DIR= The directory in local tree where to put the target dir X # URL= The URL where to fetch the source from upstream X # DEP= A list of package names the current target depends on X # X do_wget ${server_url}"$TGT" X PKG= X DIR= X URL= X DEP= X . ./$TGT X echo PKG "'$PKG'" X echo DIR "'$DIR'" X echo URL "'$URL'" X echo DEP "'$DEP'" X do_dep "$DEP" X X if [ ."$URL" = . ]; then X cd .. X return X fi X do_wget ${server_url}"$PKG" X cd .. X pkg_fname=`echo "$PKG" | sed -e 's,.*/,,'` X url_fname=`echo "$URL" | sed -e 's,.*/,,'` X conf/mkdir.sh -p -T "$DIR"/"$TGT" X star -x -C "$DIR" < src-list/"$pkg_fname" X (cd "$DIR"/"$TGT" && ( do_wget $URL; star -x < "$url_fname" ) ) X do_patch "$DIR"/"$TGT" X} X XNO_SRCROOT=no-SRCROOT-directory-found Xif get_srcroot; then X case "$cmd" in X X *version*) ;; X X *) echo SRCROOT: $SRCROOT;; X esac Xelse X SRCROOT="$NO_SRCROOT" Xfi X Xcase $cmd in X X init) X if [ -r RULES/rules.top ]; then X echo "A makefile system is already installed in the current directory." 1>&2 X exit 1 X fi X if [ ! -z "`ls`" ]; then X if [ "`ls`" != src-get ]; then X echo "Current directory not empty." 1>&2 X echo "Will not install makefile system." 1>&2 X exit 1 X fi X fi X do_wget ftp://ftp.berlios.de/pub/makefiles/testing/makefiles.tar${ZIP_SUFFIX} X ${UNZIP} < makefiles.tar${ZIP_SUFFIX} | tar xf - X # X # tar on HP-UX-10.x does not like tar xpf X # X if [ ! -r RULES/rules.top ]; then X echo "The installation of the makefile system did fail." 1>&2 X exit 1 X fi X echo X echo "*********" X echo "The installation of Makefiles was successful." X echo X echo "Do not forget to run 'src-get setup' for all platforms." X echo "*********" X echo X exit X ;; X X setup) X need_mfs X # $BINS not set up X # X if [ ! -r RULES/rules.top ]; then X echo "A makefile system is not installed in the current directory." 1>&2 X echo "Run 'src-get init' first" 1>&2 X exit 1 X fi X sh conf/setup.sh X ;; X X list) X need_bins X set_binspath X cd_srcroot X get_catalog X $PAGER src-list/catalog X ;; X X install) X need_bins X set_binspath X cd_srcroot X get_catalog X for i in "$@"; do X echo $i X do_install "$i" X done X ;; X X shell) X need_bins X unset LD_LIBRARY_PATH X unset LD_RUN_PATH X SHELL=${SHELL-/bin/sh} X set_binspath X echo "Note that 'smake' is the preferred make program." X echo "Starting ${SHELL}..." X exec ${SHELL} X echo "Cannot exec ${SHELL}" 1>&2 X exit 1 X ;; X X compile) X need_bins X unset LD_LIBRARY_PATH X unset LD_RUN_PATH X SHELL=${SHELL-/bin/sh} X set_binspath X cd_srcroot X echo "Starting compilation..." X exec smake "$@" X echo "Cannot exec smake $@" 1>&2 X exit 1 X ;; X X version|-version|--version) X echo "src-get 1.21 09/12/22 Copyright 2005-2009 J. Schilling" X exit 0 X ;; X X -help|*) echo "@(#)src-get 1.21 09/12/22 Copyright 2005-2009 J. Schilling" X usage X exit 0 X ;; X Xesac X END-of-star-1.6/conf/src-get echo x - star-1.6/conf/oarch.sh sed 's/^X//' >star-1.6/conf/oarch.sh << 'END-of-star-1.6/conf/oarch.sh' X#!/bin/sh X# @(#)oarch.sh 1.18 18/10/04 Copyright 2005-2018 J. Schilling X########################################################################### X# Written 2005 by J. Schilling X########################################################################### X# A simulation of $(OARCH) from the Schily Makefile system X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X# X# Processor P_ARCH MAKE_ARCH Instruction Set Architecture or Processor type X# Kernel K_ARCH MAKE_MACH Machine hardware class X# Machine M_ARCH MAKE_M_ARCH ISA or Processor type X# X# P mach == * uname -p (i386/mc68020/sparc/powerpc X# K arch -k == uname -m (i86pc/sun3x/sun4u/power-macintosh X# M arch == * uname -p + map sparc->sun4 (i86pc/sun3/sun4/ppc X# X# * Not available on vanilla SVr4 X# X# If P_ARCH or M_ARCH are not set, K_ARCH us used. X# X# P_ARCH -> OARCH (sparc-sunos5-cc) used as default OBJ arch subdir X# K_ARCH -> XARCH (sun4u-sunos5-cc) used as OBJ arch subdir for kernel modules X Xdbgflag=FALSE Xxflag=FALSE Xcflag=FALSE Xoflag=FALSE Xpflag=FALSE Xif [ .$1 = .-help ]; then X echo "Usage: oarch.sh [options]" X echo "Options:" X echo " -debug Print debugging information" X echo " -c Print C_ARCH instead of OARCH" X echo " -o Print O_ARCH instead of OARCH" X echo " -p Print PARCH instead of OARCH" X echo " -x Print XARCH instead of OARCH" X exit Xfi Xif [ .$1 = .-debug ]; then X dbgflag=TRUE Xfi Xif [ .$1 = .-x ]; then X xflag=TRUE Xfi Xif [ .$1 = .-c ]; then X cflag=TRUE Xfi Xif [ .$1 = .-o ]; then X oflag=TRUE Xfi Xif [ .$1 = .-p ]; then X pflag=TRUE Xfi X X# X# '((' does not work because of a parser bug in ksh on Interix. X# This is why we use '( (' here. X# XMACHCMD="( (mach || uname -p || true) 2> /dev/null)" XARCHCMD="( (arch || /usr/ucb/arch || true) 2> /dev/null)" X XXP_ARCH=`eval ${MACHCMD} | tr '[A-Z]' '[a-z]' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ, /\\()"' 'abcdefghijklmnopqrstuvwxyz,//////' | tr ',/' ',\-'` XXK_ARCH=`uname -m | tr '[A-Z]' '[a-z]' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ, /\\()"' 'abcdefghijklmnopqrstuvwxyz,//////' | tr ',/' ',\-'` XXM_ARCH=`eval ${ARCHCMD} | tr '[A-Z]' '[a-z]' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ, /\\()"' 'abcdefghijklmnopqrstuvwxyz,//////' | tr ',/' ',\-'` X X#echo XP_ARCH $XP_ARCH X#echo XK_ARCH $XK_ARCH X#echo XM_ARCH $XM_ARCH X XP_ARCH="${XP_ARCH}" XK_ARCH="${XK_ARCH}" XM_ARCH="${XM_ARCH}" X Xif [ ."$XP_ARCH" = .unknown ]; then X P_ARCH="${K_ARCH}" Xfi Xif [ ."$XP_ARCH" = . ]; then X P_ARCH="${K_ARCH}" Xfi X Xif [ ."${XM_ARCH}" = . ]; then X M_ARCH="${K_ARCH}" Xfi X XOSNAME=`uname -s | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ, /\\()"' 'abcdefghijklmnopqrstuvwxyz,//////' | tr ',/' ',\-'` XOSHOST=`uname -n | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ, /\\()"' 'abcdefghijklmnopqrstuvwxyz,//////' | tr ',/' ',\-'` XOSREL=`uname -r | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ, /\\()"' 'abcdefghijklmnopqrstuvwxyz,//////' | tr ',/' ',\-'` XOSVERS=`uname -v | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ, /\\()"' 'abcdefghijklmnopqrstuvwxyz,//////' | tr ',/' ',\-'` X XO_ARCH="$OSNAME" X Xcase "$OSNAME" in X cygwin*) O_ARCH=cygwin32_nt;; Xesac X Xif [ ."$OSNAME" = .aix ]; then X P_ARCH=rs6000 Xfi Xif [ ."$OSNAME" = .os400 ]; then X P_ARCH=powerpc Xfi Xif [ ."$OSNAME" = .bsd-os ]; then X case "$OSREL" in X 3.*) O_ARCH=bsd-os3;; X 4.*) O_ARCH=bsd-os;; X esac Xfi Xif [ ."$OSNAME" = .bsd-os ]; then X case "$OSREL" in X 3.*) O_ARCH=bsd-os3;; X 4.*) O_ARCH=bsd-os;; X esac Xfi Xif [ ."$OSNAME" = .dgux ]; then X case "$OSREL" in X r4.*) O_ARCH=dgux4;; X 5.4r3*) O_ARCH=dgux3;; X esac Xfi Xif [ ."$OSNAME" = .irix64 ]; then X O_ARCH=irix Xfi Xif [ ."$OSNAME" = .mac-os ]; then X case "$OSREL" in X 9.*) O_ARCH=mac-os9;; X 10.*) O_ARCH=mac-os10;; X esac Xfi Xcase "$OSREL" in X mingw*) O_ARCH= mingw32_nt;; Xesac Xif [ ."$OSNAME" = .newsos ]; then X case "$OSREL" in X 5.*) O_ARCH=newsos5;; X 6.*) O_ARCH=newsos6;; X esac Xfi Xif [ ."$OSNAME" = .openunix ]; then X O_ARCH=unixware Xfi Xif [ ."$OSNAME" = .os-2 ]; then X O_ARCH=os2 Xfi Xif [ ."$OSNAME" = .sco_sv ]; then X O_ARCH=openserver Xfi Xif [ ."$OSNAME" = .sunos ]; then X case "$OSREL" in X 4.*) O_ARCH=sunos4;; X 5.*) O_ARCH=sunos5;; X esac Xfi Xif [ ."$OSNAME" = .unix_sv ]; then X O_ARCH=unixware Xfi X X########################################################################### X# X# Interix: Avoid to have something like "Intel_x86_Family15_Model4_Stepping1" X# in $(OARCH), we rather use $(K_ARCH) which is e.g. "x86". X# XXX If this is changed, both files in DEFAULTS/ and DEFAULTS_ENG as X# XXX well as the file conf/oarch.sh need to be changed. X# X########################################################################### Xif [ ."$OSNAME" = .interix ]; then X P_ARCH=${K_ARCH} Xfi X XMARCH="$M_ARCH" Xif [ ."$ARCH" != . ]; then X MARCH="$ARCH" Xfi X XPARCH="$P_ARCH" Xif [ ."$ARCH" != . ]; then X PARCH="$ARCH" Xfi X XKARCH="$K_ARCH" Xif [ ."$ARCH" != . ]; then X KARCH="$ARCH" Xfi X Xconfdir= Xif [ -z "$confdir" ]; then X # X # Try the directory containing this script. X # X prog=$0 X confdir=`echo $prog|sed 's,/[^/][^/]*$,,'` X test ".$confdir" = ".$prog" && confdir=. X confdir=$confdir Xfi X XCC="`grep '^DEFCCOM' $confdir/../incs/Dcc.${PARCH}-${O_ARCH} 2>/dev/null | sed -e 's,^DEFCCOM=[ ]*,,'`" Xif [ ".$CC" = . ]; then X CC="`grep '^DEFCCOM' $confdir/../DEFAULTS/Defaults.${O_ARCH} 2>/dev/null | sed -e 's,^DEFCCOM=[ ]*,,'`" Xfi Xif [ ".$CC" = . ]; then X CC=cc Xfi X XC_ARCH="`sh $confdir/../conf/cc-config.sh -echo $CC $CC ${O_ARCH}`" X XOARCH="${PARCH}-${O_ARCH}-${C_ARCH}" XXARCH="${KARCH}-${O_ARCH}-${C_ARCH}" X Xif [ $dbgflag = TRUE ]; then X#echo xx"$P_ARCH" X echo C_ARCH " $C_ARCH" X echo P_ARCH " $P_ARCH" X echo K_ARCH " $K_ARCH" X echo M_ARCH " $M_ARCH" X echo OSNAME " $OSNAME" X echo OSHOST " $OSHOST" X echo OSREL " $OSREL" X echo OSVERS " $OSVERS" X echo OARCH " $OARCH" X echo XARCH " $XARCH" X exit Xfi Xif [ $cflag = TRUE ]; then X echo "${C_ARCH}" X exit Xfi Xif [ $oflag = TRUE ]; then X echo "${O_ARCH}" X exit Xfi Xif [ $pflag = TRUE ]; then X echo "${PARCH}" X exit Xfi Xif [ $xflag = TRUE ]; then X echo "${XARCH}" X exit Xfi Xecho "$OARCH" END-of-star-1.6/conf/oarch.sh echo x - star-1.6/conf/mkdir-sh sed 's/^X//' >star-1.6/conf/mkdir-sh << 'END-of-star-1.6/conf/mkdir-sh' X#!/bin/sh X# X# Replacement for mkdir -p ... functionality. X# X# BSD-4.3, NeXT Step <= 3.x and similar don't accept the -p flag X# X# @(#)mkdir-sh 1.2 98/12/14 Copyright 1998 J. Schilling X# X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only. X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X Xif [ $# -lt 1 ]; then X echo "Usage: mkdir-sh [-p] dir ...." X exit 1 Xfi X Xdop=false Xcase $1 in X-p) X dop=true X shift X ;; Xesac X Xif [ $dop = false ]; then X for i in "$@"; do X mkdir "$i" X done Xelse X for i in "$@"; do X if [ -d "$i" ]; then X continue X fi X # Don't use ${i:-.}, BSD4.3 doen't like it X # X fullname="$i" X if [ ."$i" = . ]; then X fullname=. X fi X dirname=`expr \ X "$fullname/" : '\(/\)/*[^/]*//*$' \| \ X "$fullname/" : '\(.*[^/]\)//*[^/][^/]*//*$' \| \ X .` X sh $0 -p "$dirname" X mkdir "$i" X done Xfi END-of-star-1.6/conf/mkdir-sh echo x - star-1.6/conf/cc-config.sh sed 's/^X//' >star-1.6/conf/cc-config.sh << 'END-of-star-1.6/conf/cc-config.sh' X#!/bin/sh X# @(#)cc-config.sh 1.14 18/04/04 Copyright 2002-2018 J. Schilling X########################################################################### X# Written 2002-2018 by J. Schilling X########################################################################### X# Configuration script called to verify system default C-compiler. X# It tries to fall back to GCC if the system default could not be found. X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X X# X# Usage: X# sh ./conf/cc-config.sh cc default-cc incs/Dcc. X# Xif [ "$#" -lt 3 ]; then X echo 'Usage: sh ./conf/cc-config.sh [-echo] incs/Dcc.' X echo 'Options:' X echo ' -echo Do not write into incs/Dcc. but echo to stdout' X echo X echo 'The "cc" parameter is the name of the preferred C-compiler' X echo 'The "default-cc" parameter is the name of the default C-compiler' X exit 1 Xfi X Xecho=echo Xif [ ".$1" = .-echo ]; then X echo=: X shift Xfi X X# X# Try to make sure all error messages are in english. X# XLC_ALL=C XLANG=C X XCC=$1 # Working copy of discovered C-compiler XCCOM=$1 # Remembered value of $CC XARG_CC=$1 # Name of preferred C-compiler XDEF_CC=$2 # Name of default C-compiler XPLATFORM_FILE=$3 # Where to write the output to XCC_FOUND=FALSE X X# X# Check whether we are using something like cc32, cc64, ... X# Xif echo "$CC" | egrep '32|64' > /dev/null 2> /dev/null; then X # X # Use the basic command name for our tests X # X CC=`echo "$CC" | sed -e 's/32//' -e 's/64//'` Xfi X X${echo} "Trying to find $CC" X X# X# Check if we are on SunOS-5.x and /usr/ucb is in PATH before /opt/SUNWspro/bin X# /usr/ucb/cc will not work correctly to compile things on Solaris. X# X# This check will also catch the case where no Sun C-compiler is installed and X# calling cc results in the message: X# /usr/ucb/cc: language optional software package not installed X# Xxos=`echo "$PLATFORM_FILE" | grep sunos5 ` Xif [ -n "$xos" ]; then X # X # On Solaris, the type builtin is working. X # X xcc=`type "$CC" | grep '/usr/ucb/*cc' ` X if [ -n "$xcc" ]; then X # X # We did find /usr/ucb/cc X # X echo 1>&2 X echo 'Warning:' "$xcc" 1>&2 X echo ' You should not have "/usr/ucb" in your PATH if you like to compile.' 1>&2 X echo ' "/usr/ucb/cc" is not working correclty on Solaris.' 1>&2 X echo ' If you did install a C-compiler in /opt/SUNWspro/bin, abort' 1>&2 X echo ' fix your PATH and start again.' 1>&2 X echo ' Otherwise GCC will be used.' 1>&2 X echo 1>&2 X sleep 60 X CC=do-no-use-ucb-cc X fi Xfi X X# X# There are old shells that don't support the 'type' builtin. X# For this reason it is not a simple task to find out whether X# this compiler exists and works. X# X# First try to run the default C-compiler without args X# Xeval "$CC > /dev/null 2>&1" 2> /dev/null Xif [ "$?" = 0 ]; then X CC_FOUND=TRUE Xelse X # X # Now try to run the default C-compiler and check whether it creates X # any output (usually an error message). X # X # This test will fail if the shell does redirect the error message X # "cc: not found". All shells I tested (except ksh) send this message to X # the stderr stream the shell itself is attached to and only redirects X # the output from the command. As there may no output if there is no X # binary, this proves the existence of the default compiler. X # X ccout=`eval "$CC 2>&1" 2>/dev/null` X ret=$? X X nf=`echo "$ccout" | grep 'not found' ` X if [ "$ret" = 127 -a -n "$nf" ]; then X # X # ksh redirects even the error message from the shell, but we X # see that there is no executable because the exit code is 127 X # we detect "command not found" if exit code is 127 and X # the message contains 'not found' X # X ccout="" X fi X X if [ -n "$ccout" ]; then X CC_FOUND=TRUE X fi Xfi X X Xif [ "$CC_FOUND" = TRUE ]; then X ${echo} "Found $CC" X X # X # Call $CC and try to find out whether it might be "gcc" or "clang". X # X CC_V=`eval "$CC -v > /dev/null" 2>&1` X GCC_V=`echo "$CC_V" | grep -i 'gcc.*version' ` X CLANG_V=`echo "$CC_V" | grep -i clang ` X X if [ ".$GCC_V" != . ]; then X if eval "gcc -v 2> /dev/null" 2>/dev/null; then X CC="gcc" X fi X elif [ ".$CLANG_V" != . ]; then X if eval "clang -v 2> /dev/null" 2>/dev/null; then X CC="clang" X fi X fi X # X # Check whether "cc" or "gcc" are emulated by another compiler X # X if [ ".$ARG_CC" = .cc -o ".$ARG_CC" = .gcc ]; then X if [ "$CC" != "$ARG_CC" ]; then X ${echo} "$ARG_CC is $CC" X fi X fi X X if [ ".$CC" = ".$DEF_CC" ]; then X ${echo} "Creating empty '$PLATFORM_FILE', using $DEF_CC as default compiler" X if [ "${echo}" = echo ]; then X :> $PLATFORM_FILE X else X echo "$DEF_CC" X fi X else X ${echo} "Making $CC the default compiler in '$PLATFORM_FILE'" X if [ "${echo}" = echo ]; then X :> $PLATFORM_FILE X echo DEFCCOM=$CC > $PLATFORM_FILE X else X echo "$CCOM" X fi X fi X exit Xfi X X# X# If the current default is gcc or anything != cc, try cc. X# Last resort: try gcc. X# XXCC=cc Xif [ ".$CC" = ".gcc" -o ".$CC" != ".cc" ]; then X ${echo} "Trying to find $XCC" X ccout=`eval "$XCC -c tt.$$.c 2>&1" 2> /dev/null` X ret=$? X nf=`echo "$ccout" | grep 'not found' ` X if [ "$ret" = 127 -a -n "$nf" ]; then X # X # ksh redirects even the error message from the shell, but we X # see that there is no executable because the exit code is 127 X # we detect "command not found" if exit code is 127 and X # the message contains 'not found' X # X ccout="" X fi X xos=`echo "$PLATFORM_FILE" | grep sunos5 ` X if [ -n "$xos" ]; then X # X # Our target is "sunos5" X # X xcc=`type "$XCC" | grep '/usr/ucb/*cc' ` X # X # If "$ccout" is non-null, then the compiler printed it X # X if [ -n "$xcc" -a -n "$ccout" ]; then X echo "Cannot use $XCC because $XCC is /usr/ucb/cc" X fi X if [ -z "$xcc" -a -n "$ccout" ]; then X # X # cc found on Solaris, use it. X # X CC="$XCC" X CC_FOUND=TRUE X fi X else X # X # cc found on other OS, use it. X # X CC="$XCC" X CC_FOUND=TRUE X fi Xfi Xif [ "$CC_FOUND" = FALSE -a ".$CC" = ".$ARG_CC" ]; then X # X # No CC found yet, try gcc X # X XCC=gcc X ${echo} 'Trying to find $XCC' X eval "gcc -v" 2> /dev/null && CC=gcc CC_FOUND=TRUE Xfi X X# X# Call $CC and try to find out whether it might be "gcc" or "clang". X# XCC_V=`eval "$CC -v > /dev/null" 2>&1` XGCC_V=`echo "$CC_V" | grep -i gcc-version ` XCLANG_V=`echo "$CC_V" | grep -i clang ` X Xif [ ".$GCC_V" != . ]; then X if eval "gcc -v 2> /dev/null" 2>/dev/null; then X CC="gcc" X CC_FOUND=TRUE X fi Xelif [ ".$CLANG_V" != . ]; then X if eval "clang -v 2> /dev/null" 2>/dev/null; then X CC="clang" X CC_FOUND=TRUE X fi Xfi X# X# Check whether "cc" or "gcc" are emulated by another compiler X# Xif [ ".$ARG_CC" = .cc -o ".$ARG_CC" = .gcc ]; then X if [ "$CC" != "$ARG_CC" ]; then X ${echo} "$ARG_CC is $CC" X fi Xfi X Xif [ ".$CC" = ".$DEF_CC" ]; then X if [ "$CC_FOUND" = TRUE ]; then X ${echo} "$XCC found, keeping current global default" X else X ${echo} "$XCC not found, keeping current global default" X fi X ${echo} "Creating empty '$PLATFORM_FILE', using $DEF_CC as default compiler" X if [ "${echo}" = echo ]; then X :> $PLATFORM_FILE X else X echo "$DEF_CC" X fi Xelse X ${echo} "Found $CC" X ${echo} "Making $CC the default compiler in '$PLATFORM_FILE'" X if [ "${echo}" = echo ]; then X echo DEFCCOM=$CC > $PLATFORM_FILE X else X echo "$CC" X fi Xfi END-of-star-1.6/conf/cc-config.sh echo x - star-1.6/conf/mkdep-hpux.sh sed 's/^X//' >star-1.6/conf/mkdep-hpux.sh << 'END-of-star-1.6/conf/mkdep-hpux.sh' X#!/bin/sh X#ident "@(#)mkdep-hpux.sh 1.2 11/11/12 " X########################################################################### X# Copyright 2002 by J. Schilling X########################################################################### X# X# Create dependency list with the HP-UX bundled cc X# X########################################################################### X# X# This script will probably not work correctly with a list of C-files X# but as we don't need it with 'smake' or 'gmake' it seems to be sufficient. X# X# Due to a design bug in the compiler interface we cannot tell the compiler X# to output the list on stdout, -Wp,-M- does not work. As the default X# output is on stderr and the output is even completely confused with X# error messages and warnings, we cannot just grep away the warnings X# like we do on SCO unix. X# X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X Xtrap 'rm -fr /tmp/cpp-m.$$ ; exit 1' 1 2 15 X Xcc -Wp,-M/tmp/cpp-m.$$ -E > /dev/null "$@" X X# X# The HP compiler creates xxx/file.o: xxx/file.c in case that X# file.c is in a sub.directory. This is wrong. The following sed X# command removes "^xxx/" from the output X# Xsed -e 's;^[^/ ]*/\(.*\)\.o;\1.o;' < /tmp/cpp-m.$$ X Xrm -f /tmp/cpp-m.$$ END-of-star-1.6/conf/mkdep-hpux.sh echo x - star-1.6/conf/mkdep-sco.sh sed 's/^X//' >star-1.6/conf/mkdep-sco.sh << 'END-of-star-1.6/conf/mkdep-sco.sh' X#!/bin/sh X#ident "@(#)mkdep-sco.sh 1.5 03/03/05 " X########################################################################### X# Copyright 1999 by J. Schilling X########################################################################### X# X# Create dependency list with SCO's cc X# X########################################################################### X# X# This script will probably not work correctly with a list of C-files X# but as we don't need it with 'smake' or 'gmake' it seems to be sufficient. X# X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XFILES= X Xfor i in "$@"; do X X case "$i" in X X -*) # ignore options X ;; X *.c) if [ ! -z "$FILES" ]; then X FILES="$FILES " X fi X # base name from $i X base=`echo $i | sed -e 's;[^/]*/;;'` X FILES="$FILES$base" X ;; X esac Xdone X XOFILES=`echo "$FILES" | sed -e 's;\([^.]*\)\.c;\1.o;g'` X Xcc -H -E 2>&1 > /dev/null "$@" | grep -hv '^"' | grep -hv '^UX:' | sed -e "s;^;$OFILES: ;" END-of-star-1.6/conf/mkdep-sco.sh echo x - star-1.6/conf/mkdep-aix.sh sed 's/^X//' >star-1.6/conf/mkdep-aix.sh << 'END-of-star-1.6/conf/mkdep-aix.sh' X#!/bin/sh X#ident "@(#)mkdep-aix.sh 1.2 09/12/31 " X########################################################################### X# Copyright 2002 by J. Schilling X########################################################################### X# X# Create dependency list with AIX cc X# X########################################################################### X# X# This script will probably not work correctly with a list of C-files X# but as we don't need it with 'smake' or 'gmake' it seems to be sufficient. X# X# Note that AIX cc will create a file foo.u for every foo.c file. The file X# foo.u is located in the directory where cc is run. X# For this reason, there may be problems of other software likes to create X# foo.u during compilation. Please report problems. X# X# In former times, we used -E but this calls the C-preprocessor that complains X# about #pragma weak a = b entries. We thus now use -qsyntaxonly in hope X# that all IBM compiler versions support it. X# X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XFILES= XUFILES= Xtrap 'rm -f $UFILES ; exit 1' 1 2 15 X Xfor i in "$@"; do X X case "$i" in X X -*) # ignore options X ;; X *.c) if [ ! -z "$FILES" ]; then X FILES="$FILES " X fi X b=`basename $i ''` X FILES="$FILES$b" X ;; X esac Xdone X XUFILES=`echo "$FILES" | sed -e 's;\([^.]*\)\.c;\1.u;g'` X Xrm -f $UFILES X#cc -M -E > /dev/null "$@" Xcc -M -qsyntaxonly > /dev/null "$@" Xcat $UFILES Xrm -f $UFILES END-of-star-1.6/conf/mkdep-aix.sh echo x - star-1.6/conf/wget.sh sed 's/^X//' >star-1.6/conf/wget.sh << 'END-of-star-1.6/conf/wget.sh' X#!/bin/sh X# @(#)wget.sh 1.3 05/05/30 Copyright 2005 J. Schilling X########################################################################### X# Written 2005 by J. Schilling X########################################################################### X# A simulation of wget using ftp X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X Xexcod=255 X Xtrap 'rm -fr /tmp/.d.$$ ; exit 1' 1 2 15 Xtrap 'rm -fr /tmp/.d.$$ ; exit $excode' 0 X Xif [ $# -lt 1 ]; then X echo "Usage: wget.sh [-d] URL" X echo "Options:" X echo " -d Print a listing of the dir part and exit" X echo X echo "Only ftp:// type URLs are supported" X exit 1 Xfi X Xdodir=FALSE Xif [ ."$1" = .-d ]; then X dodir=TRUE X shift Xfi XURL="$1" Xrest=`echo "$URL" | sed -e 's,^ftp://,,'` Xif [ "$URL" = "$rest" ]; then X echo "Unsupported protocol in" "$URL" X exit 1 Xfi X XHOST=`echo "$rest" | sed -e 's,/.*,,'` XFILE=`echo "$rest" | sed -e 's,^[^/]*/,,'` X#echo HOST "$HOST" X#echo FILE "$FILE" X XDNAME=`echo "$FILE" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` XFNAME=`echo "$FILE" | sed -e 's,.*/,,'` X#echo DNAME "$DNAME" X#echo FNAME "$FNAME" X Xmkdir /tmp/.d.$$ Xcat < /tmp/.d.$$/.netrc Xmachine "$HOST" login ftp password wget.sh@Makefiles.Schily.build XEOF Xchmod 600 /tmp/.d.$$/.netrc X Xif [ $dodir = TRUE ]; then X HOME=/tmp/.d.$$ ftp "$HOST" <star-1.6/conf/srcroot.sh << 'END-of-star-1.6/conf/srcroot.sh' X#!/bin/sh X# @(#)srcroot.sh 1.3 05/05/01 Copyright 2005 J. Schilling X########################################################################### X# Written 2005 by J. Schilling X########################################################################### X# Find and print SRCROOT X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X XSRCROOT=. Xloop=1 Xwhile [ $loop -lt 100 ]; do X #echo "$SRCROOT" X if [ ! -d $SRCROOT ]; then X # Abort on ENAMETOOLONG X break X fi X if [ -r $SRCROOT/RULES/rules.top ]; then X break X fi X if [ "$SRCROOT" = . ]; then X SRCROOT=".." X else X SRCROOT="$SRCROOT/.." X fi X loop="`expr $loop + 1`" Xdone Xif [ ! -r $SRCROOT/RULES/rules.top ]; then X echo "Cannot find SRCROOT" 1>&2 X exit 1 Xfi Xecho "$SRCROOT" END-of-star-1.6/conf/srcroot.sh echo x - star-1.6/conf/setup.sh sed 's/^X//' >star-1.6/conf/setup.sh << 'END-of-star-1.6/conf/setup.sh' X#!/bin/sh X# @(#)setup.sh 1.20 18/03/14 Copyright 2005-2018 J. Schilling X########################################################################### X# Written 2005-2018 by J. Schilling X########################################################################### X# Set up bins//{bzip2}!{gzip}!{patch}!{smake}!{star}!{wget} X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X X# Benoetigte Kommandos: X# X# makefiles http://sourceforge.net/projects/schilytools/files/makefiles/ X# makefiles http://sourceforge.net/projects/schilytools/files/makefiles/testing/makefiles.tar X# smake http://sourceforge.net/projects/s-make/files/alpha/ X# star http://sourceforge.net/projects/s-tar/files/alpha/ X# gzip ftp://wuarchive.wustl.edu/mirrors/gnu/gzip/gzip-1.2.4.tar X# wget ftp://ftp.gnu.org/gnu/wget/wget-1.9.1.tar.gz X# wget http://sourceforge.net/projects/schilytools/files/makefiles/testing/wget-1.9.1-2.tar X# gzip http://www.gzip.org/gzip-1.3.3.tar.gz X# gzip http://sourceforge.net/projects/schilytools/files/makefiles/testing/gzip-1.3.3.tar.gz X# bzip2 ftp://sources.redhat.com/pub/bzip2/v102/bzip2-1.0.2.tar.gz X# bzip2 http://www.bzip.org/1.0.3/bzip2-1.0.3.tar.gz X# bzip2 http://sourceforge.net/projects/schilytools/files/makefiles/testing/bzip2-1.0.3.tar.gz X# patch ftp://ftp.gnu.org/pub/gnu/patch/patch-2.5.4.tar.gz X# patch http://sourceforge.net/projects/schilytools/files/makefiles/testing/patch-2.5.4-1.tar.bz2 X Xtrap 'if [ -f ./$xfile ]; then rm -f ./$xfile; fi; rm -rf /tmp/i.$$/; exit 1' 1 2 15 X XSRCROOT=. Xloop=1 Xwhile [ $loop -lt 100 ]; do X #echo "$SRCROOT" X if [ ! -d $SRCROOT ]; then X # Abort on ENAMETOOLONG X break X fi X if [ -r $SRCROOT/RULES/rules.top ]; then X break X fi X if [ "$SRCROOT" = . ]; then X SRCROOT=".." X else X SRCROOT="$SRCROOT/.." X fi X loop="`expr $loop + 1`" Xdone Xif [ ! -r $SRCROOT/RULES/rules.top ]; then X echo "Cannot find SRCROOT" 1>&2 X exit 1 Xfi X Xcd "$SRCROOT" X Xif [ ! -r RULES/rules.top ]; then X echo "Cannot chdir to SRCROOT" 1>&2 X exit 1 Xfi X XOARCH=`conf/oarch.sh` XBINS=bins/"$OARCH" XPWD=`pwd` Xmkdir -p "$BINS" XPATH="${PWD}/${BINS}:${PATH}" Xexport PATH XMAKE="make" X Xif [ -r ${BINS}/bzip2 -a \ X -r ${BINS}/gzip -a \ X -r ${BINS}/lndir -a \ X -r ${BINS}/patch -a \ X -r ${BINS}/smake -a \ X -r ${BINS}/star -a \ X -r ${BINS}/wget ]; then X echo "Setup for $OARCH already done." 1>&2 X exit Xfi X XCC="${CC-`conf/oarch.sh -c`}" X XZIP_SUFFIX= XZIP=cat XUNZIP=cat X Xif bzip2 --help > /dev/null 2>&1; then X UNZIP="bzip2 -d" X ZIP=bzip2 X ZIP_SUFFIX=.bz2 Xelif gzip --help > /dev/null 2>&1; then X UNZIP="gzip -d" X ZIP=gzip X ZIP_SUFFIX=.gz Xfi X XWGET="${WGET-sh conf/wget.sh}" X Xdo_wget() { X URL="$1" X while true; do X xfile=`echo "$URL" | sed -e 's,.*/,,'` X $WGET "$URL" X X if [ -f "$xfile" ]; then X break X fi X echo X echo Retrying in 10 seconds X sleep 10 X done X xfile= X} X Xdo_wget ftp://ftp.berlios.de/pub/smake/testing/smake.tar${ZIP_SUFFIX} X${UNZIP} < smake.tar${ZIP_SUFFIX} | tar xf - X# X# tar on HP-UX-10.x does not like tar xpf X# Xcd smake-*/psmake/. Xsh ./MAKE-all Xcd .. Xpsmake/smake -r DESTDIR=/tmp/i.$$/ COPTX=-DDEFAULTS_PATH_SEARCH_FIRST install Xcd .. Xecho "Configuring Makefile system" Xcd conf X/tmp/i.$$/opt/schily/bin/smake -r Xcd .. Xcd inc X/tmp/i.$$/opt/schily/bin/smake -r Xcd .. Xstrip /tmp/i.$$/opt/schily/bin/smake Xrm -f "$BINS"/smake Xcp -p /tmp/i.$$/opt/schily/bin/smake "$BINS" Xmkdir -p "$BINS"/share/lib/smake Xrm -f "$BINS"/share/lib/smake/defaults.smk Xcp -p /tmp/i.$$/opt/schily/share/lib/smake/defaults.smk "$BINS"/share/lib/smake Xrm -rf smake-* smake.tar* XMAKE="${PWD}/${BINS}/smake" X Xif [ $ZIP = cat ]; then X #do_wget ftp://wuarchive.wustl.edu/mirrors/gnu/gzip/gzip-1.2.4.tar X do_wget ftp://ftp.berlios.de/pub/makefiles/testing/gzip-1.2.4.tar X tar xf gzip-1.2.4.tar X # X # tar on HP-UX-10.x does not like tar xpf X # X cd gzip-1.2.4 X CC="$CC" MAKE="$MAKE" CFLAGS=-O ./configure X smake X cd .. X strip gzip-1.2.4/gzip X rm -f "${BINS}"/gzip X cp -p gzip-1.2.4/gzip "${BINS}" X rm -rf gzip-1.2.4* X UNZIP="gzip -d" X ZIP=gzip X ZIP_SUFFIX=.gz Xfi X Xdo_wget ftp://ftp.berlios.de/pub/star/testing/star.tar${ZIP_SUFFIX} X${UNZIP} < star.tar${ZIP_SUFFIX} | tar xf - X# X# tar on HP-UX-10.x does not like tar xpf X# Xcd star-*/. Xsmake DESTDIR=/tmp/i.$$/ install Xcd .. Xstrip /tmp/i.$$/opt/schily/bin/star Xrm -f "${BINS}"/star Xcp -p /tmp/i.$$/opt/schily/bin/star "$BINS" Xrm -rf star-* star.tar* X Xdo_compile() { X url="$1" X dir="$2" X binpath="$3" X fname=`echo "$url" | sed -e 's,.*/,,'` X do_wget "$url" X star xpf "$fname" X cd "$dir" X if [ -r ./configure ]; then X CC="$CC" MAKE="$MAKE" CFLAGS=-O ./configure X elif [ -r ./Configure ]; then X CC="$CC" MAKE="$MAKE" CFLAGS=-O ./Configure X fi X smake CC="$CC" CFLAGS=-O X cd .. X if [ ! -r "$binpath" ]; then X echo "Cound not make $binpath" 1>&2 X fi X fname=`echo "$binpath" | sed -e 's,.*/,,'` X strip "$binpath" X rm -f "${BINS}"/"$fname" X cp -p "$binpath" "${BINS}" X rm -rf "$dir"* X} X Xdo_install() { X url="$1" X dir="$2" X X fname=`echo "$url" | sed -e 's,.*/,,'` X do_wget "$url" X star xpf "$fname" X cd "$dir" X smake X smake ibins X cd .. X rm -rf "$dir"* X} X Xdo_compile ftp://ftp.berlios.de/pub/makefiles/testing/wget-1.9.1-2.tar${ZIP_SUFFIX} \ X wget-1.9.1 \ X wget-1.9.1/src/wget X XWGET="${BINS}/wget --passive-ftp" X Xdo_compile ftp://ftp.berlios.de/pub/makefiles/testing/gzip-1.3.3.tar.gz \ X gzip-1.3.3 \ X gzip-1.3.3/gzip X Xdo_compile ftp://ftp.berlios.de/pub/makefiles/testing/bzip2-1.0.3.tar.gz \ X bzip2-1.0.3 \ X bzip2-1.0.3/bzip2 X Xdo_compile ftp://ftp.berlios.de/pub/makefiles/testing/patch-2.5.4-1.tar.bz2 \ X patch-2.5.4 \ X patch-2.5.4/patch Xln -s patch ${BINS}/gpatch X Xdo_install ftp://ftp.berlios.de/pub/makefiles/testing/lndir.tar.bz2 \ X lndir X Xrm -rf /tmp/i.$$/ END-of-star-1.6/conf/setup.sh echo x - star-1.6/conf/mkdir.sh sed 's/^X//' >star-1.6/conf/mkdir.sh << 'END-of-star-1.6/conf/mkdir.sh' X#!/bin/sh X# @(#)mkdir.sh 1.5 09/12/22 Copyright 1998 J. Schilling X########################################################################### X# Written 1998-2005 by J. Schilling X########################################################################### X# X# Schily Makefile slottable source high level mkdir -p command X# Creates TARGETS/ and needed content X# X# Replacement for mkdir -p ... functionality. X# X# mkdir(1) on BSD-4.3, NeXT Step <= 3.x and similar don't accept the -p flag X# X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X Xdop=false XdoT=false Xok=true Xwhile test $# -ne 0; do X case $1 in X -p) X dop=true X shift X ;; X -T) X doT=true X shift X ;; X -*) X echo "Unknown Option '$1'" 1>&2 X ok=false X break X ;; X *) X break X ;; X esac Xdone X Xif [ $doT = true -a $dop = false ]; then X echo "Option -T needs -p in addition" 1>&2 X ok=false Xfi X Xif [ $# -lt 1 ]; then X echo "Missing parameter" 1>&2 Xfi Xif [ $# -lt 1 -o $ok = false ]; then X echo "Usage: $0 [-p] [-T] dir ...." X echo "Options:" X echo " -p Create and including all non existing parent directories" X echo " -T Add Schily Makefile directory template files" X exit 1 Xfi X Xif [ $doT = true -a ."$SRCROOT" = . ]; then X SRCROOT=. X loop=1 X while [ $loop -lt 100 ]; do X if [ ! -d $SRCROOT ]; then X # Abort on ENAMETOOLONG X break X fi X if [ -r $SRCROOT/RULES/rules.top ]; then X break X fi X if [ "$SRCROOT" = . ]; then X SRCROOT=".." X else X SRCROOT="$SRCROOT/.." X fi X loop="`expr $loop + 1`" X done X if [ ! -r $SRCROOT/RULES/rules.top ]; then X echo "Cannot find SRCROOT directory" 1>&2 X exit 1 X fi X export SRCROOT Xfi X Xif [ $dop = false ]; then X for i in "$@"; do X mkdir "$i" X done Xelse X for i in "$@"; do X # Don't use ${i:-.}, BSD4.3 doen't like it X # X fullname="$i" X if [ ."$i" = . ]; then X fullname=. X fi X if [ "$fullname" = . ]; then X continue X fi X dirname=`expr \ X "$fullname/" : '\(/\)/*[^/]*//*$' \| \ X "$fullname/" : '\(.*[^/]\)//*[^/][^/]*//*$' \| \ X .` X X if [ $doT = false ]; then X sh $0 -p "$dirname" X if [ ! -d "$i" ]; then X mkdir "$i" X fi X continue X else X sh $0 -p -T "$dirname" X fi X X if [ ! -d "$dirname"/TARGETS ]; then X mkdir "$dirname"/TARGETS X fi X if [ ! -r "$dirname"/TARGETS/__slot ]; then X echo 'This file enables the "slot" feature of the Schily SING makefile system' > "$dirname"/TARGETS/__slot X fi X dirbase=`echo "$i" | sed -e 's,/*$,,;s,.*/\([^/]*\),\1,'` X if [ ! -r "$dirname"/TARGETS/55"$dirbase" ]; then X : > "$dirname"/TARGETS/55"$dirbase" X fi X if [ ! -r "$dirname"/Makefile ]; then X srcroot=`echo "$dirname" | sed -e 's,[^/][^/]*,..,g'` X srcroot=`echo "$SRCROOT/$srcroot" | sed -e 's,^\./,,'` X X echo '#ident %'W'% %'E'% %'Q'%' > "$dirname"/Makefile X echo '###########################################################################' >> "$dirname"/Makefile X echo '# Sample makefile for sub directory makes' >> "$dirname"/Makefile X echo '###########################################################################' >> "$dirname"/Makefile X echo "SRCROOT= $srcroot" >> "$dirname"/Makefile X echo 'RULESDIR= RULES' >> "$dirname"/Makefile X echo 'include $(SRCROOT)/$(RULESDIR)/rules.top' >> "$dirname"/Makefile X echo '###########################################################################' >> "$dirname"/Makefile X echo >> "$dirname"/Makefile X echo '###########################################################################' >> "$dirname"/Makefile X echo 'include $(SRCROOT)/$(RULESDIR)/rules.dir' >> "$dirname"/Makefile X echo '###########################################################################' >> "$dirname"/Makefile X fi X X if [ ! -d "$i" ]; then X mkdir "$i" X fi X done Xfi END-of-star-1.6/conf/mkdir.sh echo x - star-1.6/conf/mkdep-msc.sh sed 's/^X//' >star-1.6/conf/mkdep-msc.sh << 'END-of-star-1.6/conf/mkdep-msc.sh' X#!/bin/sh X#ident "@(#)mkdep-msc.sh 1.3 11/08/11 " X########################################################################### X# Copyright 1999,2006 by J. Schilling X########################################################################### X# X# Create dependency list with Microsoft's cl X# X########################################################################### X# X# This script will probably not work correctly with a list of C-files X# but as we don't need it with 'smake' or 'gmake' it seems to be sufficient. X# X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XFILES= X Xfor i in "$@"; do X X case "$i" in X X -*) # ignore options X ;; X X *.c | *.C | *.cc | *.cxx | *.cpp) X X if [ ! -z "$FILES" ]; then X FILES="$FILES " X fi X # base name from $i X base=`echo $i | sed -e 's;[^/]*/;;'` X FILES="$FILES$base" X ;; X esac Xdone X XOFILES=`echo "$FILES" | sed -e 's;\([^.]*\)\.[cC]$;\1.obj;g' -e 's;\([^.]*\)\.cc$;\1.obj;g' -e 's;\([^.]*\)\.c..$;\1.obj;g' ` X Xecho ".SPACE_IN_NAMES: true" Xcl -E -nologo 2> /dev/null "$@" | grep '\#line' | sed -e 's,^.*\#line[ \t]*[^ ]*[ \t]*",,' \ X -e 's,"$,,' -e 's/\([^\]\) /\1\\ /g' \ X -e 's,\.\\\\*,.\\,g' \ X -e "s;^;$OFILES: ;" | sort -u Xecho ".SPACE_IN_NAMES:" END-of-star-1.6/conf/mkdep-msc.sh echo x - star-1.6/conf/xconfig.mk sed 's/^X//' >star-1.6/conf/xconfig.mk << 'END-of-star-1.6/conf/xconfig.mk' X#ident @(#)xconfig.mk 1.1 06/10/31 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X X.SEARCHLIST: ../incs/$(OARCH) ../incs/$(OARCH) XVPATH= ../incs/$(OARCH) X XINSDIR= include/schily/$(OARCH) XTARGET= xconfig.h X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### X XPTARGET= ../incs/$(OARCH)/xconfig.h END-of-star-1.6/conf/xconfig.mk echo x - star-1.6/conf/post.html sed 's/^X//' >star-1.6/conf/post.html << 'END-of-star-1.6/conf/post.html' X


XFhG X XSchily's Home XVED powered X X X END-of-star-1.6/conf/post.html echo x - star-1.6/conf/pre.html sed 's/^X//' >star-1.6/conf/pre.html << 'END-of-star-1.6/conf/pre.html' X X XManpage for XXX X X X X END-of-star-1.6/conf/pre.html echo x - star-1.6/conf/mkdep-msc-interix.sh sed 's/^X//' >star-1.6/conf/mkdep-msc-interix.sh << 'END-of-star-1.6/conf/mkdep-msc-interix.sh' X#!/bin/sh X#ident "@(#)mkdep-msc-interix.sh 1.4 07/04/24 " X########################################################################### X# Copyright 1999,2006-2007 by J. Schilling X########################################################################### X# X# Create dependency list with Microsoft's cl from Interix X# X########################################################################### X# X# This script will probably not work correctly with a list of C-files X# but as we don't need it with 'smake' or 'gmake' it seems to be sufficient. X# X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### XFILES= X Xfor i in "$@"; do X X case "$i" in X X -*) # ignore options X ;; X X *.c | *.C | *.cc | *.cxx | *.cpp) X X if [ ! -z "$FILES" ]; then X FILES="$FILES " X fi X # base name from $i X base=`echo $i | sed -e 's;[^/]*/;;'` X FILES="$FILES$base" X ;; X esac Xdone X XOFILES=`echo "$FILES" | sed -e 's;\([^.]*\)\.[cC]$;\1.obj;g' -e 's;\([^.]*\)\.cc$;\1.obj;g' -e 's;\([^.]*\)\.c..$;\1.obj;g' ` X Xecho ".SPACE_IN_NAMES: true" Xcl.exe -E -nologo 2> /dev/null "$@" | grep '^\#line' | cut -d\" -f2 | sort -u | \ X sed ' Xs,^a:,/dev/fs/A, Xs,^b:,/dev/fs/B, Xs,^c:,/dev/fs/C, Xs,^d:,/dev/fs/D, Xs,^e:,/dev/fs/E, Xs,^f:,/dev/fs/F, Xs,^g:,/dev/fs/G, Xs,^h:,/dev/fs/H, Xs,^i:,/dev/fs/I, Xs,^j:,/dev/fs/J, Xs,^k:,/dev/fs/K, Xs,^l:,/dev/fs/L, Xs,^m:,/dev/fs/M, Xs,^n:,/dev/fs/N, Xs,^o:,/dev/fs/O, Xs,^p:,/dev/fs/P, Xs,^q:,/dev/fs/Q, Xs,^r:,/dev/fs/R, Xs,^s:,/dev/fs/S, Xs,^t:,/dev/fs/T, Xs,^u:,/dev/fs/U, Xs,^v:,/dev/fs/V, Xs,^w:,/dev/fs/W, Xs,^x:,/dev/fs/X, Xs,^y:,/dev/fs/Y, Xs,^z:,/dev/fs/Z, Xs,\([A-Z]\):,/dev/fs/\1, Xs,\\\\,/,g Xs/\([^\]\) /\1\\ /g' | sed -e "s;^;$OFILES: ;" Xecho ".SPACE_IN_NAMES:" END-of-star-1.6/conf/mkdep-msc-interix.sh echo x - star-1.6/conf/runrmt_android sed 's/^X//' >star-1.6/conf/runrmt_android << 'END-of-star-1.6/conf/runrmt_android' X#!/bin/sh X# @(#)runrmt_android 1.4 12/03/11 Copyright 2011 J. Schilling X########################################################################### X# Written 2011 by J. Schilling X########################################################################### X# Remotely execute a test from "configure" and copy back "conftestval" as X# well as the exit code from the program on the remote platform. X# X# This is the Android emulator variant that calls commands via the X# Android Debug Bridge. X# X# Note that the shell variable '$?' needs to be handled with caution in X# order to prevent early expansion. X# We use "sh -c" to make sure that this script will work correctly in case X# the remote user has a strange login shell. X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X Xremote_test=FALSE Xif test "$1" = "-r" ; then X remote_test=TRUE X shift Xfi X Xif test $# -lt 1 ; then X echo "Usage: runrmt_android program-to-execute" 1>&2 X echo "or" X echo " runrmt -r file-to-test" 1>&2 X exit 255 Xfi X Xif test $remote_test = FALSE -a ! -r $1 ; then X echo "$1: not found" 1>&2 X exit 254 Xfi X X# X# We should tar and feather the Android authors for redefining the name X# of the standard UNIX debugger for their tool. Hey, next time you could use X# "ls", "ps", "df" or something similar to cause even more fun. X# X# Edit this line if your Android Emulator is on a different location: Xrmt=$HOME/android-sdk-linux_x86/platform-tools/adb X X# X# Only do debugging when we are called from the schily makefilesystem X# Xif test ."$CONFIG_RMTDEBUG" != . -a ."$CONFIG_NOFAIL" != . ; then X echo "REMOTE \c" 1>&6 # configure checking messages are on fd 6 Xfi X Xif test $remote_test = TRUE; then X # X # Android has no "test" command, do the best we can do... X # As "ls" on Android does not implement -L, we may be fooled by symlinks. X # X $rmt shell "cd /data/local/tmp;ls -l $1>/dev/null 2>/dev/null;echo "'$?'" > o.exit" 2> /dev/null X $rmt pull /data/local/tmp/o.exit . 2> /dev/null X $rmt shell "rm /data/local/tmp/o.exit" 2> /dev/null > /dev/null X $rmt shell "rm /data/local/tmp/core" 2> /dev/null > /dev/null Xelse X F=`echo $1 | sed -e 's,.*/,,'` X $rmt push $1 /data/local/tmp 2> /dev/null X $rmt shell "cd /data/local/tmp;./$F > o.out 2> o.err ;echo "'$?'" > o.exit" 2> /dev/null X $rmt pull /data/local/tmp/o.exit . 2> /dev/null X $rmt pull /data/local/tmp/o.out . 2> /dev/null X $rmt pull /data/local/tmp/o.err . 2> /dev/null X $rmt pull /data/local/tmp/conftestval . 2> /dev/null X $rmt shell "rm /data/local/tmp/$F /data/local/tmp/o.exit" 2> /dev/null > /dev/null X $rmt shell "rm /data/local/tmp/o.out /data/local/tmp/o.err" 2> /dev/null > /dev/null X $rmt shell "rm /data/local/tmp/core" 2> /dev/null > /dev/null X $rmt shell "rm /data/local/tmp/conftestval" 2> /dev/null > /dev/null Xfi Xexcode=`cat ./o.exit` Xif [ -f o.out ]; then X cat o.out Xfi Xif [ -f o.err ]; then X cat o.err 1>&2 Xfi Xrm -f ./o.exit ./o.out ./o.err X#echo excode: $excode Xexit $excode END-of-star-1.6/conf/runrmt_android echo x - star-1.6/conf/runrmt_rsh sed 's/^X//' >star-1.6/conf/runrmt_rsh << 'END-of-star-1.6/conf/runrmt_rsh' X#!/bin/sh X# @(#)runrmt_rsh 1.3 11/07/16 Copyright 2011 J. Schilling X########################################################################### X# Written 2011 by J. Schilling X########################################################################### X# Remotely execute a test from "configure" and copy back "conftestval" as X# well as the exit code from the program on the remote platform. X# X# This is the generic UNIX variant that calls commands via "rsh". X# X# Note that the shell variable '$?' needs to be handled with caution in X# order to prevent early expansion. X# We use "sh -c" to make sure that this script will work correctly in case X# the remote user has a strange login shell. X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X Xremote_test=FALSE Xif test "$1" = "-r" ; then X remote_test=TRUE X shift Xfi X Xif test $# -lt 1 ; then X echo "Usage: runrmt program-to-execute" 1>&2 X echo "or" X echo " runrmt -r file-to-test" 1>&2 X exit 255 Xfi X Xif test $remote_test = FALSE -a ! -r $1 ; then X echo "$1: not found" 1>&2 X exit 254 Xfi X Xif test ."$CONFIG_RMTHOST" = . ; then X echo 'CONFIG_RMTHOST=host or CONFIG_RMTHOST=user@host required for remote execution' 1>&2 X exit 253 Xfi Xremote="$CONFIG_RMTHOST" X Xif test ."$CONFIG_RMTDEBUG" != . ; then X echo "REMOTE \c" 1>&6 # configure checking messages are on fd 6 Xfi X Xif test $remote_test = TRUE; then X rsh $remote sh -c "'cd /tmp/;test -r $1; echo "'$?'" > o.exit'" 2> /dev/null X rcp -p $remote:/tmp/o.exit . 2> /dev/null X rsh $remote "rm -f /tmp/core /tmp/o.exit" 2> /dev/null >/dev/null Xelse X F=`echo $1 | sed -e 's,.*/,,'` X rcp $1 $remote:/tmp/ 2> /dev/null X rsh $remote sh -c "'cd /tmp/;./$F; echo "'$?'" > o.exit'" X rcp -p $remote:/tmp/o.exit . 2> /dev/null X rcp -p $remote:/tmp/conftestval . 2> /dev/null X rsh $remote "rm -f /tmp/core /tmp/$F /tmp/o.exit /tmp/conftestval" 2> /dev/null >/dev/null Xfi Xexcode=`cat ./o.exit` Xrm -f ./o.exit X#echo excode: $excode Xexit $excode END-of-star-1.6/conf/runrmt_rsh echo x - star-1.6/conf/runrmt_ssh sed 's/^X//' >star-1.6/conf/runrmt_ssh << 'END-of-star-1.6/conf/runrmt_ssh' X#!/bin/sh X# @(#)runrmt_ssh 1.3 11/07/16 Copyright 2011 J. Schilling X########################################################################### X# Written 2011 by J. Schilling X########################################################################### X# Remotely execute a test from "configure" and copy back "conftestval" as X# well as the exit code from the program on the remote platform. X# X# This is the generic UNIX variant that calls commands via "ssh". X# X# Note that the shell variable '$?' needs to be handled with caution in X# order to prevent early expansion. X# We use "sh -c" to make sure that this script will work correctly in case X# the remote user has a strange login shell. X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X Xremote_test=FALSE Xif test "$1" = "-r" ; then X remote_test=TRUE X shift Xfi X Xif test $# -lt 1 ; then X echo "Usage: runrmt program-to-execute" 1>&2 X echo "or" X echo " runrmt -r file-to-test" 1>&2 X exit 255 Xfi X Xif test $remote_test = FALSE -a ! -r $1 ; then X echo "$1: not found" 1>&2 X exit 254 Xfi X Xif test ."$CONFIG_RMTHOST" = . ; then X echo 'CONFIG_RMTHOST=host or CONFIG_RMTHOST=user@host required for remote execution' 1>&2 X exit 253 Xfi Xremote="$CONFIG_RMTHOST" X Xif test ."$CONFIG_RMTDEBUG" != . ; then X echo "REMOTE \c" 1>&6 # configure checking messages are on fd 6 Xfi X Xif test $remote_test = TRUE; then X ssh $remote sh -c "'cd /tmp/;test -r $1; echo "'$?'" > o.exit'" 2> /dev/null X scp -p $remote:/tmp/o.exit . 2> /dev/null X ssh $remote "rm -f /tmp/core /tmp/o.exit" 2> /dev/null >/dev/null Xelse X F=`echo $1 | sed -e 's,.*/,,'` X scp $1 $remote:/tmp/ 2> /dev/null X ssh $remote sh -c "'cd /tmp/;./$F; echo "'$?'" > o.exit'" X scp -p $remote:/tmp/o.exit . 2> /dev/null X scp -p $remote:/tmp/conftestval . 2> /dev/null X ssh $remote "rm -f /tmp/core /tmp/$F /tmp/o.exit /tmp/conftestval" 2> /dev/null >/dev/null Xfi Xexcode=`cat ./o.exit` Xrm -f ./o.exit X#echo excode: $excode Xexit $excode END-of-star-1.6/conf/runrmt_ssh echo c - star-1.6/incs mkdir -p star-1.6/incs > /dev/null 2>&1 echo c - star-1.6/inc mkdir -p star-1.6/inc > /dev/null 2>&1 echo x - star-1.6/inc/Makefile sed 's/^X//' >star-1.6/inc/Makefile << 'END-of-star-1.6/inc/Makefile' X#ident "@(#)Makefile 1.3 08/09/10 " X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMK_FILES= align_test.mk avoffset.mk X Xalign_test.c: X @echo " ==> MAKING SYMLINKS in ." && sh ./MKLINKS X$(ALLTARGETS): align_test.c X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.mks X########################################################################### END-of-star-1.6/inc/Makefile echo x - star-1.6/inc/align_test.c sed 's/^X//' >star-1.6/inc/align_test.c << 'END-of-star-1.6/inc/align_test.c' X/* @(#)align_test.c 1.31 15/11/30 Copyright 1995-2015 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)align_test.c 1.31 15/11/30 Copyright 1995-2015 J. Schilling"; X#endif X/* X * Generate machine dependant align.h X * X * Copyright (c) 1995-2015 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#undef NO_LONGLONG /* Make sure that Llong will be long long */ X#include X#include /* Define missing prototypes */ X X/* X * Be very careful here as MSVC does not implement long long but rather __int64 X * and once someone makes 'long long' 128 bits on a 64 bit machine, we need to X * check for a MSVC __int128 type. X */ X X/* X * CHECK_ALIGN needs SIGBUS, but DJGPP has no SIGBUS X */ X/*#define FORCE_ALIGN*/ X/*#define OFF_ALIGN*/ X/*#define CHECK_ALIGN*/ X XEXPORT int main __PR((int ac, char **av)); X X#if !defined(FORCE_ALIGN) && !defined(OFF_ALIGN) && !defined(CHECK_ALIGN) X#define OFF_ALIGN X#endif X Xchar buf[8192+1024]; Xchar *buf_aligned; X X#ifdef FORCE_ALIGN X# undef CHECK_ALIGN X# undef OFF_ALIGN X#endif X X#ifdef CHECK_ALIGN X# undef FORCE_ALIGN X# undef OFF_ALIGN X#endif X X#ifdef OFF_ALIGN X# undef FORCE_ALIGN X# undef CHECK_ALIGN X#endif X X X#ifdef FORCE_ALIGN X X#define ALIGN_short sizeof (short) X#define ALIGN_int sizeof (int) X#define ALIGN_long sizeof (long) X#define ALIGN_longlong sizeof (Llong) X#define ALIGN_float sizeof (float) X#define ALIGN_double sizeof (double) X#define ALIGN_ldouble sizeof (long double) X#define ALIGN_ptr sizeof (char *) X X#endif X X#ifdef CHECK_ALIGN X X#include X#include XLOCAL jmp_buf jb; X XLOCAL int check_align __PR((int (*)(char *, int), X void (*)(char *, int), int)); XLOCAL int check_short __PR((char *, int)); XLOCAL int check_int __PR((char *, int)); XLOCAL int check_long __PR((char *, int)); XLOCAL int check_longlong __PR((char *, int)); XLOCAL int check_float __PR((char *, int)); XLOCAL int check_double __PR((char *, int)); X#ifdef HAVE_LONGDOUBLE XLOCAL int check_ldouble __PR((char *, int)); X#endif XLOCAL int check_ptr __PR((char *, int)); X XLOCAL int speed_check __PR((char *, X void (*)(char *, int), int)); XLOCAL void speed_short __PR((char *, int)); XLOCAL void speed_int __PR((char *, int)); XLOCAL void speed_long __PR((char *, int)); XLOCAL void speed_longlong __PR((char *, int)); XLOCAL void speed_float __PR((char *, int)); XLOCAL void speed_double __PR((char *, int)); X#ifdef HAVE_LONGDOUBLE XLOCAL void speed_ldouble __PR((char *, int)); X#endif XLOCAL void speed_ptr __PR((char *, int)); X X#define ALIGN_short check_align(check_short, speed_short, sizeof (short)) X#define ALIGN_int check_align(check_int, speed_int, sizeof (int)) X#define ALIGN_long check_align(check_long, speed_long, sizeof (long)) X#define ALIGN_longlong check_align(check_longlong, speed_longlong, sizeof (Llong)) X#define ALIGN_float check_align(check_float, speed_float, sizeof (float)) X#define ALIGN_double check_align(check_double, speed_double, sizeof (double)) X#define ALIGN_ldouble check_align(check_ldouble, speed_ldouble, sizeof (long double)) X#define ALIGN_ptr check_align(check_ptr, speed_ptr, sizeof (char *)) X X#endif X X#ifdef OFF_ALIGN X X#define sm_off(s, m) ((size_t)&((s)0)->m) X XLOCAL void used __PR((int i)); XLOCAL int off_short __PR((void)); XLOCAL int off_int __PR((void)); XLOCAL int off_long __PR((void)); XLOCAL int off_longlong __PR((void)); XLOCAL int off_float __PR((void)); XLOCAL int off_double __PR((void)); X#ifdef HAVE_LONGDOUBLE XLOCAL int off_ldouble __PR((void)); X#endif XLOCAL int off_ptr __PR((void)); X X#define ALIGN_short off_short() X#define ALIGN_int off_int() X#define ALIGN_long off_long() X#define ALIGN_longlong off_longlong() X#define ALIGN_float off_float() X#define ALIGN_double off_double() X#define ALIGN_ldouble off_ldouble() X#define ALIGN_ptr off_ptr() X X#endif X XLOCAL void printmacs __PR((void)); X X#ifdef CHECK_ALIGN XLOCAL void sig __PR((int)); X XLOCAL void Xsig(signo) X int signo; X{ X signal(signo, sig); X longjmp(jb, 1); X} X#endif X X#if defined(mc68000) || defined(mc68020) X#define MIN_ALIGN 2 X#else X#define MIN_ALIGN 2 X#endif X X X#define min_align(i) (((i) < MIN_ALIGN) ? MIN_ALIGN : (i)) X X/* X * Make it LOCAL MacOS-X by default links against libcurses and X * so we totherwise have a double defined "al". X */ XLOCAL char al[] = "alignment value for "; XLOCAL char ms[] = "alignment mask for "; XLOCAL char so[] = "sizeof "; XLOCAL char sh[] = "short"; XLOCAL char in[] = "int"; XLOCAL char lo[] = "long"; XLOCAL char ll[] = "long long"; XLOCAL char fl[] = "float"; XLOCAL char db[] = "double"; XLOCAL char ld[] = "long double"; XLOCAL char pt[] = "pointer"; XLOCAL char mt[] = "max type"; X X#define xalign(x, a, m) (((char *)(x)) + ((a) - (((UIntptr_t)(x))&(m)))) X XEXPORT int Xmain(ac, av) X int ac; X char **av; X{ X char *p; X int i; X int s; X int amax = 0; X int smax = 0; X X#ifdef CHECK_ALIGN X#ifdef SIGBUS X signal(SIGBUS, sig); X#endif X#endif X X i = ((size_t)buf) % 1024; X i = 1024 - i; X p = &buf[i]; X buf_aligned = p; X X#ifdef DEBUG X fprintf(stderr, "buf: 0x%lX 0x%lX\n", X (unsigned long)buf, (unsigned long)xalign(buf, 1024, 1023)); X#endif X X printf("/*\n"); X printf(" * This file has been generated automatically\n"); X printf(" * by %s\n", sccsid); X printf(" * do not edit by hand.\n"); X printf(" */\n"); X printf("#ifndef __ALIGN_H\n"); X printf("#define __ALIGN_H\n\n"); X X s = sizeof (short); X i = ALIGN_short; X i = min_align(i); X if (i > amax) X amax = i; X if (s > smax) X smax = s; X printf("\n"); X printf("#define ALIGN_SHORT %d\t/* %s(%s *)\t*/\n", i, al, sh); X printf("#define ALIGN_SMASK %d\t/* %s(%s *)\t*/\n", i-1, ms, sh); X printf("#define SIZE_SHORT %d\t/* %s(%s)\t\t\t*/\n", s, so, sh); X X s = sizeof (int); X i = ALIGN_int; X i = min_align(i); X if (i > amax) X amax = i; X if (s > smax) X smax = s; X printf("\n"); X printf("#define ALIGN_INT %d\t/* %s(%s *)\t\t*/\n", i, al, in); X printf("#define ALIGN_IMASK %d\t/* %s(%s *)\t\t*/\n", i-1, ms, in); X printf("#define SIZE_INT %d\t/* %s(%s)\t\t\t\t*/\n", s, so, in); X X s = sizeof (long); X i = ALIGN_long; X i = min_align(i); X if (i > amax) X amax = i; X if (s > smax) X smax = s; X printf("\n"); X printf("#define ALIGN_LONG %d\t/* %s(%s *)\t\t*/\n", i, al, lo); X printf("#define ALIGN_LMASK %d\t/* %s(%s *)\t\t*/\n", i-1, ms, lo); X printf("#define SIZE_LONG %d\t/* %s(%s)\t\t\t*/\n", s, so, lo); X X#ifdef HAVE_LONGLONG X s = sizeof (Llong); X i = ALIGN_longlong; X i = min_align(i); X if (i > amax) X amax = i; X if (s > smax) X smax = s; X#endif X printf("\n"); X printf("#define ALIGN_LLONG %d\t/* %s(%s *)\t*/\n", i, al, ll); X printf("#define ALIGN_LLMASK %d\t/* %s(%s *)\t*/\n", i-1, ms, ll); X printf("#define SIZE_LLONG %d\t/* %s(%s)\t\t\t*/\n", s, so, ll); X X s = sizeof (float); X i = ALIGN_float; X i = min_align(i); X if (i > amax) X amax = i; X if (s > smax) X smax = s; X printf("\n"); X printf("#define ALIGN_FLOAT %d\t/* %s(%s *)\t*/\n", i, al, fl); X printf("#define ALIGN_FMASK %d\t/* %s(%s *)\t*/\n", i-1, ms, fl); X printf("#define SIZE_FLOAT %d\t/* %s(%s)\t\t\t*/\n", s, so, fl); X X s = sizeof (double); X i = ALIGN_double; X i = min_align(i); X if (i > amax) X amax = i; X if (s > smax) X smax = s; X printf("\n"); X printf("#define ALIGN_DOUBLE %d\t/* %s(%s *)\t*/\n", i, al, db); X printf("#define ALIGN_DMASK %d\t/* %s(%s *)\t*/\n", i-1, ms, db); X printf("#define SIZE_DOUBLE %d\t/* %s(%s)\t\t\t*/\n", s, so, db); X X#ifdef HAVE_LONGDOUBLE X s = sizeof (long double); X i = ALIGN_ldouble; X i = min_align(i); X if (i > amax) X amax = i; X if (s > smax) X smax = s; X#endif X printf("\n"); X printf("#define ALIGN_LDOUBLE %d\t/* %s(%s *)\t*/\n", i, al, ld); X printf("#define ALIGN_LDMASK %d\t/* %s(%s *)\t*/\n", i-1, ms, ld); X printf("#define SIZE_LDOUBLE %d\t/* %s(%s)\t\t\t*/\n", s, so, ld); X X s = sizeof (char *); X i = ALIGN_ptr; X i = min_align(i); X if (i > amax) X amax = i; X if (s > smax) X smax = s; X printf("\n"); X printf("#define ALIGN_PTR %d\t/* %s(%s *)\t*/\n", i, al, pt); X printf("#define ALIGN_PMASK %d\t/* %s(%s *)\t*/\n", i-1, ms, pt); X printf("#define SIZE_PTR %d\t/* %s(%s)\t\t\t*/\n", s, so, pt); X X printf("\n"); X printf("#define ALIGN_TMAX %d\t/* %s(%s *)\t*/\n", amax, al, mt); X printf("#define ALIGN_TMMASK %d\t/* %s(%s *)\t*/\n", amax-1, ms, mt); X printf("#define SIZE_TMAX %d\t/* %s(%s)\t\t\t*/\n", smax, so, mt); X X printmacs(); X printf("\n#endif /* __ALIGN_H */\n"); X fflush(stdout); X return (0); X} X XLOCAL void Xprintmacs() X{ Xprintf("\n\n"); Xprintf("/*\n * There used to be a cast to an int but we get a warning from GCC.\n"); Xprintf(" * This warning message from GCC is wrong.\n"); Xprintf(" * Believe me that this macro would even be usable if I would cast to short.\n"); Xprintf(" * In order to avoid this warning, we are now using UIntptr_t\n */\n"); X/*printf("\n");*/ X/*printf("\n");*/ Xprintf("#define xaligned(a, s) ((((UIntptr_t)(a)) & (s)) == 0)\n"); Xprintf("#define x2aligned(a, b, s) (((((UIntptr_t)(a)) | ((UIntptr_t)(b))) & (s)) == 0)\n"); Xprintf("\n"); Xprintf("#define saligned(a) xaligned(a, ALIGN_SMASK)\n"); Xprintf("#define s2aligned(a, b) x2aligned(a, b, ALIGN_SMASK)\n"); Xprintf("\n"); Xprintf("#define ialigned(a) xaligned(a, ALIGN_IMASK)\n"); Xprintf("#define i2aligned(a, b) x2aligned(a, b, ALIGN_IMASK)\n"); Xprintf("\n"); Xprintf("#define laligned(a) xaligned(a, ALIGN_LMASK)\n"); Xprintf("#define l2aligned(a, b) x2aligned(a, b, ALIGN_LMASK)\n"); Xprintf("\n"); Xprintf("#define llaligned(a) xaligned(a, ALIGN_LLMASK)\n"); Xprintf("#define ll2aligned(a, b) x2aligned(a, b, ALIGN_LLMASK)\n"); Xprintf("\n"); Xprintf("#define faligned(a) xaligned(a, ALIGN_FMASK)\n"); Xprintf("#define f2aligned(a, b) x2aligned(a, b, ALIGN_FMASK)\n"); Xprintf("\n"); Xprintf("#define daligned(a) xaligned(a, ALIGN_DMASK)\n"); Xprintf("#define d2aligned(a, b) x2aligned(a, b, ALIGN_DMASK)\n"); Xprintf("\n"); Xprintf("#define ldaligned(a) xaligned(a, ALIGN_LDMASK)\n"); Xprintf("#define ld2aligned(a, b) x2aligned(a, b, ALIGN_LDMASK)\n"); Xprintf("\n"); Xprintf("#define paligned(a) xaligned(a, ALIGN_PMASK)\n"); Xprintf("#define p2aligned(a, b) x2aligned(a, b, ALIGN_PMASK)\n"); Xprintf("\n"); Xprintf("#define maligned(a) xaligned(a, ALIGN_TMMASK)\n"); Xprintf("#define m2aligned(a, b) x2aligned(a, b, ALIGN_TMMASK)\n"); X Xprintf("\n\n"); Xprintf("/*\n * There used to be a cast to an int but we get a warning from GCC.\n"); Xprintf(" * This warning message from GCC is wrong.\n"); Xprintf(" * Believe me that this macro would even be usable if I would cast to short.\n"); Xprintf(" * In order to avoid this warning, we are now using UIntptr_t\n */\n"); Xprintf("#define xalign(x, a, m) (((char *)(x)) + ((a) - 1 - ((((UIntptr_t)(x))-1)&(m))))\n"); Xprintf("\n"); Xprintf("#define salign(x) xalign((x), ALIGN_SHORT, ALIGN_SMASK)\n"); Xprintf("#define ialign(x) xalign((x), ALIGN_INT, ALIGN_IMASK)\n"); Xprintf("#define lalign(x) xalign((x), ALIGN_LONG, ALIGN_LMASK)\n"); Xprintf("#define llalign(x) xalign((x), ALIGN_LLONG, ALIGN_LLMASK)\n"); Xprintf("#define falign(x) xalign((x), ALIGN_FLOAT, ALIGN_FMASK)\n"); Xprintf("#define dalign(x) xalign((x), ALIGN_DOUBLE, ALIGN_DMASK)\n"); Xprintf("#define ldalign(x) xalign((x), ALIGN_LDOUBLE, ALIGN_LDMASK)\n"); Xprintf("#define palign(x) xalign((x), ALIGN_PTR, ALIGN_PMASK)\n"); Xprintf("#define malign(x) xalign((x), ALIGN_TMAX, ALIGN_TMMASK)\n"); X} X X#ifdef CHECK_ALIGN X/* X * Routines to compute the alignement by checking if the assignement X * causes a bus error. X * Some systems (e.g. Linux on DEC Aplha) will allow to fetch any X * type from any address. On these systems we must check the speed X * because unaligned fetches will take more time. X */ XLOCAL int Xcheck_align(cfunc, sfunc, tsize) X int (*cfunc)(); X void (*sfunc)(); X int tsize; X{ X int calign; X int align; X int tcheck; X int t; X register int i; X register char *p = buf_aligned; X X for (i = 1; i < 128; i++) { X if (!setjmp(jb)) { X (cfunc)(p, i); X break; X } X } X#ifdef DEBUG X fprintf(stderr, "i: %d tsize: %d\n", i, tsize); X#endif X if (i == tsize) X return (i); X X align = calign = i; X tcheck = speed_check(p, sfunc, i); X#ifdef DEBUG X fprintf(stderr, "tcheck: %d\n", tcheck); X#endif X X for (i = calign*2; i <= tsize; i *= 2) { X t = speed_check(p, sfunc, i); X#ifdef DEBUG X fprintf(stderr, "tcheck: %d t: %d i: %d\n", tcheck, t, i); X fprintf(stderr, "tcheck - t: %d ... * 3: %d\n", (tcheck - t), (tcheck - t) * 3); X#endif X if (((tcheck - t) > 0) && ((tcheck - t) * 3) > tcheck) { X#ifdef DEBUG X fprintf(stderr, "kleiner\n"); X#endif X align = i; X tcheck = t; X } X } X return (align); X} X XLOCAL int Xcheck_short(p, i) X char *p; X int i; X{ X short *sp; X X sp = (short *)&p[i]; X *sp = 1; X return (0); X} X XLOCAL int Xcheck_int(p, i) X char *p; X int i; X{ X int *ip; X X ip = (int *)&p[i]; X *ip = 1; X return (0); X} X XLOCAL int Xcheck_long(p, i) X char *p; X int i; X{ X long *lp; X X lp = (long *)&p[i]; X *lp = 1; X return (0); X} X X#ifdef HAVE_LONGLONG XLOCAL int Xcheck_longlong(p, i) X char *p; X int i; X{ X Llong *llp; X X llp = (Llong *)&p[i]; X *llp = 1; X return (0); X} X#endif X XLOCAL int Xcheck_float(p, i) X char *p; X int i; X{ X float *fp; X X fp = (float *)&p[i]; X *fp = 1.0; X return (0); X} X XLOCAL int Xcheck_double(p, i) X char *p; X int i; X{ X double *dp; X X dp = (double *)&p[i]; X *dp = 1.0; X return (0); X} X X#ifdef HAVE_LONGDOUBLE XLOCAL int Xcheck_ldouble(p, i) X char *p; X int i; X{ X long double *dp; X X dp = (long double *)&p[i]; X *dp = 1.0; X return (0); X} X#endif X XLOCAL int Xcheck_ptr(p, i) X char *p; X int i; X{ X char **pp; X X pp = (char **)&p[i]; X *pp = (char *)1; X return (0); X} X X/* X * Routines to compute the alignement by checking the speed of the X * assignement. X * Some systems (e.g. Linux on DEC Aplha) will allow to fetch any X * type from any address. On these systems we must check the speed X * because unaligned fetches will take more time. X */ XLOCAL void Xspeed_short(p, n) X char *p; X int n; X{ X short *sp; X int i; X X sp = (short *)&p[n]; X X for (i = 1000000; --i >= 0; ) X *sp = i; X} X XLOCAL void Xspeed_int(p, n) X char *p; X int n; X{ X int *ip; X int i; X X ip = (int *)&p[n]; X X for (i = 1000000; --i >= 0; ) X *ip = i; X} X XLOCAL void Xspeed_long(p, n) X char *p; X int n; X{ X long *lp; X int i; X X lp = (long *)&p[n]; X X for (i = 1000000; --i >= 0; ) X *lp = i; X} X X#ifdef HAVE_LONGLONG XLOCAL void Xspeed_longlong(p, n) X char *p; X int n; X{ X Llong *llp; X int i; X X llp = (Llong *)&p[n]; X X for (i = 1000000; --i >= 0; ) X *llp = i; X} X#endif X XLOCAL void Xspeed_float(p, n) X char *p; X int n; X{ X float *fp; X int i; X X fp = (float *)&p[n]; X X for (i = 1000000; --i >= 0; ) X *fp = i; X} X XLOCAL void Xspeed_double(p, n) X char *p; X int n; X{ X double *dp; X int i; X X dp = (double *)&p[n]; X X for (i = 1000000; --i >= 0; ) X *dp = i; X} X X#ifdef HAVE_LONGDOUBLE XLOCAL void Xspeed_ldouble(p, n) X char *p; X int n; X{ X long double *dp; X int i; X X dp = (long double *)&p[n]; X X for (i = 1000000; --i >= 0; ) X *dp = i; X} X#endif X XLOCAL void Xspeed_ptr(p, n) X char *p; X int n; X{ X char **pp; X int i; X X pp = (char **)&p[n]; X X for (i = 1000000; --i >= 0; ) X *pp = (char *)i; X} X X#include X#include XLOCAL int Xspeed_check(p, sfunc, n) X char *p; X void (*sfunc)(); X int n; X{ X struct tms tm1; X struct tms tm2; X X times(&tm1); X (*sfunc)(p, n); X times(&tm2); X X#ifdef DEBUG X fprintf(stderr, "t1: %ld\n", (long)tm2.tms_utime-tm1.tms_utime); X#endif X X return ((int)tm2.tms_utime-tm1.tms_utime); X} X X#endif /* CHECK_ALIGN */ X X#ifdef OFF_ALIGN X/* X * Routines to compute the alignement by using the knowledge X * of the C-compiler. X * We define a structure and check the padding that has been inserted X * by the compiler to keep the apropriate type on a properly aligned X * address. X */ XLOCAL int used_var; XLOCAL void Xused(i) X int i; X{ X used_var = i; X} X XLOCAL int Xoff_short() X{ X struct ss { X char c; X short s; X } ss; X ss.c = 0; /* fool C-compiler */ X used(ss.c); X X return (sm_off(struct ss *, s)); X} X XLOCAL int Xoff_int() X{ X struct si { X char c; X int i; X } si; X si.c = 0; /* fool C-compiler */ X used(si.c); X X return (sm_off(struct si *, i)); X} X XLOCAL int Xoff_long() X{ X struct sl { X char c; X long l; X } sl; X sl.c = 0; /* fool C-compiler */ X used(sl.c); X X return (sm_off(struct sl *, l)); X} X X#ifdef HAVE_LONGLONG XLOCAL int Xoff_longlong() X{ X struct sll { X char c; X Llong ll; X } sll; X sll.c = 0; /* fool C-compiler */ X used(sll.c); X X return (sm_off(struct sll *, ll)); X} X#endif X XLOCAL int Xoff_float() X{ X struct sf { X char c; X float f; X } sf; X sf.c = 0; /* fool C-compiler */ X used(sf.c); X X return (sm_off(struct sf *, f)); X} X XLOCAL int Xoff_double() X{ X struct sd { X char c; X double d; X } sd; X sd.c = 0; /* fool C-compiler */ X used(sd.c); X X return (sm_off(struct sd *, d)); X} X X#ifdef HAVE_LONGDOUBLE XLOCAL int Xoff_ldouble() X{ X struct sd { X char c; X long double ld; X } sd; X sd.c = 0; /* fool C-compiler */ X used(sd.c); X X return (sm_off(struct sd *, ld)); X} X#endif X XLOCAL int Xoff_ptr() X{ X struct sp { X char c; X char *p; X } sp; X sp.c = 0; /* fool C-compiler */ X used(sp.c); X X return (sm_off(struct sp *, p)); X} X X#endif /* OFF_ALIGN */ END-of-star-1.6/inc/align_test.c echo x - star-1.6/inc/align_test.mk sed 's/^X//' >star-1.6/inc/align_test.mk << 'END-of-star-1.6/inc/align_test.mk' X#ident @(#)align_test.mk 1.2 06/10/31 X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily/$(OARCH) XTARGET= align.h XTARGETC= align_test XCPPOPTS += -D__OPRINTF__ XCFILES= align_test.c X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.inc X########################################################################### END-of-star-1.6/inc/align_test.mk echo x - star-1.6/inc/avoffset.c sed 's/^X//' >star-1.6/inc/avoffset.c << 'END-of-star-1.6/inc/avoffset.c' X/* @(#)avoffset.c 1.35 17/08/01 Copyright 1987, 1995-2017 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)avoffset.c 1.35 17/08/01 Copyright 1987, 1995-2017 J. Schilling"; X#endif X/* X * This program is a tool to generate the file "avoffset.h". X * It is used by functions that trace the stack to get to the top of the stack. X * X * It generates two defines: X * AV_OFFSET - offset of argv relative to the main() frame pointer X * FP_INDIR - number of stack frames above main() X * before encountering a NULL pointer. X * X * Copyright (c) 1987, 1995-2017 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X X#ifdef HAVE_SCANSTACK X# include X#endif X XLOCAL RETSIGTYPE handler __PR((int signo)); XEXPORT int main __PR((int ac, char **av)); XLOCAL int stack_direction __PR((long *lp)); X XLOCAL RETSIGTYPE Xhandler(signo) X int signo; X{ X fprintf(stderr, "Warning: Cannot scan stack on this environment.\n"); X X printf("\n#endif /* __AVOFFSET_H */\n"); X fflush(stdout); X exit(0); X} X X Xint Xmain(ac, av) X int ac; X char **av; X{ X int stdir; X#ifdef HAVE_SCANSTACK X register struct frame *fp; X register int i = 0; X register int o = 0; X X /* X * As the SCO OpenServer C-Compiler has a bug that may cause X * the first function call to getfp() been done before the X * new stack frame is created, we call getfp() twice. X */ X (void) getfp(); X fp = (struct frame *)getfp(); X#endif X X#ifdef SIGBUS X signal(SIGBUS, handler); X#endif X signal(SIGSEGV, handler); X#ifdef SIGILL X signal(SIGILL, handler); /* For gcc -m64/sparc on FreeBSD */ X#endif X X printf("/*\n"); X printf(" * This file has been generated automatically\n"); X printf(" * by %s\n", sccsid); X printf(" * do not edit by hand.\n"); X printf(" *\n"); X printf(" * This file includes definitions for AV_OFFSET and FP_INDIR.\n"); X printf(" * FP_INDIR is the number of fp chain elements above 'main'.\n"); X printf(" * AV_OFFSET is the offset of &av[0] relative to the frame pointer in 'main'.\n"); X printf(" *\n"); X printf(" * If getav0() does not work on a specific architecture\n"); X printf(" * the program which generated this include file may dump core.\n"); X printf(" * In this case, the generated include file does not include\n"); X printf(" * definitions for AV_OFFSET and FP_INDIR but ends after this comment.\n"); X printf(" * If AV_OFFSET or FP_INDIR are missing in this file, all programs\n"); X printf(" * which use the definitions are automatically disabled.\n"); X printf(" */\n"); X printf("#ifndef __AVOFFSET_H\n"); X printf("#define __AVOFFSET_H\n\n"); X X stdir = stack_direction(0); X printf("#define STACK_DIRECTION %d\n", stdir); X fflush(stdout); X X#ifdef HAVE_SCANSTACK X /* X * Note: Scanning the stack to look for argc/argv X * works only in the main thread. X * X * llvm-gcc-4.2 has a bug and creates an endless loop if we call: X * while (fp->fr_savfp) { X * We now try to limit this to 1000 loops in hope that the bug X * does not affect the new code extended as well. X */ X while (i <= 1000 && fp->fr_savfp) { X /* X * Workaround for the still buggy clang... X * clang version 4.0.0 on ARM64 FreeBSD has become worse. X * If we do not have the strange write() call, this loop X * becomes an endless loop and the last line in the loop X * is never touched. X */ X write(-1, "", 0); X if (fp->fr_savpc == 0) X break; X X fp = (struct frame *)fp->fr_savfp; X X i++; X } X /* X * Do not add any printf()'s before this line to allow avoffset X * to abort without printing more than the comment above. X */ X fp = (struct frame *)getfp(); X o = ((char *)av) - ((char *)fp); X if ((o % sizeof (char *)) != 0) { X fprintf(stderr, "AV_OFFSET value (%d) not a multiple of pointer size.\n", o); X fprintf(stderr, "Disabling scanning the stack.\n"); X X printf("\n#endif /* __AVOFFSET_H */\n"); X exit(0); X } X if (o < -1000 || o > 1000) { X fprintf(stderr, "AV_OFFSET value (%d) does not look reasonable.\n", o); X fprintf(stderr, "Disabling scanning the stack.\n"); X X printf("\n#endif /* __AVOFFSET_H */\n"); X exit(0); X } X if (i > 1000) { X fprintf(stderr, "FP_INDIR value (%d) does not look reasonable.\n", i); X fprintf(stderr, "Disabling scanning the stack.\n"); X X printf("\n#endif /* __AVOFFSET_H */\n"); X exit(0); X } X printf("#define AV_OFFSET %d\n", o); X printf("#define FP_INDIR %d\n", i); X#endif X printf("\n#endif /* __AVOFFSET_H */\n"); X fflush(stdout); X exit(0); X return (0); /* keep lint happy */ X} X X#if __clang__ || (__GNUC__ > 3 || __GNUC__ == 3 && __GNUC_MINOR__ >= 2) X#define __NO_INL__ __attribute__((noinline)) X#else X#define __NO_INL__ X#endif X XLOCAL int __NO_INL__ Xstack_direction(lp) X long *lp; X{ X auto long *dummy[4]; X int i; X X for (i = 0; i < 4; i++) X dummy[i] = lp; X X if (lp == 0) { X return (stack_direction((long *)dummy)); X } else { X if ((long *)dummy == lp) X return (0); X return (((long *)dummy > lp) ? 1 : -1); X } X} X X#ifdef HAVE_SCANSTACK X#define IS_AVOFFSET X#include "getfp.c" X#endif END-of-star-1.6/inc/avoffset.c echo x - star-1.6/inc/avoffset.mk sed 's/^X//' >star-1.6/inc/avoffset.mk << 'END-of-star-1.6/inc/avoffset.mk' X#ident @(#)avoffset.mk 1.3 18/04/09 X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include/schily/$(OARCH) XTARGET= avoffset.h XTARGETC= avoffset XCPPOPTS += -DUSE_SCANSTACK XCPPOPTS += -D__OPRINTF__ XCFILES= avoffset.c fpoff.c X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.inc X########################################################################### END-of-star-1.6/inc/avoffset.mk echo x - star-1.6/inc/getfp.c sed 's/^X//' >star-1.6/inc/getfp.c << 'END-of-star-1.6/inc/getfp.c' X/* @(#)getfp.c 1.20 18/04/09 Copyright 1988-2018 J. Schilling */ X/* X * Get frame pointer X * X * Copyright (c) 1988-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X X#ifndef IS_AVOFFSET X/* X * We usually don't like to compile a getfp() that returns junk data in case X * we cannot scan the stack. X * The only way to find this out is by including avoffset.h. Unfortunately, we X * need to be able to use getfp() from avoffset.c in order to check if the X * return value is usable or junk. To be able to do this, we include getfp.c X * from avoffset.c and define IS_AVOFFSET before. X */ X#include X X#if !defined(AV_OFFSET) || !defined(FP_INDIR) X# ifdef HAVE_SCANSTACK X# undef HAVE_SCANSTACK X# endif X#endif X#endif X X#ifdef HAVE_SCANSTACK X#include X X#define MAXWINDOWS 32 X#define NWINDOWS 7 X X#if defined(sparc) && defined(__GNUC__) X# define FP_OFF 0x10 /* some strange things on sparc gcc */ X#else X# define FP_OFF 0 X#endif X X#if defined(__clang__) || \ X (defined(__GNUC__) && \ X ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ > 7))) X#define ATTRIBUTE_NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address)) X#else X#define ATTRIBUTE_NO_SANITIZE_ADDRESS X#endif X XEXPORT void **___fpoff __PR((char *cp)); X XATTRIBUTE_NO_SANITIZE_ADDRESS XEXPORT void ** Xgetfp() X{ X long **dummy[1]; X X#ifdef sparc X flush_reg_windows(MAXWINDOWS-2); X#endif X return ((void **)((struct frame *)___fpoff((char *)&dummy[0]))->fr_savfp); X} X X#ifdef sparc XEXPORT int Xflush_reg_windows(n) X int n; X{ X if (--n > 0) X flush_reg_windows(n); X return (0); X} X#endif X X#else /* HAVE_SCANSTACK */ X XEXPORT void ** Xgetfp() X{ X raisecond("getfp", 0); X return ((void **)0); X} X X#endif /* HAVE_SCANSTACK */ END-of-star-1.6/inc/getfp.c echo x - star-1.6/inc/README sed 's/^X//' >star-1.6/inc/README << 'END-of-star-1.6/inc/README' XThe programs 'smake and 'star' are of strategic importance for portability. X XAt least for these programs, getfp.c should be a copy rather than a link. X XOnce you have star running on a system with no symlinks, you may use star Xto create copies rather than links. END-of-star-1.6/inc/README echo x - star-1.6/inc/MKLINKS sed 's/^X//' >star-1.6/inc/MKLINKS << 'END-of-star-1.6/inc/MKLINKS' X#!/bin/sh X########################################################################### X#ident "@(#)MKLINKS 1.4 18/04/09 " X########################################################################### X# Written 2008-2011 by J. Schilling X########################################################################### X# Copyright (c) 2008-2011 J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xsymlink="ln -s" XMKLINKS_TEST=${MKLINKS_TEST-:} Xif [ ".$MKLINKS_COPY" = '.' ]; then X rm -f xxzzy.123 xxzzy.345 X echo test > xxzzy.123 X $symlink xxzzy.123 xxzzy.345 X test $? = 0 || symlink=cp X test -r xxzzy.345 || symlink=cp X ${MKLINKS_TEST} -h xxzzy.345 || symlink=cp X rm -f xxzzy.123 xxzzy.345 Xelse X symlink=cp Xfi X########################################################################### X X$symlink ../lib/align_test.c . X$symlink ../lib/avoffset.c . X$symlink ../lib/getfp.c . X$symlink ../lib/fpoff.c . END-of-star-1.6/inc/MKLINKS echo x - star-1.6/inc/fpoff.c sed 's/^X//' >star-1.6/inc/fpoff.c << 'END-of-star-1.6/inc/fpoff.c' X/* @(#)fpoff.c 1.20 18/04/09 Copyright 1988-2018 J. Schilling */ X/* X * Get frame pointer offset X * X * Copyright (c) 1988-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X X#if defined(sparc) && defined(__GNUC__) X# define FP_OFF 0x10 /* some strange things on sparc gcc */ X#else X# define FP_OFF 0 X#endif X XEXPORT void **___fpoff __PR((char *cp)); X X/* X * Don't make it static to avoid inline optimization. X * X * We need this function to fool GCCs check for returning addresses X * from outside the functions local address space. X */ XEXPORT void ** X___fpoff(cp) X char *cp; X{ X long ***lp; X X lp = (long ***)(cp + FP_OFF); X lp++; X return ((void **)lp); X} END-of-star-1.6/inc/fpoff.c echo c - star-1.6/rmt mkdir -p star-1.6/rmt > /dev/null 2>&1 echo x - star-1.6/rmt/Makefile sed 's/^X//' >star-1.6/rmt/Makefile << 'END-of-star-1.6/rmt/Makefile' X#ident @(#)Makefile 1.5 11/04/15 X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= sbin XTARGET= rmt XCPPOPTS += -DUSE_REMOTE XCPPOPTS += -DUSE_LARGEFILES XCFILES= rmt.c X#HFILES= XLIBS= -ldeflt -lschily $(LIB_SOCKET) XXMK_FILE= Makefile.man Makefile.dfl Makefile.doc X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.cmd X########################################################################### Xcount: $(CFILES) $(HFILES) X count $r1 X END-of-star-1.6/rmt/Makefile echo x - star-1.6/rmt/rmt.c sed 's/^X//' >star-1.6/rmt/rmt.c << 'END-of-star-1.6/rmt/rmt.c' X/* @(#)rmt.c 1.38 18/06/09 Copyright 1994,2000-2018 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)rmt.c 1.38 18/06/09 Copyright 1994,2000-2018 J. Schilling"; X#endif X/* X * Remote tape server X * Supports both the old BSD format and the new abstract Sun format X * which is called RMT V1 protocol. X * X * A client that likes to use the enhanced features of the RMT V1 protocol X * needs to send a "I-1\n0\n" request directly after opening the remote X * file using the 'O' rmt command. X * If the client requests the new protocol, MTIOCTOP ioctl opcodes X * in the range 0..7 are mapped to the BSD values to prevent problems X * from Linux opcode incompatibility. X * X * The open modes support an abstract string notation found in rmt.c from X * GNU. This makes it possible to use more than O_RDONLY|O_WRONLY|O_RDWR X * with open(). MTIOCTOP tape ops could be enhanced the same way, but it X * seems that the current interface supports all what we need over the X * wire. X * X * Copyright (c) 1994,2000-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X/*#define FORCE_DEBUG*/ X X#include X#include X#include /* includes sys/types.h */ X#include X#include X#include X#include X#include /* BSD-4.2 & Linux need this for MAXHOSTNAMELEN */ X#include X#include X#include X#include X X#include X#include X#include X#include X#include X#include X#include /* BeOS does not have */ X /* but inet_ntaoa() is in */ X#include X X#if (!defined(HAVE_NETDB_H) || !defined(HAVE_SYS_SOCKET_H)) X#undef USE_REMOTE X#endif X XEXPORT int main __PR((int argc, char **argv)); X#ifdef USE_REMOTE XLOCAL void checkuser __PR((void)); XLOCAL char *getpeer __PR((void)); XLOCAL BOOL checkaccess __PR((char *device)); XLOCAL BOOL strmatch __PR((char *str, char *pat)); XLOCAL void dormt __PR((void)); XLOCAL void opentape __PR((void)); XLOCAL int rmtoflags __PR((char *omode)); XLOCAL void closetape __PR((void)); XLOCAL void readtape __PR((void)); XLOCAL void writetape __PR((void)); XLOCAL void ioctape __PR((int cmd)); X#ifdef HAVE_SYS_MTIO_H XLOCAL int rmtmapold __PR((int cmd)); XLOCAL int rmtmapnew __PR((int cmd)); X#endif XLOCAL void statustape __PR((int cmd)); XLOCAL void seektape __PR((void)); XLOCAL void doversion __PR((void)); XLOCAL int fillrdbuf __PR((void)); XLOCAL void tryfillrdbuf __PR((void)); XLOCAL int readchar __PR((char *cp)); XLOCAL void readbuf __PR((char *buf, int n)); XLOCAL int readarg __PR((char *buf, int n)); XLOCAL char * preparebuffer __PR((int size)); XLOCAL int checktape __PR((char *device)); XLOCAL BOOL has_dotdot __PR((char *name)); XLOCAL void rmtrespond __PR((long ret, int err)); XLOCAL void rmterror __PR((char *str)); X X#define CMD_SIZE 80 X XLOCAL char *username; XLOCAL char *peername; X XLOCAL int tape_fd = -1; X XLOCAL char *debug_name; XLOCAL FILE *debug_file; XLOCAL BOOL found_dfltfile; X X#define DEBUG(fmt) if (debug_file) js_fprintf(debug_file, fmt) X#define DEBUG1(fmt, a) if (debug_file) js_fprintf(debug_file, fmt, a) X#define DEBUG2(fmt, a1, a2) if (debug_file) js_fprintf(debug_file, fmt, a1, a2) X#define DEBUG3(fmt, a1, a2, a3) if (debug_file) js_fprintf(debug_file, fmt, a1, a2, a3) X#define DEBUG4(fmt, a1, a2, a3, a4) if (debug_file) js_fprintf(debug_file, fmt, a1, a2, a3, a4) X#endif /* USE_REMOTE */ X XEXPORT int Xmain(argc, argv) X int argc; X char **argv; X{ X save_args(argc, argv); X#ifndef USE_REMOTE X comerrno(EX_BAD, "No remote TAPE support on this platform.\n"); X#else X argc--, argv++; X if (argc > 0 && strcmp(*argv, "-c") == 0) { X /* X * Skip params in case we have been installed/called as shell. X */ X argc--, argv++; X argc--, argv++; X } X /* X * If we are running as root (uid 0), the existence of /etc/default/rmt X * is required. If our uid is != 0 and there is no /etc/default/rmt X * we will only allow to access files in /dev (see below). X * X * WARNING you are only allowed to change the defaults configuration X * filename if you also change the documentation and add a statement X * that makes clear where the official location of the file is, why you X * did choose a nonstandard location and that the nonstandard location X * only refers to inofficial rmt versions. X * X * I was forced to add this because some people change cdrecord without X * rational reason and then publish the result. As those people X * don't contribute work and don't give support, they are causing extra X * work for me and this way slow down the development. X */ X if (defltopen("/etc/default/rmt") < 0) { X if (geteuid() == 0) { X rmterror("Remote configuration error: Cannot open /etc/default/rmt"); X exit(EX_BAD); X } X } else { X found_dfltfile = TRUE; X } X debug_name = defltread("DEBUG="); /* Get debug file name */ X#ifdef FORCE_DEBUG X if (debug_name == NULL && argc <= 0) X debug_name = "/tmp/RMT"; X#endif X#ifdef NONONO X /* X * Allowing to write arbitrary files may be a security risk. X */ X if (argc > 0) X debug_name = *argv; X#endif X X if (debug_name != NULL) X debug_file = fopen(debug_name, "w"); X X if (argc > 0) { X if (debug_file == 0) { X rmtrespond((long)-1, geterrno()); X exit(EX_BAD); X } X (void) setbuf(debug_file, (char *)0); X } X checkuser(); /* Check if we are called by a bad guy */ X peername = getpeer(); /* Get host name of caller */ X dormt(); X#endif /* USE_REMOTE */ X return (0); X} X X#ifdef USE_REMOTE XLOCAL void Xcheckuser() X{ X uid_t uid = getuid(); X char *uname; X struct passwd *pw; X X pw = getpwuid(uid); X if (pw == NULL) X goto notfound; X X username = pw->pw_name; X X /* X * If no /etc/default/rmt could be found allow general access. X */ X if (!found_dfltfile) X return; X X defltfirst(); X while ((uname = defltnext("USER=")) != NULL) { X if (strmatch(username, uname)) X return; X } Xnotfound: X rmterror("Illegal user id for RMT server"); X exit(EX_BAD); X} X X#ifndef NI_MAXHOST X#ifdef MAXHOSTNAMELEN /* XXX remove this and sys/param.h */ X#define NI_MAXHOST MAXHOSTNAMELEN X#else X#define NI_MAXHOST 64 X#endif X#endif X XLOCAL char * Xgetpeer() X{ X#ifdef HAVE_GETNAMEINFO X#ifdef HAVE_SOCKADDR_STORAGE X struct sockaddr_storage sa; X#else X char sa[256]; X#endif X#else X struct sockaddr sa; X struct hostent *he; X#endif X struct sockaddr *sap; X struct sockaddr_in *s; X socklen_t sasize = sizeof (sa); Xstatic char buffer[NI_MAXHOST]; X X sap = (struct sockaddr *)&sa; X if (getpeername(STDIN_FILENO, sap, &sasize) < 0) { X int errsav = geterrno(); X struct stat sb; X X if (fstat(STDIN_FILENO, &sb) >= 0) { X if (S_ISFIFO(sb.st_mode)) { X DEBUG("rmt: stdin is a PIPE\n"); X return ("PIPE"); X } X DEBUG1("rmt: stdin st_mode %0llo\n", (Llong)sb.st_mode); X } X X DEBUG1("rmt: peername %s\n", errmsgstr(errsav)); X return ("ILLEGAL_SOCKET"); X } else { X s = (struct sockaddr_in *)&sa; X#ifdef AF_INET6 X if (s->sin_family != AF_INET && s->sin_family != AF_INET6) { X#else X if (s->sin_family != AF_INET) { X#endif X#ifdef AF_UNIX X /* X * AF_UNIX is not defined on BeOS X */ X if (s->sin_family == AF_UNIX) { X DEBUG("rmt: stdin is a PIPE (UNIX domain socket)\n"); X return ("PIPE"); X } X#endif X DEBUG1("rmt: stdin NOT_IP socket (sin_family: %d)\n", X s->sin_family); X return ("NOT_IP"); X } X X#ifdef HAVE_GETNAMEINFO X buffer[0] = '\0'; X if (debug_file && X getnameinfo(sap, sasize, buffer, sizeof (buffer), NULL, 0, X NI_NUMERICHOST) == 0) { X DEBUG1("rmt: peername %s\n", buffer); X } X buffer[0] = '\0'; X if (getnameinfo(sap, sasize, buffer, sizeof (buffer), NULL, 0, X 0) == 0) { X DEBUG1("rmt: peername %s\n", buffer); X return (buffer); X } X return ("CANNOT_MAP_ADDRESS"); X#else /* HAVE_GETNAMEINFO */ X#ifdef HAVE_INET_NTOA X (void) js_snprintf(buffer, sizeof (buffer), "%s", X inet_ntoa(s->sin_addr)); X#else X (void) js_snprintf(buffer, sizeof (buffer), "%x", X s->sin_addr.s_addr); X#endif X DEBUG1("rmt: peername %s\n", buffer); X he = gethostbyaddr((char *)&s->sin_addr.s_addr, 4, AF_INET); X DEBUG1("rmt: peername %s\n", he != NULL ? he->h_name:buffer); X if (he != NULL) X return (he->h_name); X return (buffer); X#endif /* HAVE_GETNAMEINFO */ X } X} X XLOCAL BOOL Xcheckaccess(device) X char *device; X{ X char *target; X char *user; X char *host; X char *fname; X char *p; X X if (peername == NULL) X return (FALSE); X defltfirst(); X while ((target = defltnext("ACCESS=")) != NULL) { X p = target; X while (*p == '\t') X p++; X user = p; X if ((p = strchr(p, '\t')) != NULL) X *p++ = '\0'; X else X continue; X if (!strmatch(username, user)) X continue; X X while (*p == '\t') X p++; X host = p; X if ((p = strchr(p, '\t')) != NULL) X *p++ = '\0'; X else X continue; X if (!strmatch(peername, host)) X continue; X X fname = p; X if ((p = strchr(p, '\t')) != NULL) X *p++ = '\0'; X X DEBUG3("ACCESS %s %s %s\n", user, host, fname); X X if (has_dotdot(device)) /* Do not allow ".." in name */ X continue; X if (!strmatch(device, fname)) X continue; X return (TRUE); X } X return (FALSE); X} X XLOCAL BOOL Xstrmatch(str, pat) X char *str; X char *pat; X{ X int *aux; X int *state; X int alt; X int plen; X char *p; X X plen = strlen(pat); X aux = malloc(plen*sizeof (int)); X state = malloc((plen+1)*sizeof (int)); X if (aux == NULL || state == NULL) { X if (aux) free(aux); X if (state) free(state); X return (FALSE); X } X X if ((alt = patcompile((const unsigned char *)pat, plen, aux)) == 0) { X /* Bad pattern */ X free(aux); X free(state); X return (FALSE); X } X X p = (char *)patmatch((const unsigned char *)pat, aux, X (const unsigned char *)str, 0, X strlen(str), alt, state); X free(aux); X free(state); X X if (p != NULL && *p == '\0') X return (TRUE); X return (FALSE); X} X X/* X * The main work loop X */ XLOCAL void Xdormt() X{ X char c; X X while (readchar(&c) == 1) { X seterrno(0); X X switch (c) { X X case 'O': X opentape(); X break; X case 'C': X closetape(); X break; X case 'R': X readtape(); X break; X case 'W': X writetape(); X break; X case 'I': X case 'i': X ioctape(c); X break; X case 'S': X case 's': X statustape(c); X break; X case 'L': X seektape(); X break; X /* X * It would be nice to have something like 'V' for retrieving X * Version information. But unfortunately newer BSD rmt version X * implement this command in a way that is not useful at all. X */ X case 'v': X doversion(); X break; X default: X DEBUG1("rmtd: garbage command %c\n", c); X rmterror("Garbage command"); X exit(EX_BAD); X } X } X exit(0); X} X XLOCAL void Xopentape() X{ X char device[4096]; X char omode[CMD_SIZE]; X int omodes; X int n; X X if (tape_fd >= 0) X (void) close(tape_fd); X X n = readarg(device, sizeof (device)); X if (n < 0 || n >= sizeof (device)) { /* Try to recover */ X readarg(omode, sizeof (omode)); /* honor protocol */ X DEBUG2("rmtd: O %s %s\n", device, omode); X#ifdef ENAMETOOLONG X seterrno(ENAMETOOLONG); X#else X seterrno(EINVAL); X#endif X goto out; X } X readarg(omode, sizeof (omode)); X omodes = rmtoflags(omode); X if (omodes == -1) { X /* X * Mask off all bits that differ between operating systems. X */ X omodes = atoi(omode); X omodes &= (O_RDONLY|O_WRONLY|O_RDWR); X } X#ifdef O_TEXT X /* X * Default to O_BINARY the client may not know that we need it. X */ X if ((omodes & O_TEXT) == 0) X omodes |= O_BINARY; X#endif X DEBUG2("rmtd: O %s %s\n", device, omode); X if (!checktape(device)) { X tape_fd = -1; X seterrno(EACCES); X } else { X tape_fd = open(device, omodes, (mode_t)0666); X } Xout: X rmtrespond((long)tape_fd, geterrno()); X} X XLOCAL struct oflags { X char *fname; X int fval; X} oflags[] = { X { "O_RDONLY", O_RDONLY }, X { "O_RDWR", O_RDWR }, X { "O_WRONLY", O_WRONLY }, X#ifdef O_TEXT X { "O_TEXT", O_TEXT }, X#endif X#ifdef O_NDELAY X { "O_NDELAY", O_NDELAY }, X#endif X#ifdef O_APPEND X { "O_APPEND", O_APPEND }, X#endif X#ifdef O_SYNC X { "O_SYNC", O_SYNC }, X#endif X#ifdef O_DSYNC X { "O_DSYNC", O_DSYNC }, X#endif X#ifdef O_RSYNC X { "O_RSYNC", O_RSYNC }, X#endif X#ifdef O_NONBLOCK X { "O_NONBLOCK", O_NONBLOCK }, X#endif X#ifdef O_PRIV X { "O_PRIV", O_PRIV }, X#endif X#ifdef O_LARGEFILE X { "O_LARGEFILE",O_LARGEFILE }, X#endif X#ifdef O_CREAT X { "O_CREAT", O_CREAT }, X#endif X#ifdef O_TRUNC X { "O_TRUNC", O_TRUNC }, X#endif X#ifdef O_EXCL X { "O_EXCL", O_EXCL }, X#endif X#ifdef O_NOCTTY X { "O_NOCTTY", O_NOCTTY }, X#endif X { NULL, 0 } X}; X XLOCAL int Xrmtoflags(omode) X char *omode; X{ X register char *p = omode; X register struct oflags *op; X register int slen; X register int nmodes = 0; X X /* X * First skip numeric open modes... X */ X while (*p != '\0' && *p == ' ') X p++; X if (*p != 'O') while (*p != '\0' && *p != ' ') X p++; X while (*p != '\0' && *p != 'O') X p++; X do { X if (p[0] != 'O' || p[1] != '_') X return (-1); X X for (op = oflags; op->fname; op++) { X slen = strlen(op->fname); X if ((strncmp(op->fname, p, slen) == 0) && X (p[slen] == '|' || p[slen] == ' ' || X p[slen] == '\0')) { X nmodes |= op->fval; X break; X } X } X p = strchr(p, '|'); X } while (p && *p++ == '|'); X X return (nmodes); X} X XLOCAL void Xclosetape() X{ X int ret; X char device[CMD_SIZE]; X X DEBUG("rmtd: C\n"); X readarg(device, sizeof (device)); X ret = close(tape_fd); X rmtrespond((long)ret, geterrno()); X tape_fd = -1; X} X XLOCAL void Xreadtape() X{ X int n; X long ret; X char *buf; X char count[CMD_SIZE]; X X readarg(count, sizeof (count)); X DEBUG1("rmtd: R %s\n", count); X n = atoi(count); /* Only an int because of setsockopt */ X buf = preparebuffer(n); X ret = _niread(tape_fd, buf, n); X rmtrespond(ret, geterrno()); X if (ret >= 0) { X (void) _nixwrite(STDOUT_FILENO, buf, ret); X } X} X XLOCAL void Xwritetape() X{ X int n; X long ret; X char *buf; X char count[CMD_SIZE]; X X readarg(count, sizeof (count)); X n = atoi(count); /* Only an int because of setsockopt */ X DEBUG1("rmtd: W %s\n", count); X buf = preparebuffer(n); X readbuf(buf, n); X ret = _niwrite(tape_fd, buf, n); X rmtrespond(ret, geterrno()); X} X X/* X * Definitions for the new RMT Protocol version 1 X * X * The new Protocol version tries to make the use X * of rmtioctl() more portable between different platforms. X */ X#define RMTIVERSION -1 X#define RMT_VERSION 1 X X/* X * Support for commands beyond MTWEOF..MTNOP (0..7) X */ X#define RMTICACHE 0 X#define RMTINOCACHE 1 X#define RMTIRETEN 2 X#define RMTIERASE 3 X#define RMTIEOM 4 X#define RMTINBSF 5 X X#ifndef HAVE_SYS_MTIO_H XLOCAL void Xioctape(cmd) X int cmd; X{ X char count[CMD_SIZE]; X char opcode[CMD_SIZE]; X X readarg(opcode, sizeof (opcode)); X readarg(count, sizeof (count)); X DEBUG3("rmtd: %c %s %s\n", cmd, opcode, count); X if (atoi(opcode) == RMTIVERSION) { X rmtrespond((long)RMT_VERSION, 0); X } else { X rmtrespond((long)-1, ENOTTY); X } X} X#else X XLOCAL void Xioctape(cmd) X int cmd; X{ X long ret = 0; X int i; X char count[CMD_SIZE]; X char opcode[CMD_SIZE]; X struct mtop mtop; Xstatic BOOL version_seen = FALSE; X X readarg(opcode, sizeof (opcode)); X readarg(count, sizeof (count)); X DEBUG3("rmtd: %c %s %s\n", cmd, opcode, count); X mtop.mt_op = atoi(opcode); X ret = atol(count); X mtop.mt_count = ret; X if (mtop.mt_count != ret) { X rmtrespond((long)-1, EINVAL); X return; X } X X /* X * Only Opcodes 0..7 are unique across different architectures. X * But as in many cases Linux does not even follow this rule. X * If we know that we have been called by a VERSION 1 client, X * we may safely assume that the client is not using Linux mapping X * but the standard mapping when sending mt_op numbers over the wire. X */ X ret = 0; X if (cmd == 'I' && version_seen && (mtop.mt_op != RMTIVERSION)) { X i = rmtmapold(mtop.mt_op); X if (i < 0) { X /* X * Should we rather give it a chance instead X * of aborting the command? X */ X rmtrespond((long)-1, EINVAL); X return; X } X mtop.mt_op = i; X } X if (cmd == 'i') { X i = rmtmapnew(mtop.mt_op); X if (i < 0) { X ret = -1; X seterrno(EINVAL); X } else { X mtop.mt_op = i; X } X } X DEBUG4("rmtd: %c %d %ld ret: %ld (mapped)\n", cmd, mtop.mt_op, X (long)mtop.mt_count, ret); X if (ret == 0) { X if (mtop.mt_op == RMTIVERSION) { X /* X * Client must retrieve RMTIVERSION directly after X * opening the drive using the 'O' rmt command. X */ X ret = mtop.mt_count = RMT_VERSION; X version_seen = TRUE; X } else { X ret = ioctl(tape_fd, MTIOCTOP, (char *)&mtop); X } X } X if (ret < 0) { X rmtrespond(ret, geterrno()); X } else { X ret = mtop.mt_count; X rmtrespond(ret, geterrno()); X } X} X X/* X * Map all old /etc/rmt (over the wire) opcodes that should be in range 0..7 X * to numbers that are understood by the local driver. X * This is needed because Linux does not follow the UNIX conventions and X * uses an incompatible opcode mapping even in the range 0..7. X */ XLOCAL int Xrmtmapold(cmd) X int cmd; X{ X switch (cmd) { X X case 0: X#ifdef MTWEOF X return (MTWEOF); X#else X return (-1); X#endif X X case 1: X#ifdef MTFSF X return (MTFSF); X#else X return (-1); X#endif X X case 2: X#ifdef MTBSF X return (MTBSF); X#else X return (-1); X#endif X X case 3: X#ifdef MTFSR X return (MTFSR); X#else X return (-1); X#endif X X case 4: X#ifdef MTBSR X return (MTBSR); X#else X return (-1); X#endif X X case 5: X#ifdef MTREW X return (MTREW); X#else X return (-1); X#endif X X case 6: X#ifdef MTOFFL X return (MTOFFL); X#else X return (-1); X#endif X X case 7: X#ifdef MTNOP X return (MTNOP); X#else X return (-1); X#endif X X } X return (-1); X} X X/* X * Map all new /etc/rmt (over the wire) opcodes from 'i' command X * to numbers that are understood by the local driver. X */ XLOCAL int Xrmtmapnew(cmd) X int cmd; X{ X switch (cmd) { X X#ifdef MTCACHE X case RMTICACHE: return (MTCACHE); X#endif X#ifdef MTNOCACHE X case RMTINOCACHE: return (MTNOCACHE); X#endif X#ifdef MTRETEN X case RMTIRETEN: return (MTRETEN); X#endif X#ifdef MTERASE X case RMTIERASE: return (MTERASE); X#endif X#ifdef MTEOM X case RMTIEOM: return (MTEOM); X#endif X#ifdef MTNBSF X case RMTINBSF: return (MTNBSF); X#endif X } X return (-1); X} X#endif X X/* X * Old MTIOCGET copies a binary version of struct mtget back X * over the wire. This is highly non portable. X * MTS_* retrieves ascii versions (%d format) of a single X * field in the struct mtget. X * NOTE: MTS_ERREG may only be valid on the first call and X * must be retrived first. X */ X#define MTS_TYPE 'T' /* mtget.mt_type */ X#define MTS_DSREG 'D' /* mtget.mt_dsreg */ X#define MTS_ERREG 'E' /* mtget.mt_erreg */ X#define MTS_RESID 'R' /* mtget.mt_resid */ X#define MTS_FILENO 'F' /* mtget.mt_fileno */ X#define MTS_BLKNO 'B' /* mtget.mt_blkno */ X#define MTS_FLAGS 'f' /* mtget.mt_flags */ X#define MTS_BF 'b' /* mtget.mt_bf */ X X#ifndef HAVE_SYS_MTIO_H XLOCAL void Xstatustape(cmd) X int cmd; X{ X char subcmd; X X if (cmd == 's') { X if (readchar(&subcmd) != 1) X return; X DEBUG2("rmtd: %c%c\n", cmd, subcmd); X } else { X DEBUG1("rmtd: %c\n", cmd); X } X rmtrespond((long)-1, ENOTTY); X} X#else X XLOCAL void Xstatustape(cmd) X int cmd; X{ X int ret; X char subcmd; X struct mtget mtget; X X /* X * Only the first three fields of the struct mtget (mt_type, mt_dsreg X * and mt_erreg) are identical on all platforms. The original struct X * mtget is 16 bytes. All client implementations except the one from X * star will overwrite other data and probably die if the remote struct X * mtget is bigger than the local one. X * In addition, there are byte order problems. X */ X if (cmd == 's') { X if (readchar(&subcmd) != 1) X return; X DEBUG2("rmtd: %c%c\n", cmd, subcmd); X } else { X DEBUG1("rmtd: %c\n", cmd); X } X ret = ioctl(tape_fd, MTIOCGET, (char *)&mtget); X if (ret < 0) { X rmtrespond((long)ret, geterrno()); X } else { X if (cmd == 's') switch (subcmd) { X X#ifdef HAVE_MTGET_TYPE X case MTS_TYPE: X rmtrespond(mtget.mt_type, geterrno()); break; X#endif X#ifdef HAVE_MTGET_DSREG X case MTS_DSREG: X rmtrespond(mtget.mt_dsreg, geterrno()); break; X#endif X#ifdef HAVE_MTGET_ERREG X /* X * This must be retrieved first, as it contains an error X * code that is cleared after issuing the ioctl(). X */ X case MTS_ERREG: X rmtrespond(mtget.mt_erreg, geterrno()); break; X#endif X#ifdef HAVE_MTGET_RESID X case MTS_RESID: X rmtrespond(mtget.mt_resid, geterrno()); break; X#endif X#ifdef HAVE_MTGET_FILENO X case MTS_FILENO: X rmtrespond(mtget.mt_fileno, geterrno()); break; X#endif X#ifdef HAVE_MTGET_BLKNO X case MTS_BLKNO: X rmtrespond(mtget.mt_blkno, geterrno()); break; X#endif X#ifdef HAVE_MTGET_FLAGS X case MTS_FLAGS: X rmtrespond(mtget.mt_flags, geterrno()); break; X#endif X#ifdef HAVE_MTGET_BF X case MTS_BF: X rmtrespond(mtget.mt_bf, geterrno()); break; X#endif X default: X rmtrespond((long)-1, EINVAL); break; X } else { X /* X * Do not expect that this interface makes any sense. X * With UNIX, you may at least trust the first two X * struct members, but Linux is completely incompatible X */ X ret = sizeof (mtget); X rmtrespond((long)ret, geterrno()); X (void) _nixwrite(STDOUT_FILENO, (char *)&mtget, X sizeof (mtget)); X } X } X} X#endif X XLOCAL void Xseektape() X{ X off_t ret; X char count[CMD_SIZE]; X char whence[CMD_SIZE]; X Llong offset = (Llong)0; X int iwhence; X X readarg(count, sizeof (count)); X readarg(whence, sizeof (whence)); X DEBUG2("rmtd: L %s %s\n", count, whence); X (void) astoll(count, &offset); X iwhence = atoi(whence); X switch (iwhence) { X X case 0: iwhence = SEEK_SET; break; X case 1: iwhence = SEEK_CUR; break; X case 2: iwhence = SEEK_END; break; X#ifdef SEEK_DATA X case 3: iwhence = SEEK_DATA; break; X#endif X#ifdef SEEK_HOLE X case 4: iwhence = SEEK_HOLE; break; X#endif X X default: X DEBUG1("rmtd: Illegal lseek() whence %d\n", iwhence); X rmtrespond((long)-1, EINVAL); X return; X } X ret = (off_t)offset; X if (ret != offset) { X DEBUG1("rmtd: Illegal seek offset %lld\n", offset); X rmtrespond((long)-1, EINVAL); X return; X } X ret = lseek(tape_fd, (off_t)offset, iwhence); X if ((ret != (off_t)-1) && (sizeof (ret) > sizeof (long))) { X DEBUG1("rmtd: A %lld\n", (Llong)ret); X (void) js_snprintf(count, sizeof (count), "A%lld\n", X (Llong)ret); X (void) _nixwrite(STDOUT_FILENO, count, strlen(count)); X return; X } X rmtrespond((long)ret, geterrno()); X} X XLOCAL void Xdoversion() X{ X char arg[CMD_SIZE]; X X readarg(arg, sizeof (arg)); /* We may like to add an arg later */ X DEBUG1("rmtd: v %s\n", arg); X rmtrespond((long)RMT_VERSION, 0); X} X X#define READB_SIZE 128 XLOCAL char readb[READB_SIZE]; XLOCAL char *readbptr; XLOCAL int readbcnt; X XLOCAL int Xfillrdbuf() X{ X readbptr = readb; X X return (readbcnt = _niread(STDIN_FILENO, readb, READB_SIZE)); X} X X/* X * This function is used for error recovery, it thus may be slow. X * We try to fill the read buffer in case there is something to read. X * We will not block here, if the OS does not support O_NONBLOCK we X * will just do nothing. X */ XLOCAL void Xtryfillrdbuf() X{ X#if defined(F_GETFL) && defined(F_SETFL) && defined(O_NONBLOCK) X int fl; X X fl = fcntl(STDIN_FILENO, F_GETFL, 0); X fcntl(STDIN_FILENO, F_SETFL, fl|O_NONBLOCK); X X fillrdbuf(); X X fcntl(STDIN_FILENO, F_SETFL, fl); X#endif X} X XLOCAL int Xreadchar(cp) X char *cp; X{ X if (--readbcnt < 0) { X if (fillrdbuf() <= 0) X return (readbcnt); X --readbcnt; X } X *cp = *readbptr++; X return (1); X} X XLOCAL void Xreadbuf(buf, n) X register char *buf; X register int n; X{ X register int i = 0; X register int amt; X X if (readbcnt > 0) { X amt = readbcnt; X if (amt > n) X amt = n; X movebytes(readbptr, buf, amt); X readbptr += amt; X readbcnt -= amt; X i += amt; X } X X for (; i < n; i += amt) { X amt = _niread(STDIN_FILENO, &buf[i], n - i); X if (amt <= 0) { X DEBUG("rmtd: premature eof\n"); X rmterror("Premature eof"); X exit(EX_BAD); X } X } X} X XLOCAL int Xreadarg(buf, n) X char *buf; X int n; X{ X int i; X char c; X X for (i = 0; i < n; i++) { X if (readchar(&buf[i]) != 1) X exit(0); X if (buf[i] == '\n') X break; X } X if (buf[i] == '\n') { X buf[i] = '\0'; X return (--i); /* Do not include null byte */ X } X buf[n-1] = '\0'; X X /* X * The following code is for error recovery. X * We come here if the client send us too long parameters. X * We try to recover from the problem by reading a reasonable X * amount of data in hope to find the newline which is the X * argument terminator. X */ X if (readbcnt <= 0) X tryfillrdbuf(); X for (i = 0; readbcnt > 0 && i < 10000; i++) { X if (readchar(&c) != 1) X exit(0); X if (c == '\n') X break; X if (readbcnt <= 0) X tryfillrdbuf(); X } X return (n); X} X XLOCAL char * Xpreparebuffer(size) X int size; X{ Xstatic char *buffer = 0; Xstatic int buffersize = 0; X X if (buffer != 0 && size <= buffersize) X return (buffer); X if (buffer != 0) X free(buffer); X buffer = malloc(size); X if (buffer == 0) { X DEBUG("rmtd: cannot allocate buffer space\n"); X rmterror("Cannot allocate buffer space"); X exit(EX_BAD); X } X buffersize = size; X X#ifdef SO_SNDBUF X while (size > 512 && X setsockopt(STDOUT_FILENO, SOL_SOCKET, SO_SNDBUF, X (char *)&size, sizeof (size)) < 0) X size -= 512; X DEBUG1("rmtd: sndsize: %d\n", size); X#endif X#ifdef SO_RCVBUF X while (size > 512 && X setsockopt(STDIN_FILENO, SOL_SOCKET, SO_RCVBUF, X (char *)&size, sizeof (size)) < 0) X size -= 512; X DEBUG1("rmtd: rcvsize: %d\n", size); X#endif X return (buffer); X} X X/* X * If we are not root and there is no /etc/default/rmt X * we will only allow to access files in /dev. X * We do this because we may assume that non-root access to files X * in /dev is only granted if it does not open security holes. X * Accessing files (e.g. /etc/passwd) is not possible. X * Otherwise permissions depend on the content of /etc/default/rmt. X */ XLOCAL int Xchecktape(device) X char *device; X{ X if (!found_dfltfile) { X if (has_dotdot(device)) X return (0); X if (strncmp(device, "/dev/", 5) == 0) X return (1); X return (0); X } X return (checkaccess(device)); X} X XLOCAL BOOL Xhas_dotdot(name) X char *name; X{ X register char *p = name; X X while (*p) { X if ((p[0] == '.' && p[1] == '.') && X (p[2] == '/' || p[2] == '\0')) { X return (TRUE); X } X do { X if (*p++ == '\0') X return (FALSE); X } while (*p != '/'); X p++; X while (*p == '/') /* Skip multiple slashes */ X p++; X } X return (FALSE); X} XLOCAL void Xrmtrespond(ret, err) X long ret; X int err; X{ X char rbuf[2*CMD_SIZE]; X X if (ret >= 0) { X DEBUG1("rmtd: A %ld\n", ret); X (void) js_snprintf(rbuf, sizeof (rbuf), "A%ld\n", ret); X } else { X DEBUG2("rmtd: E %d (%s)\n", err, errmsgstr(err)); X (void) js_snprintf(rbuf, sizeof (rbuf), "E%d\n%s\n", err, X errmsgstr(err)); X } X (void) _nixwrite(STDOUT_FILENO, rbuf, strlen(rbuf)); X} X XLOCAL void Xrmterror(str) X char *str; X{ X char rbuf[2*CMD_SIZE]; X X DEBUG1("rmtd: E 0 (%s)\n", str); X (void) js_snprintf(rbuf, sizeof (rbuf), "E0\n%s\n", str); X (void) _nixwrite(STDOUT_FILENO, rbuf, strlen(rbuf)); X} X#endif /* USE_REMOTE */ END-of-star-1.6/rmt/rmt.c echo x - star-1.6/rmt/rmt.1 sed 's/^X//' >star-1.6/rmt/rmt.1 << 'END-of-star-1.6/rmt/rmt.1' X. \" @(#)rmt.1 1.17 18/06/09 Copyr 1994-2018 J. Schilling X. \" Manual Seite fuer rmt X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.75n'U X.if t .ds s \\(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH RMT 1 "2018/06/09" "J\*org Schilling" "Schily\'s USER COMMANDS" X.SH NAME Xrmt \- remote magnetic tape protocol server X.SH SYNOPSIS X.B /opt/schily/sbin/rmt X.br X.B /etc/rmt X X.SH DESCRIPTION X.IX "rmt command" "" "\fLrmt\fP \(em remote magnetic tape protocol server" X.IX "remote magnetic tape protocol server" "" "remote magnetic tape protocol server \(em \fLrmt\fP" XThis is the description of the enhanced X.B "Schily" Xversion of the X.B rmt Xremote tape server program. X.B rmt Xis a program used by programs like X.B star Xand X.B ufsdump Xthat like to access remote magnetic tape drives and files Xthrough an interprocess communication connection. X.B rmt Xis normally started up with an X.BR rexec (3) Xor X.BR rcmd (3) Xcall. X.LP XThe X.B rmt Xprogram accepts X.BR open , X.BR close , X.BR read , X.B write Xand X.B seek Xrequests as well as requests that are specific to magnetic tapes. X.B rmt Xperforms the commands and then responds with a status indication. X.LP XThis version of the rmt server gives full compatibility to the Xoriginal BSD version, the enhanced Sun version and the Xenhanced GNU version. XIn addition to the Sun and GNU enhancements, it implements further Xabstractions for better cross platform compliance. XIt supports best speed and Xbest compliance even when server and client code are running Xon different platforms. XIt is prepared to be installed as a user shell in the passwd Xfile to create remote tape specific logins and security checking. XTo use the enhanced compatibility features, you need to either Xuse the remote tape client code from X.B star Xwhich is available in X.B librmt Xor reimplement its features. X.LP XAll responses are send back in X.SM ASCII. XThey are in one of the following two forms. X.LP XSuccessful commands have responses of X.IP X.BI A number\en X.LP Xwhere X.I number Xis the X.SM ASCII Xrepresentation of a decimal number that usually is the return Xcode of the corresponding system call. XUnsuccessful commands are responded to with X.IP X.BI E error-number \en error-message \en X.LP Xwhere X.I error-number Xis one of the possible error Xnumbers described in X.BR intro (2), Xand X.I error-message Xis the corresponding error string as retrieved by X.BR strerror (3). X.ne 4 XNote that the error number is valid on the remote system where the X.B rmt Xcode runs and may have a different meaning on the local system. X.LP X.ne 5 XThe protocol implements the Xfollowing commands: X.RS X.TP 15 X.BI O device \en mode \en X.TP X.BI O device \en "mode symbolic_mode" \en XOpen the specified X.I device Xor file using the indicated X.IR mode . X.I device Xis a full path name, and X.I mode Xis an X.SM ASCII Xrepresentation of a decimal Xnumber suitable for being passed as second parameter to X.BR open (2). XA variant of the X.B open Xcommand includes the X.B "symbolic_mode" Xstring which is a X.B GNU Xextension. XIf both, X.I mode Xand X.I symbolic_mode Xare present, they are separated by a space character; X.I symbolic_mode Xappears on the same line as the numeric mode. XIt is send using the same notation as used in a C source (e.g. X.BR O_RDWR|O_CREAT ). XIf the X.I symbolic_mode Xis send to the server, the numeric X.B mode Xis ignored. XThe symbolic notation allows to send the expected open mode over Xthe wire, using a system independent method. XThis is needed because different operating systems usually define all Xbits in a different way. An exception are the lowest two bits. XThe lowest two bits allow to code X.IR O_RDONLY , O_WRONLY " and " O_RDWR . XTo prevent unexpected behavior, X.B rmt Xmasks the numeric open mode with X.B 0x03 Xbefore using it as argument to the X.BR open (2) Xcall. XIf you need more bits in the second parameter ot X.BR open (2), Xyou need to use the symbolic mode. X.sp XIf no file X.I /etc/default/rmt Xexists, only filenames starting with /dev/ are accepted for security reasons. X.sp XIf a device is already open, it is Xclosed before a new open is performed. X.sp XA X.B RMT protocol VERSION 1 Xclient should issue a X.br X.BI I -1 \en 0\en X.br Xcommand just after opening a file or device. This is needed to Xtell the server that the client is aware of the official order Xof the X.I mt_op Xcodes in the range 0..7 and that is maps deviating values to the official Xones. X.br X.ne 7 X.TP X.BI C device \en XClose the currently open device or file. The argument X.I device Xis ignored. X.br X.ne 7 X.TP X.BI R count \en XRead X.I count Xbytes of data from the open device or file. X.B rmt Xperforms the requested X.BR read (2) Xoperation and responds with X.BI A count-read\en Xif the read operation was Xsuccessful; otherwise an error in Xstandard format is returned. If the read operation Xwas successful, the data read is sent directly after Xthe response described above. X.br X.ne 7 X.TP X.BI W count \en XWrite data to the open device or file. XAfter reading the command specification, X.B rmt Xreads X.I count Xbytes from the network connection and aborts if a premature X.SM EOF Xis encountered. XThe return value from the X.BR write (2) Xoperation is returned as reply. X.br X.ne 7 X.TP X.BI L whence \en offset \en XPerform an X.BR lseek (2) Xoperation on the open device or file using the specified parameters. XThe return value from the X.BR lseek (2) Xoperation is returned as reply. X.sp XOn large file aware operating systems, X.B rmt Xwill correctly handle large X.BR lseek (2) Xrequests. X.RS X.PP XThe following whence values are supported: X.TP X0 XMapped to X.BR SEEK_SET . X.TP X1 XMapped to X.BR SEEK_CUR . X.TP X2 XMapped to X.BR SEEK_END . X.TP X3 XMapped to X.B SEEK_DATA XIf avalable on the remote system. X.TP X4 XMapped to X.B SEEK_HOLE XIf avalable on the remote system. X.RE X.br X.ne 7 X.TP X.B S XThe old non-portable status call. XThis call should not be used anymore, it has been replaced by the Xnew X.B RMT protocol version 1 Xextended status call below. XIf the currently open device is a magnetic tape, return the magnetic tape status, Xas obtained with a X.SB MTIOCGET X.B ioctl Xcall. XIf the open device is not a magnetic tape, an error is returned. XIf the X.SB MTIOCGET Xoperation was successful, Xan \*(lqack\*(rq is sent with the size of the Xstatus buffer, then the status buffer is sent. XAs the status buffer is sent in binary, this Xcommand it considered outdated. Please use the extended status command instead. XThis command is not terminated by a new-line. X.br X.ne 7 X.TP X.BI s sub-command XThe new portable status call. XThis command is part of the X.BR "RMT protocol version 1" . XIf the currently open device is a magnetic tape, return a single specified Xmember of the magnetic tape status structure, as obtained with a X.SB MTIOCGET X.B ioctl Xcall. XIf the open device is not a magnetic tape, an error is returned. XIf the X.SB MTIOCGET Xoperation was successful, the numerical value of the structure member Xis returned in decimal. XThe following sub commands are supported: X.RS X.br X.ne 3 X.TP XT Xreturn the content of the structure member X.B mt_type Xwhich contains the type of the magnetic tape device. X.br X.ne 3 X.TP XD Xreturn the content of the structure member X.B mt_dsreg Xwhich contains the \*(lqdrive status register\*(rq. X.br X.ne 3 X.TP XE Xreturn the content of the structure member X.B mt_erreg Xwhich contains the \*(lqerror register\*(rq. X.sp XThis structure member must be retrieved first Xbecause it is cleared after each X.SB MTIOCGET X.B ioctl Xcall. XThe X.B librmt Xwill always retrieve the member X.B mt_erreg Xfirst when it is told to retrieve a complete status structure. X.br X.ne 3 X.TP XR Xreturn the content of the structure member X.B mt_resid Xwhich contains the residual count of the last I/O. X.br X.ne 3 X.TP XF Xreturn the content of the structure member X.B mt_fileno Xwhich contains the block number of the current tape position. X.br X.ne 3 X.TP XB Xreturn the content of the structure member X.B mt_blkno Xwhich contains the block number of the current tape position. X.br X.ne 3 X.TP Xf Xreturn the content of the structure member X.B mt_flags Xwhich contains MTF_ flags from the driver. X.br X.ne 3 X.TP Xb Xreturn the content of the structure member X.B mt_bf Xwhich contains the optimum blocking factor. X.LP XThis command is not terminated with a new-line. X.RE X.br X.ne 7 X.TP X.BI I operation \en count \en XPerform a X.SB MTIOCOP X.BR ioctl (2) Xcommand using the specified parameters. XThe parameters are interpreted as the X.SM ASCII Xrepresentations of the decimal values to place in the X.I mt_op Xand X.I mt_count Xfields of the structure used in the X.B ioctl Xcall. XWhen the operation is successful the return value is the X.I count Xparameter. XOnly Opcodes 0..7 are unique across different architectures. XIn many cases X.B Linux Xdoes not even follow this rule and could cause harm to tape media Xin case an old non X.B RMT protocol VERSION 1 Xaware rmt client connects from UNIX to Linux or from Linux to UNIX. XIf we know that we have been called by a X.B RMT protocol VERSION 1 Xclient, we may safely assume that the client is not using the X.B Linux Xmapping over the wire but the standard mapping described below: X.RS X.TP X-1 XRetrieve the version number of the X.B rmt Xserver and tell the server that the client is aware of the official Xorder of the X.SB MTIOCOP X.BR ioctl (2) Xopcodes in the range 0..7. XLocal X.I mt_op Xcodes must be remapped to the official values before sending them Xover the wire. X.sp XThe answer of the current version of X.B rmt Xis 1. XOld X.B rmt Ximplementations send an error code back when this Xcommand is used. XFuture X.B rmt Ximplementations with further enhancements will send an answer Xwith a value > 1. X.TP X0 XIssue a X.B MTWEOF Xcommand (write X.I count Xend-of-file records). X.TP X1 XIssue a X.B MTFSF Xcommand (forward space over X.I count Xfile marks). X.TP X2 XIssue a X.B MTBSF Xcommand (backward space over X.I count Xfile marks). X.TP X3 XIssue a X.B MTFSR Xcommand (forward space X.I count Xinter-record gaps). X.TP X4 XIssue a X.B MTBSR Xcommand (backward space X.I count Xinter-record gaps). X.TP X5 XIssue a X.B MTREW Xcommand (rewind). X.TP X6 XIssue a X.B MTOFFL Xcommand (rewind and put the drive off-line). X.TP X7 XIssue a X.B MTNOP Xcommand (no operation, set status only). X.RE X.br X.ne 7 X.TP X.BI i operation \en count \en XPerform a X.SB MTIOCOP X.BR ioctl (2) Xcommand using the specified parameters. XThis command is a X.B RMT protocol VERSION 1 Xextension and implements support for commands beyond MTWEOF..MTNOP (0..7). XThe parameters are interpreted as the X.SM ASCII Xrepresentations of the decimal values described below. XThey are converted into the local values X.I mt_op Xand X.I mt_count Xfields of the structure used in the X.B ioctl Xcall according to the actual values found in . XWhen the operation is successful the return value is the X.I count Xparameter. X.RS X.TP X0 XIssue a X.B MTCACHE Xcommand (switch cache on). X.TP X1 XIssue a X.B MTNOCACHE Xcommand (switch cache off). X.TP X2 XIssue a X.B MTRETEN Xcommand (retension the tape). X.TP X3 XIssue a X.B MTERASE Xcommand (erase the entire tape). X.TP X4 XIssue a X.B MTEOM Xcommand (position to end of media). X.TP X5 XIssue a X.B MTNBSF Xcommand (backward space X.I count Xfiles to BOF). X.RE X.br X.ne 7 X.TP X.BI v \en XReturn the version of the X.B rmt Xserver. This is currently the decimal number 1. X.RE X.LP XAny other command causes X.B rmt Xto exit. X.SH FILES X.TP X/etc/default/rmt XThe file X.B /etc/default/rmt Xallows to set up rules to limit the accessibility of files based on rules. XThis feature is typically used when the rmt run from a non personal but Xtask specific login. X.sp XDefault values can be set for the following options in /etc/default/rmt. XFor example: X.sp X.BR DEBUG= /tmp/rmt.debug X.br X.BR USER= tape X.br X.BR ACCESS= "tape myhost.mydomain.org /dev/rmt/*" X.sp XAll keywords must be on the beginning of a line. X.RS X.TP X.B DEBUG XIf you like to get debug information, set this to a file name where X.B rmt Xshould put debug information. X.TP X.B USER XThe name of a user (local to the magnetic tape server) that may use Xthe services of the X.B rmt Xserver. XMore than one X.BI USER= name Xline is possible. XA line X.BR USER= * Xgrants access to all users. X.TP X.B ACCESS XThis keyword is followed by three parameters separated by a TAB. XThe name of a user (local to the magnetic tape server host) that may use Xthe services of the X.B rmt Xserver followed by the name of a host from where operation is granted Xand a file specifier pattern for a file or file sub tree that may be accessed Xif this X.B ACCESS Xline matches. XMore than one X.BI ACCESS= "name host path" Xline is possible. X.sp XIf standard input of X.B rmt Xis not a socket from a remote host, X.B rmt Xwill compare the host entry from X.B /etc/default/rmt Xwith the following strings: X.RS X.TP 10 X.B PIPE XIf X.B stdin Xis a X.SM UNIX Xpipe. X.sp XIf you like to allow remote connections that use the X.B ssh Xprotocol, you need to use the word X.B PIPE Xinstead of the real hostname in the matching X.B ACCESS= Xline. X.TP X.B ILLEGAL_SOCKET XIf X.B getpeername() Xdoes not work for X.BR stdin . X.TP X.B NOT_IP XIf X.B getpeername() Xworks for X.B stdin Xbut is not connected to an internet socket. X.RE X.RE X.SH "SEE ALSO" X.BR star (1), X.BR ufsdump (1), X.BR ufsrestore (1), X.BR intro (2), X.BR open (2), X.BR close (2), X.BR read (2), X.BR write (2), X.BR ioctl (2), X.BR lseek (2), X.BR getpeername (3), X.BR rcmd (3), X.BR rexec (3), X.BR strerror (3), X.BR mtio (7), X.BR rmtopen (3), X.BR rmtclose (3), X.BR rmtread (3), X.BR rmtwrite (3), X.BR rmtseek (3), X.BR rmtioctl (3), X.BR rmtstatus (3) X X.SH DIAGNOSTICS XAll responses are send to the network connection. XThey use the form described above. X.SH NOTES X.LP XTo use X.B rmt Xas a remote file access protocol you need to use the symbolic open Xmodes as e.g. the X.I O_CREAT Xflag is not unique between different architectures. X.LP XIn order to allow this implementation to be used Xas a remote file access protocol, Xit accepts file names up to 4096 bytes with the open command. XOther X.B rmt Ximplementations allow no more than 64 bytes. X.LP XThe possibility to create a debug file by calling X.BI rmt " file Xhas been disabled for security reasons. XIf you like to debug X.B rmt Xedit X.B /etc/default/rmt Xand insert a X.B DEBUG Xentry. X.LP XThis implementation of X.B rmt Xadds some security features to the server that make it behave Xslightly different from older implementations. XRead the above documentation about the file X/etc/default/rmt Xto make sure your local installation is configured for your needs. X.LP XTo grant the same permissions as with old X.B rmt Xservers, create a file /etc/default/rmt and add the following lines Xto this file: X.LP X.BR USER= * X.br X.BR ACCESS= "* * *" X.LP XNote that the three fields in the X.B ACCESS= Xline need to be separated by a TAB character. X.LP XBe very careful when designing patterns to match path names that may Xbe accepted for X.IR open . XIf a pattern would allow to include X.I /../ Xin the path, Xa possible intruder could virtually access any path on your system. XFor this reason, X.I /../ Xis not allowed to appear in a path regardless of the pattern. X.SH BUGS X.LP XNone known. X.SH HISTORY X.LP XThe X.B rmt Xcommand first appeared on BSD in march 1981. This X.B rmt Xserver is a new implementation Xthat tries to be compatible to all existing implementations. XIt is the only known implementation that in addition tries to Xfix the data exchange problems between different architectures. X X.LP XThis X.B rmt Ximplementation has been written in 1994 by J\*org Schilling. XIn 2000, support for X.B RMT VERSION 1 Xhas been added Xand a mapping to work around the non-standard Linux X.B mtio Xopcodes in the range 0..7 has been added. X.B rmt Xis still maintained by J\*org Schilling. X.LP X X.SH AUTHOR X.nf XJ\*org Schilling XSeestr. 110 XD-13353 Berlin XGermany X.fi X.PP XMail bugs and suggestions to: X.PP X.B Xjoerg.schilling@fokus.fraunhofer.de Xor X.B Xjoerg@schily.net END-of-star-1.6/rmt/rmt.1 echo x - star-1.6/rmt/Makefile.man sed 's/^X//' >star-1.6/rmt/Makefile.man << 'END-of-star-1.6/rmt/Makefile.man' X#ident @(#)Makefile.man 1.1 00/12/04 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= rmt XMANSECT= $(MANSECT_CMD) XMANSUFFIX= $(MANSUFF_CMD) XMANFILE= rmt.1 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/rmt/Makefile.man echo x - star-1.6/rmt/rmt.dfl sed 's/^X//' >star-1.6/rmt/rmt.dfl << 'END-of-star-1.6/rmt/rmt.dfl' X#ident @(#)rmt.dfl 1.2 05/08/09 Copyr 2000 J. Schilling X# X# This file is /etc/default/rmt X# X# NOTE: If this file is not present, rmt will reject to work for root. X# X# If no USER= entry is present, nobody is allowed to run rmt. X# If no ACCESS= entry is present, no device may to be used by remote users. X X# X# The file where debug info should go to. X# If you don't like debugging (e.g. for speed) comment out X# the this line. X# X#DEBUG=/tmp/RMT X X# X# Each USER= entry adds the listed user to the users who may run rmt X# X# A typical passwd entry looks like this: X# rtape:x:1999:1000:Remote TAPE:/export/home/rtape:/opt/schily/sbin/rmt X# X# Add entries for all valid remote users to /export/home/rtape/.rhosts X# X#USER=rtape X#USER=joerg X# Default to old SunOS behavior. If you like to be more restrictive, comment X# out the entry below and enable the explicit USER= entries above. XUSER=* X X# X# Each ACCESS= entry adds a target or group of targets to the list of visible X# targets for all users that do remote tape/file access from a specific host. X# X# Username is the name of the user that runs rmt. If you create X# different users, you may assign different permissions to different X# users from the same host. X# X# Hostname must be in the same notation as needed for .rhosts (e.g. in X# the way you will be listed by 'who' if you log in from this host). X# X# local remote X# user host file X# name name X# X#ACCESS=rtape sparky /dev/rmt/* XACCESS=* * /dev/rmt/* XACCESS=* * /dev/null XACCESS=* * /dev/zero X#ACCESS=* * * END-of-star-1.6/rmt/rmt.dfl echo x - star-1.6/rmt/Makefile.dfl sed 's/^X//' >star-1.6/rmt/Makefile.dfl << 'END-of-star-1.6/rmt/Makefile.dfl' X#ident @(#)Makefile.dfl 1.4 10/05/14 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSMODE= 0644 XINSDIR= etc/default XINSBASE= $(INS_RBASE:%/=%) XTARGET= rmt XAUXSRCEXT= .dfl X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### END-of-star-1.6/rmt/Makefile.dfl echo x - star-1.6/rmt/Makefile.doc sed 's/^X//' >star-1.6/rmt/Makefile.doc << 'END-of-star-1.6/rmt/Makefile.doc' X#ident @(#)Makefile.doc 1.1 07/06/13 X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= share/doc/rmt XTARGET= default-rmt.sample X#XMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### END-of-star-1.6/rmt/Makefile.doc echo x - star-1.6/rmt/default-rmt.sample sed 's/^X//' >star-1.6/rmt/default-rmt.sample << 'END-of-star-1.6/rmt/default-rmt.sample' X#ident @(#)rmt.dfl 1.2 05/08/09 Copyr 2000 J. Schilling X# X# This file is /etc/default/rmt X# X# NOTE: If this file is not present, rmt will reject to work for root. X# X# If no USER= entry is present, nobody is allowed to run rmt. X# If no ACCESS= entry is present, no device may to be used by remote users. X X# X# The file where debug info should go to. X# If you don't like debugging (e.g. for speed) comment out X# the this line. X# X#DEBUG=/tmp/RMT X X# X# Each USER= entry adds the listed user to the users who may run rmt X# X# A typical passwd entry looks like this: X# rtape:x:1999:1000:Remote TAPE:/export/home/rtape:/opt/csw/sbin/rmt X# X# Add entries for all valid remote users to /export/home/rtape/.rhosts X# XUSER=rtape X#USER=joerg X# Default to old SunOS behavior. If you like to be more restrictive, comment X# out the entry below and enable the explicit USER= entries above. XUSER=* X X# X# Each ACCESS= entry adds a target or group of targets to the list of visible X# targets for all users that do remote tape/file access from a specific host. X# X# Username is the name of the user that runs rmt. If you create X# different users, you may assign different permissions to different X# users from the same host. X# X# Hostname must be in the same notation as needed for .rhosts (e.g. in X# the way you will be listed by 'who' if you log in from this host). X# X# local remote X# user host file X# name name X# X#ACCESS=rtape sparky /dev/rmt/* XACCESS=* * /dev/rmt/* XACCESS=* * /dev/null XACCESS=* * /dev/zero X#ACCESS=* * * END-of-star-1.6/rmt/default-rmt.sample echo x - star-1.6/configure sed 's/^X//' >star-1.6/configure << 'END-of-star-1.6/configure' X#!/bin/sh - Xecho 'configure is no longer used - just type "make", supported make programs are:' Xecho '' Xecho 'smake - The Schily smake program' Xecho ' This is the preferred make program, the recent source can be' Xecho ' found on http://sourceforge.net/projects/schilytools/files/' Xecho ' The latest separate version of the source can be' Xecho ' found on http://sourceforge.net/projects/s-make/files/' Xecho '' Xecho ' Smake is the only make program with automake features, it is' Xecho ' the only program that works on unknown platforms.' Xecho '' Xecho 'make - SunPRO make (the enhanced schily dmake version)' Xecho ' The recent source (ported to all major platforms) can be' Xecho ' found on http://sourceforge.net/projects/schilytools/files/' Xecho '' Xecho 'make - SunPRO make (on SunOS/Solaris only)' Xecho ' in /usr/bin/ (SunOS 4.x) or /usr/ccs/bin/ (Solaris)' Xecho '' Xecho 'gmake - GNU make' Xecho ' GNU make will not work correctly on all platforms' Xecho ' and due to some conceptional bugs output several' Xecho ' error messages that are not related to the makefile' Xecho ' system but to GNU make (see README.gmake)' Xecho '' Xecho 'Other make programs will not work, for more information read README.compile' Xecho '' Xecho 'If you have problems and if you are in doubt, try to use smake' Xecho ' Always compile the latest version that can be found in schilytools:' Xecho ' http://sourceforge.net/projects/schilytools/files/' Xecho '' X# X# Make automated procedures that believe all programs still use the outdated GNU X# "./configure; make" procedure get the attention of a human ... by a delay, X# but do not let it fail. X# Xsleep 30 Xexit 0 END-of-star-1.6/configure echo c - star-1.6/TEMPLATES mkdir -p star-1.6/TEMPLATES > /dev/null 2>&1 echo x - star-1.6/TEMPLATES/Defaults.gcc sed 's/^X//' >star-1.6/TEMPLATES/Defaults.gcc << 'END-of-star-1.6/TEMPLATES/Defaults.gcc' X#ident "@(#)Defaults.gcc 1.2 15/10/08 " X########################################################################### X# X# global definitions for unknown Systems using CC=gcc X# X########################################################################### X# X# Compiler stuff X# X########################################################################### X#DEFCCOM= cc XDEFCCOM= gcc X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### X#CWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib XRUNPATH= -R $(INS_BASE)/lib -R /opt/schily/lib -R $(OLIBSDIR) X X########################################################################### X# X# Installation config stuff X# X########################################################################### XINS_BASE= /opt/schily XINS_KBASE= / XINS_RBASE= / X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= bin XDEFINSGRP= bin END-of-star-1.6/TEMPLATES/Defaults.gcc echo x - star-1.6/TEMPLATES/Defaults.xcc sed 's/^X//' >star-1.6/TEMPLATES/Defaults.xcc << 'END-of-star-1.6/TEMPLATES/Defaults.xcc' X#ident "@(#)Defaults.xcc 1.2 15/10/08 " X########################################################################### X# X# global definitions for unknown Systems using CC=cc X# X########################################################################### X# X# Compiler stuff X# X########################################################################### XDEFCCOM= cc X#DEFCCOM= gcc X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### X#CWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib X#RUNPATH= -R $(INS_BASE)/lib -R /opt/schily/lib -R $(OLIBSDIR) Will probably not work X X########################################################################### X# X# Installation config stuff X# X########################################################################### XINS_BASE= /opt/schily XINS_KBASE= / XINS_RBASE= / X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= bin XDEFINSGRP= bin END-of-star-1.6/TEMPLATES/Defaults.xcc echo x - star-1.6/TEMPLATES/temp-gcc.rul sed 's/^X//' >star-1.6/TEMPLATES/temp-gcc.rul << 'END-of-star-1.6/TEMPLATES/temp-gcc.rul' X#ident "@(#)temp-gcc.rul 1.4 14/03/31 " X########################################################################### X# Written 1997 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for unknown GCC systems X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-$(C_ARCH).rul X XOSDEFS= X XKDEFINES= -DKERNEL -D_KERNEL X XSHL_SUFFIX= .so.1.0 X X#LIB_SOCKET= -lsocket -lnsl -ldl XLIB_SOCKET= XLIB_MATH= -lm X#LIB_KVM= -lkvm XLIB_KVM= X XLDOPTS= $(LIBS_PATH) $(LDPATH) X XRANLIB= @echo " ==> RANDOMIZING ARCHIVE \"$@\""; true XARFLAGS= cr X#LORDER= lorder X#TSORT= tsort XLORDER= echo XTSORT= cat X XMKDIR= $(MKDIR_SH) END-of-star-1.6/TEMPLATES/temp-gcc.rul echo x - star-1.6/TEMPLATES/temp-xcc.rul sed 's/^X//' >star-1.6/TEMPLATES/temp-xcc.rul << 'END-of-star-1.6/TEMPLATES/temp-xcc.rul' X#ident "@(#)temp-xcc.rul 1.3 09/07/26 " X########################################################################### X# Written 1997 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for unknown systems systems with dumb cc X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-dumb.rul X XOSDEFS= X XKDEFINES= -DKERNEL -D_KERNEL X X#LIB_SOCKET= -lsocket -lnsl -ldl XLIB_SOCKET= XLIB_MATH= -lm X#LIB_KVM= -lkvm XLIB_KVM= X XARFLAGS= cr X#LORDER= lorder X#TSORT= tsort XLORDER= echo XTSORT= cat END-of-star-1.6/TEMPLATES/temp-xcc.rul echo x - star-1.6/TEMPLATES/Makefile.aux sed 's/^X//' >star-1.6/TEMPLATES/Makefile.aux << 'END-of-star-1.6/TEMPLATES/Makefile.aux' X#ident %W% %E% %Q% X########################################################################### X# Sample makefile for installing non-localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= etc XTARGET= help.dat XXMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.aux X########################################################################### END-of-star-1.6/TEMPLATES/Makefile.aux echo x - star-1.6/TEMPLATES/Makefile.cmd sed 's/^X//' >star-1.6/TEMPLATES/Makefile.cmd << 'END-of-star-1.6/TEMPLATES/Makefile.cmd' X#ident %W% %E% %Q% X########################################################################### X# Sample makefile for general application programs X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= bin XTARGET= cfform X#CPPOPTS += -Ispecincl XCFILES= cfform.c XLIBS= -lat XXMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.cmd X########################################################################### END-of-star-1.6/TEMPLATES/Makefile.cmd echo x - star-1.6/TEMPLATES/Makefile.dir sed 's/^X//' >star-1.6/TEMPLATES/Makefile.dir << 'END-of-star-1.6/TEMPLATES/Makefile.dir' X#ident %W% %E% %Q% X########################################################################### X# Sample makefile for sub directory makes X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X X# X# include Targetdirs no longer needed, we use SSPM X#include Targetdirs.$(M_ARCH) X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.dir X########################################################################### END-of-star-1.6/TEMPLATES/Makefile.dir echo x - star-1.6/TEMPLATES/Makefile.drv sed 's/^X//' >star-1.6/TEMPLATES/Makefile.drv << 'END-of-star-1.6/TEMPLATES/Makefile.drv' X#ident %W% %E% %Q% X########################################################################### X# Sample makefile for general device drivers X########################################################################### XSRCROOT= ../../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= usr/kernel/drv XTARGET= ga XCPPOPTS += -DFOKUS -DATMNA -DBROKEN_PROM -DTPI_COMPAT \ X -DGADEBUG -DGADEBUG_MASK=0x0 XCFILES= ga.c XSRCLIBS= XLIBS= XXMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.drv X########################################################################### END-of-star-1.6/TEMPLATES/Makefile.drv echo x - star-1.6/TEMPLATES/Makefile.lib sed 's/^X//' >star-1.6/TEMPLATES/Makefile.lib << 'END-of-star-1.6/TEMPLATES/Makefile.lib' X#ident %W% %E% %Q% X########################################################################### X# Sample makefile for non-shared libraries X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= lib XTARGETLIB= aal XCPPOPTS += -DFOKUS XCFILES= aallib.c XLIBS= XXMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.lib X########################################################################### END-of-star-1.6/TEMPLATES/Makefile.lib echo x - star-1.6/TEMPLATES/Makefile.loc sed 's/^X//' >star-1.6/TEMPLATES/Makefile.loc << 'END-of-star-1.6/TEMPLATES/Makefile.loc' X#ident %W% %E% %Q% X########################################################################### X# Sample makefile for installing localized auxiliary files X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= etc XTARGET= test XSRCFILE= test XXMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.loc X########################################################################### END-of-star-1.6/TEMPLATES/Makefile.loc echo x - star-1.6/TEMPLATES/Makefile.man sed 's/^X//' >star-1.6/TEMPLATES/Makefile.man << 'END-of-star-1.6/TEMPLATES/Makefile.man' X#ident %W% %E% %Q% X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= test XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= test.tr X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/TEMPLATES/Makefile.man echo x - star-1.6/TEMPLATES/Makefile.mks sed 's/^X//' >star-1.6/TEMPLATES/Makefile.mks << 'END-of-star-1.6/TEMPLATES/Makefile.mks' X#ident "%W% %E% %Q%" X########################################################################### X# Sample makefile for sub-makes in one directory X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X X#MK_FILES= cfform.mk cfget20.mk cfhec11.mk cfinfo20.mk cfpld.mk cfput20.mk XMK_FILES= cfform.mk XXMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.mks X########################################################################### END-of-star-1.6/TEMPLATES/Makefile.mks echo x - star-1.6/TEMPLATES/Makefile.root sed 's/^X//' >star-1.6/TEMPLATES/Makefile.root << 'END-of-star-1.6/TEMPLATES/Makefile.root' X#ident %W% %E% %Q% X########################################################################### X# Sample makefile for the source root X########################################################################### XSRCROOT= . XDIRNAME= SRCROOT XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X X# X# include Targetdirs no longer needed, we use SSPM X#include Targetdirs.$(M_ARCH) X X########################################################################### X# Due to a bug in SunPRO make we need special rules for the root makefile X# Xinclude $(SRCROOT)/$(RULESDIR)/rules.rdi X########################################################################### END-of-star-1.6/TEMPLATES/Makefile.root echo x - star-1.6/TEMPLATES/Makefile.scr sed 's/^X//' >star-1.6/TEMPLATES/Makefile.scr << 'END-of-star-1.6/TEMPLATES/Makefile.scr' X#ident %W% %E% %Q% X########################################################################### X# Sample makefile for installing localized shell scripts X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= bin XTARGET= test XSCRFILE= test.sh XXMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.scr X########################################################################### END-of-star-1.6/TEMPLATES/Makefile.scr echo x - star-1.6/TEMPLATES/Makefile.shl sed 's/^X//' >star-1.6/TEMPLATES/Makefile.shl << 'END-of-star-1.6/TEMPLATES/Makefile.shl' X#ident @(#)Makefile.shl 1.2 14/04/03 X########################################################################### X# Sample makefile for shared libraries X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES XSUBARCHDIR= /pic XINVERSE_SUBARCHDIR= ../ Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= lib XTARGETLIB= aal XCPPOPTS += -DFOKUS XCFILES= aallib.c XLIBS= XXMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.shl X########################################################################### END-of-star-1.6/TEMPLATES/Makefile.shl echo x - star-1.6/TEMPLATES/Makefile_de.man sed 's/^X//' >star-1.6/TEMPLATES/Makefile_de.man << 'END-of-star-1.6/TEMPLATES/Makefile_de.man' X#ident %W% %E% %Q% X########################################################################### X# Sample makefile for installing non english manual pages X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X# Rules for German manual pages (replace de with your locale) X########################################################################### X XMANDIR= man/de XTARGETMAN= test XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= test-de.tr X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/TEMPLATES/Makefile_de.man echo x - star-1.6/TEMPLATES/MKLINKS sed 's/^X//' >star-1.6/TEMPLATES/MKLINKS << 'END-of-star-1.6/TEMPLATES/MKLINKS' X#!/bin/sh X########################################################################### X#ident "@(#)MKLINKS 1.5 15/03/25 " X########################################################################### X# Written 2008-2015 by J. Schilling X########################################################################### X# Copyright (c) 2008-2015 J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xif [ -r ldummy.lnk ]; then X if [ $# -le 0 ]; then X exit 0 X fi Xfi X########################################################################### Xsymlink="ln -s" XMKLINKS_TEST=${MKLINKS_TEST-:} Xif [ ".$MKLINKS_COPY" = '.' ]; then X rm -f xxzzy.123 xxzzy.345 X echo test > xxzzy.123 X $symlink xxzzy.123 xxzzy.345 X test $? = 0 || symlink=cp X test -r xxzzy.345 || symlink=cp X ${MKLINKS_TEST} -h xxzzy.345 || symlink=cp X rm -f xxzzy.123 xxzzy.345 Xelse X symlink=cp Xfi X########################################################################### X X$symlink Makefile.cmd ldummy.lnk X$symlink Makefile.cmd cmd.mk X$symlink Makefile.inc inc.mk X$symlink Makefile.lib lib.mk X$symlink Makefile.shl shl.mk X X$symlink temp-clang.rul temp-clang32.rul X$symlink temp-clang.rul temp-clang64.rul X X$symlink temp-gcc.rul temp-gcc32.rul X$symlink temp-gcc.rul temp-gcc64.rul END-of-star-1.6/TEMPLATES/MKLINKS echo x - star-1.6/TEMPLATES/Defaults.clang sed 's/^X//' >star-1.6/TEMPLATES/Defaults.clang << 'END-of-star-1.6/TEMPLATES/Defaults.clang' X#ident "@(#)Defaults.clang 1.2 15/10/08 " X########################################################################### X# X# global definitions for unknown Systems using CC=clang X# X########################################################################### X# X# Compiler stuff X# X########################################################################### X#DEFCCOM= cc XDEFCCOM= clang X########################################################################### X# X# Link mode for libraries that are part of the makefile system: X# If DEFLINKMODE is set to "static", no dynamic linking will be used X# If DEFLINKMODE is set to "dynamic", dynamic linking will be used X# X########################################################################### XDEFLINKMODE= static X X########################################################################### X# X# If the next line is commented out, compilation is done with max warn level X# If the next line is uncommented, compilation is done with minimal warnings X# X########################################################################### X#CWARNOPTS= X XDEFINCDIRS= $(SRCROOT)/include XDEFOSINCDIRS= XLDPATH= -L/opt/schily/lib XRUNPATH= -R $(INS_BASE)/lib -R /opt/schily/lib -R $(OLIBSDIR) X X########################################################################### X# X# Installation config stuff X# X########################################################################### XINS_BASE= /opt/schily XINS_KBASE= / XINS_RBASE= / X# XDEFUMASK= 002 X# XDEFINSMODEF= 444 XDEFINSMODEX= 755 XDEFINSUSR= bin XDEFINSGRP= bin END-of-star-1.6/TEMPLATES/Defaults.clang echo x - star-1.6/TEMPLATES/Makefile.mod sed 's/^X//' >star-1.6/TEMPLATES/Makefile.mod << 'END-of-star-1.6/TEMPLATES/Makefile.mod' X#ident %W% %E% %Q% X########################################################################### X# Sample makefile for loadable streams modules X########################################################################### XSRCROOT= ../../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= usr/kernel/strmod XTARGET= ga XCPPOPTS += -DFOKUS -DATMNA -DBROKEN_PROM -DTPI_COMPAT \ X -DGADEBUG -DGADEBUG_MASK=0x0 XCFILES= ga.c XSRCLIBS= XLIBS= XXMK_FILE= Makefile.man X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.mod X########################################################################### END-of-star-1.6/TEMPLATES/Makefile.mod echo x - star-1.6/TEMPLATES/Makefile.inc sed 's/^X//' >star-1.6/TEMPLATES/Makefile.inc << 'END-of-star-1.6/TEMPLATES/Makefile.inc' X#ident %W% %E% %Q% X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= include XTARGET= align.h XTARGETC= align_test XCFILES= align_test.c X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.inc X########################################################################### END-of-star-1.6/TEMPLATES/Makefile.inc echo x - star-1.6/TEMPLATES/Makefile.wrap sed 's/^X//' >star-1.6/TEMPLATES/Makefile.wrap << 'END-of-star-1.6/TEMPLATES/Makefile.wrap' X#ident %W% %E% %Q% X########################################################################### X# Sample makefile for wrapping makes X########################################################################### XSRCROOT= ../.. XRULESDIR= RULES X#CCOM= gcc Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XSRC_DIR= wget-1.9.1 X#CONF_OPTS= --prefix=$(INS_BASE) X#CONF_OPTS= --prefix=$(INS_BASE) --program-prefix=g X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.sps X########################################################################### END-of-star-1.6/TEMPLATES/Makefile.wrap echo x - star-1.6/TEMPLATES/noshlxxx.mk sed 's/^X//' >star-1.6/TEMPLATES/noshlxxx.mk << 'END-of-star-1.6/TEMPLATES/noshlxxx.mk' X#ident "%W% %E% %Q%" X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X Xall: X @echo " ==> NO shared libs on this platform (yet)" END-of-star-1.6/TEMPLATES/noshlxxx.mk echo x - star-1.6/TEMPLATES/temp-clang.rul sed 's/^X//' >star-1.6/TEMPLATES/temp-clang.rul << 'END-of-star-1.6/TEMPLATES/temp-clang.rul' X#ident "@(#)temp-clang.rul 1.2 14/03/31 " X########################################################################### X# Written 1997-2014 by J. Schilling X########################################################################### X# X# Platform dependent MACROS for unknown CLANG systems X# X########################################################################### X# Copyright (c) J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.prg X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/cc-$(C_ARCH).rul X XOSDEFS= X XKDEFINES= -DKERNEL -D_KERNEL X XSHL_SUFFIX= .so.1.0 X X#LIB_SOCKET= -lsocket -lnsl -ldl XLIB_SOCKET= XLIB_MATH= -lm X#LIB_KVM= -lkvm XLIB_KVM= X XLDOPTS= $(LIBS_PATH) $(LDPATH) X XRANLIB= @echo " ==> RANDOMIZING ARCHIVE \"$@\""; true XARFLAGS= cr X#LORDER= lorder X#TSORT= tsort XLORDER= echo XTSORT= cat X XMKDIR= $(MKDIR_SH) END-of-star-1.6/TEMPLATES/temp-clang.rul echo c - star-1.6/mt mkdir -p star-1.6/mt > /dev/null 2>&1 echo x - star-1.6/mt/Makefile sed 's/^X//' >star-1.6/mt/Makefile << 'END-of-star-1.6/mt/Makefile' X#ident @(#)Makefile 1.9 13/04/21 X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= bin XTARGET= smt XSYMLINKS= mt XCPPOPTS += -DUSE_REMOTE XCPPOPTS += -DSCHILY_PRINT X XCFILES= mt.c X#HFILES= X# X# LIB_CAP is needed for Linux capability support in librmt. X# XLIBS= -lrmt -lschily $(LIB_SOCKET) $(LIB_CAP) XXMK_FILE= Makefile.man mt.mk1 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.cmd X########################################################################### Xcount: $(CFILES) $(HFILES) X count $r1 X END-of-star-1.6/mt/Makefile echo x - star-1.6/mt/mt.c sed 's/^X//' >star-1.6/mt/mt.c << 'END-of-star-1.6/mt/mt.c' X/* @(#)mt.c 1.30 18/11/28 Copyright 2000-2018 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)mt.c 1.30 18/11/28 Copyright 2000-2018 J. Schilling"; X#endif X/* X * Magnetic tape manipulation program X * X * Copyright (c) 2000-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X X/* X * XXX Until we find a better way, the next definitions must be in sync X * XXX with the definitions in librmt/remote.c X */ X#if !defined(HAVE_FORK) || !defined(HAVE_SOCKETPAIR) || !defined(HAVE_DUP2) X#undef USE_RCMD_RSH X#endif X#if !defined(HAVE_GETSERVBYNAME) X#undef USE_REMOTE /* Cannot get rcmd() port # */ X#endif X#if (!defined(HAVE_NETDB_H) || !defined(HAVE_RCMD)) && !defined(USE_RCMD_RSH) X#undef USE_REMOTE /* There is no rcmd() */ X#endif X X#include X#include X#include X#include X#include X#include X#include X#include X X#include X#include X/*#undef HAVE_SYS_MTIO_H*/ X#include X#include X XLOCAL BOOL help; XLOCAL BOOL prvers; XLOCAL BOOL wready; XLOCAL int debug; X XLOCAL struct mtop mt_op; XLOCAL struct rmtget mt_status; X X#ifndef HAVE_MTGET_TYPE X#ifdef HAVE_MTGET_MODEL X#define HAVE_MTGET_TYPE X#define mt_type mt_model X#endif X#endif X X#define NO_ASF 1000 X#define NO_NBSF 1001 X#ifndef MTASF X# define MTASF NO_ASF X#endif X#ifndef MTNBSF X# define MTNBSF NO_NBSF X#endif X X#define MTC_NONE 0 /* No flags defined */ X#define MTC_RW 0 /* This command writes to the tape */ X#define MTC_RDO 1 /* This command does not write */ X#define MTC_CNT 2 /* This command uses the count arg */ X#define MTC_NDEL 4 /* Open the tape drive with O_NDELAY */ X X XLOCAL struct mt_cmds { X char *mtc_name; /* The name of the command */ X char *mtc_text; /* Description of the command */ X int mtc_opcode; /* The opcode for mtio */ X int mtc_flags; /* Flags for this command */ X} cmds[] = { X#ifdef MTWEOF X { "weof", "write EOF mark", MTWEOF, MTC_RW|MTC_CNT }, X { "eof", "write EOF mark", MTWEOF, MTC_RW|MTC_CNT }, X#endif X#ifdef MTFSF X { "fsf", "forward skip FILE mark", MTFSF, MTC_RDO|MTC_CNT }, X#endif X#ifdef MTBSF X { "bsf", "backward skip FILE mark", MTBSF, MTC_RDO|MTC_CNT }, X#endif X { "asf", "absolute FILE mark pos", MTASF, MTC_RDO|MTC_CNT }, X#ifdef MTFSR X { "fsr", "forward skip record", MTFSR, MTC_RDO|MTC_CNT }, X#endif X#ifdef MTBSR X { "bsr", "backward skip record", MTBSR, MTC_RDO|MTC_CNT }, X#endif X#ifdef MTREW X { "rewind", "rewind tape", MTREW, MTC_RDO }, X#endif X#ifdef MTOFFL X { "offline", "rewind and unload", MTOFFL, MTC_RDO }, X { "rewoffl", "rewind and unload", MTOFFL, MTC_RDO }, X#endif X#ifdef MTNOP X { "status", "get tape status", MTNOP, MTC_RDO }, X#endif X { "nop", "no operation", MTNOP, MTC_RDO }, X#ifdef MTRETEN X { "retension", "retension tape cartridge", MTRETEN, MTC_RDO }, X#endif X#ifdef MTERASE X { "erase", "erase tape", MTERASE, MTC_RW }, X#endif X#ifdef MTEOM X { "eom", "position to EOM", MTEOM, MTC_RDO }, X#endif X X#if MTNBSF != NO_NBSF X { "nbsf", "backward skip FILE mark", MTNBSF, MTC_RDO|MTC_CNT }, X#endif X X#ifdef MTLOAD X { "load", "load tape", MTLOAD, MTC_RDO|MTC_NDEL }, X#endif X X { NULL, NULL, 0, MTC_NONE } X}; X XLOCAL void usage __PR((int ex)); XEXPORT int main __PR((int ac, char *av[])); XLOCAL void mtstatus __PR((struct rmtget *sp)); XLOCAL char *print_key __PR((Llong key)); XLOCAL int openremote __PR((char *tape)); XLOCAL int opentape __PR((char *tape, struct mt_cmds *cp)); XLOCAL int mtioctl __PR((int cmd, caddr_t arg)); X XLOCAL void Xusage(ex) X int ex; X{ X struct mt_cmds *cp; X int i; X X error("Usage: mt [ -f device ] [options] command [ count ]\n"); X error("Options:\n"); X error("\t-help\t\tprint this online help\n"); X error("\t-version\tprint version number\n"); X error("\t-wready\t\twait for the tape to become ready before doing command\n"); X error("\n"); X error("Commands are:\n"); X for (cp = cmds; cp->mtc_name != NULL; cp++) { X error("%s%n", cp->mtc_name, &i); X error("%*s%s\n", 14-i, "", cp->mtc_text); X } X exit(ex); X} X XLOCAL char opts[] = "f*,t*,version,help,h,debug,wready"; X Xint Xmain(ac, av) X int ac; X char *av[]; X{ X int cac; X char * const *cav; X char *tape = NULL; X char *cmd = "BADCMD"; X int count = 1; X struct mt_cmds *cp; X X save_args(ac, av); X cac = --ac; X cav = ++av; X X if (getallargs(&cac, &cav, opts, X &tape, &tape, X &prvers, X &help, &help, X &debug, X &wready) < 0) { X errmsgno(EX_BAD, "Bad Option: '%s'.\n", cav[0]); X usage(EX_BAD); X } X if (help) usage(0); X if (prvers) { X printf("mt %s %s (%s-%s-%s)\n\n", "1.30", "2018/11/28", HOST_CPU, HOST_VENDOR, HOST_OS); X printf("Copyright (C) 2000-2018 Jörg Schilling\n"); X printf("This is free software; see the source for copying conditions. There is NO\n"); X printf("warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"); X exit(0); X } X X if (tape == NULL && (tape = getenv("TAPE")) == NULL) { X#ifdef DEFTAPE X tape = DEFTAPE; X#else X errmsgno(EX_BAD, "No default tape defined.\n"); X usage(EX_BAD); X /* NOTREACHED */ X#endif X } X X cac = ac; X cav = av; X if (getfiles(&cac, &cav, opts) == 0) { X errmsgno(EX_BAD, "Missing args.\n"); X usage(EX_BAD); X } else { X cmd = cav[0]; X cav++; X cac--; X } X if (getfiles(&cac, &cav, opts) > 0) { X if (*astoi(cav[0], &count) != '\0') { X errmsgno(EX_BAD, "Not a number: '%s'.\n", cav[0]); X usage(EX_BAD); X } X if (count < 0) { X comerrno(EX_BAD, "negative file number or repeat count\n"); X /* NOTREACHED */ X } X cav++; X cac--; X } X if (getfiles(&cac, &cav, opts) > 0) { X errmsgno(EX_BAD, "Too many args.\n"); X usage(EX_BAD); X } X X for (cp = cmds; cp->mtc_name != NULL; cp++) { X if (strncmp(cmd, cp->mtc_name, strlen(cmd)) == 0) X break; X } X if (cp->mtc_name == NULL) { X comerrno(EX_BAD, "Unknown command: %s\n", cmd); X /* NOTREACHED */ X } X#ifdef DEBUG X error("cmd: %s opcode: %d %s %s\n", X cp->mtc_name, cp->mtc_opcode, X (cp->mtc_flags & MTC_RDO) != 0 ? "RO":"RW", X (cp->mtc_flags & MTC_CNT) != 0 ? "usecount":""); X#endif X X if ((cp->mtc_flags & MTC_CNT) == 0) X count = 1; X X#ifdef USE_REMOTE X rmtdebug(debug); X (void)openremote(tape); /* This needs super user privilleges */ X#endif X#ifdef HAVE_SETREUID X if (setreuid(-1, getuid()) < 0) X#else X#ifdef HAVE_SETEUID X if (seteuid(getuid()) < 0) X#else X if (setuid(getuid()) < 0) X#endif X#endif X comerr("Panic cannot set back effective uid.\n"); X X if (opentape(tape, cp) < 0) { X if (geterrno() == EIO) { X comerrno(EX_BAD, "'%s': no tape loaded or drive offline.\n", X tape); X } else if ((cp->mtc_flags & MTC_RDO) == 0 && X geterrno() == EACCES) { X comerr("Cannot open '%s': tape may be write protected.\n", tape); X } else { X comerr("Cannot open '%s'.\n", tape); X } X /* NOTREACHED */ X } X X#ifdef DEBUG X error("Tape: %s cmd : %s (%s) count: %d\n", tape, cmd, cp->mtc_name, count); X#endif X X if (cp->mtc_opcode == MTNOP) { X if (strcmp(cp->mtc_name, "nop")) { X /* X * Status ioctl X */ X if (mtioctl(MTIOCGET, (caddr_t)&mt_status) < 0) { X comerr("Cannot get mt status from '%s'.\n", tape); X /* NOTREACHED */ X } X mtstatus(&mt_status); X } X#if MTASF == NO_ASF X } else if (cp->mtc_opcode == MTASF) { X (void)mtioctl(MTIOCGET, (caddr_t)&mt_status); X if (mtioctl(MTIOCGET, (caddr_t)&mt_status) < 0) { X comerr("Cannot get mt status from '%s'.\n", tape); X /* NOTREACHED */ X } X /* X * If the device does not support to report the current file X * tape file position - rewind the tape, and space forward. X */ X#ifndef MTF_ASF X if (1) { X#else X if (!(mt_status.mt_flags & MTF_ASF) || MTNBSF == NO_NBSF) { X#endif X mt_status.mt_fileno = 0; X mt_op.mt_count = 1; X mt_op.mt_op = MTREW; X if (mtioctl(MTIOCTOP, (caddr_t)&mt_op) < 0) { X comerr("%s %s %d failed\n", tape, cp->mtc_name, X count); X /* NOTREACHED */ X } X } X if (count < mt_status.mt_fileno) { X mt_op.mt_op = MTNBSF; X mt_op.mt_count = mt_status.mt_fileno - count; X /*printf("mt: bsf= %lld\n", (Llong)mt_op.mt_count);*/ X } else { X mt_op.mt_op = MTFSF; X mt_op.mt_count = count - mt_status.mt_fileno; X /*printf("mt: fsf= %lld\n", (Llong)mt_op.mt_count);*/ X } X if (mtioctl(MTIOCTOP, (caddr_t)&mt_op) < 0) { X if (mtioctl(MTIOCTOP, (caddr_t)&mt_op) < 0) { X comerr("%s %s %d failed\n", tape, cp->mtc_name, X count); X /* NOTREACHED */ X } X } X#endif X } else { X /* X * Regular magnetic tape ioctl X */ X mt_op.mt_op = cp->mtc_opcode; X mt_op.mt_count = count; X if (mtioctl(MTIOCTOP, (caddr_t)&mt_op) < 0) { X comerr("%s %s %lld failed\n", tape, cp->mtc_name, X (Llong)mt_op.mt_count); X /* NOTREACHED */ X } X } X return (0); X} X X/* X * If we try to make this portable, we need a way to initialize it X * in an OS independant way. X * Don't use it for now. X */ X/*LOCAL */ Xstruct tape_info { X short t_type; /* type of magnetic tape device */ X char *t_name; /* name for prining */ X char *t_dsbits; /* "drive status" register */ X char *t_erbits; /* "error" register */ X}; X#ifdef XXX X tapes[] = { X { MT_ISTS, "ts11", 0, TSXS0_BITS }, X { 0 } X}; X#endif X X/* X * Interpret the status buffer returned X */ XLOCAL void Xmtstatus(sp) X register struct rmtget *sp; X{ X register struct tape_info *mt = NULL; X X#ifdef XXX X#ifdef HAVE_MTGET_TYPE X for (mt = tapes; mt->t_type; mt++) X if (mt->t_type == sp->mt_type) X break; X#endif X#endif X X#if defined(MTF_SCSI) X X if ((sp->mt_xflags & RMT_FLAGS) && (sp->mt_flags & MTF_SCSI)) { X /* X * Handle SCSI tape drives specially. X */ X if (sp->mt_xflags & RMT_TYPE) { X if (mt != NULL && mt->t_type == sp->mt_type) X printf("%s tape drive:\n", mt->t_name); X else X printf("%s tape drive:\n", "SCSI"); X } else { X printf("Unknown SCSI tape drive:\n"); X } X printf(" sense key(0x%llx)= %s residual= %lld ", X sp->mt_erreg, print_key(sp->mt_erreg), sp->mt_resid); X printf("retries= %lld\n", sp->mt_dsreg); X } else X#endif /* MTF_SCSI */ X { X /* X * Handle other drives below. X */ X if (sp->mt_xflags & RMT_TYPE) { X if (mt == NULL || mt->t_type == 0) { X printf("Unknown tape drive type (0x%llX):\n", (Ullong)sp->mt_type); X } else { X printf("%s tape drive:\n", mt->t_name); X } X } else { X printf("Unknown tape drive:\n"); X } X if (sp->mt_xflags & RMT_RESID) X printf(" residual= %lld", sp->mt_resid); X /* X * If we implement better support for specific OS, X * then we may want to implement something like the X * *BSD kernel %b printf format (e.g. printreg). X */ X if (sp->mt_xflags & RMT_DSREG) X printf (" ds = %llX", (Ullong)sp->mt_dsreg); X X if (sp->mt_xflags & RMT_ERREG) X printf (" er = %llX", sp->mt_erreg); X putchar('\n'); X } X printf(" file no= %lld block no= %lld\n", X (sp->mt_xflags & RMT_FILENO)? X sp->mt_fileno: X (Llong)-1, X (sp->mt_xflags & RMT_BLKNO)? X sp->mt_blkno: X (Llong)-1); X X if (sp->mt_xflags & RMT_BF) X printf(" optimum blocking factor= %ld\n", sp->mt_bf); X X if (sp->mt_xflags & RMT_FLAGS) X printf(" flags= 0x%llX\n", sp->mt_flags); X} X Xstatic char *sense_keys[] = { X "No Additional Sense", /* 0x00 */ X "Recovered Error", /* 0x01 */ X "Not Ready", /* 0x02 */ X "Medium Error", /* 0x03 */ X "Hardware Error", /* 0x04 */ X "Illegal Request", /* 0x05 */ X "Unit Attention", /* 0x06 */ X "Data Protect", /* 0x07 */ X "Blank Check", /* 0x08 */ X "Vendor Unique", /* 0x09 */ X "Copy Aborted", /* 0x0a */ X "Aborted Command", /* 0x0b */ X "Equal", /* 0x0c */ X "Volume Overflow", /* 0x0d */ X "Miscompare", /* 0x0e */ X "Reserved" /* 0x0f */ X}; X XLOCAL char * Xprint_key(key) X Llong key; X{ X static char keys[32]; X X if (key >= 0 && key < (sizeof(sense_keys)/sizeof(sense_keys[0]))) X return (sense_keys[key]); X js_snprintf(keys, sizeof(keys), "Unknown Key: %lld", key); X return (keys); X} X X/*--------------------------------------------------------------------------*/ XLOCAL int isremote; XLOCAL int remfd = -1; XLOCAL int mtfd; XLOCAL char *remfn; X X#ifdef USE_REMOTE XLOCAL int Xopenremote(tape) X char *tape; X{ X char host[128]; X X if ((remfn = rmtfilename(tape)) != NULL) { X rmthostname(host, sizeof(host), tape); X isremote++; X X if (debug) X errmsgno(EX_BAD, "Remote: %s Host: %s file: %s\n", X tape, host, remfn); X X if ((remfd = rmtgetconn(host, 4096, 0)) < 0) X comerrno(EX_BAD, "Cannot get connection to '%s'.\n", X /* errno not valid !! */ host); X } X return (isremote); X} X#endif X XLOCAL int Xopentape(tape, cp) X char *tape; X register struct mt_cmds *cp; X{ X int ret; X int n = 0; X int oflag; X X oflag = (cp->mtc_flags & MTC_RDO) ? O_RDONLY : O_RDWR; X#ifdef O_NDELAY X if (cp->mtc_flags & MTC_NDEL) X oflag |= O_NDELAY; X#endif X Xretry: X ret = 0; X if (isremote) { X#ifdef USE_REMOTE X if (rmtopen(remfd, remfn, oflag) < 0) X ret = -1; X#else X comerrno(EX_BAD, "Remote tape support not present.\n"); X#endif X } else if ((mtfd = open(tape, oflag)) < 0) { X ret = -1; X } X if (wready && n++ < 120 && ret < 0 && X (geterrno() == EIO || geterrno() == EBUSY)) { X sleep(1); X goto retry; X } X return (ret); X} X XLOCAL int Xmtioctl(cmd, arg) X int cmd; X caddr_t arg; X{ X int ret = -1; X struct rmtget *mtp; X struct mtop *mop; X X if (isremote) { X#ifdef USE_REMOTE X switch (cmd) { X X case MTIOCGET: X ret = rmtxstatus(remfd, (struct rmtget *)arg); X if (ret < 0) X return (ret); X X mtp = (struct rmtget *)arg; X/*#define DEBUG*/ X#ifdef DEBUG Xerror("type: %llX ds: %llX er: %llX resid: %lld fileno: %lld blkno: %lld flags: %llX bf: %ld\n", Xmtp->mt_type, mtp->mt_dsreg, mtp->mt_erreg, mtp->mt_resid, mtp->mt_fileno, Xmtp->mt_blkno, mtp->mt_flags, mtp->mt_bf); X#endif X break; X case MTIOCTOP: X mop = (struct mtop *)arg; X ret = rmtioctl(remfd, mop->mt_op, mop->mt_count); X break; X default: X comerrno(ENOTTY, "Invalid mtioctl.\n"); X /* NOTREACHED */ X } X#else X comerrno(EX_BAD, "Remote tape support not present.\n"); X#endif X } else { X#ifdef HAVE_IOCTL X if (cmd == MTIOCGET) { X struct mtget mtget; X X ret = ioctl(mtfd, cmd, &mtget); X if (ret >= 0) { X if (_mtg2rmtg((struct rmtget *)arg, &mtget) < 0) X ret = -1; X } X } else X ret = ioctl(mtfd, cmd, arg); X#else X ret = -1; X#ifdef ENOSYS X seterrno(ENOSYS); X#else X seterrno(EINVAL); X#endif X#endif X } X return (ret); X} END-of-star-1.6/mt/mt.c echo x - star-1.6/mt/Makefile.man sed 's/^X//' >star-1.6/mt/Makefile.man << 'END-of-star-1.6/mt/Makefile.man' X#ident %W% %E% %Q% X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= smt XMANSECT= $(MANSECT_CMD) XMANSUFFIX= $(MANSUFF_CMD) XMANFILE= smt.1 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/mt/Makefile.man echo x - star-1.6/mt/smt.1 sed 's/^X//' >star-1.6/mt/smt.1 << 'END-of-star-1.6/mt/smt.1' X. \" @(#)smt.1 1.2 18/05/22 Copyr 2004-2018 J. Schilling X. \" Manual Seite fuer smt X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.75n'U X.if t .ds s \\(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH SMT 1 "2018/05/22" "J\*org Schilling" "Schily\'s USER COMMANDS" X.SH NAME Xsmt \- magnetic tape control X.SH SYNOPSIS X.B smt X[ X.BI \-f " tapename X] X.I command X[ X.I count X] X.SH DESCRIPTION X.PP XThe X.B smt Xprogram sends commands to a local or a remote magnetic tape drive. X.PP XThe X.I count Xoperand specifies the number of times the requested command is Xto be performed. If X.I count Xis omitted, the value of X.I count Xdefaults to one. X.SH OPTIONS X.TP X.B \-help XPrints a summary of the options for X.BR smt (1) Xand exits. X.TP X.B \-version XPrints the X.B smt Xversion number string and exists. X.TP X.B \-debug Xprint additional debug messages. X.TP X.BI \-f " tapename X.TP X.BI \-t " tapename XSet the raw tape device to use, otherwise X.B smt Xuses a system specific default for the rtape device. XIf X.B smt Xis installed suid root or if it has been called by root, X.I tapename Xmay be in remote syntax: user@host:filename as in X.BR rcp (1) Xeven if Xinvoked by non root users. XSee SUID NOTES for more information. X.sp XTo make a file local although it includes a colon (:), the filename Xmust start with: X.IR "'/'" , X.IR "'./'" " or" X.I "'../'" X.sp XNote that if X.B smt Xtalks to an old X.B rmt Xremote tape server that does not support symbolic open modes, Xit does not open a remote tape with the X.B O_CREAT Xopen flag because this would be extremely dangerous. XIf the X.B rmt Xserver on the other side is the X.B rmt Xserver that comes with X.B star Xor the GNU X.B rmt Xserver, X.B smt Xmay use the symbolic mode for the open flags. XOnly the symbolic open modes allow to send all possible open Xmodes in a portable way to remote tape servers. X.sp XIt is recommended to use the X.B rmt Xserver that comes with X.BR star . XIt is the only X.B rmt Xserver that gives platform independent compatibility with BSD, Sun and GNU X.B rmt Xclients and it includes security features that may be set up in /etc/default/rmt. X.sp XSee ENVIRONMENT section for information on how to use X.B ssh(1) Xto create a remote tape server connection. X.TP X.B \-wready XWait for the tape drive to become ready before executing the command. X.SH COMMANDS XThe following commands are supported: X.TP 12 X.B eof X.TP X.B weof XWrite X.I count XEOF (FILE) marks at the current position on the tape. X.sp XThis command may be run remotely with any BSD compliant old rmt server. X.TP X.B fsf XForward skip over X.I count XFILE marks. XThe tape is positioned on the first block of the file. X.sp XThis command may be run remotely with any BSD compliant old rmt server. X.TP X.B bsf XBackward skip X.I count XFILE marks. XThe tape is positioned on side of the FILE mark Xthat is closer to the beginning of the tape. X.sp XThis command may be run remotely with any BSD compliant old rmt server. X.TP X.B asf XAbsolute FILE mark positioning to file number X.IR count . XThis is equivalent to a rewind followed by a X.BI fsf " count. X.sp XA RMT version 1 server is needed to run this command on a remote tape drive. X.TP X.B fsr XForward skip X.I count Xtape records. X.sp XThis command may be run remotely with any BSD compliant old rmt server. X.TP X.B bsr XBackward skip X.I count Xtape records. X.sp XThis command may be run remotely with any BSD compliant old rmt server. X.TP X.B rewind XRewind the tape. X.sp XThis command may be run remotely with any BSD compliant old rmt server. X.TP X.B offline X.TP X.B rewoffl XRewind the tape. XIf the specified tape drive allows to take the drive off-line Xor to unload the tape, a off-line or unload operation is performed Xin addition. X.sp XThis command may be run remotely with any BSD compliant old rmt server. X.TP X.B status XRetrieve and print status information for the tape drive. X.sp XA RMT version 1 server is needed to get correct status information Xon a remote tape drive. X.TP X.B nop XNo operation. XIf you only like to wait for the tape drive to become ready, call X.BR "smt -wready nop" . X.sp XThis command may be run remotely with any BSD compliant old rmt server. X.TP X.B retension XRetension the tape. This only makes sende with cartridge tape drives. X.sp XA RMT version 1 server is needed to run this command on a remote tape drive. X.TP X.B erase XErase the entire tape. This may take a long time (up to several hours) Xdepending on the tape drive and the medium. X.sp XA RMT version 1 server is needed to run this command on a remote tape drive. X.TP X.B eom XPosition the tape to the end of the recorded media. XThis allows to append data to previously written tapes. X.sp XA RMT version 1 server is needed to run this command on a remote tape drive. X.TP X.B nbsf XBackward skip X.I count XFILE marks. XThe tape is positioned on side of the FILE mark Xthat is closer to the end of the tape. This is before the first Xblock of the file. XThe X.B nbsf Xcommand is equivalent to X.I count+1 X.B bsf's Xfollowed by one X.BR fsf . X.sp XA RMT version 1 server is needed to run this command on a remote tape drive. X.TP X.B load XIf the specified tape drive allows to take the drive on-line Xor to load the tape, a on-line or load operation is performed. Xin addition. XFor remote tape drives, this command only works if the remote tape server Xsupports symbolic open modes as the command needs the X.I O_NDELAY Xflag to succeed. X.sp XA RMT version 1 server is needed to run this command on a remote tape drive. X.SH EXAMPLES X.SH ENVIRONMENT X.TP X.B RSH XIf the X.B RSH Xenvironment is present, the remote connection will not be created via X.BR rcmd (3) Xbut by calling the program pointed to by X.BR RSH . XUse e.g. X.BR RSH= /usr/bin/ssh Xto create a secure shell connection. X.sp XNote that this forces X.B smt Xto create a pipe to the X.B rsh(1) Xprogram and disallows X.B smt Xto directly access the network socket to the remote server. XThis makes it impossible to set up performance parameters and slows down Xthe connection compared to a X.B root Xinitiated X.B rcmd(3) Xconnection. X.TP X.B RMT XIf the X.B RMT Xenvironment is present, the remote tape server will not be the program X.B /etc/rmt Xbut the program pointed to by X.BR RMT . XNote that the remote tape server program name will be ignored if you log in Xusing an account that has been created with a remote tape server program as Xlogin shell. X.TP X.B TAPE XIn case no X.B \-f Xoption pas been specified, the default tape name is taken from the X.B TAPE Xenvironment. X X.SH FILES X.SH "SEE ALSO" X.BR spax (1), X.BR suntar (1), X.BR scpio (1), X.BR tar (1), X.BR cpio (1), X.BR pax (1), X.BR rcp (1), X.BR mt (1), X.BR rmt (1), X.BR match (1), X.BR dd (1), X.BR sdd (1), X.BR rsh (1), X.BR ssh (1), X.BR star (1), X.BR star (4/5), X.BR rcmd (3), X.SH DIAGNOSTICS X.SH NOTES XIf the remote tape server is running Linux and the remote tape server on Xsuch a system is not the rmt server that comes with X.BR star (1), Xthen completely unexpected results (including unexpectedly erased tapes) Xmay occur. This is because Linux ignores the numbering values for the Xmagnetic tape op codes and only the rmt server from X.BR star (1) Xmaps to standard values. XThe standard rmt server on Linux for this reason may not be called XBSD compliant. X.SH BUGS X.SH AUTHOR X.nf XJ\*org Schilling XSeestr. 110 XD\-13353 Berlin XGermany X.fi X.PP XMail bugs and suggestions to: X.PP X.B Xjoerg.schilling@fokus.fraunhofer.de Xor X.B Xjoerg@schily.net END-of-star-1.6/mt/smt.1 echo x - star-1.6/mt/mt.mk1 sed 's/^X//' >star-1.6/mt/mt.mk1 << 'END-of-star-1.6/mt/mt.mk1' X#ident "@(#)mt.mk1 1.1 10/05/12 " X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= mt XMANSECT= $(MANSECT_CMD) XMANSUFFIX= $(MANSUFF_CMD) XMANFILE= mt.1 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/mt/mt.mk1 echo x - star-1.6/mt/mt.1 sed 's/^X//' >star-1.6/mt/mt.1 << 'END-of-star-1.6/mt/mt.1' X.so man1/smt.1 X.\" "@(#)mt.1 1.1 10/05/12 " END-of-star-1.6/mt/mt.1 echo c - star-1.6/libdeflt mkdir -p star-1.6/libdeflt > /dev/null 2>&1 echo x - star-1.6/libdeflt/default.c sed 's/^X//' >star-1.6/libdeflt/default.c << 'END-of-star-1.6/libdeflt/default.c' X/* @(#)default.c 1.11 17/07/15 Copyright 1997-2017 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)default.c 1.11 17/07/15 Copyright 1997-2017 J. Schilling"; X#endif X/* X * Copyright (c) 1997-2017 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include /* For strncasecmp size_t */ X#include X#include X#include /* Define missing prototypes */ X X#define MAXLINE 512 X Xstatic FILE *dfltfile = (FILE *)NULL; Xstatic const char *dfltsect = NULL; Xstatic int dfltflags = DC_STD; X XEXPORT int defltopen __PR((const char *name)); XEXPORT int defltclose __PR((void)); XEXPORT int defltsect __PR((const char *name)); XEXPORT int defltfirst __PR((void)); XEXPORT char *defltread __PR((const char *name)); XEXPORT char *defltnext __PR((const char *name)); XEXPORT int defltcntl __PR((int cmd, int flags)); X XEXPORT int Xdefltopen(name) X const char *name; X{ X if (dfltfile != (FILE *)NULL) { X fclose(dfltfile); X dfltfile = NULL; X } X X if (name == (char *)NULL) { X return (0); X } X X if ((dfltfile = fopen(name, "r")) == (FILE *)NULL) { X return (-1); X } X dfltflags = DC_STD; X dfltsect = NULL; X X return (0); X} X XEXPORT int Xdefltclose() X{ X int ret; X X if (dfltfile != (FILE *)NULL) { X ret = fclose(dfltfile); X dfltfile = NULL; X return (ret); X } X return (0); X} X XEXPORT int Xdefltsect(name) X const char *name; X{ X size_t len; X X if (name == NULL) { X dfltsect = NULL; X return (0); X } X if (*name != '[') X return (-1); X X len = strlen(name); X if (len >= MAXLINE) X return (-1); X if (len < 3 || name[len-1] != ']') X return (-1); X X dfltsect = name; X return (0); X} X XEXPORT int Xdefltfirst() X{ X if (dfltfile == (FILE *)NULL) { X return (-1); X } X rewind(dfltfile); X if (dfltsect) { X register int len; X register int sectlen; X char buf[MAXLINE]; X X sectlen = strlen(dfltsect); X while (fgets(buf, sizeof (buf), dfltfile)) { X len = strlen(buf); X if (buf[len-1] == '\n') { X buf[len-1] = 0; X } else { X continue; X } X if (buf[0] != '[') X continue; X if (dfltflags & DC_CASE) { X if (strncmp(dfltsect, buf, sectlen) == 0) { X return (0); X } X } else { X if (strncasecmp(dfltsect, buf, sectlen) == 0) { X return (0); X } X } X } X return (-1); X } X return (0); X} X XEXPORT char * Xdefltread(name) X const char *name; X{ X if (dfltfile == (FILE *)NULL) { X return ((char *)NULL); X } X defltfirst(); X return (defltnext(name)); X} X XEXPORT char * Xdefltnext(name) X const char *name; X{ X register int len; X register int namelen; X static char buf[MAXLINE]; X X if (dfltfile == (FILE *)NULL) { X return ((char *)NULL); X } X namelen = strlen(name); X X while (fgets(buf, sizeof (buf), dfltfile)) { X len = strlen(buf); X if (buf[len-1] == '\n') { X buf[len-1] = 0; X } else { X return ((char *)NULL); X } X /* X * Check for end of current section. Seek to the end of file to X * prevent other calls to defltnext() return unexpected data. X */ X if (dfltsect != NULL && buf[0] == '[') { X fseek(dfltfile, (off_t)0, SEEK_END); X return ((char *)NULL); X } X if (dfltflags & DC_CASE) { X if (strncmp(name, buf, namelen) == 0) { X return (&buf[namelen]); X } X } else { X if (strncasecmp(name, buf, namelen) == 0) { X return (&buf[namelen]); X } X } X } X return ((char *)NULL); X} X XEXPORT int Xdefltcntl(cmd, flags) X int cmd; X int flags; X{ X int oldflags = dfltflags; X X dfltflags = flags; X X return (oldflags); X} END-of-star-1.6/libdeflt/default.c echo x - star-1.6/libdeflt/Makefile sed 's/^X//' >star-1.6/libdeflt/Makefile << 'END-of-star-1.6/libdeflt/Makefile' X#ident "@(#)Makefile 1.1 06/09/15 " X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMK_FILES= libdeflt.mk libdeflt_p.mk $(NO_SHL)shldeflt.mk X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.mks X########################################################################### END-of-star-1.6/libdeflt/Makefile echo x - star-1.6/libdeflt/libdeflt.mk sed 's/^X//' >star-1.6/libdeflt/libdeflt.mk << 'END-of-star-1.6/libdeflt/libdeflt.mk' X#ident @(#)libdeflt.mk 1.2 11/04/15 X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X X#.SEARCHLIST: . $(ARCHDIR) stdio $(ARCHDIR) X#VPATH= .:stdio:$(ARCHDIR) XINSDIR= lib XTARGETLIB= deflt X#CPPOPTS += -Ispecincl Xinclude Targets XLIBS= X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.lib X########################################################################### X#CC= echo " ==> COMPILING \"$@\""; cc X########################################################################### X END-of-star-1.6/libdeflt/libdeflt.mk echo x - star-1.6/libdeflt/Targets sed 's/^X//' >star-1.6/libdeflt/Targets << 'END-of-star-1.6/libdeflt/Targets' XCFILES= default.c END-of-star-1.6/libdeflt/Targets echo x - star-1.6/libdeflt/libdeflt_p.mk sed 's/^X//' >star-1.6/libdeflt/libdeflt_p.mk << 'END-of-star-1.6/libdeflt/libdeflt_p.mk' X#ident @(#)libdeflt_p.mk 1.3 08/01/11 X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XSUBARCHDIR= /profiled XSUBINSDIR= /profiled X#.SEARCHLIST: . $(ARCHDIR) stdio $(ARCHDIR) X#VPATH= .:stdio:$(ARCHDIR) XINSDIR= lib XTARGETLIB= deflt X#CPPOPTS += -Ispecincl XCOPTS += $(COPTGPROF) Xinclude Targets XLIBS= X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.lib X########################################################################### X#CC= echo " ==> COMPILING \"$@\""; cc X########################################################################### END-of-star-1.6/libdeflt/libdeflt_p.mk echo x - star-1.6/libdeflt/noshldeflt.mk sed 's/^X//' >star-1.6/libdeflt/noshldeflt.mk << 'END-of-star-1.6/libdeflt/noshldeflt.mk' X#ident "@(#)noshldeflt.mk 1.1 06/07/21 " X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X Xall: X @echo " ==> NO shared libs on this platform (yet)" END-of-star-1.6/libdeflt/noshldeflt.mk echo x - star-1.6/libdeflt/shldeflt.mk sed 's/^X//' >star-1.6/libdeflt/shldeflt.mk << 'END-of-star-1.6/libdeflt/shldeflt.mk' X#ident @(#)shldeflt.mk 1.1 05/06/13 X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XSUBARCHDIR= /pic X#.SEARCHLIST: . $(ARCHDIR) stdio $(ARCHDIR) X#VPATH= .:stdio:$(ARCHDIR) XINSDIR= lib XTARGETLIB= deflt X#CPPOPTS += -Ispecincl Xinclude Targets XLIBS= -lc X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.shl X########################################################################### X#CC= echo " ==> COMPILING \"$@\""; cc X########################################################################### END-of-star-1.6/libdeflt/shldeflt.mk echo x - star-1.6/libdeflt/libdeflt-mapvers sed 's/^X//' >star-1.6/libdeflt/libdeflt-mapvers << 'END-of-star-1.6/libdeflt/libdeflt-mapvers' X# /* @(#)libdeflt-mapvers 1.2 13/09/12 Copyright 2005-2013 J. Schilling */ X XSCHILY_1.1 { Xglobal: X defltsect; X X} SCHILY_1.0; X XSCHILY_1.0 { Xglobal: X defltopen; X defltfirst; X defltclose; X defltcntl; X defltnext; X defltread; X Xlocal: X *; X}; END-of-star-1.6/libdeflt/libdeflt-mapvers echo x - star-1.6/AN-1.3 sed 's/^X//' >star-1.6/AN-1.3 << 'END-of-star-1.6/AN-1.3' XNewsgroups: comp.unix.admin,comp.unix.misc,alt.os.linux,alt.sys.sun,bln.comp.sun,bln.comp.unix,comp.os.linux.development.apps,comp.os.linux.misc,comp.sys.hp.apps,comp.sys.hp.misc,comp.sys.sgi.admin,comp.sys.sgi.apps,comp.sys.sgi.misc,comp.sys.sun.admin,comp.sys.sun.apps,comp.sys.sun.misc,comp.unix.aix,comp.unix.bsd.freebsd.misc,comp.unix.bsd.netbsd.misc,comp.unix.solaris,de.comp.os.linux.misc,de.comp.os.unix,linux.dev.admin,linux.dev.apps,maus.os.linux,maus.os.linux68k,maus.os.unix,uk.comp.os.linux XSubject: Star-1.3 source has been released X XStar is the fastest tar archiver for UNIX X XStar has many improvements compared to other tar Ximlementations (including gnu tar). See below for a short description Xof the highlight of star. X XStar is located on: X Xftp://ftp.fokus.gmd.de/pub/unix/star X XChanges since star-1.2: X X- star -c now don't uses STDIO X This speeds things up (15% on Solaris 50% on Linux due to the bad X STDIO implementation on Linux) X X Star now usually needs significant less user CPU time than GNU tar. X X On Intel processors star uses about the same CPU time than GNU tar. X This is because star uses structured code which is punished by the X Intel Processor implementation. X X Star is now at least 30% faster than ufsdump X X- Experimental -Hxustar option to create xstar archives without the X extra 'tar' signature at the end of the tar header. X This makes the xstar format 100% POSIX compliant too. X X- Compat code for old tar option behaviour. X Allows all but to use "tar -cf file" on an existent file. X tar -cf file remains valid if "file" does not exist or is empty. X This keeps the star behaviour not to clobber files on miss typed X command lines and gives old tar compatibility. X X- star now realises if the tar archive is too small and not a multiple X of 512 bytes. X X- Converted to the new makefile system that uses autoconf. X X- -u/-r options enabled X X- -diff now checks for sparse files too. X Note that this will give probems if the file is located on a buggy X HP-UX NFS file server. X X- -F option new to exclude *.o SCCS/* and similar X X- -w optionm as alias for -I X -I will go away with old behavior in star-1.4 X X- Exit code now reflects the status of the exeution X X- New error statistic prints counts for several common error situations. X X- Print a warning if found more than 12 Bits in mode Feld X This helps to find non POSIX compliant Sun tar & GNU tar archives X X X- Added code to use the _FIOAI ioctl on Solaris to speed up X archiving sparse files > 200 times. You need a hacked X ufs filesystem in order to use this on Solaris 2.6 X ftp://ftp.fokus.gmd.de/pub/unix/kernel/ufs X X- Workaround for a bug in Sun's tar on Solaris that creates X illegal null terminated filenames (if the filename is X exactly 100 chars long). X X- Fixed a problem with autoconf & SCO for major()... X X- Check VOLHDR on extract X X- New option -bz to call bzip2 as compress program. X X- added O_BINARY to allow star to work corectly on Cygwin32 X X- Avoid seekdir() in Cygwin32 X X- New option -refresh-old-files to prevent star from creating X new files while extracting an archive. X X- Don't strip leading '/' from targets of symlinks X X- Star now knows that that DOS filesystems increment the time X stamp of a file only in 2 second steps. X This is needed to make the skipping of older files on extraction X work correctly. X X- Correctly skip a file on tape if the filename is longer than the X OS can handle. X X- Always make the path tables at least 1024 bytes even when the actual OS X does not allow that much. This helps to read archives from other OS. X X- Workaround for the Cygwin bug that causes maxfilename to be longer X than maxpathname. X X- Workaround for Cygwin bug that return ENOTEMPTY for X rmdir() if the arg does not refer to a directory. X *********** X We need to check this if Cygwin-1.x hast been corrected X *********** X X- Workaround for the fact that Cygwin32 does not allow us to set the X file access times for read only files. X X- Print warning for unknown archive types. X X- Knowledge base for X X Packed, Gzip compressed, LZW compressed, Freezed, X SCO LZH compressed and bzip2 X X compressed magic numbers gives hints for correct usage of -z or -bz X options. Tell user about the compression program that will X help to unpack the archive. X X- Star offeres full FIFO and remote tape access support even X on Cygwin32. X X- Better portability support X X- Support for various new OS platforms (e.g. QNX) X X- New option -refresh as alias to -refresh-old-files X X- New option -hpdev allows 24 bits in dev_minor using 8 octal X digits. Note that although it allows to ctreate tar archives X that can be read with HP-UX tar, this creates tar archives X which violate POSIX. X X- New option -modebits allows to create tar archives that include X more than 12 bits from st_mode. Note this create tar archives X that violate POSIX but some tar implementations insist in reading X such nonstandard archives.... X X- New option -copylinks allows to copy hard/symlinks targets X rather than creating a link. This helps to extract tar files X on systems that do not implement links (e.g. OS/2). X X- Print a message for EFBIG on the archive X X- Suppress the sync pipe read error messages when another X error message is already printed and the sync pipe read error X is only a result of this other error. X X- set the time of a file to 0 (1. Jan 1970) if an error occurs. X This allows to use another runf of star to overwrite this file X whithout having to specify the -U flag. X X- Use fsync() to force file consistence on NFS filesystems. X X- Allow 7 octal numbers in 8 Byte fields in POSIX mode. X This gives 21 bits in minor device numbers. X X- New base 256 coding allows 63 bits in minor device numbers. X This coding has been negotiated with the new gnutar X maintainer. X Warning, this is not yet 100% stable code but it allows X to archive device files on FreeBSD. X X- Use mkfifo() if present X X- Add remove_file support to more than plain files only. X X- Added FIFO suport for OS/2 X X- Better portability support X X- Automated de-configuration of the FIFO on platforms X that do not support shared memory X X- Fix for a buffer overflow problem with remote tape access. X X- Remote tape client in star now supports the GNU extension X for the open command that transmitts abstract open(2) flags. X X- Now includes a /etc/rmt remote tape server. X This is the first open source remote tape server that X is as portable and interoperable as possible. X Support for Sun and GNU extensions. X X- New mt program X X- rmt Program now supports additional security features X that are driven by entries in /etc/default/rmt X X- Man page created for rmt. X X- align_test.c removed from lib/ X X- avoffset.c removed from lib/ X X- several functions now use js_snprintf() instead of X sprintf() X X- star now supports to open remote files with O_CREATE X if the remote tape sever (/etc/rmt) is the Schily rmt X sever or the GNU rmt server X X- Format strings of printf-like functions checked and corrected. X X- FIFO now should work on OS/2 too X X- Fixed a autoconf typo in star_unix.c that X disabled _FIOSATIME and thus star -c -atime ... X did modify ctime when trying to reset atime after X reading a file. X X- Fixed a typo in mt.c (active if no default tape definition exists) X X- Allow mt.c to compile on systems that have no sys/mtio.h X e.g. SCO X X- mt.c will now compile on HP-UX X X- support for win98-2 & win2000 & Win ME X X- star list= ... will now skip empty lines (llen == 0) X X- Support for dev_t > 32 bits (e.g. Solaris in 64 bit mode) X X- Support for Apollo Domain/OS (e.g. mmap() specials) X X- Support for MacOS X (Darwin) X X- Support for GCC on IRIX X X- New option -onull as alias for -nullout to make star behave similar to sdd X X- Made all options that include a '_' obolete and replaced X '_' by '-' in the option names. X X- Long Listing now prints a 'l' for files with mandatory record locking X X- Long listing for major/minor now unsigned X X- timedefs.h typo fixed (caused time.h & sys/time.h never be both included) X X XRevision history (short) X X1982 First version on UNOS (extract only) X1985 Port to UNIX (fully funtional version) X1985 Added pre Posix method of handling special files/devices X1986 First experiments with fifo as external process. X1993 Remote tape access X1993 diff option X1994 Fifo with shared memory integrated into star X1994 Very long filenames and sparse files X1994 Gnutar and Ustar(Posix) handling added X1994 Xstar format (extended Posix) defined and introduced X1995 Ported to many platforms X XSupported platforms: X XSunOS 4.x, Solaris (SunOS 5.x), Linux, XHP-UX, DG/UX, IRIX, AIX, FreeBSD, NetBSD, OpenBSD, XOSF-1, True-64, BeOS, Apollo Domain/OS, Next-STep, XOS/2, SCO-openserver, SCO-unixware, Cygwin (Win32), XSony NewsOS, BSDi (BSD/OS), QNX, Apple Rhapsody, XMacOS X X XJoerg X X------------------------------------------------------------- XStar is the fastest known implementation of a tar archiver. XStar is able to make backups with more than 12MB/s if the Xdisk and tape drive support such a speed. This is more than Xdouble the speed that ufsdump will get. XAmpex got 13.5 MB/s with their new DLT tape drive. XUfsdump got a maximum speed of about 6MB/s with the same hardware. X XStar development started 1982, development is still in progress. XThe current version of star is stable and XI never did my backups with other tools than star. X XIts main advantages over other tar implementations are: X X fifo - keeps the tape streaming. X This gives you faster backups than X you can achieve with ufsdump, if the X size of the filesystem is > 1 GByte. X X pattern matcher - for a convenient user interface X (see manual page for more details). X To archive/extract a subset of files. X X sophisticated diff - user tailorable interface for comparing X tar archives against file trees X This is one of the most interesting parts X of the star implementation. X X no namelen limitation - Pathnames up to 1024 Bytes may be archived. X (The same limitation applies to linknames) X This limit may be expanded in future X without changing the method to record long names. X X deals with all 3 times - stores/restores all 3 times of a file X (even creation time) X may reset access time after doing backup X X does not clobber files - more recent copies on disk will not be X clobbered from tape X This may be the main advantage over other X tar implementations. This allows X automatically repairing of corruptions X after a crash & fsck (Check for differences X after doing this with the diff option). X X automatic byte swap - star automatically detects swapped archives X and transparently reads them the right way X X automatic format detect - star automatically detects several common X archive formats and adopts to them. X Supported archive types are: X Old tar, gnu tar, ansi tar, star. X X fully ansi compatible - Star is fully ANSI/Posix 1003.1 compatible. X See README.otherbugs for a complete description X of bugs found in other tar implementations. X XHave a look at the manual page, it is included in the distribution. X XAuthor: X XJoerg Schilling XSeestr. 110 XD-13353 Berlin XGermany X XEmail: joerg@schily.isdn.cs.tu-berlin.de, js@cs.tu-berlin.de X schilling@fokus.gmd.de X XPlease mail bugs and suggestions to me. END-of-star-1.6/AN-1.3 echo x - star-1.6/AN-1.3.1 sed 's/^X//' >star-1.6/AN-1.3.1 << 'END-of-star-1.6/AN-1.3.1' XNewsgroups: comp.unix.admin,comp.unix.misc,alt.os.linux,alt.sys.sun,bln.comp.sun,bln.comp.unix,comp.os.linux.development.apps,comp.os.linux.misc,comp.sys.hp.apps,comp.sys.hp.misc,comp.sys.sgi.admin,comp.sys.sgi.apps,comp.sys.sgi.misc,comp.sys.sun.admin,comp.sys.sun.apps,comp.sys.sun.misc,comp.unix.aix,comp.unix.bsd.freebsd.misc,comp.unix.bsd.netbsd.misc,comp.unix.solaris,de.comp.os.linux.misc,de.comp.os.unix,linux.dev.admin,linux.dev.apps,maus.os.linux,maus.os.linux68k,maus.os.unix,uk.comp.os.linux XSubject: Star-1.3 source has been released X XStar is the fastest tar archiver for UNIX X XStar has many improvements compared to other tar Ximlementations (including gnu tar). See below for a short description Xof the highlight of star. X XStar is located on: X Xftp://ftp.fokus.gmd.de/pub/unix/star X XChanges since star-1.3: X X- Fixed a bug introduced a few days before releasing 1.3 that X caused star -atime not to work on Solaris. X X Star now again is able to do archiving without modifying X times on Solaris if the user us root. X X XRevision history (short) X X1982 First version on UNOS (extract only) X1985 Port to UNIX (fully funtional version) X1985 Added pre Posix method of handling special files/devices X1986 First experiments with fifo as external process. X1993 Remote tape access X1993 diff option X1994 Fifo with shared memory integrated into star X1994 Very long filenames and sparse files X1994 Gnutar and Ustar(Posix) handling added X1994 Xstar format (extended Posix) defined and introduced X1995 Ported to many platforms X XSupported platforms: X XSunOS 4.x, Solaris (SunOS 5.x), Linux, XHP-UX, DG/UX, IRIX, AIX, FreeBSD, NetBSD, OpenBSD, XOSF-1, True-64, BeOS, Apollo Domain/OS, Next-STep, XOS/2, SCO-openserver, SCO-unixware, Cygwin (Win32), XSony NewsOS, BSDi (BSD/OS), QNX, Apple Rhapsody, XMacOS X X XJoerg X X------------------------------------------------------------- XStar is the fastest known implementation of a tar archiver. XStar is able to make backups with more than 12MB/s if the Xdisk and tape drive support such a speed. This is more than Xdouble the speed that ufsdump will get. XAmpex got 13.5 MB/s with their new DLT tape drive. XUfsdump got a maximum speed of about 6MB/s with the same hardware. X XStar development started 1982, development is still in progress. XThe current version of star is stable and XI never did my backups with other tools than star. X XIts main advantages over other tar implementations are: X X fifo - keeps the tape streaming. X This gives you faster backups than X you can achieve with ufsdump, if the X size of the filesystem is > 1 GByte. X X pattern matcher - for a convenient user interface X (see manual page for more details). X To archive/extract a subset of files. X X sophisticated diff - user tailorable interface for comparing X tar archives against file trees X This is one of the most interesting parts X of the star implementation. X X no namelen limitation - Pathnames up to 1024 Bytes may be archived. X (The same limitation applies to linknames) X This limit may be expanded in future X without changing the method to record long names. X X deals with all 3 times - stores/restores all 3 times of a file X (even creation time) X may reset access time after doing backup X X does not clobber files - more recent copies on disk will not be X clobbered from tape X This may be the main advantage over other X tar implementations. This allows X automatically repairing of corruptions X after a crash & fsck (Check for differences X after doing this with the diff option). X X automatic byte swap - star automatically detects swapped archives X and transparently reads them the right way X X automatic format detect - star automatically detects several common X archive formats and adopts to them. X Supported archive types are: X Old tar, gnu tar, ansi tar, star. X X fully ansi compatible - Star is fully ANSI/Posix 1003.1 compatible. X See README.otherbugs for a complete description X of bugs found in other tar implementations. X XHave a look at the manual page, it is included in the distribution. X XAuthor: X XJoerg Schilling XSeestr. 110 XD-13353 Berlin XGermany X XEmail: joerg@schily.isdn.cs.tu-berlin.de, js@cs.tu-berlin.de X schilling@fokus.gmd.de X XPlease mail bugs and suggestions to me. END-of-star-1.6/AN-1.3.1 echo x - star-1.6/AN-1.4 sed 's/^X//' >star-1.6/AN-1.4 << 'END-of-star-1.6/AN-1.4' XNewsgroups: comp.unix.admin,comp.unix.misc,alt.os.linux,alt.sys.sun,bln.comp.sun,bln.comp.unix,comp.os.linux.development.apps,comp.os.linux.misc,comp.sys.hp.apps,comp.sys.hp.misc,comp.sys.sgi.admin,comp.sys.sgi.apps,comp.sys.sgi.misc,comp.sys.sun.admin,comp.sys.sun.apps,comp.sys.sun.misc,comp.unix.aix,comp.unix.bsd.freebsd.misc,comp.unix.bsd.netbsd.misc,comp.unix.solaris,de.comp.os.linux.misc,de.comp.os.unix,linux.dev.admin,linux.dev.apps,maus.os.linux,maus.os.linux68k,maus.os.unix,uk.comp.os.linux XSubject: Star-1.4 source has been released X X*************** XPlease have a look at the German open Source Center BerliOS at www.berlios.de XBerliOS will continue to support free hosting of cryptography projects even Xwhen US laws change and don't allow to host cryptography projects in the USA. XAlso look at sourcewell.berlios.de, the first Open Source announcement service Xthat itself is implemented as Open Source project. X*************** X XStar is the fastest tar archiver for UNIX X XStar has many improvements compared to other tar Ximplementations (including gnu tar). See below for a short description Xof the highlight of star. X XStar is located on: X Xftp://ftp.fokus.gmd.de/pub/unix/star X XChanges since star-1.3.1: X X- Used lint on Solaris to clean up code. X GCC does not help that much.... X X- star now supports large files X X Files up to 8 GB are supported in a 100% POSIX compliant X way. Files > 8 GB use a proprietary number format that I designed X some years ago but I negotiated this format with the current X GNU tar maintainer - GNU tar uses the same format. X X- rmt now is large file aware too. X X- rmt (both: this server and the client in star) X now also abstract from the lseek whence values. X X SEEK_SET is mapped to 0 on the wire X SEEK_CUR is mapped to 1 on the wire X SEEK_END is mapped to 2 on the wire X X- Changed POSIX USTAR limitation from 8 GB-2 to 8 GB-1. X (note that the proprietary star method allows full X 64 bit filesize and will support up to 95 bits which X will _never_ be reached as long as you cannot place X storage space into a parallel universe ;-) X This is from the estimation that each atom may only store X approx 1 bit. With 95 bits you would need to use several X tons of active storage mass. X X- Honor Volheader file size when extracting archives. X X- Clear fraction of 512 bytes past the end of a file. X This was _no_ security problem as star never included any X junk that was not already part of the archive earlier. X It is done as it turns out that archives with lots of small X files (ad the FreeDB CD database) will compress more then X 20 % more effective if this space is clreared. X X- Automatic recognition and adoption to tar archives with X signed checkums. Signed checkums are needed to read tar archives X created with old SunOS-3.x and SunOS-4.x tar programs. X Note that the UNIX tar documentation always requested unsigned X checksums but the BSD based tar used to ignore this fact. X X- Atomatic use of compression programs (if needed) if the archive X is a plain file and thus seekable. X X- use non-interruptable write in remote tape handler. X This makes star .... interruped by ^\ work corectly on non BSD X systems. Note that interrupting star by ^\ causes star to X write an intermediate statistic printout. X X- rmt now uses buffered readline code re-imported from rscsi.c X to speed up rmt transfers. X X- increase the default FIFO from 1 MB to 8 MB for most OS. X X- Try to lock FIFO into memory in case star is run by root. X This helps to make tape streaming more probable. X X- -h Option as alias to the old star Option -L X X- Make -F -FF ... behave more similar to BSD tar X X- Remote tape client code now checks if the RMT server returns X more data with rmtread() or if rmtstatus() gets not the expected amount X of bytes for struct mtget. X X- Call code to switch rmt server into the new abstract mode only of the X open was successful. This avoids to clear the valid error code X resulting in the unability to report open errors on previous versions. X X- New remote.c client code gives improved unique remote file name parsing X To make a file local altough it looks "remote" prepend it X with "/", "./" or "../" X X f=ntape@tapehost:/dev/rmt/0 is remote X f=/ntape@tapehost:/dev/rmt/0 is local X X- Now star is again able to reject unsupported file types as it has been X up to 1994 when the USTAR & GNU based archive types have been X introduced. X X The new method to check for unsupported file types is again table X driven and thus fully configurable. X X- stat wrapper now fully classifies all file types X X- new table to print the name for all known file types X X- mt.c now uses the new remote file name parsing functions X X- NOTE: the new remote tape client code is also used by sdd-1.31 and X newer. If you like to have a enhanced "dd" substitution, check: X X ftp://ftp.fokus.gmd.de/pub/unix/sdd/ X X Now you can make any tar work remote (even GNU tar ;-) by calling e.g.: X X sdd if=ntape@tapehost:/dev/rmt/0cbn bs=63k | tar tvbf 126 - X X- Added a comment in star.h to clearify when/why GNUtar became X non-standard X X- Fixed a bug with printing to stdout while the tar archive X itself is stdout. X X- Faster zero'ing and copying of tar headers to speed up operation. X Used to compensate slow down from Extended POSIX.1-2001 headers. X X- Fixed a integer overflow bug in tape length computation that made X it impossible to specify a tape length of e.g. 35 GB as needed X for the Quantum DLT-7000. X X- append.c (used with -u/-r) now tries to use Nanoseconds from time X stamps X X- list.c now tries to handle Nanoseconds with the -newest & -newest-file X options X X- New archive format "pax" which is the extended "ustar" proposal X from POSIX.1-2001. This format is based on "ustar" and adds X extended headers that are infinite extensible. The headers are X added only when the old header would overflow otherwise. X X- New archive format "exustar" which is the extended "xustar" format. X This format is based on "xustar" and always adds extended headers. X X- New archive format "sunstar" which is an extended "ustar" format. X This format based on "ustar" always adds extended headers. X The extended headers are not 100% POSIX compliant: X X - no atime/ctime X X - typeflag is 'X' instead of 'x' X X- First support for extended tar headers from POSIX.1-2001. X X- Support for Caldera/SCO OpenUNIX has been added X X- New sum statistics for chmod() utimes() errors. X X- Fixed a bug that caused a FIFO (named pipe) to be created twice X in extract mode. This resulted in a warning "File exists...". X X- Better support for True-64 aka. OFS-1 X X- First support for POSIX ACL's with help from X Andreas Gruenbacher X First support for Solaris ACL's (converted into POSIX strings). X X ACL support should work on Solaris, Linux, FreeBSD and True64..... X X X Solaris ACL's are smilar enough to POSIX ACL's so I convert them to X POSIX ACLs before archiving them. Unfortunately the function X aclfromtext() from the Solaris library libsec is not usable X (see **** Solaris BUG *** description below). This bug makes it X impossible to do ACL backup/restores on passwd-less file servers. X X **** Solaris is unable to restore ACLs numerically (see description X **** below). X X HP-UX ACLs are so different from POSIX.1e that it would take a X significant amount of time to code a translation module for star. X For this reason, HP-UX is not supported at the moment. X X **** First tests on True64 show that the POSIX.1e function X **** acl_from_text() does not work as expected. I have no idea how to X **** work around this problem. X **** It may be that True64 does not support the ACL 'masks' entry. X **** This would force us to create syntetic 'mask' entries when in star X **** create mode and to compute the effective mode when in extract X **** mode. On True64 also the function acl_get_file() does not work X **** properly if a file does not have ACLs. Note that the standard X **** requests that in this case acl_get_file() should return a 3 entry X **** ACL, but on True64 it returns NULL with 'errno' unchanged. X **** Archiving and restoring ACLs from/to True64 will most likely work. X **** If you like to transfer TAR archives from/to other platforms you X **** will not be able to restore any ACL. X **** X **** As a TAR archive with ACLs made on True64 is not usable on any X **** other system, ACL support on True64 could be called broken. X X X If you list a TAR archive that contains ACLs for certain files, X those files are marked with a '+' sign past the UNIX permissions X if you request a long listing: X X 0 -rw-r--r-- gruenbacher/assis Nov 4 04:43 2001 default/file X 0 drwxrwxr-x+ gruenbacher/assis Nov 4 04:43 2001 default/dir2/ X 0 drwxr-xr-x+ gruenbacher/assis Nov 4 04:44 2001 default/dir3/ X 0 drwxrwxr-x+ gruenbacher/assis Nov 4 04:44 2001 default/ X X If you like ACL test tar archives, have a look at: X X http://acl.bestbits.at/pre/ X X and fetch the files acl*.tar X X If you are on Solaris, read the man pages: getfacl, setfacl, acl X X If you are on Linux, note that by default Linux does not yet support X ACLs. You first need to install ACL support by installing a patch X from: X http://acl.bestbits.at/ X X This page also lists the man pages for the ACL support commands X for Linux. X X If you are on FreeBSD current, you need to know that you need to X activate ACLs in the kernel _and_ in each filesystem that should X carry ACLs. X X If you are on True64, note that you first need to activate extended X security features in order to use ACLs. X The administratice command names to list or set ACLs are 'getacl' and X 'setacl'. X X Note: The ACL support code in star is alpha! Do not expect it to be X stable in any part. I cannot even grant that the archive format X will not change. However, if it turns out to be the right solution, I X will mail the star ACL format to the POSIX.1e standard commitee. X All changes have been made in a way that does not affec the behaviour X of star in case no ACLs are present. X X The format for ACLs in the extended headers used by star looks like: X X SCHILY.acl.access=user::rwx,group::rwx,mask::rwx,other::rwx X SCHILY.acl.default=user::rwx,group::rwx,mask::rwx,other::rwx X X This is a legal 'vendor unique' POSIX.1-2001 extension for extended X tar headers. X X If the format gets accepted by the POSIX.1 and POSIX1e commitee, it X would look like: X X security.acl...=user::rwx,group::rwx,mask::rwx,other::rwx X X As the text format specified by POSIX.1e is not sufficient for TAR, we X added a numerical field for all names user and group fields. X X POSIX.1e named user entry: 'user:joe:rwx,' X STAR named user entry: 'user:joe:rwx:1431,' X X When star extracts the ACL string, it first checks if user 'joe' is X known if 'joe' is known, the numerical value is stripped off and a X standard POSIX.1e ACL entry is created. If 'joe' is not known, the X text 'joe' is replaced by the numerical value '1431' and a new X POSIX.1e entry that looks like 'user:1431:rwx,' is created. X X **** Solaris BUG *** X As the function aclfromtext() on Solaris is unable to recognise a X numerical (all digit) user id, it is not possible to do ACL X backup/restore on a Solaris fileserver that has no access to the same X passwd data as it's NFS clients. X X Even worse, aclfromtext() changed the UID for each unknown user to X NOBODY and the function aclfromtext() returns as if there was no error. X This is a serious security problem as because if this behavior the file X becomes (in addition to the other users in the ACL) accessible by X "nobody" which definitely is intended. X X This is Sun bug 4426407 ;-) X **** Solaris BUG *** X X X To archive ACLs (star in create mode, you need to specify a TAR format X that supports extended POSIX.1-2001 headers _and_ uses them by default. X This may currently be achieved by calling "star -Hexustar ...". X X To extract ACLs you need to call "star -p ..." X X Note that the needed actions to archive ACLs or to extract ACLs may X change in the near future. X X- For hints on the new Access Control List support read README.ACL X X- When remote protocol error happen (e.g. because the remote server X proces dies) star now aborts faster and with better error message. X X- Check for HAVE_FORK to allow compilation (without FIFO) on strange X platforms. X X- star now supports 'G' as "multiplyer" in fs= bs= ... options. X X- Support for MacOSX-10.1 (aka Darwin-1.4) now works smoothly X X- Restructured Schily portability include files for easier and cleaner X portability X X- Better Linux support for the program 'mt'. It now prints the X file number and record number when calling 'mt status'. X X- Support for QNX Neutrino X X- Now we hopefully have floating point support for _all_ platforms X even those without *cvt() and without __dtoa(). Thanks to a hint X from Thomas Langer we now use strtod.c X to gert a fallback __dtoa() X X- Added an autoconf test for rcmd() so cdrtools now should compile X again on BeOS and AmigaOS where no rcmd() is present. X X- New option -block-number X This option has been inspired by gnutar, but with gnutar it is X useless as it prints wrong numbers. With star -block-number is X expected to print correct numbers. However star has a higly complex X dataflow because of the FIFO. If you find that it prints wrong numbers X with star, please report so I may check for the reason. X X- Do not try to "diff" Volume headers with star -diff. X This is a pseudo file with no representation in the file system! X X- Better portability for QNX X X- Try to support recent BeOS X X - (has no settimeofday() and some strange network woes) X X - Does not have utimes() but wrong utimes() prototype in X posix/sys/time.h X X - add getpagesize() emulation for BeOS X X - Workaround in libschily/comerr.c for the nonstandard X big negative errno values on BeOS X X- Try to support AmigaOS X X X- Renamed a structure member from f_offset to f_contoffset to allow X compilation on SCO OpenServer which has a macro of the same X name in file.h. X X- First support for filesystem flags (see below) X X- New Option -nodump that implements support for the 'nodump' file X flag on BSD-4.4 derivates and Linux. X On *BSD this works without performance degradation, on Linux the X system time will increase by 10% if -nodump is used. X X- New option -o as alias for -nochown to complete POSIX compatibility. X X- New 'README' file STARvsGNUTAR that is intended to help people X (currently using GNU tar) to use star. X X- Restructured the usage() functions to better deal with the fact that X the usage listing for star has become quite long. X Now every usage error will only result in a short info that gives X a hint what star options may print the needed help information. X X- The option tsize=# now has an increased functionality. X In former times, the argument was the size of a medium in multiples X of TAR blocks. Now the syntax of the bs= option has been added. X X tsize=100 means 100 tape blocks (51200 bytes) X tsize=100m means 100MBytes X tsize=10240. means 10240 Bytes X X- The option maxsize=# now has an increased functionality. X In former times, the argument was the size of a file in kBytes. X Now the syntax of the bs= option has been added. X X maxsize=100 means 100 kBytes X maxsize=100m means 100MBytes X maxsize=10240. means 10240 Bytes X X X X- A lot of code and documentation has been changed as on Friday afternoon X (7.12.2001) the new ieee POSIX-1003.1-2001 standard has been approved X and star is the first TAR archiver that is POSIX-1003.1-2001 compliant X and supports the POSIX-1003.1-2001 extended TAR headers. Old versions X of star did refer the standard as POSIX-1003.1-200x as it was not X 100% clear whether it would be approved in 2001 or 2002. X X- Large File support for IRIX-6.2 (added autoconf test for -n32 cc X option) X X- Large File support for IRIX-6.5 now everything works correctly if the X OS supports Large Files by default in 32 bit mode X (uses fseeko()/ftello() if present). This could only be done by X massively changing the autoconf code stolen from GNUtar. X X- Support for SGI IRIX platform ip17-irix X X X- Make hardlinks have size == 0 in the archive. This is a bug that X has been present for a long time. It seems that it has been overseen X sor a long time and was eported a few months ago. X X- New option -acl now needed to tell star to handle ACLs. X X This option has been introduced because it turns out that it is X impossible to handle the extract case (when the filesystem does X not support ACLs) in a decent way. Without -acl star would either X be forced to suppress eror messages for ACL handling or people X would see hundreds of ACL warnings. X X The intention for the -acl option was to make ACL handling easy X to understand. X X Here is a description how -acl works: X X - if -acl is not present in create mode, star does not X archive ACLs X X - if -acl is present in create mode and the header type X is 'exustar' (selected by H=exustar), star will X add ACL information to the archive. X X - if -acl is not present in extract mode, star does not X handle ACL information (i.e. if the FS does not handle X ACLs, no error messages will occur, if the FS handles X ACLs and there are default ACLs set up for the directory X where star puts the extracted files the extracted files X will have the inherited ACLs from the Default ACL od the X directory regardless of the ACL information in the archive). X X - if -acl is present in extract mode, star handles ACLs. X If the tar archive does not include ACL information at all X or if the archiv does not include ACL information for a X specific file, star will clear the ACL for this file. X If the tar archive includes ACL information for the file, X star will set up the ACL to be the same as the ACL information X in the archive (i.e. if -acl is present in extract mode, X no ACL information will be inherited from the ACL information X that was present in the filesystem tree before the exrtact X operation took place). X X If -acl is present in extract mode and the filesystem where X the files are extracted to does not support ACLs, star will X display an error message fo each file that is extracted. X X X- Added better compatibility to the POSIX-1003.1 standard and allow X star to handle the 'l' option as requested by the standard if X the last pacth name compoent of av[0] is either tar or ustar. X X To get a version if star with this property, you need to compile X star with: X make COPTX=-DTAR_COMPAT X X- Make the default FIFO size on Linix 8 MB as with other architectures X if the Linux version supports mmap() and thus is not tightly limited X in shared memory size. X X X- New supported architctures: X s390-linux-cc.rul parisc-linux-cc.rul parisc64-linux-cc.rul X X- fixed a bug that could hang the FIFO at the end of a archive read X operation if the archive file is much bigger than the archive X seems to be from the logical EOF mark. X X This is done by introducing a long planned FIFO shut down operation. X X- fixed a bug with links names that are exactly 100 chars long. X The bug caused the link name to be concatenated with the X string 'ustar'. X X- -p option in create mode now is -dirmode to make the meaning of X the flags easier to understand and to allow -acl to include -p X X- -acl option now includes -p in extract mode X X- When star is called as "tar" the default format is "xustar". This X avoids problems with the pax program which does not compute checksums X correctly and thus believes that the "xstar" format is not TAR. X X- blocks= and b= option now allow to specify multiplication factors X different from 512 (as with the bs= option). X X X- Print the error statistics when star aborts due to a hard error. X X- New flag -xfflags allows to archive and restore extended file flags X as found on *BSD and Linux. Archiving is done as extension to the X POSIX.1-2001 extended file headers. The flags: X X sappnd root settable append only X schg root settable immutable X nodump no dump X X are found on both *BSD and Linux and thus are mapped vice versa X X- 3rd stage and last of revision the man page X OPTIONS section alphabetically ordered and revised X X- Fixed a bug that appeared with uids/gids in the range between X 65534 and 2097151. Star did mask uid/gid values with 0xFFFF X before (as needed with historic UNIX implementations). X Bigger values are not affected as they are handled by different X methods. X X Now star correctly uses MAXOCTAL6 and MAXOCTAL7 as mask for the X POSIX.1-1988 compliant uig/gid/ values. X X X- New rule allows automatic fallback to GCC if the configured X default compiler could not be found. X X- Fix for a bug that caused star to create broken archives when X archiving files with negative time stamp ( < 1970) on 64 bit X platforms using a 64 bit variant of star. X X Star now checks for octal digit overflows that did cause X the time and the size field run together. X X- Check whether the OS uses the same st_mode definitions as X the TAR archive format. If both definitions differ, X convert the modes. X X- Introduced a loop around fsync() and code to check for X EINTR & EINVAL X X- Support Win XP (NT-5.1 os-cygwin_nt-5.1.id) X X- Significant speed up for scanning sparse files for the files's hole X list. star is now 3x faster than old star versions and 4x faster X than GNUtar X X- Fix for a Linux ACL bug. X Extracting files with 4 ACL entries did not work, X The last entry has been repeated in the buffer. X Thanks to Andreas Gruenbacher X X Description: X/*--------------------------------------------------------------------------*/ X$ getfacl e f X# file: e X# owner: root X# group: root Xuser::rw- Xuser:hofer:rw- Xgroup::r-- Xmask::rw- Xother::r-- X X# file: f X# owner: root X# group: root Xuser::rw- Xgroup::--- Xmask::--- Xother::r-- X X$ star -c -acl H=exustar e f > ef.tar Xstar: 1 blocks + 0 bytes (total of 10240 bytes = 10.00k). X$ rm e f X$ star -x -acl < ef.tar Xstar: Invalid argument. Cannot convert ACL 'user::rw-,group::---,mask::---,other::r--,rw-,other::r--,r--' to internal format for 'f'. X[...] X/*--------------------------------------------------------------------------*/ X X X- Fixed autoconf code to circumvent a bug in the Linux include files X with fseeko()/ftello() which causes problems on 64 bit systems. X X- Allow file= and f= option to be used more than once (up to 100 times). X X- New option new-volume-script=script to call script at end of each X tape in multi volume mode. X X- Set devmajor/devminor to 0 for all file types where it does X not make sense. This make sure that on operating systems or file X systems that e.g. return -1 for the device number no extended X header is generated. X X- Fixed a bug that caused star to print 'file changed size' with X some sparse files. The bug has been introduced in star-1.4a19 X and caused broken sparse files if the warning is printed. X X- -v option changed from BOOL to inc type to allow more verbose X create mode. X X- change 'file changed size' message so that is now reports either X 'file changed size (increased)' or 'file changed size (shrunk)'. X X- First implementation that is able to recursively remove non-empty X directories. X X- Added links for ia64-linux to the Make RULES to allow users of GNUmake X to compile cdrtools on IA64. Note that "smake" includes automake X features and will auto-create the missing links. X X- New option -link-dirs tells star to look for hard linked directories. X This makes star the first TAR implementation that allows to X archive hard linked directories. X X- New transient option -dump. X This option is to used to make testing of the new features for X incremental dumps easier. X X It currently defaults to the 'exustar' archive format and activates X the creation of more extended header fields that are needed to X have more file metadata information on the archive. X X- In -dump mode (a preparation for incremental dumps) star now archives: X X "SCHILY.dev" The field stat.st_dev - the filesys indicator X "SCHILY.ino" The field stat.st_ino - the file ID # X "SCHILY.nlink" The field stat.st_nlink - the hard link count X "SCHILY.filetype" The real file type - this allows e.g. X socket/door X X These fields will in future allow star to archive and extract all X information that is needed for incremental dumps. X X Star now includes ALL file metadata that is available. This allows a X complete restauration of all file properties and a diff mode that X checks for diffs in all file properties. X X- The new extended header field SCHILY.filetype now allows (again) to X archive sockets. Star's pre-posix format did allow this in 1985 but X the 'star' archive format is deprecated these days. X X- With -dump, DOOR files are archived as DOOR and extracted as plain file X of size 0. X X- statdefs.h extended to include support for the BSD 'whiteout' file X type. X X- List real file type instead of 'H' (Hard link) if this information X is available. X X- man page for sparse files extended to help to understand possible X problems. X X- New option -silent to supress informational messages like X 'xxx is sparse'. X X- New option -meta to tell star to archive only file metadate (from the X inode) but no file content. This option is needed to allow future X versions of star to support true incremental backups. X X If in extract mode, star will not attempt to create or overwrite X files/specials. X X ********* X WARNING: Do not try to extract a star archive that includes meta files. X Other tar implementations may clobber files on disk when reading such X archives. X X Star tries to cause other tar implementations to abort when they read X archives that contain meta files, but when other tar implementations X start to support POSIX.1-2001 extended headers this will not work X anymore. X X If I get support from other TAR/PAX implementors, there is a chance to X integrate the needed features into POSIX-1-2005. Please help he to X support this as meta files are needed to allow true incremental X backups. X ********* X X- Better code to check if a file is 'the archive' because MacOS X X has directories with ino # 0. X X- Compare filetype of hard links not only if the archive is the old X 1985 star format. The POSIX.1-2001 extended headers may also hold X the real file type. X X- Better warning for the broken tar headers used by GNUtar when X it adds volume headers. X X/*--------------------------------------------------------------------------*/ X X Hints for using extended POSIX.1-2001 headers: X See README.posix-2001 X X/*--------------------------------------------------------------------------*/ X X*** Fixed problems with files that are close to the maximum file size: X X- better tarblock() macro that avoids off_t overflows X X- Try to avoid problems while reading files when off+amt < 0 X or off+amt > size. X X- Try to avoid problems with the Solaris ioctl _FIOAI when off+amt < 0 X or off+amt > size. X X/*--------------------------------------------------------------------------*/ XLate changes: X X- Cast pointerdiffs to int for printf() %.*s format and/or include X workarounds for 64 bit problems in this area. X X- Use generic __malloc()/__realloc() if no memory would result in abort X X- Better autoconf test for not working mlock() on HP-UX-10.20 X X- Better autocheck code for available C-compilers on HP-UX X Now even a fallback from GCC to CC works. X X- Some changes to make compilation on 64 bit systems more correct X X- Added support for GNU Hurd to the Schily Makefilesystem X X- rmt.c changed because GNU Hurd has no MAXHOSTNAMELEN X X XRevision history (short) X X1982 First version on UNOS (extract only) X1985 Port to UNIX (fully functional version) X1985 Added pre Posix method of handling special files/devices X1986 First experiments with fifo as external process. X1993 Remote tape access X1993 diff option X1994 Fifo with shared memory integrated into star X1994 Very long filenames and sparse files X1994 Gnutar and Ustar(Posix.1-1988) handling added X1994 Xstar format (extended Posix.1-1988) defined and introduced X1995 Ported to many platforms X1999 Support for Win32 (Cygwin) X1999 base 256 support to overcome limitation with octal fields X2001 Large file support X2001 Support for POSIX.1-2001 extended headers X2001 Support for ACLs in POSIX.1-2001 extended headers X2002 Support for extended file flags in POSIX.1-2001 extended headers X2002 Support for extended inode meta data and meta files X XSupported platforms: X XVirtually any! Known to work: X XSunOS 4.x, Solaris (SunOS 5.x), Linux, XHP-UX, DG/UX, IRIX, AIX, FreeBSD, NetBSD, OpenBSD, XOSF-1, True-64, QNX, BeOS, Apollo Domain/OS, Next-STep, XOS/2, SCO-openserver, SCO-unixware, Caldera OpenUnix, XCygwin (Win32), Sony NewsOS, BSDi (BSD/OS), QNX, XApple Rhapsody, MacOS X, AmigaOS, GNU Hurd X XJoerg X X------------------------------------------------------------- XStar is the fastest known implementation of a tar archiver. XStar is able to make backups with far more than 10MB/s if the Xdisk and tape drive support such a speed. This is more than Xdouble the speed that ufsdump will get. XIn 1996, Ampex got 13.5 MB/s with their DLT tape drive which is a Xmodified professional digital video tape drive and not related Xto Quantum's DLT type drives. XUfsdump got a maximum speed of about 6MB/s with the same hardware. X XStar development started 1982, the first complete implementation has Xbeen done in 1985. I never did my backups with other tools than star. X XIts main advantages over other tar implementations are: X X fifo - keeps the tape streaming. X This gives you faster backups than X you can achieve with ufsdump, if the X size of the filesystem is > 1 GByte. X X remote tape support - a fast RMT implementation that has no X probems to saturate a 100 Mb/s network. X X accurate sparse files - star is able to reproduce holes in sparse X files accurately if the OS includes X the needed support functions. This is X currently true for Solaris-2.3 to X Solaris-2.5.1 X X pattern matcher - for a convenient user interface X (see manual page for more details). X To archive/extract a subset of files. X X sophisticated diff - user tailorable interface for comparing X tar archives against file trees X This is one of the most interesting parts X of the star implementation. X X no namelen limitation - Pathnames up to 1024 Bytes may be archived. X (The same limitation applies to linknames) X This limit may be expanded in future X without changing the method to record X long names. X X deals with all 3 times - stores/restores all 3 times of a file X (even creation time) X With POSIX.1-2001 the times are in nanosecond X granularity. X Star may reset access time after doing X backup. On Solaris this can be done without X changing the ctime. X X does not clobber files - more recent copies on disk will not be X clobbered from tape X This may be the main advantage over other X tar implementations. This allows X automatically repairing of corruptions X after a crash & fsck (Check for differences X after doing this with the diff option). X X automatic byte swap - star automatically detects swapped archives X and transparently reads them the right way X X automatic format detect - star automatically detects several common X archive formats and adopts to them. X Supported archive types are: X Old tar, gnu tar, ansi tar, star, X POSIX.1-2001 PAX, Sun's Solaris tar. X X X automatic compression detect - star automatically detects whether the X archive is compressed. If it has been X compressed with a compression program that X is compatible to decompression with "gzip" X or "bzip2", star automatically activates X decompression. X X fully ansi compatible - Star is fully ANSI/Posix 1003.1 compatible. X See README.otherbugs for a complete X description of bugs found in other tar X implementations. Star is the first tar X implementation that supports POSIX.1-2001. X X support for ACLs and file flags - star supports Access Control Lists X and extened file flags (as found on FreeBSD X and Linux). Support to archive and restore X other file properties may easily added. X X support for all inode metadata - star supports to put all inode X metadata on the archive. This allows future X versions of star to perform true X incremental dumps. X XHave a look at the manual page, it is included in the distribution. X XAuthor: X XJoerg Schilling XSeestr. 110 XD-13353 Berlin XGermany X XEmail: joerg@schily.isdn.cs.tu-berlin.de, js@cs.tu-berlin.de X schilling@fokus.gmd.de X XPlease mail bugs and suggestions to me. END-of-star-1.6/AN-1.4 echo x - star-1.6/README.SSPM sed 's/^X//' >star-1.6/README.SSPM << 'END-of-star-1.6/README.SSPM' X A new milestone in modular portable programming is ready! X XThe "Slottable Source Plugin Module" system (SSPM) is an idea that Xreally is more than 3 years old but I was hesitating to announce it Xearlier. Now I can tell you that the new makefile system has been Xunder test during the last 6 months and nobody complained about any Xproblem caused by the SSPM. X XThe portability overhead is currently about 2 MB. This turns a medium Xsized application like 'star' which is about 500 kB of pure source Xinto a packet that is 5x as big as the pure source size. X XAs all my applications are based on the Schily SING makefile system Xand share a common portability base it makes sense to share the Xadvantages of the Schily makefile system with all users. X XSimple ideas like the SSPM are usually hard to understand by people Xfrom outside, so I try to describe the new system by giving you an Xexample on how it is used: X X-------------------- XYou may test the new system by first downloading the latest Xcdrtools package X X https://sourceforge.net/projects/cdrtools/files/alpha/ X XThen unpack the source tarball, chdir into the top level Xdirectory of the cdrtools package. Run 'make' and wait until the Xcompilation has finished. X XSo far, there is nothing new (except that some people may recognize Xthat this is a 'smooth' fully integrated compilation and you don't need Xto call 'configure'. X XNow, to understand what a "Slottable Source Plugin Module" is, fetch Xanother source. There is currently only one demo source that is ready Xfor testing: X X http://sourceforge.net/projects/s-tar/files/star-1.4-sspm.tar.gz X XUnpack this tarball in the top level directory of cdrtools and Xcall 'make' again. The Schily makefile system does recognize that there Xis additional (uncompiled) source and will compile these new parts. XAs there is no need to run 'configure' again, compilation of the Xadditional 'star' sources is much faster than the compilation of the Xcomplete 'star' source package would take. X XTo understand how the "Slottable Source Plugin Module" system works, Xhave a look into the TARGETS directory..... X X------------------- END-of-star-1.6/README.SSPM echo c - star-1.6/tartest mkdir -p star-1.6/tartest > /dev/null 2>&1 echo x - star-1.6/tartest/tartest.c sed 's/^X//' >star-1.6/tartest/tartest.c << 'END-of-star-1.6/tartest/tartest.c' X/* @(#)tartest.c 1.23 18/06/17 Copyright 2002-2018 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)tartest.c 1.23 18/06/17 Copyright 2002-2018 J. Schilling"; X#endif X/* X * Copyright (c) 2002-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X X#include "star.h" X#include X#include X#include X#define GT_COMERR /* #define comerr gtcomerr */ X#define GT_ERROR /* #define error gterror */ X#include X X#include /* O_BINARY */ X#include /* for setmode() prototype */ X XLOCAL void usage __PR((int ret)); XEXPORT int main __PR((int ac, char *av[])); XLOCAL BOOL doit __PR((FILE *f)); XLOCAL BOOL checkhdr __PR((TCB *ptb)); XLOCAL BOOL checkoctal __PR((char *ptr, int len, char *text)); XLOCAL BOOL checktype __PR((TCB *ptb)); XLOCAL BOOL checkid __PR((char *ptr, char *text)); XLOCAL BOOL checkmagic __PR((char *ptr)); XLOCAL BOOL checkvers __PR((char *ptr)); XEXPORT void stolli __PR((char *s, Ullong *ull, int len)); XLOCAL Ulong checksum __PR((TCB *ptb)); XLOCAL void pretty_char __PR((char *p, unsigned c)); X XLOCAL BOOL verbose; XLOCAL BOOL signedcksum; XLOCAL BOOL is_posix_2001; X XLOCAL void Xusage(ret) X int ret; X{ X error("Usage:\t%s [options] < file\n", get_progname()); X error("Options:\n"); X error("\t-help\t\tprint this help\n"); X error("\t-version\tPrint version number.\n"); X error("\t-v\t\tprint all filenames during verification\n"); X error("\n%s checks stdin fore compliance with the POSIX.1-1990 TAR standard\n", get_progname()); X exit(ret); X /* NOTREACHED */ X} X XEXPORT int Xmain(ac, av) X int ac; X char *av[]; X{ X int cac = ac; X char *const *cav = av; X BOOL help = FALSE; X BOOL prversion = FALSE; X X save_args(ac, av); X cac--; X cav++; X if (getallargs(&cac, &cav, "help,h,version,v", &help, &help, X &prversion, &verbose) < 0) { X errmsgno(EX_BAD, "Bad Option: '%s'.\n", cav[0]); X usage(EX_BAD); X } X if (help) X usage(0); X X printf("tartest %s (%s-%s-%s)\n\n", "1.23", X HOST_CPU, HOST_VENDOR, HOST_OS); X gtprintf("Copyright (C) 2002-2017 Jörg Schilling\n"); X gtprintf("This is free software; see the source for copying conditions. There is NO\n"); X gtprintf("warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"); X if (prversion) X exit(0); X X gtprintf("\nTesting for POSIX.1-1990 TAR compliance...\n"); X X setmode(fileno(stdin), O_BINARY); X X if (!doit(stdin)) { X gtprintf(">>> Archive is not POSIX.1-1990 TAR standard compliant.\n"); X return (1); X } X gtprintf("No deviations from POSIX.1-1990 TAR standard found.\n"); X return (0); X} X XLOCAL BOOL Xdoit(f) X FILE *f; X{ X BOOL ret = TRUE; X BOOL r; X TCB tcb; X TCB *ptb; X char name[257]; X char lname[101]; X Ullong checks; X Ullong hsum; X Ullong size; X Ullong blockno = 0; X int i; X X ptb = &tcb; X for (;;) { X r = TRUE; X fillbytes(ptb, TBLOCK, '\0'); X if (fileread(f, ptb, TBLOCK) != TBLOCK) { X gtprintf("Hard EOF at block %lld\n", blockno); X return (FALSE); X } X X stolli(ptb->ustar_dbuf.t_chksum, &checks, 8); X hsum = checksum(ptb); X if (hsum == 0) { X /* X * Check EOF X */ X gtprintf("Found 1st EOF block at %lld\n", blockno); X blockno++; X if (fileread(f, ptb, TBLOCK) != TBLOCK) { X gtprintf( X "Hard EOF at block %lld (second EOF block missing)\n", X blockno); X return (FALSE); X } X hsum = checksum(ptb); X if (hsum != 0) { X gtprintf( X "Second EOF block missing at %lld\n", X blockno); X return (FALSE); X } X gtprintf("Found 2nd EOF block at %lld\n", blockno); X return (ret); X } X if (checks != hsum) { X gtprintf("Bad Checksum %0llo != %0llo at block %lld\n", X checks, hsum, blockno); X signedcksum = TRUE; X hsum = checksum(ptb); X if (checks == hsum) { X gtprintf("Warning: archive uses signed checksums.\n"); X return (FALSE); X } X if (blockno != 0) { X if (is_posix_2001) { X gtprintf( X "The archive may either be corrupted or using the POSIX.1-2001 size field.\n"); X } else { X gtprintf( X "Warning: Corrupted TAR archive.\n"); X } X } X return (FALSE); X } X blockno++; X X stolli(ptb->ustar_dbuf.t_size, &size, 12); X X if (ptb->ustar_dbuf.t_prefix[0]) { X js_snprintf(name, sizeof (name), "%.155s/%.100s", X ptb->ustar_dbuf.t_prefix, X ptb->ustar_dbuf.t_name); X } else { X strncpy(name, ptb->ustar_dbuf.t_name, 100); X name[100] = '\0'; X } X strncpy(lname, ptb->ustar_dbuf.t_linkname, 100); X lname[100] = '\0'; X X r = checkhdr(ptb); X if (!r) X ret = FALSE; X X /* X * Handle the size field acording to POSIX.1-1990. X */ X i = tarblocks(size); X switch ((int)(ptb->ustar_dbuf.t_typeflag & 0xFF)) { X X case '\0': /* Old plain file */ X case '0': /* Ustar plain file */ X case '7': /* Contiguous file */ X break; X X case '1': /* Hard link */ X case '2': /* Symbolic link */ X if (i != 0) { X gtprintf( X "Warning: t_size field: %0llu, should be 0 for %s link\n", X size, X ptb->ustar_dbuf.t_typeflag == '1'? X "hard":"symbolic"); X ret = r = FALSE; X } X i = 0; X break; X case '3': /* Character special */ X case '4': /* Block special */ X case '5': /* Directory */ X case '6': /* FIFO (named pipe) */ X i = 0; X break; X } X X if (!r || verbose) { X gtprintf("*** %sFilename '%s'\n", X r == FALSE ? X "Failing ":"", name); X if (lname[0]) { X gtprintf("*** %sLinkname '%s'\n", X r == FALSE ? X "Failing ":"", lname); X } X } X X /* X * Skip file content. X */ X while (--i >= 0) { X if (fileread(f, ptb, TBLOCK) != TBLOCK) { X gtprintf("Hard EOF at block %lld\n", blockno); X return (FALSE); X } X blockno++; X } X } X X} X XLOCAL BOOL Xcheckhdr(ptb) X TCB *ptb; X{ X BOOL ret = TRUE; X int errs = 0; X Ullong ll; X X if (ptb->ustar_dbuf.t_name[ 0] == '\0') { X gtprintf("Warning: t_name[ 0] is a null character.\n"); X errs++; X } X if (ptb->ustar_dbuf.t_name[ 0] != '\0' && X ptb->ustar_dbuf.t_name[ 99] != '\0' && X /* LINTED */ X ptb->ndbuf.t_name[100] == '\0') { X gtprintf("Warning: t_name[100] is a null character.\n"); X errs++; X } X if (ptb->ustar_dbuf.t_linkname[ 0] != '\0' && X ptb->ustar_dbuf.t_linkname[ 99] != '\0' && X /* LINTED */ X ptb->ndbuf.t_linkname[100] == '\0') { X gtprintf("Warning: t_linkname[100] is a null character.\n"); X errs++; X } X X if (!checkoctal(ptb->ustar_dbuf.t_mode, 8, "t_mode")) X errs++; X X stolli(ptb->ustar_dbuf.t_mode, &ll, 8); X if (ll & ~07777) { X gtprintf( X "Warning: too many bits in t_mode field: 0%llo, should be 0%llo\n", X ll, ll & 07777); X errs++; X } X X if (!checkoctal(ptb->ustar_dbuf.t_uid, 8, "t_uid")) X errs++; X X if (!checkoctal(ptb->ustar_dbuf.t_gid, 8, "t_gid")) X errs++; X X if (!checkoctal(ptb->ustar_dbuf.t_size, 12, "t_size")) X errs++; X X if (!checkoctal(ptb->ustar_dbuf.t_mtime, 12, "t_mtime")) X errs++; X X if (!checkoctal(ptb->ustar_dbuf.t_chksum, 8, "t_chksum")) X errs++; X X if (!checktype(ptb)) X errs++; X X if (!checkmagic(ptb->ustar_dbuf.t_magic)) X errs++; X X if (!checkvers(ptb->ustar_dbuf.t_version)) X errs++; X X if (!checkid(ptb->ustar_dbuf.t_uname, "t_uname")) X errs++; X if (!checkid(ptb->ustar_dbuf.t_gname, "t_gname")) X errs++; X X if (!checkoctal(ptb->ustar_dbuf.t_devmajor, 8, "t_devmajor")) X errs++; X X if (!checkoctal(ptb->ustar_dbuf.t_devminor, 8, "t_devminor")) X errs++; X X#ifdef __needed__ X /* X * The POSIX.1 TAR standard does not mention the last 12 bytes in the X * TAR header. They may have any value... X */ X if (cmpnullbytes(ptb->ustar_dbuf.t_mfill, 12) < 12) { X gtprintf( X "Warning: non null character in last 12 bytes of header\n"); X errs++; X } X#endif X X if (errs) X ret = FALSE; X return (ret); X} X X/* X * Check whether octal numeric fields are according to POSIX.1-1990. X */ XLOCAL BOOL Xcheckoctal(ptr, len, text) X char *ptr; X int len; X char *text; X{ X BOOL ret = TRUE; X BOOL foundoctal = FALSE; X int i; X int endoff = 0; X#ifdef END_ALL_THESAME X char endc = '\0'; X#endif X char cs[4]; X X for (i = 0; i < len; i++) { X#ifdef CHECKOCTAL_DEBUG X error("%d '%c'\n", i, ptr[i]); X#endif X X#ifdef END_ALL_THESAME X if (endoff > 0 && ptr[i] != endc) { X#else X /* X * Ugly, but the standard seems to allow mixins space and null X * characters at the end of an octal numeric field. X */ X if (endoff > 0 && (ptr[i] != ' ' && ptr[i] != '\0')) { X#endif X pretty_char(cs, ptr[i] & 0xFF); X gtprintf( X "Warning: illegal end character '%s' (0x%02X) found in field '%s[%d]'\n", X cs, X ptr[i] & 0xFF, X text, i); X ret = FALSE; X } X if (endoff > 0) X continue; X if (ptr[i] == ' ' || ptr[i] == '\0') { X if (foundoctal) { X endoff = i; X#ifdef END_ALL_THESAME X endc = ptr[i]; X#endif X continue; X } X } X if (!isoctal(ptr[i])) { X pretty_char(cs, ptr[i] & 0xFF); X gtprintf( X "Warning: non octal character '%s' (0x%02X) found in field '%s[%d]'\n", X cs, X ptr[i] & 0xFF, X text, i); X ret = FALSE; X } else { X foundoctal = TRUE; X } X } X if (foundoctal && endoff == 0) { X gtprintf("Warning: no end character found in field '%s'\n", X text); X ret = FALSE; X } X return (ret); X} X X/* X * Check whether the POSIX.1-1990 'typeflag' field contains a valid character. X */ XLOCAL BOOL Xchecktype(ptb) X TCB *ptb; X{ X BOOL ret = TRUE; X char cs[4]; X X switch ((int)(ptb->ustar_dbuf.t_typeflag & 0xFF)) { X X case '\0': /* Old plain file */ X case '0': /* Ustar plain file */ X case '1': /* Hard link */ X case '2': /* Symbolic link */ X case '3': /* Character special */ X case '4': /* Block special */ X case '5': /* Directory */ X case '6': /* FIFO (named pipe) */ X case '7': /* Contiguous file */ X break; X X case 'g': X case 'x': X if (!is_posix_2001) { X gtprintf("Warning: Archive uses POSIX.1-2001 extensions.\n"); X gtprintf("Warning: The correctness of the size field cannot be checked for this reason.\n"); X is_posix_2001 = TRUE; X } X break; X X case 'A': case 'B': case 'C': case 'D': case 'E': case 'F': case 'G': X case 'H': case 'I': case 'J': case 'K': case 'L': case 'M': case 'N': X case 'O': case 'P': case 'Q': case 'R': case 'S': case 'T': case 'U': X case 'V': case 'W': case 'X': case 'Y': case 'Z': X { static char vend[256]; X if (vend[ptb->ustar_dbuf.t_typeflag & 0xFF] == 0) { X gtprintf( X "Warning: Archive uses Vendor specific extension file type '%c'.\n", X ptb->ustar_dbuf.t_typeflag & 0xFF); X vend[ptb->ustar_dbuf.t_typeflag & 0xFF] = 1; X } X } X break; X X default: X pretty_char(cs, ptb->ustar_dbuf.t_typeflag & 0xFF); X gtprintf( X "Warning: Archive uses illegal file type '%s' (0x%02X).\n", X cs, X ptb->ustar_dbuf.t_typeflag & 0xFF); X ret = FALSE; X } X return (ret); X} X X/* X * Check whether the POSIX.1-1990 'uid' or 'gid' field contains X * reasonable things. X */ XLOCAL BOOL Xcheckid(ptr, text) X char *ptr; X char *text; X{ X BOOL ret = TRUE; X char cs[4]; X int len = 32; X int i; X X if (ptr[0] == '\0') { X for (i = 0; i < len; i++) { X if (ptr[i] != '\0') { X pretty_char(cs, ptr[i] & 0xFF); X gtprintf( X "Warning: non null character '%s' (0x%02X) found in field '%s[%d]'\n", X cs, X ptr[i] & 0xFF, X text, i); X ret = FALSE; X } X } X return (ret); X } X i = len - 1; X if (ptr[i] != '\0') { X pretty_char(cs, ptr[i] & 0xFF); X gtprintf( X "Warning: non null string terminator character '%s' (0x%02X) found in field '%s[%d]'\n", X cs, X ptr[i] & 0xFF, X text, i); X ret = FALSE; X } X return (ret); X} X X/* X * Check whether the POSIX.1-1990 'magic' field contains the X * two string "ustar" (5 characters and a null byte). X */ XLOCAL BOOL Xcheckmagic(ptr) X char *ptr; X{ X BOOL ret = TRUE; X char *mag = "ustar"; X char cs[4]; X int i; X X for (i = 0; i < 6; i++) { X if (ptr[i] != mag[i]) { X pretty_char(cs, ptr[i] & 0xFF); X gtprintf( X "Warning: illegal character '%s' (0x%02X) found in field 't_magic[%d]'\n", X cs, X ptr[i] & 0xFF, i); X ret = FALSE; X } X } X return (ret); X} X X/* X * Check whether the POSIX.1-1990 'version' field contains the X * two characters "00". X */ XLOCAL BOOL Xcheckvers(ptr) X char *ptr; X{ X BOOL ret = TRUE; X char *vers = "00"; X char cs[4]; X int i; X X for (i = 0; i < 2; i++) { X if (ptr[i] != vers[i]) { X pretty_char(cs, ptr[i] & 0xFF); X gtprintf( X "Warning: illegal character '%s' (0x%02X) found in field 't_version[%d]'\n", X cs, X ptr[i] & 0xFF, i); X ret = FALSE; X } X } X return (ret); X} X X X/* X * Convert string -> long long int X * This is the debug version that stops at "len" size to be safe against X * field overflow. X */ XEXPORT void Xstolli(s, ull, len) X register char *s; X Ullong *ull; X int len; X{ X register Ullong ret = (Ullong)0; X register char c; X register int t; X X while (*s == ' ') { X if (--len < 0) X break; X s++; X } X X for (;;) { X if (--len < 0) X break; X c = *s++; X#ifdef STOLLI_DEBUG X error("'%c'\n", c); X#endif X if (isoctal(c)) X t = c - '0'; X else X break; X ret *= 8; X ret += t; X } X *ull = ret; X#ifdef STOLLI_DEBUG X error("len: %d\n", len); X#endif X} X X/* X * Checsum function. X * Returns 0 if the block contains nothing but null characters. X */ X#define CHECKS sizeof (ptb->ustar_dbuf.t_chksum) X/* X * We know, that sizeof (TCP) is 512 and therefore has no X * reminder when dividing by 8 X * X * CHECKS is known to be 8 too, use loop unrolling. X */ X#define DO8(a) a; a; a; a; a; a; a; a; X XLOCAL Ulong Xchecksum(ptb) X register TCB *ptb; X{ X register int i; X register Ulong sum = 0; X register Uchar *us; X X if (signedcksum) { X register char *ss; X X ss = (char *)ptb; X for (i = sizeof (*ptb)/8; --i >= 0; ) { X DO8(sum += *ss++); X } X if (sum == 0L) /* Block containing 512 nul's */ X return (sum); X X ss = (char *)ptb->ustar_dbuf.t_chksum; X DO8(sum -= *ss++); X sum += CHECKS*' '; X } else { X us = (Uchar *)ptb; X for (i = sizeof (*ptb)/8; --i >= 0; ) { X DO8(sum += *us++); X } X if (sum == 0L) /* Block containing 512 nul's */ X return (sum); X X us = (Uchar *)ptb->ustar_dbuf.t_chksum; X DO8(sum -= *us++); X sum += CHECKS*' '; X } X return (sum); X} X X/* X * Pretty print one character. X * Quote anything that is not a printable 7 bit ASCII character. X */ X#define SP ' ' X#define DEL '\177' X#define SP8 (SP | 0x80) X#define DEL8 (DEL | 0x80) X XLOCAL void Xpretty_char(p, c) X char *p; X unsigned c; X{ X c &= 0xFF; X X if (c < SP || c == DEL) { /* ctl char */ X *p++ = '^'; X *p++ = c ^ 0100; X } else if ((c > DEL && c < SP8) || c == DEL8) { /* 8 bit ctl */ X *p++ = '~'; X *p++ = '^'; X *p++ = c ^ 0300; X } else if (c >= SP8) { /* 8 bit char */ X *p++ = '~'; X *p++ = c & 0177; X } else { /* normal char */ X *p++ = c; X } X *p = '\0'; X} END-of-star-1.6/tartest/tartest.c echo x - star-1.6/tartest/Makefile sed 's/^X//' >star-1.6/tartest/Makefile << 'END-of-star-1.6/tartest/Makefile' X#ident @(#)tartest.mk 1.8 18/07/10 X########################################################################### X# Sample makefile for general application programs X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= bin XTARGET= tartest XCPPOPTS += -I../star XCPPOPTS += -DUSE_LARGEFILES XCPPOPTS += -DSCHILY_PRINT X XCFILES= tartest.c XLIBS= -lschily $(LIB_INTL) X#XMK_FILE= Makefile.man XXMK_FILE= tartestman.mk X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.cmd X########################################################################### X END-of-star-1.6/tartest/Makefile echo x - star-1.6/tartest/tartest.1 sed 's/^X//' >star-1.6/tartest/tartest.1 << 'END-of-star-1.6/tartest/tartest.1' X. \" @(#)tartest.1 1.1 02/06/23 Copyr 2002 J. Schilling X. \" Manual page for tartest X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH TARTEST 1 "02/06/23" "J\*org Schilling" "Schily\'s USER COMMANDS" X.SH NAME Xtartest \- test tar archive for POSIX.1-1990 compliance X.SH SYNOPSIS X.B Xtartest X[ X.I options X] X.I < file X.SH DESCRIPTION X.B Tartest Xreads a tar archive from X.B stdin Xand checks this archive for compliance with POSIX.1-1990. X X.SH OPTIONS XAll options can be abbreviated by their first letter. X.TP X.B \-help XPrint a short help message. X.TP X.B \-v Xprint all filenames during verification. X X.SH ENVIRONMENT Xnone X X.SH FILES Xnone X X.SH NOTES XAs X.B tartest Xis limited to tests the data that is delivered by the tar archiver that is going Xto be checked, it cannot tests if the tar archiver in question will produce Xcorrect archives under all circumstances. There may be borderline cases that Xtrigger bugs in the tar archiver. X.LP XIf you like to to a more complete test, you should have a look at the file X.B READE.quicktest Xin the directory X.B testscripts Xof either the X.B star Xdistribution or the ftp server. X X.SH BUGS END-of-star-1.6/tartest/tartest.1 echo x - star-1.6/tartest/tartestman.mk sed 's/^X//' >star-1.6/tartest/tartestman.mk << 'END-of-star-1.6/tartest/tartestman.mk' X#ident %W% %E% %Q% X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= tartest XMANSECT= $(MANSECT_CMD) XMANSUFFIX= $(MANSUFF_CMD) XMANFILE= tartest.1 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/tartest/tartestman.mk echo c - star-1.6/autoconf mkdir -p star-1.6/autoconf > /dev/null 2>&1 echo x - star-1.6/autoconf/acgeneral.m4 sed 's/^X//' >star-1.6/autoconf/acgeneral.m4 << 'END-of-star-1.6/autoconf/acgeneral.m4' Xdnl @(#)acgeneral.m4 1.17 16/03/22 Copyright 1998-2016 J. Schilling Xdnl Xdnl Parameterized macros. Xdnl Requires GNU m4. Xdnl This file is part of Autoconf. Xdnl Copyright (C) 1992, 93, 94, 95, 96, 1998 Free Software Foundation, Inc. Xdnl Xdnl This program is free software; you can redistribute it and/or modify Xdnl it under the terms of the GNU General Public License as published by Xdnl the Free Software Foundation; either version 2, or (at your option) Xdnl any later version. Xdnl Xdnl This program is distributed in the hope that it will be useful, Xdnl but WITHOUT ANY WARRANTY; without even the implied warranty of Xdnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Xdnl GNU General Public License for more details. Xdnl Xdnl You should have received a copy of the GNU General Public License Xdnl along with this program; if not, write to the Free Software Xdnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA Xdnl 02111-1307, USA. Xdnl Xdnl As a special exception, the Free Software Foundation gives unlimited Xdnl permission to copy, distribute and modify the configure scripts that Xdnl are the output of Autoconf. You need not follow the terms of the GNU Xdnl General Public License when using or distributing such scripts, even Xdnl though portions of the text of Autoconf appear in them. The GNU Xdnl General Public License (GPL) does govern all other use of the material Xdnl that constitutes the Autoconf program. Xdnl Xdnl Certain portions of the Autoconf source text are designed to be copied Xdnl (in certain cases, depending on the input) into the output of Xdnl Autoconf. We call these the "data" portions. The rest of the Autoconf Xdnl source text consists of comments plus executable code that decides which Xdnl of the data portions to output in any given case. We call these Xdnl comments and executable code the "non-data" portions. Autoconf never Xdnl copies any of the non-data portions into its output. Xdnl Xdnl This special exception to the GPL applies to versions of Autoconf Xdnl released by the Free Software Foundation. When you make and Xdnl distribute a modified version of Autoconf, you may extend this special Xdnl exception to the GPL to apply to your modified version as well, *unless* Xdnl your modified version has the potential to copy into its output some Xdnl of the text that was the non-data portion of the version that you started Xdnl with. (In other words, unless your change moves or copies text from Xdnl the non-data portions to the data portions.) If your modification has Xdnl such potential, you must delete any notice of this special exception Xdnl to the GPL from your modified version. Xdnl Xdnl Written by David MacKenzie, with help from Xdnl Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor, Xdnl Roland McGrath, Noah Friedman, david d zuhn, and many others. Xdnl Xdivert(-1)dnl Throw away output until AC_INIT is called. Xchangequote([, ]) X Xdefine(AC_ACVERSION, 2.13) Xdefine(AC_ACVERSION_SCHILY, 1.17-Schily) X Xdnl Some old m4's don't support m4exit. But they provide Xdnl equivalent functionality by core dumping because of the Xdnl long macros we define. Xifdef([__gnu__], , [errprint(Autoconf requires GNU m4. XInstall it before installing Autoconf or set the XM4 environment variable to its path name. X)m4exit(2)]) X Xundefine([eval]) Xundefine([include]) Xundefine([shift]) Xundefine([format]) X X Xdnl ### Defining macros X X Xdnl m4 output diversions. We let m4 output them all in order at the end, Xdnl except that we explicitly undivert AC_DIVERSION_SED, AC_DIVERSION_CMDS, Xdnl and AC_DIVERSION_ICMDS. X Xdnl AC_DIVERSION_NOTICE - 1 (= 0) AC_REQUIRE'd #! /bin/sh line Xdefine(AC_DIVERSION_NOTICE, 1)dnl copyright notice & option help strings Xdefine(AC_DIVERSION_INIT, 2)dnl initialization code Xdefine(AC_DIVERSION_NORMAL_4, 3)dnl AC_REQUIRE'd code, 4 level deep Xdefine(AC_DIVERSION_NORMAL_3, 4)dnl AC_REQUIRE'd code, 3 level deep Xdefine(AC_DIVERSION_NORMAL_2, 5)dnl AC_REQUIRE'd code, 2 level deep Xdefine(AC_DIVERSION_NORMAL_1, 6)dnl AC_REQUIRE'd code, 1 level deep Xdefine(AC_DIVERSION_NORMAL, 7)dnl the tests and output code Xdefine(AC_DIVERSION_SED, 8)dnl variable substitutions in config.status Xdefine(AC_DIVERSION_CMDS, 9)dnl extra shell commands in config.status Xdefine(AC_DIVERSION_ICMDS, 10)dnl extra initialization in config.status X Xdnl Change the diversion stream to STREAM, while stacking old values. Xdnl AC_DIVERT_PUSH(STREAM) Xdefine(AC_DIVERT_PUSH, X[pushdef([AC_DIVERSION_CURRENT], $1)dnl Xdivert(AC_DIVERSION_CURRENT)dnl X]) X Xdnl Change the diversion stream to its previous value, unstacking it. Xdnl AC_DIVERT_POP() Xdefine(AC_DIVERT_POP, X[popdef([AC_DIVERSION_CURRENT])dnl Xdivert(AC_DIVERSION_CURRENT)dnl X]) X Xdnl Initialize the diversion setup. Xdefine([AC_DIVERSION_CURRENT], AC_DIVERSION_NORMAL) Xdnl This will be popped by AC_REQUIRE in AC_INIT. Xpushdef([AC_DIVERSION_CURRENT], AC_DIVERSION_NOTICE) X Xdnl The prologue for Autoconf macros. Xdnl AC_PRO(MACRO-NAME) Xdefine(AC_PRO, X[define([AC_PROVIDE_$1], )dnl Xifelse(AC_DIVERSION_CURRENT, AC_DIVERSION_NORMAL, X[AC_DIVERT_PUSH(builtin(eval, AC_DIVERSION_CURRENT - 1))], X[pushdef([AC_DIVERSION_CURRENT], AC_DIVERSION_CURRENT)])dnl X]) X Xdnl The Epilogue for Autoconf macros. Xdnl AC_EPI() Xdefine(AC_EPI, X[AC_DIVERT_POP()dnl Xifelse(AC_DIVERSION_CURRENT, AC_DIVERSION_NORMAL, X[undivert(AC_DIVERSION_NORMAL_4)dnl Xundivert(AC_DIVERSION_NORMAL_3)dnl Xundivert(AC_DIVERSION_NORMAL_2)dnl Xundivert(AC_DIVERSION_NORMAL_1)dnl X])dnl X]) X Xdnl Define a macro which automatically provides itself. Add machinery Xdnl so the macro automatically switches expansion to the diversion Xdnl stack if it is not already using it. In this case, once finished, Xdnl it will bring back all the code accumulated in the diversion stack. Xdnl This, combined with AC_REQUIRE, achieves the topological ordering of Xdnl macros. We don't use this macro to define some frequently called Xdnl macros that are not involved in ordering constraints, to save m4 Xdnl processing. Xdnl AC_DEFUN(NAME, EXPANSION) Xdefine([AC_DEFUN], X[define($1, [AC_PRO([$1])$2[]AC_EPI()])]) X X Xdnl ### Initialization X X Xdnl AC_INIT_NOTICE() XAC_DEFUN(AC_INIT_NOTICE, X[# Guess values for system-dependent variables and create Makefiles. X# Generated automatically using autoconf version] AC_ACVERSION AC_ACVERSION_SCHILY [ X# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. X# Copyright (C) 1998-2016 J. Schilling X# X# This configure script is free software; the Free Software Foundation X# gives unlimited permission to copy, distribute and modify it. X X# Defaults: Xac_help= Xac_default_prefix=/usr/local X[#] Any additions from configure.in:]) X Xdnl AC_PREFIX_DEFAULT(PREFIX) XAC_DEFUN(AC_PREFIX_DEFAULT, X[AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl Xac_default_prefix=$1 XAC_DIVERT_POP()]) X Xdnl AC_INIT_PARSE_ARGS() XAC_DEFUN(AC_INIT_PARSE_ARGS, X[ X# Initialize some variables set by options. X# The variables have the same names as the options, with X# dashes changed to underlines. Xbuild=NONE Xcache_file=./config.cache Xexec_prefix=NONE Xhost=NONE Xno_create= Xnonopt=NONE Xno_recursion= Xprefix=NONE Xprogram_prefix=NONE Xprogram_suffix=NONE Xprogram_transform_name=s,x,x, Xsilent= Xsite= Xsrcdir= Xtarget=NONE Xverbose= Xrmttest=test Xrmtcall= XCONFIG_RMTCALL=${CONFIG_RMTCALL-NONE} Xx_includes=NONE Xx_libraries=NONE Xdnl Installation directory options. Xdnl These are left unexpanded so users can "make install exec_prefix=/foo" Xdnl and all the variables that are supposed to be based on exec_prefix Xdnl by default will actually change. Xdnl Use braces instead of parens because sh, perl, etc. also accept them. Xbindir='${exec_prefix}/bin' Xsbindir='${exec_prefix}/sbin' Xlibexecdir='${exec_prefix}/libexec' Xdatadir='${prefix}/share' Xsysconfdir='${prefix}/etc' Xsharedstatedir='${prefix}/com' Xlocalstatedir='${prefix}/var' Xlibdir='${exec_prefix}/lib' Xincludedir='${prefix}/include' Xoldincludedir='/usr/include' Xinfodir='${prefix}/info' Xmandir='${prefix}/man' X X# Initialize some other variables. Xsubdirs= XMFLAGS= MAKEFLAGS= XSHELL=${CONFIG_SHELL-/bin/sh} X# Maximum number of lines to put in a shell here document. Xac_max_here_lines=12 X Xac_prev= Xfor ac_option Xdo X X # If the previous option needs an argument, assign it. X if test -n "$ac_prev"; then X eval "$ac_prev=\$ac_option" X ac_prev= X continue X fi X X case "$ac_option" in Xchangequote(, )dnl X -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; Xchangequote([, ])dnl X *) ac_optarg= ;; X esac X X # Accept the important Cygnus configure options, so we can diagnose typos. X X case "$ac_option" in X X -bindir | --bindir | --bindi | --bind | --bin | --bi) X ac_prev=bindir ;; X -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) X bindir="$ac_optarg" ;; X X -build | --build | --buil | --bui | --bu) X ac_prev=build ;; X -build=* | --build=* | --buil=* | --bui=* | --bu=*) X build="$ac_optarg" ;; X X -cache-file | --cache-file | --cache-fil | --cache-fi \ X | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) X ac_prev=cache_file ;; X -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ X | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) X cache_file="$ac_optarg" ;; X X -cc=* | --cc=* ) X CC="$ac_optarg" ; echo using $CC as compiler ;; X X -datadir | --datadir | --datadi | --datad | --data | --dat | --da) X ac_prev=datadir ;; X -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ X | --da=*) X datadir="$ac_optarg" ;; X X -disable-* | --disable-*) X ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` X # Reject names that are not valid shell variable names. Xchangequote(, )dnl X if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then Xchangequote([, ])dnl X AC_MSG_ERROR($ac_feature: invalid feature name) X fi X ac_feature=`echo $ac_feature| sed 's/-/_/g'` X eval "enable_${ac_feature}=no" ;; X X -enable-* | --enable-*) X ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` X # Reject names that are not valid shell variable names. Xchangequote(, )dnl X if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then Xchangequote([, ])dnl X AC_MSG_ERROR($ac_feature: invalid feature name) X fi X ac_feature=`echo $ac_feature| sed 's/-/_/g'` X case "$ac_option" in X *=*) ;; X *) ac_optarg=yes ;; X esac X eval "enable_${ac_feature}='$ac_optarg'" ;; X X -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ X | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ X | --exec | --exe | --ex) X ac_prev=exec_prefix ;; X -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ X | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ X | --exec=* | --exe=* | --ex=*) X exec_prefix="$ac_optarg" ;; X X -gas | --gas | --ga | --g) X # Obsolete; use --with-gas. X with_gas=yes ;; X X -help | --help | --hel | --he) X # Omit some internal or obsolete options to make the list less imposing. X # This message is too long to be a string in the A/UX 3.1 sh. X cat << EOF Xchangequote(, )dnl XUsage: configure [options] [host] XOptions: [defaults in brackets after descriptions] XConfiguration: X --cache-file=FILE cache test results in FILE X --help print this message X --no-create do not create output files X --quiet, --silent do not print \`checking...' messages X --version print the version of autoconf that created configure XDirectory and file names: X --prefix=PREFIX install architecture-independent files in PREFIX X [$ac_default_prefix] X --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX X [same as prefix] X --bindir=DIR user executables in DIR [EPREFIX/bin] X --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] X --libexecdir=DIR program executables in DIR [EPREFIX/libexec] X --datadir=DIR read-only architecture-independent data in DIR X [PREFIX/share] X --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] X --sharedstatedir=DIR modifiable architecture-independent data in DIR X [PREFIX/com] X --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] X --libdir=DIR object code libraries in DIR [EPREFIX/lib] X --includedir=DIR C header files in DIR [PREFIX/include] X --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] X --infodir=DIR info documentation in DIR [PREFIX/info] X --mandir=DIR man documentation in DIR [PREFIX/man] X --srcdir=DIR find the sources in DIR [configure dir or ..] X --program-prefix=PREFIX prepend PREFIX to installed program names X --program-suffix=SUFFIX append SUFFIX to installed program names X --program-transform-name=PROGRAM X run sed PROGRAM on installed program names XEOF X cat << EOF XHost type: X --build=BUILD configure for building on BUILD [BUILD=HOST] X --host=HOST configure for HOST [guessed] X --target=TARGET configure for TARGET [TARGET=HOST] XFeatures and packages: X --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) X --enable-FEATURE[=ARG] include FEATURE [ARG=yes] X --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] X --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) X --x-includes=DIR X include files are in DIR X --x-libraries=DIR X library files are in DIR Xchangequote([, ])dnl XEOF X if test -n "$ac_help"; then X echo "--enable and --with options recognized:$ac_help" X fi X exit 0 ;; X X -host | --host | --hos | --ho) X ac_prev=host ;; X -host=* | --host=* | --hos=* | --ho=*) X host="$ac_optarg" ;; X X -includedir | --includedir | --includedi | --included | --include \ X | --includ | --inclu | --incl | --inc) X ac_prev=includedir ;; X -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ X | --includ=* | --inclu=* | --incl=* | --inc=*) X includedir="$ac_optarg" ;; X X -infodir | --infodir | --infodi | --infod | --info | --inf) X ac_prev=infodir ;; X -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) X infodir="$ac_optarg" ;; X X -libdir | --libdir | --libdi | --libd) X ac_prev=libdir ;; X -libdir=* | --libdir=* | --libdi=* | --libd=*) X libdir="$ac_optarg" ;; X X -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ X | --libexe | --libex | --libe) X ac_prev=libexecdir ;; X -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ X | --libexe=* | --libex=* | --libe=*) X libexecdir="$ac_optarg" ;; X X -localstatedir | --localstatedir | --localstatedi | --localstated \ X | --localstate | --localstat | --localsta | --localst \ X | --locals | --local | --loca | --loc | --lo) X ac_prev=localstatedir ;; X -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ X | --localstate=* | --localstat=* | --localsta=* | --localst=* \ X | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) X localstatedir="$ac_optarg" ;; X X -mandir | --mandir | --mandi | --mand | --man | --ma | --m) X ac_prev=mandir ;; X -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) X mandir="$ac_optarg" ;; X X -nfp | --nfp | --nf) X # Obsolete; use --without-fp. X with_fp=no ;; X X -no-create | --no-create | --no-creat | --no-crea | --no-cre \ X | --no-cr | --no-c) X no_create=yes ;; X X -no-recursion | --no-recursion | --no-recursio | --no-recursi \ X | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) X no_recursion=yes ;; X X -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ X | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ X | --oldin | --oldi | --old | --ol | --o) X ac_prev=oldincludedir ;; X -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ X | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ X | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) X oldincludedir="$ac_optarg" ;; X X -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) X ac_prev=prefix ;; X -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) X prefix="$ac_optarg" ;; X X -program-prefix | --program-prefix | --program-prefi | --program-pref \ X | --program-pre | --program-pr | --program-p) X ac_prev=program_prefix ;; X -program-prefix=* | --program-prefix=* | --program-prefi=* \ X | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) X program_prefix="$ac_optarg" ;; X X -program-suffix | --program-suffix | --program-suffi | --program-suff \ X | --program-suf | --program-su | --program-s) X ac_prev=program_suffix ;; X -program-suffix=* | --program-suffix=* | --program-suffi=* \ X | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) X program_suffix="$ac_optarg" ;; X X -program-transform-name | --program-transform-name \ X | --program-transform-nam | --program-transform-na \ X | --program-transform-n | --program-transform- \ X | --program-transform | --program-transfor \ X | --program-transfo | --program-transf \ X | --program-trans | --program-tran \ X | --progr-tra | --program-tr | --program-t) X ac_prev=program_transform_name ;; X -program-transform-name=* | --program-transform-name=* \ X | --program-transform-nam=* | --program-transform-na=* \ X | --program-transform-n=* | --program-transform-=* \ X | --program-transform=* | --program-transfor=* \ X | --program-transfo=* | --program-transf=* \ X | --program-trans=* | --program-tran=* \ X | --progr-tra=* | --program-tr=* | --program-t=*) X program_transform_name="$ac_optarg" ;; X X -q | -quiet | --quiet | --quie | --qui | --qu | --q \ X | -silent | --silent | --silen | --sile | --sil) X silent=yes ;; X X -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) X ac_prev=sbindir ;; X -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ X | --sbi=* | --sb=*) X sbindir="$ac_optarg" ;; X X -sharedstatedir | --sharedstatedir | --sharedstatedi \ X | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ X | --sharedst | --shareds | --shared | --share | --shar \ X | --sha | --sh) X ac_prev=sharedstatedir ;; X -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ X | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ X | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ X | --sha=* | --sh=*) X sharedstatedir="$ac_optarg" ;; X X -site | --site | --sit) X ac_prev=site ;; X -site=* | --site=* | --sit=*) X site="$ac_optarg" ;; X X -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) X ac_prev=srcdir ;; X -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) X srcdir="$ac_optarg" ;; X X -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ X | --syscon | --sysco | --sysc | --sys | --sy) X ac_prev=sysconfdir ;; X -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ X | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) X sysconfdir="$ac_optarg" ;; X X -target | --target | --targe | --targ | --tar | --ta | --t) X ac_prev=target ;; X -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) X target="$ac_optarg" ;; X X -v | -verbose | --verbose | --verbos | --verbo | --verb) X verbose=yes ;; X X -version | --version | --versio | --versi | --vers) X echo "configure generated by autoconf version AC_ACVERSION AC_ACVERSION_SCHILY" X exit 0 ;; X X -with-* | --with-*) X ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` X # Reject names that are not valid shell variable names. Xchangequote(, )dnl X if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then Xchangequote([, ])dnl X AC_MSG_ERROR($ac_package: invalid package name) X fi X ac_package=`echo $ac_package| sed 's/-/_/g'` X case "$ac_option" in X *=*) ;; X *) ac_optarg=yes ;; X esac X eval "with_${ac_package}='$ac_optarg'" ;; X X -without-* | --without-*) X ac_package=`echo $ac_option|sed -e 's/-*without-//'` X # Reject names that are not valid shell variable names. Xchangequote(, )dnl X if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then Xchangequote([, ])dnl X AC_MSG_ERROR($ac_package: invalid package name) X fi X ac_package=`echo $ac_package| sed 's/-/_/g'` X eval "with_${ac_package}=no" ;; X X --x) X # Obsolete; use --with-x. X with_x=yes ;; X X -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ X | --x-incl | --x-inc | --x-in | --x-i) X ac_prev=x_includes ;; X -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ X | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) X x_includes="$ac_optarg" ;; X X -x-libraries | --x-libraries | --x-librarie | --x-librari \ X | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) X ac_prev=x_libraries ;; X -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ X | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) X x_libraries="$ac_optarg" ;; X X -*) AC_MSG_ERROR([$ac_option: invalid option; use --help to show usage]) X ;; X X *) Xchangequote(, )dnl X if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then Xchangequote([, ])dnl X AC_MSG_WARN($ac_option: invalid host type) X fi X if test "x$nonopt" != xNONE; then X AC_MSG_ERROR(can only configure for one host and one target at a time) X fi X nonopt="$ac_option" X ;; X X esac Xdone X Xif test -n "$ac_prev"; then X AC_MSG_ERROR(missing argument to --`echo $ac_prev | sed 's/_/-/g'`) Xfi X]) X Xdnl Try to have only one #! line, so the script doesn't look funny Xdnl for users of AC_REVISION. Xdnl AC_INIT_BINSH() XAC_DEFUN(AC_INIT_BINSH, X[#! /bin/sh X]) X Xdnl AC_INIT(UNIQUE-FILE-IN-SOURCE-DIR) XAC_DEFUN(AC_INIT, X[sinclude(acsite.m4)dnl Xsinclude(./aclocal.m4)dnl XAC_REQUIRE([AC_INIT_BINSH])dnl XAC_INIT_NOTICE XAC_DIVERT_POP()dnl to NORMAL XAC_DIVERT_PUSH(AC_DIVERSION_INIT)dnl XAC_INIT_PARSE_ARGS XAC_INIT_PREPARE($1)dnl XAC_DIVERT_POP()dnl to NORMAL X]) X Xdnl AC_INIT_PREPARE(UNIQUE-FILE-IN-SOURCE-DIR) XAC_DEFUN(AC_INIT_PREPARE, X[trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 X X# File descriptor usage: X# 0 standard input X# 1 file creation X# 2 errors and warnings X# 3 some systems may open it to /dev/tty X# 4 used on the Kubota Titan Xdefine(AC_FD_MSG, 6)dnl X[#] AC_FD_MSG checking for... messages and results Xdefine(AC_FD_CC, 5)dnl X[#] AC_FD_CC compiler messages saved in config.log Xif test "$silent" = yes; then X exec AC_FD_MSG>/dev/null Xelse X exec AC_FD_MSG>&1 Xfi Xexec AC_FD_CC>./config.log X Xecho "\ XThis file contains any messages produced by compilers while Xrunning configure, to aid debugging if configure makes a mistake. X" 1>&AC_FD_CC X X# Strip out --no-create and --no-recursion so they do not pile up. X# Also quote any args containing shell metacharacters. Xac_configure_args= Xfor ac_arg Xdo X case "$ac_arg" in X -no-create | --no-create | --no-creat | --no-crea | --no-cre \ X | --no-cr | --no-c) ;; X -no-recursion | --no-recursion | --no-recursio | --no-recursi \ X | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; Xchangequote(<<, >>)dnl Xdnl If you change this globbing pattern, test it on an old shell -- Xdnl it's sensitive. Putting any kind of quote in it causes syntax errors. X *" "*|*" "*|*[\[\]\~\<<#>>\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) X ac_configure_args="$ac_configure_args '$ac_arg'" ;; Xchangequote([, ])dnl X *) ac_configure_args="$ac_configure_args $ac_arg" ;; X esac Xdone X X# NLS nuisances. X# Only set these to C if already set. These must not be set unconditionally X# because not all systems understand e.g. LANG=C (notably SCO). X# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! X# Non-C LC_CTYPE values break the ctype check. Xif test "${LANG+set}" = set; then LANG=C; export LANG; fi Xif test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi Xif test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi Xif test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi X X# confdefs.h avoids OS command line length limits that DEFS can exceed. Xrm -rf conftest* confdefs.h X# AIX cpp loses on an empty file, so make sure it contains at least a newline. Xecho > confdefs.h X X# A filename unique to this package, relative to the directory that X# configure is in, which we can look for to find out if srcdir is correct. Xac_unique_file=$1 X X# Find the source files, if location was not specified. Xif test -z "$srcdir"; then X ac_srcdir_defaulted=yes X # Try the directory containing this script, then its parent. X ac_prog=[$]0 Xchangequote(, )dnl X ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` Xchangequote([, ])dnl X test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. X srcdir=$ac_confdir X if test ! -r $srcdir/$ac_unique_file; then X srcdir=.. X fi Xelse X ac_srcdir_defaulted=no Xfi Xif test ! -r $srcdir/$ac_unique_file; then X if test "$ac_srcdir_defaulted" = yes; then X AC_MSG_ERROR(can not find sources in $ac_confdir or ..) X else X AC_MSG_ERROR(can not find sources in $srcdir) X fi Xfi Xdnl Double slashes in pathnames in object file debugging info Xdnl mess up M-x gdb in Emacs. Xchangequote(, )dnl Xsrcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` Xchangequote([, ])dnl X Xdnl Let the site file select an alternate cache file if it wants to. XAC_SITE_LOAD XAC_CACHE_LOAD XAC_LANG_C Xdnl By default always use an empty string as the executable Xdnl extension. Only change it if the script calls AC_EXEEXT. Xac_exeext= Xac_xexeext= Xdnl By default assume that objects files use an extension of .o. Only Xdnl change it if the script calls AC_OBJEXT. Xac_objext=o XAC_PROG_ECHO_N Xdnl Substitute for predefined variables. XAC_SUBST(SHELL)dnl XAC_SUBST(CFLAGS)dnl XAC_SUBST(CPPFLAGS)dnl XAC_SUBST(CXXFLAGS)dnl XAC_SUBST(FFLAGS)dnl XAC_SUBST(DEFS)dnl XAC_SUBST(LDFLAGS)dnl XAC_SUBST(LIBS)dnl XAC_SUBST(exec_prefix)dnl XAC_SUBST(prefix)dnl XAC_SUBST(program_transform_name)dnl Xdnl Installation directory options. XAC_SUBST(bindir)dnl XAC_SUBST(sbindir)dnl XAC_SUBST(libexecdir)dnl XAC_SUBST(datadir)dnl XAC_SUBST(sysconfdir)dnl XAC_SUBST(sharedstatedir)dnl XAC_SUBST(localstatedir)dnl XAC_SUBST(libdir)dnl XAC_SUBST(includedir)dnl XAC_SUBST(oldincludedir)dnl XAC_SUBST(infodir)dnl XAC_SUBST(mandir)dnl X]) X X Xdnl ### Selecting optional features X X Xdnl AC_ARG_ENABLE(FEATURE, HELP-STRING, ACTION-IF-TRUE [, ACTION-IF-FALSE]) XAC_DEFUN(AC_ARG_ENABLE, X[AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl Xac_help="$ac_help X[$2]" XAC_DIVERT_POP()dnl X[#] Check whether --enable-[$1] or --disable-[$1] was given. Xif test "[${enable_]patsubst([$1], -, _)+set}" = set; then X enableval="[$enable_]patsubst([$1], -, _)" X ifelse([$3], , :, [$3]) Xifelse([$4], , , [else X $4 X])dnl Xfi X]) X XAC_DEFUN(AC_ENABLE, X[AC_OBSOLETE([$0], [; instead use AC_ARG_ENABLE])dnl XAC_ARG_ENABLE([$1], [ --enable-$1], [$2], [$3])dnl X]) X X Xdnl ### Working with optional software X X Xdnl AC_ARG_WITH(PACKAGE, HELP-STRING, ACTION-IF-TRUE [, ACTION-IF-FALSE]) XAC_DEFUN(AC_ARG_WITH, X[AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl Xac_help="$ac_help X[$2]" XAC_DIVERT_POP()dnl X[#] Check whether --with-[$1] or --without-[$1] was given. Xif test "[${with_]patsubst([$1], -, _)+set}" = set; then X withval="[$with_]patsubst([$1], -, _)" X ifelse([$3], , :, [$3]) Xifelse([$4], , , [else X $4 X])dnl Xfi X]) X XAC_DEFUN(AC_WITH, X[AC_OBSOLETE([$0], [; instead use AC_ARG_WITH])dnl XAC_ARG_WITH([$1], [ --with-$1], [$2], [$3])dnl X]) X X Xdnl ### Transforming program names. X X Xdnl AC_ARG_PROGRAM() XAC_DEFUN(AC_ARG_PROGRAM, X[if test "$program_transform_name" = s,x,x,; then X program_transform_name= Xelse X # Double any \ or $. echo might interpret backslashes. X cat <<\EOF_SED > conftestsed Xs,\\,\\\\,g; s,\$,$$,g XEOF_SED X program_transform_name="`echo $program_transform_name|sed -f conftestsed`" X rm -f conftestsed Xfi Xtest "$program_prefix" != NONE && X program_transform_name="s,^,${program_prefix},; $program_transform_name" X# Use a double $ so make ignores it. Xtest "$program_suffix" != NONE && X program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" X X# sed with no file args requires a program. Xtest "$program_transform_name" = "" && program_transform_name="s,x,x," X]) X X Xdnl ### Version numbers X X Xdnl AC_REVISION(REVISION-INFO) XAC_DEFUN(AC_REVISION, X[AC_REQUIRE([AC_INIT_BINSH])dnl X[# From configure.in] translit([$1], $")]) X Xdnl Subroutines of AC_PREREQ. X Xdnl Change the dots in NUMBER into commas. Xdnl AC_PREREQ_SPLIT(NUMBER) Xdefine(AC_PREREQ_SPLIT, X[translit($1, ., [, ])]) X Xdnl Default the ternary version number to 0 (e.g., 1, 7 -> 1, 7, 0). Xdnl AC_PREREQ_CANON(MAJOR, MINOR [,TERNARY]) Xdefine(AC_PREREQ_CANON, X[$1, $2, ifelse([$3], , 0, [$3])]) X Xdnl Complain and exit if version number 1 is less than version number 2. Xdnl PRINTABLE2 is the printable version of version number 2. Xdnl AC_PREREQ_COMPARE(MAJOR1, MINOR1, TERNARY1, MAJOR2, MINOR2, TERNARY2, Xdnl PRINTABLE2) Xdefine(AC_PREREQ_COMPARE, X[ifelse(builtin([eval], X[$3 + $2 * 1000 + $1 * 1000000 < $6 + $5 * 1000 + $4 * 1000000]), 1, X[errprint(dnl XFATAL ERROR: Autoconf version $7 or higher is required for this script X)m4exit(3)])]) X Xdnl Complain and exit if the Autoconf version is less than VERSION. Xdnl AC_PREREQ(VERSION) Xdefine(AC_PREREQ, X[AC_PREREQ_COMPARE(AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)), XAC_PREREQ_CANON(AC_PREREQ_SPLIT([$1])), [$1])]) X X Xdnl ### Getting the canonical system type X X Xdnl Find install-sh, config.sub, config.guess, and Cygnus configure Xdnl in directory DIR. These are auxiliary files used in configuration. Xdnl DIR can be either absolute or relative to $srcdir. Xdnl AC_CONFIG_AUX_DIR(DIR) XAC_DEFUN(AC_CONFIG_AUX_DIR, X[AC_CONFIG_AUX_DIRS($1 $srcdir/$1)]) X Xdnl The default is `$srcdir' or `$srcdir/..' or `$srcdir/../..'. Xdnl There's no need to call this macro explicitly; just AC_REQUIRE it. XAC_DEFUN(AC_CONFIG_AUX_DIR_DEFAULT, X[AC_CONFIG_AUX_DIRS($srcdir $srcdir/.. $srcdir/../..)]) X Xdnl Internal subroutine. Xdnl Search for the configuration auxiliary files in directory list $1. Xdnl We look only for install-sh, so users of AC_PROG_INSTALL Xdnl do not automatically need to distribute the other auxiliary files. Xdnl AC_CONFIG_AUX_DIRS(DIR ...) XAC_DEFUN(AC_CONFIG_AUX_DIRS, X[ac_aux_dir= Xfor ac_dir in $1; do X if test -f $ac_dir/install-sh; then X ac_aux_dir=$ac_dir X ac_install_sh="$ac_aux_dir/install-sh -c" X break X elif test -f $ac_dir/install.sh; then X ac_aux_dir=$ac_dir X ac_install_sh="$ac_aux_dir/install.sh -c" X break X fi Xdone Xif test -z "$ac_aux_dir"; then X AC_MSG_ERROR([can not find install-sh or install.sh in $1]) Xfi Xac_config_guess=$ac_aux_dir/config.guess Xac_config_sub=$ac_aux_dir/config.sub Xac_configure=$ac_aux_dir/configure # This should be Cygnus configure. XAC_PROVIDE([AC_CONFIG_AUX_DIR_DEFAULT])dnl X]) X Xdnl Canonicalize the host, target, and build system types. XAC_DEFUN(AC_CANONICAL_SYSTEM, X[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl XAC_BEFORE([$0], [AC_ARG_PROGRAM]) X# Do some error checking and defaulting for the host and target type. X# The inputs are: X# configure --host=HOST --target=TARGET --build=BUILD NONOPT X# X# The rules are: X# 1. You are not allowed to specify --host, --target, and nonopt at the X# same time. X# 2. Host defaults to nonopt. X# 3. If nonopt is not specified, then host defaults to the current host, X# as determined by config.guess. X# 4. Target and build default to nonopt. X# 5. If nonopt is not specified, then target and build default to host. X X# The aliases save the names the user supplied, while $host etc. X# will get canonicalized. Xcase $host---$target---$nonopt in XNONE---*---* | *---NONE---* | *---*---NONE) ;; X*) AC_MSG_ERROR(can only configure for one host and one target at a time) ;; Xesac X XAC_CANONICAL_HOST XAC_CANONICAL_TARGET XAC_CANONICAL_BUILD Xtest "$host_alias" != "$target_alias" && X test "$program_prefix$program_suffix$program_transform_name" = \ X NONENONEs,x,x, && X program_prefix=${target_alias}- X]) X Xdnl Subroutines of AC_CANONICAL_SYSTEM. X XAC_DEFUN(AC_CANONICAL_HOST, X[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl X X# Make sure we can run config.sub. Xif ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : Xelse AC_MSG_ERROR(can not run $ac_config_sub) Xfi X XAC_MSG_CHECKING(host system type) X Xdnl Set host_alias. Xhost_alias=$host Xcase "$host_alias" in XNONE) X case $nonopt in X NONE) X if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : X else AC_MSG_ERROR(can not guess host type; you must specify one) X fi ;; X *) host_alias=$nonopt ;; X esac ;; Xesac X Xdnl Set the other host vars. Xchangequote(<<, >>)dnl Xhost=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` Xhost_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` Xhost_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` Xhost_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` Xchangequote([, ])dnl XAC_MSG_RESULT($host) XAC_SUBST(host)dnl XAC_SUBST(host_alias)dnl XAC_SUBST(host_cpu)dnl XAC_SUBST(host_vendor)dnl XAC_SUBST(host_os)dnl X]) X Xdnl Internal use only. XAC_DEFUN(AC_CANONICAL_TARGET, X[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl XAC_MSG_CHECKING(target system type) X Xdnl Set target_alias. Xtarget_alias=$target Xcase "$target_alias" in XNONE) X case $nonopt in X NONE) target_alias=$host_alias ;; X *) target_alias=$nonopt ;; X esac ;; Xesac X Xdnl Set the other target vars. Xchangequote(<<, >>)dnl Xtarget=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias` Xtarget_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` Xtarget_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` Xtarget_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` Xchangequote([, ])dnl XAC_MSG_RESULT($target) XAC_SUBST(target)dnl XAC_SUBST(target_alias)dnl XAC_SUBST(target_cpu)dnl XAC_SUBST(target_vendor)dnl XAC_SUBST(target_os)dnl X]) X Xdnl Internal use only. XAC_DEFUN(AC_CANONICAL_BUILD, X[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl XAC_MSG_CHECKING(build system type) X Xdnl Set build_alias. Xbuild_alias=$build Xcase "$build_alias" in XNONE) X case $nonopt in X NONE) build_alias=$host_alias ;; X *) build_alias=$nonopt ;; X esac ;; Xesac X Xdnl Set the other build vars. Xchangequote(<<, >>)dnl Xbuild=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` Xbuild_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` Xbuild_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` Xbuild_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` Xchangequote([, ])dnl XAC_MSG_RESULT($build) XAC_SUBST(build)dnl XAC_SUBST(build_alias)dnl XAC_SUBST(build_cpu)dnl XAC_SUBST(build_vendor)dnl XAC_SUBST(build_os)dnl X]) X X Xdnl AC_VALIDATE_CACHED_SYSTEM_TUPLE[(cmd)] Xdnl if the cache file is inconsistent with the current host, Xdnl target and build system types, execute CMD or print a default Xdnl error message. XAC_DEFUN(AC_VALIDATE_CACHED_SYSTEM_TUPLE, [ X AC_REQUIRE([AC_CANONICAL_SYSTEM]) X AC_MSG_CHECKING([cached system tuple]) X if { test x"${ac_cv_host_system_type+set}" = x"set" && X test x"$ac_cv_host_system_type" != x"$host"; } || X { test x"${ac_cv_build_system_type+set}" = x"set" && X test x"$ac_cv_build_system_type" != x"$build"; } || X { test x"${ac_cv_target_system_type+set}" = x"set" && X test x"$ac_cv_target_system_type" != x"$target"; }; then X AC_MSG_RESULT([different]) X ifelse($#, 1, [$1], X [AC_MSG_ERROR([remove config.cache and re-run configure])]) X else X AC_MSG_RESULT(ok) X fi X ac_cv_host_system_type="$host" X ac_cv_build_system_type="$build" X ac_cv_target_system_type="$target" X]) X X Xdnl ### Caching test results X X Xdnl Look for site or system specific initialization scripts. Xdnl AC_SITE_LOAD() Xdefine(AC_SITE_LOAD, X[# Prefer explicitly selected file to automatically selected ones. Xif test -z "$CONFIG_SITE"; then X if test "x$prefix" != xNONE; then X CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" X else X CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" X fi Xfi Xfor ac_site_file in $CONFIG_SITE; do X if test -r "$ac_site_file"; then X echo "loading site script $ac_site_file" X . "$ac_site_file" X fi Xdone X]) X Xdnl AC_CACHE_LOAD() Xdefine(AC_CACHE_LOAD, X[if test -r "$cache_file"; then X echo "loading cache $cache_file" X . $cache_file Xelse X echo "creating cache $cache_file" X > $cache_file Xfi X]) X Xdnl AC_CACHE_SAVE() Xdefine(AC_CACHE_SAVE, X[cat > confcache <<\EOF X# This file is a shell script that caches the results of configure X# tests run on this system so they can be shared between configure X# scripts and configure runs. It is not useful on other systems. X# If it contains results you don't want to keep, you may remove or edit it. X# X# By default, configure uses ./config.cache as the cache file, X# creating it if it does not exist already. You can give configure X# the --cache-file=FILE option to use a different cache file; that is X# what configure does when it calls configure scripts in X# subdirectories, so they share the cache. X# Giving --cache-file=/dev/null disables caching, for debugging configure. X# config.status only pays attention to the cache file if you give it the X# --recheck option to rerun configure. X# XEOF Xdnl Allow a site initialization script to override cache values. X# The following way of writing the cache mishandles newlines in values, X# but we know of no workaround that is simple, portable, and efficient. X# So, don't put newlines in cache variables' values. X# Ultrix sh set writes to stderr and can't be redirected directly, X# and sets the high bit in the cache file unless we assign to the vars. Xchangequote(, )dnl X(set) 2>&1 | X case `(ac_space=' '; set | grep ac_space) 2>&1` in X *ac_space=\ *) X # `set' does not quote correctly, so add quotes (double-quote substitution X # turns \\\\ into \\, and sed turns \\ into \). X sed -n \ X -e "s/'/'\\\\''/g" \ X -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" X ;; X *) X # `set' quotes correctly as required by POSIX, so do not add quotes. X sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' X ;; X esac >> confcache Xchangequote([, ])dnl Xif cmp -s $cache_file confcache; then X : Xelse X if test -w $cache_file; then X echo "updating cache $cache_file" X cat confcache > $cache_file X else X echo "not updating unwritable cache $cache_file" X fi Xfi Xrm -f confcache X]) X Xdnl The name of shell var CACHE-ID must contain `_cv_' in order to get saved. Xdnl AC_CACHE_VAL(CACHE-ID, COMMANDS-TO-SET-IT) Xdefine(AC_CACHE_VAL, X[dnl We used to use the below line, but it fails if the 1st arg is a Xdnl shell variable, so we need the eval. Xdnl if test "${$1+set}" = set; then Xdnl the '' avoids an AIX 4.1 sh bug ("invalid expansion"). Xif eval "test \"`echo '$''{'$1'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&AC_FD_MSG Xelse X $2 Xfi X]) X Xdnl AC_CACHE_CHECK(MESSAGE, CACHE-ID, COMMANDS) Xdefine(AC_CACHE_CHECK, X[AC_MSG_CHECKING([$1]) XAC_CACHE_VAL([$2], [$3]) XAC_MSG_RESULT([$]$2)]) X X Xdnl ### Defining symbols X X Xdnl Set VARIABLE to VALUE, verbatim, or 1. Xdnl AC_DEFINE(VARIABLE [, VALUE]) Xdefine(AC_DEFINE, X[cat >> confdefs.h <<\EOF X[#define] $1 ifelse($#, 2, [$2], $#, 3, [$2], 1) XEOF X]) X Xdnl Similar, but perform shell substitutions $ ` \ once on VALUE. Xdefine(AC_DEFINE_UNQUOTED, X[cat >> confdefs.h <&AC_FD_MSG Xecho "configure:__oline__: checking $1" >&AC_FD_CC]) X Xdnl AC_CHECKING(FEATURE-DESCRIPTION) Xdefine(AC_CHECKING, X[echo "checking $1" 1>&AC_FD_MSG Xecho "configure:__oline__: checking $1" >&AC_FD_CC]) X Xdnl AC_MSG_RESULT(RESULT-DESCRIPTION) Xdefine(AC_MSG_RESULT, X[eval echo "$ac_t""$1" 1>&AC_FD_MSG]) X Xdnl AC_VERBOSE(RESULT-DESCRIPTION) Xdefine(AC_VERBOSE, X[AC_OBSOLETE([$0], [; instead use AC_MSG_RESULT])dnl Xecho " $1" 1>&AC_FD_MSG]) X Xdnl AC_MSG_WARN(PROBLEM-DESCRIPTION) Xdefine(AC_MSG_WARN, X[echo "configure: warning: $1" 1>&2]) X Xdnl AC_MSG_ERROR(ERROR-DESCRIPTION) Xdefine(AC_MSG_ERROR, X[{ echo "configure: error: $1" 1>&2; exit 1; }]) X X Xdnl ### Selecting which language to use for testing X X Xdnl AC_LANG_C() XAC_DEFUN(AC_LANG_C, X[define([AC_LANG], [C])dnl Xac_ext=c X# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. Xac_cpp='$CPP $CPPFLAGS' Xac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&AC_FD_CC' Xac_compile2='${CC-cc} -c $CFLAGS $CPPFLAGS conftest2.$ac_ext 1>&AC_FD_CC' Xac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS conftest.$ac_ext $LDFLAGS $LIBS 1>&AC_FD_CC' Xcross_compiling=$ac_cv_prog_cc_cross Xif test "$cross_compiling" = yes -a "$CONFIG_RMTCALL" != NONE ; then X cross_compiling=remote X rmtcall="$CONFIG_RMTCALL" X rmttest="$CONFIG_RMTCALL" Xfi X]) X Xdnl AC_LANG_CPLUSPLUS() XAC_DEFUN(AC_LANG_CPLUSPLUS, X[define([AC_LANG], [CPLUSPLUS])dnl Xac_ext=C X# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. Xac_cpp='$CXXCPP $CPPFLAGS' Xac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&AC_FD_CC' Xac_compile2='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest2.$ac_ext 1>&AC_FD_CC' Xac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS conftest.$ac_ext $LDFLAGS $LIBS 1>&AC_FD_CC' Xcross_compiling=$ac_cv_prog_cxx_cross Xif test "$cross_compiling" = yes -a "$CONFIG_RMTCALL" != NONE ; then X cross_compiling=remote X rmtcall="$CONFIG_RMTCALL" X rmttest="$CONFIG_RMTCALL" Xfi X]) X Xdnl AC_LANG_FORTRAN77() XAC_DEFUN(AC_LANG_FORTRAN77, X[define([AC_LANG], [FORTRAN77])dnl Xac_ext=f Xac_compile='${F77-f77} -c $FFLAGS conftest.$ac_ext 1>&AC_FD_CC' Xac_compile2='${F77-f77} -c $FFLAGS conftest2.$ac_ext 1>&AC_FD_CC' Xac_link='${F77-f77} -o conftest${ac_exeext} $FFLAGS conftest.$ac_ext $LDFLAGS $LIBS 1>&AC_FD_CC' Xcross_compiling=$ac_cv_prog_f77_cross Xif test "$cross_compiling" = yes -a "$CONFIG_RMTCALL" != NONE ; then X cross_compiling=remote X rmtcall="$CONFIG_RMTCALL" X rmttest="$CONFIG_RMTCALL" Xfi X]) X Xdnl Push the current language on a stack. Xdnl AC_LANG_SAVE() Xdefine(AC_LANG_SAVE, X[pushdef([AC_LANG_STACK], AC_LANG)]) X Xdnl Restore the current language from the stack. Xdnl AC_LANG_RESTORE() Xpushdef([AC_LANG_RESTORE], X[ifelse(AC_LANG_STACK, [C], [AC_LANG_C],dnl XAC_LANG_STACK, [CPLUSPLUS], [AC_LANG_CPLUSPLUS],dnl XAC_LANG_STACK, [FORTRAN77], [AC_LANG_FORTRAN77])[]popdef([AC_LANG_STACK])]) X X Xdnl ### Compiler-running mechanics X X Xdnl The purpose of this macro is to "configure:123: command line" Xdnl written into config.log for every test run. Xdnl Xdnl Note that previous versions of AC_TRY_EVAL did use () around the complete Xdnl eval commands. This causes unneeded sub-shells and reduces the performance Xdnl by 5% with a typical shell. Xdnl Given that the command passed to "eval" is in a shell variable, I/O Xdnl redirections and pipe calls in that variable are not parsed by the first Xdnl shell parser call but passed as textual arguments to the "eval" builtin and Xdnl then parsed inside "eval". For this reason there is no need for the () even Xdnl in case that the command contains an I/O redirection. Xdnl Xdnl AC_TRY_EVAL(VARIABLE) XAC_DEFUN(AC_TRY_EVAL, X[{ eval echo configure:__oline__: \"[$]$1\" 1>&AC_FD_CC; dnl Xeval [$]$1 2>&AC_FD_CC; }]) X Xdnl AC_TRY_COMMAND(COMMAND) XAC_DEFUN(AC_TRY_COMMAND, X[{ ac_try='$1'; AC_TRY_EVAL(ac_try); }]) X X Xdnl ### Dependencies between macros X X Xdnl AC_BEFORE(THIS-MACRO-NAME, CALLED-MACRO-NAME) Xdefine(AC_BEFORE, X[ifdef([AC_PROVIDE_$2], [errprint(__file__:__line__: [$2 was called before $1 X])])]) X Xdnl AC_REQUIRE(MACRO-NAME) Xdefine(AC_REQUIRE, X[ifdef([AC_PROVIDE_$1], , X[AC_DIVERT_PUSH(builtin(eval, AC_DIVERSION_CURRENT - 1))dnl Xindir([$1]) XAC_DIVERT_POP()dnl X])]) X Xdnl AC_PROVIDE(MACRO-NAME) Xdefine(AC_PROVIDE, X[define([AC_PROVIDE_$1], )]) X Xdnl AC_OBSOLETE(THIS-MACRO-NAME [, SUGGESTION]) Xdefine(AC_OBSOLETE, X[errprint(__file__:__line__: warning: [$1] is obsolete[$2] X)]) X X Xdnl ### Checking for programs X X Xdnl AC_CHECK_PROG(VARIABLE, PROG-TO-CHECK-FOR, VALUE-IF-FOUND Xdnl [, [VALUE-IF-NOT-FOUND] [, [PATH] [, [REJECT]]]]) XAC_DEFUN(AC_CHECK_PROG, X[# Extract the first word of "$2", so it can be a program name with args. Xset dummy $2; ac_word=[$]2 XAC_MSG_CHECKING([for $ac_word]) XAC_CACHE_VAL(ac_cv_prog_$1, X[if test -n "[$]$1"; then X ac_cv_prog_$1="[$]$1" # Let the user override the test. Xelse X IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" Xifelse([$6], , , [ ac_prog_rejected=no X])dnl Xdnl $ac_dummy forces splitting on constant user-supplied paths. Xdnl POSIX.2 word splitting is done only on the output of word expansions, Xdnl not every word. This closes a longstanding sh security hole. X ac_dummy="ifelse([$5], , $PATH, [$5])" X for ac_dir in $ac_dummy; do X test -z "$ac_dir" && ac_dir=. X if test -f $ac_dir/$ac_word; then Xifelse([$6], , , dnl X[ if test "[$ac_dir/$ac_word]" = "$6"; then X ac_prog_rejected=yes X continue X fi X])dnl X ac_cv_prog_$1="$3" X break X fi X done X IFS="$ac_save_ifs" Xifelse([$6], , , [if test $ac_prog_rejected = yes; then X # We found a bogon in the path, so make sure we never use it. X set dummy [$]ac_cv_prog_$1 X shift X if test [$]# -gt 0; then X # We chose a different compiler from the bogus one. X # However, it has the same basename, so the bogon will be chosen X # first if we set $1 to just the basename; use the full file name. X shift X set dummy "$ac_dir/$ac_word" "[$]@" X shift X ac_cv_prog_$1="[$]@" Xifelse([$2], [$4], dnl X[ else X # Default is a loser. X AC_MSG_ERROR([$1=$6 unacceptable, but no other $4 found in dnl Xifelse([$5], , [\$]PATH, [$5])]) X])dnl X fi Xfi X])dnl Xdnl If no 4th arg is given, leave the cache variable unset, Xdnl so AC_CHECK_PROGS will keep looking. Xifelse([$4], , , [ test -z "[$]ac_cv_prog_$1" && ac_cv_prog_$1="$4" X])dnl Xfi])dnl X$1="$ac_cv_prog_$1" Xif test -n "[$]$1"; then X AC_MSG_RESULT([$]$1) Xelse X AC_MSG_RESULT(no) Xfi XAC_SUBST($1)dnl X]) X Xdnl AC_PATH_PROG(VARIABLE, PROG-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND [, PATH]]) XAC_DEFUN(AC_PATH_PROG, X[# Extract the first word of "$2", so it can be a program name with args. Xset dummy $2; ac_word=[$]2 XAC_MSG_CHECKING([for $ac_word]) XAC_CACHE_VAL(ac_cv_path_$1, X[case "[$]$1" in X /*) X ac_cv_path_$1="[$]$1" # Let the user override the test with a path. X ;; X ?:/*) X ac_cv_path_$1="[$]$1" # Let the user override the test with a dos path. X ;; X *) X IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" Xdnl $ac_dummy forces splitting on constant user-supplied paths. Xdnl POSIX.2 word splitting is done only on the output of word expansions, Xdnl not every word. This closes a longstanding sh security hole. X ac_dummy="ifelse([$4], , $PATH, [$4])" X for ac_dir in $ac_dummy; do X test -z "$ac_dir" && ac_dir=. X if test -f $ac_dir/$ac_word; then X ac_cv_path_$1="$ac_dir/$ac_word" X break X fi X done X IFS="$ac_save_ifs" Xdnl If no 3rd arg is given, leave the cache variable unset, Xdnl so AC_PATH_PROGS will keep looking. Xifelse([$3], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$3" X])dnl X ;; Xesac])dnl X$1="$ac_cv_path_$1" Xif test -n "[$]$1"; then X AC_MSG_RESULT([$]$1) Xelse X AC_MSG_RESULT(no) Xfi XAC_SUBST($1)dnl X]) X Xdnl AC_CHECK_PROGS(VARIABLE, PROGS-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND Xdnl [, PATH]]) XAC_DEFUN(AC_CHECK_PROGS, X[for ac_prog in $2 Xdo XAC_CHECK_PROG($1, [$]ac_prog, [$]ac_prog, , $4) Xtest -n "[$]$1" && break Xdone Xifelse([$3], , , [test -n "[$]$1" || $1="$3" X])]) X Xdnl AC_PATH_PROGS(VARIABLE, PROGS-TO-CHECK-FOR [, VALUE-IF-NOT-FOUND Xdnl [, PATH]]) XAC_DEFUN(AC_PATH_PROGS, X[for ac_prog in $2 Xdo XAC_PATH_PROG($1, [$]ac_prog, , $4) Xtest -n "[$]$1" && break Xdone Xifelse([$3], , , [test -n "[$]$1" || $1="$3" X])]) X Xdnl Internal subroutine. XAC_DEFUN(AC_CHECK_TOOL_PREFIX, X[AC_REQUIRE([AC_CANONICAL_HOST])AC_REQUIRE([AC_CANONICAL_BUILD])dnl Xif test $host != $build; then X ac_tool_prefix=${host_alias}- Xelse X ac_tool_prefix= Xfi X]) X Xdnl AC_CHECK_TOOL(VARIABLE, PROG-TO-CHECK-FOR[, VALUE-IF-NOT-FOUND [, PATH]]) XAC_DEFUN(AC_CHECK_TOOL, X[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl XAC_CHECK_PROG($1, ${ac_tool_prefix}$2, ${ac_tool_prefix}$2, X ifelse([$3], , [$2], ), $4) Xifelse([$3], , , [ Xif test -z "$ac_cv_prog_$1"; then Xif test -n "$ac_tool_prefix"; then X AC_CHECK_PROG($1, $2, $2, $3) Xelse X $1="$3" Xfi Xfi]) X]) X Xdnl Guess the value for the `prefix' variable by looking for Xdnl the argument program along PATH and taking its parent. Xdnl Example: if the argument is `gcc' and we find /usr/local/gnu/bin/gcc, Xdnl set `prefix' to /usr/local/gnu. Xdnl This comes too late to find a site file based on the prefix, Xdnl and it might use a cached value for the path. Xdnl No big loss, I think, since most configures don't use this macro anyway. Xdnl AC_PREFIX_PROGRAM(PROGRAM) XAC_DEFUN(AC_PREFIX_PROGRAM, X[if test "x$prefix" = xNONE; then Xchangequote(<<, >>)dnl Xdefine(<>, translit($1, [a-z], [A-Z]))dnl Xchangequote([, ])dnl Xdnl We reimplement AC_MSG_CHECKING (mostly) to avoid the ... in the middle. Xecho $ac_n "checking for prefix by $ac_c" 1>&AC_FD_MSG XAC_PATH_PROG(AC_VAR_NAME, $1) Xchangequote(<<, >>)dnl X if test -n "$ac_cv_path_<<>>AC_VAR_NAME"; then X prefix=`echo $ac_cv_path_<<>>AC_VAR_NAME|sed 's%/[^/][^/]*//*[^/][^/]*$%%'` Xchangequote([, ])dnl X fi Xfi Xundefine([AC_VAR_NAME])dnl X]) X Xdnl Try to compile, link and execute TEST-PROGRAM. Set WORKING-VAR to Xdnl `yes' if the current compiler works, otherwise set it ti `no'. Set Xdnl CROSS-VAR to `yes' if the compiler and linker produce non-native Xdnl executables, otherwise set it to `no'. Before calling Xdnl `AC_TRY_COMPILER()', call `AC_LANG_*' to set-up for the right Xdnl language. Xdnl Xdnl AC_TRY_COMPILER(TEST-PROGRAM, WORKING-VAR, CROSS-VAR) XAC_DEFUN(AC_TRY_COMPILER, X[cat > conftest.$ac_ext << EOF Xifelse(AC_LANG, [FORTRAN77], , X[ X[#]line __oline__ "configure" X#include "confdefs.h" X]) X[$1] XEOF Xif AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then X [$2]=yes X # If we can't run a trivial program, we are probably using a cross compiler. X if (./conftest${ac_xexeext}; exit) 2>/dev/null; then X [$3]=no X else X [$3]=yes X fi Xelse X echo "configure: failed program was:" >&AC_FD_CC X cat conftest.$ac_ext >&AC_FD_CC X [$2]=no Xfi Xrm -fr conftest*]) X X Xdnl ### Checking for libraries X X Xdnl AC_TRY_LINK_FUNC(func, action-if-found, action-if-not-found) Xdnl Try to link a program that calls FUNC, handling GCC builtins. If Xdnl the link succeeds, execute ACTION-IF-FOUND; otherwise, execute Xdnl ACTION-IF-NOT-FOUND. X XAC_DEFUN(AC_TRY_LINK_FUNC, XAC_TRY_LINK(dnl Xifelse([$1], [main], , dnl Avoid conflicting decl of main. X[/* Override any gcc2 internal prototype to avoid an error. */ X]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus Xextern "C" X#endif X])dnl X[/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $1(); X]), X[$1()], X[$2], X[$3])) X X Xdnl AC_SEARCH_LIBS(FUNCTION, SEARCH-LIBS [, ACTION-IF-FOUND Xdnl [, ACTION-IF-NOT-FOUND [, OTHER-LIBRARIES]]]) Xdnl Search for a library defining FUNC, if it's not already available. X XAC_DEFUN(AC_SEARCH_LIBS, X[AC_PREREQ([2.13]) XAC_CACHE_CHECK([for library containing $1], [ac_cv_search_$1], X[ac_func_search_save_LIBS="$LIBS" Xac_cv_search_$1="no" XAC_TRY_LINK_FUNC([$1], [ac_cv_search_$1="none required"]) Xtest "$ac_cv_search_$1" = "no" && for i in $2; do XLIBS="-l$i $5 $ac_func_search_save_LIBS" XAC_TRY_LINK_FUNC([$1], X[ac_cv_search_$1="-l$i" Xbreak]) Xdone XLIBS="$ac_func_search_save_LIBS"]) Xif test "$ac_cv_search_$1" != "no"; then X test "$ac_cv_search_$1" = "none required" || LIBS="$ac_cv_search_$1 $LIBS" X $3 Xelse : X $4 Xfi]) X X X Xdnl AC_CHECK_LIB(LIBRARY, FUNCTION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND Xdnl [, OTHER-LIBRARIES]]]) XAC_DEFUN(AC_CHECK_LIB, X[AC_MSG_CHECKING([for $2 in -l$1]) Xdnl Use a cache variable name containing both the library and function name, Xdnl because the test really is for library $1 defining function $2, not Xdnl just for library $1. Separate tests with the same $1 and different $2s Xdnl may have different results. Xac_lib_var=`echo $1['_']$2 | sed 'y%./+-%__p_%'` XAC_CACHE_VAL(ac_cv_lib_$ac_lib_var, X[ac_save_LIBS="$LIBS" XLIBS=`echo "-l$1 $5 $LIBS" | sed -e 's/-lc //'` XAC_TRY_LINK(dnl Xifelse(AC_LANG, [FORTRAN77], , Xifelse([$2], [main], , dnl Avoid conflicting decl of main. X[/* Override any gcc2 internal prototype to avoid an error. */ X]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus Xextern "C" X#endif X])dnl X[/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $2(); X])), X [$2()], X eval "ac_cv_lib_$ac_lib_var=yes", X eval "ac_cv_lib_$ac_lib_var=no") XLIBS="$ac_save_LIBS" X])dnl Xif eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then X AC_MSG_RESULT(yes) X ifelse([$3], , X[changequote(, )dnl X ac_tr_lib=HAVE_LIB`echo $1 | sed -e 's/[^a-zA-Z0-9_]/_/g' \ X -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` Xchangequote([, ])dnl X AC_DEFINE_UNQUOTED($ac_tr_lib) X LIBS="-l$1 $LIBS" X], [$3]) Xelse X AC_MSG_RESULT(no) Xifelse([$4], , , [$4 X])dnl Xfi X]) X Xdnl AC_HAVE_LIBRARY(LIBRARY, [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND Xdnl [, OTHER-LIBRARIES]]]) XAC_DEFUN(AC_HAVE_LIBRARY, X[AC_OBSOLETE([$0], [; instead use AC_CHECK_LIB])dnl Xchangequote(<<, >>)dnl Xdefine(<>, dnl Xpatsubst(patsubst($1, <>, <<\1>>), <<-l>>, <<>>))dnl Xdefine(<>, ac_cv_lib_<<>>AC_LIB_NAME)dnl Xchangequote([, ])dnl XAC_MSG_CHECKING([for -l[]AC_LIB_NAME]) XAC_CACHE_VAL(AC_CV_NAME, X[ac_save_LIBS="$LIBS" XLIBS="-l[]AC_LIB_NAME[] $4 $LIBS" XAC_TRY_LINK( , [main()], AC_CV_NAME=yes, AC_CV_NAME=no) XLIBS="$ac_save_LIBS" X])dnl XAC_MSG_RESULT($AC_CV_NAME) Xif test "$AC_CV_NAME" = yes; then X ifelse([$2], , X[AC_DEFINE([HAVE_LIB]translit(AC_LIB_NAME, [a-z], [A-Z])) X LIBS="-l[]AC_LIB_NAME[] $LIBS" X], [$2]) Xifelse([$3], , , [else X $3 X])dnl Xfi Xundefine([AC_LIB_NAME])dnl Xundefine([AC_CV_NAME])dnl X]) X X Xdnl ### Examining declarations X X Xdnl AC_TRY_CPP(INCLUDES, [ACTION-IF-TRUE [, ACTION-IF-FALSE]]) XAC_DEFUN(AC_TRY_CPP, X[AC_REQUIRE_CPP()dnl Xcat > conftest.$ac_ext <&AC_FD_CC X echo "configure: failed program was:" >&AC_FD_CC X cat conftest.$ac_ext >&AC_FD_CC Xifelse([$3], , , [ rm -rf conftest* X $3 X])dnl Xfi Xrm -f conftest*]) X Xdnl AC_EGREP_HEADER(PATTERN, HEADER-FILE, ACTION-IF-FOUND [, Xdnl ACTION-IF-NOT-FOUND]) XAC_DEFUN(AC_EGREP_HEADER, X[AC_EGREP_CPP([$1], [#include <$2>], [$3], [$4])]) X Xdnl Because this macro is used by AC_PROG_GCC_TRADITIONAL, which must Xdnl come early, it is not included in AC_BEFORE checks. Xdnl AC_EGREP_CPP(PATTERN, PROGRAM, [ACTION-IF-FOUND [, Xdnl ACTION-IF-NOT-FOUND]]) XAC_DEFUN(AC_EGREP_CPP, X[AC_REQUIRE_CPP()dnl Xcat > conftest.$ac_ext <&AC_FD_CC | Xdnl Prevent m4 from eating character classes: Xchangequote(, )dnl X egrep "$1" >/dev/null 2>&1; then Xchangequote([, ])dnl X ifelse([$3], , :, [rm -rf conftest* X $3]) Xifelse([$4], , , [else X rm -rf conftest* X $4 X])dnl Xfi Xrm -f conftest* X]) X X Xdnl ### Examining syntax X X Xdnl AC_TRY_COMPILE(INCLUDES, FUNCTION-BODY, Xdnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) XAC_DEFUN(AC_TRY_COMPILE, X[cat > conftest.$ac_ext <&AC_FD_CC X cat conftest.$ac_ext >&AC_FD_CC Xifelse([$4], , , [ rm -rf conftest* X $4 X])dnl Xfi Xrm -f conftest*]) X X Xdnl AC_TRY_COMPILE2(INCLUDES, FUNCTION-BODY, Xdnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) XAC_DEFUN(AC_TRY_COMPILE2, X[cat > conftest2.$ac_ext <&AC_FD_CC X cat conftest.$ac_ext >&AC_FD_CC Xifelse([$4], , , [$4 X])dnl Xfi X]) X X Xdnl ### Examining libraries X X Xdnl AC_COMPILE_CHECK(ECHO-TEXT, INCLUDES, FUNCTION-BODY, Xdnl ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]) XAC_DEFUN(AC_COMPILE_CHECK, X[AC_OBSOLETE([$0], [; instead use AC_TRY_COMPILE or AC_TRY_LINK, and AC_MSG_CHECKING and AC_MSG_RESULT])dnl Xifelse([$1], , , [AC_CHECKING([for $1]) X])dnl XAC_TRY_LINK([$2], [$3], [$4], [$5]) X]) X Xdnl AC_TRY_LINK(INCLUDES, FUNCTION-BODY, Xdnl [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) XAC_DEFUN(AC_TRY_LINK, X[cat > conftest.$ac_ext <&AC_FD_CC X cat conftest.$ac_ext >&AC_FD_CC Xifelse([$4], , , [ rm -rf conftest* X $4 X])dnl Xfi Xrm -f conftest*]) X X Xdnl ### Checking for run-time features X X Xdnl AC_TRY_RUN(PROGRAM, [ACTION-IF-TRUE [, ACTION-IF-FALSE Xdnl [, ACTION-IF-CROSS-COMPILING]]]) XAC_DEFUN(AC_TRY_RUN, X[if test "$cross_compiling" = yes; then X ifelse([$4], , X [errprint(__file__:__line__: warning: [AC_TRY_RUN] called without default to allow cross compiling X)dnl X AC_MSG_ERROR(can not run test program while cross compiling)], X [$4]) Xelse X AC_TRY_RUN_NATIVE([$1], [$2], [$3]) Xfi X]) X Xdnl Like AC_TRY_RUN but assumes a native-environment (non-cross) compiler. Xdnl AC_TRY_RUN_NATIVE(PROGRAM, [ACTION-IF-TRUE [, ACTION-IF-FALSE]]) XAC_DEFUN(AC_TRY_RUN_NATIVE, X[cat > conftest.$ac_ext </dev/null Xthen Xdnl Don't remove the temporary files here, so they can be examined. X ifelse([$2], , :, [$2]) Xelse X echo "configure: failed program was:" >&AC_FD_CC X cat conftest.$ac_ext >&AC_FD_CC Xifelse([$3], , , [ rm -fr conftest* X $3 X])dnl Xfi Xrm -fr conftest*]) X X Xdnl ### Checking for header files X X Xdnl AC_CHECK_HEADER(HEADER-FILE, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) XAC_DEFUN(AC_CHECK_HEADER, X[dnl Do the transliteration at runtime so arg 1 can be a shell variable. Xac_safe=`echo "$1" | sed 'y%./+-%__p_%'` XAC_MSG_CHECKING([for $1]) XAC_CACHE_VAL(ac_cv_header_$ac_safe, X[AC_TRY_CPP([#include <$1>], eval "ac_cv_header_$ac_safe=yes", X eval "ac_cv_header_$ac_safe=no")])dnl Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X AC_MSG_RESULT(yes) X ifelse([$2], , :, [$2]) Xelse X AC_MSG_RESULT(no) Xifelse([$3], , , [$3 X])dnl Xfi X]) X Xdnl AC_CHECK_HEADERS(HEADER-FILE... [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) XAC_DEFUN(AC_CHECK_HEADERS, X[for ac_hdr in $1 Xdo XAC_CHECK_HEADER($ac_hdr, X[changequote(, )dnl X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` Xchangequote([, ])dnl X AC_DEFINE_UNQUOTED($ac_tr_hdr) $2], $3)dnl Xdone X]) X X Xdnl ### Checking for the existence of files X Xdnl AC_CHECK_FILE(FILE, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) XAC_DEFUN(AC_CHECK_FILE, X[AC_REQUIRE([AC_PROG_CC]) Xdnl Do the transliteration at runtime so arg 1 can be a shell variable. Xac_safe=`echo "$1" | sed 'y%./+-%__p_%'` XAC_MSG_CHECKING([for $1]) XAC_CACHE_VAL(ac_cv_file_$ac_safe, X[if test "$cross_compiling" = yes; then X errprint(__file__:__line__: warning: Cannot check for file existence when cross compiling X)dnl X AC_MSG_ERROR(Cannot check for file existence when cross compiling) Xelse X if $rmttest -r $1; then X eval "ac_cv_file_$ac_safe=yes" X else X eval "ac_cv_file_$ac_safe=no" X fi Xfi])dnl Xif eval "test \"`echo '$ac_cv_file_'$ac_safe`\" = yes"; then X AC_MSG_RESULT(yes) X ifelse([$2], , :, [$2]) Xelse X AC_MSG_RESULT(no) Xifelse([$3], , , [$3]) Xfi X]) X Xdnl AC_CHECK_FILES(FILE... [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) XAC_DEFUN(AC_CHECK_FILES, X[for ac_file in $1 Xdo XAC_CHECK_FILE($ac_file, X[changequote(, )dnl X ac_tr_file=HAVE_`echo $ac_file | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` Xchangequote([, ])dnl X AC_DEFINE_UNQUOTED($ac_tr_file) $2], $3)dnl Xdone X]) X X Xdnl ### Checking for library functions X X Xdnl AC_CHECK_FUNC(FUNCTION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) XAC_DEFUN(AC_CHECK_FUNC, X[AC_MSG_CHECKING([for $1]) XAC_CACHE_VAL(ac_cv_func_$1, X[AC_TRY_LINK( Xdnl Don't include because on OSF/1 3.0 it includes Xdnl which includes which contains a prototype for Xdnl select. Similarly for bzero. X[/* System header to define __stub macros and hopefully few prototypes, X which can conflict with char $1(); below. */ X#include X/* Override any gcc2 internal prototype to avoid an error. */ X]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus Xextern "C" X#endif X])dnl X[/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $1(); X], [ X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$1) || defined (__stub___$1) Xchoke me X#else X$1(); X#endif X], eval "ac_cv_func_$1=yes", eval "ac_cv_func_$1=no")]) Xif eval "test \"`echo '$ac_cv_func_'$1`\" = yes"; then X AC_MSG_RESULT(yes) X ifelse([$2], , :, [$2]) Xelse X AC_MSG_RESULT(no) Xifelse([$3], , , [$3 X])dnl Xfi X]) X Xdnl AC_CHECK_FUNCS(FUNCTION... [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) XAC_DEFUN(AC_CHECK_FUNCS, X[for ac_func in $1 Xdo XAC_CHECK_FUNC($ac_func, X[changequote(, )dnl X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` Xchangequote([, ])dnl X AC_DEFINE_UNQUOTED($ac_tr_func) $2], $3)dnl Xdone X]) X Xdnl AC_REPLACE_FUNCS(FUNCTION...) XAC_DEFUN(AC_REPLACE_FUNCS, X[AC_CHECK_FUNCS([$1], , [LIBOBJS="$LIBOBJS ${ac_func}.${ac_objext}"]) XAC_SUBST(LIBOBJS)dnl X]) X X Xdnl ### Raw Checking for the pure existence of library functions X X Xdnl AC_RCHECK_FUNC(FUNCTION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) XAC_DEFUN(AC_RCHECK_FUNC, X[AC_MSG_CHECKING([for raw availability of $1]) XAC_CACHE_VAL(ac_cv_rfunc_$1, X[AC_TRY_LINK( Xdnl Don't include because on OSF/1 3.0 it includes Xdnl which includes which contains a prototype for Xdnl select. Similarly for bzero. X[/* Override any gcc2 internal prototype to avoid an error. */ X]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus Xextern "C" X#endif X])dnl X[/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $1(); X], [ X$1(); X], eval "ac_cv_rfunc_$1=yes", eval "ac_cv_rfunc_$1=no")]) Xif eval "test \"`echo '$ac_cv_rfunc_'$1`\" = yes"; then X AC_MSG_RESULT(yes) X ifelse([$2], , :, [$2]) Xelse X AC_MSG_RESULT(no) Xifelse([$3], , , [$3 X])dnl Xfi X]) X Xdnl AC_RCHECK_FUNCS(FUNCTION... [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) XAC_DEFUN(AC_RCHECK_FUNCS, X[for ac_func in $1 Xdo XAC_RCHECK_FUNC($ac_func, X[changequote(, )dnl X ac_tr_func=HAVE_RAW_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` Xchangequote([, ])dnl X AC_DEFINE_UNQUOTED($ac_tr_func) $2], $3)dnl Xdone X]) X X Xdnl ### Checking compiler characteristics X X Xdnl AC_CHECK_SIZEOF(TYPE [, CROSS-SIZE]) XAC_DEFUN(AC_CHECK_SIZEOF, X[changequote(<<, >>)dnl Xdnl The name to #define. Xdefine(<>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl Xdnl The cache variable name. Xdefine(<>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl Xchangequote([, ])dnl XAC_MSG_CHECKING(size of $1) XAC_CACHE_VAL(AC_CV_NAME, X[AC_TRY_RUN([#include X#if HAVE_STDDEF_H || STDC_HEADERS X#include /* For ptrdiff_t, wchar_t, size_t */ X#endif X#ifdef HAVE_SYS_TYPES_H X#include X#endif Xmain() X{ X FILE *f=fopen("conftestval", "w"); X if (!f) exit(1); X fprintf(f, "%d\n", sizeof($1)); X exit(0); X}], AC_CV_NAME=`cat conftestval`, AC_CV_NAME=0, ifelse([$2], , , AC_CV_NAME=$2))])dnl XAC_MSG_RESULT($AC_CV_NAME) XAC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME) Xundefine([AC_TYPE_NAME])dnl Xundefine([AC_CV_NAME])dnl X]) X X Xdnl ### Checking for typedefs X X Xdnl AC_CHECK_TYPE(TYPE, DEFAULT) XAC_DEFUN(AC_CHECK_TYPE, X[AC_REQUIRE([AC_HEADER_STDC])dnl XAC_MSG_CHECKING(for $1) XAC_CACHE_VAL(ac_cv_type_$1, X[AC_EGREP_CPP(dnl Xchangequote(<<,>>)dnl X<<(^|[^a-zA-Z_0-9])$1[^a-zA-Z_0-9]>>dnl Xchangequote([,]), [#include X#if HAVE_STDLIB_H || STDC_HEADERS X#include X#endif X#if HAVE_STDDEF_H || STDC_HEADERS X#include X#endif], ac_cv_type_$1=yes, ac_cv_type_$1=no)])dnl XAC_MSG_RESULT($ac_cv_type_$1) Xif test $ac_cv_type_$1 = no; then X AC_DEFINE($1, $2) Xfi X]) X Xdnl AC_INCL_CHECK_TYPE(INCLUDES, TYPE, DEFAULT) XAC_DEFUN(AC_INCL_CHECK_TYPE, X[AC_REQUIRE([AC_HEADER_STDC])dnl XAC_MSG_CHECKING(for $2) XAC_CACHE_VAL(ac_cv_type_$2, X[AC_EGREP_CPP(dnl Xchangequote(<<,>>)dnl X<<(^|[^a-zA-Z_0-9])$2[^a-zA-Z_0-9]>>dnl Xchangequote([,]), [#include X#if HAVE_STDLIB_H || STDC_HEADERS X#include X#endif X#if HAVE_STDDEF_H || STDC_HEADERS X#include X#endif X$1], ac_cv_type_$2=yes, ac_cv_type_$2=no)])dnl XAC_MSG_RESULT($ac_cv_type_$2) Xif test $ac_cv_type_$2 = no; then X AC_DEFINE($2, $3) Xfi X]) X X Xdnl ### Creating output files X X Xdnl AC_CONFIG_HEADER(HEADER-TO-CREATE ...) XAC_DEFUN(AC_CONFIG_HEADER, X[define(AC_LIST_HEADER, $1)]) X Xdnl Link each of the existing files SOURCE... to the corresponding Xdnl link name in DEST... Xdnl AC_LINK_FILES(SOURCE..., DEST...) XAC_DEFUN(AC_LINK_FILES, X[dnl Xdefine([AC_LIST_FILES], ifdef([AC_LIST_FILES], [AC_LIST_FILES ],)[$1])dnl Xdefine([AC_LIST_LINKS], ifdef([AC_LIST_LINKS], [AC_LIST_LINKS ],)[$2])]) X Xdnl Add additional commands for AC_OUTPUT to put into config.status. Xdnl Use diversions instead of macros so we can be robust in the Xdnl presence of commas in $1 and/or $2. Xdnl AC_OUTPUT_COMMANDS(EXTRA-CMDS, INIT-CMDS) XAC_DEFUN(AC_OUTPUT_COMMANDS, X[AC_DIVERT_PUSH(AC_DIVERSION_CMDS)dnl X[$1] XAC_DIVERT_POP()dnl XAC_DIVERT_PUSH(AC_DIVERSION_ICMDS)dnl X[$2] XAC_DIVERT_POP()]) X Xdnl AC_CONFIG_SUBDIRS(DIR ...) XAC_DEFUN(AC_CONFIG_SUBDIRS, X[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl Xdefine([AC_LIST_SUBDIRS], ifdef([AC_LIST_SUBDIRS], [AC_LIST_SUBDIRS ],)[$1])dnl Xsubdirs="AC_LIST_SUBDIRS" XAC_SUBST(subdirs)dnl X]) X Xdnl The big finish. Xdnl Produce config.status, config.h, and links; and configure subdirs. Xdnl AC_OUTPUT([FILE...] [, EXTRA-CMDS] [, INIT-CMDS]) Xdefine(AC_OUTPUT, X[trap '' 1 2 15 XAC_CACHE_SAVE Xtrap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 X Xtest "x$prefix" = xNONE && prefix=$ac_default_prefix X# Let make expand exec_prefix. Xtest "x$exec_prefix" = xNONE && exec_prefix='${prefix}' X X# Any assignment to VPATH causes Sun make to only execute X# the first set of double-colon rules, so remove it if not needed. X# If there is a colon in the path, we need to keep it. Xif test "x$srcdir" = x.; then Xchangequote(, )dnl X ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' Xchangequote([, ])dnl Xfi X Xtrap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 X Xifdef([AC_LIST_HEADER], [DEFS=-DHAVE_CONFIG_H], [AC_OUTPUT_MAKE_DEFS()]) X X# Without the "./", some shells look in PATH for config.status. X: ${CONFIG_STATUS=./config.status} X Xecho creating $CONFIG_STATUS Xrm -f $CONFIG_STATUS Xcat > $CONFIG_STATUS </dev/null | sed 1q`: X# X[#] [$]0 [$]ac_configure_args X# X# Compiler output produced by configure, useful for debugging X# configure, is in ./config.log if it exists. X Xchangequote(, )dnl Xac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" Xchangequote([, ])dnl Xfor ac_option Xdo X case "[\$]ac_option" in X -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) X echo "running [\$]{CONFIG_SHELL-/bin/sh} [$]0 [$]ac_configure_args --no-create --no-recursion" X exec [\$]{CONFIG_SHELL-/bin/sh} [$]0 [$]ac_configure_args --no-create --no-recursion ;; X -version | --version | --versio | --versi | --vers | --ver | --ve | --v) X echo "$CONFIG_STATUS generated by autoconf version AC_ACVERSION AC_ACVERSION_SCHILY" X exit 0 ;; X -help | --help | --hel | --he | --h) X echo "[\$]ac_cs_usage"; exit 0 ;; X *) echo "[\$]ac_cs_usage"; exit 1 ;; X esac Xdone X Xac_given_srcdir=$srcdir Xifdef([AC_PROVIDE_AC_PROG_INSTALL], [ac_given_INSTALL="$INSTALL" X])dnl X Xchangequote(<<, >>)dnl Xifdef(<>, X<>, X<>) Xchangequote([, ])dnl XEOF Xcat >> $CONFIG_STATUS <> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF Xundivert(AC_DIVERSION_CMDS)dnl X$2 Xexit 0 XEOF Xchmod +x $CONFIG_STATUS Xrm -fr confdefs* $ac_clean_files Xtest "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 Xdnl config.status should not do recursion. Xifdef([AC_LIST_SUBDIRS], [AC_OUTPUT_SUBDIRS(AC_LIST_SUBDIRS)])dnl X])dnl X Xdnl Set the DEFS variable to the -D options determined earlier. Xdnl This is a subroutine of AC_OUTPUT. Xdnl It is called inside configure, outside of config.status. Xdnl AC_OUTPUT_MAKE_DEFS() Xdefine(AC_OUTPUT_MAKE_DEFS, X[# Transform confdefs.h into DEFS. Xdnl Using a here document instead of a string reduces the quoting nightmare. X# Protect against shell expansion while executing Makefile rules. X# Protect against Makefile macro expansion. Xcat > conftest.defs <<\EOF Xchangequote(<<, >>)dnl Xs%<<#define>> \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g Xs%[ `~<<#>>$^&*(){}\\|;'"<>?]%\\&%g Xs%\[%\\&%g Xs%\]%\\&%g Xs%\$%$$%g Xchangequote([, ])dnl XEOF XDEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` Xrm -f conftest.defs X]) X Xdnl Do the variable substitutions to create the Makefiles or whatever. Xdnl This is a subroutine of AC_OUTPUT. It is called inside an unquoted Xdnl here document whose contents are going into config.status, but Xdnl upon returning, the here document is being quoted. Xdnl AC_OUTPUT_FILES(FILE...) Xdefine(AC_OUTPUT_FILES, X[# Protect against being on the right side of a sed subst in config.status. Xchangequote(, )dnl Xsed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g; X s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF Xchangequote([, ])dnl Xdnl These here document variables are unquoted when configure runs Xdnl but quoted when config.status runs, so variables are expanded once. X$ac_vpsub Xdnl Shell code in configure.in might set extrasub. X$extrasub Xdnl Insert the sed substitutions of variables. Xundivert(AC_DIVERSION_SED) XCEOF XEOF X Xcat >> $CONFIG_STATUS <<\EOF X X# Split the substitutions into bite-sized pieces for seds with X# small command number limits, like on Digital OSF/1 and HP-UX. Xac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. Xac_file=1 # Number of current file. Xac_beg=1 # First line for current file. Xac_end=$ac_max_sed_cmds # Line after last line for current file. Xac_more_lines=: Xac_sed_cmds="" Xwhile $ac_more_lines; do X if test $ac_beg -gt 1; then X sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file X else X sed "${ac_end}q" conftest.subs > conftest.s$ac_file X fi X if test ! -s conftest.s$ac_file; then X ac_more_lines=false X rm -f conftest.s$ac_file X else X if test -z "$ac_sed_cmds"; then X ac_sed_cmds="sed -f conftest.s$ac_file" X else X ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" X fi X ac_file=`expr $ac_file + 1` X ac_beg=$ac_end X ac_end=`expr $ac_end + $ac_max_sed_cmds` X fi Xdone Xif test -z "$ac_sed_cmds"; then X ac_sed_cmds=cat Xfi XEOF X Xcat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF Xfor ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then Xchangequote(, )dnl X # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". X case "$ac_file" in X *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` X ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; X *) ac_file_in="${ac_file}.in" ;; X esac X X # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. X X # Remove last slash and all that follows it. Not all systems have dirname. X ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` Xchangequote([, ])dnl X if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then X # The file is in a subdirectory. X test ! -d "$ac_dir" && mkdir "$ac_dir" X ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" X # A "../" for each directory in $ac_dir_suffix. Xchangequote(, )dnl X ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` Xchangequote([, ])dnl X else X ac_dir_suffix= ac_dots= X fi X X case "$ac_given_srcdir" in X .) srcdir=. X if test -z "$ac_dots"; then top_srcdir=. X else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; X /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; X *) # Relative path. X srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" X top_srcdir="$ac_dots$ac_given_srcdir" ;; X esac X Xifdef([AC_PROVIDE_AC_PROG_INSTALL], X[ case "$ac_given_INSTALL" in Xchangequote(, )dnl X [/$]*) INSTALL="$ac_given_INSTALL" ;; Xchangequote([, ])dnl X *) INSTALL="$ac_dots$ac_given_INSTALL" ;; X esac X])dnl X X echo creating "$ac_file" X rm -f "$ac_file" X configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." X case "$ac_file" in X *Makefile*) ac_comsub="1i\\ X# $configure_input" ;; X *) ac_comsub= ;; X esac X X ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` X sed -e "$ac_comsub Xs%@configure_input@%$configure_input%g Xs%@srcdir@%$srcdir%g Xs%@top_srcdir@%$top_srcdir%g Xifdef([AC_PROVIDE_AC_PROG_INSTALL], [s%@INSTALL@%$INSTALL%g X])dnl Xdnl The parens around the eval prevent an "illegal io" in Ultrix sh. X" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file Xdnl This would break Makefile dependencies. Xdnl if cmp -s $ac_file conftest.out 2>/dev/null; then Xdnl echo "$ac_file is unchanged" Xdnl rm -f conftest.out Xdnl else Xdnl rm -f $ac_file Xdnl mv conftest.out $ac_file Xdnl fi Xfi; done Xrm -f conftest.s* X]) X Xdnl Create the config.h files from the config.h.in files. Xdnl This is a subroutine of AC_OUTPUT. It is called inside a quoted Xdnl here document whose contents are going into config.status. Xdnl AC_OUTPUT_HEADER(HEADER-FILE...) Xdefine(AC_OUTPUT_HEADER, X[changequote(<<, >>)dnl X# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where X# NAME is the cpp macro being defined and VALUE is the value it is being given. X# X# ac_d sets the value in "#define NAME VALUE" lines. Xac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' Xac_dB='\([ ][ ]*\)[^ ]*%\1#\2' Xac_dC='\3' Xac_dD='%g' X# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". Xac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' Xac_uB='\([ ]\)%\1#\2define\3' Xac_uC=' ' Xac_uD='\4%g' X# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". Xac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' Xac_eB='<<$>>%\1#\2define\3' Xac_eC=' ' Xac_eD='%g' Xchangequote([, ])dnl X Xif test "${CONFIG_HEADERS+set}" != set; then XEOF Xdnl Support passing AC_CONFIG_HEADER a value containing shell variables. Xcat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF Xfi Xfor ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then Xchangequote(, )dnl X # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". X case "$ac_file" in X *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` X ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; X *) ac_file_in="${ac_file}.in" ;; X esac Xchangequote([, ])dnl X X echo creating $ac_file X X rm -f conftest.frag conftest.in conftest.out X ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` X cat $ac_file_inputs > conftest.in X XEOF X X# Transform confdefs.h into a sed script conftest.vals that substitutes X# the proper values into config.h.in to produce config.h. And first: X# Protect against being on the right side of a sed subst in config.status. X# Protect against being in an unquoted here document in config.status. Xrm -f conftest.vals Xdnl Using a here document instead of a string reduces the quoting nightmare. Xdnl Putting comments in sed scripts is not portable. Xcat > conftest.hdr <<\EOF Xchangequote(<<, >>)dnl Xs/[\\&%]/\\&/g Xs%[\\$`]%\\&%g Xs%<<#define>> \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp Xs%ac_d%ac_u%gp Xs%ac_u%ac_e%gp Xchangequote([, ])dnl XEOF Xsed -n -f conftest.hdr confdefs.h > conftest.vals Xrm -f conftest.hdr X X# This sed command replaces #undef with comments. This is necessary, for X# example, in the case of _POSIX_SOURCE, which is predefined and required X# on some systems where configure will not decide to define it. Xcat >> conftest.vals <<\EOF Xchangequote(, )dnl Xs%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% Xchangequote([, ])dnl XEOF X X# Break up conftest.vals because some shells have a limit on X# the size of here documents, and old seds have small limits too. X Xrm -f conftest.tail Xwhile : Xdo X ac_lines=`grep -c . conftest.vals` X # grep -c gives empty output for an empty file on some AIX systems. X if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi X # Write a limited-size here document to conftest.frag. X echo ' cat > conftest.frag <> $CONFIG_STATUS X sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS X echo 'CEOF X sed -f conftest.frag conftest.in > conftest.out X rm -f conftest.in X mv conftest.out conftest.in X' >> $CONFIG_STATUS X sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail X rm -f conftest.vals X mv conftest.tail conftest.vals Xdone Xrm -f conftest.vals X Xdnl Now back to your regularly scheduled config.status. Xcat >> $CONFIG_STATUS <<\EOF X rm -f conftest.frag conftest.h X echo "/* $ac_file. Generated automatically by configure. */" > conftest.h X cat conftest.in >> conftest.h X rm -f conftest.in X if cmp -s $ac_file conftest.h 2>/dev/null; then X echo "$ac_file is unchanged" X rm -f conftest.h X else X # Remove last slash and all that follows it. Not all systems have dirname. X changequote(, )dnl X ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` X changequote([, ])dnl X if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then X # The file is in a subdirectory. X test ! -d "$ac_dir" && mkdir "$ac_dir" X fi X rm -f $ac_file X mv conftest.h $ac_file X fi Xfi; done X X]) X Xdnl This is a subroutine of AC_OUTPUT. It is called inside a quoted Xdnl here document whose contents are going into config.status. Xdnl AC_OUTPUT_LINKS(SOURCE..., DEST...) Xdefine(AC_OUTPUT_LINKS, X[EOF X Xcat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF Xsrcdir=$ac_given_srcdir Xwhile test -n "$ac_sources"; do X set $ac_dests; ac_dest=[$]1; shift; ac_dests=[$]* X set $ac_sources; ac_source=[$]1; shift; ac_sources=[$]* X X echo "linking $srcdir/$ac_source to $ac_dest" X X if test ! -r $srcdir/$ac_source; then X AC_MSG_ERROR($srcdir/$ac_source: File not found) X fi X rm -f $ac_dest X X # Make relative symlinks. X # Remove last slash and all that follows it. Not all systems have dirname. Xchangequote(, )dnl X ac_dest_dir=`echo $ac_dest|sed 's%/[^/][^/]*$%%'` Xchangequote([, ])dnl X if test "$ac_dest_dir" != "$ac_dest" && test "$ac_dest_dir" != .; then X # The dest file is in a subdirectory. X test ! -d "$ac_dest_dir" && mkdir "$ac_dest_dir" X ac_dest_dir_suffix="/`echo $ac_dest_dir|sed 's%^\./%%'`" X # A "../" for each directory in $ac_dest_dir_suffix. Xchangequote(, )dnl X ac_dots=`echo $ac_dest_dir_suffix|sed 's%/[^/]*%../%g'` Xchangequote([, ])dnl X else X ac_dest_dir_suffix= ac_dots= X fi X X case "$srcdir" in Xchangequote(, )dnl X [/$]*) ac_rel_source="$srcdir/$ac_source" ;; Xchangequote([, ])dnl X *) ac_rel_source="$ac_dots$srcdir/$ac_source" ;; X esac X X # Make a symlink if possible; otherwise try a hard link. X if ln -s $ac_rel_source $ac_dest 2>/dev/null || X ln $srcdir/$ac_source $ac_dest; then : X else X AC_MSG_ERROR(can not link $ac_dest to $srcdir/$ac_source) X fi Xdone X]) X Xdnl This is a subroutine of AC_OUTPUT. Xdnl It is called after running config.status. Xdnl AC_OUTPUT_SUBDIRS(DIRECTORY...) Xdefine(AC_OUTPUT_SUBDIRS, X[ Xif test "$no_recursion" != yes; then X X # Remove --cache-file and --srcdir arguments so they do not pile up. X ac_sub_configure_args= X ac_prev= X for ac_arg in $ac_configure_args; do X if test -n "$ac_prev"; then X ac_prev= X continue X fi X case "$ac_arg" in X -cache-file | --cache-file | --cache-fil | --cache-fi \ X | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) X ac_prev=cache_file ;; X -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ X | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) X ;; X -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) X ac_prev=srcdir ;; X -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) X ;; X *) ac_sub_configure_args="$ac_sub_configure_args $ac_arg" ;; X esac X done X X for ac_config_dir in $1; do X X # Do not complain, so a configure script can configure whichever X # parts of a large source tree are present. X if test ! -d $srcdir/$ac_config_dir; then X continue X fi X X echo configuring in $ac_config_dir X X case "$srcdir" in X .) ;; X *) X if test -d ./$ac_config_dir || mkdir ./$ac_config_dir; then :; X else X AC_MSG_ERROR(can not create `pwd`/$ac_config_dir) X fi X ;; X esac X X ac_popdir=`pwd` X cd $ac_config_dir X Xchangequote(, )dnl X # A "../" for each directory in /$ac_config_dir. X ac_dots=`echo $ac_config_dir|sed -e 's%^\./%%' -e 's%[^/]$%&/%' -e 's%[^/]*/%../%g'` Xchangequote([, ])dnl X X case "$srcdir" in X .) # No --srcdir option. We are building in place. X ac_sub_srcdir=$srcdir ;; X /*) # Absolute path. X ac_sub_srcdir=$srcdir/$ac_config_dir ;; X *) # Relative path. X ac_sub_srcdir=$ac_dots$srcdir/$ac_config_dir ;; X esac X X # Check for guested configure; otherwise get Cygnus style configure. X if test -f $ac_sub_srcdir/configure; then X ac_sub_configure=$ac_sub_srcdir/configure X elif test -f $ac_sub_srcdir/configure.in; then X ac_sub_configure=$ac_configure X else X AC_MSG_WARN(no configuration information is in $ac_config_dir) X ac_sub_configure= X fi X X # The recursion is here. X if test -n "$ac_sub_configure"; then X X # Make the cache file name correct relative to the subdirectory. X case "$cache_file" in X /*) ac_sub_cache_file=$cache_file ;; X *) # Relative path. X ac_sub_cache_file="$ac_dots$cache_file" ;; X esac Xifdef([AC_PROVIDE_AC_PROG_INSTALL], X [ case "$ac_given_INSTALL" in Xchangequote(, )dnl X [/$]*) INSTALL="$ac_given_INSTALL" ;; Xchangequote([, ])dnl X *) INSTALL="$ac_dots$ac_given_INSTALL" ;; X esac X])dnl X X echo "[running ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file] --srcdir=$ac_sub_srcdir" X # The eval makes quoting arguments work. X if eval ${CONFIG_SHELL-/bin/sh} $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_sub_srcdir X then : X else X AC_MSG_ERROR($ac_sub_configure failed for $ac_config_dir) X fi X fi X X cd $ac_popdir X done Xfi X]) END-of-star-1.6/autoconf/acgeneral.m4 echo x - star-1.6/autoconf/aclocal.m4 sed 's/^X//' >star-1.6/autoconf/aclocal.m4 << 'END-of-star-1.6/autoconf/aclocal.m4' Xdnl @(#)aclocal.m4 1.110 18/08/08 Copyright 1998-2018 J. Schilling X Xdnl Set VARIABLE to VALUE in C-string form, verbatim, or 1. Xdnl AC_DEFINE_STRING(VARIABLE [, VALUE]) Xdefine(AC_DEFINE_STRING, X[cat >> confdefs.h <<\EOF X[#define] $1 ifelse($#, 2, "[$2]", $#, 3, "[$2]", 1) XEOF X]) X Xdnl Similar, but perform shell substitutions $ ` \ once on VALUE. Xdefine(AC_DEFINE_UNQUOTED_STRING, X[cat >> confdefs.h <>)dnl X<<(^|[^a-zA-Z_0-9])$2[^a-zA-Z_0-9]>>dnl Xchangequote([,]), [#include X#if HAVE_STDLIB_H || STDC_HEADERS X#include X#endif X#if HAVE_STDDEF_H || STDC_HEADERS X#include X#endif X$1], eval ac_cv_have_type_$2=yes, eval ac_cv_have_type_$2=no)])dnl XAC_MSG_RESULT($ac_cv_have_type_$2) Xchangequote(, )dnl X ac_tr_type=HAVE_TYPE_`echo $2 | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` Xchangequote([, ])dnl Xif test $ac_cv_have_type_$2 = yes; then X AC_DEFINE_UNQUOTED($ac_tr_type) Xfi X]) X XAC_DEFUN(AC_ICONV_CONST, X[AC_CACHE_CHECK(whether iconv() uses const char **, ac_cv_iconv_const, X[cat > conftest.c < XEOF Xif AC_TRY_COMMAND(${CC-cc} -E conftest.c) | grep 'size_t.*iconv.*iconv_t.*const' >/dev/null 2>&1; then X ac_cv_iconv_const=yes Xelse X ac_cv_iconv_const=no Xfi]) Xif test $ac_cv_iconv_const = yes; then X AC_DEFINE(HAVE_ICONV_CONST) Xfi]) X XAC_DEFUN(AC_PROG_CPPX, X[AC_REQUIRE([AC_PROG_CPP])dnl XAC_MSG_CHECKING(how to run the C preprocessor for any type of file) Xif test -z "$CPPX"; then XAC_CACHE_VAL(ac_cv_prog_CPPX, X[ # This must be in double quotes, not single quotes, because CPP may get X # substituted into the Makefile and "${CC-cc}" will confuse make. X CPPX="$CPP" X CPPX_IN="" X cat > conftestcpp << EOF X xxzzy XEOF X # gcc -E does not accept any file suffix, so we need to test X # and if $CC -E fails, we try to use dirname(which($CC))/cpp X # We cannot use AC_TRY_EVAL(CPPX conftestcpp | grep xxzzy) because X # of a bug in the parser from bash X ac_result=`(echo configure:__oline__: "$CPPX conftestcpp | grep xxzzy" 1>&5; eval $CPPX conftestcpp | grep xxzzy) 2>&5` X if test -z "$ac_result"; then X changequote(, )dnl X ac_file=`eval type ${CC-cc} 2>/dev/null | sed 's%[^/]*/%/%'` X # Remove last slash and all that follows it. Not all systems have dirname. X ac_dir=`echo "$ac_file" | sed 's%/[^/][^/]*$%%'` X changequote([, ])dnl X if test -f "$ac_dir"/cpp; then X CPPX="$ac_dir"/cpp X else X # gcc -E does not like all file types, but X # gcc -E - < does. Test whether this works. X ac_result=`(echo configure:__oline__: "$CPPX - < conftestcpp | grep xxzzy" 1>&5; eval $CPPX - < conftestcpp | grep xxzzy) 2>&5` X if test -n "$ac_result"; then X CPPX_IN="- <" X fi X fi X fi X ac_cv_prog_CPPX="$CPPX" X ac_cv_prog_CPPX_IN="$CPPX_IN"])dnl X CPPX="$ac_cv_prog_CPPX" X CPPX_IN="$ac_cv_prog_CPPX_IN" Xelse X ac_cv_prog_CPPX="$CPPX" X ac_cv_prog_CPPX_IN="$CPPX_IN" Xfi XAC_MSG_RESULT($CPPX '"$CPPX_IN"') XAC_SUBST(CPPX)dnl XAC_SUBST(CPPX_IN)dnl X]) X Xdnl Checks if /bin/sh is bash Xdnl Defines BIN_SHELL_IS_BASH on success. XAC_DEFUN([AC_BIN_SHELL_BASH], X[AC_CACHE_CHECK([if /bin/sh is bash], ac_cv_bin_shell_is_bash, X [ Xac_err=`< /dev/null /bin/sh --version 2> /dev/null | egrep 'GNU sh|bash'` Xif test -n "$ac_err"; then X ac_cv_bin_shell_is_bash=yes Xelse X ac_cv_bin_shell_is_bash=no Xfi X]) Xif test $ac_cv_bin_shell_is_bash = yes; then X AC_DEFINE(BIN_SHELL_IS_BASH) Xfi]) X Xdnl Checks if sh is bash Xdnl Defines SHELL_IS_BASH on success. XAC_DEFUN([AC_SHELL_BASH], X[AC_CACHE_CHECK([if sh is bash], ac_cv_shell_is_bash, X [ Xac_err=`< /dev/null sh --version 2> /dev/null | egrep 'GNU sh|bash'` Xif test -n "$ac_err"; then X ac_cv_shell_is_bash=yes Xelse X ac_cv_shell_is_bash=no Xfi X]) Xif test $ac_cv_shell_is_bash = yes; then X AC_DEFINE(SHELL_IS_BASH) Xfi]) X Xdnl Checks if /bin/sh -ce is broken Xdnl Defines BIN_SHELL_CE_IS_BROKEN on success. XAC_DEFUN([AC_BIN_SHELL_CE_BROKEN], X[AC_CACHE_CHECK([whether /bin/sh -ce is broken], ac_cv_bin_shell_ce_is_broken, X [ Xac_err=`/bin/sh -ce 'for i in 1 2 3; do ( echo $i; if test -d . ; then (false; echo 4); fi ) ; done' | grep 2` Xif test -n "$ac_err"; then X ac_cv_bin_shell_ce_is_broken=yes Xelse X ac_cv_bin_shell_ce_is_broken=no Xfi X]) Xif test $ac_cv_bin_shell_ce_is_broken = yes; then X AC_DEFINE(BIN_SHELL_CE_IS_BROKEN) Xfi]) X Xdnl Checks if /bin/bosh is a working shell Xdnl Defines BIN_SHELL_BOSH on success. XAC_DEFUN([AC_BIN_SHELL_BOSH], X[AC_CACHE_CHECK([whether /bin/bosh is a working shell], ac_cv_bin_shell_bosh, X [ Xac_err=`< /dev/null /bin/bosh -c 'echo abc' 2> /dev/null | grep abc` Xif test "$ac_err" != "abc"; then X ac_cv_bin_shell_bosh=no Xelse X ac_err=`/bin/bosh -ce 'for i in 1 2 3; do ( echo $i; if test -d . ; then (false; echo 4); fi ) ; done' | grep 2` X if test -z "$ac_err"; then X ac_cv_bin_shell_bosh=yes X else X ac_cv_bin_shell_bosh=no X fi Xfi X]) Xif test $ac_cv_bin_shell_bosh = yes; then X AC_DEFINE(BIN_SHELL_BOSH) Xfi]) X Xdnl Checks if /opt/schily/bin/bosh is a working shell Xdnl Defines OPT_SCHILY_BIN_SHELL_BOSH on success. XAC_DEFUN([AC_OPT_SCHILY_BIN_SHELL_BOSH], X[AC_CACHE_CHECK([whether /opt/schily/bin/bosh is a working shell], ac_cv_opt_schily_bin_shell_bosh, X [ Xac_err=`< /dev/null /opt/schily/bin/bosh -c 'echo abc' 2> /dev/null | grep abc` Xif test "$ac_err" != "abc"; then X ac_cv_opt_schily_bin_shell_bosh=no Xelse X ac_err=`/opt/schily/bin/bosh -ce 'for i in 1 2 3; do ( echo $i; if test -d . ; then (false; echo 4); fi ) ; done' | grep 2` X if test -z "$ac_err"; then X ac_cv_opt_schily_bin_shell_bosh=yes X else X ac_cv_opt_schily_bin_shell_bosh=no X fi Xfi X]) Xif test $ac_cv_opt_schily_bin_shell_bosh = yes; then X AC_DEFINE(OPT_SCHILY_BIN_SHELL_BOSH) Xfi]) X Xdnl Checks if sh -ce is broken Xdnl Defines SHELL_CE_IS_BROKEN on success. XAC_DEFUN([AC_SHELL_CE_BROKEN], X[AC_CACHE_CHECK([whether sh -ce is broken], ac_cv_shell_ce_is_broken, X [ Xac_err=`sh -ce 'for i in 1 2 3; do ( echo $i; if test -d . ; then (false; echo 4); fi ) ; done' | grep 2` Xif test -n "$ac_err"; then X ac_cv_shell_ce_is_broken=yes Xelse X ac_cv_shell_ce_is_broken=no Xfi X]) Xif test $ac_cv_shell_ce_is_broken = yes; then X AC_DEFINE(SHELL_CE_IS_BROKEN) Xfi]) X Xdnl Checks if Sun cc supports -m64 Xdnl Defines sun_cc64_opt on success. XAC_DEFUN([AC_SUN_CC64_OPT], X[AC_CACHE_CHECK([if suncc/cc supports -m64], ac_cv_sun_cc64_opt, X [ Xsun_cc64=cc Xsun_cc64_opt='' Xac_cv_sun_cc64_opt=no Xif test "$GCC" != yes; then X if test "$CC" = suncc; then X sun_cc64=suncc X fi X ac_err=`< /dev/null eval $sun_cc64 -m64 -c 2>&1 | grep illegal` X if test -n "$ac_err"; then X ac_cv_sun_cc64_opt=no X else X ac_cv_sun_cc64_opt=yes X fi Xfi X]) Xif test $ac_cv_sun_cc64_opt = yes; then X sun_cc64_opt='-m64' Xfi]) X Xdnl Checks if HP cc supports -Ae Xdnl Defines hp_cc_ansi_opt on success. XAC_DEFUN([AC_HP_CC_ANSI_OPT], X[AC_CACHE_CHECK([if HP cc supports -Ae], ac_cv_hp_cc_ansi_opt, X [ Xhp_cc=cc Xhp_cc_ansi_opt='' Xac_cv_hp_cc_ansi_opt=no Xif test "$GCC" != yes; then X os_name=`(uname -s) 2> /dev/null` X if test ."$os_name" = .HP-UX ; then X ac_err=`< /dev/null eval $hp_cc -Ae -c 2>&1 | grep 'Bundled.*option is available only'` X if test -n "$ac_err"; then X ac_cv_hp_cc_ansi_opt=no X else X ac_cv_hp_cc_ansi_opt=yes X fi X fi Xfi X]) Xif test $ac_cv_hp_cc_ansi_opt = yes; then X hp_cc_ansi_opt='-Ae' Xfi]) X Xdnl Checks if HP cc supports -O Xdnl Defines hp_cc_opt_opt on success. XAC_DEFUN([AC_HP_CC_OPT_OPT], X[AC_CACHE_CHECK([if HP cc supports -O], ac_cv_hp_cc_opt_opt, X [ Xhp_cc=cc Xhp_cc_opt_opt='' Xac_cv_hp_cc_opt_opt=no Xif test "$GCC" != yes; then X os_name=`(uname -s) 2> /dev/null` X if test ."$os_name" = .HP-UX ; then X ac_err=`< /dev/null eval $hp_cc -O -c 2>&1 | grep 'Bundled.*option is available only'` X if test -n "$ac_err"; then X ac_cv_hp_cc_opt_opt=no X else X ac_cv_hp_cc_opt_opt=yes X fi X fi Xfi X]) Xif test $ac_cv_hp_cc_opt_opt = yes; then X hp_cc_opt_opt='-O' Xfi]) X Xdnl Checks if HP cc supports -G Xdnl Defines hp_cc_gprof_opt on success. XAC_DEFUN([AC_HP_CC_GPROF_OPT], X[AC_CACHE_CHECK([if HP cc supports -G], ac_cv_hp_cc_gprof_opt, X [ Xhp_cc=cc Xhp_cc_gprof_opt='' Xac_cv_hp_cc_gprof_opt=no Xif test "$GCC" != yes; then X os_name=`(uname -s) 2> /dev/null` X if test ."$os_name" = .HP-UX ; then X ac_err=`< /dev/null eval $hp_cc -O -c 2>&1 | grep 'Bundled.*option is available only'` X if test -n "$ac_err"; then X ac_cv_hp_cc_gprof_opt=no X else X ac_cv_hp_cc_gprof_opt=yes X fi X fi Xfi X]) Xif test $ac_cv_hp_cc_gprof_opt = yes; then X hp_cc_gprof_opt='-G' Xfi]) X Xdnl XXX this used to be: Xdnl #ifndef $2 Xdnl char *p = (char *) $2; Xdnl #endif Xdnl but we use this test in order to check whether we are able to get the Xdnl address of a function from this name, so we did replace this by: Xdnl char *p = (char *) $2; Xdnl exit (p != (char *)0 && *p != 0); Prevent optimizer from removing previous line Xdnl Xdnl AC_CHECK_DECLARE(INCLUDES, SYMBOL) Xdnl Checks if symbol is declared Xdnl Defines HAVE_DECL_SYMBOL on success. XAC_DEFUN([AC_CHECK_DECLARE], X[AC_CACHE_CHECK([if $2 is declared], ac_cv_have_decl_$2, X [AC_TRY_COMPILE([$1], X[ char *p = (char *) $2; exit (p != (char *)0 && *p != 0); ], X [eval ac_cv_have_decl_$2=yes], X [eval ac_cv_have_decl_$2=no])]) Xchangequote(, )dnl X ac_tr_decl=HAVE_DECL_`echo $2 | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` Xchangequote([, ])dnl Xif test $ac_cv_have_decl_$2 = yes; then X AC_DEFINE_UNQUOTED($ac_tr_decl) Xfi]) X Xdnl AC_CHECK_DFUNC(INCLUDES, SYMBOL) Xdnl Checks if symbol is defined or a function Xdnl Defines HAVE_SYMBOL on success. XAC_DEFUN([AC_CHECK_DFUNC], X[AC_CACHE_CHECK([if $2 is defined or function], ["ac_cv_have_$2"], X [AC_TRY_LINK([$1], X[ X#ifndef $2 X char *p = (char *) $2; X exit (p != (char *)0 && *p != 0); X#endif], X [eval ac_cv_have_$2=yes], X [eval ac_cv_have_$2=no])]) Xchangequote(, )dnl X ac_tr_dfunc=HAVE_`echo $2 | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` Xchangequote([, ])dnl Xif eval "test \"`echo '$ac_cv_have_'$2`\" = yes"; then X AC_DEFINE_UNQUOTED($ac_tr_dfunc) Xfi X]) X Xdnl AC_CHECK_DFUNCS(INCLUDES, FUNCTION...) XAC_DEFUN(AC_CHECK_DFUNCS, X[for ac_func in [$2] Xdo XAC_CHECK_DFUNC([$1], $ac_func)dnl Xdone X]) X Xdnl Checks whether symbol is defined or a function in a lib Xdnl AC_CHECK_DLIB(INCLUDES, LIBRARY, FUNCTION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND Xdnl [, OTHER-LIBRARIES]]]) XAC_DEFUN(AC_CHECK_DLIB, X[AC_MSG_CHECKING([for $3 in -l$2]) Xdnl Use a cache variable name containing both the library and function name, Xdnl because the test really is for library $2 defining function $3, not Xdnl just for library $2. Separate tests with the same $2 and different $3s Xdnl may have different results. Xac_lib_var=`echo $2['_']$3 | sed 'y%./+-%__p_%'` XAC_CACHE_VAL(ac_cv_lib_$ac_lib_var, X[ac_save_LIBS="$LIBS" XLIBS="-l$2 $6 $LIBS" XAC_TRY_LINK([$1], X[ X#ifndef $3 X char *p = (char *) $3; X exit (p != (char *)0 && *p != 0); X#endif], X eval "ac_cv_lib_$ac_lib_var=yes", X eval "ac_cv_lib_$ac_lib_var=no") XLIBS="$ac_save_LIBS" X])dnl Xif eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then X AC_MSG_RESULT(yes) X ifelse([$4], , X[changequote(, )dnl X ac_tr_lib=HAVE_LIB`echo $2 | sed -e 's/[^a-zA-Z0-9_]/_/g' \ X -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` Xchangequote([, ])dnl X AC_DEFINE_UNQUOTED($ac_tr_lib) X LIBS="-l$2 $LIBS" X], [$4]) Xelse X AC_MSG_RESULT(no) Xifelse([$5], , , [$5 X])dnl Xfi X]) X Xdnl Checks whether symbol is in a lib Xdnl this does not work for void func() Xdnl AC_CHECK_ILIB(INCLUDES, LIBRARY, FUNCTION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND Xdnl [, OTHER-LIBRARIES]]]) XAC_DEFUN(AC_CHECK_ILIB, X[AC_MSG_CHECKING([for $3 in -l$2]) Xdnl Use a cache variable name containing both the library and function name, Xdnl because the test really is for library $2 defining function $3, not Xdnl just for library $2. Separate tests with the same $2 and different $3s Xdnl may have different results. Xac_lib_var=`echo $2['_']$3 | sed 'y%./+-%__p_%'` XAC_CACHE_VAL(ac_cv_lib_$ac_lib_var, X[ac_save_LIBS="$LIBS" XLIBS="-l$2 $6 $LIBS" XAC_TRY_LINK([$1], X[ X char *p = (char *) $3; X X return ((int)p); X], X eval "ac_cv_lib_$ac_lib_var=yes", X eval "ac_cv_lib_$ac_lib_var=no") XLIBS="$ac_save_LIBS" X])dnl Xif eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then X AC_MSG_RESULT(yes) X ifelse([$4], , X[changequote(, )dnl X ac_tr_lib=HAVE_LIB`echo $2 | sed -e 's/[^a-zA-Z0-9_]/_/g' \ X -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` Xchangequote([, ])dnl X AC_DEFINE_UNQUOTED($ac_tr_lib) X LIBS="-l$2 $LIBS" X], [$4]) Xelse X AC_MSG_RESULT(no) Xifelse([$5], , , [$5 X])dnl Xfi X]) X Xdnl getpagesize is a inline function in unistd.h on Android XAC_DEFUN([AC_FUNC_GETPAGESIZE], X[AC_CHECK_DFUNC([ X#ifdef HAVE_UNISTD_H X#include X#endif X], getpagesize)]) X X Xdnl Checks if structure 'stat' have field 'st_spare1'. Xdnl Defines HAVE_ST_SPARE1 on success. XAC_DEFUN([AC_STRUCT_ST_SPARE1], X[AC_CACHE_CHECK([if struct stat contains st_spare1], ac_cv_struct_st_spare1, X [AC_TRY_COMPILE([#include X#include ], X [struct stat s; s.st_spare1 = 0;], X [ac_cv_struct_st_spare1=yes], X [ac_cv_struct_st_spare1=no])]) Xif test $ac_cv_struct_st_spare1 = yes; then X AC_DEFINE(HAVE_ST_SPARE1) Xfi]) X Xdnl Checks if structure 'stat' have field 'st_atimensec'. Xdnl Defines HAVE_ST_ATIMENSEC on success. XAC_DEFUN([AC_STRUCT_ST_ATIMENSEC], X[AC_CACHE_CHECK([if struct stat contains st_atimensec], ac_cv_struct_st_atimensec, X [AC_TRY_COMPILE([#include X#include ], X [struct stat s; s.st_atimensec = 0;], X [ac_cv_struct_st_atimensec=yes], X [ac_cv_struct_st_atimensec=no])]) Xif test $ac_cv_struct_st_atimensec = yes; then X AC_DEFINE(HAVE_ST_ATIMENSEC) Xfi]) X Xdnl Checks if structure 'stat' have field 'st_atime_n'. Xdnl Defines HAVE_ST_ATIME_N on success. XAC_DEFUN([AC_STRUCT_ST_ATIME_N], X[AC_CACHE_CHECK([if struct stat contains st_atime_n], ac_cv_struct_st_atime_n, X [AC_TRY_COMPILE([#include X#include ], X [struct stat s; s.st_atime_n = 0;], X [ac_cv_struct_st_atime_n=yes], X [ac_cv_struct_st_atime_n=no])]) Xif test $ac_cv_struct_st_atime_n = yes; then X AC_DEFINE(HAVE_ST_ATIME_N) Xfi]) X Xdnl Checks if structure 'stat' have field 'st_atim.tv_nsec'. Xdnl Defines HAVE_ST_NSEC on success. XAC_DEFUN([AC_STRUCT_ST_NSEC], X[AC_CACHE_CHECK([if struct stat contains st_atim.tv_nsec], ac_cv_struct_st_nsec, X [AC_TRY_COMPILE([#include X#include ], X [struct stat s; s.st_atim.tv_nsec = 0;], X [ac_cv_struct_st_nsec=yes], X [ac_cv_struct_st_nsec=no])]) Xif test $ac_cv_struct_st_nsec = yes; then X AC_DEFINE(HAVE_ST_NSEC) Xfi]) X Xdnl Checks if structure 'stat' have field 'st_atim.st__tim.tv_nsec'. Xdnl Defines HAVE_ST__TIM on success. XAC_DEFUN([AC_STRUCT_ST__TIM], X[AC_CACHE_CHECK([if struct stat contains st_atim.st__tim.tv_nsec], ac_cv_struct_st__tim, X [AC_TRY_COMPILE([#include X#include ], X [struct stat s; s.st_atim.st__tim.tv_nsec = 0;], X [ac_cv_struct_st__tim=yes], X [ac_cv_struct_st__tim=no])]) Xif test $ac_cv_struct_st__tim = yes; then X AC_DEFINE(HAVE_ST__TIM) Xfi]) X Xdnl Checks if structure 'stat' have field 'st_atimspec.tv_nsec'. Xdnl Defines HAVE_ST_ATIMESPEC on success. XAC_DEFUN([AC_STRUCT_ST_ATIMESPEC], X[AC_CACHE_CHECK([if struct stat contains st_atimespec.tv_nsec], ac_cv_struct_st_atimespec, X [AC_TRY_COMPILE([#include X#include ], X [struct stat s; s.st_atimespec.tv_nsec = 0;], X [ac_cv_struct_st_atimespec=yes], X [ac_cv_struct_st_atimespec=no])]) Xif test $ac_cv_struct_st_atimespec = yes; then X AC_DEFINE(HAVE_ST_ATIMESPEC) Xfi]) X Xdnl Checks if structure 'stat' have field 'st_flag'. Xdnl Defines HAVE_ST_FLAG on success. XAC_DEFUN([AC_STRUCT_ST_FLAG], X[AC_CACHE_CHECK([if struct stat contains st_flag], ac_cv_struct_st_flag, X [AC_TRY_COMPILE([#include X#include ], X [struct stat s; s.st_flag = 0;], X [ac_cv_struct_st_flag=yes], X [ac_cv_struct_st_flag=no])]) Xif test $ac_cv_struct_st_flag = yes; then X AC_DEFINE(HAVE_ST_FLAG) Xfi]) X Xdnl Checks if structure 'stat' have field 'st_flags'. Xdnl Defines HAVE_ST_FLAGS on success. XAC_DEFUN([AC_STRUCT_ST_FLAGS], X[AC_CACHE_CHECK([if struct stat contains st_flags], ac_cv_struct_st_flags, X [AC_TRY_COMPILE([#include X#include ], X [struct stat s; s.st_flags = 0;], X [ac_cv_struct_st_flags=yes], X [ac_cv_struct_st_flags=no])]) Xif test $ac_cv_struct_st_flags = yes; then X AC_DEFINE(HAVE_ST_FLAGS) Xfi]) X Xdnl Checks if structure 'stat' have field 'st_fstype'. Xdnl Defines HAVE_ST_FSTYPE on success. XAC_DEFUN([AC_STRUCT_ST_FSTYPE], X[AC_CACHE_CHECK([if struct stat contains st_fstype], ac_cv_struct_st_fstype, X [AC_TRY_COMPILE([#include X#include ], X [struct stat s; s.st_fstype[0] = 0;], X [ac_cv_struct_st_fstype=yes], X [ac_cv_struct_st_fstype=no])]) Xif test $ac_cv_struct_st_fstype = yes; then X AC_DEFINE(HAVE_ST_FSTYPE) Xfi]) X Xdnl Checks if structure 'stat' have field 'st_aclcnt'. Xdnl Defines HAVE_ST_ACLCNT on success. XAC_DEFUN([AC_STRUCT_ST_ACLCNT], X[AC_CACHE_CHECK([if struct stat contains st_aclcnt], ac_cv_struct_st_aclcnt, X [AC_TRY_COMPILE([#include X#include ], X [struct stat s; s.st_aclcnt = 0;], X [ac_cv_struct_st_aclcnt=yes], X [ac_cv_struct_st_aclcnt=no])]) Xif test $ac_cv_struct_st_aclcnt = yes; then X AC_DEFINE(HAVE_ST_ACLCNT) Xfi]) X Xdnl Checks if structure 'utsname' have field 'arch'. Xdnl Defines HAVE_UTSNAME_ARCH on success. XAC_DEFUN([AC_STRUCT_UTSNAME_ARCH], X[AC_CACHE_CHECK([if struct utsname contains arch], ac_cv_struct_utsname_arch, X [AC_TRY_COMPILE([#include ], X [struct utsname u; u.arch[0] = 0;], X [ac_cv_struct_utsname_arch=yes], X [ac_cv_struct_utsname_arch=no])]) Xif test $ac_cv_struct_utsname_arch = yes; then X AC_DEFINE(HAVE_UTSNAME_ARCH) Xfi]) X Xdnl Checks if structure 'utsname' have field 'processor'. Xdnl Defines HAVE_UTSNAME_PROCESSOR on success. XAC_DEFUN([AC_STRUCT_UTSNAME_PROCESSOR], X[AC_CACHE_CHECK([if struct utsname contains processor], ac_cv_struct_utsname_processor, X [AC_TRY_COMPILE([#include ], X [struct utsname u; u.processor[0] = 0;], X [ac_cv_struct_utsname_processor=yes], X [ac_cv_struct_utsname_processor=no])]) Xif test $ac_cv_struct_utsname_processor = yes; then X AC_DEFINE(HAVE_UTSNAME_PROCESSOR) Xfi]) X Xdnl Checks if structure 'utsname' have field 'sysname_host'. Xdnl Defines HAVE_UTSNAME_SYSNAME_HOST on success. XAC_DEFUN([AC_STRUCT_UTSNAME_SYSNAME_HOST], X[AC_CACHE_CHECK([if struct utsname contains sysname_host], ac_cv_struct_utsname_sysname_host, X [AC_TRY_COMPILE([#include ], X [struct utsname u; u.sysname_host[0] = 0;], X [ac_cv_struct_utsname_sysname_host=yes], X [ac_cv_struct_utsname_sysname_host=no])]) Xif test $ac_cv_struct_utsname_sysname_host = yes; then X AC_DEFINE(HAVE_UTSNAME_SYSNAME_HOST) Xfi]) X Xdnl Checks if structure 'utsname' have field 'release_host'. Xdnl Defines HAVE_UTSNAME_RELEASE_HOST on success. XAC_DEFUN([AC_STRUCT_UTSNAME_RELEASE_HOST], X[AC_CACHE_CHECK([if struct utsname contains release_host], ac_cv_struct_utsname_release_host, X [AC_TRY_COMPILE([#include ], X [struct utsname u; u.release_host[0] = 0;], X [ac_cv_struct_utsname_release_host=yes], X [ac_cv_struct_utsname_release_host=no])]) Xif test $ac_cv_struct_utsname_release_host = yes; then X AC_DEFINE(HAVE_UTSNAME_RELEASE_HOST) Xfi]) X Xdnl Checks if structure 'utsname' have field 'version_host'. Xdnl Defines HAVE_UTSNAME_VERSION_HOST on success. XAC_DEFUN([AC_STRUCT_UTSNAME_VERSION_HOST], X[AC_CACHE_CHECK([if struct utsname contains version_host], ac_cv_struct_utsname_version_host, X [AC_TRY_COMPILE([#include ], X [struct utsname u; u.version_host[0] = 0;], X [ac_cv_struct_utsname_version_host=yes], X [ac_cv_struct_utsname_version_host=no])]) Xif test $ac_cv_struct_utsname_version_host = yes; then X AC_DEFINE(HAVE_UTSNAME_VERSION_HOST) Xfi]) X Xdnl Checks if structure 'mtget' have field 'mt_type'. Xdnl Defines HAVE_MTGET_TYPE on success. XAC_DEFUN([AC_STRUCT_MTGET_TYPE], X[AC_CACHE_CHECK([if struct mtget contains mt_type], ac_cv_struct_mtget_type, X [AC_TRY_COMPILE([#include X#include ], X [struct mtget t; t.mt_type = 0;], X [ac_cv_struct_mtget_type=yes], X [ac_cv_struct_mtget_type=no])]) Xif test $ac_cv_struct_mtget_type = yes; then X AC_DEFINE(HAVE_MTGET_TYPE) Xfi]) X Xdnl Checks if structure 'mtget' have field 'mt_model'. Xdnl Defines HAVE_MTGET_MODEL on success. XAC_DEFUN([AC_STRUCT_MTGET_MODEL], X[AC_CACHE_CHECK([if struct mtget contains mt_model], ac_cv_struct_mtget_model, X [AC_TRY_COMPILE([#include X#include ], X [struct mtget t; t.mt_model = 0;], X [ac_cv_struct_mtget_model=yes], X [ac_cv_struct_mtget_model=no])]) Xif test $ac_cv_struct_mtget_model = yes; then X AC_DEFINE(HAVE_MTGET_MODEL) Xfi]) X Xdnl Checks if structure 'mtget' have field 'mt_dsreg'. Xdnl Defines HAVE_MTGET_DSREG on success. XAC_DEFUN([AC_STRUCT_MTGET_DSREG], X[AC_CACHE_CHECK([if struct mtget contains mt_dsreg], ac_cv_struct_mtget_dsreg, X [AC_TRY_COMPILE([#include X#include ], X [struct mtget t; t.mt_dsreg = 0;], X [ac_cv_struct_mtget_dsreg=yes], X [ac_cv_struct_mtget_dsreg=no])]) Xif test $ac_cv_struct_mtget_dsreg = yes; then X AC_DEFINE(HAVE_MTGET_DSREG) Xfi]) X Xdnl Checks if structure 'mtget' have field 'mt_dsreg1'. Xdnl Defines HAVE_MTGET_DSREG on success. XAC_DEFUN([AC_STRUCT_MTGET_DSREG1], X[AC_CACHE_CHECK([if struct mtget contains mt_dsreg1], ac_cv_struct_mtget_dsreg1, X [AC_TRY_COMPILE([#include X#include ], X [struct mtget t; t.mt_dsreg1 = 0;], X [ac_cv_struct_mtget_dsreg1=yes], X [ac_cv_struct_mtget_dsreg1=no])]) Xif test $ac_cv_struct_mtget_dsreg1 = yes; then X AC_DEFINE(HAVE_MTGET_DSREG1) Xfi]) X Xdnl Checks if structure 'mtget' have field 'mt_dsreg2'. Xdnl Defines HAVE_MTGET_DSREG2 on success. XAC_DEFUN([AC_STRUCT_MTGET_DSREG2], X[AC_CACHE_CHECK([if struct mtget contains mt_dsreg2], ac_cv_struct_mtget_dsreg2, X [AC_TRY_COMPILE([#include X#include ], X [struct mtget t; t.mt_dsreg2 = 0;], X [ac_cv_struct_mtget_dsreg2=yes], X [ac_cv_struct_mtget_dsreg2=no])]) Xif test $ac_cv_struct_mtget_dsreg2 = yes; then X AC_DEFINE(HAVE_MTGET_DSREG2) Xfi]) X Xdnl Checks if structure 'mtget' have field 'mt_gstat'. Xdnl Defines HAVE_MTGET_GSTAT on success. XAC_DEFUN([AC_STRUCT_MTGET_GSTAT], X[AC_CACHE_CHECK([if struct mtget contains mt_gstat], ac_cv_struct_mtget_gstat, X [AC_TRY_COMPILE([#include X#include ], X [struct mtget t; t.mt_gstat = 0;], X [ac_cv_struct_mtget_gstat=yes], X [ac_cv_struct_mtget_gstat=no])]) Xif test $ac_cv_struct_mtget_gstat = yes; then X AC_DEFINE(HAVE_MTGET_GSTAT) Xfi]) X Xdnl Checks if structure 'mtget' have field 'mt_erreg'. Xdnl Defines HAVE_MTGET_ERREG on success. XAC_DEFUN([AC_STRUCT_MTGET_ERREG], X[AC_CACHE_CHECK([if struct mtget contains mt_erreg], ac_cv_struct_mtget_erreg, X [AC_TRY_COMPILE([#include X#include ], X [struct mtget t; t.mt_erreg = 0;], X [ac_cv_struct_mtget_erreg=yes], X [ac_cv_struct_mtget_erreg=no])]) Xif test $ac_cv_struct_mtget_erreg = yes; then X AC_DEFINE(HAVE_MTGET_ERREG) Xfi]) X Xdnl Checks if structure 'mtget' have field 'mt_resid'. Xdnl Defines HAVE_MTGET_RESID on success. XAC_DEFUN([AC_STRUCT_MTGET_RESID], X[AC_CACHE_CHECK([if struct mtget contains mt_resid], ac_cv_struct_mtget_resid, X [AC_TRY_COMPILE([#include X#include ], X [struct mtget t; t.mt_resid = 0;], X [ac_cv_struct_mtget_resid=yes], X [ac_cv_struct_mtget_resid=no])]) Xif test $ac_cv_struct_mtget_resid = yes; then X AC_DEFINE(HAVE_MTGET_RESID) Xfi]) X Xdnl Checks if structure 'mtget' have field 'mt_fileno'. Xdnl Defines HAVE_MTGET_FILENO on success. XAC_DEFUN([AC_STRUCT_MTGET_FILENO], X[AC_CACHE_CHECK([if struct mtget contains mt_fileno], X ac_cv_struct_mtget_fileno, X [AC_TRY_COMPILE([#include X#include ], X [struct mtget t; t.mt_fileno = 0;], X [ac_cv_struct_mtget_fileno=yes], X [ac_cv_struct_mtget_fileno=no])]) Xif test $ac_cv_struct_mtget_fileno = yes; then X AC_DEFINE(HAVE_MTGET_FILENO) Xfi]) X Xdnl Checks if structure 'mtget' have field 'mt_blkno'. Xdnl Defines HAVE_MTGET_BLKNO on success. XAC_DEFUN([AC_STRUCT_MTGET_BLKNO], X[AC_CACHE_CHECK([if struct mtget contains mt_blkno], ac_cv_struct_mtget_blkno, X [AC_TRY_COMPILE([#include X#include ], X [struct mtget t; t.mt_blkno = 0;], X [ac_cv_struct_mtget_blkno=yes], X [ac_cv_struct_mtget_blkno=no])]) Xif test $ac_cv_struct_mtget_blkno = yes; then X AC_DEFINE(HAVE_MTGET_BLKNO) Xfi]) X Xdnl Checks if structure 'mtget' have field 'mt_flags'. Xdnl Defines HAVE_MTGET_FLAGS on success. XAC_DEFUN([AC_STRUCT_MTGET_FLAGS], X[AC_CACHE_CHECK([if struct mtget contains mt_flags], ac_cv_struct_mtget_flags, X [AC_TRY_COMPILE([#include X#include ], X [struct mtget t; t.mt_flags = 0;], X [ac_cv_struct_mtget_flags=yes], X [ac_cv_struct_mtget_flags=no])]) Xif test $ac_cv_struct_mtget_flags = yes; then X AC_DEFINE(HAVE_MTGET_FLAGS) Xfi]) X Xdnl Checks if structure 'mtget' have field 'mt_bf'. Xdnl Defines HAVE_MTGET_BF on success. XAC_DEFUN([AC_STRUCT_MTGET_BF], X[AC_CACHE_CHECK([if struct mtget contains mt_bf], ac_cv_struct_mtget_bf, X [AC_TRY_COMPILE([#include X#include ], X [struct mtget t; t.mt_bf = 0;], X [ac_cv_struct_mtget_bf=yes], X [ac_cv_struct_mtget_bf=no])]) Xif test $ac_cv_struct_mtget_bf = yes; then X AC_DEFINE(HAVE_MTGET_BF) Xfi]) X Xdnl Checks for illegal declaration of 'union semun' in sys/sem.h. Xdnl Defines HAVE_UNION_SEMUN on success. XAC_DEFUN([AC_STRUCT_UNION_SEMUN], X[AC_CACHE_CHECK([if an illegal declaration for union semun in sys/sem.h exists], ac_cv_struct_union_semun, X [AC_TRY_COMPILE([#include X#include X#include ], [union semun s;], X [ac_cv_struct_union_semun=yes], X [ac_cv_struct_union_semun=no])]) Xif test $ac_cv_struct_union_semun = yes; then X AC_DEFINE(HAVE_UNION_SEMUN) Xfi]) X Xdnl Checks if 'union wait' is declared in 'wait.h' or 'sys/wait.h'. Xdnl Defines HAVE_UNION_WAIT on success. XAC_DEFUN([AC_STRUCT_UNION_WAIT], X[AC_CACHE_CHECK([if union wait is declared in wait.h or sys/wait.h], ac_cv_struct_union_wait, X [AC_TRY_COMPILE([#include X#if defined(HAVE_WAIT_H) X# include X#else X#include X#endif], [union wait w;], X [ac_cv_struct_union_wait=yes], X [ac_cv_struct_union_wait=no])]) Xif test $ac_cv_struct_union_wait = yes; then X AC_DEFINE(HAVE_UNION_WAIT) Xfi]) X Xdnl Checks if union wait is used by default Xdnl Defines USE_UNION_WAIT to int on failure. XAC_DEFUN([AC_USE_STRUCT_UNION_WAIT], X[AC_REQUIRE([AC_HEADER_STDC])dnl XAC_MSG_CHECKING(if union wait is used by default) XAC_CACHE_VAL(ac_cv_use_union_wait, X[AC_EGREP_CPP(dnl Xchangequote(<<,>>)dnl X<>dnl Xchangequote([,]), [#include X#if defined(HAVE_WAIT_H) X# include X#else X#include X#endif Xxxzzy WTERMSIG(status) Xxxzzy WCOREDUMP(status) Xxxzzy WEXITSTATUS(status) Xxxzzy WSTOPSIG(status) Xxxzzy WIFSTOPPED(status) Xxxzzy WIFSIGNALED(status) Xxxzzy WIFEXITED(status)], ac_cv_use_union_wait=yes, ac_cv_use_union_wait=no)])dnl XAC_MSG_RESULT($ac_cv_use_union_wait) Xif test $ac_cv_use_union_wait = yes; then X AC_DEFINE(USE_UNION_WAIT) Xfi]) X Xdnl Checks if 'struct rusage' is declared in sys/resource.h. Xdnl Defines HAVE_STRUCT_RUSAGE on success. XAC_DEFUN([AC_STRUCT_RUSAGE], X[AC_CACHE_CHECK([if struct rusage is declared in sys/resource.h], ac_cv_struct_rusage, X [AC_TRY_COMPILE([#include X#include ], [struct rusage r;], X [ac_cv_struct_rusage=yes], X [ac_cv_struct_rusage=no])]) Xif test $ac_cv_struct_rusage = yes; then X AC_DEFINE(HAVE_STRUCT_RUSAGE) Xfi]) X Xdnl Checks if structure 'siginfo' have field 'si_utime'. Xdnl Defines HAVE_SI_UTIME on success. XAC_DEFUN([AC_STRUCT_SI_UTIME], X[AC_CACHE_CHECK([if struct siginfo contains si_utime], ac_cv_struct_si_utime, X [AC_TRY_COMPILE([#include X#include ], X [struct siginfo si; si.si_utime = 0;], X [ac_cv_struct_si_utime=yes], X [ac_cv_struct_si_utime=no])]) Xif test $ac_cv_struct_si_utime = yes; then X AC_DEFINE(HAVE_SI_UTIME) Xfi]) X X Xdnl Checks if structure 'dirent' have field 'd_ino'. Xdnl Defines HAVE_DIRENT_D_INO on success. XAC_DEFUN([AC_STRUCT_DIRENT_D_INO], X[AC_CACHE_CHECK([if struct dirent contains d_ino], ac_cv_struct_dirent_d_ino, X [AC_TRY_COMPILE([ X/* X * This must be kept in sync with schily/dirent.h X */ X#ifdef HAVE_SYS_TYPES_H X# include X#endif X#ifdef HAVE_SYS_STAT_H X# include X#endif X# ifdef HAVE_DIRENT_H /* This a POSIX compliant system */ X# include X# define _FOUND_DIR_ X# else /* This is a Pre POSIX system */ X X# define dirent direct X X# if defined(HAVE_SYS_DIR_H) X# include X# define _FOUND_DIR_ X# endif X X# if defined(HAVE_NDIR_H) && !defined(_FOUND_DIR_) X# include X# define _FOUND_DIR_ X# endif X X# if defined(HAVE_SYS_NDIR_H) && !defined(_FOUND_DIR_) X# include X# define _FOUND_DIR_ X# endif X# endif /* HAVE_DIRENT_H */ X ], X [struct dirent d; d.d_ino = 0;], X [ac_cv_struct_dirent_d_ino=yes], X [ac_cv_struct_dirent_d_ino=no])]) Xif test $ac_cv_struct_dirent_d_ino = yes; then X AC_DEFINE(HAVE_DIRENT_D_INO) Xfi]) X Xdnl Checks if structure 'dirent' have field 'd_type'. Xdnl Defines HAVE_DIRENT_D_TYPE on success. XAC_DEFUN([AC_STRUCT_DIRENT_D_TYPE], X[AC_CACHE_CHECK([if struct dirent contains d_type], ac_cv_struct_dirent_d_type, X [AC_TRY_COMPILE([ X/* X * This must be kept in sync with schily/dirent.h X */ X#ifdef HAVE_SYS_TYPES_H X# include X#endif X#ifdef HAVE_SYS_STAT_H X# include X#endif X# ifdef HAVE_DIRENT_H /* This a POSIX compliant system */ X# include X# define _FOUND_DIR_ X# else /* This is a Pre POSIX system */ X X# define dirent direct X X# if defined(HAVE_SYS_DIR_H) X# include X# define _FOUND_DIR_ X# endif X X# if defined(HAVE_NDIR_H) && !defined(_FOUND_DIR_) X# include X# define _FOUND_DIR_ X# endif X X# if defined(HAVE_SYS_NDIR_H) && !defined(_FOUND_DIR_) X# include X# define _FOUND_DIR_ X# endif X# endif /* HAVE_DIRENT_H */ X ], X [struct dirent d; d.d_type = 0;], X [ac_cv_struct_dirent_d_type=yes], X [ac_cv_struct_dirent_d_type=no])]) Xif test $ac_cv_struct_dirent_d_type = yes; then X AC_DEFINE(HAVE_DIRENT_D_TYPE) Xfi]) X Xdnl Checks if structure 'DIR' have field 'dd_fd'. Xdnl Defines HAVE_DIR_DD_FD on success. XAC_DEFUN([AC_STRUCT_DIR_DD_FD], X[AC_CACHE_CHECK([if DIR * contains dd_fd], ac_cv_struct_dir_dd_fd, X [AC_TRY_COMPILE([#include ], X [DIR d; d.dd_fd = 0; exit (d.dd_fd == 0);], X [ac_cv_struct_dir_dd_fd=yes], X [ac_cv_struct_dir_dd_fd=no])]) Xif test $ac_cv_struct_dir_dd_fd = yes; then X AC_DEFINE(HAVE_DIR_DD_FD) Xfi]) X Xdnl Checks wether major(), minor() and makedev() are defined in Xdnl 'sys/mkdev.h' or in 'sys/sysmacros.h. Defines MAJOR_IN_MKDEV or Xdnl MAJOR_IN_SYSMACROS or nothing. XAC_DEFUN([AC_HEADER_MAKEDEV], X[AC_CACHE_CHECK([for header file containing major(), minor() and makedev()], X ac_cv_header_makedev, X[ac_cv_header_makedev=none XAC_TRY_COMPILE([#include X#include ], X [int i = major(0); i = minor(0); i = makedev(0,0);], X [ac_cv_header_makedev=sys/mkdev.h]) Xif test $ac_cv_header_makedev = none; then X AC_TRY_COMPILE([#include X#include ], X [int i = major(0); i = minor(0); i = makedev(0,0);], X [ac_cv_header_makedev=sys/sysmacros.h]) Xfi]) Xif test $ac_cv_header_makedev = sys/mkdev.h; then X AC_DEFINE(MAJOR_IN_MKDEV) Xfi Xif test $ac_cv_header_makedev = sys/sysmacros.h; then X AC_DEFINE(MAJOR_IN_SYSMACROS) Xfi]) X Xdnl Checks for USG derived STDIO that uses _filbuf() Xdnl Defines HAVE__FILBUF on success. XAC_DEFUN([AC_HEADER__FILBUF], X[AC_CACHE_CHECK([for _filbuf()], ac_cv_func__filbuf, X [AC_TRY_LINK([#include ], X[FILE *f; Xint flag; Xint count; Xchar *ptr; Xchar c = 0; Xf = fopen("confdefs.h", "r"); X_filbuf(f); X_flsbuf(c, f); Xflag = f->_flag & _IONBF; Xflag |= f->_flag & _IOERR; Xflag |= f->_flag & _IOEOF; Xcount = f->_cnt; Xptr = (char *)f->_ptr; Xfclose(f);], X [ac_cv_func__filbuf=yes], X [ac_cv_func__filbuf=no])]) Xif test $ac_cv_func__filbuf = yes; then X AC_DEFINE(HAVE__FILBUF) Xfi]) X Xdnl Checks for USG derived STDIO that uses __filbuf() Xdnl Defines HAVE___FILBUF on success. XAC_DEFUN([AC_HEADER___FILBUF], X[AC_CACHE_CHECK([for __filbuf()], ac_cv_func___filbuf, X [AC_TRY_LINK([#include ], X[FILE *f; Xint flag; Xint count; Xchar *ptr; Xchar c = 0; Xf = fopen("confdefs.h", "r"); X__filbuf(f); X__flsbuf(c, f); Xflag = f->_flag & _IONBF; Xflag |= f->_flag & _IOERR; Xflag |= f->_flag & _IOEOF; Xcount = f->_cnt; Xptr = (char *)f->_ptr; Xfclose(f);], X [ac_cv_func___filbuf=yes], X [ac_cv_func___filbuf=no])]) Xif test $ac_cv_func___filbuf = yes; then X AC_DEFINE(HAVE___FILBUF) Xfi]) X Xdnl Checks for USG derived STDIO Xdnl Defines HAVE_USG_STDIO on success. XAC_DEFUN([AC_HEADER_USG_STDIO], X[AC_REQUIRE([AC_HEADER__FILBUF])AC_REQUIRE([AC_HEADER___FILBUF])dnl XAC_CACHE_CHECK([for USG derived STDIO], ac_cv_header_usg_stdio, X [AC_TRY_LINK([#include ], X[FILE *f; Xint flag; Xint count; Xchar *ptr; Xchar c = 0; Xf = fopen("confdefs.h", "r"); X#ifdef HAVE___FILBUF X__filbuf(f); X__flsbuf(c, f); X#else X# ifdef HAVE__FILBUF X_filbuf(f); X_flsbuf(c, f); X# else Xno filbuf() X# endif X#endif Xflag = f->_flag & _IONBF; Xflag |= f->_flag & _IOERR; Xflag |= f->_flag & _IOEOF; Xcount = f->_cnt; Xptr = (char *)f->_ptr; Xfclose(f);], X [ac_cv_header_usg_stdio=yes], X [ac_cv_header_usg_stdio=no])]) Xif test $ac_cv_header_usg_stdio = yes; then X AC_DEFINE(HAVE_USG_STDIO) Xfi]) X Xdnl Checks for Linux stdio with f->_flags Xdnl Defines HAVE_FILE__FLAGS on success. XAC_DEFUN([AC_HEADER_FILE__FLAGS], X[AC_CACHE_CHECK([for f->_flags in FILE *], ac_cv_file__flags, X [AC_TRY_LINK([#include ], X[FILE *f; Xint flags; Xf = fopen("confdefs.h", "r"); Xflags = f->_flags; Xfclose(f);], X [ac_cv_file__flags=yes], X [ac_cv_file__flags=no])]) Xif test $ac_cv_file__flags = yes; then X AC_DEFINE(HAVE_FILE__FLAGS) Xfi]) X Xdnl Checks for Linux stdio with f->_IO_buf_base Xdnl Defines HAVE_FILE__IO_BUF_BASE on success. XAC_DEFUN([AC_HEADER_FILE__IO_BUF_BASE], X[AC_CACHE_CHECK([for f->_IO_buf_base in FILE *], ac_cv_file__io_buf_base, X [AC_TRY_LINK([#include ], X[FILE *f; Xchar *ptr; Xf = fopen("confdefs.h", "r"); Xptr = f->_IO_buf_base; Xfclose(f);], X [ac_cv_file__io_buf_base=yes], X [ac_cv_file__io_buf_base=no])]) Xif test $ac_cv_file__io_buf_base = yes; then X AC_DEFINE(HAVE_FILE__IO_BUF_BASE) Xfi]) X Xdnl Checks for errno definition in Xdnl Defines HAVE_ERRNO_DEF on success. XAC_DEFUN([AC_HEADER_ERRNO_DEF], X[AC_CACHE_CHECK([for errno definition in errno.h], ac_cv_header_errno_def, X [AC_TRY_COMPILE([#include ], X[errno = 0;], X [ac_cv_header_errno_def=yes], X [ac_cv_header_errno_def=no])]) Xif test $ac_cv_header_errno_def = yes; then X AC_DEFINE(HAVE_ERRNO_DEF) Xfi]) X Xdnl Checks for environ definition in Xdnl Defines HAVE_ENVIRON_DEF on success. XAC_DEFUN([AC_HEADER_ENVIRON_DEF], X[AC_CACHE_CHECK([for environ definition in unistd.h/stdlib.h], ac_cv_header_environ_def, X [AC_TRY_COMPILE([ X#ifdef HAVE_UNISTD_H X#include X#else X#ifdef HAVE_STDLIB_H X#include /* MSC no unistd.h but environ in stdlib.h */ X#endif X#endif X], X[environ = 0;], X [ac_cv_header_environ_def=yes], X [ac_cv_header_environ_def=no])]) Xif test $ac_cv_header_environ_def = yes; then X AC_DEFINE(HAVE_ENVIRON_DEF) Xfi]) X Xdnl Checks for sys_siglist definition in Xdnl Defines HAVE_SYS_SIGLIST_DEF on success. XAC_DEFUN([AC_HEADER_SYS_SIGLIST_DEF], X[AC_CACHE_CHECK([for sys_siglist definition in signal.h], ac_cv_header_sys_siglist_def, X [AC_TRY_COMPILE([#include ], X[char *cp = (char *)sys_siglist[0]; exit (cp != (char *)0 && *cp != 0);], X [ac_cv_header_sys_siglist_def=yes], X [ac_cv_header_sys_siglist_def=no])]) Xif test $ac_cv_header_sys_siglist_def = yes; then X AC_DEFINE(HAVE_SYS_SIGLIST_DEF) Xfi]) X Xdnl Checks for extern timezone in time.h or sys/time.h Xdnl Defines HAVE_VAR_TIMEZONE_DEF on success. XAC_DEFUN([AC_VAR_TIMEZONE_DEF], X[AC_REQUIRE([AC_HEADER_TIME])dnl XAC_CACHE_CHECK([for extern timezone in time.h or sys/time.h], ac_cv_var_timezone_def, X [AC_TRY_COMPILE([ X#include X#ifdef TIME_WITH_SYS_TIME_H X# include X# include X#else X#ifdef HAVE_SYS_TIME_H X# include X#else X# include X#endif X#endif], [timezone = 1;], X [ac_cv_var_timezone_def=yes], X [ac_cv_var_timezone_def=no])]) Xif test $ac_cv_var_timezone_def = yes; then X AC_DEFINE(HAVE_VAR_TIMEZONE_DEF) Xfi]) X Xdnl Checks if extern long timezone exists in libc Xdnl Defines HAVE_VAR_TIMEZONE on success. XAC_DEFUN([AC_VAR_TIMEZONE], X[AC_CACHE_CHECK([for working extern long timezone ], ac_cv_var_timezone, X [AC_TRY_RUN([ Xextern long timezone; X Xint Xmain() X{ X exit(timezone != 0); X}], X [ac_cv_var_timezone=yes], X [ac_cv_var_timezone=no])]) Xif test $ac_cv_var_timezone = yes; then X AC_DEFINE(HAVE_VAR_TIMEZONE) Xfi]) X Xdnl Checks if extern char *__progname exists in libc Xdnl Defines HAVE_VAR___PROGNAME on success. XAC_DEFUN([AC_VAR___PROGNAME], X[AC_CACHE_CHECK([for working extern char *__progname ], ac_cv_var___progname, X [AC_TRY_RUN([ Xextern char *__progname; X Xint Xmain() X{ X exit (!(__progname != 0 && *__progname != '\0')); X}], X [ac_cv_var___progname=yes], X [ac_cv_var___progname=no])]) Xif test $ac_cv_var___progname = yes; then X AC_DEFINE(HAVE_VAR___PROGNAME) Xfi]) X Xdnl Checks if extern char *__progname_full exists in libc Xdnl Defines HAVE_VAR___PROGNAME_FULL on success. XAC_DEFUN([AC_VAR___PROGNAME_FULL], X[AC_CACHE_CHECK([for working extern char *__progname_full ], ac_cv_var___progname_full, X [AC_TRY_RUN([ Xextern char *__progname_full; X Xint Xmain() X{ X exit (!(__progname_full != 0 && *__progname_full != '\0')); X}], X [ac_cv_var___progname_full=yes], X [ac_cv_var___progname_full=no])]) Xif test $ac_cv_var___progname_full = yes; then X AC_DEFINE(HAVE_VAR___PROGNAME_FULL) Xfi]) X Xdnl Checks for UNIX-98 compliant Xdnl Defines HAVE_INTTYPES_H on success. XAC_DEFUN([AC_HEADER_INTTYPES], X[AC_CACHE_CHECK([for UNIX-98 compliant inttypes.h], ac_cv_header_inttypes, X [AC_TRY_COMPILE([#include ], X[int8_t c; uint8_t uc; int16_t s; uint16_t us; int32_t i; uint32_t ui; Xint64_t ll; uint64_t ull; Xintptr_t ip; uintptr_t uip;], X [ac_cv_header_inttypes=yes], X [ac_cv_header_inttypes=no])]) Xif test $ac_cv_header_inttypes = yes; then X AC_DEFINE(HAVE_INTTYPES_H) Xfi]) X Xdnl Checks for SUSv3 compliant Xdnl Defines HAVE_STDINT_H and HAVE_TYPE_INTMAX_T/HAVE_TYPE_UINTMAX_T on success. XAC_DEFUN([AC_HEADER_STDINT], X[AC_CACHE_CHECK([for SUSv3 compliant stdint.h], ac_cv_header_stdint, X [AC_TRY_COMPILE([#include ], X[int8_t c; uint8_t uc; int16_t s; uint16_t us; int32_t i; uint32_t ui; Xint64_t ll; uint64_t ull; Xintptr_t ip; uintptr_t uip; Xintmax_t im; uintmax_t uim;], X [ac_cv_header_stdint=yes], X [ac_cv_header_stdint=no])]) Xif test $ac_cv_header_stdint = yes; then X AC_DEFINE(HAVE_STDINT_H) X AC_DEFINE(HAVE_TYPE_INTMAX_T) X AC_DEFINE(HAVE_TYPE_UINTMAX_T) Xfi]) X Xdnl Checks for struct timeval in time.h or sys/time.h Xdnl Defines HAVE_STRUCT_TIMEVAL on success. XAC_DEFUN([AC_STRUCT_TIMEVAL], X[AC_REQUIRE([AC_HEADER_TIME])dnl XAC_CACHE_CHECK([for struct timeval in time.h or sys/time.h], ac_cv_struct_timeval, X [AC_TRY_COMPILE([ X#include X#ifdef TIME_WITH_SYS_TIME_H X# include X# include X#else X#ifdef HAVE_SYS_TIME_H X# include X#else X# include X#endif X#endif], [struct timeval tv;], X [ac_cv_struct_timeval=yes], X [ac_cv_struct_timeval=no])]) Xif test $ac_cv_struct_timeval = yes; then X AC_DEFINE(HAVE_STRUCT_TIMEVAL) Xfi]) X Xdnl Checks for struct timezone in time.h or sys/time.h Xdnl Defines HAVE_STRUCT_TIMEZONE on success. XAC_DEFUN([AC_STRUCT_TIMEZONE], X[AC_REQUIRE([AC_HEADER_TIME])dnl XAC_CACHE_CHECK([for struct timezone in time.h or sys/time.h], ac_cv_struct_timezone, X [AC_TRY_COMPILE([ X#include X#ifdef TIME_WITH_SYS_TIME_H X# include X# include X#else X#ifdef HAVE_SYS_TIME_H X# include X#else X# include X#endif X#endif], [struct timezone tz;], X [ac_cv_struct_timezone=yes], X [ac_cv_struct_timezone=no])]) Xif test $ac_cv_struct_timezone = yes; then X AC_DEFINE(HAVE_STRUCT_TIMEZONE) Xfi]) X Xdnl Checks for struct timespec in time.h or sys/time.h Xdnl Defines HAVE_STRUCT_TIMESPEC on success. XAC_DEFUN([AC_STRUCT_TIMESPEC], X[AC_REQUIRE([AC_HEADER_TIME])dnl XAC_CACHE_CHECK([for struct timespec in time.h or sys/time.h], ac_cv_struct_timespec, X [AC_TRY_COMPILE([ X#include X#ifdef TIME_WITH_SYS_TIME_H X# include X# include X#else X#ifdef HAVE_SYS_TIME_H X# include X#else X# include X#endif X#endif], [struct timespec ts;], X [ac_cv_struct_timespec=yes], X [ac_cv_struct_timespec=no])]) Xif test $ac_cv_struct_timespec = yes; then X AC_DEFINE(HAVE_STRUCT_TIMESPEC) Xfi]) X Xdnl Checks for type time_t Xdnl Defines time_t to long on failure. XAC_DEFUN([AC_TYPE_TIME_T], X[AC_REQUIRE([AC_HEADER_TIME])dnl XAC_CACHE_CHECK([for time_t], ac_cv_type_time_t, X [AC_TRY_COMPILE([ X#include X#ifdef TIME_WITH_SYS_TIME_H X# include X# include X#else X#ifdef HAVE_SYS_TIME_H X# include X#else X# include X#endif X#endif], [time_t t;], X [ac_cv_type_time_t=yes], X [ac_cv_type_time_t=no])]) Xif test $ac_cv_type_time_t = no; then X AC_DEFINE(time_t, long) Xfi]) X Xdnl AC_CHECK_SIZE_TIME([CROSS-SIZE]) Xdnl This must be called past AC_CHECK_SIZEOF(long int) XAC_DEFUN(AC_CHECK_SIZE_TIME_T, X[changequote(<<, >>)dnl Xdnl The name to #define. Xdefine(<>, translit(sizeof_time_t, [a-z *], [A-Z_P]))dnl Xdnl The cache variable name. Xdefine(<>, translit(ac_cv_sizeof_time_t, [ *], [_p]))dnl Xchangequote([, ])dnl XAC_MSG_CHECKING(size of time_t) XAC_CACHE_VAL(AC_CV_NAME, X[AC_TRY_RUN([#include X#include X#ifdef TIME_WITH_SYS_TIME_H X# include X# include X#else X#ifdef HAVE_SYS_TIME_H X# include X#else X# include X#endif X#endif Xmain() X{ X FILE *f=fopen("conftestval", "w"); X if (!f) exit(1); X fprintf(f, "%d\n", sizeof(time_t)); X exit(0); X}], AC_CV_NAME=`cat conftestval`, AC_CV_NAME=SIZEOF_LONG_INT, ifelse([$1], , , AC_CV_NAME=$1))])dnl XAC_MSG_RESULT($AC_CV_NAME) XAC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME) Xundefine([AC_TYPE_NAME])dnl Xundefine([AC_CV_NAME])dnl X]) X Xdnl AC_CHECK_SIZE_WCHAR([CROSS-SIZE]) XAC_DEFUN(AC_CHECK_SIZE_WCHAR, X[changequote(<<, >>)dnl Xdnl The name to #define. Xdefine(<>, translit(sizeof_wchar, [a-z *], [A-Z_P]))dnl Xdnl The cache variable name. Xdefine(<>, translit(ac_cv_sizeof_wchar, [ *], [_p]))dnl Xchangequote([, ])dnl XAC_MSG_CHECKING(size of wchar) XAC_CACHE_VAL(AC_CV_NAME, X[AC_TRY_RUN([#include Xmain() X{ X FILE *f=fopen("conftestval", "w"); X if (!f) exit(1); X fprintf(f, "%d\n", sizeof(L'a')); X exit(0); X}], AC_CV_NAME=`cat conftestval`, AC_CV_NAME=0, ifelse([$1], , , AC_CV_NAME=$1))])dnl XAC_MSG_RESULT($AC_CV_NAME) XAC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME) Xundefine([AC_TYPE_NAME])dnl Xundefine([AC_CV_NAME])dnl X]) X Xdnl AC_CHECK_SIZE_WCHAR([CROSS-SIZE]) XAC_DEFUN(AC_CHECK_SIZE_WCHAR_T, X[changequote(<<, >>)dnl Xdnl The name to #define. Xdefine(<>, translit(sizeof_wchar_t, [a-z *], [A-Z_P]))dnl Xdnl The cache variable name. Xdefine(<>, translit(ac_cv_sizeof_wchar_t, [ *], [_p]))dnl Xchangequote([, ])dnl XAC_MSG_CHECKING(size of wchar_t) XAC_CACHE_VAL(AC_CV_NAME, X[AC_TRY_RUN([#include X#ifdef HAVE_SYS_TYPES_H X#include X#endif X#ifdef HAVE_STDLIB_H X#include X#endif X#ifdef HAVE_WCHAR_H X#include X#endif Xmain() X{ X FILE *f=fopen("conftestval", "w"); X if (!f) exit(1); X fprintf(f, "%d\n", sizeof(wchar_t)); X exit(0); X}], AC_CV_NAME=`cat conftestval`, AC_CV_NAME=SIZEOF_CHAR, ifelse([$1], , , AC_CV_NAME=$1))])dnl XAC_MSG_RESULT($AC_CV_NAME) XAC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME) Xundefine([AC_TYPE_NAME])dnl Xundefine([AC_CV_NAME])dnl X]) X X Xdnl Checks for type clock_t Xdnl Defines clock_t to long on failure. Xdnl XXX we cannot check for AC_CHECK_HEADERS(sys/times.h) XAC_DEFUN([AC_TYPE_CLOCK_T], X[AC_REQUIRE([AC_HEADER_TIME])dnl XAC_CACHE_CHECK([for clock_t], ac_cv_type_clock_t, X [AC_TRY_COMPILE([ X#include X/* X * time.h is needed because of a bug in Next Step. X * Next Step needs time.h for clock_t X */ X#ifdef TIME_WITH_SYS_TIME X# ifndef _INCL_SYS_TIME_H X# include X# define _INCL_SYS_TIME_H X# endif X# ifndef _INCL_TIME_H X# include X# define _INCL_TIME_H X# endif X#else X#ifdef HAVE_SYS_TIME_H X# ifndef _INCL_SYS_TIME_H X# include X# define _INCL_SYS_TIME_H X# endif X#else X# ifndef _INCL_TIME_H X# include X# define _INCL_TIME_H X# endif X#endif X#endif X#ifdef HAVE_SYS_TIMES_H X#include X#endif X ], [clock_t t;], X [ac_cv_type_clock_t=yes], X [ac_cv_type_clock_t=no])]) Xif test $ac_cv_type_clock_t = no; then X AC_DEFINE(clock_t, long) Xfi]) X Xdnl Checks for type socklen_t Xdnl Defines socklen_t to int on failure. XAC_DEFUN([AC_TYPE_SOCKLEN_T], X[AC_REQUIRE([AC_HEADER_STDC])dnl XAC_MSG_CHECKING(for socklen_t) XAC_CACHE_VAL(ac_cv_type_socklen_t, X[AC_EGREP_CPP(dnl Xchangequote(<<,>>)dnl X<<(^|[^a-zA-Z_0-9])socklen_t[^a-zA-Z_0-9]>>dnl Xchangequote([,]), [#include X#if HAVE_STDLIB_H || STDC_HEADERS X#include X#endif X#if HAVE_STDDEF_H || STDC_HEADERS X#include X#endif X#include ], ac_cv_type_socklen_t=yes, ac_cv_type_socklen_t=no)])dnl XAC_MSG_RESULT($ac_cv_type_socklen_t) Xif test $ac_cv_type_socklen_t = no; then X AC_DEFINE(socklen_t, int) Xfi]) X Xdnl Checks for type stack_t Xdnl Defines HAVE_STACK_T on success. XAC_DEFUN([AC_TYPE_STACK_T], X[AC_CACHE_CHECK([if stack_t is declared in signal.h], ac_cv_stack_t, X [AC_TRY_COMPILE([#include ], X [stack_t ss; ss.ss_size = 0; exit (ss.ss_size == 0);], X [ac_cv_stack_t=yes], X [ac_cv_stack_t=no])]) Xif test $ac_cv_stack_t = yes; then X AC_DEFINE(HAVE_STACK_T) Xfi]) X Xdnl Checks for type siginfo_t Xdnl Defines HAVE_SIGINFO_T on success. XAC_DEFUN([AC_TYPE_SIGINFO_T], X[AC_CACHE_CHECK([if siginfo_t is declared in signal.h], ac_cv_siginfo_t, X [AC_TRY_COMPILE([#include X#ifdef HAVE_SIGINFO_H X#include X#else X#ifdef HAVE_SYS_SIGINFO_H X#include X#endif X#endif], X [siginfo_t si; si.si_signo = 0; exit (si.si_signo == 0);], X [ac_cv_siginfo_t=yes], X [ac_cv_siginfo_t=no])]) Xif test $ac_cv_siginfo_t = yes; then X AC_DEFINE(HAVE_SIGINFO_T) Xfi]) X Xdnl Checks for type idtype_t Xdnl Defines HAVE_TYPE_IDTYPE_T on success. XAC_DEFUN([AC_TYPE_IDTYPE_T], X[AC_CACHE_CHECK([if idtype_t is declared correctly in wait.h], ac_cv_have_type_idtype_t, X [AC_TRY_COMPILE([ X#if defined(HAVE_WAIT_H) X# include X#else X#include X#endif], X [idtype_t idt; idt = P_ALL; idt = P_PGID; idt = P_PID; exit (idt == P_PID);], X [ac_cv_have_type_idtype_t=yes], X [ac_cv_have_type_idtype_t=no])]) Xif test $ac_cv_have_type_idtype_t = yes; then X AC_DEFINE(HAVE_TYPE_IDTYPE_T) Xfi]) X Xdnl Checks for type struct sockaddr_storage Xdnl Defines HAVE_SOCKADDR_STORAGE on success. XAC_DEFUN([AC_STRUCT_SOCKADDR_STORAGE], X[AC_CACHE_CHECK([if struct sockaddr_storage is declared in socket.h], ac_cv_struct_sockaddr_storage, X [AC_TRY_COMPILE([#include ], X [struct sockaddr_storage ss; ss.ss_family = 0; exit (ss.ss_family == 0);], X [ac_cv_struct_sockaddr_storage=yes], X [ac_cv_struct_sockaddr_storage=no])]) Xif test $ac_cv_struct_sockaddr_storage = yes; then X AC_DEFINE(HAVE_SOCKADDR_STORAGE) Xfi]) X Xdnl Checks for type long long Xdnl Defines HAVE_LONGLONG on success. XAC_DEFUN([AC_TYPE_LONGLONG], X[AC_CACHE_CHECK([for type long long], ac_cv_type_longlong, X [AC_TRY_COMPILE([], [long long i;], X [ac_cv_type_longlong=yes], X [ac_cv_type_longlong=no])]) Xif test $ac_cv_type_longlong = yes; then X AC_DEFINE(HAVE_LONGLONG) Xfi]) X Xdnl Checks for type __int64 Xdnl Defines HAVE___INT64 on success. XAC_DEFUN([AC_TYPE___INT64], X[AC_CACHE_CHECK([for type __int64], ac_cv_type___int64, X [AC_TRY_COMPILE([], [__int64 i;], X [ac_cv_type___int64=yes], X [ac_cv_type___int64=no])]) Xif test $ac_cv_type___int64 = yes; then X AC_DEFINE(HAVE___INT64) Xfi]) X Xdnl Checks for type long double Xdnl Defines HAVE_LONGDOUBLE on success. XAC_DEFUN([AC_TYPE_LONGDOUBLE], X[AC_CACHE_CHECK([for type long double], ac_cv_type_longdouble, X [AC_TRY_COMPILE([], [long double ld;], X [ac_cv_type_longdouble=yes], X [ac_cv_type_longdouble=no])]) Xif test $ac_cv_type_longdouble = yes; then X AC_DEFINE(HAVE_LONGDOUBLE) Xfi]) X Xdnl Checks if C-compiler orders bitfields htol Xdnl Defines BITFIELDS_HTOL on success. XAC_DEFUN([AC_C_BITFIELDS], X[AC_CACHE_CHECK([whether bitorder in bitfields is htol], ac_cv_c_bitfields_htol, X [AC_TRY_RUN([ Xstruct { X unsigned char x1:4; X unsigned char x2:4; X} a; Xint Xmain() X{ Xchar *cp; X Xcp = (char *)&a; X*cp = 0x12; Xexit(a.x1 == 2);}], X [ac_cv_c_bitfields_htol=yes], X [ac_cv_c_bitfields_htol=no])]) Xif test $ac_cv_c_bitfields_htol = yes; then X AC_DEFINE(BITFIELDS_HTOL) Xfi]) X Xdnl Checks if C-compiler understands prototypes Xdnl Defines PROTOTYPES on success. XAC_DEFUN([AC_TYPE_PROTOTYPES], X[AC_CACHE_CHECK([for prototypes], ac_cv_type_prototypes, X [AC_TRY_RUN([ Xdoit(int i, ...) X{return 0;} Xint Xmain(int ac, char *av[]) X{ doit(1, 2, 3); Xexit(0);}], X [ac_cv_type_prototypes=yes], X [ac_cv_type_prototypes=no])]) Xif test $ac_cv_type_prototypes = yes; then X AC_DEFINE(PROTOTYPES) Xfi]) X Xdnl Checks for type size_t Xdnl Defines HAVE_SIZE_T_ on success. XAC_DEFUN([AC_TYPE_SIZE_T_], X[AC_CACHE_CHECK([for type size_t], ac_cv_type_size_t_, X [AC_TRY_COMPILE([ X#ifdef HAVE_SYS_TYPES_H X#include X#endif X#ifdef HAVE_STDLIB_H X#include X#endif X#ifdef HAVE_STDDEF_H X#include X#endif X#ifdef HAVE_STDIO_H X#include X#endif X ], [size_t s;], X [ac_cv_type_size_t_=yes], X [ac_cv_type_size_t_=no])]) Xif test $ac_cv_type_size_t_ = yes; then X AC_DEFINE(HAVE_SIZE_T) Xelse X AC_DEFINE(NO_SIZE_T) Xfi]) X Xdnl Checks if type char is unsigned Xdnl Defines CHAR_IS_UNSIGNED on success. XAC_DEFUN([AC_TYPE_CHAR], X[AC_CACHE_CHECK([if char is unsigned], ac_cv_type_char_unsigned, X [AC_TRY_RUN([ Xint Xmain() X{ X char c; X X c = -1; X exit(c < 0);}], X [ac_cv_type_char_unsigned=yes], X [ac_cv_type_char_unsigned=no], X [ac_cv_type_char_unsigned=no])]) Xif test $ac_cv_type_char_unsigned = yes; then X AC_DEFINE(CHAR_IS_UNSIGNED) Xfi]) X Xdnl Checks if function/macro va_copy() is available Xdnl Defines HAVE_VA_COPY on success. XAC_DEFUN([AC_FUNC_VA_COPY], X[AC_CACHE_CHECK([for va_copy], ac_cv_func_va_copy, X [AC_TRY_LINK([ X#ifdef HAVE_STDARG_H X# include X#else X# include X#endif], X [ Xva_list a, b; X Xva_copy(a, b);], X [ac_cv_func_va_copy=yes], X [ac_cv_func_va_copy=no])]) Xif test $ac_cv_func_va_copy = yes; then X AC_DEFINE(HAVE_VA_COPY) Xfi]) X Xdnl Checks if function/macro __va_copy() is available Xdnl Defines HAVE__VA_COPY on success. XAC_DEFUN([AC_FUNC__VA_COPY], X[AC_CACHE_CHECK([for __va_copy], ac_cv_func__va_copy, X [AC_TRY_LINK([ X#ifdef HAVE_STDARG_H X# include X#else X# include X#endif], X [ Xva_list a, b; X X__va_copy(a, b);], X X [ac_cv_func__va_copy=yes], X [ac_cv_func__va_copy=no])]) Xif test $ac_cv_func__va_copy = yes; then X AC_DEFINE(HAVE__VA_COPY) Xfi]) X Xdnl Checks if va_list is an array Xdnl Defines VA_LIST_IS_ARRAY on success. XAC_DEFUN([AC_TYPE_VA_LIST], X[AC_CACHE_CHECK([if va_list is an array], ac_cv_type_va_list_array, X [AC_TRY_LINK([ X#ifdef HAVE_STDARG_H X# include X#else X# include X#endif X], X [ Xva_list a, b; X Xa = b;], X [ac_cv_type_va_list_array=no], X [ac_cv_type_va_list_array=yes])]) Xif test $ac_cv_type_va_list_array = yes; then X AC_DEFINE(VA_LIST_IS_ARRAY) Xfi]) X Xdnl Checks if quotactl is present as ioctl Xdnl Defines HAVE_QUOTAIOCTL on success. XAC_DEFUN([AC_FUNC_QUOTAIOCTL], X[AC_CACHE_CHECK([if quotactl is an ioctl], ac_cv_func_quotaioctl, X [AC_TRY_LINK([#include X#include ], X [struct quotctl q; ioctl(0, Q_QUOTACTL, &q)], X [ac_cv_func_quotaioctl=yes], X [ac_cv_func_quotaioctl=no])]) Xif test $ac_cv_func_quotaioctl = yes; then X AC_DEFINE(HAVE_QUOTAIOCTL) Xfi]) X Xdnl Checks if function __dtoa() is available Xdnl Defines HAVE_DTOA on success. XAC_DEFUN([AC_FUNC_DTOA], X[AC_CACHE_CHECK([for __dtoa], ac_cv_func_dtoa, X [AC_TRY_LINK([extern char *__dtoa();], X[int decpt; int sign; char *ep; char *bp; Xbp = __dtoa(0.0, 2, 6, &decpt, &sign, &ep);], X [ac_cv_func_dtoa=yes], X [ac_cv_func_dtoa=no])]) Xif test $ac_cv_func_dtoa = yes; then X AC_DEFINE(HAVE_DTOA) Xfi]) X Xdnl Checks if reentrant __dtoa() exists (needs a result prt) Xdnl Defines HAVE_DTOA_R on success. XAC_DEFUN([AC_FUNC_DTOA_R], X[AC_REQUIRE([AC_FUNC_DTOA])dnl XAC_CACHE_CHECK([for __dtoa that needs result ptr], ac_cv_func_dtoa_r, X [AC_TRY_RUN([ Xextern char *__dtoa(); Xint Xmain() X{ X#ifdef HAVE_DTOA X int decpt, sign; X char *bp; X char *ep; X char *result; X X result = 0; X bp = __dtoa(1.9, 2, 5, &decpt, &sign, &ep, &result); X exit(result == 0); X#else X exit(1); X#endif X}], X [ac_cv_func_dtoa_r=yes], X [ac_cv_func_dtoa_r=no])]) Xif test $ac_cv_func_dtoa_r = yes; then X AC_DEFINE(HAVE_DTOA_R) Xfi]) X Xdnl Checks if working ecvt() exists Xdnl Defines HAVE_ECVT on success. XAC_DEFUN([AC_FUNC_ECVT], X[AC_CACHE_CHECK([for working ecvt() ], ac_cv_func_ecvt, X [AC_TRY_RUN([ Xextern char *ecvt(); X Xsprintf(s) X char *s; X{ X strcpy(s, "DEAD"); X} X Xint Xmain() X{ X int a, b; X X/* exit (strcmp("DEAD", ecvt(1.9, 2, &a, &b)) == 0);*/ X exit (strcmp("19", ecvt(1.9, 2, &a, &b)) != 0); X}], X [ac_cv_func_ecvt=yes], X [ac_cv_func_ecvt=no])]) Xif test $ac_cv_func_ecvt = yes; then X AC_DEFINE(HAVE_ECVT) Xfi]) X Xdnl Checks if working fcvt() exists Xdnl Defines HAVE_FCVT on success. XAC_DEFUN([AC_FUNC_FCVT], X[AC_CACHE_CHECK([for working fcvt() ], ac_cv_func_fcvt, X [AC_TRY_RUN([ Xextern char *fcvt(); X Xsprintf(s) X char *s; X{ X strcpy(s, "DEAD"); X} X Xint Xmain() X{ X int a, b; X X/* exit (strcmp("DEAD", fcvt(1.9, 2, &a, &b)) == 0);*/ X exit (strcmp("190", fcvt(1.9, 2, &a, &b)) != 0); X}], X [ac_cv_func_fcvt=yes], X [ac_cv_func_fcvt=no])]) Xif test $ac_cv_func_fcvt = yes; then X AC_DEFINE(HAVE_FCVT) Xfi]) X Xdnl Checks if working gcvt() exists Xdnl Defines HAVE_GCVT on success. XAC_DEFUN([AC_FUNC_GCVT], X[AC_CACHE_CHECK([for working gcvt() ], ac_cv_func_gcvt, X [AC_TRY_RUN([ Xextern char *gcvt(); X Xsprintf(s) X char *s; X{ X strcpy(s, "DEAD"); X} X Xint Xmain() X{ X char buf[32]; X X/* exit (strcmp("DEAD", gcvt(1.9, 10, buf)) == 0);*/ X exit (strcmp("1.9", gcvt(1.9, 10, buf)) != 0); X}], X [ac_cv_func_gcvt=yes], X [ac_cv_func_gcvt=no])]) Xif test $ac_cv_func_gcvt = yes; then X AC_DEFINE(HAVE_GCVT) Xfi]) X Xdnl Checks if function uname() is available Xdnl Defines HAVE_UNAME on success. XAC_DEFUN([AC_FUNC_UNAME], X[AC_CACHE_CHECK([for uname], ac_cv_func_uname, X [AC_TRY_LINK([#include ], X[struct utsname un; Xuname(&un);], X [ac_cv_func_uname=yes], X [ac_cv_func_uname=no])]) Xif test $ac_cv_func_uname = yes; then X AC_DEFINE(HAVE_UNAME) Xfi]) X Xdnl Checks if function mlock() is available Xdnl beware HP-UX 10.x it contains a bad mlock() in libc Xdnl Defines HAVE_MLOCK on success. XAC_DEFUN([AC_FUNC_MLOCK], X[AC_REQUIRE([AC_HEADER_ERRNO_DEF])dnl XAC_CACHE_CHECK([for mlock], ac_cv_func_mlock, X [AC_TRY_RUN([ X#include X#include X#ifndef HAVE_ERRNO_DEF Xextern int errno; X#endif X Xmain() X{ X if (mlock(0, 0) < 0) { X if (errno == EINVAL || errno == ENOMEM || X errno == EPERM || errno == EACCES) X exit(0); X exit(-1); X } X exit(0); X}], X [ac_cv_func_mlock=yes], X [ac_cv_func_mlock=no]) Xrm -f core core.* *.core]) Xif test $ac_cv_func_mlock = yes; then X AC_DEFINE(HAVE_MLOCK) Xfi]) X Xdnl Checks if function mlockall() is available Xdnl beware HP-UX 10.x it contains a bad mlockall() in libc Xdnl Defines HAVE_MLOCKALL on success. XAC_DEFUN([AC_FUNC_MLOCKALL], X[AC_REQUIRE([AC_HEADER_ERRNO_DEF])dnl XAC_CACHE_CHECK([for mlockall], ac_cv_func_mlockall, X [AC_TRY_RUN([ X#include X#include X#include X#ifndef HAVE_ERRNO_DEF Xextern int errno; X#endif X Xint Xmain() X{ X if (mlockall(MCL_CURRENT|MCL_FUTURE) < 0) { X if (errno == EINVAL || errno == ENOMEM || X errno == EPERM || errno == EACCES) X exit(0); X exit(-1); X } X exit(0); X} X], X [ac_cv_func_mlockall=yes], X [ac_cv_func_mlockall=no]) Xrm -f core core.* *.core]) Xif test $ac_cv_func_mlockall = yes; then X AC_DEFINE(HAVE_MLOCKALL) Xfi]) X XAC_DEFUN([jsAC_FUNC_MMAP], X[AC_CHECK_HEADERS(unistd.h)dnl XAC_REQUIRE([AC_MMAP_SIZEP])dnl XAC_REQUIRE([AC_FUNC_GETPAGESIZE])dnl XAC_CACHE_CHECK(for working mmap, ac_cv_func_mmap_fixed_mapped, X[AC_TRY_RUN([ X/* Thanks to Mike Haertel and Jim Avera for this test. X Here is a matrix of mmap possibilities: X mmap private not fixed X mmap private fixed at somewhere currently unmapped X mmap private fixed at somewhere already mapped X mmap shared not fixed X mmap shared fixed at somewhere currently unmapped X mmap shared fixed at somewhere already mapped X For private mappings, we should verify that changes cannot be read() X back from the file, nor mmap's back from the file at a different X address. (There have been systems where private was not correctly X implemented like the infamous i386 svr4.0, and systems where the X VM page cache was not coherent with the filesystem buffer cache X like early versions of FreeBSD and possibly contemporary NetBSD.) X For shared mappings, we should conversely verify that changes get X propogated back to all the places they're supposed to be. X X Grep wants private fixed already mapped. X The main things grep needs to know about mmap are: X * does it exist and is it safe to write into the mmap'd area X * how to use it (BSD variants) */ X#include X#include X#include X X/* X * Needed for Apollo Domain/OS and may be for others? X */ X#ifdef _MMAP_WITH_SIZEP X# define mmap_sizeparm(s) (&(s)) X#else X# define mmap_sizeparm(s) (s) X#endif X X/* This mess was copied from the GNU getpagesize.h. */ X#ifndef HAVE_GETPAGESIZE X# ifdef HAVE_UNISTD_H X# include X# endif X X/* Assume that all systems that can run configure have sys/param.h. */ X# ifndef HAVE_SYS_PARAM_H X# define HAVE_SYS_PARAM_H 1 X# endif X X# ifdef _SC_PAGESIZE X# define getpagesize() sysconf(_SC_PAGESIZE) X# else /* no _SC_PAGESIZE */ X# ifdef HAVE_SYS_PARAM_H X# include X# ifdef EXEC_PAGESIZE X# define getpagesize() EXEC_PAGESIZE X# else /* no EXEC_PAGESIZE */ X# ifdef NBPG X# define getpagesize() NBPG * CLSIZE X# ifndef CLSIZE X# define CLSIZE 1 X# endif /* no CLSIZE */ X# else /* no NBPG */ X# ifdef NBPC X# define getpagesize() NBPC X# else /* no NBPC */ X# ifdef PAGESIZE X# define getpagesize() PAGESIZE X# endif /* PAGESIZE */ X# endif /* no NBPC */ X# endif /* no NBPG */ X# endif /* no EXEC_PAGESIZE */ X# else /* no HAVE_SYS_PARAM_H */ X# define getpagesize() 8192 /* punt totally */ X# endif /* no HAVE_SYS_PARAM_H */ X# endif /* no _SC_PAGESIZE */ X X#endif /* no HAVE_GETPAGESIZE */ X X#ifdef __cplusplus Xextern "C" { void *malloc(unsigned); } X#else Xchar *malloc(); X#endif X Xint Xmain() X{ X char *data, *data2, *data3; X int i, pagesize; X int fd; X X pagesize = getpagesize(); X X /* X * First, make a file with some known garbage in it. X */ X data = malloc(pagesize); X if (!data) X exit(1); X for (i = 0; i < pagesize; ++i) X *(data + i) = rand(); X umask(0); X fd = creat("conftestmmap", 0600); X if (fd < 0) X exit(1); X if (write(fd, data, pagesize) != pagesize) X exit(1); X close(fd); X X /* X * Next, try to mmap the file at a fixed address which X * already has something else allocated at it. If we can, X * also make sure that we see the same garbage. X */ X fd = open("conftestmmap", O_RDWR); X if (fd < 0) X exit(1); X data2 = malloc(2 * pagesize); X if (!data2) X exit(1); X data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1); X if (data2 != mmap(data2, mmap_sizeparm(pagesize), PROT_READ | PROT_WRITE, X MAP_PRIVATE | MAP_FIXED, fd, 0L)) X exit(1); X for (i = 0; i < pagesize; ++i) X if (*(data + i) != *(data2 + i)) X exit(1); X X /* X * Finally, make sure that changes to the mapped area X * do not percolate back to the file as seen by read(). X * (This is a bug on some variants of i386 svr4.0.) X */ X for (i = 0; i < pagesize; ++i) X *(data2 + i) = *(data2 + i) + 1; X data3 = malloc(pagesize); X if (!data3) X exit(1); X if (read(fd, data3, pagesize) != pagesize) X exit(1); X for (i = 0; i < pagesize; ++i) X if (*(data + i) != *(data3 + i)) X exit(1); X close(fd); X unlink("conftestmmap"); X exit(0); X} X], ac_cv_func_mmap_fixed_mapped=yes, ac_cv_func_mmap_fixed_mapped=no, Xac_cv_func_mmap_fixed_mapped=no)]) Xif test $ac_cv_func_mmap_fixed_mapped = yes; then X AC_DEFINE(HAVE_MMAP) Xfi X]) X XAC_DEFUN([AC_MMAP_SIZEP], X[AC_CHECK_HEADERS(unistd.h)dnl XAC_REQUIRE([AC_FUNC_GETPAGESIZE])dnl XAC_CACHE_CHECK(for mmap that needs ptr to size, ac_cv_func_mmap_sizep, X[AC_TRY_RUN([ X#include X#include X#include X#include X#include X X#ifndef MAP_FILE X#define MAP_FILE 0 /* Needed on Apollo Domain/OS */ X#endif X X/* This mess was copied from the GNU getpagesize.h. */ X#ifndef HAVE_GETPAGESIZE X# ifdef HAVE_UNISTD_H X# include X# endif X X/* Assume that all systems that can run configure have sys/param.h. */ X# ifndef HAVE_SYS_PARAM_H X# define HAVE_SYS_PARAM_H 1 X# endif X X# ifdef _SC_PAGESIZE X# define getpagesize() sysconf(_SC_PAGESIZE) X# else /* no _SC_PAGESIZE */ X# ifdef HAVE_SYS_PARAM_H X# include X# ifdef EXEC_PAGESIZE X# define getpagesize() EXEC_PAGESIZE X# else /* no EXEC_PAGESIZE */ X# ifdef NBPG X# define getpagesize() NBPG * CLSIZE X# ifndef CLSIZE X# define CLSIZE 1 X# endif /* no CLSIZE */ X# else /* no NBPG */ X# ifdef NBPC X# define getpagesize() NBPC X# else /* no NBPC */ X# ifdef PAGESIZE X# define getpagesize() PAGESIZE X# endif /* PAGESIZE */ X# endif /* no NBPC */ X# endif /* no NBPG */ X# endif /* no EXEC_PAGESIZE */ X# else /* no HAVE_SYS_PARAM_H */ X# define getpagesize() 8192 /* punt totally */ X# endif /* no HAVE_SYS_PARAM_H */ X# endif /* no _SC_PAGESIZE */ X X#endif /* no HAVE_GETPAGESIZE */ X X#ifdef __cplusplus Xextern "C" { void *malloc(unsigned); } X#else Xchar *malloc(); X#endif X Xjmp_buf jenv; X Xint Xintr() X{ X signal(SIGSEGV, intr); X longjmp(jenv, 1); X} X Xint Xmain() X{ X char *data, *data2; X int i, pagesize, ps; X int fd; X X pagesize = getpagesize(); X X /* X * First, make a file with some known garbage in it. X */ X data = malloc(pagesize); X if (!data) X exit(1); X for (i = 0; i < pagesize; ++i) X *(data + i) = rand(); X umask(0); X fd = creat("conftestmmap", 0600); X if (fd < 0) X exit(1); X if (write(fd, data, pagesize) != pagesize) X exit(1); X close(fd); X X /* X * Next, try to mmap the file at a fixed address which X * already has something else allocated at it. If we can, X * also make sure that we see the same garbage. X */ X fd = open("conftestmmap", O_RDWR); X if (fd < 0) X exit(1); X X /* X * Keep a copy, Apollo modifies the value... X */ X ps = pagesize; X X /* X * Apollo mmap() is not a syscall but a library function and fails X * if it tries to dereference 'ps'. We must use setjmp in order to X * catch the failure. X */ X signal(SIGSEGV, intr); X if (setjmp(jenv) == 0) { X data2 = mmap(0, ps, PROT_READ, MAP_FILE | MAP_PRIVATE, fd, 0L); X } else { X data2 = (char *)-1; X } X if (data2 != (char *)-1) X exit(1); X X signal(SIGSEGV, intr); X if (setjmp(jenv) == 0) { X data2 = mmap(0, &ps, PROT_READ, MAP_FILE | MAP_PRIVATE, fd, 0L); X } else { X data2 = (char *)-1; X } X if (data2 == (char *)-1) X exit(1); X X for (i = 0; i < pagesize; ++i) X if (*(data + i) != *(data2 + i)) X exit(1); X X close(fd); X unlink("conftestmmap"); X exit(0); X} X], ac_cv_func_mmap_sizep=yes, ac_cv_func_mmap_sizep=no, Xac_cv_func_mmap_sizep=no)]) Xif test $ac_cv_func_mmap_sizep = yes; then X AC_DEFINE(_MMAP_WITH_SIZEP) Xfi X]) X Xdnl Checks if mmap() works to get shared memory Xdnl Defines HAVE_SMMAP on success. XAC_DEFUN([AC_FUNC_SMMAP], X[AC_CACHE_CHECK([if mmap works to get shared memory], ac_cv_func_smmap, X [AC_TRY_RUN([ X#include X#include X X#ifndef MAP_ANONYMOUS X# ifdef MAP_ANON X# define MAP_ANONYMOUS MAP_ANON X# endif X#endif X X/* X * Needed for Apollo Domain/OS and may be for others? X */ X#ifdef _MMAP_WITH_SIZEP X# define mmap_sizeparm(s) (&(s)) X#else X# define mmap_sizeparm(s) (s) X#endif X Xchar * Xmkshare() X{ X int size = 8192; X int f; X char *addr; X X#ifdef MAP_ANONYMOUS /* HP/UX */ X f = -1; X addr = mmap(0, mmap_sizeparm(size), PROT_READ|PROT_WRITE, MAP_SHARED|MAP_ANONYMOUS, f, 0); X#else X if ((f = open("/dev/zero", 2)) < 0) X exit(1); X addr = mmap(0, mmap_sizeparm(size), PROT_READ|PROT_WRITE, MAP_SHARED, f, 0); X#endif X if (addr == (char *)-1) X exit(1); X close(f); X X return (addr); X} X Xint Xmain() X{ X char *addr; X X addr = mkshare(); X *addr = 'I'; X X switch (fork()) { X X case -1: X printf("help\n"); exit(1); X X case 0: /* child */ X *addr = 'N'; X _exit(0); X break; X default: /* parent */ X wait(0); X sleep(1); X break; X } X X if (*addr != 'N') X exit(1); X exit(0); X} X], X [ac_cv_func_smmap=yes], X [ac_cv_func_smmap=no], X [ac_cv_func_smmap=no])]) Xif test $ac_cv_func_smmap = yes; then X AC_DEFINE(HAVE_SMMAP) Xfi]) X Xdnl Checks if shmget() works to get shared memory Xdnl Defines HAVE_SHMGET on success. XAC_DEFUN([AC_FUNC_SHMGET], X[AC_CACHE_CHECK([if shmget works to get shared memory], ac_cv_func_shmget, X [AC_TRY_RUN([ X#include X#include X#include Xint Xmain() X{ X int id; X X id = shmget(IPC_PRIVATE, 0x1, IPC_CREAT|0600); X if (id == -1) X exit(1); X shmctl(id, IPC_RMID, 0); X exit(0); X} X], X [ac_cv_func_shmget=yes], X [ac_cv_func_shmget=no], X [ac_cv_func_shmget=no])]) Xif test $ac_cv_func_shmget = yes; then X AC_DEFINE(HAVE_SHMGET) Xfi]) X Xdnl Checks if sys_siglist[] exists Xdnl Defines HAVE_SYS_SIGLIST on success. XAC_DEFUN([AC_FUNC_SYS_SIGLIST], X[AC_CACHE_CHECK([for sys_siglist], ac_cv_func_sys_siglist, X [AC_TRY_RUN([ Xint Xmain() X{ extern char *sys_siglist[]; Xif (sys_siglist[1] == 0) X exit(1); Xexit(0);}], X [ac_cv_func_sys_siglist=yes], X [ac_cv_func_sys_siglist=no])]) Xif test $ac_cv_func_sys_siglist = yes; then X AC_DEFINE(HAVE_SYS_SIGLIST) Xfi]) X Xdnl Checks for maximum number of bits in minor device number XAC_DEFUN([AC_CHECK_MINOR_BITS], X[AC_REQUIRE([AC_HEADER_MAKEDEV])dnl Xchangequote(<<, >>)dnl Xdefine(<>, DEV_MINOR_BITS)dnl Xdnl The cache variable name. Xdefine(<>, ac_cv_dev_minor_bits)dnl Xchangequote([, ])dnl XAC_MSG_CHECKING(bits in minor device number) XAC_CACHE_VAL(AC_CV_NAME, X[AC_TRY_RUN([#include X#include X#ifdef major X# define _FOUND_MAJOR_ X#endif X X#ifdef MAJOR_IN_MKDEV X# include X# define _FOUND_MAJOR_ X#endif X X#ifndef _FOUND_MAJOR_ X# ifdef MAJOR_IN_SYSMACROS X# include X# define _FOUND_MAJOR_ X# endif X#endif X X#ifndef _FOUND_MAJOR_ X# if defined(hpux) || defined(__hpux__) || defined(__hpux) X# include X# define _FOUND_MAJOR_ X# endif X#endif X X#ifndef _FOUND_MAJOR_ X# define major(dev) (((dev) >> 8) & 0xFF) X# define minor(dev) ((dev) & 0xFF) X# define makedev(majo, mino) (((majo) << 8) | (mino)) X#endif Xint Xmain() X{ X long l = 1; X int i; X int m; X int c = 0; X FILE *f=fopen("conftestval", "w"); X int maxloop = 32; X X if (sizeof (long) > 4) X maxloop = 64; X X if (!f) exit(1); X X for (i=1, m=0; i <= maxloop; i++, l<<=1) { X if (minor(l) == 0 && c == 0) X c = m; X if (minor(l) != 0) X m = i; X } X fprintf(f, "%d\n", m); X exit(0); X}], AC_CV_NAME=`cat conftestval`, AC_CV_NAME=0, ifelse([$2], , , AC_CV_NAME=$2))])dnl XAC_MSG_RESULT($AC_CV_NAME) XAC_DEFINE_UNQUOTED(AC_MACRO_NAME, $AC_CV_NAME) Xundefine([AC_MACRO_NAME])dnl Xundefine([AC_CV_NAME])dnl X]) X Xdnl Checks for maximum number of bits in minor device numbers are non contiguous Xdnl Defines DEV_MINOR_NONCONTIG on success. XAC_DEFUN([AC_CHECK_MINOR_NONCONTIG], X[AC_REQUIRE([AC_HEADER_MAKEDEV])dnl XAC_CACHE_CHECK([whether bits in minor device numbers are non contiguous], ac_cv_dev_minor_noncontig, X [AC_TRY_RUN([ X#include X#ifdef major X# define _FOUND_MAJOR_ X#endif X X#ifdef MAJOR_IN_MKDEV X# include X# define _FOUND_MAJOR_ X#endif X X#ifndef _FOUND_MAJOR_ X# ifdef MAJOR_IN_SYSMACROS X# include X# define _FOUND_MAJOR_ X# endif X#endif X X#ifndef _FOUND_MAJOR_ X# if defined(hpux) || defined(__hpux__) || defined(__hpux) X# include X# define _FOUND_MAJOR_ X# endif X#endif X X#ifndef _FOUND_MAJOR_ X# define major(dev) (((dev) >> 8) & 0xFF) X# define minor(dev) ((dev) & 0xFF) X# define makedev(majo, mino) (((majo) << 8) | (mino)) X#endif Xint Xmain() X{ X long l = 1; X int i; X int m; X int c = 0; X int maxloop = 32; X X if (sizeof (long) > 4) X maxloop = 64; X X for (i=1, m=0; i <= maxloop; i++, l<<=1) { X if (minor(l) == 0 && c == 0) X c = m; X if (minor(l) != 0) X m = i; X } Xexit (m == c);}], X [ac_cv_dev_minor_noncontig=yes], X [ac_cv_dev_minor_noncontig=no])]) Xif test $ac_cv_dev_minor_noncontig = yes; then X AC_DEFINE(DEV_MINOR_NONCONTIG) Xfi]) X Xdnl Checks if we may not define our own malloc() Xdnl Defines NO_USER_MALLOC if we cannot. XAC_DEFUN([AC_USER_MALLOC], X[AC_CACHE_CHECK([if we may not define our own malloc()], ac_cv_no_user_malloc, X [AC_TRY_RUN([ X#if !defined(__CYGWIN32__) && !defined(__CYGWIN__) Xstatic int mcalled; Xchar * Xmalloc(s) X int s; X{ X extern char *sbrk(); X X /* X * Don't ask me why, but with Cygwin on 64 Bit Vista this hangs X * infinitely and is undebuggable unless we call write() here... X */ X write(2, "", 0); X mcalled++; X _exit(0); X return (sbrk(s)); X} X Xfree(p) char *p;{} X#endif /* !defined(__CYGWIN32__) && !defined(__CYGWIN__) */ X Xmain() X{ X#if !defined(__CYGWIN32__) && !defined(__CYGWIN__) X#ifdef HAVE_STRDUP X strdup("aaa"); X#else X exit(0); X#endif X#endif /* !defined(__CYGWIN32__) && !defined(__CYGWIN__) */ X exit(1);}], X [ac_cv_no_user_malloc=no], X [ac_cv_no_user_malloc=yes])]) Xif test $ac_cv_no_user_malloc = yes; then X AC_DEFINE(NO_USER_MALLOC) Xfi]) X Xdnl Checks if ecvt()/fcvt()/gcvt() may be replaced by local implementations Xdnl There are known problems on ATARI MINT and older Linux version and statical linking Xdnl Defines NO_USER_XCVT on failure. XAC_DEFUN([AC_USER_XCVT], X[AC_CACHE_CHECK([if we may not define our own ecvt()/fcvt()/gcvt()], ac_cv_no_user_xcvt, X [AC_TRY_LINK([ X#include X Xchar * Xecvt(value, ndig, decpt, sign) X double value; X int ndig; X int *decpt; X int *sign; X{ X return ("ecvt-test"); X} X Xchar * Xfcvt(value, ndig, decpt, sign) X double value; X int ndig; X int *decpt; X int *sign; X{ X return ("fcvt-test"); X} X Xchar * Xgcvt(value, ndig, bp) X double value; X int ndig; X char *bp; X{ X return ("gcvt-test"); X} X], X [ X char buf[64]; X X printf("E: %e F: %f G: %g local gcvt: %s\n", 1.234, 1.234, 1.234, gcvt(1.234, 4, buf)); X], X [ac_cv_no_user_xcvt=no], X [ac_cv_no_user_xcvt=yes])]) Xif test $ac_cv_no_user_xcvt = yes; then X AC_DEFINE(NO_USER_XCVT) Xfi]) X Xdnl Checks if BSD-4.2 compliant getpgrp() exists Xdnl Defines HAVE_BSD_GETPGRP on success. XAC_DEFUN([AC_FUNC_BSD_GETPGRP], X[AC_CACHE_CHECK([for BSD compliant getpgrp], ac_cv_func_bsd_getpgrp, X [AC_TRY_RUN([ Xint Xmain() X{ long p; X/* X * POSIX getpgrp() has void parameter... X */ X p = getpgrp(-1); X if (p == getpgrp(1) && p == getpgrp(getpid())) X exit(1); Xexit(0);}], X [ac_cv_func_bsd_getpgrp=yes], X [ac_cv_func_bsd_getpgrp=no])]) Xif test $ac_cv_func_bsd_getpgrp = yes; then X AC_DEFINE(HAVE_BSD_GETPGRP) Xfi]) X Xdnl Checks if BSD-4.2 compliant setpgrp() exists Xdnl Defines HAVE_BSD_SETPGRP on success. XAC_DEFUN([AC_FUNC_BSD_SETPGRP], X[AC_REQUIRE([AC_HEADER_ERRNO_DEF])dnl XAC_CACHE_CHECK([for BSD compliant setpgrp], ac_cv_func_bsd_setpgrp, X [AC_TRY_RUN([ X#include X#ifndef HAVE_ERRNO_DEF Xextern int errno; X#endif Xint Xmain() X{ errno = 0; X/* X * Force illegal pid on BSD X */ Xif (setpgrp(-1, 100) < 0 && errno == ESRCH) X exit(0); Xexit(1);}], X [ac_cv_func_bsd_setpgrp=yes], X [ac_cv_func_bsd_setpgrp=no])]) Xif test $ac_cv_func_bsd_setpgrp = yes; then X AC_DEFINE(HAVE_BSD_SETPGRP) Xfi]) X Xdnl Checks if *printf() supports %jd Xdnl Defines HAVE_PRINTF_J on success. XAC_DEFUN([AC_FUNC_PRINTF_J], X[AC_CACHE_CHECK([whether *printf() supports %jd], ac_cv_func_printf_j, X [AC_TRY_RUN([ X#include Xint Xmain() X{ intmax_t m = 123456789012LL; Xchar buf[32]; Xsprintf(buf, "%jd", m); Xif (strcmp(buf, "123456789012") == 0) X exit(0); Xexit(1);}], X [ac_cv_func_printf_j=yes], X [ac_cv_func_printf_j=no])]) Xif test $ac_cv_func_printf_j = yes; then X AC_DEFINE(HAVE_PRINTF_J) Xfi]) X Xdnl Checks if *printf() supports %zd Xdnl Defines HAVE_PRINTF_Z on success. XAC_DEFUN([AC_FUNC_PRINTF_Z], X[AC_CACHE_CHECK([whether *printf() supports %zd], ac_cv_func_printf_z, X [AC_TRY_RUN([ X#include Xint Xmain() X{ size_t m = 1234567890; Xchar buf[32]; Xsprintf(buf, "%zd", m); Xif (strcmp(buf, "1234567890") == 0) X exit(0); Xexit(1);}], X [ac_cv_func_printf_z=yes], X [ac_cv_func_printf_z=no])]) Xif test $ac_cv_func_printf_z = yes; then X AC_DEFINE(HAVE_PRINTF_Z) Xfi]) X Xdnl Checks if *printf() supports %lld Xdnl Defines HAVE_PRINTF_LL on success. XAC_DEFUN([AC_FUNC_PRINTF_LL], X[AC_CACHE_CHECK([whether *printf() supports %lld], ac_cv_func_printf_ll, X [AC_TRY_RUN([ Xint Xmain() X{ long long ll = 123456789012LL; Xchar buf[32]; Xsprintf(buf, "%lld", ll); Xif (strcmp(buf, "123456789012") == 0) X exit(0); Xexit(1);}], X [ac_cv_func_printf_ll=yes], X [ac_cv_func_printf_ll=no])]) Xif test $ac_cv_func_printf_ll = yes; then X AC_DEFINE(HAVE_PRINTF_LL) Xfi]) X Xdnl Checks if C99 compliant isinf() exists Xdnl Defines HAVE_C99_ISINF on success. XAC_DEFUN([AC_FUNC_C99_ISINF], X[AC_CACHE_CHECK([for C99 compliant isinf], ac_cv_func_c99_isinf, X [AC_TRY_LINK([#include ], [ double d; X#ifndef isinf XThe isinf macro is not defined X#endif Xreturn (isinf(d)); X], X [ac_cv_func_c99_isinf=yes], X [ac_cv_func_c99_isinf=no])]) Xif test $ac_cv_func_c99_isinf = yes; then X AC_DEFINE(HAVE_C99_ISINF) Xfi]) X Xdnl Checks if C99 compliant isnan() exists Xdnl Defines HAVE_C99_ISNAN on success. XAC_DEFUN([AC_FUNC_C99_ISNAN], X[AC_CACHE_CHECK([for C99 compliant isnan], ac_cv_func_c99_isnan, X [AC_TRY_LINK([#include ], [ double d; X#ifndef isnan XThe isnan macro is not defined X#endif Xreturn (isnan(d)); X], X [ac_cv_func_c99_isnan=yes], X [ac_cv_func_c99_isnan=no])]) Xif test $ac_cv_func_c99_isnan = yes; then X AC_DEFINE(HAVE_C99_ISNAN) Xfi]) X Xdnl Checks if select() needs more than sys/time.h & sys/types.h Xdnl Defines SELECT_NONSTD_HDR on success. XAC_DEFUN([AC_HEADER_SELECT_NONSTD], X[AC_CACHE_CHECK([if select needs nonstd include files], ac_cv_header_slect_nonstd_hdr, X [AC_TRY_COMPILE([#include X#include ], X [fd_set rfd; FD_ZERO(&rfd); select(1, &rfd, 0, 0, 0);], X [ac_cv_header_slect_nonstd_hdr=no], X [ac_cv_header_slect_nonstd_hdr=yes])]) Xif test $ac_cv_header_slect_nonstd_hdr = yes; then X AC_DEFINE(SELECT_NONSTD_HDR) Xfi]) X Xdnl Checks if select() needs sys/select.h Xdnl Defines NEED_SYS_SELECT_H on success. XAC_DEFUN([AC_HEADER_SYS_SELECT], X[AC_REQUIRE([AC_HEADER_SELECT_NONSTD])dnl XAC_CACHE_CHECK([if sys/select.h is needed for select], ac_cv_header_need_sys_select_h, X [AC_TRY_COMPILE([#include X#include X#include X#ifndef SELECT_NONSTD_HDR Xdo not compile if we do not need nonstandard headers X#endif], X [fd_set rfd; FD_ZERO(&rfd); select(1, &rfd, 0, 0, 0);], X [ac_cv_header_need_sys_select_h=yes], X [ac_cv_header_need_sys_select_h=no])]) Xif test $ac_cv_header_need_sys_select_h = yes; then X AC_DEFINE(NEED_SYS_SELECT_H) Xfi]) X Xdnl Checks if select() needs sys/socket.h Xdnl Defines NEED_SYS_SOCKET_H on success. XAC_DEFUN([AC_HEADER_SELECT2], X[AC_REQUIRE([AC_HEADER_SELECT_NONSTD])dnl XAC_CACHE_CHECK([if sys/socket.h is needed for select], ac_cv_header_need_sys_socket_h, X [AC_TRY_COMPILE([#include X#include X#include X#ifndef SELECT_NONSTD_HDR Xdo not compile if we do not need nonstandard headers X#endif], X [fd_set rfd; FD_ZERO(&rfd); select(1, &rfd, 0, 0, 0);], X [ac_cv_header_need_sys_socket_h=yes], X [ac_cv_header_need_sys_socket_h=no])]) Xif test $ac_cv_header_need_sys_socket_h = yes; then X AC_DEFINE(NEED_SYS_SOCKET_H) Xfi]) X Xdnl Checks if file locking via fcntl() is available Xdnl Defines HAVE_FCNTL_LOCKF on success. XAC_DEFUN([AC_FUNC_FCNTL_LOCKF], X[AC_CACHE_CHECK([for file locking via fcntl], ac_cv_func_fcntl_lock, X [AC_TRY_LINK([ X#include X#include ], X [ Xstruct flock fl; Xfcntl(0, F_SETLK, &fl);], X [ac_cv_func_fcntl_lock=yes], X [ac_cv_func_fcntl_lock=no])]) Xif test $ac_cv_func_fcntl_lock = yes; then X AC_DEFINE(HAVE_FCNTL_LOCKF) Xfi]) X X Xdnl Checks if sigsetjmp() is available Xdnl Defines HAVE_SIGSETJMP on success. XAC_DEFUN([AC_FUNC_SIGSETJMP], X[AC_CACHE_CHECK([for sigsetjmp], ac_cv_func_sigsetjmp, X [AC_TRY_LINK([ X#include ], X [ Xsigjmp_buf jb; Xsigsetjmp(jb, 1);], X [ac_cv_func_sigsetjmp=yes], X [ac_cv_func_sigsetjmp=no])]) Xif test $ac_cv_func_sigsetjmp = yes; then X AC_DEFINE(HAVE_SIGSETJMP) Xfi]) X Xdnl Checks if siglongjmp() is available Xdnl Defines HAVE_SIGLONGJMP on success. XAC_DEFUN([AC_FUNC_SIGLONGJMP], X[AC_CACHE_CHECK([for siglongjmp], ac_cv_func_siglongjmp, X [AC_TRY_LINK([ X#include ], X [ Xsigjmp_buf jb; Xsigsetjmp(jb, 1); Xsiglongjmp(jb, 1);], X [ac_cv_func_siglongjmp=yes], X [ac_cv_func_siglongjmp=no])]) Xif test $ac_cv_func_siglongjmp = yes; then X AC_DEFINE(HAVE_SIGLONGJMP) Xfi]) X X Xdnl Checks if link() allows hard links on symlinks Xdnl Defines HAVE_HARD_SYMLINKS on success. XAC_DEFUN([AC_HARD_SYMLINKS], X[AC_CACHE_CHECK([if link() allows hard links on symlinks], ac_cv_hard_symlinks, X [AC_TRY_RUN([ Xmain() X{ X int ret = 0; X X unlink("confdefs.f1"); X unlink("confdefs.l1"); X unlink("confdefs.h1"); X X if (symlink("confdefs.f1", "confdefs.l1") < 0) X ret = 1; X if (link("confdefs.l1", "confdefs.h1") < 0) X ret = 1; X X unlink("confdefs.l1"); X unlink("confdefs.h1"); X X exit(ret); X}], X [ac_cv_hard_symlinks=yes], X [ac_cv_hard_symlinks=no])]) Xif test $ac_cv_hard_symlinks = yes; then X AC_DEFINE(HAVE_HARD_SYMLINKS) Xfi]) X X Xdnl Checks if link() does not follow symlinks Xdnl Defines HAVE_LINK_NOFOLLOW on success. XAC_DEFUN([AC_LINK_NOFOLLOW], X[AC_CACHE_CHECK([if link() does not folow symlinks], ac_cv_link_nofollow, X [AC_TRY_RUN([ X#include X#include X Xmain() X{ X int ret = 0; X int f; X struct stat sb; X X unlink("confdefs.f1"); X unlink("confdefs.l1"); X unlink("confdefs.h1"); X X f = creat("confdefs.f1", 0666); X close(f); X if (symlink("confdefs.f1", "confdefs.l1") < 0) X ret = 1; X if (link("confdefs.l1", "confdefs.h1") < 0) X ret = 1; X X stat("confdefs.f1", &sb); X if (sb.st_nlink == 2) X ret = 1; X X unlink("confdefs.f1"); X unlink("confdefs.l1"); X unlink("confdefs.h1"); X X exit(ret); X}], X [ac_cv_link_nofollow=yes], X [ac_cv_link_nofollow=no])]) Xif test $ac_cv_link_nofollow = yes; then X AC_DEFINE(HAVE_LINK_NOFOLLOW) Xfi]) X Xdnl Checks if access() does implement E_OK (010) for effective UIDs Xdnl Defines HAVE_ACCESS_E_OK on success. XAC_DEFUN([AC_ACCESS_E_OK], X[AC_REQUIRE([AC_HEADER_ERRNO_DEF])dnl XAC_CHECK_HEADERS(unistd.h) XAC_CACHE_CHECK([if access() does implement E_OK], ac_cv_access_e_ok, X [AC_TRY_RUN([ X# ifdef HAVE_UNISTD_H X# include X# endif X#ifndef R_OK X#define R_OK 4 /* Test for Read permission */ X#define W_OK 2 /* Test for Write permission */ X#define X_OK 1 /* Test for eXecute permission */ X#define F_OK 0 /* Test for existence of File */ X#endif X X#ifndef E_OK X#ifdef EFF_ONLY_OK X#define E_OK EFF_ONLY_OK /* Irix */ X#else X#ifdef EUID_OK X#define E_OK EUID_OK /* UNICOS (0400) */ X#else X#define E_OK 010 /* Test effective uids */ X#endif X#endif X#endif X X#include X#ifndef HAVE_ERRNO_DEF Xextern int errno; X#endif X Xmain() X{ X#ifdef _MSC_VER X/* X * If we use "cl" to compile and call access(".", E_OK|F_OK), the program will X * cause an exception that results in a popup window. For this reason, the test X * is disabled for "cl", it would not work anyway. X */ X int ret = 1; X#else X int ret = 0; X X if (access(".", F_OK) != 0) X ret = 1; X else if (access(".", E_OK|F_OK) != 0) X ret = 1; X else if (access(".", (R_OK<<4)|F_OK) == 0) X ret = 1; X#endif X X exit(ret); X}], X [ac_cv_access_e_ok=yes], X [ac_cv_access_e_ok=no])]) Xif test $ac_cv_access_e_ok = yes; then X AC_DEFINE(HAVE_ACCESS_E_OK) Xfi]) X Xdnl Checks if fnmatch() does implement FNM_IGNORECASE Xdnl Defines HAVE_FNMATCH_IGNORECASE on success. XAC_DEFUN([AC_FNMATCH_IGNORECASE], X[AC_CHECK_HEADERS(fnmatch.h) XAC_CACHE_CHECK([if fnmatch() does implement FNM_IGNORECASE or FNM_CASEFOLD], ac_cv_fnmatch_igncase, X [AC_TRY_RUN([ X#ifdef HAVE_FNMATCH X#include X#endif X X#ifndef FNM_IGNORECASE X#ifdef FNM_CASEFOLD X#define FNM_IGNORECASE FNM_CASEFOLD X#endif X#endif X Xmain() X{ X int ret; X X ret = fnmatch("a", "A", FNM_IGNORECASE); X exit(ret); X}], X [ac_cv_fnmatch_igncase=yes], X [ac_cv_fnmatch_igncase=no])]) Xif test $ac_cv_fnmatch_igncase = yes; then X AC_DEFINE(HAVE_FNMATCH_IGNORECASE) Xfi]) X X X Xdnl Checks if realloc() does implement realloc(NULL, size) Xdnl Defines HAVE_REALLOC_NULL on success. XAC_DEFUN([AC_FUNC_REALLOC_NULL], X[AC_CHECK_HEADERS(stdlib.h) XAC_TYPE_SIGNAL XAC_CACHE_CHECK([if realloc() does implement realloc(NULL, size)], ac_cv_realloc_null, X [AC_TRY_RUN([ X#ifdef HAVE_STDLIB_H X#include X#endif X#include X XRETSIGTYPE Xsig(s) X int s; X{ X exit(1); X} Xint Xmain() X{ X char *p; X X signal(SIGSEGV, sig); X p = realloc((char *)0, 10); X if (p == (char *)0) X exit(1); X exit(0); X}], X [ac_cv_realloc_null=yes], X [ac_cv_realloc_null=no])]) Xif test $ac_cv_realloc_null = yes; then X AC_DEFINE(HAVE_REALLOC_NULL) Xfi]) X X Xdnl Checks if waitid() is present and is at least minimally usable. Xdnl Mac OS X is POSIX certified but definitely not POSIX compliant Xdnl so we need to to implement a complex test for waitid(). Xdnl Defines HAVE_WAITID on success. XAC_DEFUN([AC_FUNC_WAITID], X[AC_CHECK_HEADERS(stdlib.h) XAC_CHECK_HEADERS(unistd.h) XAC_CHECK_HEADERS(wait.h) XAC_HEADER_SYS_WAIT XAC_CACHE_CHECK([for halfway POSIX compliant waitid()], ac_cv_func_waitid, X [AC_TRY_RUN([ X#ifdef HAVE_STDLIB_H X#include X#endif X#ifdef HAVE_UNISTD_H X#include X#endif X#if defined(HAVE_WAIT_H) X# include X#else X#include X#endif X#include X/* X * Non-standard compliant platforms may need X * #include or something similar X * in addition to the include files above. X */ X Xint Xmain() X{ X siginfo_t si; X pid_t pid; X int ret; X X if ((pid = fork()) < 0) X exit(1); X if (pid == 0) { X _exit(1234567890); X } X ret = waitid(P_PID, pid, &si, WEXITED); X if (ret < 0) X exit(1); X if (pid != si.si_pid) /* Mac OS X has si.si_pid == 0 */ X exit(2); X if (si.si_code != CLD_EXITED) /* Mac OS X has si.si_code == 0 */ X exit(3); X if ((si.si_status & 0xFFFF) != (1234567890 & 0xFFFF)) X exit(4); /* Should deliver more than 8 bits */ X /* Linux only delivers 8 bits */ X /* Mac OS X delivers 24 bits */ X X exit(0); X}], X [ac_cv_func_waitid=yes], X [ac_cv_func_waitid=no])]) Xif test $ac_cv_func_waitid = yes; then X AC_DEFINE(HAVE_WAITID) Xfi]) X X Xdnl Checks whether waitpid() is present and supports WNOWAIT. Xdnl SVr4 supports it but POSIX does not list it. Xdnl Defines HAVE_WNOWAIT_WAITPID on success. XAC_DEFUN([AC_WNOWAIT_WAITPID], X[AC_CHECK_HEADERS(stdlib.h) XAC_CHECK_HEADERS(unistd.h) XAC_CHECK_HEADERS(wait.h) XAC_HEADER_SYS_WAIT XAC_HEADER_ERRNO_DEF XAC_CACHE_CHECK([for SVr4 compliant waitpid() with WNOWAIT support], ac_cv_wnowait_waitpid, X [AC_TRY_RUN([ X#ifdef HAVE_STDLIB_H X#include X#endif X#ifdef HAVE_UNISTD_H X#include X#endif X#if defined(HAVE_WAIT_H) X# include X#else X#include X#endif X#include X#ifndef HAVE_ERRNO_DEF Xextern int errno; X#endif X Xint Xmain() X{ X int xstat; X pid_t pid = -1; X int ret; X X ret = waitpid(pid, &xstat, WNOWAIT); X if (ret < 0 && errno == EINVAL) X exit(1); X exit(0); X}], X [ac_cv_wnowait_waitpid=yes], X [ac_cv_wnowait_waitpid=no])]) Xif test $ac_cv_wnowait_waitpid = yes; then X AC_DEFINE(HAVE_WNOWAIT_WAITPID) Xfi]) X X Xdnl XXXXXXXXXXXXXXXXXX Begin Stolen (but modified) from GNU tar XXXXXXXXXXXXXXXXXXXXXXXXXXX Xdnl Changes: X Xdnl One line has been changed to: [ac_save_CC="${CC-cc}" to default to "'cc" X Xdnl AC_SYS_LARGEFILE_MACRO_VALUE test moved from AC_FUNC_FSEEKO into AC_SYS_LARGEFILE Xdnl Do not call AC_FUNC_FSEEKO because it does not check whether fseeko() is Xdnl available on non Large File mode. There are additionoal tests for fseeko()/ftello() Xdnl inside the AC_HAVE_LARGEFILES test. X Xdnl largefile_cc_opt definition added X X#serial 18 X Xdnl By default, many hosts won't let programs access large files; Xdnl one must use special compiler options to get large-file access to work. Xdnl For more details about this brain damage please see: Xdnl http://www.sas.com/standards/large.file/x_open.20Mar96.html X Xdnl Written by Paul Eggert . X Xdnl Internal subroutine of AC_SYS_LARGEFILE. Xdnl AC_SYS_LARGEFILE_TEST_INCLUDES XAC_DEFUN([AC_SYS_LARGEFILE_TEST_INCLUDES], X [[#include X /* Check that off_t can represent 2**63 - 1 correctly. X We can't simply "#define LARGE_OFF_T 9223372036854775807", X since some C++ compilers masquerading as C compilers X incorrectly reject 9223372036854775807. */ X# define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) X int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 X && LARGE_OFF_T % 2147483647 == 1) X ? 1 : -1]; X ]]) X Xdnl Internal subroutine of AC_SYS_LARGEFILE. Xdnl AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE, CACHE-VAR, COMMENT, INCLUDES, FUNCTION-BODY) XAC_DEFUN([AC_SYS_LARGEFILE_MACRO_VALUE], X [AC_CACHE_CHECK([for $1 value needed for large files], $3, X [$3=no X AC_TRY_COMPILE([$5], X [$6], X , X [AC_TRY_COMPILE([#define $1 $2] X[$5] X , X [$6], X [$3=$2])])]) X if test "[$]$3" != no; then X AC_DEFINE_UNQUOTED([$1], [$]$3, [$4]) X fi]) X XAC_DEFUN([AC_SYS_LARGEFILE], X [AC_ARG_ENABLE(largefile, X [ --disable-largefile omit support for large files]) X if test "$enable_largefile" != no; then X X AC_CACHE_CHECK([for special C compiler options needed for large files], X ac_cv_sys_largefile_CC, X [ac_cv_sys_largefile_CC=no X largefile_cc_opt="" X if test "$GCC" != yes; then X # IRIX 6.2 and later do not support large files by default, X # so use the C compiler's -n32 option if that helps. X AC_TRY_COMPILE(AC_SYS_LARGEFILE_TEST_INCLUDES, , , X [ac_save_CC="${CC-cc}" X CC="$CC -n32" X AC_TRY_COMPILE(AC_SYS_LARGEFILE_TEST_INCLUDES, , X ac_cv_sys_largefile_CC=' -n32') X CC="$ac_save_CC"]) X fi]) X if test "$ac_cv_sys_largefile_CC" != no; then X CC="$CC$ac_cv_sys_largefile_CC" X largefile_cc_opt="$ac_cv_sys_largefile_CC" X fi X X AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, 64, X ac_cv_sys_file_offset_bits, X [Number of bits in a file offset, on hosts where this is settable.], X AC_SYS_LARGEFILE_TEST_INCLUDES) X AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, 1, X ac_cv_sys_large_files, X [Define for large files, on AIX-style hosts.], X AC_SYS_LARGEFILE_TEST_INCLUDES) X AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE, 1, X ac_cv_sys_largefile_source, X [Define to make fseeko visible on some hosts (e.g. glibc 2.2).], X [#include ], [return !fseeko;]) X fi X ]) X X XAC_DEFUN([AC_FUNC_FSEEKO], X [AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE, 1, X ac_cv_sys_largefile_source, X [Define to make fseeko visible on some hosts (e.g. glibc 2.2).], X [#include ], [return !fseeko;]) X # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug X # in glibc 2.1.3, but that breaks too many other things. X # If you want fseeko and ftello with glibc, upgrade to a fixed glibc. X X AC_CACHE_CHECK([for fseeko], ac_cv_func_fseeko, X [ac_cv_func_fseeko=no X AC_TRY_LINK([#include ], X [return fseeko && fseeko (stdin, 0, 0);], X [ac_cv_func_fseeko=yes])]) X if test $ac_cv_func_fseeko != no; then X AC_DEFINE(HAVE_FSEEKO, 1, X [Define if fseeko (and presumably ftello) exists and is declared.]) X fi]) X X Xdnl XXXXXXXXXXXXXXXXXX End Stolen (but modified) from GNU tar XXXXXXXXXXXXXXXXXXXXXXXXXXXXX X XAC_DEFUN([AC_HAVE_LARGEFILES], X[AC_CACHE_CHECK([if system supports Large Files at all], ac_cv_largefiles, X [AC_TRY_COMPILE([#include X#include ], X [ X/* X * Check that off_t can represent 2**63 - 1 correctly. X * We can't simply "#define LARGE_OFF_T 9223372036854775807", X * since some C++ compilers masquerading as C compilers X * incorrectly reject 9223372036854775807. X */ X# define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) X int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 X && LARGE_OFF_T % 2147483647 == 1) X ? 1 : -1]; Xreturn !fseeko; Xreturn !ftello;], X [ac_cv_largefiles=yes], X [ac_cv_largefiles=no])]) X if test $ac_cv_largefiles = yes; then X AC_DEFINE(HAVE_LARGEFILES) X fi]) X Xdnl Checks for whether fseeko() is available in non large file mode Xdnl and whether there is a prototype for fseeko() Xdnl Defines HAVE_FSEEKO on success. XAC_DEFUN([AC_SMALL_FSEEKO], X[AC_CACHE_CHECK([for fseeko()], ac_cv_func_fseeko, X [AC_TRY_LINK([#include ], X[return !fseeko;], X [ac_cv_func_fseeko=yes], X [ac_cv_func_fseeko=no])]) Xif test $ac_cv_func_fseeko = yes; then X AC_DEFINE(HAVE_FSEEKO) Xfi]) X Xdnl Checks for whether ftello() is available in non large file mode Xdnl and whether there is a prototype for ftello() Xdnl Defines HAVE_FTELLO on success. XAC_DEFUN([AC_SMALL_FTELLO], X[AC_CACHE_CHECK([for ftello()], ac_cv_func_ftello, X [AC_TRY_LINK([#include ], X[return !ftello;], X [ac_cv_func_ftello=yes], X [ac_cv_func_ftello=no])]) Xif test $ac_cv_func_ftello = yes; then X AC_DEFINE(HAVE_FTELLO) Xfi]) X Xdnl Checks if compiler allows dynamic arrays. Xdnl Defines HAVE_DYN_ARRAYS on success. XAC_DEFUN([AC_DYN_ARRAYS], X[AC_CACHE_CHECK([if compiler allows dynamic arrays], ac_cv_dyn_arrays, X [AC_TRY_COMPILE([], X [extern int __aa(); int len = __aa(); char some_array[len];], X [ac_cv_dyn_arrays=yes], X [ac_cv_dyn_arrays=no])]) Xif test $ac_cv_dyn_arrays = yes; then X AC_DEFINE(HAVE_DYN_ARRAYS) Xfi]) X Xdnl Checks if the compiler allows #pragma weak Xdnl Defines HAVE_PRAGMA_WEAK on success. XAC_DEFUN([AC_PRAGMA_WEAK], X[AC_CACHE_CHECK([if compiler allows pragma weak], ac_cv_pragma_weak, X [AC_TRY_LINK([extern int test2(); X#pragma weak test2 = test1 Xint test1() {return 0;}], X[return test2();], X [ac_cv_pragma_weak=yes], X [ac_cv_pragma_weak=no])]) Xif test $ac_cv_pragma_weak = yes; then X AC_DEFINE(HAVE_PRAGMA_WEAK) Xfi]) X Xdnl Checks if Linux include file linux/ext2_fs.h is broken Xdnl Defines HAVE_BROKEN_LINUX_EXT2_FS_H on success. XAC_DEFUN([AC_BROKEN_LINUX_EXT2_FS_H], X[AC_CACHE_CHECK([if Linux include file linux/ext2_fs.h is broken], ac_cv_broken_linux_ext2_fs_h, X [AC_TRY_COMPILE([ X#if defined(__linux__) || defined(__linux) || defined(linux) X#include X#endif], X [], X [ac_cv_broken_linux_ext2_fs_h=no], X [ac_cv_broken_linux_ext2_fs_h=yes])]) Xif test $ac_cv_broken_linux_ext2_fs_h = yes; then X AC_DEFINE(HAVE_BROKEN_LINUX_EXT2_FS_H) Xfi]) X Xdnl Checks if Linux include file /usr/src/linux/include/linux/ext2_fs.h is broken Xdnl Defines HAVE_BROKEN_SRC_LINUX_EXT2_FS_H on success. XAC_DEFUN([AC_BROKEN_SRC_LINUX_EXT2_FS_H], X[AC_CACHE_CHECK([if Linux include file /usr/src/linux/include/linux/ext2_fs.h is broken], ac_cv_broken_src_linux_ext2_fs_h, X [___CPPFLAGS=$CPPFLAGS; CPPFLAGS="-I/usr/src/linux/include $CPPFLAGS" X AC_TRY_COMPILE([ X#if defined(__linux__) || defined(__linux) || defined(linux) X#include X#endif], X [], X [ac_cv_broken_src_linux_ext2_fs_h=no], X [ac_cv_broken_src_linux_ext2_fs_h=yes])]) XCPPFLAGS=$___CPPFLAGS Xif test $ac_cv_broken_src_linux_ext2_fs_h = yes; then X AC_DEFINE(HAVE_BROKEN_SRC_LINUX_EXT2_FS_H) Xfi]) X Xdnl Checks if Linux include file scsi/scsi.h is broken Xdnl Defines HAVE_BROKEN_SCSI_SCSI_H on success. XAC_DEFUN([AC_BROKEN_SCSI_SCSI_H], X[AC_CACHE_CHECK([if Linux include file scsi/scsi.h is broken], ac_cv_broken_scsi_scsi_h, X [AC_TRY_COMPILE([ X#if defined(__linux__) || defined(__linux) || defined(linux) X#include X#endif], X [], X [ac_cv_broken_scsi_scsi_h=no], X [ac_cv_broken_scsi_scsi_h=yes])]) Xif test $ac_cv_broken_scsi_scsi_h = yes; then X AC_DEFINE(HAVE_BROKEN_SCSI_SCSI_H) Xfi]) X Xdnl Checks if Linux include file /usr/src/linux/include/scsi/scsi.h is broken Xdnl Defines HAVE_BROKEN_SRC_SCSI_SCSI_H on success. XAC_DEFUN([AC_BROKEN_SRC_SCSI_SCSI_H], X[AC_CACHE_CHECK([if Linux include file /usr/src/linux/include/scsi/scsi.h is broken], ac_cv_broken_src_scsi_scsi_h, X [___CPPFLAGS=$CPPFLAGS; CPPFLAGS="-I/usr/src/linux/include $CPPFLAGS" X AC_TRY_COMPILE([ X#if defined(__linux__) || defined(__linux) || defined(linux) X#include X#endif], X [], X [ac_cv_broken_src_scsi_scsi_h=no], X [ac_cv_broken_src_scsi_scsi_h=yes])]) XCPPFLAGS=$___CPPFLAGS Xif test $ac_cv_broken_src_scsi_scsi_h = yes; then X AC_DEFINE(HAVE_BROKEN_SRC_SCSI_SCSI_H) Xfi]) X Xdnl Checks if Linux include file scsi/sg.h is broken Xdnl Defines HAVE_BROKEN_SCSI_SG_H on success. XAC_DEFUN([AC_BROKEN_SCSI_SG_H], X[AC_CACHE_CHECK([if Linux include file scsi/sg.h is broken], ac_cv_broken_scsi_sg_h, X [AC_TRY_COMPILE([ X#if defined(__linux__) || defined(__linux) || defined(linux) X#include X#include X#endif], X [], X [ac_cv_broken_scsi_sg_h=no], X [ac_cv_broken_scsi_sg_h=yes])]) Xif test $ac_cv_broken_scsi_sg_h = yes; then X AC_DEFINE(HAVE_BROKEN_SCSI_SG_H) Xfi]) X Xdnl Checks if Linux include file /usr/src/linux/include/scsi/sg.h is broken Xdnl Defines HAVE_BROKEN_SRC_SCSI_SG_H on success. XAC_DEFUN([AC_BROKEN_SRC_SCSI_SG_H], X[AC_CACHE_CHECK([if Linux include file /usr/src/linux/include/scsi/sg.h is broken], ac_cv_broken_src_scsi_sg_h, X [___CPPFLAGS=$CPPFLAGS; CPPFLAGS="-I/usr/src/linux/include $CPPFLAGS" X AC_TRY_COMPILE([ X#if defined(__linux__) || defined(__linux) || defined(linux) X#include X#include X#endif], X [], X [ac_cv_broken_src_scsi_sg_h=no], X [ac_cv_broken_src_scsi_sg_h=yes])]) XCPPFLAGS=$___CPPFLAGS Xif test $ac_cv_broken_src_scsi_sg_h = yes; then X AC_DEFINE(HAVE_BROKEN_SRC_SCSI_SG_H) Xfi]) X XAC_DEFUN(AC_PROG_SHELL_BROKEN_E, X[AC_CACHE_CHECK(whether handling of /bin/sh -ce 'command' is broken, ac_cv_prog_shell_broken_e, X[if AC_TRY_COMMAND(/bin/sh -ce 'if false; true; then echo yes; else echo no; fi') | egrep yes >/dev/null 2>&1; then X ac_cv_prog_shell_broken_e=no Xelse X ac_cv_prog_shell_broken_e=yes Xfi Xif test $ac_cv_prog_shell_broken_e = yes; then X AC_DEFINE(HAVE_PROG_SHELL_BROKEN_E) Xfi])]) X Xdnl Checks if a file exists Xdnl Do not use test -r as bash on Haiku returns 0 for test -r /dev/stdin Xdnl even though /dev/stdin does not exist. Xdnl Xdnl Defines HAVE_ on success. Xdnl AC_STAT_FILE(FILE, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) XAC_DEFUN([AC_STAT_FILE], X[AC_REQUIRE([AC_PROG_CC]) Xdnl Do the transliteration at runtime so arg 1 can be a shell variable. Xac_safe=`echo "$1" | sed 'y%./+-%__p_%'` XAC_MSG_CHECKING([for $1]) XAC_CACHE_VAL(ac_cv_file_$ac_safe, X [AC_TRY_RUN([ X#include X#include X Xint Xmain() X{ X struct stat sb; X X exit(stat("$1", &sb) < 0); X}], X [eval ac_cv_file_$ac_safe=yes], X [eval ac_cv_file_$ac_safe=no])]) Xif eval "test \"`echo '$ac_cv_file_'$ac_safe`\" = yes"; then X AC_MSG_RESULT(yes) X ifelse([$2], , :, [$2]) Xelse X AC_MSG_RESULT(no) X ifelse([$3], , , [$3]) Xfi X]) X Xdnl AC_STAT_FILES(FILE... [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) XAC_DEFUN(AC_STAT_FILES, X[for ac_file in $1 Xdo XAC_STAT_FILE($ac_file, X[changequote(, )dnl X ac_tr_file=HAVE_`echo $ac_file | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` Xchangequote([, ])dnl X AC_DEFINE_UNQUOTED($ac_tr_file) $2], $3)dnl Xdone X]) END-of-star-1.6/autoconf/aclocal.m4 echo x - star-1.6/autoconf/acoldnames.m4 sed 's/^X//' >star-1.6/autoconf/acoldnames.m4 << 'END-of-star-1.6/autoconf/acoldnames.m4' Xdnl @(#)acoldnames.m4 1.3 08/08/01 Copyright 1998-2008 J. Schilling Xdnl Xdnl Map old names of Autoconf macros to new regularized names. Xdnl This file is part of Autoconf. Xdnl Copyright (C) 1994 Free Software Foundation, Inc. Xdnl Xdnl This program is free software; you can redistribute it and/or modify Xdnl it under the terms of the GNU General Public License as published by Xdnl the Free Software Foundation; either version 2, or (at your option) Xdnl any later version. Xdnl Xdnl This program is distributed in the hope that it will be useful, Xdnl but WITHOUT ANY WARRANTY; without even the implied warranty of Xdnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Xdnl GNU General Public License for more details. Xdnl Xdnl You should have received a copy of the GNU General Public License Xdnl along with this program; if not, write to the Free Software Xdnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA Xdnl 02111-1307, USA. Xdnl Xdnl General macros. Xdnl Xdefine(AC_WARN, [indir([AC_MSG_WARN], $@)])dnl Xdefine(AC_ERROR, [indir([AC_MSG_ERROR], $@)])dnl XAC_DEFUN(AC_PROGRAM_CHECK, [indir([AC_CHECK_PROG], $@)])dnl XAC_DEFUN(AC_PROGRAM_PATH, [indir([AC_PATH_PROG], $@)])dnl XAC_DEFUN(AC_PROGRAMS_CHECK, [indir([AC_CHECK_PROGS], $@)])dnl XAC_DEFUN(AC_PROGRAMS_PATH, [indir([AC_PATH_PROGS], $@)])dnl XAC_DEFUN(AC_PREFIX, [indir([AC_PREFIX_PROGRAM], $@)])dnl XAC_DEFUN(AC_HEADER_EGREP, [indir([AC_EGREP_HEADER], $@)])dnl XAC_DEFUN(AC_PROGRAM_EGREP, [indir([AC_EGREP_CPP], $@)])dnl XAC_DEFUN(AC_TEST_PROGRAM, [indir([AC_TRY_RUN], $@)])dnl XAC_DEFUN(AC_TEST_CPP, [indir([AC_TRY_CPP], $@)])dnl XAC_DEFUN(AC_HEADER_CHECK, [indir([AC_CHECK_HEADER], $@)])dnl XAC_DEFUN(AC_FUNC_CHECK, [indir([AC_CHECK_FUNC], $@)])dnl XAC_DEFUN(AC_HAVE_FUNCS, [indir([AC_CHECK_FUNCS], $@)])dnl XAC_DEFUN(AC_HAVE_HEADERS, [indir([AC_CHECK_HEADERS], $@)])dnl XAC_DEFUN(AC_SIZEOF_TYPE, [indir([AC_CHECK_SIZEOF], $@)])dnl Xdnl Xdnl Specific macros. Xdnl XAC_DEFUN(AC_GCC_TRADITIONAL, [indir([AC_PROG_GCC_TRADITIONAL])])dnl XAC_DEFUN(AC_MINUS_C_MINUS_O, [indir([AC_PROG_CC_C_O])])dnl XAC_DEFUN(AC_SET_MAKE, [indir([AC_PROG_MAKE_SET])])dnl XAC_DEFUN(AC_YYTEXT_POINTER, [indir([AC_DECL_YYTEXT])])dnl XAC_DEFUN(AC_LN_S, [indir([AC_PROG_LN_S])])dnl XAC_DEFUN(AC_STDC_HEADERS, [indir([AC_HEADER_STDC])])dnl XAC_DEFUN(AC_MAJOR_HEADER, [indir([AC_HEADER_MAJOR])])dnl XAC_DEFUN(AC_STAT_MACROS_BROKEN, [indir([AC_HEADER_STAT])])dnl XAC_DEFUN(AC_SYS_SIGLIST_DECLARED, [indir([AC_DECL_SYS_SIGLIST])])dnl XAC_DEFUN(AC_GETGROUPS_T, [indir([AC_TYPE_GETGROUPS])])dnl XAC_DEFUN(AC_UID_T, [indir([AC_TYPE_UID_T])])dnl XAC_DEFUN(AC_SIZE_T, [indir([AC_TYPE_SIZE_T])])dnl XAC_DEFUN(AC_PID_T, [indir([AC_TYPE_PID_T])])dnl XAC_DEFUN(AC_OFF_T, [indir([AC_TYPE_OFF_T])])dnl XAC_DEFUN(AC_MODE_T, [indir([AC_TYPE_MODE_T])])dnl XAC_DEFUN(AC_RETSIGTYPE, [indir([AC_TYPE_SIGNAL])])dnl XAC_DEFUN(AC_MMAP, [indir([AC_FUNC_MMAP])])dnl XAC_DEFUN(AC_VPRINTF, [indir([AC_FUNC_VPRINTF])])dnl XAC_DEFUN(AC_VFORK, [indir([AC_FUNC_VFORK])])dnl XAC_DEFUN(AC_WAIT3, [indir([AC_FUNC_WAIT3])])dnl XAC_DEFUN(AC_ALLOCA, [indir([AC_FUNC_ALLOCA])])dnl XAC_DEFUN(AC_GETLOADAVG, [indir([AC_FUNC_GETLOADAVG])])dnl XAC_DEFUN(AC_UTIME_NULL, [indir([AC_FUNC_UTIME_NULL])])dnl XAC_DEFUN(AC_STRCOLL, [indir([AC_FUNC_STRCOLL])])dnl XAC_DEFUN(AC_SETVBUF_REVERSED, [indir([AC_FUNC_SETVBUF_REVERSED])])dnl XAC_DEFUN(AC_TIME_WITH_SYS_TIME, [indir([AC_HEADER_TIME])])dnl XAC_DEFUN(AC_TIMEZONE, [indir([AC_STRUCT_TM_ZONE])])dnl XAC_DEFUN(AC_ST_BLOCKS, [indir([AC_STRUCT_ST_BLOCKS])])dnl XAC_DEFUN(AC_ST_BLKSIZE, [indir([AC_STRUCT_ST_BLKSIZE])])dnl XAC_DEFUN(AC_ST_RDEV, [indir([AC_STRUCT_ST_RDEV])])dnl XAC_DEFUN(AC_CROSS_CHECK, [indir([AC_C_CROSS])])dnl XAC_DEFUN(AC_CHAR_UNSIGNED, [indir([AC_C_CHAR_UNSIGNED])])dnl XAC_DEFUN(AC_LONG_DOUBLE, [indir([AC_C_LONG_DOUBLE])])dnl XAC_DEFUN(AC_WORDS_BIGENDIAN, [indir([AC_C_BIGENDIAN])])dnl XAC_DEFUN(AC_INLINE, [indir([AC_C_INLINE])])dnl XAC_DEFUN(AC_CONST, [indir([AC_C_CONST])])dnl XAC_DEFUN(AC_LONG_FILE_NAMES, [indir([AC_SYS_LONG_FILE_NAMES])])dnl XAC_DEFUN(AC_RESTARTABLE_SYSCALLS, [indir([AC_SYS_RESTARTABLE_SYSCALLS])])dnl XAC_DEFUN(AC_FIND_X, [indir([AC_PATH_X])])dnl XAC_DEFUN(AC_FIND_XTRA, [indir([AC_PATH_XTRA])])dnl END-of-star-1.6/autoconf/acoldnames.m4 echo x - star-1.6/autoconf/acspecific.m4 sed 's/^X//' >star-1.6/autoconf/acspecific.m4 << 'END-of-star-1.6/autoconf/acspecific.m4' Xdnl @(#)acspecific.m4 1.18 19/03/14 Copyright 1998-2017 J. Schilling Xdnl Xdnl Macros that test for specific features. Xdnl This file is part of Autoconf. Xdnl Copyright (C) 1992, 93, 94, 95, 96, 1998 Free Software Foundation, Inc. Xdnl Xdnl This program is free software; you can redistribute it and/or modify Xdnl it under the terms of the GNU General Public License as published by Xdnl the Free Software Foundation; either version 2, or (at your option) Xdnl any later version. Xdnl Xdnl This program is distributed in the hope that it will be useful, Xdnl but WITHOUT ANY WARRANTY; without even the implied warranty of Xdnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Xdnl GNU General Public License for more details. Xdnl Xdnl You should have received a copy of the GNU General Public License Xdnl along with this program; if not, write to the Free Software Xdnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA Xdnl 02111-1307, USA. Xdnl Xdnl As a special exception, the Free Software Foundation gives unlimited Xdnl permission to copy, distribute and modify the configure scripts that Xdnl are the output of Autoconf. You need not follow the terms of the GNU Xdnl General Public License when using or distributing such scripts, even Xdnl though portions of the text of Autoconf appear in them. The GNU Xdnl General Public License (GPL) does govern all other use of the material Xdnl that constitutes the Autoconf program. Xdnl Xdnl Certain portions of the Autoconf source text are designed to be copied Xdnl (in certain cases, depending on the input) into the output of Xdnl Autoconf. We call these the "data" portions. The rest of the Autoconf Xdnl source text consists of comments plus executable code that decides which Xdnl of the data portions to output in any given case. We call these Xdnl comments and executable code the "non-data" portions. Autoconf never Xdnl copies any of the non-data portions into its output. Xdnl Xdnl This special exception to the GPL applies to versions of Autoconf Xdnl released by the Free Software Foundation. When you make and Xdnl distribute a modified version of Autoconf, you may extend this special Xdnl exception to the GPL to apply to your modified version as well, *unless* Xdnl your modified version has the potential to copy into its output some Xdnl of the text that was the non-data portion of the version that you started Xdnl with. (In other words, unless your change moves or copies text from Xdnl the non-data portions to the data portions.) If your modification has Xdnl such potential, you must delete any notice of this special exception Xdnl to the GPL from your modified version. Xdnl Xdnl Written by David MacKenzie, with help from Xdnl Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor, Xdnl Roland McGrath, Noah Friedman, david d zuhn, and many others. X X Xdnl ### Checks for programs X X Xdnl Check whether to use -n, \c, or newline-tab to separate Xdnl checking messages from result messages. Xdnl Idea borrowed from dist 3.0. Xdnl Internal use only. XAC_DEFUN(AC_PROG_ECHO_N, X[if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then X # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. X if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then X ac_n= ac_c=' X' ac_t=' ' X else X ac_n=-n ac_c= ac_t= X fi Xelse X ac_n= ac_c='\c' ac_t= Xfi X]) X XAC_DEFUN(AC_PROG_CC, X[AC_BEFORE([$0], [AC_PROG_CPP])dnl XAC_CHECK_PROG(CC, gcc, gcc) Xif test -z "$CC"; then X AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) X if test -z "$CC"; then X case "`uname -s`" in X *win32* | *WIN32*) X AC_CHECK_PROG(CC, cl, cl) ;; X esac X fi X test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH]) Xfi X XAC_PROG_CC_WORKS XAC_PROG_CC_GNU X Xif test $ac_cv_prog_gcc = yes; then X GCC=yes Xelse X GCC= Xfi X Xdnl Check whether -g works, even if CFLAGS is set, in case the package Xdnl plays around with CFLAGS (such as to build both debugging and Xdnl normal versions of a library), tasteless as that idea is. Xac_test_CFLAGS="${CFLAGS+set}" Xac_save_CFLAGS="$CFLAGS" XCFLAGS= XAC_PROG_CC_G Xif test "$ac_test_CFLAGS" = set; then X CFLAGS="$ac_save_CFLAGS" Xelif test $ac_cv_prog_cc_g = yes; then X if test "$GCC" = yes; then X CFLAGS="-g -O2" X else X CFLAGS="-g" X fi Xelse X if test "$GCC" = yes; then X CFLAGS="-O2" X else X CFLAGS= X fi Xfi X]) X XAC_DEFUN(AC_PROG_CXX, X[AC_BEFORE([$0], [AC_PROG_CXXCPP])dnl XAC_CHECK_PROGS(CXX, $CCC c++ g++ gcc CC cxx cc++ cl, gcc) X XAC_PROG_CXX_WORKS XAC_PROG_CXX_GNU X Xif test $ac_cv_prog_gxx = yes; then X GXX=yes Xelse X GXX= Xfi X Xdnl Check whether -g works, even if CXXFLAGS is set, in case the package Xdnl plays around with CXXFLAGS (such as to build both debugging and Xdnl normal versions of a library), tasteless as that idea is. Xac_test_CXXFLAGS="${CXXFLAGS+set}" Xac_save_CXXFLAGS="$CXXFLAGS" XCXXFLAGS= XAC_PROG_CXX_G Xif test "$ac_test_CXXFLAGS" = set; then X CXXFLAGS="$ac_save_CXXFLAGS" Xelif test $ac_cv_prog_cxx_g = yes; then X if test "$GXX" = yes; then X CXXFLAGS="-g -O2" X else X CXXFLAGS="-g" X fi Xelse X if test "$GXX" = yes; then X CXXFLAGS="-O2" X else X CXXFLAGS= X fi Xfi X]) X Xdnl Determine a Fortran 77 compiler to use. If `F77' is not already set Xdnl in the environment, check for `g77', `f77' and `f2c', in that order. Xdnl Set the output variable `F77' to the name of the compiler found. Xdnl Xdnl If using `g77' (the GNU Fortran 77 compiler), then `AC_PROG_F77' Xdnl will set the shell variable `G77' to `yes', and empty otherwise. If Xdnl the output variable `FFLAGS' was not already set in the environment, Xdnl then set it to `-g -02' for `g77' (or `-O2' where `g77' does not Xdnl accept `-g'). Otherwise, set `FFLAGS' to `-g' for all other Fortran Xdnl 77 compilers. Xdnl Xdnl AC_PROG_F77() XAC_DEFUN(AC_PROG_F77, X[AC_BEFORE([$0], [AC_PROG_CPP])dnl Xif test -z "$F77"; then X AC_CHECK_PROGS(F77, g77 f77 f2c) X test -z "$F77" && AC_MSG_ERROR([no acceptable Fortran 77 compiler found in \$PATH]) Xfi X XAC_PROG_F77_WORKS XAC_PROG_F77_GNU X Xif test $ac_cv_prog_g77 = yes; then X G77=yes Xdnl Check whether -g works, even if FFLAGS is set, in case the package Xdnl plays around with FFLAGS (such as to build both debugging and Xdnl normal versions of a library), tasteless as that idea is. X ac_test_FFLAGS="${FFLAGS+set}" X ac_save_FFLAGS="$FFLAGS" X FFLAGS= X AC_PROG_F77_G X if test "$ac_test_FFLAGS" = set; then X FFLAGS="$ac_save_FFLAGS" X elif test $ac_cv_prog_f77_g = yes; then X FFLAGS="-g -O2" X else X FFLAGS="-O2" X fi Xelse X G77= X test "${FFLAGS+set}" = set || FFLAGS="-g" Xfi X]) X XAC_DEFUN(AC_PROG_CC_WORKS, X[AC_MSG_CHECKING([whether the C compiler ($CC $CFLAGS $LDFLAGS) works]) XAC_LANG_SAVE XAC_LANG_C XAC_TRY_COMPILER([main(){return(0);}], ac_cv_prog_cc_works, ac_cv_prog_cc_cross) XAC_LANG_RESTORE XAC_MSG_RESULT($ac_cv_prog_cc_works) Xif test $ac_cv_prog_cc_works = no; then X ccout=`eval "${CC-cc} 2>&1" 2> /dev/null` X ret=$? X nf=`echo "$ccout" | grep 'not found'` X if test $ret = 127 -a -n "$nf" ; then # Korn Shell X ccout="" X fi X if test "$ret" -ne 0 -a ! -n "$ccout" ; then X AC_MSG_ERROR([installation or configuration problem: C compiler ${CC-cc} not found.]) X fi X AC_MSG_ERROR([installation or configuration problem: C compiler cannot create executables.]) Xfi XAC_MSG_CHECKING([whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler]) XAC_MSG_RESULT($ac_cv_prog_cc_cross) Xcross_compiling=$ac_cv_prog_cc_cross Xif test "$cross_compiling" = yes -a "$CONFIG_RMTCALL" != NONE ; then X cross_compiling=remote X rmtcall="$CONFIG_RMTCALL" X rmttest="$CONFIG_RMTCALL" Xfi X]) X XAC_DEFUN(AC_PROG_CXX_WORKS, X[AC_MSG_CHECKING([whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works]) XAC_LANG_SAVE XAC_LANG_CPLUSPLUS XAC_TRY_COMPILER([int main(){return(0);}], ac_cv_prog_cxx_works, ac_cv_prog_cxx_cross) XAC_LANG_RESTORE XAC_MSG_RESULT($ac_cv_prog_cxx_works) Xif test $ac_cv_prog_cxx_works = no; then X AC_MSG_ERROR([installation or configuration problem: C++ compiler cannot create executables.]) Xfi XAC_MSG_CHECKING([whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler]) XAC_MSG_RESULT($ac_cv_prog_cxx_cross) Xcross_compiling=$ac_cv_prog_cxx_cross Xif test "$cross_compiling" = yes -a "$CONFIG_RMTCALL" != NONE ; then X cross_compiling=remote X rmtcall="$CONFIG_RMTCALL" X rmttest="$CONFIG_RMTCALL" Xfi X]) X Xdnl Test whether the Fortran 77 compiler can compile and link a trivial Xdnl Fortran program. Also, test whether the Fortran 77 compiler is a Xdnl cross-compiler (which may realistically be the case if the Fortran Xdnl compiler is `g77'). Xdnl Xdnl AC_PROG_F77_WORKS() XAC_DEFUN(AC_PROG_F77_WORKS, X[AC_MSG_CHECKING([whether the Fortran 77 compiler ($F77 $FFLAGS $LDFLAGS) works]) XAC_LANG_SAVE XAC_LANG_FORTRAN77 XAC_TRY_COMPILER(dnl X[ program conftest X end X], ac_cv_prog_f77_works, ac_cv_prog_f77_cross) XAC_LANG_RESTORE XAC_MSG_RESULT($ac_cv_prog_f77_works) Xif test $ac_cv_prog_f77_works = no; then X AC_MSG_ERROR([installation or configuration problem: Fortran 77 compiler cannot create executables.]) Xfi XAC_MSG_CHECKING([whether the Fortran 77 compiler ($F77 $FFLAGS $LDFLAGS) is a cross-compiler]) XAC_MSG_RESULT($ac_cv_prog_f77_cross) Xcross_compiling=$ac_cv_prog_f77_cross Xif test "$cross_compiling" = yes -a "$CONFIG_RMTCALL" != NONE ; then X cross_compiling=remote X rmtcall="$CONFIG_RMTCALL" X rmttest="$CONFIG_RMTCALL" Xfi X]) X Xdnl Checks whether $CONFIG_RMTCALL and $CONFIG_RMTHOST are both set up Xdnl in our enviroment to avoid hidden failures in the tests. Xdnl In case of calling programs on an emulator, set CONFIG_RMTHOST=none XAC_DEFUN(AC_REMOTE_PARMS,[ Xif test "$cross_compiling" = remote -a ."$CONFIG_RMTCALL" = . ; then X echo 'CONFIG_RMTCALL=script-path required for remote execution' 1>&2 X exit 1 Xfi Xif test "$cross_compiling" = remote -a ."$CONFIG_RMTHOST" = . ; then X echo 'CONFIG_RMTHOST=host or CONFIG_RMTHOST=user@host required for remote execution' 1>&2 X exit 1 Xfi Xif test "$cross_compiling" = remote ; then X echo "Cross-Compiling with remote execution of test programs" X echo "Cross-Compile script: $CONFIG_RMTCALL" X echo "Cross-Compile host: $CONFIG_RMTHOST" Xfi X]) X X XAC_DEFUN(AC_PROG_CC_GNU, X[AC_CACHE_CHECK(whether we are using GNU C, ac_cv_prog_gcc, X[dnl The semicolon is to pacify NeXT's syntax-checking cpp. Xcat > conftest.c </dev/null 2>&1; then X ac_cv_prog_gcc=yes Xelse X ac_cv_prog_gcc=no Xfi])]) X XAC_DEFUN(AC_PROG_CXX_GNU, X[AC_CACHE_CHECK(whether we are using GNU C++, ac_cv_prog_gxx, X[dnl The semicolon is to pacify NeXT's syntax-checking cpp. Xcat > conftest.C </dev/null 2>&1; then X ac_cv_prog_gxx=yes Xelse X ac_cv_prog_gxx=no Xfi])]) X Xdnl Test whether for Fortran 77 compiler is `g77' (the GNU Fortran 77 Xdnl Compiler). This test depends on whether the Fortran 77 compiler can Xdnl do CPP pre-processing. Xdnl Xdnl AC_PROG_F77_GNU() XAC_DEFUN(AC_PROG_F77_GNU, X[AC_CACHE_CHECK(whether we are using GNU Fortran 77, ac_cv_prog_g77, X[cat > conftest.fpp </dev/null 2>&1; then X ac_cv_prog_g77=yes Xelse X ac_cv_prog_g77=no Xfi])]) X XAC_DEFUN(AC_PROG_CC_G, X[AC_CACHE_CHECK(whether ${CC-cc} accepts -g, ac_cv_prog_cc_g, X[echo 'void f(){}' > conftest.c Xif test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then X ac_cv_prog_cc_g=yes Xelse X ac_cv_prog_cc_g=no Xfi Xrm -rf conftest* X])]) X XAC_DEFUN(AC_PROG_CXX_G, X[AC_CACHE_CHECK(whether ${CXX-g++} accepts -g, ac_cv_prog_cxx_g, X[echo 'void f(){}' > conftest.cc Xif test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then X ac_cv_prog_cxx_g=yes Xelse X ac_cv_prog_cxx_g=no Xfi Xrm -rf conftest* X])]) X Xdnl Test whether the Fortran 77 compiler can accept the `-g' option to Xdnl enable debugging. Xdnl Xdnl AC_PROG_F77_G() XAC_DEFUN(AC_PROG_F77_G, X[AC_CACHE_CHECK(whether $F77 accepts -g, ac_cv_prog_f77_g, X[cat > conftest.f << EOF X program conftest X end XEOF Xif test -z "`$F77 -g -c conftest.f 2>&1`"; then X ac_cv_prog_f77_g=yes Xelse X ac_cv_prog_f77_g=no Xfi Xrm -rf conftest* X])]) X XAC_DEFUN(AC_PROG_GCC_TRADITIONAL, X[AC_REQUIRE([AC_PROG_CC])dnl XAC_REQUIRE([AC_PROG_CPP])dnl Xif test $ac_cv_prog_gcc = yes; then X AC_CACHE_CHECK(whether ${CC-cc} needs -traditional, X ac_cv_prog_gcc_traditional, X[ ac_pattern="Autoconf.*'x'" X AC_EGREP_CPP($ac_pattern, [#include XAutoconf TIOCGETP], X ac_cv_prog_gcc_traditional=yes, ac_cv_prog_gcc_traditional=no) X X if test $ac_cv_prog_gcc_traditional = no; then X AC_EGREP_CPP($ac_pattern, [#include XAutoconf TCGETA], X ac_cv_prog_gcc_traditional=yes) X fi]) X if test $ac_cv_prog_gcc_traditional = yes; then X CC="$CC -traditional" X fi Xfi X]) X XAC_DEFUN(AC_PROG_CC_C_O, X[if test "x$CC" != xcc; then X AC_MSG_CHECKING(whether $CC and cc understand -c and -o together) Xelse X AC_MSG_CHECKING(whether cc understands -c and -o together) Xfi Xset dummy $CC; ac_cc="`echo [$]2 | Xchangequote(, )dnl X sed -e 's/[^a-zA-Z0-9_]/_/g' -e 's/^[0-9]/_/'`" Xchangequote([, ])dnl XAC_CACHE_VAL(ac_cv_prog_cc_${ac_cc}_c_o, X[echo 'foo(){}' > conftest.c X# Make sure it works both with $CC and with simple cc. X# We do the test twice because some compilers refuse to overwrite an X# existing .o file with -o, though they will create one. Xac_try='${CC-cc} -c conftest.c -o conftest.o 1>&AC_FD_CC' Xif AC_TRY_EVAL(ac_try) && X test -f conftest.o && AC_TRY_EVAL(ac_try); Xthen X eval ac_cv_prog_cc_${ac_cc}_c_o=yes X if test "x$CC" != xcc; then X # Test first that cc exists at all. X if AC_TRY_COMMAND(cc -c conftest.c 1>&AC_FD_CC); then X ac_try='cc -c conftest.c -o conftest.o 1>&AC_FD_CC' X if AC_TRY_EVAL(ac_try) && X test -f conftest.o && AC_TRY_EVAL(ac_try); X then X # cc works too. X : X else X # cc exists but doesn't like -o. X eval ac_cv_prog_cc_${ac_cc}_c_o=no X fi X fi X fi Xelse X eval ac_cv_prog_cc_${ac_cc}_c_o=no Xfi Xrm -rf conftest* X])dnl Xif eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = yes"; then X AC_MSG_RESULT(yes) Xelse X AC_MSG_RESULT(no) X AC_DEFINE(NO_MINUS_C_MINUS_O) Xfi X]) X Xdnl Test if the Fortran 77 compiler accepts the options `-c' and `-o' Xdnl simultaneously, and define `F77_NO_MINUS_C_MINUS_O' if it does not. Xdnl Xdnl The usefulness of this macro is questionable, as I can't really see Xdnl why anyone would use it. The only reason I include it is for Xdnl completeness, since a similar test exists for the C compiler. Xdnl Xdnl AC_PROG_F77_C_O XAC_DEFUN(AC_PROG_F77_C_O, X[AC_BEFORE([$0], [AC_PROG_F77])dnl XAC_MSG_CHECKING(whether $F77 understand -c and -o together) Xset dummy $F77; ac_f77="`echo [$]2 | Xchangequote(, )dnl Xsed -e 's/[^a-zA-Z0-9_]/_/g' -e 's/^[0-9]/_/'`" Xchangequote([, ])dnl XAC_CACHE_VAL(ac_cv_prog_f77_${ac_f77}_c_o, X[cat > conftest.f << EOF X program conftest X end XEOF X# We do the `AC_TRY_EVAL' test twice because some compilers refuse to X# overwrite an existing `.o' file with `-o', although they will create X# one. Xac_try='$F77 $FFLAGS -c conftest.f -o conftest.o 1>&AC_FD_CC' Xif AC_TRY_EVAL(ac_try) && test -f conftest.o && AC_TRY_EVAL(ac_try); then X eval ac_cv_prog_f77_${ac_f77}_c_o=yes Xelse X eval ac_cv_prog_f77_${ac_f77}_c_o=no Xfi Xrm -rf conftest* X])dnl Xif eval "test \"`echo '$ac_cv_prog_f77_'${ac_f77}_c_o`\" = yes"; then X AC_MSG_RESULT(yes) Xelse X AC_MSG_RESULT(no) X AC_DEFINE(F77_NO_MINUS_C_MINUS_O) Xfi X]) X Xdnl Define SET_MAKE to set ${MAKE} if make doesn't. XAC_DEFUN(AC_PROG_MAKE_SET, X[AC_MSG_CHECKING(whether ${MAKE-make} sets \${MAKE}) Xset dummy ${MAKE-make}; ac_make=`echo "[$]2" | sed 'y%./+-%__p_%'` XAC_CACHE_VAL(ac_cv_prog_make_${ac_make}_set, X[cat > conftestmake <<\EOF Xall: X @echo 'ac_maketemp="${MAKE}"' XEOF Xchangequote(, )dnl X# GNU make sometimes prints "make[1]: Entering...", which would confuse us. Xeval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` Xchangequote([, ])dnl Xif test -n "$ac_maketemp"; then X eval ac_cv_prog_make_${ac_make}_set=yes Xelse X eval ac_cv_prog_make_${ac_make}_set=no Xfi Xrm -f conftestmake])dnl Xif eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then X AC_MSG_RESULT(yes) X SET_MAKE= Xelse X AC_MSG_RESULT(no) X SET_MAKE="MAKE=${MAKE-make}" Xfi XAC_SUBST([SET_MAKE])dnl X]) X XAC_DEFUN(AC_PROG_RANLIB, X[AC_CHECK_PROG(RANLIB, ranlib, ranlib, :)]) X Xdnl Check for mawk first since it's generally faster. XAC_DEFUN(AC_PROG_AWK, X[AC_CHECK_PROGS(AWK, mawk gawk nawk awk, )]) X XAC_DEFUN(AC_PROG_YACC, X[AC_CHECK_PROGS(YACC, 'bison -y' byacc, yacc)]) X XAC_DEFUN(AC_PROG_CPP, X[AC_MSG_CHECKING(how to run the C preprocessor) X# On Suns, sometimes $CPP names a directory. Xif test -n "$CPP" && test -d "$CPP"; then X CPP= Xfi Xif test -z "$CPP"; then XAC_CACHE_VAL(ac_cv_prog_CPP, X[ # This must be in double quotes, not single quotes, because CPP may get X # substituted into the Makefile and "${CC-cc}" will confuse make. X CPP="${CC-cc} -E" X # On the NeXT, cc -E runs the code through the compiler's parser, X # not just through cpp. Xdnl Use a header file that comes with gcc, so configuring glibc Xdnl with a fresh cross-compiler works. X AC_TRY_CPP([#include XSyntax Error], , X CPP="${CC-cc} -E -traditional-cpp" X AC_TRY_CPP([#include XSyntax Error], , X CPP="${CC-cc} -nologo -E" X AC_TRY_CPP([#include XSyntax Error], , CPP=/lib/cpp))) X ac_cv_prog_CPP="$CPP"])dnl X CPP="$ac_cv_prog_CPP" Xelse X ac_cv_prog_CPP="$CPP" Xfi XAC_MSG_RESULT($CPP) XAC_SUBST(CPP)dnl X]) X XAC_DEFUN(AC_PROG_CXXCPP, X[AC_MSG_CHECKING(how to run the C++ preprocessor) Xif test -z "$CXXCPP"; then XAC_CACHE_VAL(ac_cv_prog_CXXCPP, X[AC_LANG_SAVE[]dnl XAC_LANG_CPLUSPLUS[]dnl X CXXCPP="${CXX-g++} -E" X AC_TRY_CPP([#include ], , CXXCPP=/lib/cpp) X ac_cv_prog_CXXCPP="$CXXCPP" XAC_LANG_RESTORE[]dnl Xfi])dnl XCXXCPP="$ac_cv_prog_CXXCPP" XAC_MSG_RESULT($CXXCPP) XAC_SUBST(CXXCPP)dnl X]) X Xdnl Require finding the C or C++ preprocessor, whichever is the Xdnl current language. XAC_DEFUN(AC_REQUIRE_CPP, X[ifelse(AC_LANG, C, [AC_REQUIRE([AC_PROG_CPP])], [AC_REQUIRE([AC_PROG_CXXCPP])])]) X XAC_DEFUN(AC_PROG_LEX, X[AC_CHECK_PROG(LEX, flex, flex, lex) Xif test -z "$LEXLIB" Xthen X case "$LEX" in X flex*) ac_lib=fl ;; X *) ac_lib=l ;; X esac X AC_CHECK_LIB($ac_lib, yywrap, LEXLIB="-l$ac_lib") Xfi XAC_SUBST(LEXLIB)]) X Xdnl Check if lex declares yytext as a char * by default, not a char[]. Xundefine([AC_DECL_YYTEXT]) XAC_DEFUN(AC_DECL_YYTEXT, X[AC_REQUIRE_CPP()dnl XAC_REQUIRE([AC_PROG_LEX])dnl XAC_CACHE_CHECK(lex output file root, ac_cv_prog_lex_root, X[# The minimal lex program is just a single line: %%. But some broken lexes X# (Solaris, I think it was) want two %% lines, so accommodate them. Xecho '%% X%%' | $LEX Xif test -f lex.yy.c; then X ac_cv_prog_lex_root=lex.yy Xelif test -f lexyy.c; then X ac_cv_prog_lex_root=lexyy Xelse X AC_MSG_ERROR(cannot find output from $LEX; giving up) Xfi]) XLEX_OUTPUT_ROOT=$ac_cv_prog_lex_root XAC_SUBST(LEX_OUTPUT_ROOT)dnl X XAC_CACHE_CHECK(whether yytext is a pointer, ac_cv_prog_lex_yytext_pointer, X[# POSIX says lex can declare yytext either as a pointer or an array; the X# default is implementation-dependent. Figure out which it is, since X# not all implementations provide the %pointer and %array declarations. Xac_cv_prog_lex_yytext_pointer=no Xecho 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c Xac_save_LIBS="$LIBS" XLIBS="$LIBS $LEXLIB" XAC_TRY_LINK(`cat $LEX_OUTPUT_ROOT.c`, , ac_cv_prog_lex_yytext_pointer=yes) XLIBS="$ac_save_LIBS" Xrm -f "${LEX_OUTPUT_ROOT}.c" X]) Xdnl Xif test $ac_cv_prog_lex_yytext_pointer = yes; then X AC_DEFINE(YYTEXT_POINTER) Xfi X]) X XAC_DEFUN(AC_PROG_INSTALL, X[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl X# Find a good install program. We prefer a C program (faster), X# so one script is as good as another. But avoid the broken or X# incompatible versions: X# SysV /etc/install, /usr/sbin/install X# SunOS /usr/etc/install X# IRIX /sbin/install X# AIX /bin/install X# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag X# AFS /usr/afsws/bin/install, which mishandles nonexistent args X# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" X# ./install, which can be erroneously created by make from ./install.sh. XAC_MSG_CHECKING(for a BSD compatible install) Xif test -z "$INSTALL"; then XAC_CACHE_VAL(ac_cv_path_install, X[ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" X for ac_dir in $PATH; do X # Account for people who put trailing slashes in PATH elements. X case "$ac_dir/" in X /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; X *) X # OSF1 and SCO ODT 3.0 have their own names for install. X # Don't use installbsd from OSF since it installs stuff as root X # by default. X for ac_prog in ginstall scoinst install; do X if test -f $ac_dir/$ac_prog; then X if test $ac_prog = install && X grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then X # AIX install. It has an incompatible calling convention. X : X else X ac_cv_path_install="$ac_dir/$ac_prog -c" X break 2 X fi X fi X done X ;; X esac X done X IFS="$ac_save_IFS" X])dnl X if test "${ac_cv_path_install+set}" = set; then X INSTALL="$ac_cv_path_install" X else X # As a last resort, use the slow shell script. We don't cache a X # path for INSTALL within a source directory, because that will X # break other packages using the cache if that directory is X # removed, or if the path is relative. X INSTALL="$ac_install_sh" X fi Xfi Xdnl We do special magic for INSTALL instead of AC_SUBST, to get Xdnl relative paths right. XAC_MSG_RESULT($INSTALL) X X# Use test -z because SunOS4 sh mishandles braces in ${var-val}. X# It thinks the first close brace ends the variable substitution. Xtest -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' XAC_SUBST(INSTALL_PROGRAM)dnl X Xtest -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' XAC_SUBST(INSTALL_SCRIPT)dnl X Xtest -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' XAC_SUBST(INSTALL_DATA)dnl X]) X XAC_DEFUN(AC_PROG_LN_S, X[AC_MSG_CHECKING(whether ln -s works) XAC_CACHE_VAL(ac_cv_prog_LN_S, X[rm -f conftestdata Xif ln -s X conftestdata 2>/dev/null Xthen X rm -f conftestdata X ac_cv_prog_LN_S="ln -s" Xelse X ac_cv_prog_LN_S=ln Xfi])dnl XLN_S="$ac_cv_prog_LN_S" Xif test "$ac_cv_prog_LN_S" = "ln -s"; then X AC_MSG_RESULT(yes) Xelse X AC_MSG_RESULT(no) Xfi XAC_SUBST(LN_S)dnl X]) X Xdefine(AC_RSH, X[errprint(__file__:__line__: [$0] has been removed; replace it with equivalent code X)m4exit(4)]) X X Xdnl ### Checks for header files X X XAC_DEFUN(AC_HEADER_STDC, X[AC_REQUIRE_CPP()dnl XAC_CACHE_CHECK(for ANSI C header files, ac_cv_header_stdc, X[AC_TRY_CPP([#include X#include X#include X#include ], ac_cv_header_stdc=yes, ac_cv_header_stdc=no) X Xif test $ac_cv_header_stdc = yes; then X # SunOS 4.x string.h does not declare mem*, contrary to ANSI. XAC_EGREP_HEADER(memchr, string.h, , ac_cv_header_stdc=no) Xfi X Xif test $ac_cv_header_stdc = yes; then X # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. XAC_EGREP_HEADER(free, stdlib.h, , ac_cv_header_stdc=no) Xfi X Xif test $ac_cv_header_stdc = yes; then X # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. XAC_TRY_RUN([#include X#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') X#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) X#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) Xint main () { int i; for (i = 0; i < 256; i++) Xif (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); Xexit (0); } X], , ac_cv_header_stdc=no, :) Xfi]) Xif test $ac_cv_header_stdc = yes; then X AC_DEFINE(STDC_HEADERS) X AC_DEFINE(HAVE_STDARG_H) X AC_DEFINE(HAVE_STDLIB_H) X AC_DEFINE(HAVE_STRING_H) X AC_DEFINE(HAVE_FLOAT_H) Xfi X]) X XAC_DEFUN(AC_UNISTD_H, X[AC_OBSOLETE([$0], [; instead use AC_CHECK_HEADERS(unistd.h)])dnl XAC_CHECK_HEADER(unistd.h, AC_DEFINE(HAVE_UNISTD_H))]) X XAC_DEFUN(AC_USG, X[AC_OBSOLETE([$0], X [; instead use AC_CHECK_HEADERS(string.h) and HAVE_STRING_H])dnl XAC_MSG_CHECKING([for BSD string and memory functions]) XAC_TRY_LINK([#include ], [rindex(0, 0); bzero(0, 0);], X [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no); AC_DEFINE(USG)])]) X X Xdnl If memchr and the like aren't declared in , include . Xdnl To avoid problems, don't check for gcc2 built-ins. XAC_DEFUN(AC_MEMORY_H, X[AC_OBSOLETE([$0], [; instead use AC_CHECK_HEADERS(memory.h) and HAVE_MEMORY_H])dnl XAC_MSG_CHECKING(whether string.h declares mem functions) XAC_EGREP_HEADER(memchr, string.h, ac_found=yes, ac_found=no) XAC_MSG_RESULT($ac_found) Xif test $ac_found = no; then X AC_CHECK_HEADER(memory.h, [AC_DEFINE(NEED_MEMORY_H)]) Xfi X]) X XAC_DEFUN(AC_HEADER_MAJOR, X[AC_CACHE_CHECK(whether sys/types.h defines makedev, X ac_cv_header_sys_types_h_makedev, X[AC_TRY_LINK([#include ], [return makedev(0, 0);], X ac_cv_header_sys_types_h_makedev=yes, ac_cv_header_sys_types_h_makedev=no) X]) X Xif test $ac_cv_header_sys_types_h_makedev = no; then XAC_CHECK_HEADER(sys/mkdev.h, [AC_DEFINE(MAJOR_IN_MKDEV)]) X X if test $ac_cv_header_sys_mkdev_h = no; then XAC_CHECK_HEADER(sys/sysmacros.h, [AC_DEFINE(MAJOR_IN_SYSMACROS)]) X fi Xfi X]) X XAC_DEFUN(AC_HEADER_DIRENT, X[ac_header_dirent=no XAC_CHECK_HEADERS_DIRENT(dirent.h sys/ndir.h sys/dir.h ndir.h, X [ac_header_dirent=$ac_hdr; break]) X# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. Xif test $ac_header_dirent = dirent.h; then XAC_CHECK_LIB(c, opendir, :, X [AC_CHECK_LIB(dir, opendir, LIBS="$LIBS -ldir")]) Xelse XAC_CHECK_LIB(c, opendir, :, X [AC_CHECK_LIB(x, opendir, LIBS="$LIBS -lx")]) Xfi X]) X Xdnl Like AC_CHECK_HEADER, except also make sure that HEADER-FILE Xdnl defines the type `DIR'. dirent.h on NextStep 3.2 doesn't. Xdnl AC_CHECK_HEADER_DIRENT(HEADER-FILE, ACTION-IF-FOUND) XAC_DEFUN(AC_CHECK_HEADER_DIRENT, X[ac_safe=`echo "$1" | sed 'y%./+-%__p_%'` XAC_MSG_CHECKING([for $1 that defines DIR]) XAC_CACHE_VAL(ac_cv_header_dirent_$ac_safe, X[AC_TRY_COMPILE([#include X#include <$1>], [DIR *dirp = 0;], X eval "ac_cv_header_dirent_$ac_safe=yes", X eval "ac_cv_header_dirent_$ac_safe=no")])dnl Xif eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then X AC_MSG_RESULT(yes) X $2 Xelse X AC_MSG_RESULT(no) Xfi X]) X Xdnl Like AC_CHECK_HEADERS, except succeed only for a HEADER-FILE that Xdnl defines `DIR'. Xdnl AC_CHECK_HEADERS_DIRENT(HEADER-FILE... [, ACTION]) Xdefine(AC_CHECK_HEADERS_DIRENT, X[for ac_hdr in $1 Xdo XAC_CHECK_HEADER_DIRENT($ac_hdr, X[changequote(, )dnl X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` Xchangequote([, ])dnl X AC_DEFINE_UNQUOTED($ac_tr_hdr) $2])dnl Xdone]) X XAC_DEFUN(AC_DIR_HEADER, X[AC_OBSOLETE([$0], [; instead use AC_HEADER_DIRENT])dnl Xac_header_dirent=no Xfor ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do X AC_CHECK_HEADER_DIRENT($ac_hdr, [ac_header_dirent=$ac_hdr; break]) Xdone X Xcase "$ac_header_dirent" in Xdirent.h) AC_DEFINE(DIRENT) ;; Xsys/ndir.h) AC_DEFINE(SYSNDIR) ;; Xsys/dir.h) AC_DEFINE(SYSDIR) ;; Xndir.h) AC_DEFINE(NDIR) ;; Xesac X XAC_CACHE_CHECK(whether closedir returns void, ac_cv_func_closedir_void, X[AC_TRY_RUN([#include X#include <$ac_header_dirent> Xint closedir(); main() { exit(closedir(opendir(".")) != 0); }], X ac_cv_func_closedir_void=no, ac_cv_func_closedir_void=yes, ac_cv_func_closedir_void=yes)]) Xif test $ac_cv_func_closedir_void = yes; then X AC_DEFINE(VOID_CLOSEDIR) Xfi X]) X XAC_DEFUN(AC_HEADER_STAT, X[AC_CACHE_CHECK(whether stat file-mode macros are broken, X ac_cv_header_stat_broken, X[AC_EGREP_CPP([You lose], [#include X#include X X#if defined(S_ISBLK) && defined(S_IFDIR) X# if S_ISBLK (S_IFDIR) XYou lose. X# endif X#endif X X#if defined(S_ISBLK) && defined(S_IFCHR) X# if S_ISBLK (S_IFCHR) XYou lose. X# endif X#endif X X#if defined(S_ISLNK) && defined(S_IFREG) X# if S_ISLNK (S_IFREG) XYou lose. X# endif X#endif X X#if defined(S_ISSOCK) && defined(S_IFREG) X# if S_ISSOCK (S_IFREG) XYou lose. X# endif X#endif X], ac_cv_header_stat_broken=yes, ac_cv_header_stat_broken=no)]) Xif test $ac_cv_header_stat_broken = yes; then X AC_DEFINE(STAT_MACROS_BROKEN) Xfi X]) X XAC_DEFUN(AC_DECL_SYS_SIGLIST, X[AC_CACHE_CHECK([for sys_siglist declaration in signal.h or unistd.h], X ac_cv_decl_sys_siglist, X[AC_TRY_COMPILE([#include X#include X/* NetBSD declares sys_siglist in unistd.h. */ X#ifdef HAVE_UNISTD_H X#include X#endif], [char *msg = *(sys_siglist + 1);], X ac_cv_decl_sys_siglist=yes, ac_cv_decl_sys_siglist=no)]) Xif test $ac_cv_decl_sys_siglist = yes; then X AC_DEFINE(SYS_SIGLIST_DECLARED) Xfi X]) X XAC_DEFUN(AC_HEADER_SYS_WAIT, X[AC_CACHE_CHECK([for sys/wait.h that is POSIX.1 compatible], X ac_cv_header_sys_wait_h, X[AC_TRY_COMPILE([#include X#include X#ifndef WEXITSTATUS X#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) X#endif X#ifndef WIFEXITED X#define WIFEXITED(stat_val) (((stat_val) & 255) == 0) X#endif], [int s; Xwait (&s); Xs = WIFEXITED (s) ? WEXITSTATUS (s) : 1;], Xac_cv_header_sys_wait_h=yes, ac_cv_header_sys_wait_h=no)]) Xif test $ac_cv_header_sys_wait_h = yes; then X AC_DEFINE(HAVE_SYS_WAIT_H) Xfi X]) X X Xdnl ### Checks for typedefs X X XAC_DEFUN(AC_TYPE_GETGROUPS, X[AC_REQUIRE([AC_TYPE_UID_T])dnl XAC_CACHE_CHECK(type of array argument to getgroups, ac_cv_type_getgroups, X[AC_TRY_RUN( Xchangequote(<<, >>)dnl X<< X/* Thanks to Mike Rendell for this test. */ X#include X#define NGID 256 X#undef MAX X#define MAX(x, y) ((x) > (y) ? (x) : (y)) Xmain() X{ X gid_t gidset[NGID]; X int i, n; X union { gid_t gval; long lval; } val; X X val.lval = -1; X for (i = 0; i < NGID; i++) X gidset[i] = val.gval; X n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1, X gidset); X /* Exit non-zero if getgroups seems to require an array of ints. This X happens when gid_t is short but getgroups modifies an array of ints. */ X exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0); X} X>>, Xchangequote([, ])dnl X ac_cv_type_getgroups=gid_t, ac_cv_type_getgroups=int, X ac_cv_type_getgroups=cross) Xif test $ac_cv_type_getgroups = cross; then X dnl When we can't run the test program (we are cross compiling), presume X dnl that has either an accurate prototype for getgroups or none. X dnl Old systems without prototypes probably use int. X AC_EGREP_HEADER([getgroups.*int.*gid_t], unistd.h, X ac_cv_type_getgroups=gid_t, ac_cv_type_getgroups=int) Xfi]) XAC_DEFINE_UNQUOTED(GETGROUPS_T, $ac_cv_type_getgroups) X]) X XAC_DEFUN(AC_TYPE_UID_T, X[AC_CACHE_CHECK(for uid_t in sys/types.h, ac_cv_type_uid_t, X[AC_EGREP_HEADER(uid_t, sys/types.h, X ac_cv_type_uid_t=yes, ac_cv_type_uid_t=no)]) Xif test $ac_cv_type_uid_t = no; then X AC_DEFINE(uid_t, int) X AC_DEFINE(gid_t, int) Xfi X]) X XAC_DEFUN(AC_TYPE_SIZE_T, X[AC_CHECK_TYPE(size_t, unsigned)]) X XAC_DEFUN(AC_TYPE_PID_T, X[AC_CHECK_TYPE(pid_t, int)]) X XAC_DEFUN(AC_TYPE_OFF_T, X[AC_CHECK_TYPE(off_t, long)]) X XAC_DEFUN(AC_TYPE_MODE_T, X[AC_CHECK_TYPE(mode_t, int)]) X Xdnl Note that identifiers starting with SIG are reserved by ANSI C. XAC_DEFUN(AC_TYPE_SIGNAL, X[AC_CACHE_CHECK([return type of signal handlers], ac_cv_type_signal, X[AC_TRY_COMPILE([#include X#include X#ifdef signal X#undef signal X#endif X#ifdef __cplusplus Xextern "C" void (*signal (int, void (*)(int)))(int); X#else Xvoid (*signal ()) (); X#endif X], X[int i;], ac_cv_type_signal=void, ac_cv_type_signal=int)]) XAC_DEFINE_UNQUOTED(RETSIGTYPE, $ac_cv_type_signal) X]) X X Xdnl ### Checks for functions X X XAC_DEFUN(AC_FUNC_CLOSEDIR_VOID, X[AC_REQUIRE([AC_HEADER_DIRENT])dnl XAC_CACHE_CHECK(whether closedir returns void, ac_cv_func_closedir_void, X[AC_TRY_RUN([#include X#include <$ac_header_dirent> Xint closedir(); main() { exit(closedir(opendir(".")) != 0); }], X ac_cv_func_closedir_void=no, ac_cv_func_closedir_void=yes, ac_cv_func_closedir_void=yes)]) Xif test $ac_cv_func_closedir_void = yes; then X AC_DEFINE(CLOSEDIR_VOID) Xfi X]) X XAC_DEFUN(AC_FUNC_FNMATCH, X[AC_CACHE_CHECK(for working fnmatch, ac_cv_func_fnmatch_works, X# Some versions of Solaris or SCO have a broken fnmatch function. X# So we run a test program. If we are cross-compiling, take no chance. X# Thanks to John Oleynick and Franc,ois Pinard for this test. X[AC_TRY_RUN([main() { exit (fnmatch ("a*", "abc", 0) != 0); }], Xac_cv_func_fnmatch_works=yes, ac_cv_func_fnmatch_works=no, Xac_cv_func_fnmatch_works=no)]) Xif test $ac_cv_func_fnmatch_works = yes; then X AC_DEFINE(HAVE_FNMATCH) Xfi X]) X XAC_DEFUN(AC_FUNC_MMAP, X[AC_CHECK_HEADERS(unistd.h) XAC_CHECK_FUNCS(getpagesize) XAC_CACHE_CHECK(for working mmap, ac_cv_func_mmap_fixed_mapped, X[AC_TRY_RUN([ X/* Thanks to Mike Haertel and Jim Avera for this test. X Here is a matrix of mmap possibilities: X mmap private not fixed X mmap private fixed at somewhere currently unmapped X mmap private fixed at somewhere already mapped X mmap shared not fixed X mmap shared fixed at somewhere currently unmapped X mmap shared fixed at somewhere already mapped X For private mappings, we should verify that changes cannot be read() X back from the file, nor mmap's back from the file at a different X address. (There have been systems where private was not correctly X implemented like the infamous i386 svr4.0, and systems where the X VM page cache was not coherent with the filesystem buffer cache X like early versions of FreeBSD and possibly contemporary NetBSD.) X For shared mappings, we should conversely verify that changes get X propogated back to all the places they're supposed to be. X X Grep wants private fixed already mapped. X The main things grep needs to know about mmap are: X * does it exist and is it safe to write into the mmap'd area X * how to use it (BSD variants) */ X#include X#include X#include X X/* This mess was copied from the GNU getpagesize.h. */ X#ifndef HAVE_GETPAGESIZE X# ifdef HAVE_UNISTD_H X# include X# endif X X/* Assume that all systems that can run configure have sys/param.h. */ X# ifndef HAVE_SYS_PARAM_H X# define HAVE_SYS_PARAM_H 1 X# endif X X# ifdef _SC_PAGESIZE X# define getpagesize() sysconf(_SC_PAGESIZE) X# else /* no _SC_PAGESIZE */ X# ifdef HAVE_SYS_PARAM_H X# include X# ifdef EXEC_PAGESIZE X# define getpagesize() EXEC_PAGESIZE X# else /* no EXEC_PAGESIZE */ X# ifdef NBPG X# define getpagesize() NBPG * CLSIZE X# ifndef CLSIZE X# define CLSIZE 1 X# endif /* no CLSIZE */ X# else /* no NBPG */ X# ifdef NBPC X# define getpagesize() NBPC X# else /* no NBPC */ X# ifdef PAGESIZE X# define getpagesize() PAGESIZE X# endif /* PAGESIZE */ X# endif /* no NBPC */ X# endif /* no NBPG */ X# endif /* no EXEC_PAGESIZE */ X# else /* no HAVE_SYS_PARAM_H */ X# define getpagesize() 8192 /* punt totally */ X# endif /* no HAVE_SYS_PARAM_H */ X# endif /* no _SC_PAGESIZE */ X X#endif /* no HAVE_GETPAGESIZE */ X X#ifdef __cplusplus Xextern "C" { void *malloc(unsigned); } X#else Xchar *malloc(); X#endif X Xint Xmain() X{ X char *data, *data2, *data3; X int i, pagesize; X int fd; X X pagesize = getpagesize(); X X /* X * First, make a file with some known garbage in it. X */ X data = malloc(pagesize); X if (!data) X exit(1); X for (i = 0; i < pagesize; ++i) X *(data + i) = rand(); X umask(0); X fd = creat("conftestmmap", 0600); X if (fd < 0) X exit(1); X if (write(fd, data, pagesize) != pagesize) X exit(1); X close(fd); X X /* X * Next, try to mmap the file at a fixed address which X * already has something else allocated at it. If we can, X * also make sure that we see the same garbage. X */ X fd = open("conftestmmap", O_RDWR); X if (fd < 0) X exit(1); X data2 = malloc(2 * pagesize); X if (!data2) X exit(1); X data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1); X if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE, X MAP_PRIVATE | MAP_FIXED, fd, 0L)) X exit(1); X for (i = 0; i < pagesize; ++i) X if (*(data + i) != *(data2 + i)) X exit(1); X X /* X * Finally, make sure that changes to the mapped area X * do not percolate back to the file as seen by read(). X * (This is a bug on some variants of i386 svr4.0.) X */ X for (i = 0; i < pagesize; ++i) X *(data2 + i) = *(data2 + i) + 1; X data3 = malloc(pagesize); X if (!data3) X exit(1); X if (read(fd, data3, pagesize) != pagesize) X exit(1); X for (i = 0; i < pagesize; ++i) X if (*(data + i) != *(data3 + i)) X exit(1); X close(fd); X unlink("conftestmmap"); X exit(0); X} X], ac_cv_func_mmap_fixed_mapped=yes, ac_cv_func_mmap_fixed_mapped=no, Xac_cv_func_mmap_fixed_mapped=no)]) Xif test $ac_cv_func_mmap_fixed_mapped = yes; then X AC_DEFINE(HAVE_MMAP) Xfi X]) X XAC_DEFUN(AC_FUNC_GETPGRP, X[AC_CACHE_CHECK(whether getpgrp takes no argument, ac_cv_func_getpgrp_void, X[AC_TRY_RUN([ X/* X * If this system has a BSD-style getpgrp(), X * which takes a pid argument, exit unsuccessfully. X * X * Snarfed from Chet Ramey's bash pgrp.c test program X */ X#include X#include X Xint pid; Xint pg1, pg2, pg3, pg4; Xint ng, np, s, child; X Xmain() X{ X pid = getpid(); X pg1 = getpgrp(0); X pg2 = getpgrp(); X pg3 = getpgrp(pid); X pg4 = getpgrp(1); X X /* X * If all of these values are the same, it's pretty sure that X * we're on a system that ignores getpgrp's first argument. X */ X if (pg2 == pg4 && pg1 == pg3 && pg2 == pg3) X exit(0); X X child = fork(); X if (child < 0) X exit(1); X else if (child == 0) { X np = getpid(); X /* X * If this is Sys V, this will not work; pgrp will be X * set to np because setpgrp just changes a pgrp to be X * the same as the pid. X */ X setpgrp(np, pg1); X ng = getpgrp(0); /* Same result for Sys V and BSD */ X if (ng == pg1) { X exit(1); X } else { X exit(0); X } X } else { X wait(&s); X exit(s>>8); X } X} X], ac_cv_func_getpgrp_void=yes, ac_cv_func_getpgrp_void=no, X AC_MSG_ERROR(cannot check getpgrp if cross compiling)) X]) Xif test $ac_cv_func_getpgrp_void = yes; then X AC_DEFINE(GETPGRP_VOID) Xfi X]) X XAC_DEFUN(AC_FUNC_SETPGRP, X[AC_CACHE_CHECK(whether setpgrp takes no argument, ac_cv_func_setpgrp_void, XAC_TRY_RUN([ X#ifdef HAVE_UNISTD_H X#include X#endif X X/* X * If this system has a BSD-style setpgrp, which takes arguments, exit X * successfully. X */ Xmain() X{ X if (setpgrp(1,1) == -1) X exit(0); X else X exit(1); X} X], ac_cv_func_setpgrp_void=no, ac_cv_func_setpgrp_void=yes, X AC_MSG_ERROR(cannot check setpgrp if cross compiling)) X) Xif test $ac_cv_func_setpgrp_void = yes; then X AC_DEFINE(SETPGRP_VOID) Xfi X]) X XAC_DEFUN(AC_FUNC_VPRINTF, X[AC_CHECK_FUNC(vprintf, AC_DEFINE(HAVE_VPRINTF)) Xif test "$ac_cv_func_vprintf" != yes; then XAC_CHECK_FUNC(_doprnt, AC_DEFINE(HAVE_DOPRNT)) Xfi X]) X XAC_DEFUN(AC_FUNC_VFORK, X[AC_REQUIRE([AC_TYPE_PID_T])dnl XAC_CHECK_HEADER(vfork.h, AC_DEFINE(HAVE_VFORK_H)) XAC_CACHE_CHECK(for working vfork, ac_cv_func_vfork_works, X[AC_TRY_RUN([/* Thanks to Paul Eggert for first version of this test. */ X#include X#include X#include X#ifdef HAVE_UNISTD_H X#include X#endif X#ifdef HAVE_VFORK_H X#include X#endif X#ifdef HAVE_STDLIB_H X#include X#endif X#if defined(HAVE_WAIT_H) X#include X#else X#include X#endif X/* On some sparc systems, changes by the child to local and incoming X argument registers are propagated back to the parent. X The compiler is told about this with #include , X but some compilers (e.g. gcc -O) don't grok . X Test for this by using a static variable whose address X is put into a register that is clobbered by the vfork. */ X#ifndef VMS Xstatic int X#ifdef __cplusplus Xsparc_address_test (int arg) X#else Xsparc_address_test (arg) int arg; X#endif X{ X static pid_t child; X if (!child) { X child = vfork (); X if (child < 0) { X perror ("vfork"); X _exit(2); X } X if (!child) { X arg = getpid(); X write(-1, "", 0); X _exit (arg); X } X } X return (0); X} X#endif Xint exc = 0; Xint data = 0; X Xint Xmain() { X pid_t parent = getpid (); X pid_t child; X X#ifndef VMS X sparc_address_test(0); X#endif X X child = vfork (); X X if (child == 0) { X /* Here is another test for sparc vfork register problems. X This test uses lots of local variables, at least X as many local variables as main has allocated so far X including compiler temporaries. 4 locals are enough for X gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe. X A buggy compiler should reuse the register of parent X for one of the local variables, since it will think that X parent can't possibly be used any more in this routine. X Assigning to the local variable will thus munge parent X in the parent process. */ X pid_t X p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), X p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); X /* Convince the compiler that p..p7 are live; otherwise, it might X use the same hardware register for all 8 local variables. */ X if (p != p1 || p != p2 || p != p3 || p != p4 X || p != p5 || p != p6 || p != p7) X exc = 1; X X /* On some systems (e.g. IRIX 3.3), X vfork doesn't separate parent from child file descriptors. X If the child closes a descriptor before it execs or exits, X this munges the parent's descriptor as well. X Test for this by closing stdout in the child. */ X if (exc == 0) X exc = close(fileno(stdout)) != 0; X X /* X * Check whether a modification in the data segment of the child X * is forwarded to the data segment of the parent, vfork() on Haiku X * fails to do this. We cannot use vfork() in this case as vfork() X * children usually signal things to their parent by modifying the X * data segment. X */ X data = 1; X X /* X * VMS hangs if we do not call execl() X */ X#ifdef HAVE_EXECL X /* X * On VMS, things hang unless the child calls exec() X */ X if (exc == 0) X execl("/bin/true", "true", (char *)0); X else X execl("/bin/false", "false", (char *)0); X#endif X _exit(exc); X } else { X int status; X struct stat st; X X while (wait(&status) != child) X ; X exit( X /* Was there some problem with vforking? */ X child < 0 X X /* Did the child fail? (This shouldn't happen.) */ X || status X X /* Did the vfork/compiler bug occur? */ X || parent != getpid() X X || data == 0 X X /* Did the file descriptor bug occur? */ X || fstat(fileno(stdout), &st) != 0 X ); X } X}], Xac_cv_func_vfork_works=yes, ac_cv_func_vfork_works=no, AC_CHECK_FUNC(vfork) Xac_cv_func_vfork_works=$ac_cv_func_vfork)]) Xif test $ac_cv_func_vfork_works = no; then X AC_DEFINE(vfork, fork) Xelse X AC_DEFINE(HAVE_VFORK) Xfi X]) X XAC_DEFUN(AC_FUNC_WAIT3, X[AC_CACHE_CHECK(for wait3 that fills in rusage, ac_cv_func_wait3_rusage, X[AC_TRY_RUN([#include X#include X#include X#include X/* HP-UX has wait3 but does not fill in rusage at all. */ Xmain() { X struct rusage r; X int i; X /* Use a field that we can force nonzero -- X voluntary context switches. X For systems like NeXT and OSF/1 that don't set it, X also use the system CPU time. And page faults (I/O) for Linux. */ X r.ru_nvcsw = 0; X r.ru_utime.tv_sec = 0; X r.ru_utime.tv_usec = 0; X r.ru_stime.tv_sec = 0; X r.ru_stime.tv_usec = 0; X r.ru_majflt = r.ru_minflt = 0; X switch (fork()) { X case 0: /* Child. */ X sleep(1); /* Give up the CPU. */ X for (i=200000; --i > 0;) getpid(); /* Use up some CPU time */ X _exit(0); X case -1: _exit(0); /* What can we do? */ X default: /* Parent. */ X wait3(&i, 0, &r); X sleep(2); /* Avoid "text file busy" from rm on fast HP-UX machines. */ X exit(r.ru_nvcsw == 0 && r.ru_majflt == 0 && r.ru_minflt == 0 X && r.ru_utime.tv_sec == 0 && r.ru_utime.tv_usec == 0 X && r.ru_stime.tv_sec == 0 && r.ru_stime.tv_usec == 0); X } X}], ac_cv_func_wait3_rusage=yes, ac_cv_func_wait3_rusage=no, Xac_cv_func_wait3_rusage=no)]) Xif test $ac_cv_func_wait3_rusage = yes; then X AC_DEFINE(HAVE_WAIT3) Xfi X]) X XAC_DEFUN(AC_FUNC_ALLOCA, X[AC_REQUIRE_CPP()dnl Set CPP; we run AC_EGREP_CPP conditionally. X# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works X# for constant arguments. Useless! XAC_CACHE_CHECK([for working alloca.h], ac_cv_header_alloca_h, X[AC_TRY_LINK([#include ], [char *p = alloca(2 * sizeof(int));], X ac_cv_header_alloca_h=yes, ac_cv_header_alloca_h=no)]) Xif test $ac_cv_header_alloca_h = yes; then X AC_DEFINE(HAVE_ALLOCA_H) Xfi X XAC_CACHE_CHECK([for alloca], ac_cv_func_alloca_works, X[AC_TRY_LINK([ X#ifdef __GNUC__ X# define alloca __builtin_alloca X#else X# ifdef _MSC_VER X# include X# define alloca _alloca X# else X# if HAVE_ALLOCA_H X# include X# else X# ifdef _AIX X #pragma alloca X# else X# ifndef alloca /* predefined by HP cc +Olibcalls */ Xchar *alloca (); X# endif X# endif X# endif X# endif X#endif X], [char *p = (char *) alloca(1);], X ac_cv_func_alloca_works=yes, ac_cv_func_alloca_works=no)]) Xif test $ac_cv_func_alloca_works = yes; then X AC_DEFINE(HAVE_ALLOCA) Xfi X Xif test $ac_cv_func_alloca_works = no; then X # The SVR3 libPW and SVR4 libucb both contain incompatible functions X # that cause trouble. Some versions do not even contain alloca or X # contain a buggy version. If you still want to use their alloca, X # use ar to extract alloca.o from them instead of compiling alloca.c. X ALLOCA=alloca.${ac_objext} X AC_DEFINE(C_ALLOCA) X XAC_CACHE_CHECK(whether alloca needs Cray hooks, ac_cv_os_cray, X[AC_EGREP_CPP(webecray, X[#if defined(CRAY) && ! defined(CRAY2) Xwebecray X#else Xwenotbecray X#endif X], ac_cv_os_cray=yes, ac_cv_os_cray=no)]) Xif test $ac_cv_os_cray = yes; then Xfor ac_func in _getb67 GETB67 getb67; do X AC_CHECK_FUNC($ac_func, [AC_DEFINE_UNQUOTED(CRAY_STACKSEG_END, $ac_func) X break]) Xdone Xfi X XAC_CACHE_CHECK(stack direction for C alloca, ac_cv_c_stack_direction, X[AC_TRY_RUN([find_stack_direction () X{ X static char *addr = 0; X auto char dummy; X if (addr == 0) X { X addr = &dummy; X return find_stack_direction (); X } X else X return (&dummy > addr) ? 1 : -1; X} Xmain () X{ X exit (find_stack_direction() < 0); X}], ac_cv_c_stack_direction=1, ac_cv_c_stack_direction=-1, X ac_cv_c_stack_direction=0)]) XAC_DEFINE_UNQUOTED(STACK_DIRECTION, $ac_cv_c_stack_direction) Xfi XAC_SUBST(ALLOCA)dnl X]) X XAC_DEFUN(AC_FUNC_GETLOADAVG, X[ac_have_func=no # yes means we've found a way to get the load average. X X# Some systems with -lutil have (and need) -lkvm as well, some do not. X# On Solaris, -lkvm requires nlist from -lelf, so check that first X# to get the right answer into the cache. XAC_CHECK_LIB(elf, elf_begin, LIBS="-lelf $LIBS") XAC_CHECK_LIB(kvm, kvm_open, LIBS="-lkvm $LIBS") X# Check for the 4.4BSD definition of getloadavg. XAC_CHECK_LIB(util, getloadavg, X [LIBS="-lutil $LIBS" ac_have_func=yes ac_cv_func_getloadavg_setgid=yes]) X Xif test $ac_have_func = no; then X # There is a commonly available library for RS/6000 AIX. X # Since it is not a standard part of AIX, it might be installed locally. X ac_getloadavg_LIBS="$LIBS"; LIBS="-L/usr/local/lib $LIBS" X AC_CHECK_LIB(getloadavg, getloadavg, X LIBS="-lgetloadavg $LIBS", LIBS="$ac_getloadavg_LIBS") Xfi X X# Make sure it is really in the library, if we think we found it. XAC_REPLACE_FUNCS(getloadavg) X Xif test $ac_cv_func_getloadavg = yes; then X AC_DEFINE(HAVE_GETLOADAVG) X ac_have_func=yes Xelse X # Figure out what our getloadavg.c needs. X ac_have_func=no X AC_CHECK_HEADER(sys/dg_sys_info.h, X [ac_have_func=yes; AC_DEFINE(DGUX) X AC_CHECK_LIB(dgc, dg_sys_info)]) X X # We cannot check for , because Solaris 2 does not use dwarf (it X # uses stabs), but it is still SVR4. We cannot check for because X # Irix 4.0.5F has the header but not the library. X if test $ac_have_func = no && test $ac_cv_lib_elf_elf_begin = yes; then X ac_have_func=yes; AC_DEFINE(SVR4) X fi X X if test $ac_have_func = no; then X AC_CHECK_HEADER(inq_stats/cpustats.h, X [ac_have_func=yes; AC_DEFINE(UMAX) X AC_DEFINE(UMAX4_3)]) X fi X X if test $ac_have_func = no; then X AC_CHECK_HEADER(sys/cpustats.h, X [ac_have_func=yes; AC_DEFINE(UMAX)]) X fi X X if test $ac_have_func = no; then X AC_CHECK_HEADERS(mach/mach.h) X fi X X AC_CHECK_HEADER(nlist.h, X [AC_DEFINE(NLIST_STRUCT) X AC_CACHE_CHECK([for n_un in struct nlist], ac_cv_struct_nlist_n_un, X [AC_TRY_COMPILE([#include ], X [struct nlist n; n.n_un.n_name = 0;], X ac_cv_struct_nlist_n_un=yes, ac_cv_struct_nlist_n_un=no)]) X if test $ac_cv_struct_nlist_n_un = yes; then X AC_DEFINE(NLIST_NAME_UNION) X fi X ])dnl Xfi # Do not have getloadavg in system libraries. X X# Some definitions of getloadavg require that the program be installed setgid. Xdnl FIXME Don't hardwire the path of getloadavg.c in the top-level directory. XAC_CACHE_CHECK(whether getloadavg requires setgid, X ac_cv_func_getloadavg_setgid, X[AC_EGREP_CPP([Yowza Am I SETGID yet], X[#include "$srcdir/getloadavg.c" X#ifdef LDAV_PRIVILEGED XYowza Am I SETGID yet X#endif], X ac_cv_func_getloadavg_setgid=yes, ac_cv_func_getloadavg_setgid=no)]) Xif test $ac_cv_func_getloadavg_setgid = yes; then X NEED_SETGID=true; AC_DEFINE(GETLOADAVG_PRIVILEGED) Xelse X NEED_SETGID=false Xfi XAC_SUBST(NEED_SETGID)dnl X Xif test $ac_cv_func_getloadavg_setgid = yes; then X AC_CACHE_CHECK(group of /dev/kmem, ac_cv_group_kmem, X[changequote(, )dnl X # On Solaris, /dev/kmem is a symlink. Get info on the real file. X ac_ls_output=`ls -lgL /dev/kmem 2>/dev/null` X # If we got an error (system does not support symlinks), try without -L. X test -z "$ac_ls_output" && ac_ls_output=`ls -lg /dev/kmem` X ac_cv_group_kmem=`echo $ac_ls_output \ X | sed -ne 's/[ ][ ]*/ /g; X s/^.[sSrwx-]* *[0-9]* *\([^0-9]*\) *.*/\1/; X / /s/.* //;p;'` Xchangequote([, ])dnl X]) X KMEM_GROUP=$ac_cv_group_kmem Xfi XAC_SUBST(KMEM_GROUP)dnl X]) X XAC_DEFUN(AC_FUNC_UTIME_NULL, X[AC_CACHE_CHECK(whether utime accepts a null argument, ac_cv_func_utime_null, X[rm -f conftestdata; > conftestdata X# Sequent interprets utime(file, 0) to mean use start of epoch. Wrong. XAC_TRY_RUN([#include X#include Xmain() { Xstruct stat s, t; Xexit(!(stat ("conftestdata", &s) == 0 && utime("conftestdata", (long *)0) == 0 X&& stat("conftestdata", &t) == 0 && t.st_mtime >= s.st_mtime X&& t.st_mtime - s.st_mtime < 120)); X}], ac_cv_func_utime_null=yes, ac_cv_func_utime_null=no, X ac_cv_func_utime_null=no) Xrm -f core core.* *.core]) Xif test $ac_cv_func_utime_null = yes; then X AC_DEFINE(HAVE_UTIME_NULL) Xfi X]) X XAC_DEFUN(AC_FUNC_STRCOLL, X[AC_CACHE_CHECK(for working strcoll, ac_cv_func_strcoll_works, X[AC_TRY_RUN([#include Xmain () X{ X exit (strcoll ("abc", "def") >= 0 || X strcoll ("ABC", "DEF") >= 0 || X strcoll ("123", "456") >= 0); X}], ac_cv_func_strcoll_works=yes, ac_cv_func_strcoll_works=no, Xac_cv_func_strcoll_works=no)]) Xif test $ac_cv_func_strcoll_works = yes; then X AC_DEFINE(HAVE_STRCOLL) Xfi X]) X XAC_DEFUN(AC_FUNC_SETVBUF_REVERSED, X[AC_CACHE_CHECK(whether setvbuf arguments are reversed, X ac_cv_func_setvbuf_reversed, X[AC_TRY_RUN([#include X/* If setvbuf has the reversed format, exit 0. */ Xmain () { X /* This call has the arguments reversed. X A reversed system may check and see that the address of main X is not _IOLBF, _IONBF, or _IOFBF, and return nonzero. */ X if (setvbuf(stdout, _IOLBF, (char *) main, BUFSIZ) != 0) X exit(1); X putc('\r', stdout); X exit(0); /* Non-reversed systems segv here. */ X}], ac_cv_func_setvbuf_reversed=yes, ac_cv_func_setvbuf_reversed=no) Xrm -f core core.* *.core]) Xif test $ac_cv_func_setvbuf_reversed = yes; then X AC_DEFINE(SETVBUF_REVERSED) Xfi X]) X XAC_DEFUN(AC_FUNC_GETMNTENT, X[# getmntent is in -lsun on Irix 4, -lseq on Dynix/PTX, -lgen on Unixware. XAC_CHECK_LIB(sun, getmntent, LIBS="-lsun $LIBS", X [AC_CHECK_LIB(seq, getmntent, LIBS="-lseq $LIBS", X [AC_CHECK_LIB(gen, getmntent, LIBS="-lgen $LIBS")])]) XAC_CHECK_FUNC(getmntent, [AC_DEFINE(HAVE_GETMNTENT)])]) X XAC_DEFUN(AC_FUNC_STRFTIME, X[AC_CHECK_FUNC(strftime, [AC_DEFINE(HAVE_STRFTIME)], X[# strftime is in -lintl on SCO UNIX. XAC_CHECK_LIB(intl, strftime, X[AC_DEFINE(HAVE_STRFTIME) XLIBS="-lintl $LIBS"])])]) X XAC_DEFUN(AC_FUNC_MEMCMP, X[AC_CACHE_CHECK(for 8-bit clean memcmp, ac_cv_func_memcmp_clean, X[AC_TRY_RUN([ Xmain() X{ X char c0 = 0x40, c1 = 0x80, c2 = 0x81; X exit(memcmp(&c0, &c2, 1) < 0 && memcmp(&c1, &c2, 1) < 0 ? 0 : 1); X} X], ac_cv_func_memcmp_clean=yes, ac_cv_func_memcmp_clean=no, Xac_cv_func_memcmp_clean=no)]) Xtest $ac_cv_func_memcmp_clean = no && LIBOBJS="$LIBOBJS memcmp.${ac_objext}" XAC_SUBST(LIBOBJS)dnl X]) X XAC_DEFUN(AC_FUNC_SELECT_ARGTYPES, X[AC_MSG_CHECKING([types of arguments for select()]) X AC_CACHE_VAL(ac_cv_func_select_arg234,dnl X [AC_CACHE_VAL(ac_cv_func_select_arg1,dnl X [AC_CACHE_VAL(ac_cv_func_select_arg5,dnl X [for ac_cv_func_select_arg234 in 'fd_set *' 'int *' 'void *'; do X for ac_cv_func_select_arg1 in 'int' 'size_t' 'unsigned long' 'unsigned'; do X for ac_cv_func_select_arg5 in 'struct timeval *' 'const struct timeval *'; do X AC_TRY_COMPILE(dnl X[#ifdef HAVE_SYS_TYPES_H X#include X#endif X#ifdef HAVE_SYS_TIME_H X#include X#endif X#ifdef HAVE_SYS_SELECT_H X#include X#endif X#ifdef HAVE_SYS_SOCKET_H X#include X#endif Xextern select ($ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg234,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5);],,dnl X [ac_not_found=no ; break 3],ac_not_found=yes) X done X done X done X ])dnl AC_CACHE_VAL X ])dnl AC_CACHE_VAL X ])dnl AC_CACHE_VAL X if test "$ac_not_found" = yes; then X ac_cv_func_select_arg1=int X ac_cv_func_select_arg234='int *' X ac_cv_func_select_arg5='struct timeval *' X fi X AC_MSG_RESULT([$ac_cv_func_select_arg1,$ac_cv_func_select_arg234,$ac_cv_func_select_arg5]) X AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG1,$ac_cv_func_select_arg1) X AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG234,($ac_cv_func_select_arg234)) X AC_DEFINE_UNQUOTED(SELECT_TYPE_ARG5,($ac_cv_func_select_arg5)) X]) X X Xdnl ### Checks for structure members X X XAC_DEFUN(AC_HEADER_TIME, X[AC_CACHE_CHECK([whether time.h and sys/time.h may both be included], X ac_cv_header_time, X[AC_TRY_COMPILE([#include X#include X#include ], X[struct tm *tp;], ac_cv_header_time=yes, ac_cv_header_time=no)]) Xif test $ac_cv_header_time = yes; then X AC_DEFINE(TIME_WITH_SYS_TIME) Xfi X]) X XAC_DEFUN(AC_STRUCT_TM, X[AC_CACHE_CHECK([whether struct tm is in sys/time.h or time.h], X ac_cv_struct_tm, X[AC_TRY_COMPILE([#include X#include ], X[struct tm *tp; tp->tm_sec;], X ac_cv_struct_tm=time.h, ac_cv_struct_tm=sys/time.h)]) Xif test $ac_cv_struct_tm = sys/time.h; then X AC_DEFINE(TM_IN_SYS_TIME) Xfi X]) X XAC_DEFUN(AC_STRUCT_TM_ZONE, X[AC_REQUIRE([AC_STRUCT_TM])dnl XAC_CACHE_CHECK([for tm_zone in struct tm], ac_cv_struct_tm_zone, X[AC_TRY_COMPILE([#include X#include <$ac_cv_struct_tm>], [struct tm tm; tm.tm_zone;], X ac_cv_struct_tm_zone=yes, ac_cv_struct_tm_zone=no)]) Xif test "$ac_cv_struct_tm_zone" = yes; then X AC_DEFINE(HAVE_TM_ZONE) Xelse X AC_CACHE_CHECK(for tzname, ac_cv_var_tzname, X[AC_TRY_LINK( Xchangequote(<<, >>)dnl X<<#include X#ifndef tzname /* For SGI. */ Xextern char *tzname[]; /* RS6000 and others reject char **tzname. */ X#endif>>, Xchangequote([, ])dnl X[atoi(*tzname);], ac_cv_var_tzname=yes, ac_cv_var_tzname=no)]) X if test $ac_cv_var_tzname = yes; then X AC_DEFINE(HAVE_TZNAME) X fi Xfi X]) X XAC_DEFUN(AC_STRUCT_ST_BLOCKS, X[AC_CACHE_CHECK([for st_blocks in struct stat], ac_cv_struct_st_blocks, X[AC_TRY_COMPILE([#include X#include ], [struct stat s; s.st_blocks;], Xac_cv_struct_st_blocks=yes, ac_cv_struct_st_blocks=no)]) Xif test $ac_cv_struct_st_blocks = yes; then X AC_DEFINE(HAVE_ST_BLOCKS) Xelse X LIBOBJS="$LIBOBJS fileblocks.${ac_objext}" Xfi XAC_SUBST(LIBOBJS)dnl X]) X XAC_DEFUN(AC_STRUCT_ST_BLKSIZE, X[AC_CACHE_CHECK([for st_blksize in struct stat], ac_cv_struct_st_blksize, X[AC_TRY_COMPILE([#include X#include ], [struct stat s; s.st_blksize;], Xac_cv_struct_st_blksize=yes, ac_cv_struct_st_blksize=no)]) Xif test $ac_cv_struct_st_blksize = yes; then X AC_DEFINE(HAVE_ST_BLKSIZE) Xfi X]) X XAC_DEFUN(AC_STRUCT_ST_RDEV, X[AC_CACHE_CHECK([for st_rdev in struct stat], ac_cv_struct_st_rdev, X[AC_TRY_COMPILE([#include X#include ], [struct stat s; s.st_rdev;], Xac_cv_struct_st_rdev=yes, ac_cv_struct_st_rdev=no)]) Xif test $ac_cv_struct_st_rdev = yes; then X AC_DEFINE(HAVE_ST_RDEV) Xfi X]) X X Xdnl ### Checks for compiler characteristics X X XAC_DEFUN(AC_C_CROSS, X[AC_OBSOLETE([$0], [; it has been merged into AC_PROG_CC])]) X XAC_DEFUN(AC_C_CHAR_UNSIGNED, X[AC_CACHE_CHECK(whether char is unsigned, ac_cv_c_char_unsigned, X[if test "$GCC" = yes; then X # GCC predefines this symbol on systems where it applies. XAC_EGREP_CPP(yes, X[#ifdef __CHAR_UNSIGNED__ X yes X#endif X], ac_cv_c_char_unsigned=yes, ac_cv_c_char_unsigned=no) Xelse XAC_TRY_RUN( X[/* volatile prevents gcc2 from optimizing the test away on sparcs. */ X#if !defined(__STDC__) || __STDC__ != 1 X#define volatile X#endif Xmain() { X volatile char c = 255; exit(c < 0); X}], ac_cv_c_char_unsigned=yes, ac_cv_c_char_unsigned=no) Xfi]) Xif test $ac_cv_c_char_unsigned = yes && test "$GCC" != yes; then X AC_DEFINE(__CHAR_UNSIGNED__) Xfi X]) X XAC_DEFUN(AC_C_LONG_DOUBLE, X[AC_CACHE_CHECK(for long double, ac_cv_c_long_double, X[if test "$GCC" = yes; then X ac_cv_c_long_double=yes Xelse XAC_TRY_RUN([int main() { X/* The Stardent Vistra knows sizeof(long double), but does not support it. */ Xlong double foo = 0.0; X/* On Ultrix 4.3 cc, long double is 4 and double is 8. */ Xexit(sizeof(long double) < sizeof(double)); }], Xac_cv_c_long_double=yes, ac_cv_c_long_double=no) Xfi]) Xif test $ac_cv_c_long_double = yes; then X AC_DEFINE(HAVE_LONG_DOUBLE) Xfi X]) X XAC_DEFUN(AC_INT_16_BITS, X[AC_OBSOLETE([$0], [; instead use AC_CHECK_SIZEOF(int)])dnl XAC_MSG_CHECKING(whether int is 16 bits) XAC_TRY_RUN([main() { exit(sizeof(int) != 2); }], X [AC_MSG_RESULT(yes) X AC_DEFINE(INT_16_BITS)], AC_MSG_RESULT(no)) X]) X XAC_DEFUN(AC_LONG_64_BITS, X[AC_OBSOLETE([$0], [; instead use AC_CHECK_SIZEOF(long)])dnl XAC_MSG_CHECKING(whether long int is 64 bits) XAC_TRY_RUN([main() { exit(sizeof(long int) != 8); }], X [AC_MSG_RESULT(yes) X AC_DEFINE(LONG_64_BITS)], AC_MSG_RESULT(no)) X]) X XAC_DEFUN(AC_C_BIGENDIAN, X[AC_CACHE_CHECK(whether byte ordering is bigendian, ac_cv_c_bigendian, X[ac_cv_c_bigendian=unknown X# See if sys/param.h defines the BYTE_ORDER macro. XAC_TRY_COMPILE([#include X#include ], [ X#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN X bogus endian macros X#endif], [# It does; now see whether it defined to BIG_ENDIAN or not. XAC_TRY_COMPILE([#include X#include ], [ X#if BYTE_ORDER != BIG_ENDIAN X not big endian X#endif], ac_cv_c_bigendian=yes, ac_cv_c_bigendian=no)]) Xif test $ac_cv_c_bigendian = unknown; then XAC_TRY_RUN([main () { X /* Are we little or big endian? From Harbison&Steele. */ X union X { X long l; X char c[sizeof (long)]; X } u; X u.l = 1; X exit (u.c[sizeof (long) - 1] == 1); X}], ac_cv_c_bigendian=no, ac_cv_c_bigendian=yes) Xfi]) Xif test $ac_cv_c_bigendian = yes; then X AC_DEFINE(WORDS_BIGENDIAN) Xfi X]) X Xdnl Do nothing if the compiler accepts the inline keyword. Xdnl Otherwise define inline to __inline__ or __inline if one of those work, Xdnl otherwise define inline to be empty. XAC_DEFUN(AC_C_INLINE, X[AC_CACHE_CHECK([for inline], ac_cv_c_inline, X[ac_cv_c_inline=no Xfor ac_kw in inline __inline__ __inline; do X AC_TRY_COMPILE(, [} $ac_kw foo() {], [ac_cv_c_inline=$ac_kw; break]) Xdone X]) Xcase "$ac_cv_c_inline" in X inline | yes) X AC_DEFINE(HAVE_INLINE) X ;; X no) AC_DEFINE(inline, ) X ;; X *) AC_DEFINE_UNQUOTED(inline, $ac_cv_c_inline) X AC_DEFINE(HAVE_INLINE) X ;; Xesac X]) X XAC_DEFUN(AC_C_CONST, X[dnl This message is consistent in form with the other checking messages, Xdnl and with the result message. XAC_CACHE_CHECK([for working const], ac_cv_c_const, X[AC_TRY_COMPILE(, Xchangequote(<<, >>)dnl X<< X/* Ultrix mips cc rejects this. */ Xtypedef int charset[2]; const charset x; X/* SunOS 4.1.1 cc rejects this. */ Xchar const *const *ccp; Xchar **p; X/* NEC SVR4.0.2 mips cc rejects this. */ Xstruct point {int x, y;}; Xstatic struct point const zero = {0,0}; X/* AIX XL C 1.02.0.0 rejects this. X It does not let you subtract one const X* pointer from another in an arm X of an if-expression whose if-part is not a constant expression */ Xconst char *g = "string"; Xccp = &g + (g ? g-g : 0); X/* HPUX 7.0 cc rejects these. */ X++ccp; Xp = (char**) ccp; Xccp = (char const *const *) p; X{ /* SCO 3.2v4 cc rejects this. */ X char *t; X char const *s = 0 ? (char *) 0 : (char const *) 0; X X *t++ = 0; X} X{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ X int x[] = {25, 17}; X const int *foo = &x[0]; X ++foo; X} X{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ X typedef const int *iptr; X iptr p = 0; X ++p; X} X{ /* AIX XL C 1.02.0.0 rejects this saying X "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ X struct s { int j; const int *ap[3]; }; X struct s *b; b->j = 5; X} X{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ X const int foo = 10; X} X>>, Xchangequote([, ])dnl Xac_cv_c_const=yes, ac_cv_c_const=no)]) Xif test $ac_cv_c_const = no; then X AC_DEFINE(const, ) Xfi X]) X XAC_DEFUN(AC_C_STRINGIZE, [ XAC_REQUIRE([AC_PROG_CPP]) XAC_MSG_CHECKING([for preprocessor stringizing operator]) XAC_CACHE_VAL(ac_cv_c_stringize, XAC_EGREP_CPP([#teststring],[ X#define x(y) #y X Xchar *s = x(teststring); X], ac_cv_c_stringize=no, ac_cv_c_stringize=yes)) Xif test "${ac_cv_c_stringize}" = yes Xthen X AC_DEFINE(HAVE_STRINGIZE) Xfi XAC_MSG_RESULT([${ac_cv_c_stringize}]) X])dnl X Xdefine(AC_ARG_ARRAY, X[errprint(__file__:__line__: [$0] has been removed; don't do unportable things with arguments X)m4exit(4)]) X Xdnl Check the object extension used by the compiler: typically .o or Xdnl .obj. If this is called, some other behaviour will change, Xdnl determined by ac_objext. XAC_DEFUN(AC_OBJEXT, X[AC_MSG_CHECKING([for object suffix]) XAC_CACHE_VAL(ac_cv_objext, X[rm -rf conftest* Xecho 'int i = 1;' > conftest.$ac_ext Xif AC_TRY_EVAL(ac_compile); then X for ac_file in conftest.*; do X case $ac_file in X *.c) ;; X *.dSYM) ;; # Ignore strange directory found on Mac OS X with cc -g X *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;; X esac X done Xelse X AC_MSG_ERROR([installation or configuration problem; compiler does not work]) Xfi Xrm -rf conftest*]) XAC_MSG_RESULT($ac_cv_objext) XOBJEXT=$ac_cv_objext Xac_objext=$ac_cv_objext XAC_SUBST(OBJEXT)]) X Xdnl Determine the linker flags (e.g. `-L' and `-l') for the Fortran 77 Xdnl intrinsic and run-time libraries that are required to successfully Xdnl link a Fortran 77 program or shared library. The output variable Xdnl FLIBS is set to these flags. Xdnl Xdnl This macro is intended to be used in those situations when it is Xdnl necessary to mix, e.g. C++ and Fortran 77, source code into a single Xdnl program or shared library. Xdnl Xdnl For example, if object files from a C++ and Fortran 77 compiler must Xdnl be linked together, then the C++ compiler/linker must be used for Xdnl linking (since special C++-ish things need to happen at link time Xdnl like calling global constructors, instantiating templates, enabling Xdnl exception support, etc.). Xdnl Xdnl However, the Fortran 77 intrinsic and run-time libraries must be Xdnl linked in as well, but the C++ compiler/linker doesn't know how to Xdnl add these Fortran 77 libraries. Hence, the macro Xdnl `AC_F77_LIBRARY_LDFLAGS' was created to determine these Fortran 77 Xdnl libraries. Xdnl Xdnl This macro was packaged in its current form by Matthew D. Langston Xdnl . However, nearly all of this macro Xdnl came from the `OCTAVE_FLIBS' macro in `octave-2.0.13/aclocal.m4', Xdnl and full credit should go to John W. Eaton for writing this Xdnl extremely useful macro. Thank you John. Xdnl Xdnl AC_F77_LIBRARY_LDFLAGS() XAC_DEFUN(AC_F77_LIBRARY_LDFLAGS, X[AC_MSG_CHECKING([for Fortran 77 libraries]) XAC_REQUIRE([AC_PROG_F77]) XAC_REQUIRE([AC_CANONICAL_HOST]) XAC_CACHE_VAL(ac_cv_flibs, X[changequote(, )dnl Xdnl Write a minimal program and compile it with -v. I don't know what Xdnl to do if your compiler doesn't have -v... Xecho " END" > conftest.f Xfoutput=`${F77} -v -o conftest conftest.f 2>&1` Xdnl Xdnl The easiest thing to do for xlf output is to replace all the commas Xdnl with spaces. Try to only do that if the output is really from xlf, Xdnl since doing that causes problems on other systems. Xdnl Xxlf_p=`echo $foutput | grep xlfentry` Xif test -n "$xlf_p"; then X foutput=`echo $foutput | sed 's/,/ /g'` Xfi Xdnl Xld_run_path=`echo $foutput | \ X sed -n -e 's/^.*LD_RUN_PATH *= *\([^ ]*\).*/\1/p'` Xdnl Xdnl We are only supposed to find this on Solaris systems... Xdnl Uh, the run path should be absolute, shouldn't it? Xdnl Xcase "$ld_run_path" in X /*) X if test "$ac_cv_prog_gcc" = yes; then X ld_run_path="-Xlinker -R -Xlinker $ld_run_path" X else X ld_run_path="-R $ld_run_path" X fi X ;; X *) X ld_run_path= X ;; Xesac Xdnl Xflibs= Xlflags= Xdnl Xdnl If want_arg is set, we know we want the arg to be added to the list, Xdnl so we don't have to examine it. Xdnl Xwant_arg= Xdnl Xfor arg in $foutput; do X old_want_arg=$want_arg X want_arg= Xdnl Xdnl None of the options that take arguments expect the argument to Xdnl start with a -, so pretend we didn't see anything special. Xdnl X if test -n "$old_want_arg"; then X case "$arg" in X -*) X old_want_arg= X ;; X esac X fi X case "$old_want_arg" in X '') X case $arg in X /*.a) X exists=false X for f in $lflags; do X if test x$arg = x$f; then X exists=true X fi X done X if $exists; then X arg= X else X lflags="$lflags $arg" X fi X ;; X -bI:*) X exists=false X for f in $lflags; do X if test x$arg = x$f; then X exists=true X fi X done X if $exists; then X arg= X else X if test "$ac_cv_prog_gcc" = yes; then X lflags="$lflags -Xlinker $arg" X else X lflags="$lflags $arg" X fi X fi X ;; X -lang* | -lcrt0.o | -lc | -lgcc) X arg= X ;; X -[lLR]) X want_arg=$arg X arg= X ;; X -[lLR]*) X exists=false X for f in $lflags; do X if test x$arg = x$f; then X exists=true X fi X done X if $exists; then X arg= X else X case "$arg" in X -lkernel32) X case "$canonical_host_type" in X *-*-cygwin*) X arg= X ;; X *) X lflags="$lflags $arg" X ;; X esac X ;; X -lm) X ;; X *) X lflags="$lflags $arg" X ;; X esac X fi X ;; X -u) X want_arg=$arg X arg= X ;; X -Y) X want_arg=$arg X arg= X ;; X *) X arg= X ;; X esac X ;; X -[lLR]) X arg="$old_want_arg $arg" X ;; X -u) X arg="-u $arg" X ;; X -Y) Xdnl Xdnl Should probably try to ensure unique directory options here too. Xdnl This probably only applies to Solaris systems, and then will only Xdnl work with gcc... Xdnl X arg=`echo $arg | sed -e 's%^P,%%'` X SAVE_IFS=$IFS X IFS=: X list= X for elt in $arg; do X list="$list -L$elt" X done X IFS=$SAVE_IFS X arg="$list" X ;; X esac Xdnl X if test -n "$arg"; then X flibs="$flibs $arg" X fi Xdone Xif test -n "$ld_run_path"; then X flibs_result="$ld_run_path $flibs" Xelse X flibs_result="$flibs" Xfi Xchangequote([, ])dnl Xac_cv_flibs="$flibs_result"]) XFLIBS="$ac_cv_flibs" XAC_SUBST(FLIBS)dnl XAC_MSG_RESULT($FLIBS) X]) X X Xdnl ### Checks for operating system services X X XAC_DEFUN(AC_SYS_INTERPRETER, X[# Pull the hash mark out of the macro call to avoid m4 problems. Xac_msg="whether #! works in shell scripts" XAC_CACHE_CHECK($ac_msg, ac_cv_sys_interpreter, X[echo '#! /bin/cat Xexit 69 X' > conftest Xchmod u+x conftest X(SHELL=/bin/sh; export SHELL; ./conftest >/dev/null) Xif test $? -ne 69; then X ac_cv_sys_interpreter=yes Xelse X ac_cv_sys_interpreter=no Xfi Xrm -f conftest]) Xinterpval="$ac_cv_sys_interpreter" X]) X Xdefine(AC_HAVE_POUNDBANG, X[errprint(__file__:__line__: [$0 has been replaced by AC_SYS_INTERPRETER, taking no arguments X])m4exit(4)]) X XAC_DEFUN(AC_SYS_LONG_FILE_NAMES, X[AC_CACHE_CHECK(for long file names, ac_cv_sys_long_file_names, X[ac_cv_sys_long_file_names=yes X# Test for long file names in all the places we know might matter: X# . the current directory, where building will happen X# $prefix/lib where we will be installing things X# $exec_prefix/lib likewise X# eval it to expand exec_prefix. X# $TMPDIR if set, where it might want to write temporary files X# if $TMPDIR is not set: X# /tmp where it might want to write temporary files X# /var/tmp likewise X# /usr/tmp likewise Xif test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then X ac_tmpdirs="$TMPDIR" Xelse X ac_tmpdirs='/tmp /var/tmp /usr/tmp' Xfi Xfor ac_dir in . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do X test -d $ac_dir || continue X test -w $ac_dir || continue # It is less confusing to not echo anything here. X (echo 1 > $ac_dir/conftest9012345) 2>/dev/null X (echo 2 > $ac_dir/conftest9012346) 2>/dev/null X val=`cat $ac_dir/conftest9012345 2>/dev/null` X if test ! -f $ac_dir/conftest9012345 || test "$val" != 1; then X ac_cv_sys_long_file_names=no X rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null X break X fi X rm -f $ac_dir/conftest9012345 $ac_dir/conftest9012346 2>/dev/null Xdone]) Xif test $ac_cv_sys_long_file_names = yes; then X AC_DEFINE(HAVE_LONG_FILE_NAMES) Xfi X]) X XAC_DEFUN(AC_SYS_RESTARTABLE_SYSCALLS, X[AC_CACHE_CHECK(for restartable system calls, ac_cv_sys_restartable_syscalls, X[AC_TRY_RUN( X[/* Exit 0 (true) if wait returns something other than -1, X i.e. the pid of the child, which means that wait was restarted X after getting the signal. */ X#include X#include Xucatch (isig) { } Xmain () { X int i = fork (), status; X if (i == 0) { sleep (3); kill (getppid (), SIGINT); sleep (3); exit (0); } X signal (SIGINT, ucatch); X status = wait(&i); X if (status == -1) wait(&i); X exit (status == -1); X} X], ac_cv_sys_restartable_syscalls=yes, ac_cv_sys_restartable_syscalls=no)]) Xif test $ac_cv_sys_restartable_syscalls = yes; then X AC_DEFINE(HAVE_RESTARTABLE_SYSCALLS) Xfi X]) X XAC_DEFUN(AC_PATH_X, X[AC_REQUIRE_CPP()dnl Set CPP; we run AC_PATH_X_DIRECT conditionally. X# If we find X, set shell vars x_includes and x_libraries to the X# paths, otherwise set no_x=yes. X# Uses ac_ vars as temps to allow command line to override cache and checks. X# --without-x overrides everything else, but does not touch the cache. XAC_MSG_CHECKING(for X) X XAC_ARG_WITH(x, [ --with-x use the X Window System]) X# $have_x is `yes', `no', `disabled', or empty when we do not yet know. Xif test "x$with_x" = xno; then X # The user explicitly disabled X. X have_x=disabled Xelse X if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then X # Both variables are already set. X have_x=yes X else XAC_CACHE_VAL(ac_cv_have_x, X[# One or both of the vars are not set, and there is no cached value. Xac_x_includes=NO ac_x_libraries=NO XAC_PATH_X_XMKMF XAC_PATH_X_DIRECT Xif test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then X # Didn't find X anywhere. Cache the known absence of X. X ac_cv_have_x="have_x=no" Xelse X # Record where we found X for the cache. X ac_cv_have_x="have_x=yes \ X ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" Xfi])dnl X fi X eval "$ac_cv_have_x" Xfi # $with_x != no X Xif test "$have_x" != yes; then X AC_MSG_RESULT($have_x) X no_x=yes Xelse X # If each of the values was on the command line, it overrides each guess. X test "x$x_includes" = xNONE && x_includes=$ac_x_includes X test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries X # Update the cache value to reflect the command line values. X ac_cv_have_x="have_x=yes \ X ac_x_includes=$x_includes ac_x_libraries=$x_libraries" X AC_MSG_RESULT([libraries $x_libraries, headers $x_includes]) Xfi X]) X Xdnl Internal subroutine of AC_PATH_X. Xdnl Set ac_x_includes and/or ac_x_libraries. XAC_DEFUN(AC_PATH_X_XMKMF, X[rm -fr conftestdir Xif mkdir conftestdir; then X cd conftestdir X # Make sure to not put "make" in the Imakefile rules, since we grep it out. X cat > Imakefile <<'EOF' Xacfindx: X @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"' XEOF X if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then X # GNU make sometimes prints "make[1]: Entering...", which would confuse us. X eval `${MAKE-make} acfindx 2>/dev/null | grep -v make` X # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. X for ac_extension in a so sl; do X if test ! -f $ac_im_usrlibdir/libX11.$ac_extension && X test -f $ac_im_libdir/libX11.$ac_extension; then X ac_im_usrlibdir=$ac_im_libdir; break X fi X done X # Screen out bogus values from the imake configuration. They are X # bogus both because they are the default anyway, and because X # using them would break gcc on systems where it needs fixed includes. X case "$ac_im_incroot" in X /usr/include) ;; X *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;; X esac X case "$ac_im_usrlibdir" in X /usr/lib | /lib) ;; X *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;; X esac X fi X cd .. X rm -fr conftestdir Xfi X]) X Xdnl Internal subroutine of AC_PATH_X. Xdnl Set ac_x_includes and/or ac_x_libraries. XAC_DEFUN(AC_PATH_X_DIRECT, X[if test "$ac_x_includes" = NO; then X # Guess where to find include files, by looking for this one X11 .h file. X test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h X X # First, try using that file with no special directory specified. XAC_TRY_CPP([#include <$x_direct_test_include>], X[# We can compile using X headers with no special include directory. Xac_x_includes=], X[# Look for the header file in a standard set of common directories. X# Check X11 before X11Rn because it is often a symlink to the current release. X for ac_dir in \ X /usr/X11/include \ X /usr/X11R6/include \ X /usr/X11R5/include \ X /usr/X11R4/include \ X \ X /usr/include/X11 \ X /usr/include/X11R6 \ X /usr/include/X11R5 \ X /usr/include/X11R4 \ X \ X /usr/local/X11/include \ X /usr/local/X11R6/include \ X /usr/local/X11R5/include \ X /usr/local/X11R4/include \ X \ X /usr/local/include/X11 \ X /usr/local/include/X11R6 \ X /usr/local/include/X11R5 \ X /usr/local/include/X11R4 \ X \ X /usr/X386/include \ X /usr/x386/include \ X /usr/XFree86/include/X11 \ X \ X /usr/include \ X /usr/local/include \ X /usr/unsupported/include \ X /usr/athena/include \ X /usr/local/x11r5/include \ X /usr/lpp/Xamples/include \ X \ X /usr/openwin/include \ X /usr/openwin/share/include \ X ; \ X do X if test -r "$ac_dir/$x_direct_test_include"; then X ac_x_includes=$ac_dir X break X fi X done]) Xfi # $ac_x_includes = NO X Xif test "$ac_x_libraries" = NO; then X # Check for the libraries. X X test -z "$x_direct_test_library" && x_direct_test_library=Xt X test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc X X # See if we find them without any special options. X # Don't add to $LIBS permanently. X ac_save_LIBS="$LIBS" X LIBS="-l$x_direct_test_library $LIBS" XAC_TRY_LINK(, [${x_direct_test_function}()], X[LIBS="$ac_save_LIBS" X# We can link X programs with no special library path. Xac_x_libraries=], X[LIBS="$ac_save_LIBS" X# First see if replacing the include by lib works. X# Check X11 before X11Rn because it is often a symlink to the current release. Xfor ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \ X /usr/X11/lib \ X /usr/X11R6/lib \ X /usr/X11R5/lib \ X /usr/X11R4/lib \ X \ X /usr/lib/X11 \ X /usr/lib/X11R6 \ X /usr/lib/X11R5 \ X /usr/lib/X11R4 \ X \ X /usr/local/X11/lib \ X /usr/local/X11R6/lib \ X /usr/local/X11R5/lib \ X /usr/local/X11R4/lib \ X \ X /usr/local/lib/X11 \ X /usr/local/lib/X11R6 \ X /usr/local/lib/X11R5 \ X /usr/local/lib/X11R4 \ X \ X /usr/X386/lib \ X /usr/x386/lib \ X /usr/XFree86/lib/X11 \ X \ X /usr/lib \ X /usr/local/lib \ X /usr/unsupported/lib \ X /usr/athena/lib \ X /usr/local/x11r5/lib \ X /usr/lpp/Xamples/lib \ X /lib/usr/lib/X11 \ X \ X /usr/openwin/lib \ X /usr/openwin/share/lib \ X ; \ Xdo Xdnl Don't even attempt the hair of trying to link an X program! X for ac_extension in a so sl; do X if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then X ac_x_libraries=$ac_dir X break 2 X fi X done Xdone]) Xfi # $ac_x_libraries = NO X]) X Xdnl Find additional X libraries, magic flags, etc. XAC_DEFUN(AC_PATH_XTRA, X[AC_REQUIRE([AC_PATH_X])dnl Xif test "$no_x" = yes; then X # Not all programs may use this symbol, but it does not hurt to define it. X AC_DEFINE(X_DISPLAY_MISSING) X X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= Xelse X if test -n "$x_includes"; then X X_CFLAGS="$X_CFLAGS -I$x_includes" X fi X X # It would also be nice to do this for all -L options, not just this one. X if test -n "$x_libraries"; then X X_LIBS="$X_LIBS -L$x_libraries" Xdnl FIXME banish uname from this macro! X # For Solaris; some versions of Sun CC require a space after -R and X # others require no space. Words are not sufficient . . . . X case "`(uname -sr) 2>/dev/null`" in X "SunOS 5"*) X AC_MSG_CHECKING(whether -R must be followed by a space) X ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries" X AC_TRY_LINK(, , ac_R_nospace=yes, ac_R_nospace=no) X if test $ac_R_nospace = yes; then X AC_MSG_RESULT(no) X X_LIBS="$X_LIBS -R$x_libraries" X else X LIBS="$ac_xsave_LIBS -R $x_libraries" X AC_TRY_LINK(, , ac_R_space=yes, ac_R_space=no) X if test $ac_R_space = yes; then X AC_MSG_RESULT(yes) X X_LIBS="$X_LIBS -R $x_libraries" X else X AC_MSG_RESULT(neither works) X fi X fi X LIBS="$ac_xsave_LIBS" X esac X fi X X # Check for system-dependent libraries X programs must link with. X # Do this before checking for the system-independent R6 libraries X # (-lICE), since we may need -lsocket or whatever for X linking. X X if test "$ISC" = yes; then X X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" X else X # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X X # libraries were built with DECnet support. And karl@cs.umb.edu says X # the Alpha needs dnet_stub (dnet does not exist). X AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"]) X if test $ac_cv_lib_dnet_dnet_ntoa = no; then X AC_CHECK_LIB(dnet_stub, dnet_ntoa, X [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"]) X fi X X # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, X # to get the SysV transport functions. X # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4) X # needs -lnsl. X # The nsl library prevents programs from opening the X display X # on Irix 5.2, according to dickey@clark.net. X AC_CHECK_FUNC(gethostbyname) X if test $ac_cv_func_gethostbyname = no; then X AC_CHECK_LIB(nsl, gethostbyname, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl") X fi X X # lieder@skyler.mavd.honeywell.com says without -lsocket, X # socket/setsockopt and other routines are undefined under SCO ODT X # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary X # on later versions), says simon@lia.di.epfl.ch: it contains X # gethostby* variants that don't use the nameserver (or something). X # -lsocket must be given before -lnsl if both are needed. X # We assume that if connect needs -lnsl, so does gethostbyname. X AC_CHECK_FUNC(connect) X if test $ac_cv_func_connect = no; then X AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", , X $X_EXTRA_LIBS) X fi X X # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX. X AC_CHECK_FUNC(remove) X if test $ac_cv_func_remove = no; then X AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix") X fi X X # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. X AC_CHECK_FUNC(shmat) X if test $ac_cv_func_shmat = no; then X AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc") X fi X fi X X # Check for libraries that X11R6 Xt/Xaw programs need. X ac_save_LDFLAGS="$LDFLAGS" X test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" X # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to X # check for ICE first), but we must link in the order -lSM -lICE or X # we get undefined symbols. So assume we have SM if we have ICE. X # These have to be linked with before -lX11, unlike the other X # libraries we check for below, so use a different variable. X # --interran@uluru.Stanford.EDU, kb@cs.umb.edu. X AC_CHECK_LIB(ICE, IceConnectionNumber, X [X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"], , $X_EXTRA_LIBS) X LDFLAGS="$ac_save_LDFLAGS" X Xfi XAC_SUBST(X_CFLAGS)dnl XAC_SUBST(X_PRE_LIBS)dnl XAC_SUBST(X_LIBS)dnl XAC_SUBST(X_EXTRA_LIBS)dnl X]) X Xdnl The old Cygwin32 macro is deprecated. XAC_DEFUN(AC_CYGWIN32, X[AC_OBSOLETE([$0], [; instead use AC_CYGWIN])dnl XAC_CYGWIN]) X Xdnl Check for Cygwin. This is a way to set the right value for Xdnl EXEEXT. XAC_DEFUN(AC_CYGWIN, X[AC_CACHE_CHECK(for Cygwin environment, ac_cv_cygwin, X[AC_TRY_COMPILE(,[ X#ifndef __CYGWIN__ X#define __CYGWIN__ __CYGWIN32__ X#endif Xreturn __CYGWIN__;], Xac_cv_cygwin=yes, ac_cv_cygwin=no) Xrm -rf conftest*]) XCYGWIN= Xtest "$ac_cv_cygwin" = yes && CYGWIN=yes]) X Xdnl Check for mingw32. This is another way to set the right value for Xdnl EXEEXT. XAC_DEFUN(AC_MINGW32, X[AC_CACHE_CHECK(for mingw32 environment, ac_cv_mingw32, X[AC_TRY_COMPILE(,[return __MINGW32__;], Xac_cv_mingw32=yes, ac_cv_mingw32=no) Xrm -rf conftest*]) XMINGW32= Xtest "$ac_cv_mingw32" = yes && MINGW32=yes]) X Xdnl Check for EMX/OS2. This is another way to set the right value for Xdnl EXEEXT. XAC_DEFUN(AC_EMXOS2, X[AC_CACHE_CHECK(for EMX/OS2 environment, ac_cv_emxos2, X[AC_TRY_COMPILE(,[return __EMX__;], Xac_cv_emxos2=yes, ac_cv_emxos2=no) Xrm -rf conftest*]) XAC_CACHE_VAL(ac_cv_libpre, Xif test "$ac_cv_emxos2" = yes ; then X ac_cv_libpre= Xelse X ac_cv_libpre=lib Xfi X) XEMXOS2= Xtest "$ac_cv_emxos2" = yes && EMXOS2=yes]) X Xdnl Check for the extension used for executables. This knows that we Xdnl add .exe for Cygwin or mingw32. Otherwise, it compiles a test Xdnl executable. If this is called, the executable extensions will be Xdnl automatically used by link commands run by the configure script. Xdnl Xdnl exeext -> whether prog.exe ist created instead of prog Xdnl xexeect -> whether prog.exe needs to be called instead of prog Xdnl XAC_DEFUN(AC_EXEEXT, X[AC_REQUIRE([AC_CYGWIN]) XAC_REQUIRE([AC_MINGW32]) XAC_REQUIRE([AC_EMXOS2]) XAC_MSG_CHECKING([for executable suffix]) XAC_CACHE_VAL(ac_cv_exeext, X[if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$EMXOS2" = yes; then X ac_cv_exeext=.exe X ac_cv_xexeext="" Xelse X rm -rf conftest* X echo 'int main () { return 0; }' > conftest.$ac_ext X ac_cv_exeext= X if AC_TRY_EVAL(ac_link); then X for file in conftest.*; do X case $file in X *.c | *.o | *.obj) ;; X *.dSYM) ;; # Ignore strange directory found on Mac OS X with cc -g X *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; X esac X done X else X ccout=`eval "${CC-cc} 2>&1" 2> /dev/null` X ret=$? X nf=`echo "$ccout" | grep 'not found'` X if test $ret = 127 -a -n "$nf" ; then # Korn Shell X ccout="" X fi X if test "$ret" -ne 0 -a ! -n "$ccout" ; then X AC_MSG_ERROR([installation or configuration problem: C compiler ${CC-cc} not found.]) X fi X AC_MSG_ERROR([installation or configuration problem: compiler cannot create executables.]) X fi X (./conftest ; exit) 2> /dev/null X if test $? != 0 ; then X ac_cv_xexeext="${ac_cv_exeext}" X (./conftest${ac_cv_xexeext} ; exit) 2> /dev/null X if test $? != 0 ; then X ac_cv_xexeext="" X fi X fi X rm -rf conftest* X test x"${ac_cv_exeext}" = x && ac_cv_exeext=no X test x"${ac_cv_xexeext}" = x && ac_cv_xexeext=no Xfi]) XEXEEXT="" XXEXEEXT="" Xtest x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} Xtest x"${ac_cv_xexeext}" != xno && XEXEEXT=${ac_cv_xexeext} XAC_MSG_RESULT(${ac_cv_exeext}) XAC_MSG_CHECKING([for executable calling suffix]) XAC_MSG_RESULT(${ac_cv_xexeext}) Xdnl Setting ac_exeext will implicitly change the ac_link command. Xac_exeext=$EXEEXT Xac_xexeext=$XEXEEXT XAC_SUBST(EXEEXT) XAC_SUBST(XEXEEXT) X]) X X Xdnl ### Checks for UNIX variants Xdnl These are kludges which should be replaced by a single POSIX check. Xdnl They aren't cached, to discourage their use. X X XAC_DEFUN(AC_AIX, X[AC_BEFORE([$0], [AC_TRY_COMPILE])dnl XAC_BEFORE([$0], [AC_TRY_RUN])dnl XAC_MSG_CHECKING(for AIX) XAC_EGREP_CPP(yes, X[#ifdef _AIX X yes X#endif X], [AC_MSG_RESULT(yes); AC_DEFINE(_ALL_SOURCE)], AC_MSG_RESULT(no)) X]) X XAC_DEFUN(AC_MINIX, X[AC_BEFORE([$0], [AC_TRY_COMPILE])dnl XAC_BEFORE([$0], [AC_TRY_RUN])dnl XAC_CHECK_HEADER(minix/config.h, MINIX=yes, MINIX=) Xif test "$MINIX" = yes; then X AC_DEFINE(_POSIX_SOURCE) X AC_DEFINE(_POSIX_1_SOURCE, 2) X AC_DEFINE(_MINIX) Xfi X]) X XAC_DEFUN(AC_ISC_POSIX, X[AC_REQUIRE([AC_PROG_CC])dnl XAC_BEFORE([$0], [AC_TRY_COMPILE])dnl XAC_BEFORE([$0], [AC_TRY_RUN])dnl XAC_MSG_CHECKING(for POSIXized ISC) Xif test -d /etc/conf/kconfig.d && X grep _POSIX_VERSION [/usr/include/sys/unistd.h] >/dev/null 2>&1 Xthen X AC_MSG_RESULT(yes) X ISC=yes # If later tests want to check for ISC. X AC_DEFINE(_POSIX_SOURCE) X if test "$GCC" = yes; then X CC="$CC -posix" X else X CC="$CC -Xp" X fi Xelse X AC_MSG_RESULT(no) X ISC= Xfi X]) X XAC_DEFUN(AC_XENIX_DIR, X[AC_OBSOLETE([$0], [; instead use AC_HEADER_DIRENT])dnl XAC_REQUIRE([AC_DIR_HEADER])dnl XAC_MSG_CHECKING(for Xenix) XAC_EGREP_CPP(yes, X[#if defined(M_XENIX) && !defined(M_UNIX) X yes X#endif X], [AC_MSG_RESULT(yes); XENIX=yes], [AC_MSG_RESULT(no); XENIX=]) Xif test "$XENIX" = yes; then X # Make sure -ldir precedes -lx. X test $ac_header_dirent = dirent.h && LIBS="-ldir $LIBS" X LIBS="$LIBS -lx" Xfi X]) X XAC_DEFUN(AC_DYNIX_SEQ, X[AC_OBSOLETE([$0], [; instead use AC_FUNC_GETMNTENT])dnl XAC_CHECK_LIB(seq, getmntent, LIBS="-lseq $LIBS") X]) X XAC_DEFUN(AC_IRIX_SUN, X[AC_OBSOLETE([$0], [; instead use AC_FUNC_GETMNTENT or AC_CHECK_LIB(sun, getpwnam)])dnl XAC_CHECK_LIB(sun, getmntent, LIBS="-lsun $LIBS") X]) X XAC_DEFUN(AC_SCO_INTL, X[AC_OBSOLETE([$0], [; instead use AC_FUNC_STRFTIME])dnl XAC_CHECK_LIB(intl, strftime, LIBS="-lintl $LIBS") X]) END-of-star-1.6/autoconf/acspecific.m4 echo x - star-1.6/autoconf/autoconf sed 's/^X//' >star-1.6/autoconf/autoconf << 'END-of-star-1.6/autoconf/autoconf' X#! /bin/sh X# @(#)autoconf 1.8 09/04/19 Copyright 1999-2009 J. Schilling X# X# autoconf -- create `configure' using m4 macros X# Copyright (C) 1992, 1993, 1994, 1996 Free Software Foundation, Inc. X X# This program is free software; you can redistribute it and/or modify X# it under the terms of the GNU General Public License as published by X# the Free Software Foundation; either version 2, or (at your option) X# any later version. X X# This program is distributed in the hope that it will be useful, X# but WITHOUT ANY WARRANTY; without even the implied warranty of X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X# GNU General Public License for more details. X X# You should have received a copy of the GNU General Public License X# along with this program; if not, write to the Free Software X# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA X# 02111-1307, USA. X X# If given no args, create `configure' from template file `configure.in'. X# With one arg, create a configure script on standard output from X# the given template file. X Xusage="\ XUsage: autoconf [-h] [--help] [-m dir] [--macrodir=dir] X [-l dir] [--localdir=dir] [--version] [template-file]" X X# NLS nuisances. X# Only set these to C if already set. These must not be set unconditionally X# because not all systems understand e.g. LANG=C (notably SCO). X# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! X# Non-C LC_CTYPE values break the ctype check. Xif test "${LANG+set}" = set; then LANG=C; export LANG; fi Xif test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi Xif test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi Xif test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi X X: ${AC_MACRODIR=.} X X: ${M4=/usr/bin/gm4} X$M4 < /dev/null 2> /dev/null || M4=/opt/sfw/bin/gm4 X$M4 < /dev/null 2> /dev/null || M4=/usr/sfw/bin/gm4 X$M4 < /dev/null 2> /dev/null || M4=/opt/csw/bin/gm4 X$M4 < /dev/null 2> /dev/null || M4=gm4 X$M4 < /dev/null 2> /dev/null || M4=m4 X X: ${AWK=/usr/bin/gawk} X$AWK '{print 1}' < /dev/null 2> /dev/null || AWK=/opt/sfw/bin/gawk X$AWK '{print 1}' < /dev/null 2> /dev/null || AWK=/usr/sfw/bin/gawk X$AWK '{print 1}' < /dev/null 2> /dev/null || AWK=/opt/csw/bin/gawk X$AWK '{print 1}' < /dev/null 2> /dev/null || AWK=gawk X$AWK '{print 1}' < /dev/null 2> /dev/null || AWK=nawk X$AWK '{print 1}' < /dev/null 2> /dev/null || AWK=awk X Xcase "${M4}" in X/*) # Handle the case that m4 has moved since we were configured. X # It may have been found originally in a build directory. X test -f "${M4}" || M4=/usr/sfw/bin/gm4 X test -f "${M4}" || M4=m4 ;; Xesac X X: ${TMPDIR=/tmp} Xtmpout=${TMPDIR}/acout.$$ Xlocaldir= Xshow_version=no X Xwhile test $# -gt 0 ; do X case "${1}" in X -h | --help | --h* ) X echo "${usage}" 1>&2; exit 0 ;; X --localdir=* | --l*=* ) X localdir="`echo \"${1}\" | sed -e 's/^[^=]*=//'`" X shift ;; X -l | --localdir | --l*) X shift X test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; } X localdir="${1}" X shift ;; X --macrodir=* | --m*=* ) X AC_MACRODIR="`echo \"${1}\" | sed -e 's/^[^=]*=//'`" X shift ;; X -m | --macrodir | --m* ) X shift X test $# -eq 0 && { echo "${usage}" 1>&2; exit 1; } X AC_MACRODIR="${1}" X shift ;; X --version | --v* ) X show_version=yes; shift ;; X -- ) # Stop option processing X shift; break ;; X - ) # Use stdin as input. X break ;; X -* ) X echo "${usage}" 1>&2; exit 1 ;; X * ) X break ;; X esac Xdone X Xif test $show_version = yes; then X version=`sed -n 's/define.AC_ACVERSION.[ ]*\([0-9.]*\).*/\1/p' \ X $AC_MACRODIR/acgeneral.m4` X echo "Autoconf version $version" X exit 0 Xfi X Xcase $# in X 0) infile=configure.in ;; X 1) infile="$1" ;; X *) echo "$usage" >&2; exit 1 ;; Xesac X Xtrap 'rm -f $tmpin $tmpout; exit 1' 1 2 15 X Xtmpin=${TMPDIR}/acin.$$ # Always set this, to avoid bogus errors from some rm's. Xif test z$infile = z-; then X infile=$tmpin X cat > $infile Xelif test ! -r "$infile"; then X echo "autoconf: ${infile}: No such file or directory" >&2 X exit 1 Xfi X Xif test -n "$localdir"; then X use_localdir="-I$localdir -DAC_LOCALDIR=$localdir" Xelse X use_localdir= Xfi X X# Use the frozen version of Autoconf if available. Xr= f= X# Some non-GNU m4's don't reject the --help option, so give them /dev/null. Xcase `$M4 --help < /dev/null 2>&1` in X*reload-state*) test -r $AC_MACRODIR/autoconf.m4f && { r=--reload f=f; } ;; X*traditional*) ;; X*) echo Autoconf requires GNU m4 1.1 or later >&2; rm -f $tmpin; exit 1 ;; Xesac X X$M4 -I$AC_MACRODIR $use_localdir $r autoconf.m4$f $infile > $tmpout || X { rm -f $tmpin $tmpout; exit 2; } X X# You could add your own prefixes to pattern if you wanted to check for X# them too, e.g. pattern='\(AC_\|ILT_\)', except that UNIX sed doesn't do X# alternation. Xpattern="AC_" X Xstatus=0 Xif grep "^[^#]*${pattern}" $tmpout > /dev/null 2>&1; then X echo "autoconf: Undefined macros:" >&2 X sed -n "s/^[^#]*\\(${pattern}[_A-Za-z0-9]*\\).*/\\1/p" $tmpout | X while read macro; do X grep -n "^[^#]*$macro" $infile /dev/null X test $? -eq 1 && echo >&2 "***BUG in Autoconf--please report*** $macro" X done | sort -u >&2 X status=1 Xfi X Xif test $# -eq 0; then X exec 4> configure; chmod +x configure Xelse X exec 4>&1 Xfi X X# Put the real line numbers into configure to make config.log more helpful. X$AWK ' X/__oline__/ { printf "%d:", NR + 1 } X { print } X' $tmpout | sed ' X/__oline__/s/^\([0-9][0-9]*\):\(.*\)__oline__/\2\1/ X' >&4 X Xrm -f $tmpout X Xexit $status END-of-star-1.6/autoconf/autoconf echo x - star-1.6/autoconf/autoconf.m4 sed 's/^X//' >star-1.6/autoconf/autoconf.m4 << 'END-of-star-1.6/autoconf/autoconf.m4' Xdnl Driver that loads the Autoconf macro files. Xdnl Requires GNU m4. Xdnl This file is part of Autoconf. Xdnl Copyright (C) 1994 Free Software Foundation, Inc. Xdnl Xdnl This program is free software; you can redistribute it and/or modify Xdnl it under the terms of the GNU General Public License as published by Xdnl the Free Software Foundation; either version 2, or (at your option) Xdnl any later version. Xdnl Xdnl This program is distributed in the hope that it will be useful, Xdnl but WITHOUT ANY WARRANTY; without even the implied warranty of Xdnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Xdnl GNU General Public License for more details. Xdnl Xdnl You should have received a copy of the GNU General Public License Xdnl along with this program; if not, write to the Free Software Xdnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA Xdnl 02111-1307, USA. Xdnl Xdnl Written by David MacKenzie. Xdnl Xinclude(acgeneral.m4)dnl Xbuiltin(include, acspecific.m4)dnl Xbuiltin(include, acoldnames.m4)dnl Xdnl Do not sinclude acsite.m4 here, because it may not be installed Xdnl yet when Autoconf is frozen. Xdnl Do not sinclude ./aclocal.m4 here, to prevent it from being frozen. END-of-star-1.6/autoconf/autoconf.m4 echo x - star-1.6/autoconf/autoheader.m4 sed 's/^X//' >star-1.6/autoconf/autoheader.m4 << 'END-of-star-1.6/autoconf/autoheader.m4' Xdnl Driver and redefinitions of some Autoconf macros for autoheader. Xdnl This file is part of Autoconf. Xdnl Copyright (C) 1994, 1995 Free Software Foundation, Inc. Xdnl Xdnl This program is free software; you can redistribute it and/or modify Xdnl it under the terms of the GNU General Public License as published by Xdnl the Free Software Foundation; either version 2, or (at your option) Xdnl any later version. Xdnl Xdnl This program is distributed in the hope that it will be useful, Xdnl but WITHOUT ANY WARRANTY; without even the implied warranty of Xdnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Xdnl GNU General Public License for more details. Xdnl Xdnl You should have received a copy of the GNU General Public License Xdnl along with this program; if not, write to the Free Software Xdnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA Xdnl 02111-1307, USA. Xdnl Xdnl Written by Roland McGrath. Xdnl Xinclude(acgeneral.m4)dnl Xbuiltin(include, acspecific.m4)dnl Xbuiltin(include, acoldnames.m4)dnl X Xdnl These are alternate definitions of some macros, which produce Xdnl strings in the output marked with "@@@" so we can easily extract Xdnl the information we want. The `#' at the end of the first line of Xdnl each definition seems to be necessary to prevent m4 from eating Xdnl the newline, which makes the @@@ not always be at the beginning of Xdnl a line. X Xdefine([AC_CHECK_FUNCS], [# X@@@funcs="$funcs $1"@@@ Xifelse([$2], , , [ X# If it was found, we do: X$2 X# If it was not found, we do: X$3 X]) X]) X Xdefine([AC_CHECK_HEADERS], [# X@@@headers="$headers $1"@@@ Xifelse([$2], , , [ X# If it was found, we do: X$2 X# If it was not found, we do: X$3 X]) X]) X Xdefine([AC_CHECK_HEADERS_DIRENT], [# X@@@headers="$headers $1"@@@ X]) X Xdefine([AC_CHECK_LIB], [# X ifelse([$3], , [ X@@@libs="$libs $1"@@@ X], [ X# If it was found, we do: X$3 X# If it was not found, we do: X$4 X]) X]) X Xdefine([AC_HAVE_LIBRARY], [# Xchangequote(<<, >>)dnl Xdefine(<>, dnl Xpatsubst(patsubst($1, <>, <<\1>>), <<-l>>, <<>>))dnl Xchangequote([, ])dnl X ifelse([$2], , [ X@@@libs="$libs AC_LIB_NAME"@@@ X], [ X# If it was found, we do: X$2 X# If it was not found, we do: X$3 X]) X]) X Xdefine([AC_CHECK_SIZEOF], [# X@@@types="$types,$1"@@@ X]) X Xdefine([AC_CONFIG_HEADER], [# Xdefine([AC_CONFIG_H], patsubst($1, [ .*$], []))dnl X@@@config_h=AC_CONFIG_H@@@ X]) X Xdefine([AC_DEFINE], [# Xifelse([$3],,[# X@@@syms="$syms $1"@@@ X], [# X@@@verbatim="$verbatim X/* $3 */ X#undef $1 X"@@@ X])]) X Xdefine([AC_DEFINE_UNQUOTED], [# Xifelse([$3],,[# X@@@syms="$syms $1"@@@ X], [# X@@@verbatim="$verbatim X/* $3 */ X#undef $1 X"@@@ X])]) END-of-star-1.6/autoconf/autoheader.m4 echo x - star-1.6/autoconf/config.guess sed 's/^X//' >star-1.6/autoconf/config.guess << 'END-of-star-1.6/autoconf/config.guess' X#! /bin/sh X# @(#)config.guess 1.20 18/10/03 Copyright 1999-2014 J. Schilling X# X# Attempt to guess a canonical system name. X# Copyright (C) 1992, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc. X# X# This file is free software; you can redistribute it and/or modify it X# under the terms of the GNU General Public License as published by X# the Free Software Foundation; either version 2 of the License, or X# (at your option) any later version. X# X# This program is distributed in the hope that it will be useful, but X# WITHOUT ANY WARRANTY; without even the implied warranty of X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU X# General Public License for more details. X# X# You should have received a copy of the GNU General Public License X# along with this program; if not, write to the Free Software X# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. X# X# As a special exception to the GNU General Public License, if you X# distribute this file as part of a program that contains a X# configuration script generated by Autoconf, you may include it under X# the same distribution terms that you use for the rest of that program. X X# Written by Per Bothner . X# The master version of this file is at the FSF in /home/gd/gnu/lib. X# X# This script attempts to guess a canonical system name similar to X# config.sub. If it succeeds, it prints the system name on stdout, and X# exits with 0. Otherwise, it exits with 1. X# X# The plan is that this can be called by configure scripts if you X# don't specify an explicit system type (host/target name). X# X# Only a few systems have been added to this list; please add others X# (but try to keep the structure clean). X# X X# This is needed to find uname on a Pyramid OSx when run in the BSD universe. X# (ghazi@noc.rutgers.edu 8/24/94.) Xif (test -f /.attbin/uname) >/dev/null 2>&1 ; then X PATH=$PATH:/.attbin ; export PATH Xfi X XUNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown XUNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown XUNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown XUNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown X Xtrap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15 X X# Note: order is significant - the case branches are not exclusive. X X# X# This command helps to debug the script via "sh -x" X# X: "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" X Xcase "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in X alpha:OSF1:*:*) X if test $UNAME_RELEASE = "V4.0"; then X UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` X fi X # A Vn.n version is a released version. X # A Tn.n version is a released field test version. X # A Xn.n version is an unreleased experimental baselevel. X # 1.2 uses "1.2" for uname -r. X cat <dummy.s X .globl main X .ent main Xmain: X .frame \$30,0,\$26,0 X .prologue 0 X .long 0x47e03d80 # implver $0 X lda \$2,259 X .long 0x47e20c21 # amask $2,$1 X srl \$1,8,\$2 X sll \$2,2,\$2 X sll \$0,3,\$0 X addl \$1,\$0,\$0 X addl \$2,\$0,\$0 X ret \$31,(\$26),1 X .end main XEOF X ${CC-cc} dummy.s -o dummy 2>/dev/null X if test "$?" = 0 ; then X ./dummy X case "$?" in X 7) X UNAME_MACHINE="alpha" X ;; X 15) X UNAME_MACHINE="alphaev5" X ;; X 14) X UNAME_MACHINE="alphaev56" X ;; X 10) X UNAME_MACHINE="alphapca56" X ;; X 16) X UNAME_MACHINE="alphaev6" X ;; X esac X fi X rm -f dummy.s dummy X echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr [[A-Z]] [[a-z]]` X exit 0 ;; X 21064:Windows_NT:50:3) X echo alpha-dec-winnt3.5 X exit 0 ;; X *:FreeMiNT:*:*) X echo m68k-atari-freemint X exit 0 ;; X *:MiNT:*:*) X echo m68k-atari-mint X exit 0 ;; X *:TOS:*:*) X echo m68k-atari-tos X exit 0 ;; X Amiga*:UNIX_System_V:4.0:*) X echo m68k-cbm-sysv4 X exit 0;; X amiga:NetBSD:*:*) X echo m68k-cbm-netbsd${UNAME_RELEASE} X exit 0 ;; X amiga:OpenBSD:*:*) X echo m68k-unknown-openbsd${UNAME_RELEASE} X exit 0 ;; X *:[Aa]miga[Oo][Ss]:*:*) X echo ${UNAME_MACHINE}-unknown-amigaos X exit 0 ;; X arc64:OpenBSD:*:*) X echo mips64el-unknown-openbsd${UNAME_RELEASE} X exit 0 ;; X arc:OpenBSD:*:*) X echo mipsel-unknown-openbsd${UNAME_RELEASE} X exit 0 ;; X hkmips:OpenBSD:*:*) X echo mips-unknown-openbsd${UNAME_RELEASE} X exit 0 ;; X pmax:OpenBSD:*:*) X echo mipsel-unknown-openbsd${UNAME_RELEASE} X exit 0 ;; X sgi:OpenBSD:*:*) X echo mips-unknown-openbsd${UNAME_RELEASE} X exit 0 ;; X wgrisc:OpenBSD:*:*) X echo mipsel-unknown-openbsd${UNAME_RELEASE} X exit 0 ;; X arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) X echo arm-acorn-riscix${UNAME_RELEASE} X exit 0;; X arm32:NetBSD:*:*) X echo arm-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` X exit 0 ;; X SR2?01:HI-UX/MPP:*:*) X echo hppa1.1-hitachi-hiuxmpp X exit 0;; X Pyramid*:OSx*:*:*|MIS*:OSx*:*:*|MIS*:SMP_DC-OSx*:*:*) X # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. X if test "`(/bin/universe) 2>/dev/null`" = att ; then X echo pyramid-pyramid-sysv3 X else X echo pyramid-pyramid-bsd X fi X exit 0 ;; X NILE:*:*:dcosx) X echo pyramid-pyramid-svr4 X exit 0 ;; X sun4H:SunOS:5.*:*) X echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` X exit 0 ;; X sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) X echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` X exit 0 ;; X i86pc:SunOS:5.*:*) X echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` X exit 0 ;; X sun4*:SunOS:6*:*) X # According to config.sub, this is the proper way to canonicalize X # SunOS6. Hard to guess exactly what SunOS6 will be like, but X # it's likely to be more like Solaris than SunOS4. X echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` X exit 0 ;; X sun4*:SunOS:*:*) X case "`/usr/bin/arch -k`" in X Series*|S4*) X UNAME_RELEASE=`uname -v` X ;; X esac X # Japanese Language versions have a version number like `4.1.3-JL'. X echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` X exit 0 ;; X sun3*:SunOS:*:*) X echo m68k-sun-sunos${UNAME_RELEASE} X exit 0 ;; X sun*:*:4.2BSD:*) X UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` X test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 X case "`/bin/arch`" in X sun3) X echo m68k-sun-sunos${UNAME_RELEASE} X ;; X sun4) X echo sparc-sun-sunos${UNAME_RELEASE} X ;; X esac X exit 0 ;; X aushp:SunOS:*:*) X echo sparc-auspex-sunos${UNAME_RELEASE} X exit 0 ;; X atari*:NetBSD:*:*) X echo m68k-atari-netbsd${UNAME_RELEASE} X exit 0 ;; X atari*:OpenBSD:*:*) X echo m68k-unknown-openbsd${UNAME_RELEASE} X exit 0 ;; X sun3*:NetBSD:*:*) X echo m68k-sun-netbsd${UNAME_RELEASE} X exit 0 ;; X sun3*:OpenBSD:*:*) X echo m68k-unknown-openbsd${UNAME_RELEASE} X exit 0 ;; X mac68k:NetBSD:*:*) X echo m68k-apple-netbsd${UNAME_RELEASE} X exit 0 ;; X mac68k:OpenBSD:*:*) X echo m68k-unknown-openbsd${UNAME_RELEASE} X exit 0 ;; X mvme68k:OpenBSD:*:*) X echo m68k-unknown-openbsd${UNAME_RELEASE} X exit 0 ;; X mvme88k:OpenBSD:*:*) X echo m88k-unknown-openbsd${UNAME_RELEASE} X exit 0 ;; X powerpc:machten:*:*) X echo powerpc-apple-machten${UNAME_RELEASE} X exit 0 ;; X macppc:NetBSD:*:*) X echo powerpc-apple-netbsd${UNAME_RELEASE} X exit 0 ;; X RISC*:Mach:*:*) X echo mips-dec-mach_bsd4.3 X exit 0 ;; X RISC*:ULTRIX:*:*) X echo mips-dec-ultrix${UNAME_RELEASE} X exit 0 ;; X VAX*:ULTRIX*:*:*) X echo vax-dec-ultrix${UNAME_RELEASE} X exit 0 ;; X 2020:CLIX:*:*) X echo clipper-intergraph-clix${UNAME_RELEASE} X exit 0 ;; X mips:*:*:UMIPS | mips:*:*:RISCos) X sed 's/^ //' << EOF >dummy.c X int main (argc, argv) int argc; char **argv; { X #if defined (host_mips) && defined (MIPSEB) X #if defined (SYSTYPE_SYSV) X printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); X #endif X #if defined (SYSTYPE_SVR4) X printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); X #endif X #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) X printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); X #endif X #endif X exit (-1); X } XEOF X ${CC-cc} dummy.c -o dummy \ X && ./dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ X && rm dummy.c dummy && exit 0 X rm -f dummy.c dummy X echo mips-mips-riscos${UNAME_RELEASE} X exit 0 ;; X Night_Hawk:Power_UNIX:*:*) X echo powerpc-harris-powerunix X exit 0 ;; X m88k:CX/UX:7*:*) X echo m88k-harris-cxux7 X exit 0 ;; X m88k:*:4*:R4*) X echo m88k-motorola-sysv4 X exit 0 ;; X m88k:*:3*:R3*) X echo m88k-motorola-sysv3 X exit 0 ;; X AViiON:dgux:*:*) X # DG/UX returns AViiON for all architectures X UNAME_PROCESSOR=`/usr/bin/uname -p` X if [ $UNAME_PROCESSOR = mc88100 -o $UNAME_PROCESSOR = mc88110 ] ; then X if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \ X -o ${TARGET_BINARY_INTERFACE}x = x ] ; then X echo m88k-dg-dgux${UNAME_RELEASE} X else X echo m88k-dg-dguxbcs${UNAME_RELEASE} X fi X else echo i586-dg-dgux${UNAME_RELEASE} X fi X exit 0 ;; X M88*:DolphinOS:*:*) # DolphinOS (SVR3) X echo m88k-dolphin-sysv3 X exit 0 ;; X M88*:*:R3*:*) X # Delta 88k system running SVR3 X echo m88k-motorola-sysv3 X exit 0 ;; X XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) X echo m88k-tektronix-sysv3 X exit 0 ;; X Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) X echo m68k-tektronix-bsd X exit 0 ;; X *:IRIX*:*:*) X echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` X exit 0 ;; X ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. X echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id X exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' X i?86:AIX:*:*) X echo i386-ibm-aix X exit 0 ;; X *:AIX:2:3) X if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then X sed 's/^ //' << EOF >dummy.c X #include X X main() X { X if (!__power_pc()) X exit(1); X puts("powerpc-ibm-aix3.2.5"); X exit(0); X } XEOF X ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0 X rm -f dummy.c dummy X echo rs6000-ibm-aix3.2.5 X elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then X echo rs6000-ibm-aix3.2.4 X else X echo rs6000-ibm-aix3.2 X fi X exit 0 ;; X *:AIX:*:4) X IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'` X if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then X IBM_ARCH=rs6000 X else X IBM_ARCH=powerpc X fi X if [ -x /usr/bin/oslevel ] ; then X IBM_REV=`/usr/bin/oslevel` X else X IBM_REV=4.${UNAME_RELEASE} X fi X echo ${IBM_ARCH}-ibm-aix${IBM_REV} X exit 0 ;; X *:AIX:*:*) X echo rs6000-ibm-aix X exit 0 ;; X *:OS400:*:*) X # The AIX emulation on OS400 returns the serial number for uname -m X # e.g. 00210002307W, we return "powerpc" for the architecture. X echo powerpc-ibm-os400 X exit 0 ;; X ibmrt:4.4BSD:*|romp-ibm:BSD:*) X echo romp-ibm-bsd4.4 X exit 0 ;; X ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and X echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to X exit 0 ;; # report: romp-ibm BSD 4.3 X *:BOSX:*:*) X echo rs6000-bull-bosx X exit 0 ;; X DPX/2?00:B.O.S.:*:*) X echo m68k-bull-sysv3 X exit 0 ;; X 9000/[34]??:4.3bsd:1.*:*) X echo m68k-hp-bsd X exit 0 ;; X hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) X echo m68k-hp-bsd4.4 X exit 0 ;; X 9000/[34678]??:HP-UX:*:*) X case "${UNAME_MACHINE}" in X 9000/31? ) HP_ARCH=m68000 ;; X 9000/[34]?? ) HP_ARCH=m68k ;; X 9000/6?? | 9000/7?? | 9000/80[24] | 9000/8?[13679] | 9000/892 | 9000/820 | 9000/800 ) X sed 's/^ //' << EOF >dummy.c X #include X #include X X int main () X { X #if defined(_SC_KERNEL_BITS) X long bits = sysconf(_SC_KERNEL_BITS); X #endif X long cpu = sysconf (_SC_CPU_VERSION); X X switch (cpu) X { X case CPU_PA_RISC1_0: puts ("hppa1.0"); break; X case CPU_PA_RISC1_1: puts ("hppa1.1"); break; X case CPU_PA_RISC2_0: X #if defined(_SC_KERNEL_BITS) X switch (bits) X { X case 64: puts ("hppa2.0w"); break; X case 32: puts ("hppa2.0n"); break; X default: puts ("hppa2.0"); break; X } break; X #else /* !defined(_SC_KERNEL_BITS) */ X puts ("hppa2.0"); break; X #endif X default: puts ("hppa1.0"); break; X } X exit (0); X } XEOF X (${CC-cc} dummy.c -o dummy 2>/dev/null ) && HP_ARCH=`./dummy` X rm -f dummy.c dummy X esac X HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` X echo ${HP_ARCH}-hp-hpux${HPUX_REV} X exit 0 ;; X 3050*:HI-UX:*:*) X sed 's/^ //' << EOF >dummy.c X #include X int X main () X { X long cpu = sysconf (_SC_CPU_VERSION); X /* The order matters, because CPU_IS_HP_MC68K erroneously returns X true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct X results, however. */ X if (CPU_IS_PA_RISC (cpu)) X { X switch (cpu) X { X case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; X case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; X case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; X default: puts ("hppa-hitachi-hiuxwe2"); break; X } X } X else if (CPU_IS_HP_MC68K (cpu)) X puts ("m68k-hitachi-hiuxwe2"); X else puts ("unknown-hitachi-hiuxwe2"); X exit (0); X } XEOF X ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0 X rm -f dummy.c dummy X echo unknown-hitachi-hiuxwe2 X exit 0 ;; X 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) X echo hppa1.1-hp-bsd X exit 0 ;; X 9000/8??:4.3bsd:*:*) X echo hppa1.0-hp-bsd X exit 0 ;; X hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) X echo hppa1.1-hp-osf X exit 0 ;; X hp8??:OSF1:*:*) X echo hppa1.0-hp-osf X exit 0 ;; X i?86:OSF1:*:*) X if [ -x /usr/sbin/sysversion ] ; then X echo ${UNAME_MACHINE}-unknown-osf1mk X else X echo ${UNAME_MACHINE}-unknown-osf1 X fi X exit 0 ;; X parisc*:Lites*:*:*) X echo hppa1.1-hp-lites X exit 0 ;; X *:Bitrig:*:*) X echo ${UNAME_MACHINE}-unknown-bitrig X exit 0 ;; X C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) X echo c1-convex-bsd X exit 0 ;; X C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) X if getsysinfo -f scalar_acc X then echo c32-convex-bsd X else echo c2-convex-bsd X fi X exit 0 ;; X C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) X echo c34-convex-bsd X exit 0 ;; X C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) X echo c38-convex-bsd X exit 0 ;; X C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) X echo c4-convex-bsd X exit 0 ;; X CRAY*X-MP:*:*:*) X echo xmp-cray-unicos X exit 0 ;; X CRAY*Y-MP:*:*:*) X echo ymp-cray-unicos${UNAME_RELEASE} X exit 0 ;; X CRAY*[A-Z]90:*:*:*) X echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ X | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ X -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ X exit 0 ;; X CRAY*TS:*:*:*) X echo t90-cray-unicos${UNAME_RELEASE} X exit 0 ;; X CRAY-2:*:*:*) X echo cray2-cray-unicos X exit 0 ;; X F300:UNIX_System_V:*:*) X FUJITSU_SYS=`uname -p | tr [A-Z] [a-z] | sed -e 's/\///'` X FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` X echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" X exit 0 ;; X F301:UNIX_System_V:*:*) X echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'` X exit 0 ;; X hp3[0-9][05]:NetBSD:*:*) X echo m68k-hp-netbsd${UNAME_RELEASE} X exit 0 ;; X hp300:OpenBSD:*:*) X echo m68k-unknown-openbsd${UNAME_RELEASE} X exit 0 ;; X sparc*:BSD/OS:*:*) X echo sparc-unknown-bsdi${UNAME_RELEASE} X exit 0 ;; X i?86:BSD/386:*:* | *:BSD/OS:*:*) X echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} X exit 0 ;; X *:FreeBSD:*:*) X echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` X exit 0 ;; X *:DragonFly:*:*) X echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` X exit 0 ;; X *:NetBSD:*:*) X echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` X exit 0 ;; X *:OpenBSD:*:*) X echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` X exit 0 ;; X i*:CYGWIN*:*) X echo ${UNAME_MACHINE}-pc-cygwin X exit 0 ;; X x*:CYGWIN*:*) X echo ${UNAME_MACHINE}-pc-cygwin X exit 0 ;; X i*:MINGW*:*) X echo ${UNAME_MACHINE}-pc-mingw32 X exit 0 ;; X p*:CYGWIN*:*) X echo powerpcle-unknown-cygwin X exit 0 ;; X x86:Interix*:3*) X echo i586-pc-interix3 X exit 0 ;; X prep*:SunOS:5.*:*) X echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` X exit 0 ;; X aarch64:SunOS:5.*:*) X echo aarch64-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` X exit 0 ;; X *:GNU:*:*) X echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` X exit 0 ;; X s390:Linux:*:* | s390x:Linux:*:*) X echo ${UNAME_MACHINE}-ibm-linux X exit 0 ;; X *:Linux:*:*) X # uname on the ARM produces all sorts of strangeness, and we need to X # filter it out. X case "$UNAME_MACHINE" in X arm* | sa110*) UNAME_MACHINE="arm" ;; X esac X X # The BFD linker knows what the default object file format is, so X # first see if it will tell us. X ld_help_string=`ld --help 2>&1` X ld_supported_emulations=`echo $ld_help_string \ X | sed -ne '/supported emulations:/!d X s/[ ][ ]*/ /g X s/.*supported emulations: *// X s/ .*// X p'` X case "$ld_supported_emulations" in X i?86linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" ; exit 0 ;; X i?86coff) echo "${UNAME_MACHINE}-pc-linux-gnucoff" ; exit 0 ;; X sparclinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; X armlinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; X m68klinux) echo "${UNAME_MACHINE}-unknown-linux-gnuaout" ; exit 0 ;; X elf32ppc) echo "powerpc-unknown-linux-gnu" ; exit 0 ;; X esac X X if test "${UNAME_MACHINE}" = "alpha" ; then X sed 's/^ //' <dummy.s X .globl main X .ent main X main: X .frame \$30,0,\$26,0 X .prologue 0 X .long 0x47e03d80 # implver $0 X lda \$2,259 X .long 0x47e20c21 # amask $2,$1 X srl \$1,8,\$2 X sll \$2,2,\$2 X sll \$0,3,\$0 X addl \$1,\$0,\$0 X addl \$2,\$0,\$0 X ret \$31,(\$26),1 X .end main XEOF X LIBC="" X ${CC-cc} dummy.s -o dummy 2>/dev/null X if test "$?" = 0 ; then X ./dummy X case "$?" in X 7) X UNAME_MACHINE="alpha" X ;; X 15) X UNAME_MACHINE="alphaev5" X ;; X 14) X UNAME_MACHINE="alphaev56" X ;; X 10) X UNAME_MACHINE="alphapca56" X ;; X 16) X UNAME_MACHINE="alphaev6" X ;; X esac X X objdump --private-headers dummy | \ X grep ld.so.1 > /dev/null X if test "$?" = 0 ; then X LIBC="libc1" X fi X fi X rm -f dummy.s dummy X echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0 X elif test "${UNAME_MACHINE}" = "mips" ; then X cat >dummy.c </dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0 X rm -f dummy.c dummy X else X # Either a pre-BFD a.out linker (linux-gnuoldld) X # or one that does not give us useful --help. X # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout. X # If ld does not provide *any* "supported emulations:" X # that means it is gnuoldld. X echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:" X test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0 X X case "${UNAME_MACHINE}" in X i?86) X VENDOR=pc; X ;; X *) X VENDOR=unknown; X ;; X esac X # Determine whether the default compiler is a.out or elf X cat >dummy.c < Xmain(argc, argv) X int argc; X char *argv[]; X{ X#if defined __ELF__ || defined __SUNPRO_C X# ifdef __GLIBC__ X# if __GLIBC__ >= 2 X printf ("%s-${VENDOR}-linux-gnu\n", argv[1]); X# else X printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); X# endif X# else X printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); X# endif X#else X printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]); X#endif X return 0; X} XEOF X ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0 X rm -f dummy.c dummy X fi ;; X# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions X# are messed up and put the nodename in both sysname and nodename. X i?86:DYNIX/ptx:4*:*) X echo i386-sequent-sysv4 X exit 0 ;; X i?86:UNIX_SV:4.2MP:2.*) X # Unixware is an offshoot of SVR4, but it has its own version X # number series starting with 2... X # I am not positive that other SVR4 systems won't match this, X # I just have to hope. -- rms. X # Use sysv4.2uw... so that sysv4* matches it. X echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} X exit 0 ;; X i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*) X if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then X echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE} X else X echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE} X fi X exit 0 ;; X i?86:MS-DOS:5:50) X # DJGPP v2 X echo ${UNAME_MACHINE}-pc-msdos X exit 0 ;; X i?86:*:5:*) X # Fixed at (any) Pentium or better X UNAME_MACHINE=i586 X if [ ${UNAME_SYSTEM} = "UnixWare" ] || X [ ${UNAME_SYSTEM} = "OpenUNIX" ]; then X echo ${UNAME_MACHINE}-sco-sysv${UNAME_RELEASE}uw${UNAME_VERSION} X else X echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE} X fi X exit 0 ;; X i?86:*:3.2:*) X if test -f /usr/options/cb.name; then X UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then X UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` X (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 X (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ X && UNAME_MACHINE=i586 X echo ${UNAME_MACHINE}-pc-sco$UNAME_REL X else X echo ${UNAME_MACHINE}-pc-sysv32 X fi X exit 0 ;; X pc:*:*:*) X # uname -m prints for DJGPP always 'pc', but it prints nothing about X # the processor, so we play safe by assuming i386. X echo i386-pc-msdosdjgpp X exit 0 ;; X Intel:Mach:3*:*) X echo i386-pc-mach3 X exit 0 ;; X paragon:*:*:*) X echo i860-intel-osf1 X exit 0 ;; X i860:*:4.*:*) # i860-SVR4 X if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then X echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 X else # Add other i860-SVR4 vendors below as they are discovered. X echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 X fi X exit 0 ;; X *:Minix:*:*) X echo i386-pc-minix X exit 0 ;; X mini*:CTIX:SYS*5:*) X # "miniframe" X echo m68010-convergent-sysv X exit 0 ;; X M68*:*:R3V[567]*:*) X test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; X 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0) X OS_REL='' X test -r /etc/.relid \ X && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` X /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ X && echo i486-ncr-sysv4.3${OS_REL} && exit 0 X /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ X && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; X 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) X /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ X && echo i486-ncr-sysv4 && exit 0 ;; X m68*:LynxOS:2.*:*) X echo m68k-unknown-lynxos${UNAME_RELEASE} X exit 0 ;; X mc68030:UNIX_System_V:4.*:*) X echo m68k-atari-sysv4 X exit 0 ;; X i?86:LynxOS:2.*:*) X echo i386-unknown-lynxos${UNAME_RELEASE} X exit 0 ;; X TSUNAMI:LynxOS:2.*:*) X echo sparc-unknown-lynxos${UNAME_RELEASE} X exit 0 ;; X rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*) X echo rs6000-unknown-lynxos${UNAME_RELEASE} X exit 0 ;; X SM[BE]S:UNIX_SV:*:*) X echo mips-dde-sysv${UNAME_RELEASE} X exit 0 ;; X RM*:SINIX-*:*:*) X echo mips-sni-sysv4 X exit 0 ;; X *:SINIX-*:*:*) X if uname -p 2>/dev/null >/dev/null ; then X UNAME_MACHINE=`(uname -p) 2>/dev/null` X echo ${UNAME_MACHINE}-sni-sysv4 X else X echo ns32k-sni-sysv X fi X exit 0 ;; X PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort X # says X echo i586-unisys-sysv4 X exit 0 ;; X *:UNIX_System_V:4*:FTX*) X # From Gerald Hewes . X # How about differentiating between stratus architectures? -djm X echo hppa1.1-stratus-sysv4 X exit 0 ;; X *:*:*:FTX*) X # From seanf@swdc.stratus.com. X echo i860-stratus-sysv4 X exit 0 ;; X mc68*:A/UX:*:*) X echo m68k-apple-aux${UNAME_RELEASE} X exit 0 ;; X news*:NEWS-OS:*:6*) X echo mips-sony-newsos6 X exit 0 ;; X R3000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R4000:UNIX_SV:*:*) X if [ -d /usr/nec ]; then X echo mips-nec-sysv${UNAME_RELEASE} X else X echo mips-unknown-sysv${UNAME_RELEASE} X fi X exit 0 ;; X BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. X echo powerpc-be-beos X exit 0 ;; X BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. X echo powerpc-apple-beos X exit 0 ;; X BePC:BeOS:*:*) # BeOS running on Intel PC compatible. X echo i586-pc-beos X exit 0 ;; X BeMac:Haiku:*:*) X echo powerpc-apple-haiku X exit ;; X BePC:Haiku:*:*) X echo i586-pc-haiku X exit ;; X "Power Macintosh":Rhapsody:*) X echo powerpc-apple-rhapsody${UNAME_RELEASE} X exit 0 ;; X "Power Macintosh":"Mac OS":*) X echo powerpc-apple-macosx${UNAME_RELEASE} X exit 0 ;; X "Power Macintosh":"Darwin":*) X echo powerpc-apple-macosx${UNAME_RELEASE} X exit 0 ;; X "i386":"Darwin":*) X echo i386-apple-macosx${UNAME_RELEASE} X exit 0 ;; X "x86_64":"Darwin":*) X echo x86_64-apple-macosx${UNAME_RELEASE} X exit 0 ;; X "x86":"Darwin":*) X echo i386-apple-macosx${UNAME_RELEASE} X exit 0 ;; X *:OS/2:*:*) X echo "i386-pc-os2_emx" X exit 0;; X *:OpenVMS:*:*) X UNAME_PROCESSOR=`uname -p | tr [A-Z] [a-z]` X echo "${UNAME_PROCESSOR}-hp-openvms" X exit 0;; Xesac X X#echo '(No uname command or uname output not recognized.)' 1>&2 X#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 X Xcat >dummy.c < X# include X#endif Xmain () X{ X#if defined (sony) X#if defined (MIPSEB) X /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, X I don't know.... */ X printf ("mips-sony-bsd\n"); exit (0); X#else X#include X printf ("m68k-sony-newsos%s\n", X#ifdef NEWSOS4 X "4" X#else X "" X#endif X ); exit (0); X#endif X#endif X X#if defined (__arm) && defined (__acorn) && defined (__unix) X printf ("arm-acorn-riscix"); exit (0); X#endif X X#if defined (hp300) && !defined (hpux) X printf ("m68k-hp-bsd\n"); exit (0); X#endif X X#if defined (NeXT) X#if !defined (__ARCHITECTURE__) X#define __ARCHITECTURE__ "m68k" X#endif X int version; X version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; X printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); X exit (0); X#endif X X#if defined (MULTIMAX) || defined (n16) X#if defined (UMAXV) X printf ("ns32k-encore-sysv\n"); exit (0); X#else X#if defined (CMU) X printf ("ns32k-encore-mach\n"); exit (0); X#else X printf ("ns32k-encore-bsd\n"); exit (0); X#endif X#endif X#endif X X#if defined (__386BSD__) X printf ("i386-pc-bsd\n"); exit (0); X#endif X X#if defined (sequent) X#if defined (i386) X printf ("i386-sequent-dynix\n"); exit (0); X#endif X#if defined (ns32000) X printf ("ns32k-sequent-dynix\n"); exit (0); X#endif X#endif X X#if defined (_SEQUENT_) X struct utsname un; X X uname(&un); X X if (strncmp(un.version, "V2", 2) == 0) { X printf ("i386-sequent-ptx2\n"); exit (0); X } X if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ X printf ("i386-sequent-ptx1\n"); exit (0); X } X printf ("i386-sequent-ptx\n"); exit (0); X X#endif X X#if defined (vax) X#if !defined (ultrix) X printf ("vax-dec-bsd\n"); exit (0); X#else X printf ("vax-dec-ultrix\n"); exit (0); X#endif X#endif X X#if defined (alliant) && defined (i860) X printf ("i860-alliant-bsd\n"); exit (0); X#endif X X exit (1); X} XEOF X X${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0 Xrm -f dummy.c dummy X X# Apollos put the system type in the environment. X Xtest -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } X X# Convex versions that predate uname can use getsysinfo(1) X Xif [ -x /usr/convex/getsysinfo ] Xthen X case `getsysinfo -f cpu_type` in X c1*) X echo c1-convex-bsd X exit 0 ;; X c2*) X if getsysinfo -f scalar_acc X then echo c32-convex-bsd X else echo c2-convex-bsd X fi X exit 0 ;; X c34*) X echo c34-convex-bsd X exit 0 ;; X c38*) X echo c38-convex-bsd X exit 0 ;; X c4*) X echo c4-convex-bsd X exit 0 ;; X esac Xfi X Xif [ x$CONFIG_NOFAIL = xTRUE ]; then X echo unknownCPU-unknownMFR-unknownOS X exit 0 Xfi X X#echo '(Unable to guess system type)' 1>&2 X Xexit 1 END-of-star-1.6/autoconf/config.guess echo x - star-1.6/autoconf/config.sub sed 's/^X//' >star-1.6/autoconf/config.sub << 'END-of-star-1.6/autoconf/config.sub' X#! /bin/sh X# @(#)config.sub 1.13 18/10/03 Copyright 1999-2017 J. Schilling X# X# Configuration validation subroutine script, version 1.1. X# Copyright (C) 1991, 92-97, 1998 Free Software Foundation, Inc. X# This file is (in principle) common to ALL GNU software. X# The presence of a machine in this file suggests that SOME GNU software X# can handle that machine. It does not imply ALL GNU software can. X# X# This file is free software; you can redistribute it and/or modify X# it under the terms of the GNU General Public License as published by X# the Free Software Foundation; either version 2 of the License, or X# (at your option) any later version. X# X# This program is distributed in the hope that it will be useful, X# but WITHOUT ANY WARRANTY; without even the implied warranty of X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X# GNU General Public License for more details. X# X# You should have received a copy of the GNU General Public License X# along with this program; if not, write to the Free Software X# Foundation, Inc., 59 Temple Place - Suite 330, X# Boston, MA 02111-1307, USA. X X# As a special exception to the GNU General Public License, if you X# distribute this file as part of a program that contains a X# configuration script generated by Autoconf, you may include it under X# the same distribution terms that you use for the rest of that program. X X# Configuration subroutine to validate and canonicalize a configuration type. X# Supply the specified configuration type as an argument. X# If it is invalid, we print an error message on stderr and exit with code 1. X# Otherwise, we print the canonical config type on stdout and succeed. X X# This file is supposed to be the same for all GNU packages X# and recognize all the CPU types, system types and aliases X# that are meaningful with *any* GNU software. X# Each package is responsible for reporting which valid configurations X# it does not support. The user should be able to distinguish X# a failure to support a valid configuration from a meaningless X# configuration. X X# The goal of this file is to map all the various variations of a given X# machine specification into a single specification in the form: X# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM X# or in some cases, the newer four-part form: X# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM X# It is wrong to echo any other type of specification. X Xif [ x$1 = x ] Xthen X echo Configuration name missing. 1>&2 X echo "Usage: $0 CPU-MFR-OPSYS" 1>&2 X echo "or $0 ALIAS" 1>&2 X echo where ALIAS is a recognized configuration type. 1>&2 X exit 1 Xfi X X# First pass through any local machine types. Xcase $1 in X *local*) X echo $1 X exit 0 X ;; X *) X ;; Xesac X X# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). X# Here we must recognize all the valid KERNEL-OS combinations. Xmaybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` Xcase $maybe_os in X linux-gnu*) X os=-$maybe_os X basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` X ;; X *) X basic_machine=`echo $1 | sed 's/-[^-]*$//'` X if [ $basic_machine != $1 ] X then os=`echo $1 | sed 's/.*-/-/'` X else os=; fi X ;; Xesac X X### Let's recognize common machines as not being operating systems so X### that things like config.sub decstation-3100 work. We also X### recognize some manufacturers as not being operating systems, so we X### can provide default operating systems below. Xcase $os in X -sun*os*) X # Prevent following clause from handling this invalid input. X ;; X -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ X -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ X -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ X -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ X -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ X -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ X -apple) X os= X basic_machine=$1 X ;; X -hiux*) X os=-hiuxwe2 X ;; X -sco5) X os=sco3.2v5 X basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` X ;; X -sco4) X os=-sco3.2v4 X basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` X ;; X -sco3.2.[4-9]*) X os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` X basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` X ;; X -sco3.2v[4-9]*) X # Don't forget version if it is 3.2v4 or newer. X basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` X ;; X -sco*) X os=-sco3.2v2 X basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` X ;; X -isc) X os=-isc2.2 X basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` X ;; X -clix*) X basic_machine=clipper-intergraph X ;; X -isc*) X basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` X ;; X -lynx*) X os=-lynxos X ;; X -ptx*) X basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` X ;; X -windowsnt*) X os=`echo $os | sed -e 's/windowsnt/winnt/'` X ;; X -psos*) X os=-psos X ;; Xesac X X# Decode aliases for certain CPU-COMPANY combinations. Xcase $basic_machine in X # Recognize the basic CPU types without company name. X # Some are omitted here because they have special meanings below. X tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc \ X | aarch64 | arm \ X | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \ X | 580 | i960 | h8300 | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0? \ X | alpha | alphaev5 | alphaev56 | we32k | ns16k | clipper \ X | i370 | sh | powerpc | powerpcle | 1750a | dsp16xx | pdp11 \ X | mips64 | mipsel | mips64el | mips64orion | mips64orionel \ X | mipstx39 | mipstx39el \ X | sparc | sparclet | sparclite | sparc64 | v850) X basic_machine=$basic_machine-unknown X ;; X X # We use `pc' rather than `unknown' X # because (1) that's what they normally are, and X # (2) the word "unknown" tends to confuse beginning users. X i[34567]86) X basic_machine=$basic_machine-pc X ;; X # Object if more than one company name word. X *-*-*) X echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 X exit 1 X ;; X # Recognize the basic CPU types with company name. X vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \ X | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* \ X | aarch64-* | arm-* \ X | c[123]* \ X | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ X | power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \ X | xmp-* | ymp-* | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0?-* \ X | ia64-* \ X | alpha-* | alphaev5-* | alphaev56-* | alphaev6-* | we32k-* | cydra-* \ X | ns16k-* | pn-* | np1-* | xps100-* | clipper-* | orion-* \ X | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \ X | sparc64-* | mips64-* | mipsel-* \ X | mips64el-* | mips64orion-* | mips64orionel-* \ X | mipstx39-* | mipstx39el-* \ X | f301-* \ X | x86-* | x86_64-* | amd64-*) X ;; X # Recognize the various machine names and aliases which stand X # for a CPU type and a company and sometimes even an OS. X 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) X basic_machine=m68000-att X ;; X 3b*) X basic_machine=we32k-att X ;; X alliant | fx80) X basic_machine=fx80-alliant X ;; X altos | altos3068) X basic_machine=m68k-altos X ;; X am29k) X basic_machine=a29k-none X os=-bsd X ;; X amdahl) X basic_machine=580-amdahl X os=-sysv X ;; X amiga | amiga-*) X basic_machine=m68k-cbm X ;; X amigaos | amigados) X basic_machine=m68k-cbm X os=-amigaos X ;; X amigaunix | amix) X basic_machine=m68k-cbm X os=-sysv4 X ;; X apollo68) X basic_machine=m68k-apollo X os=-sysv X ;; X aux) X basic_machine=m68k-apple X os=-aux X ;; X balance) X basic_machine=ns32k-sequent X os=-dynix X ;; X convex-c1) X basic_machine=c1-convex X os=-bsd X ;; X convex-c2) X basic_machine=c2-convex X os=-bsd X ;; X convex-c32) X basic_machine=c32-convex X os=-bsd X ;; X convex-c34) X basic_machine=c34-convex X os=-bsd X ;; X convex-c38) X basic_machine=c38-convex X os=-bsd X ;; X cray | ymp) X basic_machine=ymp-cray X os=-unicos X ;; X cray2) X basic_machine=cray2-cray X os=-unicos X ;; X [ctj]90-cray) X basic_machine=c90-cray X os=-unicos X ;; X crds | unos) X basic_machine=m68k-crds X ;; X da30 | da30-*) X basic_machine=m68k-da30 X ;; X decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) X basic_machine=mips-dec X ;; X delta | 3300 | motorola-3300 | motorola-delta \ X | 3300-motorola | delta-motorola) X basic_machine=m68k-motorola X ;; X delta88) X basic_machine=m88k-motorola X os=-sysv3 X ;; X dpx20 | dpx20-*) X basic_machine=rs6000-bull X os=-bosx X ;; X dpx2* | dpx2*-bull) X basic_machine=m68k-bull X os=-sysv3 X ;; X ebmon29k) X basic_machine=a29k-amd X os=-ebmon X ;; X elxsi) X basic_machine=elxsi-elxsi X os=-bsd X ;; X encore | umax | mmax) X basic_machine=ns32k-encore X ;; X fx2800) X basic_machine=i860-alliant X ;; X genix) X basic_machine=ns32k-ns X ;; X gmicro) X basic_machine=tron-gmicro X os=-sysv X ;; X h3050r* | hiux*) X basic_machine=hppa1.1-hitachi X os=-hiuxwe2 X ;; X h8300hms) X basic_machine=h8300-hitachi X os=-hms X ;; X harris) X basic_machine=m88k-harris X os=-sysv3 X ;; X hp300-*) X basic_machine=m68k-hp X ;; X hp300bsd) X basic_machine=m68k-hp X os=-bsd X ;; X hp300hpux) X basic_machine=m68k-hp X os=-hpux X ;; X hp9k2[0-9][0-9] | hp9k31[0-9]) X basic_machine=m68000-hp X ;; X hp9k3[2-9][0-9]) X basic_machine=m68k-hp X ;; X hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7) X basic_machine=hppa1.1-hp X ;; X hp9k8[0-9][0-9] | hp8[0-9][0-9]) X basic_machine=hppa1.0-hp X ;; X hppa-next) X os=-nextstep3 X ;; X i370-ibm* | ibm*) X basic_machine=i370-ibm X os=-mvs X ;; X# I'm not sure what "Sysv32" means. Should this be sysv3.2? X i[34567]86v32) X basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` X os=-sysv32 X ;; X i[34567]86v4*) X basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` X os=-sysv4 X ;; X i[34567]86v) X basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` X os=-sysv X ;; X i[34567]86sol2) X basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` X os=-solaris2 X ;; X iris | iris4d) X basic_machine=mips-sgi X case $os in X -irix*) X ;; X *) X os=-irix4 X ;; X esac X ;; X isi68 | isi) X basic_machine=m68k-isi X os=-sysv X ;; X m88k-omron*) X basic_machine=m88k-omron X ;; X magnum | m3230) X basic_machine=mips-mips X os=-sysv X ;; X merlin) X basic_machine=ns32k-utek X os=-sysv X ;; X miniframe) X basic_machine=m68000-convergent X ;; X mipsel*-linux*) X basic_machine=mipsel-unknown X os=-linux-gnu X ;; X mips*-linux*) X basic_machine=mips-unknown X os=-linux-gnu X ;; X mips3*-*) X basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` X ;; X mips3*) X basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown X ;; X ncr3000) X basic_machine=i486-ncr X os=-sysv4 X ;; X news | news700 | news800 | news900) X basic_machine=m68k-sony X os=-newsos X ;; X news1000) X basic_machine=m68030-sony X os=-newsos X ;; X news-3600 | risc-news) X basic_machine=mips-sony X os=-newsos X ;; X next | m*-next ) X basic_machine=m68k-next X case $os in X -nextstep* ) X ;; X -ns2*) X os=-nextstep2 X ;; X *) X os=-nextstep3 X ;; X esac X ;; X nh3000) X basic_machine=m68k-harris X os=-cxux X ;; X nh[45]000) X basic_machine=m88k-harris X os=-cxux X ;; X nindy960) X basic_machine=i960-intel X os=-nindy X ;; X np1) X basic_machine=np1-gould X ;; X pa-hitachi) X basic_machine=hppa1.1-hitachi X os=-hiuxwe2 X ;; X paragon) X basic_machine=i860-intel X os=-osf X ;; X parisc-unknown) X basic_machine=parisc-unknown X ;; X pbd) X basic_machine=sparc-tti X ;; X pbb) X basic_machine=m68k-tti X ;; X pc532 | pc532-*) X basic_machine=ns32k-pc532 X ;; X pentium | p5 | k5 | nexen) X basic_machine=i586-pc X ;; X pentiumpro | p6 | k6 | 6x86) X basic_machine=i686-pc X ;; X pentiumii | pentium2) X basic_machine=i786-pc X ;; X pentium-* | p5-* | k5-* | nexen-*) X basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` X ;; X pentiumpro-* | p6-* | k6-* | 6x86-*) X basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` X ;; X pentiumii-* | pentium2-*) X basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` X ;; X pn) X basic_machine=pn-gould X ;; X power) basic_machine=rs6000-ibm X ;; X ppc) basic_machine=powerpc-unknown X ;; X ppc64) basic_machine=powerpc64-unknown X ;; X ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` X ;; X ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` X ;; X ppcle | powerpclittle | ppc-le | powerpc-little) X basic_machine=powerpcle-unknown X ;; X ppcle-* | powerpclittle-*) X basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` X ;; X ps2) X basic_machine=i386-ibm X ;; X rm[46]00) X basic_machine=mips-siemens X ;; X rtpc | rtpc-*) X basic_machine=romp-ibm X ;; X s390 | s390-*) X basic_machine=s390-ibm X ;; X s390x | s390x-*) X basic_machine=s390x-ibm X ;; X sequent) X basic_machine=i386-sequent X ;; X sh) X basic_machine=sh-hitachi X os=-hms X ;; X sps7) X basic_machine=m68k-bull X os=-sysv2 X ;; X spur) X basic_machine=spur-unknown X ;; X sun2) X basic_machine=m68000-sun X ;; X sun2os3) X basic_machine=m68000-sun X os=-sunos3 X ;; X sun2os4) X basic_machine=m68000-sun X os=-sunos4 X ;; X sun3os3) X basic_machine=m68k-sun X os=-sunos3 X ;; X sun3os4) X basic_machine=m68k-sun X os=-sunos4 X ;; X sun4os3) X basic_machine=sparc-sun X os=-sunos3 X ;; X sun4os4) X basic_machine=sparc-sun X os=-sunos4 X ;; X sun4sol2) X basic_machine=sparc-sun X os=-solaris2 X ;; X sun3 | sun3-*) X basic_machine=m68k-sun X ;; X sun4) X basic_machine=sparc-sun X ;; X sun386 | sun386i | roadrunner) X basic_machine=i386-sun X ;; X symmetry) X basic_machine=i386-sequent X os=-dynix X ;; X tx39) X basic_machine=mipstx39-unknown X ;; X tx39el) X basic_machine=mipstx39el-unknown X ;; X tower | tower-32) X basic_machine=m68k-ncr X ;; X udi29k) X basic_machine=a29k-amd X os=-udi X ;; X ultra3) X basic_machine=a29k-nyu X os=-sym1 X ;; X vaxv) X basic_machine=vax-dec X os=-sysv X ;; X vms) X basic_machine=vax-dec X os=-vms X ;; X vpp*|vx|vx-*) X basic_machine=f301-fujitsu X ;; X vxworks960) X basic_machine=i960-wrs X os=-vxworks X ;; X vxworks68) X basic_machine=m68k-wrs X os=-vxworks X ;; X vxworks29k) X basic_machine=a29k-wrs X os=-vxworks X ;; X xmp) X basic_machine=xmp-cray X os=-unicos X ;; X xps | xps100) X basic_machine=xps100-honeywell X ;; X none) X basic_machine=none-none X os=-none X ;; X X# Here we handle the default manufacturer of certain CPU types. It is in X# some cases the only manufacturer, in others, it is the most popular. X mips) X if [ x$os = x-linux-gnu ]; then X basic_machine=mips-unknown X else X basic_machine=mips-mips X fi X ;; X romp) X basic_machine=romp-ibm X ;; X rs6000) X basic_machine=rs6000-ibm X ;; X vax) X basic_machine=vax-dec X ;; X pdp11) X basic_machine=pdp11-dec X ;; X we32k) X basic_machine=we32k-att X ;; X sparc) X basic_machine=sparc-sun X ;; X cydra) X basic_machine=cydra-cydrome X ;; X orion) X basic_machine=orion-highlevel X ;; X orion105) X basic_machine=clipper-highlevel X ;; X *) X echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 X exit 1 X ;; Xesac X X# Here we canonicalize certain aliases for manufacturers. Xcase $basic_machine in X *-digital*) X basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` X ;; X *-commodore*) X basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` X ;; X *) X ;; Xesac X X# Decode manufacturer-specific aliases for certain operating systems. X Xif [ x"$os" != x"" ] Xthen Xcase $os in X # First match some system type aliases X # that might get confused with valid system types. X # -solaris* is a basic system type, with this one exception. X -solaris1 | -solaris1.*) X os=`echo $os | sed -e 's|solaris1|sunos4|'` X ;; X -solaris) X os=-solaris2 X ;; X -svr4*) X os=-sysv4 X ;; X -unixware*) X os=-sysv4.2uw X ;; X -gnu/linux*) X os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` X ;; X # First accept the basic system types. X # The portable systems comes first. X # Each alternative MUST END IN A *, to match a version number. X # -sysv* is not here because it comes later, after sysvr4. X -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ X | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ X | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ X | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ X | -aos* \ X | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ X | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ X | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -dragonfly* \ X | -bitrig* \ X | -minix* \ X | -riscix* \ X | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \ X | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ X | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ X | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ X | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -os2* \ X | -interix* | -uwin* | -mks* | -rhapsody* | -macos* | -pyro* \ X | -haiku* | -syllable* | -os400* ) X # Remember, each alternative MUST END IN *, to match a version number. X ;; X -linux*) X os=`echo $os | sed -e 's|linux|linux-gnu|'` X ;; X -sunos5*) X os=`echo $os | sed -e 's|sunos5|solaris2|'` X ;; X -sunos6*) X os=`echo $os | sed -e 's|sunos6|solaris3|'` X ;; X -osfrose*) X os=-osfrose X ;; X -osf*) X os=-osf X ;; X -utek*) X os=-bsd X ;; X -dynix*) X os=-bsd X ;; X -acis*) X os=-aos X ;; X -ctix* | -uts*) X os=-sysv X ;; X -ns2 ) X os=-nextstep2 X ;; X # Preserve the version number of sinix5. X -sinix5.*) X os=`echo $os | sed -e 's|sinix|sysv|'` X ;; X -sinix*) X os=-sysv4 X ;; X -triton*) X os=-sysv3 X ;; X -oss*) X os=-sysv3 X ;; X -svr4) X os=-sysv4 X ;; X -svr3) X os=-sysv3 X ;; X # For sys5.3 apollo X -sys5.3) X os=-sysv3 X ;; X -sysvr4) X os=-sysv4 X ;; X # This must come after -sysvr4. X -sysv*) X ;; X -xenix) X os=-xenix X ;; X -freemint) X os=-freemint X ;; X -mint) X os=-mint X ;; X -tos) X os=-tos X ;; X X -none) X ;; X *) X # Get rid of the `-' at the beginning of $os. X os=`echo $os | sed 's/[^-]*-//'` X echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 X exit 1 X ;; Xesac Xelse X X# Here we handle the default operating systems that come with various machines. X# The value should be what the vendor currently ships out the door with their X# machine or put another way, the most popular os provided with the machine. X X# Note that if you're going to try to match "-MANUFACTURER" here (say, X# "-sun"), then you have to tell the case statement up towards the top X# that MANUFACTURER isn't an operating system. Otherwise, code above X# will signal an error saying that MANUFACTURER isn't an operating X# system, and we'll never get to this point. X Xcase $basic_machine in X *-acorn) X os=-riscix1.2 X ;; X arm*-semi) X os=-aout X ;; X pdp11-*) X os=-none X ;; X *-dec | vax-*) X os=-ultrix4.2 X ;; X m68*-apollo) X os=-domain X ;; X i386-sun) X os=-sunos4.0.2 X ;; X m68000-sun) X os=-sunos3 X # This also exists in the configure program, but was not the X # default. X # os=-sunos4 X ;; X *-tti) # must be before sparc entry or we get the wrong os. X os=-sysv3 X ;; X sparc-* | *-sun) X os=-sunos4.1.1 X ;; X *-be) X os=-beos X ;; X *-haiku) X os=-haiku X ;; X *-ibm) X os=-aix X ;; X *-hp) X os=-hpux X ;; X *-hitachi) X os=-hiux X ;; X i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) X os=-sysv X ;; X *-cbm) X os=-amigaos X ;; X *-dg) X os=-dgux X ;; X *-dolphin) X os=-sysv3 X ;; X m68k-ccur) X os=-rtu X ;; X m88k-omron*) X os=-luna X ;; X *-next ) X os=-nextstep X ;; X *-sequent) X os=-ptx X ;; X *-crds) X os=-unos X ;; X *-ns) X os=-genix X ;; X i370-*) X os=-mvs X ;; X *-next) X os=-nextstep3 X ;; X *-gould) X os=-sysv X ;; X *-highlevel) X os=-bsd X ;; X *-encore) X os=-bsd X ;; X *-sgi) X os=-irix X ;; X *-siemens) X os=-sysv4 X ;; X *-masscomp) X os=-rtu X ;; X f301-fujitsu) X os=-uxpv X ;; X *) X os=-none X ;; Xesac Xfi X X# Here we handle the case where we know the os, and the CPU type, but not the X# manufacturer. We pick the logical manufacturer. Xvendor=unknown Xcase $basic_machine in X *-unknown) X case $os in X -riscix*) X vendor=acorn X ;; X -sunos*) X vendor=sun X ;; X -aix*) X vendor=ibm X ;; X -os400*) X vendor=ibm X ;; X -hpux*) X vendor=hp X ;; X -hiux*) X vendor=hitachi X ;; X -unos*) X vendor=crds X ;; X -dgux*) X vendor=dg X ;; X -luna*) X vendor=omron X ;; X -genix*) X vendor=ns X ;; X -mvs*) X vendor=ibm X ;; X -ptx*) X vendor=sequent X ;; X -vxsim* | -vxworks*) X vendor=wrs X ;; X -aux*) X vendor=apple X ;; X esac X basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` X ;; Xesac X Xecho $basic_machine$os END-of-star-1.6/autoconf/config.sub echo x - star-1.6/autoconf/configure.in sed 's/^X//' >star-1.6/autoconf/configure.in << 'END-of-star-1.6/autoconf/configure.in' Xdnl @(#)configure.in 1.294 19/03/18 Copyright 1998-2019 J. Schilling Xdnl Process this file with autoconf to produce a configure script. XAC_REVISION(1.294)dnl X Xdnl AC_INIT(xconfig.h.in) XAC_INIT(config.guess) XAC_CONFIG_HEADER(xconfig.h) XAC_CANONICAL_HOST X Xdnl Checks for programs. XAC_SHELL_BASH XAC_BIN_SHELL_BASH XAC_SHELL_CE_BROKEN XAC_BIN_SHELL_CE_BROKEN XAC_BIN_SHELL_BOSH XAC_OPT_SCHILY_BIN_SHELL_BOSH Xdnl CC=${CC-cc} Xdnl AC_PROG_CC XAC_CHECK_PROG(CC, cc, cc, gcc) dnl we default to cc not gcc Xdnl The cross compile concepts from GNU autoconf are not usable. Xdnl We permit to execute test programs on a remote machine while Xdnl running "configure" in a cross compile environment. XAC_PROG_CC dnl now check for cross compiling Xdnl cross_compiling=remote dnl disable GNU cross compile "defaults" Xdnl rmtcall="$CONFIG_RMTCALL" dnl enable script for remote execution Xdnl remote execution of test programs may be set up with: Xdnl CONFIG_RMTCALL=script-path Xdnl and Xdnl CONFIG_RMTHOST=host or CONFIG_RMTHOST=user@host Xdnl If AC_PROG_CC detects a cross compiler and CONFIG_RMTCALL is set, then Xdnl all test programs are automatically transferred to the test machine Xdnl and run on that machine. XAC_REMOTE_PARMS dnl check for correct remote parameters XAC_OBJEXT XAC_EXEEXT XAC_PROG_CPP XAC_PROG_CPPX XAC_SUN_CC64_OPT XAC_HP_CC_ANSI_OPT XAC_HP_CC_OPT_OPT XAC_HP_CC_GPROF_OPT Xdnl AC_PROG_INSTALL XAC_PROG_RANLIB XAC_PROG_MAKE_SET XAC_CHECK_PROGS(YACC, yacc 'bison -y' byacc, noyacc) XAC_CHECK_PROGS(BISON, bison, nobison) X# X# We need both tsort/lorder or none of them X# XAC_PATH_PROG(LORDER, lorder, echo, $PATH:/usr/ccs/bin) Xif test "$LORDER" = echo; then X TSORT=cat Xelse X AC_PATH_PROG(TSORT, tsort, cat, $PATH:/usr/ccs/bin) X if test "$TSORT" = cat; then X LORDER=echo X fi Xfi X Xdnl Checks for header files. XAC_HEADER_STDC XAC_CHECK_HEADERS(stdarg.h stdlib.h string.h float.h) dnl AC_HEADER_STDC in particular XAC_HEADER_INTTYPES XAC_HEADER_STDINT Xac_xsave_LIBS="$LIBS" XLIBS="" XAC_HEADER_DIRENT Xlib_dir="$LIBS" XLIBS="$ac_xsave_LIBS" XAC_HEADER_STAT XAC_HEADER_TIME XAC_HEADER_SYS_WAIT Xdnl check whether select() needs sys/select.h XAC_HEADER_SYS_SELECT Xdnl check whether select() needs sys/socket.h (BeOS) XAC_HEADER_SELECT2 XAC_CHECK_HEADERS(ar.h) XAC_CHECK_HEADERS(assert.h) XAC_CHECK_HEADERS(stdio.h varargs.h stdarg.h stdlib.h stddef.h string.h strings.h unistd.h fcntl.h io.h sys/file.h) XAC_CHECK_HEADERS(conio.h) XAC_CHECK_HEADERS(getopt.h) XAC_CHECK_HEADERS(limits.h) XAC_CHECK_HEADERS(a.out.h aouthdr.h elf.h) XAC_CHECK_HEADERS(sysexits.h) XAC_CHECK_HEADERS(malloc.h posix/malloc.h sgtty.h termios.h termio.h) XAC_CHECK_HEADERS(pwd.h grp.h sys/acl.h aclutils.h acllib.h acl/libacl.h) XAC_CHECK_HEADERS(signal.h siginfo.h sys/siginfo.h ucontext.h) XAC_CHECK_HEADERS(shadow.h syslog.h) XAC_CHECK_HEADERS(sys/time.h sys/times.h utime.h sys/utime.h sys/ioctl.h sys/filio.h sys/param.h sys/systeminfo.h sys/sysctl.h) XAC_CHECK_HEADERS(sys/loadavg.h) XAC_CHECK_HEADERS(sys/syscall.h) XAC_CHECK_HEADERS(mach/machine.h) XAC_CHECK_HEADERS(mntent.h sys/mntent.h sys/mnttab.h sys/mount.h) XAC_CHECK_HEADERS(sys/fork.h vfork.h wait.h sys/wait.h sys/resource.h procfs.h sys/procfs.h libproc.h) XAC_CHECK_HEADERS(ulimit.h) XAC_CHECK_HEADERS(process.h) XAC_CHECK_HEADERS(sys/utsname.h sys/priocntl.h sys/rtpriocntl.h sys/procset.h) XAC_CHECK_HEADERS(sys/mtio.h sys/tape.h sys/mman.h linux/pg.h camlib.h) XAC_CHECK_HEADERS(sys/shm.h sys/sem.h sys/ipc.h semaphore.h) XAC_CHECK_HEADERS(sys/dkio.h sys/dklabel.h sun/dkio.h sun/dklabel.h) XAC_CHECK_HEADERS(sys/types.h sys/stat.h types.h stat.h) XAC_CHECK_HEADERS(sys/stypes.h sys/filedesc.h) XAC_CHECK_HEADERS(sys/acct.h) XAC_CHECK_HEADERS(poll.h sys/poll.h sys/select.h) XAC_CHECK_HEADERS(netdb.h arpa/aixrcmds.h sys/socket.h netinet/in.h stropts.h) XAC_CHECK_HEADERS(ieeefp.h fp.h) XAC_CHECK_HEADERS(values.h float.h math.h) XAC_CHECK_HEADERS(arpa/inet.h) XAC_CHECK_HEADERS(rpc/rpc.h) XAC_CHECK_HEADERS(bsd/dev/scsireg.h) Xdnl Check for HP-UX sys/bsdtty.h (needed for TIOCGPGRP) XAC_CHECK_HEADERS(sys/bsdtty.h) Xdnl Check for Linux kernel definitions XAC_CHECK_HEADERS(scsi/scsi.h scsi/sg.h linux/scsi.h linux.sg.h) XAC_CHECK_HEADERS(linux/types.h linux/gfp.h asm/types.h) XAC_CHECK_HEADERS(sys/capability.h) XAC_CHECK_HEADERS(selinux/selinux.h) Xdnl Check for BeOS kernel definitions (e.g. B_PAGE_SIZE) XAC_CHECK_HEADERS(OS.h) Xdnl needed for newer OS/2 versions of EMX XAC_CHECK_HEADERS(os2.h) XAC_CHECK_HEADERS(os2me.h) Xdnl Check for MS-Win's junkyard XAC_CHECK_HEADERS(windows.h) Xdnl Check for moving Linux targets caused by missing concepts XAC_CHECK_HEADERS(linux/fs.h ext2fs/ext2_fs.h) Xdnl Check for Linux Extended File Attributes definitions XAC_CHECK_HEADERS(sys/xattr.h) XAC_CHECK_HEADERS(attr/xattr.h) Xdnl Check for Mas OS X ac, av, env delarations XAC_CHECK_HEADERS(crt_externs.h) XAC_CHECK_HEADERS(fnmatch.h) XAC_CHECK_HEADERS(libintl.h locale.h langinfo.h nl_types.h) XAC_CHECK_HEADERS(ctype.h wctype.h wchar.h iconv.h) XAC_CHECK_HEADERS(priv.h sys/priv.h) XAC_CHECK_HEADERS(exec_attr.h secdb.h) XAC_CHECK_HEADERS(direct.h) XAC_CHECK_HEADERS(pthread.h thread.h) XAC_CHECK_HEADERS(libgen.h) XAC_CHECK_HEADERS(regex.h regexp.h regexpr.h) XAC_CHECK_HEADERS(dlfcn.h link.h dl.h libelf.h) XAC_CHECK_HEADERS(ranlib.h) XAC_CHECK_HEADERS(expat.h) X Xdnl from aclocal.m4 (uses AC_TRY_COMPILE) XAC_HEADER_MAKEDEV X Xdnl don't use GNU original Xdnl from GNU acspecific.m4 (uses AC_CHECK_HEADER) Xdnl AC_HEADER_MAJOR X XAC_CHECK_MINOR_BITS XAC_CHECK_MINOR_NONCONTIG X XAC_HEADER_USG_STDIO XAC_HEADER_ERRNO_DEF XAC_HEADER_ENVIRON_DEF XAC_HEADER_SYS_SIGLIST_DEF XAC_WNOWAIT_WAITPID X Xdnl Checks for typedefs, structures, and compiler characteristics. XAC_C_CONST XAC_C_BIGENDIAN XAC_C_BITFIELDS XAC_C_STRINGIZE XAC_C_INLINE XAC_TYPE_SIGNAL XAC_TYPE_GETGROUPS XAC_TYPE_LONGLONG XAC_TYPE___INT64 XAC_TYPE_LONGDOUBLE XAC_TYPE_PROTOTYPES Xdnl AC_USER_MALLOC must be past AC_CHECK_FUNCS(strdup) XAC_DYN_ARRAYS XAC_PRAGMA_WEAK X Xdnl This is a hack to compile two files and to check whether a weak alias from Xdnl one file can be seen in another file. The reason for this test is to detect Xdnl a bug on Cygwin that causes waek symbols to become "local" symbols that Xdnl are useless because they would be invisible for other parts of the code. X Xif test $ac_cv_pragma_weak = yes; then XAC_TRY_COMPILE2([#pragma weak weakname = conffunc],[],[true],[true]) Xac_save_LIBS="$LIBS" XLIBS="conftest2.$ac_cv_objext" XAC_CACHE_CHECK([if linker allows pragma weak], ac_cv_link_weak, X [AC_TRY_LINK([extern int weakname();], X[return weakname();], X [ac_cv_link_weak=yes], X [ac_cv_link_weak=no])]) XLIBS="$ac_save_LIBS" Xif test $ac_cv_link_weak = yes; then X AC_DEFINE(HAVE_LINK_WEAK) Xfi Xrm -f conftest2.* Xfi X XAC_TYPE_UID_T XAC_TYPE_SIZE_T XAC_CHECK_TYPE(ssize_t, int) XAC_CHECK_TYPE(ptrdiff_t, int) XAC_TYPE_PID_T XAC_TYPE_OFF_T XAC_TYPE_MODE_T XAC_TYPE_TIME_T XAC_CHECK_TYPE(caddr_t, char *) XAC_CHECK_TYPE(daddr_t, long) XAC_CHECK_TYPE(dev_t, unsigned short) XAC_CHECK_TYPE(major_t, dev_t) XAC_CHECK_TYPE(minor_t, dev_t) XAC_CHECK_TYPE(ino_t, unsigned long) XAC_CHECK_TYPE(nlink_t, unsigned long) XAC_CHECK_TYPE(blksize_t, long) XAC_CHECK_TYPE(blkcnt_t, Intmax_t) XAC_TYPE_CLOCK_T XAC_TYPE_SOCKLEN_T XAC_HAVE_TYPE([#include ], greg_t) XAC_HAVE_TYPE([#include ], rlim_t) Xdnl NetBSD-5 has an idtype_t that is in conflict with POSIX Xdnl AC_HAVE_TYPE([#include ], idtype_t) XAC_TYPE_IDTYPE_T XAC_HAVE_TYPE([#include ], siginfo_t) XAC_TYPE_STACK_T XAC_TYPE_SIGINFO_T X Xdnl These types are present on all UNIX systems but should be avoided Xdnl for portability. Xdnl On Apollo/Domain OS we don't have them.... Xdnl Better include and use Uchar, Uint & Ulong XAC_CHECK_TYPE(u_char, unsigned char) XAC_CHECK_TYPE(u_short, unsigned short) XAC_CHECK_TYPE(u_int, unsigned int) XAC_CHECK_TYPE(u_long, unsigned long) X XAC_INCL_CHECK_TYPE( X[#ifdef HAVE_INTTYPES_H X#include X#endif X#ifdef HAVE_STDINT_H X#include X#endif X], int8_t, Int8_t) X XAC_INCL_CHECK_TYPE( X[#ifdef HAVE_INTTYPES_H X#include X#endif X#ifdef HAVE_STDINT_H X#include X#endif X], int16_t, Int16_t) X XAC_INCL_CHECK_TYPE( X[#ifdef HAVE_INTTYPES_H X#include X#endif X#ifdef HAVE_STDINT_H X#include X#endif X], int32_t, Int32_t) X XAC_INCL_CHECK_TYPE( X[#ifdef HAVE_INTTYPES_H X#include X#endif X#ifdef HAVE_STDINT_H X#include X#endif X], int64_t, Int64_t) X XAC_INCL_CHECK_TYPE( X[#ifdef HAVE_INTTYPES_H X#include X#endif X#ifdef HAVE_STDINT_H X#include X#endif X], intmax_t, Intmax_t) X XAC_INCL_CHECK_TYPE( X[#ifdef HAVE_INTTYPES_H X#include X#endif X#ifdef HAVE_STDINT_H X#include X#endif X], intptr_t, Intptr_t) X XAC_INCL_CHECK_TYPE( X[#ifdef HAVE_INTTYPES_H X#include X#endif X#ifdef HAVE_STDINT_H X#include X#endif X], uint8_t, UInt8_t) X XAC_INCL_CHECK_TYPE( X[#ifdef HAVE_INTTYPES_H X#include X#endif X#ifdef HAVE_STDINT_H X#include X#endif X], uint16_t, UInt16_t) X XAC_INCL_CHECK_TYPE( X[#ifdef HAVE_INTTYPES_H X#include X#endif X#ifdef HAVE_STDINT_H X#include X#endif X], uint32_t, UInt32_t) X XAC_INCL_CHECK_TYPE( X[#ifdef HAVE_INTTYPES_H X#include X#endif X#ifdef HAVE_STDINT_H X#include X#endif X], uint64_t, UInt64_t) X XAC_INCL_CHECK_TYPE( X[#ifdef HAVE_INTTYPES_H X#include X#endif X#ifdef HAVE_STDINT_H X#include X#endif X], uintmax_t, UIntmax_t) X XAC_INCL_CHECK_TYPE( X[#ifdef HAVE_INTTYPES_H X#include X#endif X#ifdef HAVE_STDINT_H X#include X#endif X], uintptr_t, UIntptr_t) X XAC_INCL_CHECK_TYPE( X[#ifdef HAVE_WCHAR_H X#include X#endif X#ifdef HAVE_WCTYPE_H X#include X#endif X], wctype_t, int) X XAC_INCL_CHECK_TYPE( X[#ifdef HAVE_WCHAR_H X#include X#endif X#ifdef HAVE_WCTYPE_H X#include X#endif X#include X], wint_t, int) X XAC_INCL_CHECK_TYPE( X[#ifdef HAVE_WCHAR_H X#include X#endif X#ifdef HAVE_WCTYPE_H X#include X#endif X], mbstate_t, int) X XAC_INCL_CHECK_TYPE( X#ifdef HAVE_SYS_STAT_H X[#include X#endif X#ifdef HAVE_STAT_H X#include X#endif X], timestruc_t, struct timespec) X XAC_CHECK_SIZEOF(char) XAC_CHECK_SIZEOF(short int) XAC_CHECK_SIZEOF(int) XAC_CHECK_SIZEOF(long int) XAC_CHECK_SIZEOF(long long) XAC_CHECK_SIZEOF(__int64) XAC_CHECK_SIZEOF(char *) X XAC_CHECK_SIZEOF(unsigned char) XAC_CHECK_SIZEOF(unsigned short int) XAC_CHECK_SIZEOF(unsigned int) XAC_CHECK_SIZEOF(unsigned long int) XAC_CHECK_SIZEOF(unsigned long long) XAC_CHECK_SIZEOF(unsigned __int64) XAC_CHECK_SIZEOF(unsigned char *) XAC_CHECK_SIZEOF(float) XAC_CHECK_SIZEOF(double) XAC_CHECK_SIZEOF(long double) X XAC_CHECK_SIZEOF(size_t) XAC_CHECK_SIZEOF(ssize_t) XAC_CHECK_SIZEOF(ptrdiff_t) X XAC_CHECK_SIZEOF(mode_t) XAC_CHECK_SIZEOF(uid_t) XAC_CHECK_SIZEOF(gid_t) XAC_CHECK_SIZEOF(pid_t) X XAC_CHECK_SIZEOF(dev_t) XAC_CHECK_SIZEOF(major_t) XAC_CHECK_SIZEOF(minor_t) X Xdnl This call must be past AC_CHECK_SIZEOF(long int) XAC_CHECK_SIZE_TIME_T XAC_CHECK_SIZE_WCHAR XAC_CHECK_SIZE_WCHAR_T X Xdnl # AC_TYPE_SIZE_T_ # Defines HAVE_SIZE_T / NO_SIZE_T XAC_TYPE_CHAR XAC_TYPE_VA_LIST XAC_HEADER_FILE__FLAGS XAC_HEADER_FILE__IO_BUF_BASE XAC_STRUCT_TIMEVAL XAC_STRUCT_TIMEZONE XAC_STRUCT_TIMESPEC XAC_STRUCT_MTGET_TYPE XAC_STRUCT_MTGET_MODEL XAC_STRUCT_MTGET_DSREG XAC_STRUCT_MTGET_DSREG1 XAC_STRUCT_MTGET_DSREG2 XAC_STRUCT_MTGET_GSTAT XAC_STRUCT_MTGET_ERREG XAC_STRUCT_MTGET_RESID XAC_STRUCT_MTGET_FILENO XAC_STRUCT_MTGET_BLKNO XAC_STRUCT_MTGET_FLAGS XAC_STRUCT_MTGET_BF XAC_STRUCT_RUSAGE XAC_STRUCT_SI_UTIME XAC_STRUCT_SOCKADDR_STORAGE XAC_STRUCT_UNION_SEMUN XAC_STRUCT_UNION_WAIT XAC_USE_STRUCT_UNION_WAIT XAC_STRUCT_ST_SPARE1 XAC_STRUCT_ST_ATIMENSEC XAC_STRUCT_ST_ATIME_N XAC_STRUCT_ST_NSEC XAC_STRUCT_ST__TIM XAC_STRUCT_ST_ATIMESPEC XAC_STRUCT_ST_BLKSIZE XAC_STRUCT_ST_BLOCKS XAC_STRUCT_ST_FSTYPE XAC_STRUCT_ST_ACLCNT XAC_STRUCT_ST_RDEV XAC_STRUCT_ST_FLAG XAC_STRUCT_ST_FLAGS XAC_STRUCT_DIRENT_D_INO XAC_STRUCT_DIRENT_D_TYPE XAC_STRUCT_DIR_DD_FD XAC_STRUCT_UTSNAME_ARCH XAC_STRUCT_UTSNAME_PROCESSOR XAC_STRUCT_UTSNAME_SYSNAME_HOST XAC_STRUCT_UTSNAME_RELEASE_HOST XAC_STRUCT_UTSNAME_VERSION_HOST X Xdnl Check whether iconv() uses const char ** arguments XAC_ICONV_CONST X Xdnl Check whether we are able to get the address of a function Xdnl or whether the symbol is declared and usable as rhs XAC_CHECK_DECLARE([ X#include X#include ], stat) XAC_CHECK_DECLARE([ X#include X#include ], lstat) X Xdnl Checks for library functions. XAC_FUNC_WAIT3 XAC_FUNC_MLOCK XAC_FUNC_MLOCKALL XAC_FUNC_VA_COPY XAC_FUNC__VA_COPY XAC_FUNC_ECVT XAC_FUNC_FCVT XAC_FUNC_GCVT XAC_FUNC_DTOA XAC_FUNC_DTOA_R XAC_FUNC_GETPAGESIZE XjsAC_FUNC_MMAP XAC_MMAP_SIZEP XAC_FUNC_SMMAP XAC_FUNC_SHMGET XAC_FUNC_ALLOCA XAC_FUNC_QUOTAIOCTL XAC_FUNC_FCNTL_LOCKF XAC_FUNC_UNAME XAC_CHECK_FUNCS(execl) XAC_FUNC_VFORK XAC_FUNC_SYS_SIGLIST XAC_FUNC_BSD_GETPGRP XAC_FUNC_BSD_SETPGRP XAC_FUNC_C99_ISINF XAC_FUNC_C99_ISNAN XAC_FUNC_SIGSETJMP XAC_FUNC_SIGLONGJMP XAC_FUNC_PRINTF_J XAC_FUNC_PRINTF_Z XAC_FUNC_PRINTF_LL XAC_FUNC_REALLOC_NULL XAC_FUNC_WAITID XAC_CHECK_FUNCS(access eaccess euidaccess) XAC_CHECK_FUNCS(memchr memcmp memcpy memccpy memmove memset) XAC_CHECK_FUNCS(brk sbrk strerror nice flock lockf fchdir statvfs quotactl) XAC_CHECK_FUNCS(realpath resolvepath) XAC_CHECK_FUNCS(dup dup2) XAC_CHECK_FUNCS(getcwd shmat semget) XAC_CHECK_FUNCS(lstat readlink symlink link rename mkfifo mknod) XAC_CHECK_FUNCS(setreuid setresuid seteuid setuid) XAC_CHECK_FUNCS(setregid setresgid setegid setgid) XAC_CHECK_FUNCS(getuid geteuid getgid getegid) XAC_CHECK_FUNCS(getpid getppid) XAC_CHECK_FUNCS(getpgid setpgid getsid setsid) XAC_CHECK_FUNCS(getpgrp setpgrp) XAC_CHECK_FUNCS(getpwnam getpwent getpwuid setpwent endpwent) XAC_CHECK_FUNCS(getgrnam getgrent getgrgid setgrent endgrent) Xdnl getspwnam() on HP-UX is in libsec.a XAC_CHECK_FUNCS(getspnam getspwnam) XAC_CHECK_FUNCS(getlogin) Xdnl Cannot simply include "waitid" here as the so called POSIX compliant Xdnl Mac OS X comes with a completely broken waitid() implementation. XAC_CHECK_FUNCS(sync fsync fork forkx vforkx forkall forkallx wait wait4 wait6 waitpid getrusage getrlimit setrlimit ulimit) XAC_CHECK_FUNCS(execl execle execlp execv execve execvp) XAC_CHECK_FUNCS(spawnl spawnle spawnlp spawnlpe) XAC_CHECK_FUNCS(spawnv spawnve spawnvp spawnvpe) XAC_CHECK_FUNCS(cwait) XAC_CHECK_FUNCS(getexecname) XAC_CHECK_FUNCS(getprogname setprogname) XAC_CHECK_FUNCS(proc_pidpath) XAC_CHECK_FUNCS(getloadavg) XAC_CHECK_FUNCS(gethostid gethostname getdomainname getdtablesize) XAC_CHECK_FUNCS(gettimeofday settimeofday time stime gethrtime) XAC_CHECK_FUNCS(ftime tzset mktime gmtime localtime timegm timelocal) XAC_CHECK_FUNCS(ctime cftime ascftime strftime) XAC_CHECK_FUNCS(poll select isastream) XAC_CHECK_FUNCS(chown fchown lchown chmod fchmod lchmod times utime utimes futimes lutimes) XAC_CHECK_FUNCS(utimens lutimens) XAC_CHECK_FUNCS(futimens utimensat) XAC_CHECK_FUNCS(ioctl fcntl) Xdnl AC_CHECK_FUNCS(ecvt fcvt gcvt) XAC_CHECK_FUNCS(qecvt qfcvt qgcvt) XAC_CHECK_FUNCS(_qecvt _qfcvt _qgcvt) XAC_CHECK_FUNCS(_qecvt_r _qfcvt_r _qgcvt_r) XAC_CHECK_FUNCS(_ldecvt _ldfcvt _ldgcvt) XAC_CHECK_FUNCS(ecvt_r fcvt_r gcvt_r) XAC_CHECK_FUNCS(_ldecvt_r _ldfcvt_r _ldgcvt_r) XAC_CHECK_FUNCS(econvert fconvert gconvert) XAC_CHECK_FUNCS(qeconvert qfconvert qgconvert) XAC_CHECK_FUNCS(isinf isnan) XAC_CHECK_FUNCS(getc_unlocked getchar_unlocked putc_unlocked putchar_unlocked) XAC_CHECK_FUNCS(flockfile funlockfile ftrylockfile) XAC_CHECK_FUNCS(rand drand48) XAC_CHECK_FUNCS(strtol strtoll strtoul strtoull strtod) XAC_CHECK_FUNCS(setpriority DosSetPriority) XAC_CHECK_FUNCS(DosAllocSharedMem) XAC_CHECK_FUNCS(getdelim) XAC_CHECK_FUNCS(seekdir fdopendir) Xdnl These are POSIX.1 functions (syscalls on Solaris) XAC_CHECK_FUNCS(openat fstatat fchownat futimesat renameat unlinkat) Xdnl This is a library function for the Solaris extended attr interface XAC_CHECK_FUNCS(attropen) Xdnl This appeared on Solaris 11 Build 63 XAC_CHECK_FUNCS(__accessat) Xdnl This appeared not yet in POSIX XAC_CHECK_FUNCS(accessat) Xdnl This are POSIX extensions not found on Solaris 10 XAC_CHECK_FUNCS(mkdirat faccessat fchmodat linkat mkfifoat mknodat readlinkat symlinkat) XAC_CHECK_FUNCS(pipe _pipe) XAC_CHECK_FUNCS(popen pclose _popen _pclose) XAC_CHECK_FUNCS(closefrom) XAC_CHECK_FUNCS(strsignal str2sig sig2str) XAC_CHECK_FUNCS(kill killpg) XAC_CHECK_FUNCS(signal sighold sigrelse sigignore sigpause sigprocmask sigsetmask sigset sigaltstack sigblock) XAC_CHECK_FUNCS(alarm sleep usleep yield) XAC_CHECK_FUNCS(atexit on_exit) Xdnl tcgetattr and tcsetattr are a inline functions in termios.h on Android XAC_CHECK_DFUNC([ X#ifdef HAVE_TERMIOS_H X#include X#endif X], tcgetattr) XAC_CHECK_DFUNC([ X#ifdef HAVE_TERMIOS_H X#include X#endif X], tcsetattr) XAC_CHECK_FUNCS(tcgetpgrp tcsetpgrp tcgetsid) XAC_CHECK_FUNCS(getenv putenv setenv unsetenv) XAC_CHECK_FUNCS(snprintf strcasecmp strncasecmp) XAC_CHECK_FUNCS(vprintf vfprintf vsprintf vsnprintf) X XAC_CHECK_DFUNCS([ X#ifdef HAVE_STRING_H X#include X#endif X], strcat strncat strcmp strncmp strcpy strlcat strlcpy strncpy strdup strndup strlen strnlen strchr strrchr strstr strspn strcspn) XAC_CHECK_DFUNCS([ X#ifdef HAVE_WCHAR_H X#include X#endif X], wcscat wcsncat wcscmp wcsncmp wcscpy wcslcat wcslcpy wcsncpy wcsdup wcsndup wcslen wcsnlen wcschr wcsrchr wcsstr wcsspn wcscspn) X XAC_CHECK_FUNCS(wcwidth wcswidth wctype iswctype) XAC_CHECK_FUNCS(basename dirname) XAC_CHECK_FUNCS(pathconf fpathconf lpathconf) XAC_CHECK_FUNCS(malloc calloc valloc realloc memalign posix_memalign) XAC_CHECK_FUNCS(madvise) XAC_CHECK_FUNCS(mktemp mkstemp) XAC_CHECK_FUNCS(chflags fchflags fflagstostr strtofflags) XAC_CHECK_FUNCS(fnmatch) XAC_CHECK_FUNCS(truncate ftruncate) XAC_CHECK_FUNCS(getppriv setppriv priv_set) XAC_CHECK_FUNCS(issetugid) XAC_CHECK_FUNCS(getroles privbit_set) XAC_CHECK_FUNCS(setlocale localeconv nl_langinfo) XAC_CHECK_FUNCS(setbuf setvbuf) XAC_CHECK_FUNCS(clone_area create_area delete_area) X Xdnl The official POSIX rule is not to define "new" interfaces that Xdnl are in conflict with older interfaces of the same name. Xdnl Our interfaces fexec*() have been defined and published in 1982. Xdnl The new POSIX interfaces define a different interface and the Xdnl new POSIX interfaces even use names that are not compatible with Xdnl POSIX rules. The new POSIX interfaces in question should be called Xdnl fdexec*() to follow the rules of other similar POSIX functions. Xdnl Xdnl We use AC_RCHECK_FUNCS() because some Linux distros define a Xdnl fexecve() that returns ENOSYS an AC_CHECK_FUNCS() would return FALSE Xdnl Xecho Checking for POSIX violations by the POSIX.1-2008 standard: XAC_RCHECK_FUNCS(fexecl fexecle fexecv fexecve) XAC_RCHECK_FUNCS(fspawnv fspawnl fspawnv_nowait) X Xdnl A similar problem exists with the new POSIX.1-2008 interfaces Xdnl getline() and fgetline(). These interfaces are also incompatible Xdnl with our interfaces defined in 1982. XAC_RCHECK_FUNCS(getline fgetline) Xecho End of tests for POSIX violations by the POSIX.1-2008 standard. X Xdnl Check whether a symbol is either defined in an include file or Xdnl otherwise usable (e.g. as function) XAC_CHECK_DFUNC([#include ], dirfd) X XAC_CHECK_DFUNC([ X#ifdef HAVE_WCHAR_H X#include X#endif X#ifdef HAVE_WCTYPE_H X#include X#endif X], iswprint) X XAC_CHECK_DFUNC([ X#ifdef HAVE_WCHAR_H X#include X#endif X#ifdef HAVE_WCTYPE_H X#include X#endif X], iswblank) X XAC_CHECK_DFUNC([ X#ifdef HAVE_CTYPE_H X#include X#endif X], isblank) X XAC_CHECK_DFUNC([ X#ifdef HAVE_WCHAR_H X#include X#endif X#ifdef HAVE_WCTYPE_H X#include X#endif X], mbsinit) X XAC_CHECK_DFUNC([ X#ifdef HAVE_STDLIB_H X#include X#endif X], mbtowc) X XAC_CHECK_DFUNC([ X#ifdef HAVE_STDLIB_H X#include X#endif X], wctomb) X XAC_CHECK_DFUNC([ X#ifdef HAVE_WCHAR_H X#include X#endif X#ifdef HAVE_WCTYPE_H X#include X#endif X], mbrtowc) X XAC_CHECK_DFUNC([ X#ifdef HAVE_WCHAR_H X#include X#endif X#ifdef HAVE_WCTYPE_H X#include X#endif X], wcrtomb) X XAC_CHECK_DFUNC([#include ], finite) XAC_CHECK_DFUNC([#include ], isnand) X Xdnl Checks for typedefs, structures, and compiler characteristics. Xdnl that need results from the AC_CHECK_FUNCS() calls. XAC_USER_MALLOC Xdnl AC_USER_XCVT test macro does not yet work XAC_VAR_TIMEZONE XAC_VAR_TIMEZONE_DEF XAC_VAR___PROGNAME XAC_VAR___PROGNAME_FULL X Xdnl Checks for OS characteristics. XAC_HARD_SYMLINKS XAC_LINK_NOFOLLOW XAC_ACCESS_E_OK XAC_FNMATCH_IGNORECASE X Xdnl Need to check this in default compilation mode to find out Xdnl whether this platform supports both functions by default too. Xdnl We cannot use the standard tests because they would find Xdnl that fseeko()/ftello() are present in small file mode on Xdnl Limnux while there is no prototype for these functions. XAC_SMALL_FSEEKO XAC_SMALL_FTELLO X XAC_CHECK_LIB(c, dlopen, lib_dl="", X [AC_CHECK_LIB(dl, dlopen, lib_dl="-ldl")]) Xac_save_LIBS="$LIBS" XLIBS="$LIBS $lib_dl" XAC_CHECK_FUNCS(dlopen dlclose dlsym dlerror dlinfo) XAC_CHECK_FUNCS(shl_load shl_unload shl_gethandle) XLIBS="$ac_save_LIBS" Xif test ."$lib_dl" = .""; then X AC_DEFINE(HAVE_DLOPEN_IN_LIBC) Xfi X XAC_CHECK_DFUNCS([ X#ifdef HAVE_WINDOWS_H X#undef u_char X#undef u_short X#undef u_int X#undef u_long X#include X#endif X], LoadLibrary FreeLibrary GetProcAddress) X Xdnl ??? AC_CHECK_LIB(socket, socket, lib_socket="-lsocket") Xdnl Xac_save_LIBS="$LIBS" XAC_CHECK_LIB(c, socket, lib_socket="", X [AC_CHECK_LIB(socket, socket, lib_socket="-lsocket")]) XLIBS="$ac_save_LIBS" XAC_CHECK_LIB(c, gethostbyname, lib_nsl="", X [AC_CHECK_LIB(nsl, gethostbyname, lib_nsl="-lnsl", X [AC_CHECK_LIB(network, gethostbyname, lib_nsl="-lnetwork")])]) XLIBS="$ac_save_LIBS" XLIBS="$LIBS $lib_nsl $lib_socket" XAC_CHECK_FUNCS(rcmd socket socketpair) XAC_CHECK_FUNCS(getservbyname inet_ntoa) XAC_CHECK_FUNCS(getaddrinfo getnameinfo) XAC_CHECK_FUNCS(host2netname netname2host) XLIBS="$ac_save_LIBS" X Xac_save_LIBS="$LIBS" XAC_CHECK_LIB(c, res_init, lib_resolv="", X [AC_CHECK_LIB(resolv, res_init, lib_resolv="-lresolv")]) XLIBS="$ac_save_LIBS" Xif test ."$lib_resolv" = .""; then X AC_DEFINE(HAVE_RESOLV_IN_LIBC) Xfi X Xdnl Check for largefile support Xdnl Do this last to make sure that no large file definition Xdnl in confdefs.h will modify our results XAC_SYS_LARGEFILE Xdnl Warning do not run this test. it interferes with the test Xdnl AC_CHECK_FUNCS(fseeko ftello) from above. Xdnl The test AC_HAVE_LARGEFILES will check whether ftello/fseeko Xdnl are available in Large File mode Xdnl AC_FUNC_FSEEKO XAC_HAVE_LARGEFILES X XAC_DEFINE_UNQUOTED_STRING(HOST_ALIAS,$host_alias) XAC_DEFINE_UNQUOTED_STRING(HOST_SUB,$host) XAC_DEFINE_UNQUOTED_STRING(HOST_CPU,$host_cpu) XAC_DEFINE_UNQUOTED_STRING(HOST_VENDOR,$host_vendor) XAC_DEFINE_UNQUOTED_STRING(HOST_OS,$host_os) X Xdnl AC_CHECK_LIB(crypt, crypt, lib_crypt="-lcrypt") X XAC_CHECK_LIB(c, crypt, lib_crypt="", X [AC_CHECK_LIB(crypt, crypt, lib_crypt="-lcrypt")]) Xif test ."$lib_crypt" = .""; then X AC_DEFINE(HAVE_CRYPT_IN_LIBC) Xfi X Xac_save_LIBS="$LIBS" XLIBS="$LIBS $lib_crypt" XAC_CHECK_FUNCS(crypt) XLIBS="$ac_save_LIBS" X XAC_CHECK_ILIB([#include ], c, gettext, lib_intl="", X [AC_CHECK_ILIB([#include ], intl, gettext, lib_intl="-lintl")]) Xif test ."$lib_intl" = .""; then X AC_DEFINE(HAVE_GETTEXT_IN_LIBC) Xfi X Xac_save_LIBS="$LIBS" XLIBS="$LIBS $lib_intl" XAC_CHECK_DFUNC([#include ], gettext) XLIBS="$ac_save_LIBS" X XAC_CHECK_ILIB([#include ], c, iconv_open, lib_iconv="", X [AC_CHECK_ILIB([#include ], iconv, iconv_open, lib_iconv="-liconv")]) Xif test ."$lib_iconv" = .""; then X AC_DEFINE(HAVE_ICONV_IN_LIBC) Xfi X Xac_save_LIBS="$LIBS" XLIBS="$LIBS $lib_iconv" XAC_CHECK_DFUNC([#include ], iconv) XAC_CHECK_DFUNC([#include ], iconv_open) XAC_CHECK_DFUNC([#include ], iconv_close) Xdnl GNU libiconv on Linux and Cygwin may make "configure" fail :-( XAC_CHECK_DFUNC([#include ], libiconv) XAC_CHECK_DFUNC([#include ], libiconv_open) XAC_CHECK_DFUNC([#include ], libiconv_close) XLIBS="$ac_save_LIBS" X XAC_CHECK_LIB(c, XML_Parse, lib_expat="", X [AC_CHECK_LIB(expat, XML_Parse, lib_expat="-lexpat")]) Xif test ."$lib_expat" = ."" -a "$ac_cv_lib_c_XML_Parse" = yes ; then X AC_DEFINE(HAVE_EXPAT_IN_LIBC) Xfi Xac_save_LIBS="$LIBS" XLIBS="$LIBS $lib_expat" XAC_CHECK_FUNCS(XML_Parse) XLIBS="$ac_save_LIBS" X Xif test "$CC" = cl.exe; then X echo configure does not yet support library checks for cl.exe: X echo checking for SCardEstablishContext in -lwinscard... we know it is present X lib_pcsc="-lwinscard" X AC_DEFINE(HAVE_SCARDESTABLISHCONTEXT) Xelse X AC_CHECK_LIB(c, SCardEstablishContext, lib_pcsc="", X [AC_CHECK_LIB(winscard, SCardEstablishContext, lib_pcsc="-lwinscard", X [AC_CHECK_LIB(pcsclite, SCardEstablishContext, lib_pcsc="-lpcsclite")])]) X if test ."$lib_pcsc" = ."" -a "$ac_cv_lib_c_SCardEstablishContext" = yes ; then X AC_DEFINE(HAVE_PCSC_IN_LIBC) X fi X ac_save_LIBS="$LIBS" X LIBS="$LIBS $lib_pcsc" X AC_CHECK_FUNCS(SCardEstablishContext) X LIBS="$ac_save_LIBS" Xfi X Xif test "$CC" = cl.exe; then X echo configure does not yet support library checks for cl.exe: X echo checking for CRYPTO_free in -llibeay32... we know it is present X echo checking for SSL_free in -lssleay32... we know it is present X lib_crypto="-llibeay32" X lib_ssl="-lssleay32" Xelse X AC_CHECK_LIB(c, CRYPTO_free, lib_crypto="", X [AC_CHECK_LIB(crypto, CRYPTO_free, lib_crypto="-lcrypto")]) X if test ."$lib_crypto" = ."" -a "$ac_cv_lib_c_CRYPTO_free" = yes ; then X AC_DEFINE(HAVE_CRYPTO_IN_LIBC) X fi X ac_save_LIBS="$LIBS" X LIBS="$LIBS $lib_crypto" X AC_CHECK_FUNCS(CRYPTO_free) X LIBS="$ac_save_LIBS" X AC_CHECK_LIB(c, SSL_free, lib_ssl="", X [AC_CHECK_LIB(ssl, SSL_free, lib_ssl="-lssl")]) X if test ."$lib_ssl" = ."" -a "$ac_cv_lib_c_SSL_free" = yes ; then X AC_DEFINE(HAVE_SSL_IN_LIBC) X fi X ac_save_LIBS="$LIBS" X LIBS="$LIBS $lib_ssl" X AC_CHECK_FUNCS(SSL_free) X LIBS="$ac_save_LIBS" Xfi X Xif test $ac_cv_header_camlib_h = yes; then X scsi_lib=-lcam X lib_scsi=-lcam Xfi X Xif test "$ac_cv_header_sys_acl_h" = yes; then X X AC_CHECKING(for Posix Access Control List support) X AC_CHECK_LIB(acl, acl_get_file, lib_acl="-lacl") X AC_CHECK_LIB(pacl, acl_get_file, lib_acl="-lpacl") X X dnl If $lib_acl is nonempty, save it in $lib_acl_test X X if test ".$lib_acl" != .; then X lib_acl_test="$lib_acl" X fi X X ac_save_LIBS="$LIBS" X LIBS="$LIBS $lib_acl" X AC_CHECK_FUNCS(acl_get_file acl_set_file acl_from_text acl_to_text acl_free acl_delete_def_file) X AC_CHECK_FUNCS(acl_extended_file) X AC_CHECK_FUNCS(acl_get_entry) X AC_CHECK_FUNCS(acl_to_text_np acl_get_brand_np acl_is_trivial_np acl_strip_np) X LIBS="$ac_save_LIBS" X X AC_CHECKING(for Solaris UFS Access Control List support) X AC_CHECK_LIB(sec, acltotext, lib_acl="-lsec") X ac_save_LIBS="$LIBS" X LIBS="$LIBS $lib_acl" X AC_CHECK_FUNCS(acl facl aclfromtext acltotext) X X AC_CHECKING(for NFSv4 Access Control List support) X dnl These functions support NFSv4 ACLs X dnl Do not check for acl_free because of a name clash with the withdrawn POSIX draft X AC_CHECK_FUNCS(acl_get acl_set facl_get facl_set acl_fromtext acl_totext) X LIBS="$ac_save_LIBS" X X dnl On Solaris, there is no need for lib_acl_test as acl(2) is in -libc X X AC_CHECKING(for HP-UX Access Control List support) X AC_CHECK_FUNCS(getacl fgetacl setacl fsetacl strtoacl acltostr cpacl fcpacl chownacl setaclentry fsetaclentry) X X dnl XXX lib_acl_test: How do we test for ACLs on HP-UX? X Xfi X Xif test "$ac_cv_header_attr_xattr_h" = yes || test "$ac_cv_header_sys_xattr_h" = yes; then X AC_CHECKING(for Linux flavor Extended Attribute support) X AC_CHECK_LIB(c, getxattr, lib_rt="", X [AC_CHECK_LIB(attr, getxattr, lib_attr="-lattr")]) X ac_save_LIBS="$LIBS" X LIBS="$LIBS $lib_attr" X AC_CHECK_FUNCS(getxattr setxattr listxattr lgetxattr lsetxattr llistxattr) X LIBS="$ac_save_LIBS" Xfi X XAC_CHECKING(for RBAC support) XAC_CHECK_LIB(secdb, getuserattr, lib_secdb="-lsecdb") Xac_save_LIBS="$LIBS" XLIBS="$LIBS $lib_secdb" XAC_CHECK_FUNCS(getauthattr getuserattr getexecattr getprofattr) XLIBS="$ac_save_LIBS" X XAC_CHECKING(for gmatch() support) XAC_CHECK_LIB(gen, gmatch, lib_gen="-lgen") Xac_save_LIBS="$LIBS" XLIBS="$LIBS $lib_gen" XAC_CHECK_FUNCS(gmatch) XLIBS="$ac_save_LIBS" X XAC_CHECKING(for ELF support) XAC_CHECK_LIB(elf, elf_begin, lib_elf="-lelf") Xac_save_LIBS="$LIBS" XLIBS="$LIBS $lib_elf" XAC_CHECK_FUNCS(elf_begin) XLIBS="$ac_save_LIBS" X XAC_CHECK_FUNCS(thr_yield) X Xdnl AC_CHECK_LIB(c, sem_post, lib_sem="", Xdnl [AC_CHECK_LIB(pthread, sem_post, lib_sem="-lpthread")]) Xdnl ac_save_LIBS="$LIBS" Xdnl LIBS="$LIBS $lib_sem" Xdnl AC_CHECK_FUNCS(sem_post) Xdnl LIBS="$ac_save_LIBS" X XAC_CHECK_LIB(c, pthread_create, lib_pthread="", X [AC_CHECK_LIB(pthread, pthread_create, lib_pthread="-lpthread")]) X Xac_save_LIBS="$LIBS" XLIBS="$LIBS $lib_pthread" XAC_CHECK_FUNCS(pthread_create pthread_kill) XAC_CHECK_FUNCS(pthread_mutex_lock pthread_cond_wait pthread_spin_lock) XLIBS="$ac_save_LIBS" X XAC_CHECK_LIB(c, clock_gettime, lib_rt="", X [AC_CHECK_LIB(rt, clock_gettime, lib_rt="-lrt", X [AC_CHECK_LIB(posix4, clock_gettime, lib_rt="-lposix4")])]) Xif test ."$lib_rt" = .""; then X AC_DEFINE(HAVE_CLOCK_GETTIME_IN_LIBC) Xfi X Xac_save_LIBS="$LIBS" XLIBS="$LIBS $lib_rt" XAC_CHECK_FUNCS(clock_gettime clock_settime clock_getres) XAC_CHECK_FUNCS(sched_getparam sched_setparam sched_getscheduler sched_setscheduler) XAC_CHECK_FUNCS(sched_yield) XAC_CHECK_FUNCS(nanosleep) XLIBS="$ac_save_LIBS" X XAC_CHECK_LIB(cap, cap_get_proc, lib_cap="-lcap") Xac_save_LIBS="$LIBS" XLIBS="$LIBS $lib_cap" XAC_CHECK_FUNCS(cap_get_proc cap_set_proc cap_set_flag cap_clear_flag) XLIBS="$ac_save_LIBS" X Xif test "$ac_cv_header_selinux_selinux_h" = yes; then X AC_CHECKING(for SELinux support) X ac_save_LIBS="$LIBS" X LIBS="$LIBS $lib_attr" X AC_CHECK_LIB(selinux, is_selinux_enabled, lib_selinux="-lselinux") X LIBS="$ac_save_LIBS" X LIBS="$LIBS $lib_selinux $lib_attr" X AC_CHECK_FUNCS(is_selinux_enabled) X LIBS="$ac_save_LIBS" Xfi X Xdnl Misc OS checks. Xdnl Xdnl WARNING: AC_CHECK_FILES uses "test -r file" and bash on Haiku returns wrong results Xdnl for /dev/stdin /dev/stdout /dev/stderr /dev/fd/0 /dev/fd/1 /dev/fd/2 Xdnl For this reason, we rather use AC_STAT_FILES Xdnl AC_CHECK_FILES(/dev/tty /dev/null /dev/zero) Xdnl AC_CHECK_FILES(/dev/stdin /dev/stdout /dev/stderr) Xdnl AC_CHECK_FILES(/dev/fd/0 /dev/fd/1 /dev/fd/2) Xdnl AC_CHECK_FILES(/usr/src/linux/include) X XAC_STAT_FILES(/dev/tty /dev/null /dev/zero) XAC_STAT_FILES(/dev/stdin /dev/stdout /dev/stderr) XAC_STAT_FILES(/dev/fd/0 /dev/fd/1 /dev/fd/2) XAC_STAT_FILES(/usr/src/linux/include /usr/xpg4/bin/sh /opt/schily/xpg4/bin/sh) X Xdnl Checks for OS madness. XUNAME=`uname || true` X Xif test ."$UNAME" = .Linux; then X Xdnl Linux madness tests: X XAC_BROKEN_LINUX_EXT2_FS_H XAC_BROKEN_SRC_LINUX_EXT2_FS_H Xif test .$ac_cv_broken_linux_ext2_fs_h = .no -o .$ac_cv_broken_src_linux_ext2_fs_h = .no; then X # X # If either /usr/include/linux/ex2_fs.h works or X # /usr/src/linux/include/linux/ex2_fs.h works, we will X # #define HAVE_USABLE_LINUX_EXT2_FS_H X # X # If HAVE_USABLE_LINUX_EXT2_FS_H is defined, a simple X # #include will work. X # X ac_cv_usable_linux_ext2_fs_h=yes X AC_DEFINE(HAVE_USABLE_LINUX_EXT2_FS_H) Xelse X ac_cv_usable_linux_ext2_fs_h=no Xfi XAC_BROKEN_SCSI_SCSI_H XAC_BROKEN_SRC_SCSI_SCSI_H XAC_BROKEN_SCSI_SG_H XAC_BROKEN_SRC_SCSI_SG_H X Xif test .$ac_cv_broken_src_scsi_scsi_h = .yes; then X may_linux_src_include=no Xfi Xif test .$ac_cv_broken_src_linux_ext2_fs_h = .yes; then X may_linux_src_include=no Xfi Xif test .$ac_cv_file__usr_src_linux_include = .yes; then # only warn if there is /usr/src/linux/include Xif test .$may_linux_src_include = .no; then X echo X echo "Warning: *** /usr/src/linux/include contains broken include files ***" X echo "Warning: *** /usr/src/linux/include is not used this reason ***" X echo "Warning: This may result in the inability to use recent Linux kernel interfaces" X echo Xfi Xfi Xif test .$ac_cv_header_ext2fs_ext2_fs_h = .no; then # only if there is no Xif test .$ac_cv_usable_linux_ext2_fs_h = .no; then X echo X echo "Warning: *** linux/ext2_fs.h is not usable at all ***" X echo "Warning: *** This makes it impossible to support Linux file flags ***" X echo "You may try to compile using 'make COPTX=-DTRY_EXT2_FS'" X echo X echo "Better install the ext2 developer package" X echo X sleep 10 Xfi Xfi # was missing Xfi # Linux only tests X XAC_SUBST(may_linux_src_include) X XAC_SUBST(largefile_cc_opt) XAC_SUBST(sun_cc64_opt) XAC_SUBST(hp_cc_ansi_opt) XAC_SUBST(hp_cc_opt_opt) XAC_SUBST(hp_cc_gprof_opt) X XAC_SUBST(lib_crypt) XAC_SUBST(lib_resolv) XAC_SUBST(lib_intl) XAC_SUBST(lib_iconv) XAC_SUBST(lib_expat) XAC_SUBST(lib_pcsc) XAC_SUBST(lib_crypto) XAC_SUBST(lib_ssl) XAC_SUBST(lib_nsl) XAC_SUBST(scsi_lib) XAC_SUBST(lib_scsi) XAC_SUBST(lib_acl) XAC_SUBST(lib_acl_test) XAC_SUBST(lib_attr) XAC_SUBST(lib_secdb) XAC_SUBST(lib_gen) XAC_SUBST(lib_elf) XAC_SUBST(lib_pthread) XAC_SUBST(lib_rt) XAC_SUBST(lib_dl) XAC_SUBST(lib_dir) XAC_SUBST(lib_cap) XAC_SUBST(lib_selinux) X XAC_OUTPUT(rules.cnf) END-of-star-1.6/autoconf/configure.in echo x - star-1.6/autoconf/install-sh sed 's/^X//' >star-1.6/autoconf/install-sh << 'END-of-star-1.6/autoconf/install-sh' X#! /bin/sh X# X# install - install a program, script, or datafile X# This comes from X11R5 (mit/util/scripts/install.sh). X# X# Copyright 1991 by the Massachusetts Institute of Technology X# X# Permission to use, copy, modify, distribute, and sell this software and its X# documentation for any purpose is hereby granted without fee, provided that X# the above copyright notice appear in all copies and that both that X# copyright notice and this permission notice appear in supporting X# documentation, and that the name of M.I.T. not be used in advertising or X# publicity pertaining to distribution of the software without specific, X# written prior permission. M.I.T. makes no representations about the X# suitability of this software for any purpose. It is provided "as is" X# without express or implied warranty. X# X# Calling this script install-sh is preferred over install.sh, to prevent X# `make' implicit rules from creating a file called install from it X# when there is no Makefile. X# X# This script is compatible with the BSD install script, but was written X# from scratch. It can only install one file at a time, a restriction X# shared with many OS's install programs. X X X# set DOITPROG to echo to test this script X X# Don't use :- since 4.3BSD and earlier shells don't like it. Xdoit="${DOITPROG-}" X X X# put in absolute paths if you don't have them in your path; or use env. vars. X Xmvprog="${MVPROG-mv}" Xcpprog="${CPPROG-cp}" Xchmodprog="${CHMODPROG-chmod}" Xchownprog="${CHOWNPROG-chown}" Xchgrpprog="${CHGRPPROG-chgrp}" Xstripprog="${STRIPPROG-strip}" Xrmprog="${RMPROG-rm}" Xmkdirprog="${MKDIRPROG-mkdir}" X Xtransformbasename="" Xtransform_arg="" Xinstcmd="$mvprog" Xchmodcmd="$chmodprog 0755" Xchowncmd="" Xchgrpcmd="" Xstripcmd="" Xrmcmd="$rmprog -f" Xmvcmd="$mvprog" Xsrc="" Xdst="" Xdir_arg="" X Xwhile [ x"$1" != x ]; do X case $1 in X -c) instcmd="$cpprog" X shift X continue;; X X -d) dir_arg=true X shift X continue;; X X -m) chmodcmd="$chmodprog $2" X shift X shift X continue;; X X -o) chowncmd="$chownprog $2" X shift X shift X continue;; X X -g) chgrpcmd="$chgrpprog $2" X shift X shift X continue;; X X -s) stripcmd="$stripprog" X shift X continue;; X X -t=*) transformarg=`echo $1 | sed 's/-t=//'` X shift X continue;; X X -b=*) transformbasename=`echo $1 | sed 's/-b=//'` X shift X continue;; X X *) if [ x"$src" = x ] X then X src=$1 X else X # this colon is to work around a 386BSD /bin/sh bug X : X dst=$1 X fi X shift X continue;; X esac Xdone X Xif [ x"$src" = x ] Xthen X echo "install: no input file specified" X exit 1 Xelse X true Xfi X Xif [ x"$dir_arg" != x ]; then X dst=$src X src="" X X if [ -d $dst ]; then X instcmd=: X else X instcmd=mkdir X fi Xelse X X# Waiting for this to be detected by the "$instcmd $src $dsttmp" command X# might cause directories to be created, which would be especially bad X# if $src (and thus $dsttmp) contains '*'. X X if [ -f $src -o -d $src ] X then X true X else X echo "install: $src does not exist" X exit 1 X fi X X if [ x"$dst" = x ] X then X echo "install: no destination specified" X exit 1 X else X true X fi X X# If destination is a directory, append the input filename; if your system X# does not like double slashes in filenames, you may need to add some logic X X if [ -d $dst ] X then X dst="$dst"/`basename $src` X else X true X fi Xfi X X## this sed command emulates the dirname command Xdstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` X X# Make sure that the destination directory exists. X# this part is taken from Noah Friedman's mkinstalldirs script X X# Skip lots of stat calls in the usual case. Xif [ ! -d "$dstdir" ]; then XdefaultIFS=' X' XIFS="${IFS-${defaultIFS}}" X XoIFS="${IFS}" X# Some sh's can't handle IFS=/ for some reason. XIFS='%' Xset - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` XIFS="${oIFS}" X Xpathcomp='' X Xwhile [ $# -ne 0 ] ; do X pathcomp="${pathcomp}${1}" X shift X X if [ ! -d "${pathcomp}" ] ; X then X $mkdirprog "${pathcomp}" X else X true X fi X X pathcomp="${pathcomp}/" Xdone Xfi X Xif [ x"$dir_arg" != x ] Xthen X $doit $instcmd $dst && X X if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && X if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && X if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && X if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi Xelse X X# If we're going to rename the final executable, determine the name now. X X if [ x"$transformarg" = x ] X then X dstfile=`basename $dst` X else X dstfile=`basename $dst $transformbasename | X sed $transformarg`$transformbasename X fi X X# don't allow the sed command to completely eliminate the filename X X if [ x"$dstfile" = x ] X then X dstfile=`basename $dst` X else X true X fi X X# Make a temp file name in the proper directory. X X dsttmp=$dstdir/#inst.$$# X X# Move or copy the file name to the temp name X X $doit $instcmd $src $dsttmp && X X trap "rm -f ${dsttmp}" 0 && X X# and set any options; do chmod last to preserve setuid bits X X# If any of these fail, we abort the whole thing. If we want to X# ignore errors from any of these, just make sure not to ignore X# errors from the above "$doit $instcmd $src $dsttmp" command. X X if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && X if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && X if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && X if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && X X# Now rename the file to the real destination. X X $doit $rmcmd -f $dstdir/$dstfile && X $doit $mvcmd $dsttmp $dstdir/$dstfile X Xfi && X X Xexit 0 END-of-star-1.6/autoconf/install-sh echo x - star-1.6/autoconf/rules.cnf.in sed 's/^X//' >star-1.6/autoconf/rules.cnf.in << 'END-of-star-1.6/autoconf/rules.cnf.in' X# @(#)rules.cnf.in 1.36 18/08/15 Copyright 1998-2018 J. Schilling X X# X# WARNING: no space/comment past the following three macros! X# The comment is thus in the line before X# X X# Executable extension "" on UNIX, ".exe" on DOS XEXEEXT= @EXEEXT@ X X# If non-empty, prog.exec needs to be called so XXEXEEXT= @XEXEEXT@ X X# Object extension, .o on UNIX, .obj on DOS XOBJEXT= @OBJEXT@ X XYACC= @YACC@ # Yacc parser is present XBISON= @BISON@ # Bison parser if present XTSORT_PROG= @TSORT@ # Path to tsort program if present XLORDER_PROG= @LORDER@ # Path to lorder program if present XCPP= @CPP@ # Command to run C preprocessor XCPPX= @CPPX@ # Command to run cpp with any type of file XCPPX_IN= @CPPX_IN@ # Used with CPPX when "gcc -E - <" is needed X XLARGEFILE_CC_OPT= @largefile_cc_opt@ # Largefile option for IRIX XSUN_CC64_OPT= @sun_cc64_opt@ # Used on e.g. Solaris and Linux XHP_CC_ANSI_OPT= @hp_cc_ansi_opt@ # Used on HP-UX XHP_CC_OPT_OPT= @hp_cc_opt_opt@ # Used on HP-UX XHP_CC_GPROF_OPT= @hp_cc_gprof_opt@ # Used on HP-UX X XMAY_LINUX_SRC_INCLUDE= @may_linux_src_include@ # /usr/src/include useful X XSCSILIB= @scsi_lib@ # IRIX libcam (outdated) XLIB_SCSI= @lib_scsi@ # New SCSI lib variable XLIB_RESOLV= @lib_resolv@ # libresolv if code is not in libc XLIB_CRYPT= @lib_crypt@ # Library for crypt() if not in libc XLIB_INTL= @lib_intl@ # Library for gettext() if not in libc XLIB_ICONV= @lib_iconv@ # Library for iconv() if not in libc XLIB_EXPAT= @lib_expat@ # Expat library if present XLIB_PCSC= @lib_pcsc@ # PCSC library if present XLIB_CRYPTO= @lib_crypto@ # Crypto library for OpenSSL & friends XLIB_SSL= @lib_ssl@ # SSL library for OpenSSL & friends XLIB_NSL= @lib_nsl@ # For gethostbyname() / socket() ... users XLIB_ACL= @lib_acl@ # Full (test/set) ACL users like star XLIB_ACL_TEST= @lib_acl_test@ # Test only ACL users like libfind XLIB_ATTR= @lib_attr@ # Linux xattr library XLIB_SECDB= @lib_secdb@ # Solaris security access, e.g. getexecattr() XLIB_GEN= @lib_gen@ # SVr4 library that contains gmatch() XLIB_ELF= @lib_elf@ # Standard ELF library if present XLIB_PTHREAD= @lib_pthread@ # POSIX thread library if not in libc XLIB_RT= @lib_rt@ # Real time lib for e.g. clock_gettime() XLIB_DL= @lib_dl@ # Dynamic linker library XLIB_DIR= @lib_dir@ # Lib for opendir() if not in libc XLIB_CAP= @lib_cap@ # Linux capability lib XLIB_SELINUX= @lib_selinux@ # SELinux lib END-of-star-1.6/autoconf/rules.cnf.in echo x - star-1.6/autoconf/xconfig.h.in sed 's/^X//' >star-1.6/autoconf/xconfig.h.in << 'END-of-star-1.6/autoconf/xconfig.h.in' X/* @(#)xconfig.h.in 1.275 19/03/18 Copyright 1998-2019 J. Schilling */ X/* X * Dynamic autoconf C-include code. X * Do not edit, this file has been created automatically. X * X * Copyright (c) 1998-2019 J. Schilling X * X * The layout for this file is controlled by "configure". X * Switch off cstyle(1) checks for now. X */ X#ifndef __XCONFIG_H X#define __XCONFIG_H X/* BEGIN CSTYLED */ X X/* X * Header Files X */ X#undef PROTOTYPES /* if Compiler supports ANSI C prototypes */ X#undef HAVE_INLINE /* if Compiler supports "inline" keyword */ X#undef HAVE_AR_H /* to use ar.h */ X#undef HAVE_ASSERT_H /* to use assert.h */ X#undef HAVE_STDIO_H /* to use stdio.h */ X#undef HAVE_STDARG_H /* to use stdarg.h, else use varargs.h NOTE: SaberC on a Sun has prototypes but no stdarg.h */ X#undef HAVE_VARARGS_H /* to use use varargs.h NOTE: The free HP-UX C-compiler has stdarg.h but no PROTOTYPES */ X#undef HAVE_STDLIB_H /* to use general utility defines (malloc(), size_t ...) and general C library prototypes */ X#undef HAVE_STDDEF_H /* to use offsetof(), ptrdiff_t, wchar_t, size_t */ X#undef HAVE_STRING_H /* to get NULL and ANSI C string function prototypes */ X#undef HAVE_STRINGS_H /* to get BSD string function prototypes */ X#undef STDC_HEADERS /* if ANSI compliant stdlib.h, stdarg.h, string.h, float.h are present */ X#undef HAVE_UNISTD_H /* to get POSIX syscall prototypes XXX sys/file.h fcntl.h (unixstd/fctl)XXX*/ X#undef HAVE_GETOPT_H /* to get getopt() prototype from getopt.h instead of unistd.h */ X#undef HAVE_LIMITS_H /* to get POSIX numeric limits constants */ X#undef HAVE_A_OUT_H /* if a.out.h is present (may be a system using a.out format) */ X#undef HAVE_AOUTHDR_H /* if aouthdr.h is present. This is a COFF system */ X#undef HAVE_ELF_H /* if elf.h is present. This is an ELF system */ X#undef HAVE_FCNTL_H /* to access, O_XXX constants for open(), otherwise use sys/file.h */ X#undef HAVE_IO_H /* to access setmode()... from WIN-DOS, OS/2 and similar */ X#undef HAVE_CONIO_H /* to access getch()... from WIN-DOS, OS/2 and similar */ X#undef HAVE_SYS_FILE_H /* to use O_XXX constants for open() and flock() defs */ X#undef HAVE_INTTYPES_H /* to use UNIX-98 inttypes.h */ X#undef HAVE_STDINT_H /* to use SUSv3 stdint.h */ X#undef HAVE_DIRENT_H /* to use POSIX dirent.h */ X#undef HAVE_SYS_DIR_H /* to use BSD sys/dir.h */ X#undef HAVE_NDIR_H /* to use ndir.h */ X#undef HAVE_SYS_NDIR_H /* to use sys/ndir.h */ X#undef HAVE_ALLOCA_H /* if alloca.h exists */ X#undef HAVE_MALLOC_H /* if malloc.h exists */ X#undef HAVE_POSIX_MALLOC_H /* The Haiku include file for malloc()/valloc()/... */ X#undef HAVE_SGTTY_H /* if sgtty.h exists */ X#undef HAVE_TERMIOS_H /* to use POSIX termios.h */ X#undef HAVE_TERMIO_H /* to use SVR4 termio.h */ X#undef HAVE_PWD_H /* if pwd.h exists */ X#undef HAVE_GRP_H /* if grp.h exists */ X#undef HAVE_SIGNAL_H /* if signal.h exists */ X#undef HAVE_SIGINFO_H /* if siginfo.h exists */ X#undef HAVE_SYS_SIGINFO_H /* if sys/siginfo.h exists */ X#undef HAVE_UCONTEXT_H /* if ucontext.h exists */ X#undef HAVE_SYS_ACL_H /* to use for ACL definitions */ X#undef HAVE_ACLUTILS_H /* to use for NFSv4 ACL extensions */ X#undef HAVE_ACLLIB_H /* if HP-UX is present */ X#undef HAVE_ACL_LIBACL_H /* if Linux is present */ X#undef HAVE_SHADOW_H /* if shadow.h exists */ X#undef HAVE_SYSLOG_H /* if syslog.h exists */ X#undef HAVE_SYS_TIME_H /* may include sys/time.h for struct timeval */ X#undef TIME_WITH_SYS_TIME /* may include both time.h and sys/time.h */ X#undef HAVE_TIMES /* to use times() and sys/times.h */ X#undef HAVE_SYS_TIMES_H /* may include sys/times.h for struct tms */ X#undef HAVE_UTIME /* to use AT&T utime() and utimbuf */ X#undef HAVE_UTIMES /* to use BSD utimes() and sys/time.h */ X#undef HAVE_FUTIMES /* to use BSD futimes() and sys/time.h */ X#undef HAVE_LUTIMES /* to use BSD lutimes() and sys/time.h */ X#undef HAVE_UTIMENS /* to use BSD utimens() and sys/time.h */ X#undef HAVE_FUTIMENS /* to use BSD futimens() and sys/time.h */ X#undef HAVE_LUTIMENS /* to use BSD lutimens() and sys/time.h */ X#undef HAVE_UTIME_H /* to use utime.h for the utimbuf structure declaration, else declare struct utimbuf yourself */ X#undef HAVE_SYS_UTIME_H /* to use sys/utime.h if utime.h does not exist */ X#undef HAVE_SYS_IOCTL_H /* if sys/ioctl.h is present */ X#undef HAVE_SYS_FILIO_H /* if sys/filio.h is present */ X#undef HAVE_SYS_PARAM_H /* if sys/param.h is present */ X#undef HAVE_MACH_MACHINE_H /* if mach/machine.h is present */ X#undef HAVE_MNTENT_H /* if mntent.h is present */ X#undef HAVE_SYS_MNTENT_H /* if sys/mntent.h is present */ X#undef HAVE_SYS_MNTTAB_H /* if sys/mnttab.h is present */ X#undef HAVE_SYS_MOUNT_H /* if sys/mount.h is present */ X#undef HAVE_WAIT_H /* to use wait.h for prototypes and union wait */ X#undef HAVE_SYS_WAIT_H /* else use sys/wait.h */ X#undef HAVE_ULIMIT_H /* to use ulimit() as fallback for getrlimit() */ X#undef HAVE_PROCESS_H /* to use process.h for spawn*() and cwait() */ X#undef HAVE_SYS_RESOURCE_H /* to use sys/resource.h for rlimit() and wait3() */ X#undef HAVE_PROCFS_H /* to use procfs.h instead of sys/procfs.h (Solaris forces profcs-2) */ X#undef HAVE_SYS_PROCFS_H /* to use sys/procfs.h for wait3() emulation */ X#undef HAVE_LIBPROC_H /* to use libproc.h (Mac OS X) */ X#undef HAVE_SYS_SYSTEMINFO_H /* to use SVr4 sysinfo() */ X#undef HAVE_SYS_SYSCTL_H /* to use BSD sysctl() */ X#undef HAVE_SYS_UTSNAME_H /* to use uname() */ X#undef HAVE_SYS_PRIOCNTL_H /* to use SVr4 priocntl() instead of nice()/setpriority() */ X#undef HAVE_SYS_RTPRIOCNTL_H /* if the system supports SVr4 real time classes */ X#undef HAVE_SYS_PROCSET_H /* if the system supports SVr4 process sets */ X#undef HAVE_SYS_LOADAVG_H /* to use getloadavg() */ X#undef HAVE_SYS_SYSCALL_H /* to use syscall() */ X#undef HAVE_SYS_MTIO_H /* to use mtio definitions from sys/mtio.h */ X#undef HAVE_SYS_TAPE_H /* to use mtio definitions from AIX sys/tape.h */ X#undef HAVE_SYS_MMAN_H /* to use definitions for mmap()/madvise()... from sys/mman.h */ X#undef HAVE_SYS_SHM_H /* to use definitions for shmget() ... from sys/shm.h */ X#undef HAVE_SYS_SEM_H /* to use definitions for semget() ... from sys/sem.h */ X#undef HAVE_SYS_IPC_H /* to use definitions for ftok() ... from sys/ipc.h */ X#undef HAVE_SEMAPHORE_H /* to use definitions for sema_init() ... from semaphore.h */ X#undef MAJOR_IN_MKDEV /* if we should include sys/mkdev.h to get major()/minor()/makedev() */ X#undef MAJOR_IN_SYSMACROS /* if we should include sys/sysmacros.h to get major()/minor()/makedev() */ X#undef HAVE_SYS_DKIO_H /* if we may include sys/dkio.h for disk ioctls */ X#undef HAVE_SYS_DKLABEL_H /* if we may include sys/dklabel.h for disk label */ X#undef HAVE_SUN_DKIO_H /* if we may include sun/dkio.h for disk ioctls */ X#undef HAVE_SUN_DKLABEL_H /* if we may include sun/dklabel.h for disk label */ X#undef HAVE_SYS_TYPES_H /* if we may include sys/types.h (the standard) */ X#undef HAVE_SYS_STYPES_H /* if we may include sys/stypes.h (JOS) */ X#undef HAVE_SYS_FILEDESC_H /* if we may include sys/filedesc.h (JOS) */ X#undef HAVE_SYS_STAT_H /* if we may include sys/stat.h (the standard) */ X#undef HAVE_SYS_ACCT_H /* if we may include sys/acct.h */ X#undef HAVE_TYPES_H /* if we may include types.h (rare cases e.g. ATARI TOS) */ X#undef HAVE_STAT_H /* if we may include stat.h (rare cases e.g. ATARI TOS) */ X#undef HAVE_POLL_H /* if we may include poll.h to use poll() */ X#undef HAVE_SYS_POLL_H /* if we may include sys/poll.h to use poll() */ X#undef HAVE_SYS_SELECT_H /* if we may have sys/select.h nonstandard use for select() on some systems*/ X#undef NEED_SYS_SELECT_H /* if we need sys/select.h to use select() (this is nonstandard) */ X#undef HAVE_NETDB_H /* if we have netdb.h for get*by*() and rcmd() */ X#undef HAVE_ARPA_AIXRCMDS_H /* if we have arpa/aixrcmds.h for get*by*() and rcmd() */ X#undef HAVE_SYS_SOCKET_H /* if we have sys/socket.h for socket() */ X#undef NEED_SYS_SOCKET_H /* if we need sys/socket.h to use select() (this is nonstandard) */ X#undef HAVE_NETINET_IN_H /* if we have netinet/in.h */ X#undef HAVE_STROPTS_H /* if we have stropts.h */ X#undef HAVE_LINUX_PG_H /* if we may include linux/pg.h for PP ATAPI sypport */ X#undef HAVE_CAMLIB_H /* if we may include camlib.h for CAM SCSI transport definitions */ X#undef HAVE_IEEEFP_H /* if we may include ieeefp.h for finite()/isnand() */ X#undef HAVE_FP_H /* if we may include fp.h for FINITE()/IS_INF()/IS_NAN() */ X#undef HAVE_VALUES_H /* if we may include values.h for MAXFLOAT */ X#undef HAVE_FLOAT_H /* if we may include float.h for FLT_MAX */ X#undef HAVE_MATH_H /* if we may include math.h for e.g. isinf()/isnan() */ X#undef HAVE__FILBUF /* if we have _filbuf() for USG derived STDIO */ X#undef HAVE___FILBUF /* if we have __filbuf() for USG derived STDIO */ X#undef HAVE_USG_STDIO /* if we have USG derived STDIO */ X#undef HAVE_ERRNO_DEF /* if we have errno definition in */ X#undef HAVE_ENVIRON_DEF /* if we have environ definition in */ X#undef HAVE_SYS_SIGLIST_DEF /* if we have sys_siglist definition in */ X#undef HAVE_SYS_FORK_H /* if we should include sys/fork.h for forkx() definitions */ X#undef HAVE_VFORK_H /* if we should include vfork.h for vfork() definitions */ X#undef HAVE_ARPA_INET_H /* if we have arpa/inet.h (missing on BeOS) */ X /* BeOS has inet_ntoa() in */ X#undef HAVE_RPC_RPC_H /* if we may include rpc/rpc.h */ X#undef HAVE_BSD_DEV_SCSIREG_H /* if we have a NeXT Step compatible sg driver */ X#undef HAVE_SCSI_SCSI_H /* if we may include scsi/scsi.h */ X#undef HAVE_SCSI_SG_H /* if we may include scsi/sg.h */ X#undef HAVE_LINUX_SCSI_H /* if we may include linux/scsi.h */ X#undef HAVE_LINUX_SG_H /* if we may include linux/sg.h */ X#undef HAVE_LINUX_TYPES_H /* if we may include linux/types.h */ X#undef HAVE_LINUX_GFP_H /* if we may include linux/gfp.h */ X#undef HAVE_ASM_TYPES_H /* if we may include asm/types.h */ X#undef HAVE_SYS_CAPABILITY_H /* if we may include sys/capability.h */ X#undef HAVE_SELINUX_SELINUX_H /* if we may include selinux/selinux.h */ X#undef HAVE_SYS_BSDTTY_H /* if we have sys/bsdtty.h on HP-UX for TIOCGPGRP */ X#undef HAVE_OS_H /* if we have the BeOS kernel definitions in OS.h */ X#undef HAVE_OS2_H /* if we have the OS/2 definitions in os2.h */ X#undef HAVE_OS2ME_H /* if we have the OS/2 definitions in os2me.h */ X#undef HAVE_WINDOWS_H /* if we have the MS-Win definitions in windows.h */ X#undef HAVE_LINUX_FS_H /* if we have the Linux moving target linux/fs.h */ X#undef HAVE_EXT2FS_EXT2_FS_H /* if we have the Linux moving target ext2fs/ext2_fs.h */ X#undef HAVE_SYS_XATTR_H /* if we have the Linux Extended File Attr definitions in sys/xattr.h */ X#undef HAVE_ATTR_XATTR_H /* if we have the Linux Extended File Attr definitions in attr/xattr.h */ X#undef HAVE_CRT_EXTERNS_H /* if we have the Mac OS X env definitions in crt_externs.h */ X#undef HAVE_FNMATCH_H /* if we may include fnmatch.h */ X#undef HAVE_DIRECT_H /* if we may include direct.h (MSVC for getcwd()/chdir()/mkdir()/rmdir()) */ X#undef HAVE_SYSEXITS_H /* if we may include sysexits.h */ X X#undef HAVE_LIBINTL_H /* if we may include libintl.h */ X#undef HAVE_LOCALE_H /* if we may include locale.h */ X#undef HAVE_LANGINFO_H /* if we may include langinfo.h */ X#undef HAVE_NL_TYPES_H /* if we may include nl_types.h */ X#undef HAVE_CTYPE_H /* if we may include ctype.h */ X#undef HAVE_WCTYPE_H /* if we may include wctype.h */ X#undef HAVE_WCHAR_H /* if we may include wchar.h */ X#undef HAVE_ICONV_H /* if we may include iconv.h */ X X#undef HAVE_PRIV_H /* if we may include priv.h */ X#undef HAVE_SYS_PRIV_H /* if we may include sys/priv.h */ X#undef HAVE_EXEC_ATTR_H /* if we may include exec_attr.h */ X#undef HAVE_SECDB_H /* if we may include secdb.h */ X#undef HAVE_PTHREAD_H /* if we may include pthread.h */ X#undef HAVE_THREAD_H /* if we may include thread.h */ X X#undef HAVE_LIBGEN_H /* if we may include libgen.h */ X#undef HAVE_REGEX_H /* if we may include regex.h */ X#undef HAVE_REGEXP_H /* if we may include regexp.h */ X#undef HAVE_REGEXPR_H /* if we may include regexpr.h */ X X#undef HAVE_DLFCN_H /* if we may include dlfcn.h */ X#undef HAVE_LINK_H /* if we may include link.h */ X#undef HAVE_DL_H /* if we may include dl.h */ X#undef HAVE_LIBELF_H /* if we may include libelf.h */ X X#undef HAVE_RANLIB_H /* if we may include ranlib.h */ X X#undef HAVE_EXPAT_H /* if we may include expat.h */ X X/* X * Convert to SCHILY name X */ X#ifdef STDC_HEADERS X# ifndef HAVE_STDC_HEADERS X# define HAVE_STDC_HEADERS X# endif X#endif X X#ifdef HAVE_ELF_H X#define HAVE_ELF /* This system uses ELF */ X#else X# ifdef HAVE_AOUTHDR_H X# define HAVE_COFF /* This system uses COFF */ X# else X# ifdef HAVE_A_OUT_H X# define HAVE_AOUT /* This system uses AOUT */ X# endif X# endif X#endif X X/* X * Function declarations X */ X#undef HAVE_DECL_STAT /* Whether defines extern stat(); */ X#undef HAVE_DECL_LSTAT /* Whether defines extern lstat(); */ X X/* X * Library Functions X */ X#undef HAVE_ACCESS /* access() is present in libc */ X#undef HAVE_EACCESS /* eaccess() is present in libc */ X#undef HAVE_EUIDACCESS /* euidaccess() is present in libc */ X#undef HAVE_ACCESS_E_OK /* access() implements E_OK (010) for effective UIDs */ X#undef HAVE_CRYPT_IN_LIBC /* whether crypt() is in libc (needs no -lcrypt) */ X#undef HAVE_CRYPT /* crypt() is present in libc or libcrypt */ X#undef HAVE_STRERROR /* strerror() is present in libc */ X#undef HAVE_MEMCHR /* memchr() is present in libc */ X#undef HAVE_MEMCMP /* memcmp() is present in libc */ X#undef HAVE_MEMCPY /* memcpy() is present in libc */ X#undef HAVE_MEMCCPY /* memccpy() is present in libc */ X#undef HAVE_MEMMOVE /* memmove() is present in libc */ X#undef HAVE_MEMSET /* memset() is present in libc */ X#undef HAVE_MADVISE /* madvise() is present in libc */ X#undef HAVE_MLOCK /* mlock() is present in libc */ X#undef HAVE_MLOCKALL /* working mlockall() is present in libc */ X#undef HAVE_MMAP /* working mmap() is present in libc */ X#undef _MMAP_WITH_SIZEP /* mmap() needs address of size parameter */ X#undef HAVE_FLOCK /* *BSD flock() is present in libc */ X#undef HAVE_LOCKF /* lockf() is present in libc (XOPEN) */ X#undef HAVE_FCNTL_LOCKF /* file locking via fcntl() is present in libc */ X#undef HAVE_FCHDIR /* fchdir() is present in libc */ X#undef HAVE_FDOPENDIR /* fdopendir() is present in libc */ X#undef HAVE_GETDELIM /* getdelim() is present in libc */ X#undef HAVE_OPENAT /* openat() is present in libc */ X#undef HAVE_ATTROPEN /* attropen() is present in libc */ X#undef HAVE_FSTATAT /* fstatat() is present in libc */ X#undef HAVE_FCHOWNAT /* fchownat() is present in libc */ X#undef HAVE_FUTIMESAT /* futimesat() is present in libc */ X#undef HAVE_RENAMEAT /* renameat() is present in libc */ X#undef HAVE_UNLINKAT /* unlinkat() is present in libc */ X#undef HAVE___ACCESSAT /* __accessat() is present in libc */ X#undef HAVE_ACCESSAT /* accessat() is present in libc */ X#undef HAVE_REALPATH /* realpath() is present in libc */ X#undef HAVE_RESOLVEPATH /* resolvepath() is present in libc */ X/* X * See e.g. http://www.die.net/doc/linux/man/man2/mkdirat.2.html X */ X#undef HAVE_MKDIRAT /* mkdirat() is present in libc */ X#undef HAVE_FACCESSAT /* faccessat() is present in libc */ X#undef HAVE_FCHMODAT /* fchmodat() is present in libc */ X#undef HAVE_LINKAT /* inkat() is present in libc */ X#undef HAVE_MKFIFOAT /* mkfifoat() is present in libc */ X#undef HAVE_MKNODAT /* mknodat() is present in libc */ X#undef HAVE_READLINKAT /* readlinkat() is present in libc */ X#undef HAVE_SYMLINKAT /* symlinkat() is present in libc */ X#undef HAVE_UTIMENSAT /* utimensat() is present in libc */ X#undef HAVE_IOCTL /* ioctl() is present in libc */ X#undef HAVE_FCNTL /* fcntl() is present in libc */ X#undef HAVE_PIPE /* pipe() is present in libc */ X#undef HAVE__PIPE /* _pipe() is present in libc */ X#undef HAVE_POPEN /* popen() is present in libc */ X#undef HAVE_PCLOSE /* pclose() is present in libc */ X#undef HAVE__POPEN /* _popen() is present in libc */ X#undef HAVE__PCLOSE /* _pclose() is present in libc */ X#undef HAVE_CLOSEFROM /* closefrom() is present in libc */ X#undef HAVE_STATVFS /* statvfs() is present in libc */ X#undef HAVE_QUOTACTL /* quotactl() is present in libc */ X#undef HAVE_QUOTAIOCTL /* use ioctl(f, Q_QUOTACTL, &q) instead of quotactl() */ X#undef HAVE_GETPID /* getpid() is present in libc */ X#undef HAVE_GETPPID /* getppid() is present in libc */ X#undef HAVE_SETREUID /* setreuid() is present in libc */ X#undef HAVE_SETRESUID /* setresuid() is present in libc */ X#undef HAVE_SETEUID /* seteuid() is present in libc */ X#undef HAVE_SETUID /* setuid() is present in libc */ X#undef HAVE_SETREGID /* setregid() is present in libc */ X#undef HAVE_SETRESGID /* setresgid() is present in libc */ X#undef HAVE_SETEGID /* setegid() is present in libc */ X#undef HAVE_SETGID /* setgid() is present in libc */ X#undef HAVE_GETUID /* getuid() is present in libc */ X#undef HAVE_GETEUID /* geteuid() is present in libc */ X#undef HAVE_GETGID /* getgid() is present in libc */ X#undef HAVE_GETEGID /* getegid() is present in libc */ X#undef HAVE_GETPGID /* getpgid() is present in libc (POSIX) */ X#undef HAVE_SETPGID /* setpgid() is present in libc (POSIX) */ X#undef HAVE_GETPGRP /* getpgrp() is present in libc (ANY) */ X#undef HAVE_GETSID /* getsid() is present in libc (POSIX) */ X#undef HAVE_SETSID /* setsid() is present in libc (POSIX) */ X#undef HAVE_SETPGRP /* setpgrp() is present in libc (ANY) */ X#undef HAVE_BSD_GETPGRP /* getpgrp() in libc is BSD-4.2 compliant */ X#undef HAVE_BSD_SETPGRP /* setpgrp() in libc is BSD-4.2 compliant */ X#undef HAVE_GETPWNAM /* getpwnam() in libc */ X#undef HAVE_GETPWENT /* getpwent() in libc */ X#undef HAVE_GETPWUID /* getpwuid() in libc */ X#undef HAVE_SETPWENT /* setpwent() in libc */ X#undef HAVE_ENDPWENT /* endpwent() in libc */ X#undef HAVE_GETGRNAM /* getgrnam() in libc */ X#undef HAVE_GETGRENT /* getgrent() in libc */ X#undef HAVE_GETGRGID /* getgrgid() in libc */ X#undef HAVE_SETGRENT /* setgrent() in libc */ X#undef HAVE_ENDGRENT /* endgrent() in libc */ X#undef HAVE_GETSPNAM /* getspnam() in libc (SVR4 compliant) */ X#undef HAVE_GETSPWNAM /* getspwnam() in libsec.a (HP-UX) */ X#undef HAVE_GETLOGIN /* getlogin() in libc */ X#undef HAVE_SYNC /* sync() is present in libc */ X#undef HAVE_FSYNC /* fsync() is present in libc */ X#undef HAVE_TCGETATTR /* tcgetattr() is present in libc */ X#undef HAVE_TCSETATTR /* tcsetattr() is present in libc */ X#undef HAVE_TCGETPGRP /* tcgetpgrp() is present in libc */ X#undef HAVE_TCSETPGRP /* tcsetpgrp() is present in libc */ X#undef HAVE_TCGETSID /* tcgetsid() is present in libc */ X#undef HAVE_WAIT /* wait() is present in libc */ X#undef HAVE_WAIT3 /* working wait3() is present in libc */ X#undef HAVE_WAIT4 /* wait4() is present in libc */ X#undef HAVE_WAIT6 /* wait6() is present in libc */ X#undef HAVE_WAITID /* waitid() is present in libc */ X#undef HAVE_WAITPID /* waitpid() is present in libc */ X#undef HAVE_WNOWAIT_WAITPID /* waitpid() supports NOWAIT */ X#undef HAVE_CWAIT /* cwait() is present in libc */ X#undef HAVE_GETHOSTID /* gethostid() is present in libc */ X#undef HAVE_GETHOSTNAME /* gethostname() is present in libc */ X#undef HAVE_GETDOMAINNAME /* getdomainname() is present in libc */ X#undef HAVE_GETPAGESIZE /* getpagesize() is present in libc */ X#undef HAVE_GETDTABLESIZE /* getdtablesize() is present in libc */ X#undef HAVE_GETRUSAGE /* getrusage() is present in libc */ X#undef HAVE_GETRLIMIT /* getrlimit() is present in libc */ X#undef HAVE_SETRLIMIT /* setrlimit() is present in libc */ X#undef HAVE_ULIMIT /* ulimit() is present in libc */ X#undef HAVE_GETTIMEOFDAY /* gettimeofday() is present in libc */ X#undef HAVE_SETTIMEOFDAY /* settimeofday() is present in libc */ X#undef HAVE_VAR_TIMEZONE /* extern long timezone is present in libc */ X#undef HAVE_VAR_TIMEZONE_DEF /* extern long timezone is present in time.h */ X#undef HAVE_TIME /* time() is present in libc */ X#undef HAVE_GMTIME /* gmtime() is present in libc */ X#undef HAVE_LOCALTIME /* localtime() is present in libc */ X#undef HAVE_MKTIME /* mktime() is present in libc */ X#undef HAVE_TIMEGM /* timegm() is present in libc */ X#undef HAVE_TIMELOCAL /* timelocal() is present in libc */ X#undef HAVE_FTIME /* ftime() is present in libc */ X#undef HAVE_STIME /* stime() is present in libc */ X#undef HAVE_TZSET /* tzset() is present in libc */ X#undef HAVE_CTIME /* ctime() is present in libc */ X#undef HAVE_CFTIME /* cftime() is present in libc */ X#undef HAVE_ASCFTIME /* ascftime() is present in libc */ X#undef HAVE_STRFTIME /* strftime() is present in libc */ X#undef HAVE_GETHRTIME /* gethrtime() is present in libc */ X#undef HAVE_POLL /* poll() is present in libc */ X#undef HAVE_SELECT /* select() is present in libc */ X#undef HAVE_ISASTREAM /* isastream() is present in libc */ X#undef HAVE_CHMOD /* chmod() is present in libc */ X#undef HAVE_FCHMOD /* fchmod() is present in libc */ X#undef HAVE_LCHMOD /* lchmod() is present in libc */ X#undef HAVE_CHOWN /* chown() is present in libc */ X#undef HAVE_FCHOWN /* fchown() is present in libc */ X#undef HAVE_LCHOWN /* lchown() is present in libc */ X#undef HAVE_TRUNCATE /* truncate() is present in libc */ X#undef HAVE_FTRUNCATE /* ftruncate() is present in libc */ X#undef HAVE_BRK /* brk() is present in libc */ X#undef HAVE_SBRK /* sbrk() is present in libc */ X#undef HAVE_VA_COPY /* va_copy() is present in varargs.h/stdarg.h */ X#undef HAVE__VA_COPY /* __va_copy() is present in varargs.h/stdarg.h */ X#undef HAVE_DTOA /* BSD-4.4 __dtoa() is present in libc */ X#undef HAVE_DTOA_R /* BSD-4.4 __dtoa() with result ptr (reentrant) */ X#undef HAVE_DUP /* dup() is present in libc */ X#undef HAVE_DUP2 /* dup2() is present in libc */ X#undef HAVE_GETCWD /* POSIX getcwd() is present in libc */ X#undef HAVE_SMMAP /* may map anonymous memory to get shared mem */ X#undef HAVE_SHMAT /* shmat() is present in libc */ X#undef HAVE_SHMGET /* shmget() is present in libc and working */ X#undef HAVE_SEMGET /* semget() is present in libc */ X#undef HAVE_LSTAT /* lstat() is present in libc */ X#undef HAVE_READLINK /* readlink() is present in libc */ X#undef HAVE_SYMLINK /* symlink() is present in libc */ X#undef HAVE_LINK /* link() is present in libc */ X#undef HAVE_HARD_SYMLINKS /* link() allows hard links on symlinks */ X#undef HAVE_LINK_NOFOLLOW /* link() does not follow symlinks when hard linking symlinks */ X#undef HAVE_RENAME /* rename() is present in libc */ X#undef HAVE_MKFIFO /* mkfifo() is present in libc */ X#undef HAVE_MKNOD /* mknod() is present in libc */ X#undef HAVE_ECVT /* ecvt() is present in libc */ X#undef HAVE_FCVT /* fcvt() is present in libc */ X#undef HAVE_GCVT /* gcvt() is present in libc */ X#undef HAVE_ECVT_R /* ecvt_r() is present in libc */ X#undef HAVE_FCVT_R /* fcvt_r() is present in libc */ X#undef HAVE_GCVT_R /* gcvt_r() is present in libc */ X#undef HAVE_QECVT /* qecvt() is present in libc */ X#undef HAVE_QFCVT /* qfcvt() is present in libc */ X#undef HAVE_QGCVT /* qgcvt() is present in libc */ X#undef HAVE__QECVT /* _qecvt() is present in libc */ X#undef HAVE__QFCVT /* _qfcvt() is present in libc */ X#undef HAVE__QGCVT /* _qgcvt() is present in libc */ X#undef HAVE__QECVT_R /* _qecvt_r() is present in libc */ X#undef HAVE__QFCVT_R /* _qfcvt_r() is present in libc */ X#undef HAVE__QGCVT_R /* _qgcvt_r() is present in libc */ X#undef HAVE__LDECVT /* _ldecvt() is present in libc */ X#undef HAVE__LDFCVT /* _ldfcvt() is present in libc */ X#undef HAVE__LDGCVT /* _ldgcvt() is present in libc */ X#undef HAVE__LDECVT_R /* _ldecvt_r() is present in libc */ X#undef HAVE__LDFCVT_R /* _ldfcvt_r() is present in libc */ X#undef HAVE__LDGCVT_R /* _ldgcvt_r() is present in libc */ X#undef HAVE_ECONVERT /* econvert() is present in libc */ X#undef HAVE_FCONVERT /* fconvert() is present in libc */ X#undef HAVE_GCONVERT /* gconvert() is present in libc */ X#undef HAVE_QECONVERT /* qeconvert() is present in libc */ X#undef HAVE_QFCONVERT /* qfconvert() is present in libc */ X#undef HAVE_QGCONVERT /* qgconvert() is present in libc */ X#undef HAVE_ISINF /* isinf() is present in libc */ X#undef HAVE_ISNAN /* isnan() is present in libc */ X#undef HAVE_C99_ISINF /* isinf() is present in math.h/libc */ X#undef HAVE_C99_ISNAN /* isnan() is present in math.h/libc */ X#undef HAVE_GETC_UNLOCKED /* getc_unlocked() is present in libc */ X#undef HAVE_GETCHAR_UNLOCKED /* getchar_unlocked() is present in libc */ X#undef HAVE_PUTC_UNLOCKED /* putc_unlocked() is present in libc */ X#undef HAVE_PUTCHAR_UNLOCKED /* putchar_unlocked() is present in libc */ X#undef HAVE_FLOCKFILE /* flockfile() is present in libc */ X#undef HAVE_FUNLOCKFILE /* funlockfile() is present in libc */ X#undef HAVE_FTRYLOCKFILE /* ftrylockfile() is present in libc */ X#undef HAVE_FINITE /* finite() is present in libc/ieeefp.h (SVr4) */ X#undef HAVE_ISNAND /* isnand() is present in libc/ieeefp.h (SVr4) */ X#undef HAVE_RAND /* rand() is present in libc */ X#undef HAVE_DRAND48 /* drand48() is present in libc */ X#undef HAVE_ICONV_IN_LIBC /* whether iconv() is in libc (needs no -liconv) */ X#undef HAVE_ICONV /* iconv() is present in libiconv */ X#undef HAVE_ICONV_OPEN /* iconv_open() is present in libiconv */ X#undef HAVE_ICONV_CLOSE /* iconv_close() is present in libiconc */ X#undef HAVE_LIBICONV /* libiconv() is present in libiconv */ X#undef HAVE_LIBICONV_OPEN /* libiconv_open() is present in liiconv */ X#undef HAVE_LIBICONV_CLOSE /* libiconv_close() is present in libiconv */ X#undef HAVE_SETPRIORITY /* setpriority() is present in libc */ X#undef HAVE_NICE /* nice() is present in libc */ X#undef HAVE_DOSSETPRIORITY /* DosSetPriority() is present in libc */ X#undef HAVE_DOSALLOCSHAREDMEM /* DosAllocSharedMem() is present in libc */ X#undef HAVE_SEEKDIR /* seekdir() is present in libc */ X#undef HAVE_GETENV /* getenv() is present in libc */ X#undef HAVE_PUTENV /* putenv() is present in libc (preferred function) */ X#undef HAVE_SETENV /* setenv() is present in libc (use instead of putenv()) */ X#undef HAVE_UNSETENV /* unsetenv() is present in libc */ X#undef HAVE_UNAME /* uname() is present in libc */ X#undef HAVE_SNPRINTF /* snprintf() is present in libc */ X#undef HAVE_VPRINTF /* vprintf() is present in libc */ X#undef HAVE_VFPRINTF /* vfprintf() is present in libc */ X#undef HAVE_VSPRINTF /* vsprintf() is present in libc */ X#undef HAVE_VSNPRINTF /* vsnprintf() is present in libc */ X#undef HAVE_STRCAT /* strcat() is present in libc */ X#undef HAVE_STRNCAT /* strncat() is present in libc */ X#undef HAVE_STRCMP /* strcmp() is present in libc */ X#undef HAVE_STRNCMP /* strncmp() is present in libc */ X#undef HAVE_STRCPY /* strcpy() is present in libc */ X#undef HAVE_STRLCAT /* strlcat() is present in libc */ X#undef HAVE_STRLCPY /* strlcpy() is present in libc */ X#undef HAVE_STRNCPY /* strncpy() is present in libc */ X#undef HAVE_STRDUP /* strdup() is present in libc */ X#undef HAVE_STRNDUP /* strndup() is present in libc */ X#undef HAVE_STRLEN /* strlen() is present in libc */ X#undef HAVE_STRNLEN /* strnlen() is present in libc */ X#undef HAVE_STRCHR /* strchr() is present in libc */ X#undef HAVE_STRRCHR /* strrchr() is present in libc */ X#undef HAVE_STRSTR /* strstr() is present in libc */ X#undef HAVE_STRSPN /* strspn() is present in libc */ X#undef HAVE_STRCSPN /* strcspn() is present in libc */ X#undef HAVE_STRCASECMP /* strcasecmp() is present in libc */ X#undef HAVE_STRNCASECMP /* strncasecmp() is present in libc */ X#undef HAVE_BASENAME /* basename() is present in libc */ X#undef HAVE_DIRNAME /* dirname() is present in libc */ X#undef HAVE_PATHCONF /* pathconf() is present in libc */ X#undef HAVE_FPATHCONF /* fpathconf() is present in libc */ X#undef HAVE_LPATHCONF /* lpathconf() is present in libc */ X#undef HAVE_STRTOL /* strtol() is present in libc */ X#undef HAVE_STRTOLL /* strtoll() is present in libc */ X#undef HAVE_STRTOUL /* strtoul() is present in libc */ X#undef HAVE_STRTOULL /* strtoull() is present in libc */ X#undef HAVE_STRTOD /* strtold() is present in libc */ X#undef HAVE_STRSIGNAL /* strsignal() is present in libc */ X#undef HAVE_STR2SIG /* str2sig() is present in libc */ X#undef HAVE_SIG2STR /* sig2str() is present in libc */ X#undef HAVE_SIGSETJMP /* sigsetjmp() is present in libc */ X#undef HAVE_SIGLONGJMP /* siglongjmp() is present in libc */ X#undef HAVE_KILL /* kill() is present in libc */ X#undef HAVE_KILLPG /* killpg() is present in libc */ X#undef HAVE_SIGNAL /* signal() is present in libc */ X#undef HAVE_SIGHOLD /* sighold() is present in libc */ X#undef HAVE_SIGRELSE /* sigrelse() is present in libc */ X#undef HAVE_SIGIGNORE /* sigignore() is present in libc */ X#undef HAVE_SIGPAUSE /* sigpause() is present in libc */ X#undef HAVE_SIGPROCMASK /* sigprocmask() is present in libc (POSIX) */ X#undef HAVE_SIGSETMASK /* sigsetmask() is present in libc (BSD) */ X#undef HAVE_SIGSET /* sigset() is present in libc (POSIX) */ X#undef HAVE_SIGALTSTACK /* sigaltstack() is present in libc (POSIX) */ X#undef HAVE_SIGBLOCK /* sigblock() is present in libc (BSD) */ X#undef HAVE_SYS_SIGLIST /* char *sys_siglist[] is present in libc */ X#undef HAVE_ALARM /* alarm() is present in libc */ X#undef HAVE_SLEEP /* sleep() is present in libc */ X#undef HAVE_USLEEP /* usleep() is present in libc */ X#undef HAVE_FORK /* fork() is present in libc */ X#undef HAVE_FORKX /* forkx() is present in libc */ X#undef HAVE_FORKALL /* forkall() is present in libc */ X#undef HAVE_FORKALLX /* forkallx() is present in libc */ X#undef HAVE_VFORK /* working vfork() is present in libc */ X#undef HAVE_VFORKX /* working vforkx() is present in libc */ X#undef HAVE_EXECL /* execl() is present in libc */ X#undef HAVE_EXECLE /* execle() is present in libc */ X#undef HAVE_EXECLP /* execlp() is present in libc */ X#undef HAVE_EXECV /* execv() is present in libc */ X#undef HAVE_EXECVE /* execve() is present in libc */ X#undef HAVE_EXECVP /* execvp() is present in libc */ X#undef HAVE_SPAWNL /* spawnl() is present in libc */ X#undef HAVE_SPAWNLE /* spawnle() is present in libc */ X#undef HAVE_SPAWNLP /* spawnlp() is present in libc */ X#undef HAVE_SPAWNLPE /* spawnlpe() is present in libc */ X#undef HAVE_SPAWNV /* spawnv() is present in libc */ X#undef HAVE_SPAWNVE /* spawnve() is present in libc */ X#undef HAVE_SPAWNVP /* spawnvp() is present in libc */ X#undef HAVE_SPAWNVPE /* spawnvpe() is present in libc */ X#undef HAVE_ATEXIT /* atexit() is present in libc */ X#undef HAVE_ON_EXIT /* on_exit() (SunOS-4.x) is present in libc */ X#undef HAVE_GETEXECNAME /* getexecname() is present in libc */ X#undef HAVE_GETPROGNAME /* getprogname() is present in libc */ X#undef HAVE_SETPROGNAME /* setprogname() is present in libc */ X#undef HAVE_PROC_PIDPATH /* proc_pidpath() is present in libc */ X#undef HAVE_VAR_PROGNAME /* extern char *__progname is present in libc */ X#undef HAVE_VAR_PROGNAME_FULL /* extern char *__progname_full is present in libc */ X#undef HAVE_GETLOADAVG /* getloadavg() is present in libc */ X#undef HAVE_ALLOCA /* alloca() is present (else use malloc())*/ X#undef HAVE_MALLOC /* malloc() is present in libc */ X#undef HAVE_CALLOC /* calloc() is present in libc */ X#undef HAVE_REALLOC /* realloc() is present in libc */ X#undef HAVE_REALLOC_NULL /* realloc() implements realloc(NULL, size) */ X#undef HAVE_VALLOC /* valloc() is present in libc (else use malloc())*/ X#undef HAVE_MEMALIGN /* memalign() is present in libc */ X#undef HAVE_POSIX_MEMALIGN /* posix_memalign() is present in libc */ X#undef vfork X#undef HAVE_WCSCAT /* wcscat() is present in libc */ X#undef HAVE_WCSNCAT /* wcsncat() is present in libc */ X#undef HAVE_WCSCMP /* wcscmp() is present in libc */ X#undef HAVE_WCSNCMP /* wcsncmp() is present in libc */ X#undef HAVE_WCSCPY /* wcscpy() is present in libc */ X#undef HAVE_WCSLCAT /* wcsncat() is present in libc */ X#undef HAVE_WCSLCPY /* wcsncpy() is present in libc */ X#undef HAVE_WCSNCPY /* wcsncpy() is present in libc */ X#undef HAVE_WCSDUP /* wcsdup() is present in libc */ X#undef HAVE_WCSNDUP /* wcsndup() is present in libc */ X#undef HAVE_WCSLEN /* wcslen() is present in libc */ X#undef HAVE_WCSNLEN /* wcsnlen() is present in libc */ X#undef HAVE_WCSCHR /* wcschr() is present in libc */ X#undef HAVE_WCSRCHR /* wcsrchr() is present in libc */ X#undef HAVE_WCSSTR /* wcsstr() is present in libc */ X#undef HAVE_WCSSPN /* wcsspn() is present in libc */ X#undef HAVE_WCSCSPN /* wcscspn() is present in libc */ X#undef HAVE_WCWIDTH /* wcwidth() is present in libc */ X#undef HAVE_WCSWIDTH /* wcswidth() is present in libc */ X#undef HAVE_WCTYPE /* wctype() is present in libc */ X#undef HAVE_ISWCTYPE /* iswctype() is present in libc */ X X X#undef HAVE_CHFLAGS /* chflags() is present in libc */ X#undef HAVE_FCHFLAGS /* fchflags() is present in libc */ X#undef HAVE_FFLAGSTOSTR /* fflagstostr() is present in libc */ X#undef HAVE_STRTOFFLAGS /* strtofflags() is present in libc */ X X#undef HAVE_GETTEXT_IN_LIBC /* whether gettext() is in libc (needs no -lintl) */ X#undef HAVE_GETTEXT /* gettext() is present in -lintl */ X#undef HAVE_SETLOCALE /* setlocale() is present in libc */ X#undef HAVE_LOCALECONV /* localeconv() is present in libc */ X#undef HAVE_NL_LANGINFO /* nl_langinfo() is present in libc */ X X#undef HAVE_EXPAT_IN_LIBC /* whether XML_Parse() is in libc (needs no -lexpat) */ X#undef HAVE_XML_PARSE /* whether XML_Parse() libc or -lexpat */ X X#undef HAVE_PCSC_IN_LIBC /* whether SCardEstablishContext() is in libc (needs no -lpcsclite) */ X#undef HAVE_SCARDESTABLISHCONTEXT /* whether SCardEstablishContext() libc or -lpcsclite */ X X#undef HAVE_CRYPTO_IN_LIBC /* whether CRYPTO_free() is in libc (needs no -lcrypto) */ X#undef HAVE_CRYPTO_FREE /* whether CRYPTO_free() libc or -lcrypto */ X X#undef HAVE_SSL_IN_LIBC /* whether SSL_free() is in libc (needs no -lssl) */ X#undef HAVE_SSL_FREE /* whether SSL_free() libc or -lssl */ X X#undef HAVE_SETBUF /* setbuf() is present in libc */ X#undef HAVE_SETVBUF /* setvbuf() is present in libc */ X X#undef HAVE_FNMATCH /* fnmatch() is present in libc */ X#undef HAVE_FNMATCH_IGNORECASE /* fnmatch() implements FNM_IGNORECASE */ X X#undef HAVE_MKTEMP /* mktemp() is present in libc */ X#undef HAVE_MKSTEMP /* mkstemp() is present in libc */ X X#undef HAVE_GETPPRIV /* getppriv() is present in libc */ X#undef HAVE_SETPPRIV /* setppriv() is present in libc */ X#undef HAVE_PRIV_SET /* priv_set() is present in libc */ X#undef HAVE_ISSETUGID /* issetugid() is present in libc */ X#undef HAVE_GETROLES /* getroles() is present in libc (AIX) */ X#undef HAVE_PRIVBIT_SET /* privbit_set() is present in libc (AIX) */ X X#undef HAVE_GETAUTHATTR /* getauthattr() is present in -lsecdb */ X#undef HAVE_GETUSERATTR /* getuserattr() is present in -lsecdb */ X#undef HAVE_GETEXECATTR /* getexecattr() is present in -lsecdb */ X#undef HAVE_GETPROFATTR /* getprofattr() is present in -lsecdb */ X X#undef HAVE_GMATCH /* gmatch() is present in -lgen */ X X#undef HAVE_ELF_BEGIN /* elf_begin() is present in -lelf */ X X#undef HAVE_CLONE_AREA /* clone_area() is present in libc */ X#undef HAVE_CREATE_AREA /* create_area() is present in libc */ X#undef HAVE_DELETE_AREA /* delete_area() is present in libc */ X X#undef HAVE_RES_INIT_IN_LIBC /* whether res_init() is in libc (needs no -lresolv) */ X X#undef HAVE_DLOPEN_IN_LIBC /* whether dlopen() is in libc (needs no -ldl) */ X#undef HAVE_DLOPEN /* dlopen() is present in libc */ X#undef HAVE_DLCLOSE /* dlclose() is present in libc */ X#undef HAVE_DLSYM /* dlsym() is present in libc */ X#undef HAVE_DLERROR /* dlerror() is present in libc */ X#undef HAVE_DLINFO /* dlinfo() is present in libc */ X#undef HAVE_SHL_LOAD /* shl_load() is present in libc */ X#undef HAVE_SHL_UNLOAD /* shl_unload() is present in libc */ X#undef HAVE_SHL_GETHANDLE /* shl_gethandle() is present in libc */ X#undef HAVE_LOADLIBRARY /* LoadLibrary() as present in libc */ X#undef HAVE_FREELIBRARY /* FreeLibrary() is present in libc */ X#undef HAVE_GETPROCADDRESS /* GetProcAddress() is present in libc */ X X#undef HAVE_YIELD /* yield() is present in libc */ X#undef HAVE_THR_YIELD /* thr_yield() is present in libc */ X X#undef HAVE_PTHREAD_CREATE /* pthread_create() is present in libpthread */ X#undef HAVE_PTHREAD_KILL /* pthread_kill() is present in libpthread */ X#undef HAVE_PTHREAD_MUTEX_LOCK /* pthread_mutex_lock() is present in libpthread */ X#undef HAVE_PTHREAD_COND_WAIT /* pthread_cond_wait() is present in libpthread */ X#undef HAVE_PTHREAD_SPIN_LOCK /* pthread_spin_lock() is present in libpthread */ X X#undef HAVE_CLOCK_GETTIME_IN_LIBC /* whether clock_gettime() is in libc (needs no -lrt) */ X#undef HAVE_CLOCK_GETTIME /* clock_gettime() is present in librt */ X#undef HAVE_CLOCK_SETTIME /* clock_settime() is present in librt */ X#undef HAVE_CLOCK_GETRES /* clock_getres() is present in librt */ X#undef HAVE_SCHED_GETPARAM /* sched_getparam() is present in librt */ X#undef HAVE_SCHED_SETPARAM /* sched_setparam() is present in librt */ X#undef HAVE_SCHED_GETSCHEDULER /* sched_getscheduler() is present in librt */ X#undef HAVE_SCHED_SETSCHEDULER /* sched_setscheduler() is present in librt */ X#undef HAVE_SCHED_YIELD /* sched_yield() is present in librt */ X#undef HAVE_NANOSLEEP /* nanosleep() is present in librt */ X X/* X * The POSIX.1e draft has been withdrawn in 1997. X * Linux started to implement this outdated concept in 1997. X */ X#undef HAVE_CAP_GET_PROC /* cap_get_proc() is present in libcap */ X#undef HAVE_CAP_SET_PROC /* cap_set_proc() is present in libcap */ X#undef HAVE_CAP_SET_FLAG /* cap_set_flag() is present in libcap */ X#undef HAVE_CAP_CLEAR_FLAG /* cap_clear_flag() is present in libcap */ X X/* X * SELinux support X */ X#undef HAVE_IS_SELINUX_ENABLED /* is_selinux_enabled() is present in libselinux */ X X#undef HAVE_DIRFD /* dirfd() is present in libc */ X#undef HAVE_ISWPRINT /* iswprint() is present in libc */ X#undef HAVE_ISWBLANK /* iswblank() is present in libc */ X#undef HAVE_ISBLANK /* isblank() is present in libc */ X#undef HAVE_MBSINIT /* mbsinit() is present in libc */ X#undef HAVE_MBTOWC /* mbtowc() is present in libc */ X#undef HAVE_WCTOMB /* wctomb() is present in libc */ X#undef HAVE_MBRTOWC /* mbrtowc() is present in libc */ X#undef HAVE_WCRTOMB /* wcrtomb() is present in libc */ X X#undef HAVE_PRINTF_J /* *printf() in libc supports %jd */ X#undef HAVE_PRINTF_Z /* *printf() in libc supports %zd */ X#undef HAVE_PRINTF_LL /* *printf() in libc supports %lld */ X X/* X * Functions that we defined in 1982 but where POSIX.1-2008 defined X * a POSIX violating incompatible definition. X * We use AC_RCHECK_FUNCS(), so we get HAVE_RAW_* results as some X * Linux distros have fexecve() that returns ENOSYS. X */ X#undef HAVE_RAW_FEXECL /* fexecl() */ X#undef HAVE_RAW_FEXECLE /* fexecle() */ X#undef HAVE_RAW_FEXECV /* fexecv() */ X#undef HAVE_RAW_FEXECVE /* fexecve() */ X#undef HAVE_RAW_FSPAWNV /* fspawnv() */ X#undef HAVE_RAW_FSPAWNL /* fspawnl() */ X#undef HAVE_RAW_FSPAWNV_NOWAIT /* fspawnv_nowait() */ X#undef HAVE_RAW_GETLINE /* getline() */ X#undef HAVE_RAW_FGETLINE /* fgetline() */ X X X/* X * Misc OS stuff X */ X /* Dirty hack, better use C program not test */ X#if !defined(_MSC_VER) && !defined(__MINGW32__) X#undef HAVE__DEV_TTY /* /dev/tty present */ X#undef HAVE__DEV_NULL /* /dev/null present */ X#undef HAVE__DEV_ZERO /* /dev/zero present */ X#undef HAVE__DEV_STDIN /* /dev/stdin present */ X#undef HAVE__DEV_STDOUT /* /dev/stdout present */ X#undef HAVE__DEV_STDERR /* /dev/stderr present */ X#undef HAVE__DEV_FD_0 /* /dev/fd/0 present */ X#undef HAVE__DEV_FD_1 /* /dev/fd/1 present */ X#undef HAVE__DEV_FD_2 /* /dev/fd/2 present */ X#undef HAVE__USR_SRC_LINUX_INCLUDE /* /usr/src/linux/include present */ X#undef HAVE__USR_XPG4_BIN_SH /* /usr/xpg4/bin/sh present */ X#undef HAVE__OPT_SCHILY_XPG4_BIN_SH /* /opt/schily/xpg4/bin/sh present */ X#endif X X/* X * Misc OS programs X */ X#undef SHELL_IS_BASH /* sh is bash */ X#undef BIN_SHELL_IS_BASH /* /bin/sh is bash */ X#undef SHELL_CE_IS_BROKEN /* sh -ce is broken */ X#undef BIN_SHELL_CE_IS_BROKEN /* /bin/sh -ce is broken */ X#undef BIN_SHELL_BOSH /* /bin/bosh is a working Bourne Shell */ X#undef OPT_SCHILY_BIN_SHELL_BOSH /* /opt/schily/bin/bosh is a working Bourne Shell */ X X/* X * OS madness X */ X#undef HAVE_BROKEN_LINUX_EXT2_FS_H /* whether is broken */ X#undef HAVE_BROKEN_SRC_LINUX_EXT2_FS_H /* whether /usr/src/linux/include/linux/ext2_fs.h is broken */ X#undef HAVE_USABLE_LINUX_EXT2_FS_H /* whether linux/ext2_fs.h is usable at all */ X#undef HAVE_BROKEN_SCSI_SCSI_H /* whether is broken */ X#undef HAVE_BROKEN_SRC_SCSI_SCSI_H /* whether /usr/src/linux/include/scsi/scsi.h is broken */ X#undef HAVE_BROKEN_SCSI_SG_H /* whether is broken */ X#undef HAVE_BROKEN_SRC_SCSI_SG_H /* whether /usr/src/linux/include/scsi/sg.h is broken */ X X/* X * Linux Extended File Attributes X */ X#undef HAVE_GETXATTR /* getxattr() */ X#undef HAVE_SETXATTR /* setxattr() */ X#undef HAVE_LISTXATTR /* listxattr() */ X#undef HAVE_LGETXATTR /* lgetxattr() */ X#undef HAVE_LSETXATTR /* lsetxattr() */ X#undef HAVE_LLISTXATTR /* llistxattr() */ X X/* X * Important: This must be a result from a check _before_ the Large File test X * has been run. It then tells us whether these functions are X * available even when not in Large File mode. X * X * Do not run the AC_FUNC_FSEEKO test from the GNU tar Large File test X * siute. It will use the same cache names and interfere with our test. X * Instead use the tests AC_SMALL_FSEEKO/AC_SMALL/STELLO and make sure X * they are placed before the large file tests. X */ X#undef HAVE_FSEEKO /* fseeko() is present in default compile mode */ X#undef HAVE_FTELLO /* ftello() is present in default compile mode */ X X#undef HAVE_RCMD /* rcmd() is present in libc/libsocket */ X#undef HAVE_SOCKET /* socket() is present in libc/libsocket */ X#undef HAVE_SOCKETPAIR /* socketpair() is present in libc/libsocket */ X#undef HAVE_GETSERVBYNAME /* getservbyname() is present in libc/libsocket */ X#undef HAVE_INET_NTOA /* inet_ntoa() is present in libc/libsocket */ X#undef HAVE_GETADDRINFO /* getaddrinfo() is present in libc/libsocket */ X#undef HAVE_GETNAMEINFO /* getnameinfo() is present in libc/libsocket */ X#undef HAVE_HOST2NETNAME /* host2netname() is present in libc/libsocket */ X#undef HAVE_NETNAME2HOST /* netname2host() is present in libc/libsocket */ X X X#if defined(HAVE_QUOTACTL) || defined(HAVE_QUOTAIOCTL) X# define HAVE_QUOTA /* The system inludes quota */ X#endif X X/* X * We need to test for the include files too because Apollo Domain/OS has a X * libc that includes the functions but the includes files are not visible X * from the BSD compile environment. X * X * ATARI MiNT has a non-working shmget(), so we test for it separately. X */ X#if defined(HAVE_SHMAT) && defined(HAVE_SHMGET) && \ X defined(HAVE_SYS_SHM_H) && defined(HAVE_SYS_IPC_H) X# define HAVE_USGSHM /* USG shared memory is present */ X#endif X#if defined(HAVE_SEMGET) && defined(HAVE_SYS_SHM_H) && defined(HAVE_SYS_IPC_H) X# define HAVE_USGSEM /* USG semaphores are present */ X#endif X X#if defined(HAVE_GETPGRP) && !defined(HAVE_BSD_GETPGRP) X#define HAVE_POSIX_GETPGRP 1 /* getpgrp() in libc is POSIX compliant */ X#endif X#if defined(HAVE_SETPGRP) && !defined(HAVE_BSD_SETPGRP) X#define HAVE_POSIX_SETPGRP 1 /* setpgrp() in libc is POSIX compliant */ X#endif X X/* X * Structures X */ X#undef HAVE_FILE__FLAGS /* if FILE * contains _flags */ X#undef HAVE_FILE__IO_BUF_BASE /* if FILE * contains _IO_buf_base */ X X#undef HAVE_MTGET_TYPE /* if struct mtget contains mt_type (drive type) */ X#undef HAVE_MTGET_MODEL /* if struct mtget contains mt_model (drive type) */ X#undef HAVE_MTGET_DSREG /* if struct mtget contains mt_dsreg (drive status) */ X#undef HAVE_MTGET_DSREG1 /* if struct mtget contains mt_dsreg1 (drive status msb) */ X#undef HAVE_MTGET_DSREG2 /* if struct mtget contains mt_dsreg2 (drive status lsb) */ X#undef HAVE_MTGET_GSTAT /* if struct mtget contains mt_gstat (generic status) */ X#undef HAVE_MTGET_ERREG /* if struct mtget contains mt_erreg (error register) */ X#undef HAVE_MTGET_RESID /* if struct mtget contains mt_resid (residual count) */ X#undef HAVE_MTGET_FILENO /* if struct mtget contains mt_fileno (file #) */ X#undef HAVE_MTGET_BLKNO /* if struct mtget contains mt_blkno (block #) */ X#undef HAVE_MTGET_FLAGS /* if struct mtget contains mt_flags (flags) */ X#undef HAVE_MTGET_BF /* if struct mtget contains mt_bf (optimum blocking factor) */ X#undef HAVE_STRUCT_TIMEVAL /* have struct timeval in time.h or sys/time.h */ X#undef HAVE_STRUCT_TIMEZONE /* have struct timezone in time.h or sys/time.h */ X#undef HAVE_STRUCT_TIMESPEC /* have struct timespec in time.h or sys/time.h */ X#undef HAVE_STRUCT_RUSAGE /* have struct rusage in sys/resource.h */ X#undef HAVE_SI_UTIME /* if struct siginfo contains si_utime */ X#undef HAVE_UNION_SEMUN /* have an illegal definition for union semun in sys/sem.h */ X#undef HAVE_UNION_WAIT /* have union wait in wait.h */ X#undef USE_UNION_WAIT /* union wait in wait.h is used by default */ X#undef HAVE_DIRENT_D_INO /* have d_ino in struct dirent */ X#undef HAVE_DIRENT_D_TYPE /* have d_type in struct dirent */ X#undef HAVE_DIR_DD_FD /* have dd_fd in DIR * */ X/* X * SCO UnixWare has st_atim.st__tim.tv_nsec but the st_atim.tv_nsec tests also X * succeeds. If you use st_atim.tv_nsec on UnixWare, you get a warning about X * illegal structure usage. For this reason, your code needs to have X * #ifdef HAVE_ST__TIM before #ifdef HAVE_ST_NSEC. X */ X#undef HAVE_ST_SPARE1 /* if struct stat contains st_spare1 (usecs) */ X#undef HAVE_ST_ATIMENSEC /* if struct stat contains st_atimensec (nanosecs) */ X#undef HAVE_ST_ATIME_N /* if struct stat contains st_atime_n (nanosecs) */ X#undef HAVE_ST_NSEC /* if struct stat contains st_atim.tv_nsec (nanosecs) */ X#undef HAVE_ST__TIM /* if struct stat contains st_atim.st__tim.tv_nsec (nanosecs) */ X#undef HAVE_ST_ATIMESPEC /* if struct stat contains st_atimespec.tv_nsec (nanosecs) */ X#undef HAVE_ST_BLKSIZE /* if struct stat contains st_blksize */ X#undef HAVE_ST_BLOCKS /* if struct stat contains st_blocks */ X#undef HAVE_ST_FSTYPE /* if struct stat contains st_fstype */ X#undef HAVE_ST_ACLCNT /* if struct stat contains st_aclcnt */ X#undef HAVE_ST_RDEV /* if struct stat contains st_rdev */ X#undef HAVE_ST_FLAG /* if struct stat contains st_flag */ X#undef HAVE_ST_FLAGS /* if struct stat contains st_flags */ X#undef STAT_MACROS_BROKEN /* if the macros S_ISDIR, S_ISREG .. don't work */ X X#undef HAVE_UTSNAME_ARCH /* if struct utsname contains processor as arch */ X#undef HAVE_UTSNAME_PROCESSOR /* if struct utsname contains processor */ X#undef HAVE_UTSNAME_SYSNAME_HOST /* if struct utsname contains sysname_host */ X#undef HAVE_UTSNAME_RELEASE_HOST /* if struct utsname contains release_host */ X#undef HAVE_UTSNAME_VERSION_HOST /* if struct utsname contains version_host */ X X#undef DEV_MINOR_BITS /* # if bits needed to hold minor device number */ X#undef DEV_MINOR_NONCONTIG /* if bits in minor device number are noncontiguous */ X X#undef HAVE_SOCKADDR_STORAGE /* if socket.h defines struct sockaddr_storage */ X X X/* X * Byteorder/Bitorder X */ X#define HAVE_C_BIGENDIAN /* Flag that WORDS_BIGENDIAN test was done */ X#undef WORDS_BIGENDIAN /* If using network byte order */ X#define HAVE_C_BITFIELDS /* Flag that BITFIELDS_HTOL test was done */ X#undef BITFIELDS_HTOL /* If high bits come first in structures */ X X/* X * Types/Keywords X */ X#undef SIZEOF_CHAR X#undef SIZEOF_SHORT_INT X#undef SIZEOF_INT X#undef SIZEOF_LONG_INT X#undef SIZEOF_LONG_LONG X#undef SIZEOF___INT64 X#undef SIZEOF_CHAR_P X#undef SIZEOF_UNSIGNED_CHAR X#undef SIZEOF_UNSIGNED_SHORT_INT X#undef SIZEOF_UNSIGNED_INT X#undef SIZEOF_UNSIGNED_LONG_INT X#undef SIZEOF_UNSIGNED_LONG_LONG X#undef SIZEOF_UNSIGNED___INT64 X#undef SIZEOF_UNSIGNED_CHAR_P X#undef SIZEOF_FLOAT X#undef SIZEOF_DOUBLE X#undef SIZEOF_LONG_DOUBLE X X#undef SIZEOF_SIZE_T X#undef SIZEOF_SSIZE_T X#undef SIZEOF_PTRDIFF_T X X#undef SIZEOF_MODE_T X#undef SIZEOF_UID_T X#undef SIZEOF_GID_T X#undef SIZEOF_PID_T X X/* X * If sizeof (mode_t) is < sizeof (int) and used with va_arg(), X * GCC4 will abort the code. So we need to use the promoted size. X */ X#if SIZEOF_MODE_T < SIZEOF_INT X#define PROMOTED_MODE_T int X#else X#define PROMOTED_MODE_T mode_t X#endif X X#undef SIZEOF_DEV_T X#undef SIZEOF_MAJOR_T X#undef SIZEOF_MINOR_T X X#undef SIZEOF_TIME_T X#undef SIZEOF_WCHAR /* sizeof (L'a') */ X#undef SIZEOF_WCHAR_T /* sizeof (wchar_t) */ X X#undef HAVE_LONGLONG /* Compiler defines long long type */ X#undef HAVE___INT64 /* Compiler defines __int64 type */ X#undef HAVE_LONGDOUBLE /* Compiler defines long double type */ X#undef CHAR_IS_UNSIGNED /* Compiler defines char to be unsigned */ X X#undef const /* Define to empty if const doesn't work */ X#undef uid_t /* To be used if uid_t is not present */ X#undef gid_t /* To be used if gid_t is not present */ X#undef size_t /* To be used if size_t is not present */ X#undef ssize_t /* To be used if ssize_t is not present */ X#undef ptrdiff_t /* To be used if ptrdiff_t is not present */ X#undef pid_t /* To be used if pid_t is not present */ X#undef off_t /* To be used if off_t is not present */ X#undef mode_t /* To be used if mode_t is not present */ X#undef time_t /* To be used if time_t is not present */ X#undef caddr_t /* To be used if caddr_t is not present */ X#undef daddr_t /* To be used if daddr_t is not present */ X#undef dev_t /* To be used if dev_t is not present */ X#undef major_t /* To be used if major_t is not present */ X#undef minor_t /* To be used if minor_t is not present */ X#undef ino_t /* To be used if ino_t is not present */ X#undef nlink_t /* To be used if nlink_t is not present */ X#undef blksize_t /* To be used if blksize_t is not present */ X#undef blkcnt_t /* To be used if blkcnt_t is not present */ X X#undef HAVE_TYPE_INTMAX_T /* if defines intmax_t */ X#undef HAVE_TYPE_UINTMAX_T /* if defines uintmax_t */ X X#undef int8_t /* To be used if int8_t is not present */ X#undef int16_t /* To be used if int16_t is not present */ X#undef int32_t /* To be used if int32_t is not present */ X#if defined(HAVE_LONGLONG) || defined(HAVE___INT64) X#undef int64_t /* To be used if int64_t is not present */ X#endif X#undef intmax_t /* To be used if intmax_t is not present */ X#undef uint8_t /* To be used if uint8_t is not present */ X#undef uint16_t /* To be used if uint16_t is not present */ X#undef uint32_t /* To be used if uint32_t is not present */ X#if defined(HAVE_LONGLONG) || defined(HAVE___INT64) X#undef uint64_t /* To be used if uint64_t is not present */ X#endif X#undef uintmax_t /* To be used if uintmax_t is not present */ X X#undef HAVE_TYPE_GREG_T /* if defines greg_t */ X X#undef HAVE_TYPE_RLIM_T /* if defines rlim_t */ X#undef HAVE_TYPE_IDTYPE_T /* if defines idtype_t */ X#undef HAVE_TYPE_SIGINFO_T /* if defines siginfo_t */ X X#undef HAVE_STACK_T /* if defines stack_t */ X#undef HAVE_SIGINFO_T /* if defines siginfo_t */ X X/* X * Important: Next Step needs time.h for clock_t (because of a bug) X */ X#undef clock_t /* To be used if clock_t is not present */ X#undef socklen_t /* To be used if socklen_t is not present */ X X/* X * These types are present on all UNIX systems but should be avoided X * for portability. X * On Apollo/Domain OS we don't have them.... X * X * Better include and use Uchar, Uint & Ulong X */ X#undef u_char /* To be used if u_char is not present */ X#undef u_short /* To be used if u_short is not present */ X#undef u_int /* To be used if u_int is not present */ X#undef u_long /* To be used if u_long is not present */ X X#undef wctype_t /* To be used if wctype_t is not in wchar.h */ X#undef wint_t /* To be used if wint_t is not in wchar.h */ X#undef mbstate_t /* To be used if mbstate_t is not in wchar.h */ X X#undef timestruc_t /* To be used if timestruc_t is not in sys/stat.h */ X X/*#undef HAVE_SIZE_T*/ X/*#undef NO_SIZE_T*/ X#undef VA_LIST_IS_ARRAY /* va_list is an array */ X#undef GETGROUPS_T X#define GID_T GETGROUPS_T X X/* X * Define as the return type of signal handlers (int or void). X */ X#undef RETSIGTYPE X X/* X * Defined in case that we have iconv(iconv_t, const char **, site_t *, ...) X */ X#undef HAVE_ICONV_CONST X X/* X * Defines needed to get large file support. X */ X#ifdef USE_LARGEFILES X X#undef HAVE_LARGEFILES X X#ifdef HAVE_LARGEFILES /* If we have working largefiles at all */ X /* This is not defined with glibc-2.1.3 */ X X#undef _FILE_OFFSET_BITS /* # of bits in off_t if settable */ X#undef _LARGEFILE_SOURCE /* To make ftello() visible (HP-UX 10.20). */ X#undef _LARGE_FILES /* Large file defined on AIX-style hosts. */ X#undef _XOPEN_SOURCE /* To make ftello() visible (glibc 2.1.3). */ X /* XXX We don't use this because glibc2.1.3*/ X /* XXX is bad anyway. If we define */ X /* XXX _XOPEN_SOURCE we will loose caddr_t */ X X#undef HAVE_FSEEKO /* Do we need this? If HAVE_LARGEFILES is */ X /* defined, we have fseeko() */ X X#endif /* HAVE_LARGEFILES */ X#endif /* USE_LARGEFILES */ X X#ifdef USE_ACL /* Enable/disable ACL support */ X/* X * The withdrawn POSIX.1e ACL draft support. X * It has been written in 1993 and withdrawn in 1997. X * Linux started to implement it in 2001. X */ X#undef HAVE_ACL_GET_FILE /* acl_get_file() function */ X#undef HAVE_ACL_SET_FILE /* acl_set_file() function */ X#undef HAVE_ACL_GET_ENTRY /* acl_get_entry() function */ X#undef HAVE_ACL_FROM_TEXT /* acl_from_text() function */ X#undef HAVE_ACL_TO_TEXT /* acl_to_text() function */ X#undef HAVE_ACL_TO_TEXT_NP /* acl_to_text_np() function */ X#undef HAVE_ACL_GET_BRAND_NP /* acl_get_brand_np() function */ X#undef HAVE_ACL_IS_TRIVIAL_NP /* acl_is_trivial_np() function */ X#undef HAVE_ACL_STRIP_NP /* acl_strip_np() function */ X#undef HAVE_ACL_FREE /* acl_free() function */ X#undef HAVE_ACL_DELETE_DEF_FILE /* acl_delete_def_file() function */ X#undef HAVE_ACL_EXTENDED_FILE /* acl_extended_file() function (Linux only)*/ X X#if defined(HAVE_ACL_GET_FILE) && defined(HAVE_ACL_SET_FILE) && \ X defined(HAVE_ACL_FROM_TEXT) && defined(HAVE_ACL_TO_TEXT) && \ X defined(HAVE_ACL_FREE) X# define HAVE_POSIX_ACL 1 /* Withdrawn POSIX draft ACL's present */ X#endif X X/* X * Sun UFS ACL support. X * Note: unfortunately, HP-UX has an (undocumented) acl() function in libc. X */ X#undef HAVE_ACL /* acl() function */ X#undef HAVE_FACL /* facl() function */ X#undef HAVE_ACLFROMTEXT /* aclfromtext() function */ X#undef HAVE_ACLTOTEXT /* acltotext() function */ X X/* X * NFSv4 ACL support. X * Note: There is an unfortunate name clash for acl_free() with the X * withdrawn POSIX.1e draft. We correct this below. X */ X#undef HAVE_ACL_GET /* acl_get() function */ X#undef HAVE_ACL_SET /* acl_set() function */ X#undef HAVE_FACL_GET /* facl_get() function */ X#undef HAVE_FACL_SET /* facl_set() function */ X#undef HAVE_ACL_FROMTEXT /* acl_fromtext() function */ X#undef HAVE_ACL_TOTEXT /* acl_totext() function */ X X#if !defined(HAVE_POSIX_ACL) X/* X * Cygwin used to implement the Sun UFS ACL interface but in 2016 X * moved towards the withdrawn POSIX draft. X * Make sure that we do not #define HAVE_POSIX_ACL and HAVE_SUN_ACL X * at the same time. X */ X#if defined(HAVE_ACL) && defined(HAVE_FACL) && \ X defined(HAVE_ACLFROMTEXT) && defined(HAVE_ACLTOTEXT) X# define HAVE_SUN_ACL 1 /* Sun UFS ACL's present */ X#endif X#endif /* !defined(HAVE_POSIX_ACL) */ X X#if defined(HAVE_ACL_GET) && defined(HAVE_ACL_SET) && \ X defined(HAVE_FACL_GET) && defined(HAVE_FACL_SET) && \ X defined(HAVE_ACL_FROMTEXT) && defined(HAVE_ACL_TOTEXT) X# define HAVE_ACL_FREE 1 /* acl_fre() function */ X# define HAVE_NFSV4_ACL 1 /* NFSv4 ACL's present */ X#endif X X#if defined(HAVE_ACL_GET_BRAND_NP) X#ifndef HAVE_NFSV4_ACL X# define HAVE_NFSV4_ACL 1 /* NFSv4 ACL's present */ X#endif X# define HAVE_FREEBSD_NFSV4_ACL 1 /* FreeBSD NFSv4 ACL implementation */ X#endif X X/* X * HP-UX ACL support. X * Note: unfortunately, HP-UX has an (undocumented) acl() function in libc. X */ X#undef HAVE_GETACL /* getacl() function */ X#undef HAVE_FGETACL /* fgetacl() function */ X#undef HAVE_SETACL /* setacl() function */ X#undef HAVE_FSETACL /* fsetacl() function */ X#undef HAVE_STRTOACL /* strtoacl() function */ X#undef HAVE_ACLTOSTR /* acltostr() function */ X#undef HAVE_CPACL /* cpacl() function */ X#undef HAVE_FCPACL /* fcpacl() function */ X#undef HAVE_CHOWNACL /* chownacl() function */ X#undef HAVE_SETACLENTRY /* setaclentry() function */ X#undef HAVE_FSETACLENTRY /* fsetaclentry() function */ X X#if defined(HAVE_GETACL) && defined(HAVE_FGETACL) && \ X defined(HAVE_SETACL) && defined(HAVE_FSETACL) && \ X defined(HAVE_STRTOACL) && defined(HAVE_ACLTOTEXT) X# define HAVE_HP_ACL 1 /* HP-UX ACL's present */ X#endif X X/* X * Global definition whether ACL support is present. X * As HP-UX differs too much from other implementations, HAVE_HP_ACL is not X * included in HAVE_ANY_ACL. X */ X#if defined(HAVE_POSIX_ACL) || defined(HAVE_SUN_ACL) || defined(HAVE_NFSV4_ACL) X# define HAVE_ANY_ACL 1 /* Any ACL implementation present */ X#endif X X#endif /* USE_ACL */ X X/* X * Misc CC / LD related stuff X */ X#undef NO_USER_MALLOC /* If we cannot define our own malloc() */ X#undef NO_USER_XCVT /* If we cannot define our own ecvt()/fcvt()/gcvt() */ X#undef HAVE_DYN_ARRAYS /* If the compiler allows dynamic sized arrays */ X#undef HAVE_PRAGMA_WEAK /* If the compiler allows #pragma weak */ X#undef HAVE_LINK_WEAK /* If the linker sees weak entries in other files */ X#undef HAVE_STRINGIZE /* If the cpp supports ANSI C stringize */ X#undef inline X X/* X * Strings that help to maintain OS/platform id's in C-programs X */ X#undef HOST_ALIAS /* Output from config.guess (orig) */ X#undef HOST_SUB /* Output from config.sub (modified) */ X#undef HOST_CPU /* CPU part from HOST_SUB */ X#undef HOST_VENDOR /* VENDOR part from HOST_SUB */ X#undef HOST_OS /* CPU part from HOST_SUB */ X X X/* X * Begin restricted code for quality assurance. X * X * Warning: you are not allowed to include the #define below if you are not X * using the Schily makefile system or if you modified the autoconfiguration X * tests. X * X * If you only added other tests you are allowed to keep this #define. X * X * This restiction is introduced because this way, I hope that people X * contribute to the project instead of creating branches. X */ X#define IS_SCHILY_XCONFIG X/* X * End restricted code for quality assurance. X */ X X#endif /* __XCONFIG_H */ END-of-star-1.6/autoconf/xconfig.h.in echo x - star-1.6/autoconf/configure sed 's/^X//' >star-1.6/autoconf/configure << 'END-of-star-1.6/autoconf/configure' X#! /bin/sh X X# From configure.in 1.294 X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X#serial 18 X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X# Guess values for system-dependent variables and create Makefiles. X# Generated automatically using autoconf version 2.13 1.17-Schily X# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. X# Copyright (C) 1998-2016 J. Schilling X# X# This configure script is free software; the Free Software Foundation X# gives unlimited permission to copy, distribute and modify it. X X# Defaults: Xac_help= Xac_default_prefix=/usr/local X# Any additions from configure.in: Xac_help="$ac_help X --disable-largefile omit support for large files" X X# Initialize some variables set by options. X# The variables have the same names as the options, with X# dashes changed to underlines. Xbuild=NONE Xcache_file=./config.cache Xexec_prefix=NONE Xhost=NONE Xno_create= Xnonopt=NONE Xno_recursion= Xprefix=NONE Xprogram_prefix=NONE Xprogram_suffix=NONE Xprogram_transform_name=s,x,x, Xsilent= Xsite= Xsrcdir= Xtarget=NONE Xverbose= Xrmttest=test Xrmtcall= XCONFIG_RMTCALL=${CONFIG_RMTCALL-NONE} Xx_includes=NONE Xx_libraries=NONE Xbindir='${exec_prefix}/bin' Xsbindir='${exec_prefix}/sbin' Xlibexecdir='${exec_prefix}/libexec' Xdatadir='${prefix}/share' Xsysconfdir='${prefix}/etc' Xsharedstatedir='${prefix}/com' Xlocalstatedir='${prefix}/var' Xlibdir='${exec_prefix}/lib' Xincludedir='${prefix}/include' Xoldincludedir='/usr/include' Xinfodir='${prefix}/info' Xmandir='${prefix}/man' X X# Initialize some other variables. Xsubdirs= XMFLAGS= MAKEFLAGS= XSHELL=${CONFIG_SHELL-/bin/sh} X# Maximum number of lines to put in a shell here document. Xac_max_here_lines=12 X Xac_prev= Xfor ac_option Xdo X X # If the previous option needs an argument, assign it. X if test -n "$ac_prev"; then X eval "$ac_prev=\$ac_option" X ac_prev= X continue X fi X X case "$ac_option" in X -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; X *) ac_optarg= ;; X esac X X # Accept the important Cygnus configure options, so we can diagnose typos. X X case "$ac_option" in X X -bindir | --bindir | --bindi | --bind | --bin | --bi) X ac_prev=bindir ;; X -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) X bindir="$ac_optarg" ;; X X -build | --build | --buil | --bui | --bu) X ac_prev=build ;; X -build=* | --build=* | --buil=* | --bui=* | --bu=*) X build="$ac_optarg" ;; X X -cache-file | --cache-file | --cache-fil | --cache-fi \ X | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) X ac_prev=cache_file ;; X -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ X | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) X cache_file="$ac_optarg" ;; X X -cc=* | --cc=* ) X CC="$ac_optarg" ; echo using $CC as compiler ;; X X -datadir | --datadir | --datadi | --datad | --data | --dat | --da) X ac_prev=datadir ;; X -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ X | --da=*) X datadir="$ac_optarg" ;; X X -disable-* | --disable-*) X ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` X # Reject names that are not valid shell variable names. X if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then X { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } X fi X ac_feature=`echo $ac_feature| sed 's/-/_/g'` X eval "enable_${ac_feature}=no" ;; X X -enable-* | --enable-*) X ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` X # Reject names that are not valid shell variable names. X if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then X { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } X fi X ac_feature=`echo $ac_feature| sed 's/-/_/g'` X case "$ac_option" in X *=*) ;; X *) ac_optarg=yes ;; X esac X eval "enable_${ac_feature}='$ac_optarg'" ;; X X -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ X | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ X | --exec | --exe | --ex) X ac_prev=exec_prefix ;; X -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ X | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ X | --exec=* | --exe=* | --ex=*) X exec_prefix="$ac_optarg" ;; X X -gas | --gas | --ga | --g) X # Obsolete; use --with-gas. X with_gas=yes ;; X X -help | --help | --hel | --he) X # Omit some internal or obsolete options to make the list less imposing. X # This message is too long to be a string in the A/UX 3.1 sh. X cat << EOF XUsage: configure [options] [host] XOptions: [defaults in brackets after descriptions] XConfiguration: X --cache-file=FILE cache test results in FILE X --help print this message X --no-create do not create output files X --quiet, --silent do not print \`checking...' messages X --version print the version of autoconf that created configure XDirectory and file names: X --prefix=PREFIX install architecture-independent files in PREFIX X [$ac_default_prefix] X --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX X [same as prefix] X --bindir=DIR user executables in DIR [EPREFIX/bin] X --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] X --libexecdir=DIR program executables in DIR [EPREFIX/libexec] X --datadir=DIR read-only architecture-independent data in DIR X [PREFIX/share] X --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] X --sharedstatedir=DIR modifiable architecture-independent data in DIR X [PREFIX/com] X --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] X --libdir=DIR object code libraries in DIR [EPREFIX/lib] X --includedir=DIR C header files in DIR [PREFIX/include] X --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] X --infodir=DIR info documentation in DIR [PREFIX/info] X --mandir=DIR man documentation in DIR [PREFIX/man] X --srcdir=DIR find the sources in DIR [configure dir or ..] X --program-prefix=PREFIX prepend PREFIX to installed program names X --program-suffix=SUFFIX append SUFFIX to installed program names X --program-transform-name=PROGRAM X run sed PROGRAM on installed program names XEOF X cat << EOF XHost type: X --build=BUILD configure for building on BUILD [BUILD=HOST] X --host=HOST configure for HOST [guessed] X --target=TARGET configure for TARGET [TARGET=HOST] XFeatures and packages: X --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) X --enable-FEATURE[=ARG] include FEATURE [ARG=yes] X --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] X --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) X --x-includes=DIR X include files are in DIR X --x-libraries=DIR X library files are in DIR XEOF X if test -n "$ac_help"; then X echo "--enable and --with options recognized:$ac_help" X fi X exit 0 ;; X X -host | --host | --hos | --ho) X ac_prev=host ;; X -host=* | --host=* | --hos=* | --ho=*) X host="$ac_optarg" ;; X X -includedir | --includedir | --includedi | --included | --include \ X | --includ | --inclu | --incl | --inc) X ac_prev=includedir ;; X -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ X | --includ=* | --inclu=* | --incl=* | --inc=*) X includedir="$ac_optarg" ;; X X -infodir | --infodir | --infodi | --infod | --info | --inf) X ac_prev=infodir ;; X -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) X infodir="$ac_optarg" ;; X X -libdir | --libdir | --libdi | --libd) X ac_prev=libdir ;; X -libdir=* | --libdir=* | --libdi=* | --libd=*) X libdir="$ac_optarg" ;; X X -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ X | --libexe | --libex | --libe) X ac_prev=libexecdir ;; X -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ X | --libexe=* | --libex=* | --libe=*) X libexecdir="$ac_optarg" ;; X X -localstatedir | --localstatedir | --localstatedi | --localstated \ X | --localstate | --localstat | --localsta | --localst \ X | --locals | --local | --loca | --loc | --lo) X ac_prev=localstatedir ;; X -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ X | --localstate=* | --localstat=* | --localsta=* | --localst=* \ X | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) X localstatedir="$ac_optarg" ;; X X -mandir | --mandir | --mandi | --mand | --man | --ma | --m) X ac_prev=mandir ;; X -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) X mandir="$ac_optarg" ;; X X -nfp | --nfp | --nf) X # Obsolete; use --without-fp. X with_fp=no ;; X X -no-create | --no-create | --no-creat | --no-crea | --no-cre \ X | --no-cr | --no-c) X no_create=yes ;; X X -no-recursion | --no-recursion | --no-recursio | --no-recursi \ X | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) X no_recursion=yes ;; X X -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ X | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ X | --oldin | --oldi | --old | --ol | --o) X ac_prev=oldincludedir ;; X -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ X | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ X | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) X oldincludedir="$ac_optarg" ;; X X -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) X ac_prev=prefix ;; X -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) X prefix="$ac_optarg" ;; X X -program-prefix | --program-prefix | --program-prefi | --program-pref \ X | --program-pre | --program-pr | --program-p) X ac_prev=program_prefix ;; X -program-prefix=* | --program-prefix=* | --program-prefi=* \ X | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) X program_prefix="$ac_optarg" ;; X X -program-suffix | --program-suffix | --program-suffi | --program-suff \ X | --program-suf | --program-su | --program-s) X ac_prev=program_suffix ;; X -program-suffix=* | --program-suffix=* | --program-suffi=* \ X | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) X program_suffix="$ac_optarg" ;; X X -program-transform-name | --program-transform-name \ X | --program-transform-nam | --program-transform-na \ X | --program-transform-n | --program-transform- \ X | --program-transform | --program-transfor \ X | --program-transfo | --program-transf \ X | --program-trans | --program-tran \ X | --progr-tra | --program-tr | --program-t) X ac_prev=program_transform_name ;; X -program-transform-name=* | --program-transform-name=* \ X | --program-transform-nam=* | --program-transform-na=* \ X | --program-transform-n=* | --program-transform-=* \ X | --program-transform=* | --program-transfor=* \ X | --program-transfo=* | --program-transf=* \ X | --program-trans=* | --program-tran=* \ X | --progr-tra=* | --program-tr=* | --program-t=*) X program_transform_name="$ac_optarg" ;; X X -q | -quiet | --quiet | --quie | --qui | --qu | --q \ X | -silent | --silent | --silen | --sile | --sil) X silent=yes ;; X X -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) X ac_prev=sbindir ;; X -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ X | --sbi=* | --sb=*) X sbindir="$ac_optarg" ;; X X -sharedstatedir | --sharedstatedir | --sharedstatedi \ X | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ X | --sharedst | --shareds | --shared | --share | --shar \ X | --sha | --sh) X ac_prev=sharedstatedir ;; X -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ X | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ X | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ X | --sha=* | --sh=*) X sharedstatedir="$ac_optarg" ;; X X -site | --site | --sit) X ac_prev=site ;; X -site=* | --site=* | --sit=*) X site="$ac_optarg" ;; X X -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) X ac_prev=srcdir ;; X -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) X srcdir="$ac_optarg" ;; X X -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ X | --syscon | --sysco | --sysc | --sys | --sy) X ac_prev=sysconfdir ;; X -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ X | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) X sysconfdir="$ac_optarg" ;; X X -target | --target | --targe | --targ | --tar | --ta | --t) X ac_prev=target ;; X -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) X target="$ac_optarg" ;; X X -v | -verbose | --verbose | --verbos | --verbo | --verb) X verbose=yes ;; X X -version | --version | --versio | --versi | --vers) X echo "configure generated by autoconf version 2.13 1.17-Schily" X exit 0 ;; X X -with-* | --with-*) X ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` X # Reject names that are not valid shell variable names. X if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then X { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } X fi X ac_package=`echo $ac_package| sed 's/-/_/g'` X case "$ac_option" in X *=*) ;; X *) ac_optarg=yes ;; X esac X eval "with_${ac_package}='$ac_optarg'" ;; X X -without-* | --without-*) X ac_package=`echo $ac_option|sed -e 's/-*without-//'` X # Reject names that are not valid shell variable names. X if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then X { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } X fi X ac_package=`echo $ac_package| sed 's/-/_/g'` X eval "with_${ac_package}=no" ;; X X --x) X # Obsolete; use --with-x. X with_x=yes ;; X X -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ X | --x-incl | --x-inc | --x-in | --x-i) X ac_prev=x_includes ;; X -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ X | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) X x_includes="$ac_optarg" ;; X X -x-libraries | --x-libraries | --x-librarie | --x-librari \ X | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) X ac_prev=x_libraries ;; X -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ X | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) X x_libraries="$ac_optarg" ;; X X -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } X ;; X X *) X if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then X echo "configure: warning: $ac_option: invalid host type" 1>&2 X fi X if test "x$nonopt" != xNONE; then X { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } X fi X nonopt="$ac_option" X ;; X X esac Xdone X Xif test -n "$ac_prev"; then X { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } Xfi X Xtrap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 X X# File descriptor usage: X# 0 standard input X# 1 file creation X# 2 errors and warnings X# 3 some systems may open it to /dev/tty X# 4 used on the Kubota Titan X# 6 checking for... messages and results X# 5 compiler messages saved in config.log Xif test "$silent" = yes; then X exec 6>/dev/null Xelse X exec 6>&1 Xfi Xexec 5>./config.log X Xecho "\ XThis file contains any messages produced by compilers while Xrunning configure, to aid debugging if configure makes a mistake. X" 1>&5 X X# Strip out --no-create and --no-recursion so they do not pile up. X# Also quote any args containing shell metacharacters. Xac_configure_args= Xfor ac_arg Xdo X case "$ac_arg" in X -no-create | --no-create | --no-creat | --no-crea | --no-cre \ X | --no-cr | --no-c) ;; X -no-recursion | --no-recursion | --no-recursio | --no-recursi \ X | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; X *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) X ac_configure_args="$ac_configure_args '$ac_arg'" ;; X *) ac_configure_args="$ac_configure_args $ac_arg" ;; X esac Xdone X X# NLS nuisances. X# Only set these to C if already set. These must not be set unconditionally X# because not all systems understand e.g. LANG=C (notably SCO). X# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! X# Non-C LC_CTYPE values break the ctype check. Xif test "${LANG+set}" = set; then LANG=C; export LANG; fi Xif test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi Xif test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi Xif test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi X X# confdefs.h avoids OS command line length limits that DEFS can exceed. Xrm -rf conftest* confdefs.h X# AIX cpp loses on an empty file, so make sure it contains at least a newline. Xecho > confdefs.h X X# A filename unique to this package, relative to the directory that X# configure is in, which we can look for to find out if srcdir is correct. Xac_unique_file=config.guess X X# Find the source files, if location was not specified. Xif test -z "$srcdir"; then X ac_srcdir_defaulted=yes X # Try the directory containing this script, then its parent. X ac_prog=$0 X ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` X test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. X srcdir=$ac_confdir X if test ! -r $srcdir/$ac_unique_file; then X srcdir=.. X fi Xelse X ac_srcdir_defaulted=no Xfi Xif test ! -r $srcdir/$ac_unique_file; then X if test "$ac_srcdir_defaulted" = yes; then X { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } X else X { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } X fi Xfi Xsrcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` X X# Prefer explicitly selected file to automatically selected ones. Xif test -z "$CONFIG_SITE"; then X if test "x$prefix" != xNONE; then X CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" X else X CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" X fi Xfi Xfor ac_site_file in $CONFIG_SITE; do X if test -r "$ac_site_file"; then X echo "loading site script $ac_site_file" X . "$ac_site_file" X fi Xdone X Xif test -r "$cache_file"; then X echo "loading cache $cache_file" X . $cache_file Xelse X echo "creating cache $cache_file" X > $cache_file Xfi X Xac_ext=c X# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. Xac_cpp='$CPP $CPPFLAGS' Xac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' Xac_compile2='${CC-cc} -c $CFLAGS $CPPFLAGS conftest2.$ac_ext 1>&5' Xac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS conftest.$ac_ext $LDFLAGS $LIBS 1>&5' Xcross_compiling=$ac_cv_prog_cc_cross Xif test "$cross_compiling" = yes -a "$CONFIG_RMTCALL" != NONE ; then X cross_compiling=remote X rmtcall="$CONFIG_RMTCALL" X rmttest="$CONFIG_RMTCALL" Xfi X Xac_exeext= Xac_xexeext= Xac_objext=o Xif (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then X # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. X if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then X ac_n= ac_c=' X' ac_t=' ' X else X ac_n=-n ac_c= ac_t= X fi Xelse X ac_n= ac_c='\c' ac_t= Xfi X X X Xac_aux_dir= Xfor ac_dir in $srcdir $srcdir/.. $srcdir/../..; do X if test -f $ac_dir/install-sh; then X ac_aux_dir=$ac_dir X ac_install_sh="$ac_aux_dir/install-sh -c" X break X elif test -f $ac_dir/install.sh; then X ac_aux_dir=$ac_dir X ac_install_sh="$ac_aux_dir/install.sh -c" X break X fi Xdone Xif test -z "$ac_aux_dir"; then X { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } Xfi Xac_config_guess=$ac_aux_dir/config.guess Xac_config_sub=$ac_aux_dir/config.sub Xac_configure=$ac_aux_dir/configure # This should be Cygnus configure. X X X# Make sure we can run config.sub. Xif ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : Xelse { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } Xfi X Xecho $ac_n "checking host system type""... $ac_c" 1>&6 Xecho "configure:892: checking host system type" >&5 X Xhost_alias=$host Xcase "$host_alias" in XNONE) X case $nonopt in X NONE) X if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : X else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } X fi ;; X *) host_alias=$nonopt ;; X esac ;; Xesac X Xhost=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` Xhost_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` Xhost_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` Xhost_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` Xeval echo "$ac_t""$host" 1>&6 X X Xecho $ac_n "checking if sh is bash""... $ac_c" 1>&6 Xecho "configure:914: checking if sh is bash" >&5 Xif eval "test \"`echo '$''{'ac_cv_shell_is_bash'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X Xac_err=`< /dev/null sh --version 2> /dev/null | egrep 'GNU sh|bash'` Xif test -n "$ac_err"; then X ac_cv_shell_is_bash=yes Xelse X ac_cv_shell_is_bash=no Xfi X Xfi X Xeval echo "$ac_t""$ac_cv_shell_is_bash" 1>&6 Xif test $ac_cv_shell_is_bash = yes; then X cat >> confdefs.h <<\EOF X#define SHELL_IS_BASH 1 XEOF X Xfi Xecho $ac_n "checking if /bin/sh is bash""... $ac_c" 1>&6 Xecho "configure:936: checking if /bin/sh is bash" >&5 Xif eval "test \"`echo '$''{'ac_cv_bin_shell_is_bash'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X Xac_err=`< /dev/null /bin/sh --version 2> /dev/null | egrep 'GNU sh|bash'` Xif test -n "$ac_err"; then X ac_cv_bin_shell_is_bash=yes Xelse X ac_cv_bin_shell_is_bash=no Xfi X Xfi X Xeval echo "$ac_t""$ac_cv_bin_shell_is_bash" 1>&6 Xif test $ac_cv_bin_shell_is_bash = yes; then X cat >> confdefs.h <<\EOF X#define BIN_SHELL_IS_BASH 1 XEOF X Xfi Xecho $ac_n "checking whether sh -ce is broken""... $ac_c" 1>&6 Xecho "configure:958: checking whether sh -ce is broken" >&5 Xif eval "test \"`echo '$''{'ac_cv_shell_ce_is_broken'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X Xac_err=`sh -ce 'for i in 1 2 3; do ( echo $i; if test -d . ; then (false; echo 4); fi ) ; done' | grep 2` Xif test -n "$ac_err"; then X ac_cv_shell_ce_is_broken=yes Xelse X ac_cv_shell_ce_is_broken=no Xfi X Xfi X Xeval echo "$ac_t""$ac_cv_shell_ce_is_broken" 1>&6 Xif test $ac_cv_shell_ce_is_broken = yes; then X cat >> confdefs.h <<\EOF X#define SHELL_CE_IS_BROKEN 1 XEOF X Xfi Xecho $ac_n "checking whether /bin/sh -ce is broken""... $ac_c" 1>&6 Xecho "configure:980: checking whether /bin/sh -ce is broken" >&5 Xif eval "test \"`echo '$''{'ac_cv_bin_shell_ce_is_broken'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X Xac_err=`/bin/sh -ce 'for i in 1 2 3; do ( echo $i; if test -d . ; then (false; echo 4); fi ) ; done' | grep 2` Xif test -n "$ac_err"; then X ac_cv_bin_shell_ce_is_broken=yes Xelse X ac_cv_bin_shell_ce_is_broken=no Xfi X Xfi X Xeval echo "$ac_t""$ac_cv_bin_shell_ce_is_broken" 1>&6 Xif test $ac_cv_bin_shell_ce_is_broken = yes; then X cat >> confdefs.h <<\EOF X#define BIN_SHELL_CE_IS_BROKEN 1 XEOF X Xfi Xecho $ac_n "checking whether /bin/bosh is a working shell""... $ac_c" 1>&6 Xecho "configure:1002: checking whether /bin/bosh is a working shell" >&5 Xif eval "test \"`echo '$''{'ac_cv_bin_shell_bosh'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X Xac_err=`< /dev/null /bin/bosh -c 'echo abc' 2> /dev/null | grep abc` Xif test "$ac_err" != "abc"; then X ac_cv_bin_shell_bosh=no Xelse X ac_err=`/bin/bosh -ce 'for i in 1 2 3; do ( echo $i; if test -d . ; then (false; echo 4); fi ) ; done' | grep 2` X if test -z "$ac_err"; then X ac_cv_bin_shell_bosh=yes X else X ac_cv_bin_shell_bosh=no X fi Xfi X Xfi X Xeval echo "$ac_t""$ac_cv_bin_shell_bosh" 1>&6 Xif test $ac_cv_bin_shell_bosh = yes; then X cat >> confdefs.h <<\EOF X#define BIN_SHELL_BOSH 1 XEOF X Xfi Xecho $ac_n "checking whether /opt/schily/bin/bosh is a working shell""... $ac_c" 1>&6 Xecho "configure:1029: checking whether /opt/schily/bin/bosh is a working shell" >&5 Xif eval "test \"`echo '$''{'ac_cv_opt_schily_bin_shell_bosh'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X Xac_err=`< /dev/null /opt/schily/bin/bosh -c 'echo abc' 2> /dev/null | grep abc` Xif test "$ac_err" != "abc"; then X ac_cv_opt_schily_bin_shell_bosh=no Xelse X ac_err=`/opt/schily/bin/bosh -ce 'for i in 1 2 3; do ( echo $i; if test -d . ; then (false; echo 4); fi ) ; done' | grep 2` X if test -z "$ac_err"; then X ac_cv_opt_schily_bin_shell_bosh=yes X else X ac_cv_opt_schily_bin_shell_bosh=no X fi Xfi X Xfi X Xeval echo "$ac_t""$ac_cv_opt_schily_bin_shell_bosh" 1>&6 Xif test $ac_cv_opt_schily_bin_shell_bosh = yes; then X cat >> confdefs.h <<\EOF X#define OPT_SCHILY_BIN_SHELL_BOSH 1 XEOF X Xfi X# Extract the first word of "cc", so it can be a program name with args. Xset dummy cc; ac_word=$2 Xecho $ac_n "checking for $ac_word""... $ac_c" 1>&6 Xecho "configure:1058: checking for $ac_word" >&5 Xif eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test -n "$CC"; then X ac_cv_prog_CC="$CC" # Let the user override the test. Xelse X IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" X ac_dummy="$PATH" X for ac_dir in $ac_dummy; do X test -z "$ac_dir" && ac_dir=. X if test -f $ac_dir/$ac_word; then X ac_cv_prog_CC="cc" X break X fi X done X IFS="$ac_save_ifs" X test -z "$ac_cv_prog_CC" && ac_cv_prog_CC="gcc" Xfi Xfi XCC="$ac_cv_prog_CC" Xif test -n "$CC"; then X eval echo "$ac_t""$CC" 1>&6 Xelse X eval echo "$ac_t""no" 1>&6 Xfi X # Extract the first word of "gcc", so it can be a program name with args. Xset dummy gcc; ac_word=$2 Xecho $ac_n "checking for $ac_word""... $ac_c" 1>&6 Xecho "configure:1087: checking for $ac_word" >&5 Xif eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test -n "$CC"; then X ac_cv_prog_CC="$CC" # Let the user override the test. Xelse X IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" X ac_dummy="$PATH" X for ac_dir in $ac_dummy; do X test -z "$ac_dir" && ac_dir=. X if test -f $ac_dir/$ac_word; then X ac_cv_prog_CC="gcc" X break X fi X done X IFS="$ac_save_ifs" Xfi Xfi XCC="$ac_cv_prog_CC" Xif test -n "$CC"; then X eval echo "$ac_t""$CC" 1>&6 Xelse X eval echo "$ac_t""no" 1>&6 Xfi X Xif test -z "$CC"; then X # Extract the first word of "cc", so it can be a program name with args. Xset dummy cc; ac_word=$2 Xecho $ac_n "checking for $ac_word""... $ac_c" 1>&6 Xecho "configure:1117: checking for $ac_word" >&5 Xif eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test -n "$CC"; then X ac_cv_prog_CC="$CC" # Let the user override the test. Xelse X IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" X ac_prog_rejected=no X ac_dummy="$PATH" X for ac_dir in $ac_dummy; do X test -z "$ac_dir" && ac_dir=. X if test -f $ac_dir/$ac_word; then X if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then X ac_prog_rejected=yes X continue X fi X ac_cv_prog_CC="cc" X break X fi X done X IFS="$ac_save_ifs" Xif test $ac_prog_rejected = yes; then X # We found a bogon in the path, so make sure we never use it. X set dummy $ac_cv_prog_CC X shift X if test $# -gt 0; then X # We chose a different compiler from the bogus one. X # However, it has the same basename, so the bogon will be chosen X # first if we set CC to just the basename; use the full file name. X shift X set dummy "$ac_dir/$ac_word" "$@" X shift X ac_cv_prog_CC="$@" X fi Xfi Xfi Xfi XCC="$ac_cv_prog_CC" Xif test -n "$CC"; then X eval echo "$ac_t""$CC" 1>&6 Xelse X eval echo "$ac_t""no" 1>&6 Xfi X X if test -z "$CC"; then X case "`uname -s`" in X *win32* | *WIN32*) X # Extract the first word of "cl", so it can be a program name with args. Xset dummy cl; ac_word=$2 Xecho $ac_n "checking for $ac_word""... $ac_c" 1>&6 Xecho "configure:1168: checking for $ac_word" >&5 Xif eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test -n "$CC"; then X ac_cv_prog_CC="$CC" # Let the user override the test. Xelse X IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" X ac_dummy="$PATH" X for ac_dir in $ac_dummy; do X test -z "$ac_dir" && ac_dir=. X if test -f $ac_dir/$ac_word; then X ac_cv_prog_CC="cl" X break X fi X done X IFS="$ac_save_ifs" Xfi Xfi XCC="$ac_cv_prog_CC" Xif test -n "$CC"; then X eval echo "$ac_t""$CC" 1>&6 Xelse X eval echo "$ac_t""no" 1>&6 Xfi X ;; X esac X fi X test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } Xfi X Xecho $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 Xecho "configure:1200: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 X Xac_ext=c X# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. Xac_cpp='$CPP $CPPFLAGS' Xac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' Xac_compile2='${CC-cc} -c $CFLAGS $CPPFLAGS conftest2.$ac_ext 1>&5' Xac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS conftest.$ac_ext $LDFLAGS $LIBS 1>&5' Xcross_compiling=$ac_cv_prog_cc_cross Xif test "$cross_compiling" = yes -a "$CONFIG_RMTCALL" != NONE ; then X cross_compiling=remote X rmtcall="$CONFIG_RMTCALL" X rmttest="$CONFIG_RMTCALL" Xfi X Xcat > conftest.$ac_ext << EOF X X#line 1217 "configure" X#include "confdefs.h" X Xmain(){return(0);} XEOF Xif { eval echo configure:1222: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X ac_cv_prog_cc_works=yes X # If we can't run a trivial program, we are probably using a cross compiler. X if (./conftest${ac_xexeext}; exit) 2>/dev/null; then X ac_cv_prog_cc_cross=no X else X ac_cv_prog_cc_cross=yes X fi Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X ac_cv_prog_cc_works=no Xfi Xrm -fr conftest* Xac_ext=c X# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. Xac_cpp='$CPP $CPPFLAGS' Xac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' Xac_compile2='${CC-cc} -c $CFLAGS $CPPFLAGS conftest2.$ac_ext 1>&5' Xac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS conftest.$ac_ext $LDFLAGS $LIBS 1>&5' Xcross_compiling=$ac_cv_prog_cc_cross Xif test "$cross_compiling" = yes -a "$CONFIG_RMTCALL" != NONE ; then X cross_compiling=remote X rmtcall="$CONFIG_RMTCALL" X rmttest="$CONFIG_RMTCALL" Xfi X Xeval echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 Xif test $ac_cv_prog_cc_works = no; then X ccout=`eval "${CC-cc} 2>&1" 2> /dev/null` X ret=$? X nf=`echo "$ccout" | grep 'not found'` X if test $ret = 127 -a -n "$nf" ; then # Korn Shell X ccout="" X fi X if test "$ret" -ne 0 -a ! -n "$ccout" ; then X { echo "configure: error: installation or configuration problem: C compiler ${CC-cc} not found." 1>&2; exit 1; } X fi X { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } Xfi Xecho $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 Xecho "configure:1263: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 Xeval echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 Xcross_compiling=$ac_cv_prog_cc_cross Xif test "$cross_compiling" = yes -a "$CONFIG_RMTCALL" != NONE ; then X cross_compiling=remote X rmtcall="$CONFIG_RMTCALL" X rmttest="$CONFIG_RMTCALL" Xfi X Xecho $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 Xecho "configure:1273: checking whether we are using GNU C" >&5 Xif eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.c <&5; eval $ac_try 2>&5; }; } | egrep yes >/dev/null 2>&1; then X ac_cv_prog_gcc=yes Xelse X ac_cv_prog_gcc=no Xfi Xfi X Xeval echo "$ac_t""$ac_cv_prog_gcc" 1>&6 X Xif test $ac_cv_prog_gcc = yes; then X GCC=yes Xelse X GCC= Xfi X Xac_test_CFLAGS="${CFLAGS+set}" Xac_save_CFLAGS="$CFLAGS" XCFLAGS= Xecho $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 Xecho "configure:1301: checking whether ${CC-cc} accepts -g" >&5 Xif eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X echo 'void f(){}' > conftest.c Xif test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then X ac_cv_prog_cc_g=yes Xelse X ac_cv_prog_cc_g=no Xfi Xrm -rf conftest* X Xfi X Xeval echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 Xif test "$ac_test_CFLAGS" = set; then X CFLAGS="$ac_save_CFLAGS" Xelif test $ac_cv_prog_cc_g = yes; then X if test "$GCC" = yes; then X CFLAGS="-g -O2" X else X CFLAGS="-g" X fi Xelse X if test "$GCC" = yes; then X CFLAGS="-O2" X else X CFLAGS= X fi Xfi X Xif test "$cross_compiling" = remote -a ."$CONFIG_RMTCALL" = . ; then X echo 'CONFIG_RMTCALL=script-path required for remote execution' 1>&2 X exit 1 Xfi Xif test "$cross_compiling" = remote -a ."$CONFIG_RMTHOST" = . ; then X echo 'CONFIG_RMTHOST=host or CONFIG_RMTHOST=user@host required for remote execution' 1>&2 X exit 1 Xfi Xif test "$cross_compiling" = remote ; then X echo "Cross-Compiling with remote execution of test programs" X echo "Cross-Compile script: $CONFIG_RMTCALL" X echo "Cross-Compile host: $CONFIG_RMTHOST" Xfi X echo $ac_n "checking for object suffix""... $ac_c" 1>&6 Xecho "configure:1346: checking for object suffix" >&5 Xif eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X rm -rf conftest* Xecho 'int i = 1;' > conftest.$ac_ext Xif { eval echo configure:1352: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X for ac_file in conftest.*; do X case $ac_file in X *.c) ;; X *.dSYM) ;; # Ignore strange directory found on Mac OS X with cc -g X *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;; X esac X done Xelse X { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; } Xfi Xrm -rf conftest* Xfi X Xeval echo "$ac_t""$ac_cv_objext" 1>&6 XOBJEXT=$ac_cv_objext Xac_objext=$ac_cv_objext X Xecho $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 Xecho "configure:1371: checking for Cygwin environment" >&5 Xif eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext <&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_cygwin=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_cygwin=no Xfi Xrm -f conftest* Xrm -rf conftest* Xfi X Xeval echo "$ac_t""$ac_cv_cygwin" 1>&6 XCYGWIN= Xtest "$ac_cv_cygwin" = yes && CYGWIN=yes Xecho $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 Xecho "configure:1404: checking for mingw32 environment" >&5 Xif eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext <&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_mingw32=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_mingw32=no Xfi Xrm -f conftest* Xrm -rf conftest* Xfi X Xeval echo "$ac_t""$ac_cv_mingw32" 1>&6 XMINGW32= Xtest "$ac_cv_mingw32" = yes && MINGW32=yes Xecho $ac_n "checking for EMX/OS2 environment""... $ac_c" 1>&6 Xecho "configure:1433: checking for EMX/OS2 environment" >&5 Xif eval "test \"`echo '$''{'ac_cv_emxos2'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext <&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_emxos2=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_emxos2=no Xfi Xrm -f conftest* Xrm -rf conftest* Xfi X Xeval echo "$ac_t""$ac_cv_emxos2" 1>&6 Xif eval "test \"`echo '$''{'ac_cv_libpre'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$ac_cv_emxos2" = yes ; then X ac_cv_libpre= Xelse X ac_cv_libpre=lib Xfi X Xfi X XEMXOS2= Xtest "$ac_cv_emxos2" = yes && EMXOS2=yes X X X Xecho $ac_n "checking for executable suffix""... $ac_c" 1>&6 Xecho "configure:1476: checking for executable suffix" >&5 Xif eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$CYGWIN" = yes || test "$MINGW32" = yes || test "$EMXOS2" = yes; then X ac_cv_exeext=.exe X ac_cv_xexeext="" Xelse X rm -rf conftest* X echo 'int main () { return 0; }' > conftest.$ac_ext X ac_cv_exeext= X if { eval echo configure:1487: \"$ac_link\" 1>&5; eval $ac_link 2>&5; }; then X for file in conftest.*; do X case $file in X *.c | *.o | *.obj) ;; X *.dSYM) ;; # Ignore strange directory found on Mac OS X with cc -g X *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;; X esac X done X else X ccout=`eval "${CC-cc} 2>&1" 2> /dev/null` X ret=$? X nf=`echo "$ccout" | grep 'not found'` X if test $ret = 127 -a -n "$nf" ; then # Korn Shell X ccout="" X fi X if test "$ret" -ne 0 -a ! -n "$ccout" ; then X { echo "configure: error: installation or configuration problem: C compiler ${CC-cc} not found." 1>&2; exit 1; } X fi X { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; } X fi X (./conftest ; exit) 2> /dev/null X if test $? != 0 ; then X ac_cv_xexeext="${ac_cv_exeext}" X (./conftest${ac_cv_xexeext} ; exit) 2> /dev/null X if test $? != 0 ; then X ac_cv_xexeext="" X fi X fi X rm -rf conftest* X test x"${ac_cv_exeext}" = x && ac_cv_exeext=no X test x"${ac_cv_xexeext}" = x && ac_cv_xexeext=no Xfi Xfi X XEXEEXT="" XXEXEEXT="" Xtest x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext} Xtest x"${ac_cv_xexeext}" != xno && XEXEEXT=${ac_cv_xexeext} Xeval echo "$ac_t""${ac_cv_exeext}" 1>&6 Xecho $ac_n "checking for executable calling suffix""... $ac_c" 1>&6 Xecho "configure:1527: checking for executable calling suffix" >&5 Xeval echo "$ac_t""${ac_cv_xexeext}" 1>&6 Xac_exeext=$EXEEXT Xac_xexeext=$XEXEEXT X X X Xecho $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 Xecho "configure:1535: checking how to run the C preprocessor" >&5 X# On Suns, sometimes $CPP names a directory. Xif test -n "$CPP" && test -d "$CPP"; then X CPP= Xfi Xif test -z "$CPP"; then Xif eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X # This must be in double quotes, not single quotes, because CPP may get X # substituted into the Makefile and "${CC-cc}" will confuse make. X CPP="${CC-cc} -E" X # On the NeXT, cc -E runs the code through the compiler's parser, X # not just through cpp. X cat > conftest.$ac_ext < XSyntax Error XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:1556: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X : Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X CPP="${CC-cc} -E -traditional-cpp" X cat > conftest.$ac_ext < XSyntax Error XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:1573: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X : Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X CPP="${CC-cc} -nologo -E" X cat > conftest.$ac_ext < XSyntax Error XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:1590: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X : Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X CPP=/lib/cpp Xfi Xrm -f conftest* Xfi Xrm -f conftest* Xfi Xrm -f conftest* X ac_cv_prog_CPP="$CPP" Xfi X CPP="$ac_cv_prog_CPP" Xelse X ac_cv_prog_CPP="$CPP" Xfi Xeval echo "$ac_t""$CPP" 1>&6 X Xecho $ac_n "checking how to run the C preprocessor for any type of file""... $ac_c" 1>&6 Xecho "configure:1615: checking how to run the C preprocessor for any type of file" >&5 Xif test -z "$CPPX"; then Xif eval "test \"`echo '$''{'ac_cv_prog_CPPX'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X # This must be in double quotes, not single quotes, because CPP may get X # substituted into the Makefile and "${CC-cc}" will confuse make. X CPPX="$CPP" X CPPX_IN="" X cat > conftestcpp << EOF X xxzzy XEOF X # gcc -E does not accept any file suffix, so we need to test X # and if $CC -E fails, we try to use dirname(which($CC))/cpp X # We cannot use AC_TRY_EVAL(CPPX conftestcpp | grep xxzzy) because X # of a bug in the parser from bash X ac_result=`(echo configure:1631: "$CPPX conftestcpp | grep xxzzy" 1>&5; eval $CPPX conftestcpp | grep xxzzy) 2>&5` X if test -z "$ac_result"; then X ac_file=`eval type ${CC-cc} 2>/dev/null | sed 's%[^/]*/%/%'` X # Remove last slash and all that follows it. Not all systems have dirname. X ac_dir=`echo "$ac_file" | sed 's%/[^/][^/]*$%%'` X if test -f "$ac_dir"/cpp; then X CPPX="$ac_dir"/cpp X else X # gcc -E does not like all file types, but X # gcc -E - < does. Test whether this works. X ac_result=`(echo configure:1641: "$CPPX - < conftestcpp | grep xxzzy" 1>&5; eval $CPPX - < conftestcpp | grep xxzzy) 2>&5` X if test -n "$ac_result"; then X CPPX_IN="- <" X fi X fi X fi X ac_cv_prog_CPPX="$CPPX" X ac_cv_prog_CPPX_IN="$CPPX_IN" Xfi X CPPX="$ac_cv_prog_CPPX" X CPPX_IN="$ac_cv_prog_CPPX_IN" Xelse X ac_cv_prog_CPPX="$CPPX" X ac_cv_prog_CPPX_IN="$CPPX_IN" Xfi Xeval echo "$ac_t""$CPPX '"$CPPX_IN"'" 1>&6 X Xecho $ac_n "checking if suncc/cc supports -m64""... $ac_c" 1>&6 Xecho "configure:1659: checking if suncc/cc supports -m64" >&5 Xif eval "test \"`echo '$''{'ac_cv_sun_cc64_opt'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X Xsun_cc64=cc Xsun_cc64_opt='' Xac_cv_sun_cc64_opt=no Xif test "$GCC" != yes; then X if test "$CC" = suncc; then X sun_cc64=suncc X fi X ac_err=`< /dev/null eval $sun_cc64 -m64 -c 2>&1 | grep illegal` X if test -n "$ac_err"; then X ac_cv_sun_cc64_opt=no X else X ac_cv_sun_cc64_opt=yes X fi Xfi X Xfi X Xeval echo "$ac_t""$ac_cv_sun_cc64_opt" 1>&6 Xif test $ac_cv_sun_cc64_opt = yes; then X sun_cc64_opt='-m64' Xfi Xecho $ac_n "checking if HP cc supports -Ae""... $ac_c" 1>&6 Xecho "configure:1686: checking if HP cc supports -Ae" >&5 Xif eval "test \"`echo '$''{'ac_cv_hp_cc_ansi_opt'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X Xhp_cc=cc Xhp_cc_ansi_opt='' Xac_cv_hp_cc_ansi_opt=no Xif test "$GCC" != yes; then X os_name=`(uname -s) 2> /dev/null` X if test ."$os_name" = .HP-UX ; then X ac_err=`< /dev/null eval $hp_cc -Ae -c 2>&1 | grep 'Bundled.*option is available only'` X if test -n "$ac_err"; then X ac_cv_hp_cc_ansi_opt=no X else X ac_cv_hp_cc_ansi_opt=yes X fi X fi Xfi X Xfi X Xeval echo "$ac_t""$ac_cv_hp_cc_ansi_opt" 1>&6 Xif test $ac_cv_hp_cc_ansi_opt = yes; then X hp_cc_ansi_opt='-Ae' Xfi Xecho $ac_n "checking if HP cc supports -O""... $ac_c" 1>&6 Xecho "configure:1713: checking if HP cc supports -O" >&5 Xif eval "test \"`echo '$''{'ac_cv_hp_cc_opt_opt'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X Xhp_cc=cc Xhp_cc_opt_opt='' Xac_cv_hp_cc_opt_opt=no Xif test "$GCC" != yes; then X os_name=`(uname -s) 2> /dev/null` X if test ."$os_name" = .HP-UX ; then X ac_err=`< /dev/null eval $hp_cc -O -c 2>&1 | grep 'Bundled.*option is available only'` X if test -n "$ac_err"; then X ac_cv_hp_cc_opt_opt=no X else X ac_cv_hp_cc_opt_opt=yes X fi X fi Xfi X Xfi X Xeval echo "$ac_t""$ac_cv_hp_cc_opt_opt" 1>&6 Xif test $ac_cv_hp_cc_opt_opt = yes; then X hp_cc_opt_opt='-O' Xfi Xecho $ac_n "checking if HP cc supports -G""... $ac_c" 1>&6 Xecho "configure:1740: checking if HP cc supports -G" >&5 Xif eval "test \"`echo '$''{'ac_cv_hp_cc_gprof_opt'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X Xhp_cc=cc Xhp_cc_gprof_opt='' Xac_cv_hp_cc_gprof_opt=no Xif test "$GCC" != yes; then X os_name=`(uname -s) 2> /dev/null` X if test ."$os_name" = .HP-UX ; then X ac_err=`< /dev/null eval $hp_cc -O -c 2>&1 | grep 'Bundled.*option is available only'` X if test -n "$ac_err"; then X ac_cv_hp_cc_gprof_opt=no X else X ac_cv_hp_cc_gprof_opt=yes X fi X fi Xfi X Xfi X Xeval echo "$ac_t""$ac_cv_hp_cc_gprof_opt" 1>&6 Xif test $ac_cv_hp_cc_gprof_opt = yes; then X hp_cc_gprof_opt='-G' Xfi X# Extract the first word of "ranlib", so it can be a program name with args. Xset dummy ranlib; ac_word=$2 Xecho $ac_n "checking for $ac_word""... $ac_c" 1>&6 Xecho "configure:1769: checking for $ac_word" >&5 Xif eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test -n "$RANLIB"; then X ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. Xelse X IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" X ac_dummy="$PATH" X for ac_dir in $ac_dummy; do X test -z "$ac_dir" && ac_dir=. X if test -f $ac_dir/$ac_word; then X ac_cv_prog_RANLIB="ranlib" X break X fi X done X IFS="$ac_save_ifs" X test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" Xfi Xfi XRANLIB="$ac_cv_prog_RANLIB" Xif test -n "$RANLIB"; then X eval echo "$ac_t""$RANLIB" 1>&6 Xelse X eval echo "$ac_t""no" 1>&6 Xfi X Xecho $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 Xecho "configure:1797: checking whether ${MAKE-make} sets \${MAKE}" >&5 Xset dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` Xif eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftestmake <<\EOF Xall: X @echo 'ac_maketemp="${MAKE}"' XEOF X# GNU make sometimes prints "make[1]: Entering...", which would confuse us. Xeval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` Xif test -n "$ac_maketemp"; then X eval ac_cv_prog_make_${ac_make}_set=yes Xelse X eval ac_cv_prog_make_${ac_make}_set=no Xfi Xrm -f conftestmake Xfi Xif eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X SET_MAKE= Xelse X eval echo "$ac_t""no" 1>&6 X SET_MAKE="MAKE=${MAKE-make}" Xfi X Xfor ac_prog in yacc 'bison -y' byacc Xdo X# Extract the first word of "$ac_prog", so it can be a program name with args. Xset dummy $ac_prog; ac_word=$2 Xecho $ac_n "checking for $ac_word""... $ac_c" 1>&6 Xecho "configure:1828: checking for $ac_word" >&5 Xif eval "test \"`echo '$''{'ac_cv_prog_YACC'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test -n "$YACC"; then X ac_cv_prog_YACC="$YACC" # Let the user override the test. Xelse X IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" X ac_dummy="$PATH" X for ac_dir in $ac_dummy; do X test -z "$ac_dir" && ac_dir=. X if test -f $ac_dir/$ac_word; then X ac_cv_prog_YACC="$ac_prog" X break X fi X done X IFS="$ac_save_ifs" Xfi Xfi XYACC="$ac_cv_prog_YACC" Xif test -n "$YACC"; then X eval echo "$ac_t""$YACC" 1>&6 Xelse X eval echo "$ac_t""no" 1>&6 Xfi X Xtest -n "$YACC" && break Xdone Xtest -n "$YACC" || YACC="noyacc" X Xfor ac_prog in bison Xdo X# Extract the first word of "$ac_prog", so it can be a program name with args. Xset dummy $ac_prog; ac_word=$2 Xecho $ac_n "checking for $ac_word""... $ac_c" 1>&6 Xecho "configure:1863: checking for $ac_word" >&5 Xif eval "test \"`echo '$''{'ac_cv_prog_BISON'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test -n "$BISON"; then X ac_cv_prog_BISON="$BISON" # Let the user override the test. Xelse X IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" X ac_dummy="$PATH" X for ac_dir in $ac_dummy; do X test -z "$ac_dir" && ac_dir=. X if test -f $ac_dir/$ac_word; then X ac_cv_prog_BISON="$ac_prog" X break X fi X done X IFS="$ac_save_ifs" Xfi Xfi XBISON="$ac_cv_prog_BISON" Xif test -n "$BISON"; then X eval echo "$ac_t""$BISON" 1>&6 Xelse X eval echo "$ac_t""no" 1>&6 Xfi X Xtest -n "$BISON" && break Xdone Xtest -n "$BISON" || BISON="nobison" X X# X# We need both tsort/lorder or none of them X# X# Extract the first word of "lorder", so it can be a program name with args. Xset dummy lorder; ac_word=$2 Xecho $ac_n "checking for $ac_word""... $ac_c" 1>&6 Xecho "configure:1899: checking for $ac_word" >&5 Xif eval "test \"`echo '$''{'ac_cv_path_LORDER'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X case "$LORDER" in X /*) X ac_cv_path_LORDER="$LORDER" # Let the user override the test with a path. X ;; X ?:/*) X ac_cv_path_LORDER="$LORDER" # Let the user override the test with a dos path. X ;; X *) X IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" X ac_dummy="$PATH:/usr/ccs/bin" X for ac_dir in $ac_dummy; do X test -z "$ac_dir" && ac_dir=. X if test -f $ac_dir/$ac_word; then X ac_cv_path_LORDER="$ac_dir/$ac_word" X break X fi X done X IFS="$ac_save_ifs" X test -z "$ac_cv_path_LORDER" && ac_cv_path_LORDER="echo" X ;; Xesac Xfi XLORDER="$ac_cv_path_LORDER" Xif test -n "$LORDER"; then X eval echo "$ac_t""$LORDER" 1>&6 Xelse X eval echo "$ac_t""no" 1>&6 Xfi X Xif test "$LORDER" = echo; then X TSORT=cat Xelse X # Extract the first word of "tsort", so it can be a program name with args. Xset dummy tsort; ac_word=$2 Xecho $ac_n "checking for $ac_word""... $ac_c" 1>&6 Xecho "configure:1938: checking for $ac_word" >&5 Xif eval "test \"`echo '$''{'ac_cv_path_TSORT'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X case "$TSORT" in X /*) X ac_cv_path_TSORT="$TSORT" # Let the user override the test with a path. X ;; X ?:/*) X ac_cv_path_TSORT="$TSORT" # Let the user override the test with a dos path. X ;; X *) X IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" X ac_dummy="$PATH:/usr/ccs/bin" X for ac_dir in $ac_dummy; do X test -z "$ac_dir" && ac_dir=. X if test -f $ac_dir/$ac_word; then X ac_cv_path_TSORT="$ac_dir/$ac_word" X break X fi X done X IFS="$ac_save_ifs" X test -z "$ac_cv_path_TSORT" && ac_cv_path_TSORT="cat" X ;; Xesac Xfi XTSORT="$ac_cv_path_TSORT" Xif test -n "$TSORT"; then X eval echo "$ac_t""$TSORT" 1>&6 Xelse X eval echo "$ac_t""no" 1>&6 Xfi X X if test "$TSORT" = cat; then X LORDER=echo X fi Xfi X Xecho $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 Xecho "configure:1977: checking for ANSI C header files" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#include X#include X#include XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:1990: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X ac_cv_header_stdc=yes Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_header_stdc=no Xfi Xrm -f conftest* X Xif test $ac_cv_header_stdc = yes; then X # SunOS 4.x string.h does not declare mem*, contrary to ANSI. Xcat > conftest.$ac_ext < XEOF Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 | X egrep "memchr" >/dev/null 2>&1; then X : Xelse X rm -rf conftest* X ac_cv_header_stdc=no Xfi Xrm -f conftest* X Xfi X Xif test $ac_cv_header_stdc = yes; then X # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. Xcat > conftest.$ac_ext < XEOF Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 | X egrep "free" >/dev/null 2>&1; then X : Xelse X rm -rf conftest* X ac_cv_header_stdc=no Xfi Xrm -f conftest* X Xfi X Xif test $ac_cv_header_stdc = yes; then X # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. Xif test "$cross_compiling" = yes; then X : Xelse X cat > conftest.$ac_ext < X#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') X#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) X#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) Xint main () { int i; for (i = 0; i < 256; i++) Xif (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); Xexit (0); } X XEOF Xif { eval echo configure:2057: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X : Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_header_stdc=no Xfi Xrm -fr conftest* Xfi X Xfi Xfi X Xeval echo "$ac_t""$ac_cv_header_stdc" 1>&6 Xif test $ac_cv_header_stdc = yes; then X cat >> confdefs.h <<\EOF X#define STDC_HEADERS 1 XEOF X X cat >> confdefs.h <<\EOF X#define HAVE_STDARG_H 1 XEOF X X cat >> confdefs.h <<\EOF X#define HAVE_STDLIB_H 1 XEOF X X cat >> confdefs.h <<\EOF X#define HAVE_STRING_H 1 XEOF X X cat >> confdefs.h <<\EOF X#define HAVE_FLOAT_H 1 XEOF X Xfi X Xfor ac_hdr in stdarg.h stdlib.h string.h float.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:2100: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:2110: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X echo $ac_n "checking for UNIX-98 compliant inttypes.h""... $ac_c" 1>&6 Xecho "configure:2136: checking for UNIX-98 compliant inttypes.h" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_inttypes'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < Xint main() { Xint8_t c; uint8_t uc; int16_t s; uint16_t us; int32_t i; uint32_t ui; Xint64_t ll; uint64_t ull; Xintptr_t ip; uintptr_t uip; X; return 0; } XEOF Xif { eval echo configure:2150: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_header_inttypes=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_header_inttypes=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_header_inttypes" 1>&6 Xif test $ac_cv_header_inttypes = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_INTTYPES_H 1 XEOF X Xfi Xecho $ac_n "checking for SUSv3 compliant stdint.h""... $ac_c" 1>&6 Xecho "configure:2170: checking for SUSv3 compliant stdint.h" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_stdint'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < Xint main() { Xint8_t c; uint8_t uc; int16_t s; uint16_t us; int32_t i; uint32_t ui; Xint64_t ll; uint64_t ull; Xintptr_t ip; uintptr_t uip; Xintmax_t im; uintmax_t uim; X; return 0; } XEOF Xif { eval echo configure:2185: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_header_stdint=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_header_stdint=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_header_stdint" 1>&6 Xif test $ac_cv_header_stdint = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_STDINT_H 1 XEOF X X cat >> confdefs.h <<\EOF X#define HAVE_TYPE_INTMAX_T 1 XEOF X X cat >> confdefs.h <<\EOF X#define HAVE_TYPE_UINTMAX_T 1 XEOF X Xfi Xac_xsave_LIBS="$LIBS" XLIBS="" Xac_header_dirent=no Xfor ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 Xecho "configure:2219: checking for $ac_hdr that defines DIR" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#include <$ac_hdr> Xint main() { XDIR *dirp = 0; X; return 0; } XEOF Xif { eval echo configure:2232: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X eval "ac_cv_header_dirent_$ac_safe=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_dirent_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_dirent_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. Xif test $ac_header_dirent = dirent.h; then Xecho $ac_n "checking for opendir in -lc""... $ac_c" 1>&6 Xecho "configure:2257: checking for opendir in -lc" >&5 Xac_lib_var=`echo c'_'opendir | sed 'y%./+-%__p_%'` Xif eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_save_LIBS="$LIBS" XLIBS=`echo "-lc $LIBS" | sed -e 's/-lc //'` Xcat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=no" Xfi Xrm -f conftest* XLIBS="$ac_save_LIBS" X Xfi Xif eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X : Xelse X eval echo "$ac_t""no" 1>&6 Xecho $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 Xecho "configure:2295: checking for opendir in -ldir" >&5 Xac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` Xif eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_save_LIBS="$LIBS" XLIBS=`echo "-ldir $LIBS" | sed -e 's/-lc //'` Xcat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=no" Xfi Xrm -f conftest* XLIBS="$ac_save_LIBS" X Xfi Xif eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X LIBS="$LIBS -ldir" Xelse X eval echo "$ac_t""no" 1>&6 Xfi X Xfi X Xelse Xecho $ac_n "checking for opendir in -lc""... $ac_c" 1>&6 Xecho "configure:2338: checking for opendir in -lc" >&5 Xac_lib_var=`echo c'_'opendir | sed 'y%./+-%__p_%'` Xif eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_save_LIBS="$LIBS" XLIBS=`echo "-lc $LIBS" | sed -e 's/-lc //'` Xcat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=no" Xfi Xrm -f conftest* XLIBS="$ac_save_LIBS" X Xfi Xif eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X : Xelse X eval echo "$ac_t""no" 1>&6 Xecho $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 Xecho "configure:2376: checking for opendir in -lx" >&5 Xac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` Xif eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_save_LIBS="$LIBS" XLIBS=`echo "-lx $LIBS" | sed -e 's/-lc //'` Xcat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=no" Xfi Xrm -f conftest* XLIBS="$ac_save_LIBS" X Xfi Xif eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X LIBS="$LIBS -lx" Xelse X eval echo "$ac_t""no" 1>&6 Xfi X Xfi X Xfi X Xlib_dir="$LIBS" XLIBS="$ac_xsave_LIBS" Xecho $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>&6 Xecho "configure:2422: checking whether stat file-mode macros are broken" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_stat_broken'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#include X X#if defined(S_ISBLK) && defined(S_IFDIR) X# if S_ISBLK (S_IFDIR) XYou lose. X# endif X#endif X X#if defined(S_ISBLK) && defined(S_IFCHR) X# if S_ISBLK (S_IFCHR) XYou lose. X# endif X#endif X X#if defined(S_ISLNK) && defined(S_IFREG) X# if S_ISLNK (S_IFREG) XYou lose. X# endif X#endif X X#if defined(S_ISSOCK) && defined(S_IFREG) X# if S_ISSOCK (S_IFREG) XYou lose. X# endif X#endif X XEOF Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 | X egrep "You lose" >/dev/null 2>&1; then X rm -rf conftest* X ac_cv_header_stat_broken=yes Xelse X rm -rf conftest* X ac_cv_header_stat_broken=no Xfi Xrm -f conftest* X Xfi X Xeval echo "$ac_t""$ac_cv_header_stat_broken" 1>&6 Xif test $ac_cv_header_stat_broken = yes; then X cat >> confdefs.h <<\EOF X#define STAT_MACROS_BROKEN 1 XEOF X Xfi X Xecho $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 Xecho "configure:2478: checking whether time.h and sys/time.h may both be included" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#include X#include Xint main() { Xstruct tm *tp; X; return 0; } XEOF Xif { eval echo configure:2492: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_header_time=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_header_time=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_header_time" 1>&6 Xif test $ac_cv_header_time = yes; then X cat >> confdefs.h <<\EOF X#define TIME_WITH_SYS_TIME 1 XEOF X Xfi X Xecho $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 Xecho "configure:2513: checking for sys/wait.h that is POSIX.1 compatible" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#include X#ifndef WEXITSTATUS X#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) X#endif X#ifndef WIFEXITED X#define WIFEXITED(stat_val) (((stat_val) & 255) == 0) X#endif Xint main() { Xint s; Xwait (&s); Xs = WIFEXITED (s) ? WEXITSTATUS (s) : 1; X; return 0; } XEOF Xif { eval echo configure:2534: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_header_sys_wait_h=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_header_sys_wait_h=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6 Xif test $ac_cv_header_sys_wait_h = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_SYS_WAIT_H 1 XEOF X Xfi X Xecho $ac_n "checking if select needs nonstd include files""... $ac_c" 1>&6 Xecho "configure:2555: checking if select needs nonstd include files" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_slect_nonstd_hdr'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#include Xint main() { Xfd_set rfd; FD_ZERO(&rfd); select(1, &rfd, 0, 0, 0); X; return 0; } XEOF Xif { eval echo configure:2568: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_header_slect_nonstd_hdr=no Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_header_slect_nonstd_hdr=yes Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_header_slect_nonstd_hdr" 1>&6 Xif test $ac_cv_header_slect_nonstd_hdr = yes; then X cat >> confdefs.h <<\EOF X#define SELECT_NONSTD_HDR 1 XEOF X Xfi Xecho $ac_n "checking if sys/select.h is needed for select""... $ac_c" 1>&6 Xecho "configure:2588: checking if sys/select.h is needed for select" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_need_sys_select_h'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#include X#include X#ifndef SELECT_NONSTD_HDR Xdo not compile if we do not need nonstandard headers X#endif Xint main() { Xfd_set rfd; FD_ZERO(&rfd); select(1, &rfd, 0, 0, 0); X; return 0; } XEOF Xif { eval echo configure:2605: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_header_need_sys_select_h=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_header_need_sys_select_h=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_header_need_sys_select_h" 1>&6 Xif test $ac_cv_header_need_sys_select_h = yes; then X cat >> confdefs.h <<\EOF X#define NEED_SYS_SELECT_H 1 XEOF X Xfi Xecho $ac_n "checking if sys/socket.h is needed for select""... $ac_c" 1>&6 Xecho "configure:2625: checking if sys/socket.h is needed for select" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_need_sys_socket_h'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#include X#include X#ifndef SELECT_NONSTD_HDR Xdo not compile if we do not need nonstandard headers X#endif Xint main() { Xfd_set rfd; FD_ZERO(&rfd); select(1, &rfd, 0, 0, 0); X; return 0; } XEOF Xif { eval echo configure:2642: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_header_need_sys_socket_h=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_header_need_sys_socket_h=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_header_need_sys_socket_h" 1>&6 Xif test $ac_cv_header_need_sys_socket_h = yes; then X cat >> confdefs.h <<\EOF X#define NEED_SYS_SOCKET_H 1 XEOF X Xfi Xfor ac_hdr in ar.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:2665: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:2675: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in assert.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:2705: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:2715: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in stdio.h varargs.h stdarg.h stdlib.h stddef.h string.h strings.h unistd.h fcntl.h io.h sys/file.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:2745: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:2755: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in conio.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:2785: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:2795: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in getopt.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:2825: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:2835: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in limits.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:2865: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:2875: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in a.out.h aouthdr.h elf.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:2905: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:2915: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in sysexits.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:2945: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:2955: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in malloc.h posix/malloc.h sgtty.h termios.h termio.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:2985: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:2995: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in pwd.h grp.h sys/acl.h aclutils.h acllib.h acl/libacl.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:3025: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:3035: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in signal.h siginfo.h sys/siginfo.h ucontext.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:3065: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:3075: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in shadow.h syslog.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:3105: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:3115: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in sys/time.h sys/times.h utime.h sys/utime.h sys/ioctl.h sys/filio.h sys/param.h sys/systeminfo.h sys/sysctl.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:3145: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:3155: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in sys/loadavg.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:3185: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:3195: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in sys/syscall.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:3225: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:3235: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in mach/machine.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:3265: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:3275: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in mntent.h sys/mntent.h sys/mnttab.h sys/mount.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:3305: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:3315: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in sys/fork.h vfork.h wait.h sys/wait.h sys/resource.h procfs.h sys/procfs.h libproc.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:3345: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:3355: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in ulimit.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:3385: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:3395: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in process.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:3425: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:3435: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in sys/utsname.h sys/priocntl.h sys/rtpriocntl.h sys/procset.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:3465: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:3475: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in sys/mtio.h sys/tape.h sys/mman.h linux/pg.h camlib.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:3505: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:3515: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in sys/shm.h sys/sem.h sys/ipc.h semaphore.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:3545: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:3555: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in sys/dkio.h sys/dklabel.h sun/dkio.h sun/dklabel.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:3585: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:3595: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in sys/types.h sys/stat.h types.h stat.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:3625: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:3635: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in sys/stypes.h sys/filedesc.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:3665: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:3675: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in sys/acct.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:3705: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:3715: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in poll.h sys/poll.h sys/select.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:3745: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:3755: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in netdb.h arpa/aixrcmds.h sys/socket.h netinet/in.h stropts.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:3785: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:3795: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in ieeefp.h fp.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:3825: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:3835: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in values.h float.h math.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:3865: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:3875: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in arpa/inet.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:3905: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:3915: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in rpc/rpc.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:3945: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:3955: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in bsd/dev/scsireg.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:3985: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:3995: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in sys/bsdtty.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:4025: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:4035: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in scsi/scsi.h scsi/sg.h linux/scsi.h linux.sg.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:4065: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:4075: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in linux/types.h linux/gfp.h asm/types.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:4105: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:4115: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in sys/capability.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:4145: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:4155: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in selinux/selinux.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:4185: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:4195: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in OS.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:4225: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:4235: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in os2.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:4265: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:4275: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in os2me.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:4305: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:4315: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in windows.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:4345: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:4355: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in linux/fs.h ext2fs/ext2_fs.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:4385: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:4395: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in sys/xattr.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:4425: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:4435: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in attr/xattr.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:4465: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:4475: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in crt_externs.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:4505: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:4515: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in fnmatch.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:4545: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:4555: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in libintl.h locale.h langinfo.h nl_types.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:4585: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:4595: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in ctype.h wctype.h wchar.h iconv.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:4625: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:4635: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in priv.h sys/priv.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:4665: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:4675: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in exec_attr.h secdb.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:4705: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:4715: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in direct.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:4745: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:4755: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in pthread.h thread.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:4785: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:4795: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in libgen.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:4825: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:4835: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in regex.h regexp.h regexpr.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:4865: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:4875: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in dlfcn.h link.h dl.h libelf.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:4905: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:4915: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in ranlib.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:4945: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:4955: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in expat.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:4985: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:4995: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X X Xecho $ac_n "checking for header file containing major(), minor() and makedev()""... $ac_c" 1>&6 Xecho "configure:5023: checking for header file containing major(), minor() and makedev()" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_makedev'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_cv_header_makedev=none Xcat > conftest.$ac_ext < X#include Xint main() { Xint i = major(0); i = minor(0); i = makedev(0,0); X; return 0; } XEOF Xif { eval echo configure:5037: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_header_makedev=sys/mkdev.h Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 Xfi Xrm -f conftest* Xif test $ac_cv_header_makedev = none; then X cat > conftest.$ac_ext < X#include Xint main() { Xint i = major(0); i = minor(0); i = makedev(0,0); X; return 0; } XEOF Xif { eval echo configure:5055: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_header_makedev=sys/sysmacros.h Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 Xfi Xrm -f conftest* Xfi Xfi X Xeval echo "$ac_t""$ac_cv_header_makedev" 1>&6 Xif test $ac_cv_header_makedev = sys/mkdev.h; then X cat >> confdefs.h <<\EOF X#define MAJOR_IN_MKDEV 1 XEOF X Xfi Xif test $ac_cv_header_makedev = sys/sysmacros.h; then X cat >> confdefs.h <<\EOF X#define MAJOR_IN_SYSMACROS 1 XEOF X Xfi X X Xecho $ac_n "checking bits in minor device number""... $ac_c" 1>&6 Xecho "configure:5082: checking bits in minor device number" >&5 Xif eval "test \"`echo '$''{'ac_cv_dev_minor_bits'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext < X#include X#ifdef major X# define _FOUND_MAJOR_ X#endif X X#ifdef MAJOR_IN_MKDEV X# include X# define _FOUND_MAJOR_ X#endif X X#ifndef _FOUND_MAJOR_ X# ifdef MAJOR_IN_SYSMACROS X# include X# define _FOUND_MAJOR_ X# endif X#endif X X#ifndef _FOUND_MAJOR_ X# if defined(hpux) || defined(__hpux__) || defined(__hpux) X# include X# define _FOUND_MAJOR_ X# endif X#endif X X#ifndef _FOUND_MAJOR_ X# define major(dev) (((dev) >> 8) & 0xFF) X# define minor(dev) ((dev) & 0xFF) X# define makedev(majo, mino) (((majo) << 8) | (mino)) X#endif Xint Xmain() X{ X long l = 1; X int i; X int m; X int c = 0; X FILE *f=fopen("conftestval", "w"); X int maxloop = 32; X X if (sizeof (long) > 4) X maxloop = 64; X X if (!f) exit(1); X X for (i=1, m=0; i <= maxloop; i++, l<<=1) { X if (minor(l) == 0 && c == 0) X c = m; X if (minor(l) != 0) X m = i; X } X fprintf(f, "%d\n", m); X exit(0); X} XEOF Xif { eval echo configure:5147: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_dev_minor_bits=`cat conftestval` Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_dev_minor_bits=0 Xfi Xrm -fr conftest* Xfi X Xfi Xeval echo "$ac_t""$ac_cv_dev_minor_bits" 1>&6 Xcat >> confdefs.h <&6 Xecho "configure:5167: checking whether bits in minor device numbers are non contiguous" >&5 Xif eval "test \"`echo '$''{'ac_cv_dev_minor_noncontig'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext < X#ifdef major X# define _FOUND_MAJOR_ X#endif X X#ifdef MAJOR_IN_MKDEV X# include X# define _FOUND_MAJOR_ X#endif X X#ifndef _FOUND_MAJOR_ X# ifdef MAJOR_IN_SYSMACROS X# include X# define _FOUND_MAJOR_ X# endif X#endif X X#ifndef _FOUND_MAJOR_ X# if defined(hpux) || defined(__hpux__) || defined(__hpux) X# include X# define _FOUND_MAJOR_ X# endif X#endif X X#ifndef _FOUND_MAJOR_ X# define major(dev) (((dev) >> 8) & 0xFF) X# define minor(dev) ((dev) & 0xFF) X# define makedev(majo, mino) (((majo) << 8) | (mino)) X#endif Xint Xmain() X{ X long l = 1; X int i; X int m; X int c = 0; X int maxloop = 32; X X if (sizeof (long) > 4) X maxloop = 64; X X for (i=1, m=0; i <= maxloop; i++, l<<=1) { X if (minor(l) == 0 && c == 0) X c = m; X if (minor(l) != 0) X m = i; X } Xexit (m == c);} XEOF Xif { eval echo configure:5227: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_dev_minor_noncontig=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_dev_minor_noncontig=no Xfi Xrm -fr conftest* Xfi X Xfi X Xeval echo "$ac_t""$ac_cv_dev_minor_noncontig" 1>&6 Xif test $ac_cv_dev_minor_noncontig = yes; then X cat >> confdefs.h <<\EOF X#define DEV_MINOR_NONCONTIG 1 XEOF X Xfi X Xecho $ac_n "checking for _filbuf()""... $ac_c" 1>&6 Xecho "configure:5250: checking for _filbuf()" >&5 Xif eval "test \"`echo '$''{'ac_cv_func__filbuf'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < Xint main() { XFILE *f; Xint flag; Xint count; Xchar *ptr; Xchar c = 0; Xf = fopen("confdefs.h", "r"); X_filbuf(f); X_flsbuf(c, f); Xflag = f->_flag & _IONBF; Xflag |= f->_flag & _IOERR; Xflag |= f->_flag & _IOEOF; Xcount = f->_cnt; Xptr = (char *)f->_ptr; Xfclose(f); X; return 0; } XEOF Xif { eval echo configure:5275: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X ac_cv_func__filbuf=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_func__filbuf=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_func__filbuf" 1>&6 Xif test $ac_cv_func__filbuf = yes; then X cat >> confdefs.h <<\EOF X#define HAVE__FILBUF 1 XEOF X Xfi Xecho $ac_n "checking for __filbuf()""... $ac_c" 1>&6 Xecho "configure:5295: checking for __filbuf()" >&5 Xif eval "test \"`echo '$''{'ac_cv_func___filbuf'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < Xint main() { XFILE *f; Xint flag; Xint count; Xchar *ptr; Xchar c = 0; Xf = fopen("confdefs.h", "r"); X__filbuf(f); X__flsbuf(c, f); Xflag = f->_flag & _IONBF; Xflag |= f->_flag & _IOERR; Xflag |= f->_flag & _IOEOF; Xcount = f->_cnt; Xptr = (char *)f->_ptr; Xfclose(f); X; return 0; } XEOF Xif { eval echo configure:5320: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X ac_cv_func___filbuf=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_func___filbuf=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_func___filbuf" 1>&6 Xif test $ac_cv_func___filbuf = yes; then X cat >> confdefs.h <<\EOF X#define HAVE___FILBUF 1 XEOF X Xfi Xecho $ac_n "checking for USG derived STDIO""... $ac_c" 1>&6 Xecho "configure:5340: checking for USG derived STDIO" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_usg_stdio'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < Xint main() { XFILE *f; Xint flag; Xint count; Xchar *ptr; Xchar c = 0; Xf = fopen("confdefs.h", "r"); X#ifdef HAVE___FILBUF X__filbuf(f); X__flsbuf(c, f); X#else X# ifdef HAVE__FILBUF X_filbuf(f); X_flsbuf(c, f); X# else Xno filbuf() X# endif X#endif Xflag = f->_flag & _IONBF; Xflag |= f->_flag & _IOERR; Xflag |= f->_flag & _IOEOF; Xcount = f->_cnt; Xptr = (char *)f->_ptr; Xfclose(f); X; return 0; } XEOF Xif { eval echo configure:5374: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X ac_cv_header_usg_stdio=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_header_usg_stdio=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_header_usg_stdio" 1>&6 Xif test $ac_cv_header_usg_stdio = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_USG_STDIO 1 XEOF X Xfi Xecho $ac_n "checking for errno definition in errno.h""... $ac_c" 1>&6 Xecho "configure:5394: checking for errno definition in errno.h" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_errno_def'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < Xint main() { Xerrno = 0; X; return 0; } XEOF Xif { eval echo configure:5406: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_header_errno_def=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_header_errno_def=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_header_errno_def" 1>&6 Xif test $ac_cv_header_errno_def = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_ERRNO_DEF 1 XEOF X Xfi Xecho $ac_n "checking for environ definition in unistd.h/stdlib.h""... $ac_c" 1>&6 Xecho "configure:5426: checking for environ definition in unistd.h/stdlib.h" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_environ_def'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#else X#ifdef HAVE_STDLIB_H X#include /* MSC no unistd.h but environ in stdlib.h */ X#endif X#endif X Xint main() { Xenviron = 0; X; return 0; } XEOF Xif { eval echo configure:5446: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_header_environ_def=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_header_environ_def=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_header_environ_def" 1>&6 Xif test $ac_cv_header_environ_def = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_ENVIRON_DEF 1 XEOF X Xfi Xecho $ac_n "checking for sys_siglist definition in signal.h""... $ac_c" 1>&6 Xecho "configure:5466: checking for sys_siglist definition in signal.h" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_sys_siglist_def'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < Xint main() { Xchar *cp = (char *)sys_siglist[0]; exit (cp != (char *)0 && *cp != 0); X; return 0; } XEOF Xif { eval echo configure:5478: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_header_sys_siglist_def=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_header_sys_siglist_def=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_header_sys_siglist_def" 1>&6 Xif test $ac_cv_header_sys_siglist_def = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_SYS_SIGLIST_DEF 1 XEOF X Xfi Xfor ac_hdr in stdlib.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:5501: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:5511: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in unistd.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:5541: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:5551: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in wait.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:5581: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:5591: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xecho $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 Xecho "configure:5618: checking for sys/wait.h that is POSIX.1 compatible" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#include X#ifndef WEXITSTATUS X#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) X#endif X#ifndef WIFEXITED X#define WIFEXITED(stat_val) (((stat_val) & 255) == 0) X#endif Xint main() { Xint s; Xwait (&s); Xs = WIFEXITED (s) ? WEXITSTATUS (s) : 1; X; return 0; } XEOF Xif { eval echo configure:5639: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_header_sys_wait_h=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_header_sys_wait_h=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6 Xif test $ac_cv_header_sys_wait_h = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_SYS_WAIT_H 1 XEOF X Xfi X Xecho $ac_n "checking for errno definition in errno.h""... $ac_c" 1>&6 Xecho "configure:5660: checking for errno definition in errno.h" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_errno_def'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < Xint main() { Xerrno = 0; X; return 0; } XEOF Xif { eval echo configure:5672: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_header_errno_def=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_header_errno_def=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_header_errno_def" 1>&6 Xif test $ac_cv_header_errno_def = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_ERRNO_DEF 1 XEOF X Xfi Xecho $ac_n "checking for SVr4 compliant waitpid() with WNOWAIT support""... $ac_c" 1>&6 Xecho "configure:5692: checking for SVr4 compliant waitpid() with WNOWAIT support" >&5 Xif eval "test \"`echo '$''{'ac_cv_wnowait_waitpid'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext < X#endif X#ifdef HAVE_UNISTD_H X#include X#endif X#if defined(HAVE_WAIT_H) X# include X#else X#include X#endif X#include X#ifndef HAVE_ERRNO_DEF Xextern int errno; X#endif X Xint Xmain() X{ X int xstat; X pid_t pid = -1; X int ret; X X ret = waitpid(pid, &xstat, WNOWAIT); X if (ret < 0 && errno == EINVAL) X exit(1); X exit(0); X} XEOF Xif { eval echo configure:5732: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_wnowait_waitpid=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_wnowait_waitpid=no Xfi Xrm -fr conftest* Xfi X Xfi X Xeval echo "$ac_t""$ac_cv_wnowait_waitpid" 1>&6 Xif test $ac_cv_wnowait_waitpid = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_WNOWAIT_WAITPID 1 XEOF X Xfi X Xecho $ac_n "checking for working const""... $ac_c" 1>&6 Xecho "configure:5755: checking for working const" >&5 Xif eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext <j = 5; X} X{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ X const int foo = 10; X} X X; return 0; } XEOF Xif { eval echo configure:5809: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_c_const=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_c_const=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_c_const" 1>&6 Xif test $ac_cv_c_const = no; then X cat >> confdefs.h <<\EOF X#define const XEOF X Xfi X Xecho $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 Xecho "configure:5830: checking whether byte ordering is bigendian" >&5 Xif eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_cv_c_bigendian=unknown X# See if sys/param.h defines the BYTE_ORDER macro. Xcat > conftest.$ac_ext < X#include Xint main() { X X#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN X bogus endian macros X#endif X; return 0; } XEOF Xif { eval echo configure:5848: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X # It does; now see whether it defined to BIG_ENDIAN or not. Xcat > conftest.$ac_ext < X#include Xint main() { X X#if BYTE_ORDER != BIG_ENDIAN X not big endian X#endif X; return 0; } XEOF Xif { eval echo configure:5863: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_c_bigendian=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_c_bigendian=no Xfi Xrm -f conftest* Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 Xfi Xrm -f conftest* Xif test $ac_cv_c_bigendian = unknown; then Xif test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_c_bigendian=no Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_c_bigendian=yes Xfi Xrm -fr conftest* Xfi X Xfi Xfi X Xeval echo "$ac_t""$ac_cv_c_bigendian" 1>&6 Xif test $ac_cv_c_bigendian = yes; then X cat >> confdefs.h <<\EOF X#define WORDS_BIGENDIAN 1 XEOF X Xfi X Xecho $ac_n "checking whether bitorder in bitfields is htol""... $ac_c" 1>&6 Xecho "configure:5920: checking whether bitorder in bitfields is htol" >&5 Xif eval "test \"`echo '$''{'ac_cv_c_bitfields_htol'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_c_bitfields_htol=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_c_bitfields_htol=no Xfi Xrm -fr conftest* Xfi X Xfi X Xeval echo "$ac_t""$ac_cv_c_bitfields_htol" 1>&6 Xif test $ac_cv_c_bitfields_htol = yes; then X cat >> confdefs.h <<\EOF X#define BITFIELDS_HTOL 1 XEOF X Xfi X X Xecho $ac_n "checking for preprocessor stringizing operator""... $ac_c" 1>&6 Xecho "configure:5968: checking for preprocessor stringizing operator" >&5 Xif eval "test \"`echo '$''{'ac_cv_c_stringize'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext <&5 | X egrep "#teststring" >/dev/null 2>&1; then X rm -rf conftest* X ac_cv_c_stringize=no Xelse X rm -rf conftest* X ac_cv_c_stringize=yes Xfi Xrm -f conftest* X Xfi X Xif test "${ac_cv_c_stringize}" = yes Xthen X cat >> confdefs.h <<\EOF X#define HAVE_STRINGIZE 1 XEOF X Xfi Xeval echo "$ac_t""${ac_cv_c_stringize}" 1>&6 X Xecho $ac_n "checking for inline""... $ac_c" 1>&6 Xecho "configure:6003: checking for inline" >&5 Xif eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_cv_c_inline=no Xfor ac_kw in inline __inline__ __inline; do X cat > conftest.$ac_ext <&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_c_inline=$ac_kw; break Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 Xfi Xrm -f conftest* Xdone X Xfi X Xeval echo "$ac_t""$ac_cv_c_inline" 1>&6 Xcase "$ac_cv_c_inline" in X inline | yes) X cat >> confdefs.h <<\EOF X#define HAVE_INLINE 1 XEOF X X ;; X no) cat >> confdefs.h <<\EOF X#define inline XEOF X X ;; X *) cat >> confdefs.h <> confdefs.h <<\EOF X#define HAVE_INLINE 1 XEOF X X ;; Xesac X Xecho $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 Xecho "configure:6054: checking return type of signal handlers" >&5 Xif eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#include X#ifdef signal X#undef signal X#endif X#ifdef __cplusplus Xextern "C" void (*signal (int, void (*)(int)))(int); X#else Xvoid (*signal ()) (); X#endif X Xint main() { Xint i; X; return 0; } XEOF Xif { eval echo configure:6076: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_type_signal=void Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_type_signal=int Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_type_signal" 1>&6 Xcat >> confdefs.h <&6 Xecho "configure:6095: checking for uid_t in sys/types.h" >&5 Xif eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 | X egrep "uid_t" >/dev/null 2>&1; then X rm -rf conftest* X ac_cv_type_uid_t=yes Xelse X rm -rf conftest* X ac_cv_type_uid_t=no Xfi Xrm -f conftest* X Xfi X Xeval echo "$ac_t""$ac_cv_type_uid_t" 1>&6 Xif test $ac_cv_type_uid_t = no; then X cat >> confdefs.h <<\EOF X#define uid_t int XEOF X X cat >> confdefs.h <<\EOF X#define gid_t int XEOF X Xfi X Xecho $ac_n "checking type of array argument to getgroups""... $ac_c" 1>&6 Xecho "configure:6129: checking type of array argument to getgroups" >&5 Xif eval "test \"`echo '$''{'ac_cv_type_getgroups'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X ac_cv_type_getgroups=cross Xelse X cat > conftest.$ac_ext < X#define NGID 256 X#undef MAX X#define MAX(x, y) ((x) > (y) ? (x) : (y)) Xmain() X{ X gid_t gidset[NGID]; X int i, n; X union { gid_t gval; long lval; } val; X X val.lval = -1; X for (i = 0; i < NGID; i++) X gidset[i] = val.gval; X n = getgroups (sizeof (gidset) / MAX (sizeof (int), sizeof (gid_t)) - 1, X gidset); X /* Exit non-zero if getgroups seems to require an array of ints. This X happens when gid_t is short but getgroups modifies an array of ints. */ X exit ((n > 0 && gidset[n] != val.gval) ? 1 : 0); X} X XEOF Xif { eval echo configure:6162: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_type_getgroups=gid_t Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_type_getgroups=int Xfi Xrm -fr conftest* Xfi X Xif test $ac_cv_type_getgroups = cross; then X cat > conftest.$ac_ext < XEOF Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 | X egrep "getgroups.*int.*gid_t" >/dev/null 2>&1; then X rm -rf conftest* X ac_cv_type_getgroups=gid_t Xelse X rm -rf conftest* X ac_cv_type_getgroups=int Xfi Xrm -f conftest* X Xfi Xfi X Xeval echo "$ac_t""$ac_cv_type_getgroups" 1>&6 Xcat >> confdefs.h <&6 Xecho "configure:6200: checking for type long long" >&5 Xif eval "test \"`echo '$''{'ac_cv_type_longlong'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext <&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_type_longlong=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_type_longlong=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_type_longlong" 1>&6 Xif test $ac_cv_type_longlong = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_LONGLONG 1 XEOF X Xfi Xecho $ac_n "checking for type __int64""... $ac_c" 1>&6 Xecho "configure:6232: checking for type __int64" >&5 Xif eval "test \"`echo '$''{'ac_cv_type___int64'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext <&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_type___int64=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_type___int64=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_type___int64" 1>&6 Xif test $ac_cv_type___int64 = yes; then X cat >> confdefs.h <<\EOF X#define HAVE___INT64 1 XEOF X Xfi Xecho $ac_n "checking for type long double""... $ac_c" 1>&6 Xecho "configure:6264: checking for type long double" >&5 Xif eval "test \"`echo '$''{'ac_cv_type_longdouble'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext <&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_type_longdouble=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_type_longdouble=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_type_longdouble" 1>&6 Xif test $ac_cv_type_longdouble = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_LONGDOUBLE 1 XEOF X Xfi Xecho $ac_n "checking for prototypes""... $ac_c" 1>&6 Xecho "configure:6296: checking for prototypes" >&5 Xif eval "test \"`echo '$''{'ac_cv_type_prototypes'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_type_prototypes=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_type_prototypes=no Xfi Xrm -fr conftest* Xfi X Xfi X Xeval echo "$ac_t""$ac_cv_type_prototypes" 1>&6 Xif test $ac_cv_type_prototypes = yes; then X cat >> confdefs.h <<\EOF X#define PROTOTYPES 1 XEOF X Xfi Xecho $ac_n "checking if compiler allows dynamic arrays""... $ac_c" 1>&6 Xecho "configure:6336: checking if compiler allows dynamic arrays" >&5 Xif eval "test \"`echo '$''{'ac_cv_dyn_arrays'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext <&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_dyn_arrays=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_dyn_arrays=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_dyn_arrays" 1>&6 Xif test $ac_cv_dyn_arrays = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_DYN_ARRAYS 1 XEOF X Xfi Xecho $ac_n "checking if compiler allows pragma weak""... $ac_c" 1>&6 Xecho "configure:6368: checking if compiler allows pragma weak" >&5 Xif eval "test \"`echo '$''{'ac_cv_pragma_weak'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X ac_cv_pragma_weak=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_pragma_weak=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_pragma_weak" 1>&6 Xif test $ac_cv_pragma_weak = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_PRAGMA_WEAK 1 XEOF X Xfi X X Xif test $ac_cv_pragma_weak = yes; then Xcat > conftest2.$ac_ext <&5; eval $ac_compile2 2>&5; }; then X true X Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 Xtrue Xfi X Xac_save_LIBS="$LIBS" XLIBS="conftest2.$ac_cv_objext" Xecho $ac_n "checking if linker allows pragma weak""... $ac_c" 1>&6 Xecho "configure:6424: checking if linker allows pragma weak" >&5 Xif eval "test \"`echo '$''{'ac_cv_link_weak'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X ac_cv_link_weak=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_link_weak=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_link_weak" 1>&6 XLIBS="$ac_save_LIBS" Xif test $ac_cv_link_weak = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_LINK_WEAK 1 XEOF X Xfi Xrm -f conftest2.* Xfi X Xecho $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>&6 Xecho "configure:6460: checking for uid_t in sys/types.h" >&5 Xif eval "test \"`echo '$''{'ac_cv_type_uid_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 | X egrep "uid_t" >/dev/null 2>&1; then X rm -rf conftest* X ac_cv_type_uid_t=yes Xelse X rm -rf conftest* X ac_cv_type_uid_t=no Xfi Xrm -f conftest* X Xfi X Xeval echo "$ac_t""$ac_cv_type_uid_t" 1>&6 Xif test $ac_cv_type_uid_t = no; then X cat >> confdefs.h <<\EOF X#define uid_t int XEOF X X cat >> confdefs.h <<\EOF X#define gid_t int XEOF X Xfi X Xecho $ac_n "checking for size_t""... $ac_c" 1>&6 Xecho "configure:6494: checking for size_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#if HAVE_STDLIB_H || STDC_HEADERS X#include X#endif X#if HAVE_STDDEF_H || STDC_HEADERS X#include X#endif XEOF Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 | X egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then X rm -rf conftest* X ac_cv_type_size_t=yes Xelse X rm -rf conftest* X ac_cv_type_size_t=no Xfi Xrm -f conftest* X Xfi Xeval echo "$ac_t""$ac_cv_type_size_t" 1>&6 Xif test $ac_cv_type_size_t = no; then X cat >> confdefs.h <<\EOF X#define size_t unsigned XEOF X Xfi X Xecho $ac_n "checking for ssize_t""... $ac_c" 1>&6 Xecho "configure:6529: checking for ssize_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_type_ssize_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#if HAVE_STDLIB_H || STDC_HEADERS X#include X#endif X#if HAVE_STDDEF_H || STDC_HEADERS X#include X#endif XEOF Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 | X egrep "(^|[^a-zA-Z_0-9])ssize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then X rm -rf conftest* X ac_cv_type_ssize_t=yes Xelse X rm -rf conftest* X ac_cv_type_ssize_t=no Xfi Xrm -f conftest* X Xfi Xeval echo "$ac_t""$ac_cv_type_ssize_t" 1>&6 Xif test $ac_cv_type_ssize_t = no; then X cat >> confdefs.h <<\EOF X#define ssize_t int XEOF X Xfi X Xecho $ac_n "checking for ptrdiff_t""... $ac_c" 1>&6 Xecho "configure:6564: checking for ptrdiff_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_type_ptrdiff_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#if HAVE_STDLIB_H || STDC_HEADERS X#include X#endif X#if HAVE_STDDEF_H || STDC_HEADERS X#include X#endif XEOF Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 | X egrep "(^|[^a-zA-Z_0-9])ptrdiff_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then X rm -rf conftest* X ac_cv_type_ptrdiff_t=yes Xelse X rm -rf conftest* X ac_cv_type_ptrdiff_t=no Xfi Xrm -f conftest* X Xfi Xeval echo "$ac_t""$ac_cv_type_ptrdiff_t" 1>&6 Xif test $ac_cv_type_ptrdiff_t = no; then X cat >> confdefs.h <<\EOF X#define ptrdiff_t int XEOF X Xfi X Xecho $ac_n "checking for pid_t""... $ac_c" 1>&6 Xecho "configure:6599: checking for pid_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_type_pid_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#if HAVE_STDLIB_H || STDC_HEADERS X#include X#endif X#if HAVE_STDDEF_H || STDC_HEADERS X#include X#endif XEOF Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 | X egrep "(^|[^a-zA-Z_0-9])pid_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then X rm -rf conftest* X ac_cv_type_pid_t=yes Xelse X rm -rf conftest* X ac_cv_type_pid_t=no Xfi Xrm -f conftest* X Xfi Xeval echo "$ac_t""$ac_cv_type_pid_t" 1>&6 Xif test $ac_cv_type_pid_t = no; then X cat >> confdefs.h <<\EOF X#define pid_t int XEOF X Xfi X Xecho $ac_n "checking for off_t""... $ac_c" 1>&6 Xecho "configure:6634: checking for off_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#if HAVE_STDLIB_H || STDC_HEADERS X#include X#endif X#if HAVE_STDDEF_H || STDC_HEADERS X#include X#endif XEOF Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 | X egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then X rm -rf conftest* X ac_cv_type_off_t=yes Xelse X rm -rf conftest* X ac_cv_type_off_t=no Xfi Xrm -f conftest* X Xfi Xeval echo "$ac_t""$ac_cv_type_off_t" 1>&6 Xif test $ac_cv_type_off_t = no; then X cat >> confdefs.h <<\EOF X#define off_t long XEOF X Xfi X Xecho $ac_n "checking for mode_t""... $ac_c" 1>&6 Xecho "configure:6669: checking for mode_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_type_mode_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#if HAVE_STDLIB_H || STDC_HEADERS X#include X#endif X#if HAVE_STDDEF_H || STDC_HEADERS X#include X#endif XEOF Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 | X egrep "(^|[^a-zA-Z_0-9])mode_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then X rm -rf conftest* X ac_cv_type_mode_t=yes Xelse X rm -rf conftest* X ac_cv_type_mode_t=no Xfi Xrm -f conftest* X Xfi Xeval echo "$ac_t""$ac_cv_type_mode_t" 1>&6 Xif test $ac_cv_type_mode_t = no; then X cat >> confdefs.h <<\EOF X#define mode_t int XEOF X Xfi X Xecho $ac_n "checking for time_t""... $ac_c" 1>&6 Xecho "configure:6704: checking for time_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_type_time_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#ifdef TIME_WITH_SYS_TIME_H X# include X# include X#else X#ifdef HAVE_SYS_TIME_H X# include X#else X# include X#endif X#endif Xint main() { Xtime_t t; X; return 0; } XEOF Xif { eval echo configure:6727: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_type_time_t=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_type_time_t=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_type_time_t" 1>&6 Xif test $ac_cv_type_time_t = no; then X cat >> confdefs.h <<\EOF X#define time_t long XEOF X Xfi Xecho $ac_n "checking for caddr_t""... $ac_c" 1>&6 Xecho "configure:6747: checking for caddr_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_type_caddr_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#if HAVE_STDLIB_H || STDC_HEADERS X#include X#endif X#if HAVE_STDDEF_H || STDC_HEADERS X#include X#endif XEOF Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 | X egrep "(^|[^a-zA-Z_0-9])caddr_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then X rm -rf conftest* X ac_cv_type_caddr_t=yes Xelse X rm -rf conftest* X ac_cv_type_caddr_t=no Xfi Xrm -f conftest* X Xfi Xeval echo "$ac_t""$ac_cv_type_caddr_t" 1>&6 Xif test $ac_cv_type_caddr_t = no; then X cat >> confdefs.h <<\EOF X#define caddr_t char * XEOF X Xfi X Xecho $ac_n "checking for daddr_t""... $ac_c" 1>&6 Xecho "configure:6782: checking for daddr_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_type_daddr_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#if HAVE_STDLIB_H || STDC_HEADERS X#include X#endif X#if HAVE_STDDEF_H || STDC_HEADERS X#include X#endif XEOF Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 | X egrep "(^|[^a-zA-Z_0-9])daddr_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then X rm -rf conftest* X ac_cv_type_daddr_t=yes Xelse X rm -rf conftest* X ac_cv_type_daddr_t=no Xfi Xrm -f conftest* X Xfi Xeval echo "$ac_t""$ac_cv_type_daddr_t" 1>&6 Xif test $ac_cv_type_daddr_t = no; then X cat >> confdefs.h <<\EOF X#define daddr_t long XEOF X Xfi X Xecho $ac_n "checking for dev_t""... $ac_c" 1>&6 Xecho "configure:6817: checking for dev_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_type_dev_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#if HAVE_STDLIB_H || STDC_HEADERS X#include X#endif X#if HAVE_STDDEF_H || STDC_HEADERS X#include X#endif XEOF Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 | X egrep "(^|[^a-zA-Z_0-9])dev_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then X rm -rf conftest* X ac_cv_type_dev_t=yes Xelse X rm -rf conftest* X ac_cv_type_dev_t=no Xfi Xrm -f conftest* X Xfi Xeval echo "$ac_t""$ac_cv_type_dev_t" 1>&6 Xif test $ac_cv_type_dev_t = no; then X cat >> confdefs.h <<\EOF X#define dev_t unsigned short XEOF X Xfi X Xecho $ac_n "checking for major_t""... $ac_c" 1>&6 Xecho "configure:6852: checking for major_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_type_major_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#if HAVE_STDLIB_H || STDC_HEADERS X#include X#endif X#if HAVE_STDDEF_H || STDC_HEADERS X#include X#endif XEOF Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 | X egrep "(^|[^a-zA-Z_0-9])major_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then X rm -rf conftest* X ac_cv_type_major_t=yes Xelse X rm -rf conftest* X ac_cv_type_major_t=no Xfi Xrm -f conftest* X Xfi Xeval echo "$ac_t""$ac_cv_type_major_t" 1>&6 Xif test $ac_cv_type_major_t = no; then X cat >> confdefs.h <<\EOF X#define major_t dev_t XEOF X Xfi X Xecho $ac_n "checking for minor_t""... $ac_c" 1>&6 Xecho "configure:6887: checking for minor_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_type_minor_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#if HAVE_STDLIB_H || STDC_HEADERS X#include X#endif X#if HAVE_STDDEF_H || STDC_HEADERS X#include X#endif XEOF Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 | X egrep "(^|[^a-zA-Z_0-9])minor_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then X rm -rf conftest* X ac_cv_type_minor_t=yes Xelse X rm -rf conftest* X ac_cv_type_minor_t=no Xfi Xrm -f conftest* X Xfi Xeval echo "$ac_t""$ac_cv_type_minor_t" 1>&6 Xif test $ac_cv_type_minor_t = no; then X cat >> confdefs.h <<\EOF X#define minor_t dev_t XEOF X Xfi X Xecho $ac_n "checking for ino_t""... $ac_c" 1>&6 Xecho "configure:6922: checking for ino_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_type_ino_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#if HAVE_STDLIB_H || STDC_HEADERS X#include X#endif X#if HAVE_STDDEF_H || STDC_HEADERS X#include X#endif XEOF Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 | X egrep "(^|[^a-zA-Z_0-9])ino_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then X rm -rf conftest* X ac_cv_type_ino_t=yes Xelse X rm -rf conftest* X ac_cv_type_ino_t=no Xfi Xrm -f conftest* X Xfi Xeval echo "$ac_t""$ac_cv_type_ino_t" 1>&6 Xif test $ac_cv_type_ino_t = no; then X cat >> confdefs.h <<\EOF X#define ino_t unsigned long XEOF X Xfi X Xecho $ac_n "checking for nlink_t""... $ac_c" 1>&6 Xecho "configure:6957: checking for nlink_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_type_nlink_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#if HAVE_STDLIB_H || STDC_HEADERS X#include X#endif X#if HAVE_STDDEF_H || STDC_HEADERS X#include X#endif XEOF Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 | X egrep "(^|[^a-zA-Z_0-9])nlink_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then X rm -rf conftest* X ac_cv_type_nlink_t=yes Xelse X rm -rf conftest* X ac_cv_type_nlink_t=no Xfi Xrm -f conftest* X Xfi Xeval echo "$ac_t""$ac_cv_type_nlink_t" 1>&6 Xif test $ac_cv_type_nlink_t = no; then X cat >> confdefs.h <<\EOF X#define nlink_t unsigned long XEOF X Xfi X Xecho $ac_n "checking for blksize_t""... $ac_c" 1>&6 Xecho "configure:6992: checking for blksize_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_type_blksize_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#if HAVE_STDLIB_H || STDC_HEADERS X#include X#endif X#if HAVE_STDDEF_H || STDC_HEADERS X#include X#endif XEOF Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 | X egrep "(^|[^a-zA-Z_0-9])blksize_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then X rm -rf conftest* X ac_cv_type_blksize_t=yes Xelse X rm -rf conftest* X ac_cv_type_blksize_t=no Xfi Xrm -f conftest* X Xfi Xeval echo "$ac_t""$ac_cv_type_blksize_t" 1>&6 Xif test $ac_cv_type_blksize_t = no; then X cat >> confdefs.h <<\EOF X#define blksize_t long XEOF X Xfi X Xecho $ac_n "checking for blkcnt_t""... $ac_c" 1>&6 Xecho "configure:7027: checking for blkcnt_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_type_blkcnt_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#if HAVE_STDLIB_H || STDC_HEADERS X#include X#endif X#if HAVE_STDDEF_H || STDC_HEADERS X#include X#endif XEOF Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 | X egrep "(^|[^a-zA-Z_0-9])blkcnt_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then X rm -rf conftest* X ac_cv_type_blkcnt_t=yes Xelse X rm -rf conftest* X ac_cv_type_blkcnt_t=no Xfi Xrm -f conftest* X Xfi Xeval echo "$ac_t""$ac_cv_type_blkcnt_t" 1>&6 Xif test $ac_cv_type_blkcnt_t = no; then X cat >> confdefs.h <<\EOF X#define blkcnt_t Intmax_t XEOF X Xfi X Xecho $ac_n "checking for clock_t""... $ac_c" 1>&6 Xecho "configure:7062: checking for clock_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_type_clock_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* X * time.h is needed because of a bug in Next Step. X * Next Step needs time.h for clock_t X */ X#ifdef TIME_WITH_SYS_TIME X# ifndef _INCL_SYS_TIME_H X# include X# define _INCL_SYS_TIME_H X# endif X# ifndef _INCL_TIME_H X# include X# define _INCL_TIME_H X# endif X#else X#ifdef HAVE_SYS_TIME_H X# ifndef _INCL_SYS_TIME_H X# include X# define _INCL_SYS_TIME_H X# endif X#else X# ifndef _INCL_TIME_H X# include X# define _INCL_TIME_H X# endif X#endif X#endif X#ifdef HAVE_SYS_TIMES_H X#include X#endif X Xint main() { Xclock_t t; X; return 0; } XEOF Xif { eval echo configure:7105: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_type_clock_t=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_type_clock_t=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_type_clock_t" 1>&6 Xif test $ac_cv_type_clock_t = no; then X cat >> confdefs.h <<\EOF X#define clock_t long XEOF X Xfi Xecho $ac_n "checking for socklen_t""... $ac_c" 1>&6 Xecho "configure:7125: checking for socklen_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_type_socklen_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#if HAVE_STDLIB_H || STDC_HEADERS X#include X#endif X#if HAVE_STDDEF_H || STDC_HEADERS X#include X#endif X#include XEOF Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 | X egrep "(^|[^a-zA-Z_0-9])socklen_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then X rm -rf conftest* X ac_cv_type_socklen_t=yes Xelse X rm -rf conftest* X ac_cv_type_socklen_t=no Xfi Xrm -f conftest* X Xfi Xeval echo "$ac_t""$ac_cv_type_socklen_t" 1>&6 Xif test $ac_cv_type_socklen_t = no; then X cat >> confdefs.h <<\EOF X#define socklen_t int XEOF X Xfi Xecho $ac_n "checking for greg_t""... $ac_c" 1>&6 Xecho "configure:7160: checking for greg_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_have_type_greg_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#if HAVE_STDLIB_H || STDC_HEADERS X#include X#endif X#if HAVE_STDDEF_H || STDC_HEADERS X#include X#endif X#include XEOF Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 | X egrep "(^|[^a-zA-Z_0-9])greg_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then X rm -rf conftest* X eval ac_cv_have_type_greg_t=yes Xelse X rm -rf conftest* X eval ac_cv_have_type_greg_t=no Xfi Xrm -f conftest* X Xfi Xeval echo "$ac_t""$ac_cv_have_type_greg_t" 1>&6 X ac_tr_type=HAVE_TYPE_`echo greg_t | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` Xif test $ac_cv_have_type_greg_t = yes; then X cat >> confdefs.h <&6 Xecho "configure:7197: checking for rlim_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_have_type_rlim_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#if HAVE_STDLIB_H || STDC_HEADERS X#include X#endif X#if HAVE_STDDEF_H || STDC_HEADERS X#include X#endif X#include XEOF Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 | X egrep "(^|[^a-zA-Z_0-9])rlim_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then X rm -rf conftest* X eval ac_cv_have_type_rlim_t=yes Xelse X rm -rf conftest* X eval ac_cv_have_type_rlim_t=no Xfi Xrm -f conftest* X Xfi Xeval echo "$ac_t""$ac_cv_have_type_rlim_t" 1>&6 X ac_tr_type=HAVE_TYPE_`echo rlim_t | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` Xif test $ac_cv_have_type_rlim_t = yes; then X cat >> confdefs.h <&6 Xecho "configure:7234: checking if idtype_t is declared correctly in wait.h" >&5 Xif eval "test \"`echo '$''{'ac_cv_have_type_idtype_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#else X#include X#endif Xint main() { Xidtype_t idt; idt = P_ALL; idt = P_PGID; idt = P_PID; exit (idt == P_PID); X; return 0; } XEOF Xif { eval echo configure:7251: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_have_type_idtype_t=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_have_type_idtype_t=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_have_type_idtype_t" 1>&6 Xif test $ac_cv_have_type_idtype_t = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_TYPE_IDTYPE_T 1 XEOF X Xfi Xecho $ac_n "checking for siginfo_t""... $ac_c" 1>&6 Xecho "configure:7271: checking for siginfo_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_have_type_siginfo_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#if HAVE_STDLIB_H || STDC_HEADERS X#include X#endif X#if HAVE_STDDEF_H || STDC_HEADERS X#include X#endif X#include XEOF Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 | X egrep "(^|[^a-zA-Z_0-9])siginfo_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then X rm -rf conftest* X eval ac_cv_have_type_siginfo_t=yes Xelse X rm -rf conftest* X eval ac_cv_have_type_siginfo_t=no Xfi Xrm -f conftest* X Xfi Xeval echo "$ac_t""$ac_cv_have_type_siginfo_t" 1>&6 X ac_tr_type=HAVE_TYPE_`echo siginfo_t | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` Xif test $ac_cv_have_type_siginfo_t = yes; then X cat >> confdefs.h <&6 Xecho "configure:7308: checking if stack_t is declared in signal.h" >&5 Xif eval "test \"`echo '$''{'ac_cv_stack_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < Xint main() { Xstack_t ss; ss.ss_size = 0; exit (ss.ss_size == 0); X; return 0; } XEOF Xif { eval echo configure:7320: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_stack_t=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_stack_t=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_stack_t" 1>&6 Xif test $ac_cv_stack_t = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_STACK_T 1 XEOF X Xfi Xecho $ac_n "checking if siginfo_t is declared in signal.h""... $ac_c" 1>&6 Xecho "configure:7340: checking if siginfo_t is declared in signal.h" >&5 Xif eval "test \"`echo '$''{'ac_cv_siginfo_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#ifdef HAVE_SIGINFO_H X#include X#else X#ifdef HAVE_SYS_SIGINFO_H X#include X#endif X#endif Xint main() { Xsiginfo_t si; si.si_signo = 0; exit (si.si_signo == 0); X; return 0; } XEOF Xif { eval echo configure:7359: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_siginfo_t=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_siginfo_t=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_siginfo_t" 1>&6 Xif test $ac_cv_siginfo_t = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_SIGINFO_T 1 XEOF X Xfi X Xecho $ac_n "checking for u_char""... $ac_c" 1>&6 Xecho "configure:7380: checking for u_char" >&5 Xif eval "test \"`echo '$''{'ac_cv_type_u_char'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#if HAVE_STDLIB_H || STDC_HEADERS X#include X#endif X#if HAVE_STDDEF_H || STDC_HEADERS X#include X#endif XEOF Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 | X egrep "(^|[^a-zA-Z_0-9])u_char[^a-zA-Z_0-9]" >/dev/null 2>&1; then X rm -rf conftest* X ac_cv_type_u_char=yes Xelse X rm -rf conftest* X ac_cv_type_u_char=no Xfi Xrm -f conftest* X Xfi Xeval echo "$ac_t""$ac_cv_type_u_char" 1>&6 Xif test $ac_cv_type_u_char = no; then X cat >> confdefs.h <<\EOF X#define u_char unsigned char XEOF X Xfi X Xecho $ac_n "checking for u_short""... $ac_c" 1>&6 Xecho "configure:7415: checking for u_short" >&5 Xif eval "test \"`echo '$''{'ac_cv_type_u_short'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#if HAVE_STDLIB_H || STDC_HEADERS X#include X#endif X#if HAVE_STDDEF_H || STDC_HEADERS X#include X#endif XEOF Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 | X egrep "(^|[^a-zA-Z_0-9])u_short[^a-zA-Z_0-9]" >/dev/null 2>&1; then X rm -rf conftest* X ac_cv_type_u_short=yes Xelse X rm -rf conftest* X ac_cv_type_u_short=no Xfi Xrm -f conftest* X Xfi Xeval echo "$ac_t""$ac_cv_type_u_short" 1>&6 Xif test $ac_cv_type_u_short = no; then X cat >> confdefs.h <<\EOF X#define u_short unsigned short XEOF X Xfi X Xecho $ac_n "checking for u_int""... $ac_c" 1>&6 Xecho "configure:7450: checking for u_int" >&5 Xif eval "test \"`echo '$''{'ac_cv_type_u_int'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#if HAVE_STDLIB_H || STDC_HEADERS X#include X#endif X#if HAVE_STDDEF_H || STDC_HEADERS X#include X#endif XEOF Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 | X egrep "(^|[^a-zA-Z_0-9])u_int[^a-zA-Z_0-9]" >/dev/null 2>&1; then X rm -rf conftest* X ac_cv_type_u_int=yes Xelse X rm -rf conftest* X ac_cv_type_u_int=no Xfi Xrm -f conftest* X Xfi Xeval echo "$ac_t""$ac_cv_type_u_int" 1>&6 Xif test $ac_cv_type_u_int = no; then X cat >> confdefs.h <<\EOF X#define u_int unsigned int XEOF X Xfi X Xecho $ac_n "checking for u_long""... $ac_c" 1>&6 Xecho "configure:7485: checking for u_long" >&5 Xif eval "test \"`echo '$''{'ac_cv_type_u_long'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#if HAVE_STDLIB_H || STDC_HEADERS X#include X#endif X#if HAVE_STDDEF_H || STDC_HEADERS X#include X#endif XEOF Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 | X egrep "(^|[^a-zA-Z_0-9])u_long[^a-zA-Z_0-9]" >/dev/null 2>&1; then X rm -rf conftest* X ac_cv_type_u_long=yes Xelse X rm -rf conftest* X ac_cv_type_u_long=no Xfi Xrm -f conftest* X Xfi Xeval echo "$ac_t""$ac_cv_type_u_long" 1>&6 Xif test $ac_cv_type_u_long = no; then X cat >> confdefs.h <<\EOF X#define u_long unsigned long XEOF X Xfi X X Xecho $ac_n "checking for int8_t""... $ac_c" 1>&6 Xecho "configure:7521: checking for int8_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_type_int8_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#if HAVE_STDLIB_H || STDC_HEADERS X#include X#endif X#if HAVE_STDDEF_H || STDC_HEADERS X#include X#endif X#ifdef HAVE_INTTYPES_H X#include X#endif X#ifdef HAVE_STDINT_H X#include X#endif X XEOF Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 | X egrep "(^|[^a-zA-Z_0-9])int8_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then X rm -rf conftest* X ac_cv_type_int8_t=yes Xelse X rm -rf conftest* X ac_cv_type_int8_t=no Xfi Xrm -f conftest* X Xfi Xeval echo "$ac_t""$ac_cv_type_int8_t" 1>&6 Xif test $ac_cv_type_int8_t = no; then X cat >> confdefs.h <<\EOF X#define int8_t Int8_t XEOF X Xfi X X Xecho $ac_n "checking for int16_t""... $ac_c" 1>&6 Xecho "configure:7564: checking for int16_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_type_int16_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#if HAVE_STDLIB_H || STDC_HEADERS X#include X#endif X#if HAVE_STDDEF_H || STDC_HEADERS X#include X#endif X#ifdef HAVE_INTTYPES_H X#include X#endif X#ifdef HAVE_STDINT_H X#include X#endif X XEOF Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 | X egrep "(^|[^a-zA-Z_0-9])int16_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then X rm -rf conftest* X ac_cv_type_int16_t=yes Xelse X rm -rf conftest* X ac_cv_type_int16_t=no Xfi Xrm -f conftest* X Xfi Xeval echo "$ac_t""$ac_cv_type_int16_t" 1>&6 Xif test $ac_cv_type_int16_t = no; then X cat >> confdefs.h <<\EOF X#define int16_t Int16_t XEOF X Xfi X X Xecho $ac_n "checking for int32_t""... $ac_c" 1>&6 Xecho "configure:7607: checking for int32_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_type_int32_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#if HAVE_STDLIB_H || STDC_HEADERS X#include X#endif X#if HAVE_STDDEF_H || STDC_HEADERS X#include X#endif X#ifdef HAVE_INTTYPES_H X#include X#endif X#ifdef HAVE_STDINT_H X#include X#endif X XEOF Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 | X egrep "(^|[^a-zA-Z_0-9])int32_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then X rm -rf conftest* X ac_cv_type_int32_t=yes Xelse X rm -rf conftest* X ac_cv_type_int32_t=no Xfi Xrm -f conftest* X Xfi Xeval echo "$ac_t""$ac_cv_type_int32_t" 1>&6 Xif test $ac_cv_type_int32_t = no; then X cat >> confdefs.h <<\EOF X#define int32_t Int32_t XEOF X Xfi X X Xecho $ac_n "checking for int64_t""... $ac_c" 1>&6 Xecho "configure:7650: checking for int64_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_type_int64_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#if HAVE_STDLIB_H || STDC_HEADERS X#include X#endif X#if HAVE_STDDEF_H || STDC_HEADERS X#include X#endif X#ifdef HAVE_INTTYPES_H X#include X#endif X#ifdef HAVE_STDINT_H X#include X#endif X XEOF Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 | X egrep "(^|[^a-zA-Z_0-9])int64_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then X rm -rf conftest* X ac_cv_type_int64_t=yes Xelse X rm -rf conftest* X ac_cv_type_int64_t=no Xfi Xrm -f conftest* X Xfi Xeval echo "$ac_t""$ac_cv_type_int64_t" 1>&6 Xif test $ac_cv_type_int64_t = no; then X cat >> confdefs.h <<\EOF X#define int64_t Int64_t XEOF X Xfi X X Xecho $ac_n "checking for intmax_t""... $ac_c" 1>&6 Xecho "configure:7693: checking for intmax_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_type_intmax_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#if HAVE_STDLIB_H || STDC_HEADERS X#include X#endif X#if HAVE_STDDEF_H || STDC_HEADERS X#include X#endif X#ifdef HAVE_INTTYPES_H X#include X#endif X#ifdef HAVE_STDINT_H X#include X#endif X XEOF Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 | X egrep "(^|[^a-zA-Z_0-9])intmax_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then X rm -rf conftest* X ac_cv_type_intmax_t=yes Xelse X rm -rf conftest* X ac_cv_type_intmax_t=no Xfi Xrm -f conftest* X Xfi Xeval echo "$ac_t""$ac_cv_type_intmax_t" 1>&6 Xif test $ac_cv_type_intmax_t = no; then X cat >> confdefs.h <<\EOF X#define intmax_t Intmax_t XEOF X Xfi X X Xecho $ac_n "checking for intptr_t""... $ac_c" 1>&6 Xecho "configure:7736: checking for intptr_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_type_intptr_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#if HAVE_STDLIB_H || STDC_HEADERS X#include X#endif X#if HAVE_STDDEF_H || STDC_HEADERS X#include X#endif X#ifdef HAVE_INTTYPES_H X#include X#endif X#ifdef HAVE_STDINT_H X#include X#endif X XEOF Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 | X egrep "(^|[^a-zA-Z_0-9])intptr_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then X rm -rf conftest* X ac_cv_type_intptr_t=yes Xelse X rm -rf conftest* X ac_cv_type_intptr_t=no Xfi Xrm -f conftest* X Xfi Xeval echo "$ac_t""$ac_cv_type_intptr_t" 1>&6 Xif test $ac_cv_type_intptr_t = no; then X cat >> confdefs.h <<\EOF X#define intptr_t Intptr_t XEOF X Xfi X X Xecho $ac_n "checking for uint8_t""... $ac_c" 1>&6 Xecho "configure:7779: checking for uint8_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_type_uint8_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#if HAVE_STDLIB_H || STDC_HEADERS X#include X#endif X#if HAVE_STDDEF_H || STDC_HEADERS X#include X#endif X#ifdef HAVE_INTTYPES_H X#include X#endif X#ifdef HAVE_STDINT_H X#include X#endif X XEOF Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 | X egrep "(^|[^a-zA-Z_0-9])uint8_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then X rm -rf conftest* X ac_cv_type_uint8_t=yes Xelse X rm -rf conftest* X ac_cv_type_uint8_t=no Xfi Xrm -f conftest* X Xfi Xeval echo "$ac_t""$ac_cv_type_uint8_t" 1>&6 Xif test $ac_cv_type_uint8_t = no; then X cat >> confdefs.h <<\EOF X#define uint8_t UInt8_t XEOF X Xfi X X Xecho $ac_n "checking for uint16_t""... $ac_c" 1>&6 Xecho "configure:7822: checking for uint16_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_type_uint16_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#if HAVE_STDLIB_H || STDC_HEADERS X#include X#endif X#if HAVE_STDDEF_H || STDC_HEADERS X#include X#endif X#ifdef HAVE_INTTYPES_H X#include X#endif X#ifdef HAVE_STDINT_H X#include X#endif X XEOF Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 | X egrep "(^|[^a-zA-Z_0-9])uint16_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then X rm -rf conftest* X ac_cv_type_uint16_t=yes Xelse X rm -rf conftest* X ac_cv_type_uint16_t=no Xfi Xrm -f conftest* X Xfi Xeval echo "$ac_t""$ac_cv_type_uint16_t" 1>&6 Xif test $ac_cv_type_uint16_t = no; then X cat >> confdefs.h <<\EOF X#define uint16_t UInt16_t XEOF X Xfi X X Xecho $ac_n "checking for uint32_t""... $ac_c" 1>&6 Xecho "configure:7865: checking for uint32_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_type_uint32_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#if HAVE_STDLIB_H || STDC_HEADERS X#include X#endif X#if HAVE_STDDEF_H || STDC_HEADERS X#include X#endif X#ifdef HAVE_INTTYPES_H X#include X#endif X#ifdef HAVE_STDINT_H X#include X#endif X XEOF Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 | X egrep "(^|[^a-zA-Z_0-9])uint32_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then X rm -rf conftest* X ac_cv_type_uint32_t=yes Xelse X rm -rf conftest* X ac_cv_type_uint32_t=no Xfi Xrm -f conftest* X Xfi Xeval echo "$ac_t""$ac_cv_type_uint32_t" 1>&6 Xif test $ac_cv_type_uint32_t = no; then X cat >> confdefs.h <<\EOF X#define uint32_t UInt32_t XEOF X Xfi X X Xecho $ac_n "checking for uint64_t""... $ac_c" 1>&6 Xecho "configure:7908: checking for uint64_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_type_uint64_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#if HAVE_STDLIB_H || STDC_HEADERS X#include X#endif X#if HAVE_STDDEF_H || STDC_HEADERS X#include X#endif X#ifdef HAVE_INTTYPES_H X#include X#endif X#ifdef HAVE_STDINT_H X#include X#endif X XEOF Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 | X egrep "(^|[^a-zA-Z_0-9])uint64_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then X rm -rf conftest* X ac_cv_type_uint64_t=yes Xelse X rm -rf conftest* X ac_cv_type_uint64_t=no Xfi Xrm -f conftest* X Xfi Xeval echo "$ac_t""$ac_cv_type_uint64_t" 1>&6 Xif test $ac_cv_type_uint64_t = no; then X cat >> confdefs.h <<\EOF X#define uint64_t UInt64_t XEOF X Xfi X X Xecho $ac_n "checking for uintmax_t""... $ac_c" 1>&6 Xecho "configure:7951: checking for uintmax_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_type_uintmax_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#if HAVE_STDLIB_H || STDC_HEADERS X#include X#endif X#if HAVE_STDDEF_H || STDC_HEADERS X#include X#endif X#ifdef HAVE_INTTYPES_H X#include X#endif X#ifdef HAVE_STDINT_H X#include X#endif X XEOF Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 | X egrep "(^|[^a-zA-Z_0-9])uintmax_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then X rm -rf conftest* X ac_cv_type_uintmax_t=yes Xelse X rm -rf conftest* X ac_cv_type_uintmax_t=no Xfi Xrm -f conftest* X Xfi Xeval echo "$ac_t""$ac_cv_type_uintmax_t" 1>&6 Xif test $ac_cv_type_uintmax_t = no; then X cat >> confdefs.h <<\EOF X#define uintmax_t UIntmax_t XEOF X Xfi X X Xecho $ac_n "checking for uintptr_t""... $ac_c" 1>&6 Xecho "configure:7994: checking for uintptr_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_type_uintptr_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#if HAVE_STDLIB_H || STDC_HEADERS X#include X#endif X#if HAVE_STDDEF_H || STDC_HEADERS X#include X#endif X#ifdef HAVE_INTTYPES_H X#include X#endif X#ifdef HAVE_STDINT_H X#include X#endif X XEOF Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 | X egrep "(^|[^a-zA-Z_0-9])uintptr_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then X rm -rf conftest* X ac_cv_type_uintptr_t=yes Xelse X rm -rf conftest* X ac_cv_type_uintptr_t=no Xfi Xrm -f conftest* X Xfi Xeval echo "$ac_t""$ac_cv_type_uintptr_t" 1>&6 Xif test $ac_cv_type_uintptr_t = no; then X cat >> confdefs.h <<\EOF X#define uintptr_t UIntptr_t XEOF X Xfi X X Xecho $ac_n "checking for wctype_t""... $ac_c" 1>&6 Xecho "configure:8037: checking for wctype_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_type_wctype_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#if HAVE_STDLIB_H || STDC_HEADERS X#include X#endif X#if HAVE_STDDEF_H || STDC_HEADERS X#include X#endif X#ifdef HAVE_WCHAR_H X#include X#endif X#ifdef HAVE_WCTYPE_H X#include X#endif X XEOF Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 | X egrep "(^|[^a-zA-Z_0-9])wctype_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then X rm -rf conftest* X ac_cv_type_wctype_t=yes Xelse X rm -rf conftest* X ac_cv_type_wctype_t=no Xfi Xrm -f conftest* X Xfi Xeval echo "$ac_t""$ac_cv_type_wctype_t" 1>&6 Xif test $ac_cv_type_wctype_t = no; then X cat >> confdefs.h <<\EOF X#define wctype_t int XEOF X Xfi X X Xecho $ac_n "checking for wint_t""... $ac_c" 1>&6 Xecho "configure:8080: checking for wint_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_type_wint_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#if HAVE_STDLIB_H || STDC_HEADERS X#include X#endif X#if HAVE_STDDEF_H || STDC_HEADERS X#include X#endif X#ifdef HAVE_WCHAR_H X#include X#endif X#ifdef HAVE_WCTYPE_H X#include X#endif X#include X XEOF Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 | X egrep "(^|[^a-zA-Z_0-9])wint_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then X rm -rf conftest* X ac_cv_type_wint_t=yes Xelse X rm -rf conftest* X ac_cv_type_wint_t=no Xfi Xrm -f conftest* X Xfi Xeval echo "$ac_t""$ac_cv_type_wint_t" 1>&6 Xif test $ac_cv_type_wint_t = no; then X cat >> confdefs.h <<\EOF X#define wint_t int XEOF X Xfi X X Xecho $ac_n "checking for mbstate_t""... $ac_c" 1>&6 Xecho "configure:8124: checking for mbstate_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_type_mbstate_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#if HAVE_STDLIB_H || STDC_HEADERS X#include X#endif X#if HAVE_STDDEF_H || STDC_HEADERS X#include X#endif X#ifdef HAVE_WCHAR_H X#include X#endif X#ifdef HAVE_WCTYPE_H X#include X#endif X XEOF Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 | X egrep "(^|[^a-zA-Z_0-9])mbstate_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then X rm -rf conftest* X ac_cv_type_mbstate_t=yes Xelse X rm -rf conftest* X ac_cv_type_mbstate_t=no Xfi Xrm -f conftest* X Xfi Xeval echo "$ac_t""$ac_cv_type_mbstate_t" 1>&6 Xif test $ac_cv_type_mbstate_t = no; then X cat >> confdefs.h <<\EOF X#define mbstate_t int XEOF X Xfi X X Xecho $ac_n "checking for timestruc_t""... $ac_c" 1>&6 Xecho "configure:8167: checking for timestruc_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_type_timestruc_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#if HAVE_STDLIB_H || STDC_HEADERS X#include X#endif X#if HAVE_STDDEF_H || STDC_HEADERS X#include X#endif X#ifdef HAVE_SYS_STAT_H X#include X#endif X#ifdef HAVE_STAT_H X#include X#endif X XEOF Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 | X egrep "(^|[^a-zA-Z_0-9])timestruc_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then X rm -rf conftest* X ac_cv_type_timestruc_t=yes Xelse X rm -rf conftest* X ac_cv_type_timestruc_t=no Xfi Xrm -f conftest* X Xfi Xeval echo "$ac_t""$ac_cv_type_timestruc_t" 1>&6 Xif test $ac_cv_type_timestruc_t = no; then X cat >> confdefs.h <<\EOF X#define timestruc_t struct timespec XEOF X Xfi X X Xecho $ac_n "checking size of char""... $ac_c" 1>&6 Xecho "configure:8210: checking size of char" >&5 Xif eval "test \"`echo '$''{'ac_cv_sizeof_char'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext < X#if HAVE_STDDEF_H || STDC_HEADERS X#include /* For ptrdiff_t, wchar_t, size_t */ X#endif X#ifdef HAVE_SYS_TYPES_H X#include X#endif Xmain() X{ X FILE *f=fopen("conftestval", "w"); X if (!f) exit(1); X fprintf(f, "%d\n", sizeof(char)); X exit(0); X} XEOF Xif { eval echo configure:8235: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_sizeof_char=`cat conftestval` Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_sizeof_char=0 Xfi Xrm -fr conftest* Xfi X Xfi Xeval echo "$ac_t""$ac_cv_sizeof_char" 1>&6 Xcat >> confdefs.h <&6 Xecho "configure:8255: checking size of short int" >&5 Xif eval "test \"`echo '$''{'ac_cv_sizeof_short_int'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext < X#if HAVE_STDDEF_H || STDC_HEADERS X#include /* For ptrdiff_t, wchar_t, size_t */ X#endif X#ifdef HAVE_SYS_TYPES_H X#include X#endif Xmain() X{ X FILE *f=fopen("conftestval", "w"); X if (!f) exit(1); X fprintf(f, "%d\n", sizeof(short int)); X exit(0); X} XEOF Xif { eval echo configure:8280: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_sizeof_short_int=`cat conftestval` Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_sizeof_short_int=0 Xfi Xrm -fr conftest* Xfi X Xfi Xeval echo "$ac_t""$ac_cv_sizeof_short_int" 1>&6 Xcat >> confdefs.h <&6 Xecho "configure:8300: checking size of int" >&5 Xif eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext < X#if HAVE_STDDEF_H || STDC_HEADERS X#include /* For ptrdiff_t, wchar_t, size_t */ X#endif X#ifdef HAVE_SYS_TYPES_H X#include X#endif Xmain() X{ X FILE *f=fopen("conftestval", "w"); X if (!f) exit(1); X fprintf(f, "%d\n", sizeof(int)); X exit(0); X} XEOF Xif { eval echo configure:8325: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_sizeof_int=`cat conftestval` Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_sizeof_int=0 Xfi Xrm -fr conftest* Xfi X Xfi Xeval echo "$ac_t""$ac_cv_sizeof_int" 1>&6 Xcat >> confdefs.h <&6 Xecho "configure:8345: checking size of long int" >&5 Xif eval "test \"`echo '$''{'ac_cv_sizeof_long_int'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext < X#if HAVE_STDDEF_H || STDC_HEADERS X#include /* For ptrdiff_t, wchar_t, size_t */ X#endif X#ifdef HAVE_SYS_TYPES_H X#include X#endif Xmain() X{ X FILE *f=fopen("conftestval", "w"); X if (!f) exit(1); X fprintf(f, "%d\n", sizeof(long int)); X exit(0); X} XEOF Xif { eval echo configure:8370: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_sizeof_long_int=`cat conftestval` Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_sizeof_long_int=0 Xfi Xrm -fr conftest* Xfi X Xfi Xeval echo "$ac_t""$ac_cv_sizeof_long_int" 1>&6 Xcat >> confdefs.h <&6 Xecho "configure:8390: checking size of long long" >&5 Xif eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext < X#if HAVE_STDDEF_H || STDC_HEADERS X#include /* For ptrdiff_t, wchar_t, size_t */ X#endif X#ifdef HAVE_SYS_TYPES_H X#include X#endif Xmain() X{ X FILE *f=fopen("conftestval", "w"); X if (!f) exit(1); X fprintf(f, "%d\n", sizeof(long long)); X exit(0); X} XEOF Xif { eval echo configure:8415: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_sizeof_long_long=`cat conftestval` Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_sizeof_long_long=0 Xfi Xrm -fr conftest* Xfi X Xfi Xeval echo "$ac_t""$ac_cv_sizeof_long_long" 1>&6 Xcat >> confdefs.h <&6 Xecho "configure:8435: checking size of __int64" >&5 Xif eval "test \"`echo '$''{'ac_cv_sizeof___int64'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext < X#if HAVE_STDDEF_H || STDC_HEADERS X#include /* For ptrdiff_t, wchar_t, size_t */ X#endif X#ifdef HAVE_SYS_TYPES_H X#include X#endif Xmain() X{ X FILE *f=fopen("conftestval", "w"); X if (!f) exit(1); X fprintf(f, "%d\n", sizeof(__int64)); X exit(0); X} XEOF Xif { eval echo configure:8460: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_sizeof___int64=`cat conftestval` Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_sizeof___int64=0 Xfi Xrm -fr conftest* Xfi X Xfi Xeval echo "$ac_t""$ac_cv_sizeof___int64" 1>&6 Xcat >> confdefs.h <&6 Xecho "configure:8480: checking size of char *" >&5 Xif eval "test \"`echo '$''{'ac_cv_sizeof_char_p'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext < X#if HAVE_STDDEF_H || STDC_HEADERS X#include /* For ptrdiff_t, wchar_t, size_t */ X#endif X#ifdef HAVE_SYS_TYPES_H X#include X#endif Xmain() X{ X FILE *f=fopen("conftestval", "w"); X if (!f) exit(1); X fprintf(f, "%d\n", sizeof(char *)); X exit(0); X} XEOF Xif { eval echo configure:8505: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_sizeof_char_p=`cat conftestval` Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_sizeof_char_p=0 Xfi Xrm -fr conftest* Xfi X Xfi Xeval echo "$ac_t""$ac_cv_sizeof_char_p" 1>&6 Xcat >> confdefs.h <&6 Xecho "configure:8526: checking size of unsigned char" >&5 Xif eval "test \"`echo '$''{'ac_cv_sizeof_unsigned_char'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext < X#if HAVE_STDDEF_H || STDC_HEADERS X#include /* For ptrdiff_t, wchar_t, size_t */ X#endif X#ifdef HAVE_SYS_TYPES_H X#include X#endif Xmain() X{ X FILE *f=fopen("conftestval", "w"); X if (!f) exit(1); X fprintf(f, "%d\n", sizeof(unsigned char)); X exit(0); X} XEOF Xif { eval echo configure:8551: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_sizeof_unsigned_char=`cat conftestval` Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_sizeof_unsigned_char=0 Xfi Xrm -fr conftest* Xfi X Xfi Xeval echo "$ac_t""$ac_cv_sizeof_unsigned_char" 1>&6 Xcat >> confdefs.h <&6 Xecho "configure:8571: checking size of unsigned short int" >&5 Xif eval "test \"`echo '$''{'ac_cv_sizeof_unsigned_short_int'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext < X#if HAVE_STDDEF_H || STDC_HEADERS X#include /* For ptrdiff_t, wchar_t, size_t */ X#endif X#ifdef HAVE_SYS_TYPES_H X#include X#endif Xmain() X{ X FILE *f=fopen("conftestval", "w"); X if (!f) exit(1); X fprintf(f, "%d\n", sizeof(unsigned short int)); X exit(0); X} XEOF Xif { eval echo configure:8596: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_sizeof_unsigned_short_int=`cat conftestval` Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_sizeof_unsigned_short_int=0 Xfi Xrm -fr conftest* Xfi X Xfi Xeval echo "$ac_t""$ac_cv_sizeof_unsigned_short_int" 1>&6 Xcat >> confdefs.h <&6 Xecho "configure:8616: checking size of unsigned int" >&5 Xif eval "test \"`echo '$''{'ac_cv_sizeof_unsigned_int'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext < X#if HAVE_STDDEF_H || STDC_HEADERS X#include /* For ptrdiff_t, wchar_t, size_t */ X#endif X#ifdef HAVE_SYS_TYPES_H X#include X#endif Xmain() X{ X FILE *f=fopen("conftestval", "w"); X if (!f) exit(1); X fprintf(f, "%d\n", sizeof(unsigned int)); X exit(0); X} XEOF Xif { eval echo configure:8641: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_sizeof_unsigned_int=`cat conftestval` Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_sizeof_unsigned_int=0 Xfi Xrm -fr conftest* Xfi X Xfi Xeval echo "$ac_t""$ac_cv_sizeof_unsigned_int" 1>&6 Xcat >> confdefs.h <&6 Xecho "configure:8661: checking size of unsigned long int" >&5 Xif eval "test \"`echo '$''{'ac_cv_sizeof_unsigned_long_int'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext < X#if HAVE_STDDEF_H || STDC_HEADERS X#include /* For ptrdiff_t, wchar_t, size_t */ X#endif X#ifdef HAVE_SYS_TYPES_H X#include X#endif Xmain() X{ X FILE *f=fopen("conftestval", "w"); X if (!f) exit(1); X fprintf(f, "%d\n", sizeof(unsigned long int)); X exit(0); X} XEOF Xif { eval echo configure:8686: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_sizeof_unsigned_long_int=`cat conftestval` Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_sizeof_unsigned_long_int=0 Xfi Xrm -fr conftest* Xfi X Xfi Xeval echo "$ac_t""$ac_cv_sizeof_unsigned_long_int" 1>&6 Xcat >> confdefs.h <&6 Xecho "configure:8706: checking size of unsigned long long" >&5 Xif eval "test \"`echo '$''{'ac_cv_sizeof_unsigned_long_long'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext < X#if HAVE_STDDEF_H || STDC_HEADERS X#include /* For ptrdiff_t, wchar_t, size_t */ X#endif X#ifdef HAVE_SYS_TYPES_H X#include X#endif Xmain() X{ X FILE *f=fopen("conftestval", "w"); X if (!f) exit(1); X fprintf(f, "%d\n", sizeof(unsigned long long)); X exit(0); X} XEOF Xif { eval echo configure:8731: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_sizeof_unsigned_long_long=`cat conftestval` Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_sizeof_unsigned_long_long=0 Xfi Xrm -fr conftest* Xfi X Xfi Xeval echo "$ac_t""$ac_cv_sizeof_unsigned_long_long" 1>&6 Xcat >> confdefs.h <&6 Xecho "configure:8751: checking size of unsigned __int64" >&5 Xif eval "test \"`echo '$''{'ac_cv_sizeof_unsigned___int64'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext < X#if HAVE_STDDEF_H || STDC_HEADERS X#include /* For ptrdiff_t, wchar_t, size_t */ X#endif X#ifdef HAVE_SYS_TYPES_H X#include X#endif Xmain() X{ X FILE *f=fopen("conftestval", "w"); X if (!f) exit(1); X fprintf(f, "%d\n", sizeof(unsigned __int64)); X exit(0); X} XEOF Xif { eval echo configure:8776: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_sizeof_unsigned___int64=`cat conftestval` Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_sizeof_unsigned___int64=0 Xfi Xrm -fr conftest* Xfi X Xfi Xeval echo "$ac_t""$ac_cv_sizeof_unsigned___int64" 1>&6 Xcat >> confdefs.h <&6 Xecho "configure:8796: checking size of unsigned char *" >&5 Xif eval "test \"`echo '$''{'ac_cv_sizeof_unsigned_char_p'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext < X#if HAVE_STDDEF_H || STDC_HEADERS X#include /* For ptrdiff_t, wchar_t, size_t */ X#endif X#ifdef HAVE_SYS_TYPES_H X#include X#endif Xmain() X{ X FILE *f=fopen("conftestval", "w"); X if (!f) exit(1); X fprintf(f, "%d\n", sizeof(unsigned char *)); X exit(0); X} XEOF Xif { eval echo configure:8821: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_sizeof_unsigned_char_p=`cat conftestval` Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_sizeof_unsigned_char_p=0 Xfi Xrm -fr conftest* Xfi X Xfi Xeval echo "$ac_t""$ac_cv_sizeof_unsigned_char_p" 1>&6 Xcat >> confdefs.h <&6 Xecho "configure:8841: checking size of float" >&5 Xif eval "test \"`echo '$''{'ac_cv_sizeof_float'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext < X#if HAVE_STDDEF_H || STDC_HEADERS X#include /* For ptrdiff_t, wchar_t, size_t */ X#endif X#ifdef HAVE_SYS_TYPES_H X#include X#endif Xmain() X{ X FILE *f=fopen("conftestval", "w"); X if (!f) exit(1); X fprintf(f, "%d\n", sizeof(float)); X exit(0); X} XEOF Xif { eval echo configure:8866: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_sizeof_float=`cat conftestval` Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_sizeof_float=0 Xfi Xrm -fr conftest* Xfi X Xfi Xeval echo "$ac_t""$ac_cv_sizeof_float" 1>&6 Xcat >> confdefs.h <&6 Xecho "configure:8886: checking size of double" >&5 Xif eval "test \"`echo '$''{'ac_cv_sizeof_double'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext < X#if HAVE_STDDEF_H || STDC_HEADERS X#include /* For ptrdiff_t, wchar_t, size_t */ X#endif X#ifdef HAVE_SYS_TYPES_H X#include X#endif Xmain() X{ X FILE *f=fopen("conftestval", "w"); X if (!f) exit(1); X fprintf(f, "%d\n", sizeof(double)); X exit(0); X} XEOF Xif { eval echo configure:8911: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_sizeof_double=`cat conftestval` Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_sizeof_double=0 Xfi Xrm -fr conftest* Xfi X Xfi Xeval echo "$ac_t""$ac_cv_sizeof_double" 1>&6 Xcat >> confdefs.h <&6 Xecho "configure:8931: checking size of long double" >&5 Xif eval "test \"`echo '$''{'ac_cv_sizeof_long_double'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext < X#if HAVE_STDDEF_H || STDC_HEADERS X#include /* For ptrdiff_t, wchar_t, size_t */ X#endif X#ifdef HAVE_SYS_TYPES_H X#include X#endif Xmain() X{ X FILE *f=fopen("conftestval", "w"); X if (!f) exit(1); X fprintf(f, "%d\n", sizeof(long double)); X exit(0); X} XEOF Xif { eval echo configure:8956: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_sizeof_long_double=`cat conftestval` Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_sizeof_long_double=0 Xfi Xrm -fr conftest* Xfi X Xfi Xeval echo "$ac_t""$ac_cv_sizeof_long_double" 1>&6 Xcat >> confdefs.h <&6 Xecho "configure:8977: checking size of size_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_sizeof_size_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext < X#if HAVE_STDDEF_H || STDC_HEADERS X#include /* For ptrdiff_t, wchar_t, size_t */ X#endif X#ifdef HAVE_SYS_TYPES_H X#include X#endif Xmain() X{ X FILE *f=fopen("conftestval", "w"); X if (!f) exit(1); X fprintf(f, "%d\n", sizeof(size_t)); X exit(0); X} XEOF Xif { eval echo configure:9002: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_sizeof_size_t=`cat conftestval` Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_sizeof_size_t=0 Xfi Xrm -fr conftest* Xfi X Xfi Xeval echo "$ac_t""$ac_cv_sizeof_size_t" 1>&6 Xcat >> confdefs.h <&6 Xecho "configure:9022: checking size of ssize_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_sizeof_ssize_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext < X#if HAVE_STDDEF_H || STDC_HEADERS X#include /* For ptrdiff_t, wchar_t, size_t */ X#endif X#ifdef HAVE_SYS_TYPES_H X#include X#endif Xmain() X{ X FILE *f=fopen("conftestval", "w"); X if (!f) exit(1); X fprintf(f, "%d\n", sizeof(ssize_t)); X exit(0); X} XEOF Xif { eval echo configure:9047: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_sizeof_ssize_t=`cat conftestval` Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_sizeof_ssize_t=0 Xfi Xrm -fr conftest* Xfi X Xfi Xeval echo "$ac_t""$ac_cv_sizeof_ssize_t" 1>&6 Xcat >> confdefs.h <&6 Xecho "configure:9067: checking size of ptrdiff_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_sizeof_ptrdiff_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext < X#if HAVE_STDDEF_H || STDC_HEADERS X#include /* For ptrdiff_t, wchar_t, size_t */ X#endif X#ifdef HAVE_SYS_TYPES_H X#include X#endif Xmain() X{ X FILE *f=fopen("conftestval", "w"); X if (!f) exit(1); X fprintf(f, "%d\n", sizeof(ptrdiff_t)); X exit(0); X} XEOF Xif { eval echo configure:9092: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_sizeof_ptrdiff_t=`cat conftestval` Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_sizeof_ptrdiff_t=0 Xfi Xrm -fr conftest* Xfi X Xfi Xeval echo "$ac_t""$ac_cv_sizeof_ptrdiff_t" 1>&6 Xcat >> confdefs.h <&6 Xecho "configure:9113: checking size of mode_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_sizeof_mode_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext < X#if HAVE_STDDEF_H || STDC_HEADERS X#include /* For ptrdiff_t, wchar_t, size_t */ X#endif X#ifdef HAVE_SYS_TYPES_H X#include X#endif Xmain() X{ X FILE *f=fopen("conftestval", "w"); X if (!f) exit(1); X fprintf(f, "%d\n", sizeof(mode_t)); X exit(0); X} XEOF Xif { eval echo configure:9138: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_sizeof_mode_t=`cat conftestval` Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_sizeof_mode_t=0 Xfi Xrm -fr conftest* Xfi X Xfi Xeval echo "$ac_t""$ac_cv_sizeof_mode_t" 1>&6 Xcat >> confdefs.h <&6 Xecho "configure:9158: checking size of uid_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_sizeof_uid_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext < X#if HAVE_STDDEF_H || STDC_HEADERS X#include /* For ptrdiff_t, wchar_t, size_t */ X#endif X#ifdef HAVE_SYS_TYPES_H X#include X#endif Xmain() X{ X FILE *f=fopen("conftestval", "w"); X if (!f) exit(1); X fprintf(f, "%d\n", sizeof(uid_t)); X exit(0); X} XEOF Xif { eval echo configure:9183: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_sizeof_uid_t=`cat conftestval` Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_sizeof_uid_t=0 Xfi Xrm -fr conftest* Xfi X Xfi Xeval echo "$ac_t""$ac_cv_sizeof_uid_t" 1>&6 Xcat >> confdefs.h <&6 Xecho "configure:9203: checking size of gid_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_sizeof_gid_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext < X#if HAVE_STDDEF_H || STDC_HEADERS X#include /* For ptrdiff_t, wchar_t, size_t */ X#endif X#ifdef HAVE_SYS_TYPES_H X#include X#endif Xmain() X{ X FILE *f=fopen("conftestval", "w"); X if (!f) exit(1); X fprintf(f, "%d\n", sizeof(gid_t)); X exit(0); X} XEOF Xif { eval echo configure:9228: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_sizeof_gid_t=`cat conftestval` Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_sizeof_gid_t=0 Xfi Xrm -fr conftest* Xfi X Xfi Xeval echo "$ac_t""$ac_cv_sizeof_gid_t" 1>&6 Xcat >> confdefs.h <&6 Xecho "configure:9248: checking size of pid_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_sizeof_pid_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext < X#if HAVE_STDDEF_H || STDC_HEADERS X#include /* For ptrdiff_t, wchar_t, size_t */ X#endif X#ifdef HAVE_SYS_TYPES_H X#include X#endif Xmain() X{ X FILE *f=fopen("conftestval", "w"); X if (!f) exit(1); X fprintf(f, "%d\n", sizeof(pid_t)); X exit(0); X} XEOF Xif { eval echo configure:9273: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_sizeof_pid_t=`cat conftestval` Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_sizeof_pid_t=0 Xfi Xrm -fr conftest* Xfi X Xfi Xeval echo "$ac_t""$ac_cv_sizeof_pid_t" 1>&6 Xcat >> confdefs.h <&6 Xecho "configure:9294: checking size of dev_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_sizeof_dev_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext < X#if HAVE_STDDEF_H || STDC_HEADERS X#include /* For ptrdiff_t, wchar_t, size_t */ X#endif X#ifdef HAVE_SYS_TYPES_H X#include X#endif Xmain() X{ X FILE *f=fopen("conftestval", "w"); X if (!f) exit(1); X fprintf(f, "%d\n", sizeof(dev_t)); X exit(0); X} XEOF Xif { eval echo configure:9319: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_sizeof_dev_t=`cat conftestval` Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_sizeof_dev_t=0 Xfi Xrm -fr conftest* Xfi X Xfi Xeval echo "$ac_t""$ac_cv_sizeof_dev_t" 1>&6 Xcat >> confdefs.h <&6 Xecho "configure:9339: checking size of major_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_sizeof_major_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext < X#if HAVE_STDDEF_H || STDC_HEADERS X#include /* For ptrdiff_t, wchar_t, size_t */ X#endif X#ifdef HAVE_SYS_TYPES_H X#include X#endif Xmain() X{ X FILE *f=fopen("conftestval", "w"); X if (!f) exit(1); X fprintf(f, "%d\n", sizeof(major_t)); X exit(0); X} XEOF Xif { eval echo configure:9364: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_sizeof_major_t=`cat conftestval` Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_sizeof_major_t=0 Xfi Xrm -fr conftest* Xfi X Xfi Xeval echo "$ac_t""$ac_cv_sizeof_major_t" 1>&6 Xcat >> confdefs.h <&6 Xecho "configure:9384: checking size of minor_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_sizeof_minor_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext < X#if HAVE_STDDEF_H || STDC_HEADERS X#include /* For ptrdiff_t, wchar_t, size_t */ X#endif X#ifdef HAVE_SYS_TYPES_H X#include X#endif Xmain() X{ X FILE *f=fopen("conftestval", "w"); X if (!f) exit(1); X fprintf(f, "%d\n", sizeof(minor_t)); X exit(0); X} XEOF Xif { eval echo configure:9409: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_sizeof_minor_t=`cat conftestval` Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_sizeof_minor_t=0 Xfi Xrm -fr conftest* Xfi X Xfi Xeval echo "$ac_t""$ac_cv_sizeof_minor_t" 1>&6 Xcat >> confdefs.h <&6 Xecho "configure:9430: checking size of time_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_sizeof_time_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext < X#include X#ifdef TIME_WITH_SYS_TIME_H X# include X# include X#else X#ifdef HAVE_SYS_TIME_H X# include X#else X# include X#endif X#endif Xmain() X{ X FILE *f=fopen("conftestval", "w"); X if (!f) exit(1); X fprintf(f, "%d\n", sizeof(time_t)); X exit(0); X} XEOF Xif { eval echo configure:9460: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_sizeof_time_t=`cat conftestval` Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_sizeof_time_t=SIZEOF_LONG_INT Xfi Xrm -fr conftest* Xfi X Xfi Xeval echo "$ac_t""$ac_cv_sizeof_time_t" 1>&6 Xcat >> confdefs.h <&6 Xecho "configure:9480: checking size of wchar" >&5 Xif eval "test \"`echo '$''{'ac_cv_sizeof_wchar'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext < Xmain() X{ X FILE *f=fopen("conftestval", "w"); X if (!f) exit(1); X fprintf(f, "%d\n", sizeof(L'a')); X exit(0); X} XEOF Xif { eval echo configure:9499: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_sizeof_wchar=`cat conftestval` Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_sizeof_wchar=0 Xfi Xrm -fr conftest* Xfi X Xfi Xeval echo "$ac_t""$ac_cv_sizeof_wchar" 1>&6 Xcat >> confdefs.h <&6 Xecho "configure:9519: checking size of wchar_t" >&5 Xif eval "test \"`echo '$''{'ac_cv_sizeof_wchar_t'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext < X#ifdef HAVE_SYS_TYPES_H X#include X#endif X#ifdef HAVE_STDLIB_H X#include X#endif X#ifdef HAVE_WCHAR_H X#include X#endif Xmain() X{ X FILE *f=fopen("conftestval", "w"); X if (!f) exit(1); X fprintf(f, "%d\n", sizeof(wchar_t)); X exit(0); X} XEOF Xif { eval echo configure:9547: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_sizeof_wchar_t=`cat conftestval` Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_sizeof_wchar_t=SIZEOF_CHAR Xfi Xrm -fr conftest* Xfi X Xfi Xeval echo "$ac_t""$ac_cv_sizeof_wchar_t" 1>&6 Xcat >> confdefs.h <&6 Xecho "configure:9568: checking if char is unsigned" >&5 Xif eval "test \"`echo '$''{'ac_cv_type_char_unsigned'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X ac_cv_type_char_unsigned=no Xelse X cat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_type_char_unsigned=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_type_char_unsigned=no Xfi Xrm -fr conftest* Xfi X Xfi X Xeval echo "$ac_t""$ac_cv_type_char_unsigned" 1>&6 Xif test $ac_cv_type_char_unsigned = yes; then X cat >> confdefs.h <<\EOF X#define CHAR_IS_UNSIGNED 1 XEOF X Xfi Xecho $ac_n "checking if va_list is an array""... $ac_c" 1>&6 Xecho "configure:9609: checking if va_list is an array" >&5 Xif eval "test \"`echo '$''{'ac_cv_type_va_list_array'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#else X# include X#endif X Xint main() { X Xva_list a, b; X Xa = b; X; return 0; } XEOF Xif { eval echo configure:9630: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X ac_cv_type_va_list_array=no Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_type_va_list_array=yes Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_type_va_list_array" 1>&6 Xif test $ac_cv_type_va_list_array = yes; then X cat >> confdefs.h <<\EOF X#define VA_LIST_IS_ARRAY 1 XEOF X Xfi Xecho $ac_n "checking for f->_flags in FILE *""... $ac_c" 1>&6 Xecho "configure:9650: checking for f->_flags in FILE *" >&5 Xif eval "test \"`echo '$''{'ac_cv_file__flags'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < Xint main() { XFILE *f; Xint flags; Xf = fopen("confdefs.h", "r"); Xflags = f->_flags; Xfclose(f); X; return 0; } XEOF Xif { eval echo configure:9666: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X ac_cv_file__flags=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_file__flags=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_file__flags" 1>&6 Xif test $ac_cv_file__flags = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_FILE__FLAGS 1 XEOF X Xfi Xecho $ac_n "checking for f->_IO_buf_base in FILE *""... $ac_c" 1>&6 Xecho "configure:9686: checking for f->_IO_buf_base in FILE *" >&5 Xif eval "test \"`echo '$''{'ac_cv_file__io_buf_base'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < Xint main() { XFILE *f; Xchar *ptr; Xf = fopen("confdefs.h", "r"); Xptr = f->_IO_buf_base; Xfclose(f); X; return 0; } XEOF Xif { eval echo configure:9702: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X ac_cv_file__io_buf_base=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_file__io_buf_base=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_file__io_buf_base" 1>&6 Xif test $ac_cv_file__io_buf_base = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_FILE__IO_BUF_BASE 1 XEOF X Xfi Xecho $ac_n "checking for struct timeval in time.h or sys/time.h""... $ac_c" 1>&6 Xecho "configure:9722: checking for struct timeval in time.h or sys/time.h" >&5 Xif eval "test \"`echo '$''{'ac_cv_struct_timeval'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#ifdef TIME_WITH_SYS_TIME_H X# include X# include X#else X#ifdef HAVE_SYS_TIME_H X# include X#else X# include X#endif X#endif Xint main() { Xstruct timeval tv; X; return 0; } XEOF Xif { eval echo configure:9745: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_struct_timeval=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_struct_timeval=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_struct_timeval" 1>&6 Xif test $ac_cv_struct_timeval = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_STRUCT_TIMEVAL 1 XEOF X Xfi Xecho $ac_n "checking for struct timezone in time.h or sys/time.h""... $ac_c" 1>&6 Xecho "configure:9765: checking for struct timezone in time.h or sys/time.h" >&5 Xif eval "test \"`echo '$''{'ac_cv_struct_timezone'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#ifdef TIME_WITH_SYS_TIME_H X# include X# include X#else X#ifdef HAVE_SYS_TIME_H X# include X#else X# include X#endif X#endif Xint main() { Xstruct timezone tz; X; return 0; } XEOF Xif { eval echo configure:9788: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_struct_timezone=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_struct_timezone=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_struct_timezone" 1>&6 Xif test $ac_cv_struct_timezone = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_STRUCT_TIMEZONE 1 XEOF X Xfi Xecho $ac_n "checking for struct timespec in time.h or sys/time.h""... $ac_c" 1>&6 Xecho "configure:9808: checking for struct timespec in time.h or sys/time.h" >&5 Xif eval "test \"`echo '$''{'ac_cv_struct_timespec'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#ifdef TIME_WITH_SYS_TIME_H X# include X# include X#else X#ifdef HAVE_SYS_TIME_H X# include X#else X# include X#endif X#endif Xint main() { Xstruct timespec ts; X; return 0; } XEOF Xif { eval echo configure:9831: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_struct_timespec=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_struct_timespec=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_struct_timespec" 1>&6 Xif test $ac_cv_struct_timespec = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_STRUCT_TIMESPEC 1 XEOF X Xfi Xecho $ac_n "checking if struct mtget contains mt_type""... $ac_c" 1>&6 Xecho "configure:9851: checking if struct mtget contains mt_type" >&5 Xif eval "test \"`echo '$''{'ac_cv_struct_mtget_type'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#include Xint main() { Xstruct mtget t; t.mt_type = 0; X; return 0; } XEOF Xif { eval echo configure:9864: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_struct_mtget_type=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_struct_mtget_type=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_struct_mtget_type" 1>&6 Xif test $ac_cv_struct_mtget_type = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_MTGET_TYPE 1 XEOF X Xfi Xecho $ac_n "checking if struct mtget contains mt_model""... $ac_c" 1>&6 Xecho "configure:9884: checking if struct mtget contains mt_model" >&5 Xif eval "test \"`echo '$''{'ac_cv_struct_mtget_model'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#include Xint main() { Xstruct mtget t; t.mt_model = 0; X; return 0; } XEOF Xif { eval echo configure:9897: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_struct_mtget_model=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_struct_mtget_model=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_struct_mtget_model" 1>&6 Xif test $ac_cv_struct_mtget_model = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_MTGET_MODEL 1 XEOF X Xfi Xecho $ac_n "checking if struct mtget contains mt_dsreg""... $ac_c" 1>&6 Xecho "configure:9917: checking if struct mtget contains mt_dsreg" >&5 Xif eval "test \"`echo '$''{'ac_cv_struct_mtget_dsreg'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#include Xint main() { Xstruct mtget t; t.mt_dsreg = 0; X; return 0; } XEOF Xif { eval echo configure:9930: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_struct_mtget_dsreg=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_struct_mtget_dsreg=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_struct_mtget_dsreg" 1>&6 Xif test $ac_cv_struct_mtget_dsreg = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_MTGET_DSREG 1 XEOF X Xfi Xecho $ac_n "checking if struct mtget contains mt_dsreg1""... $ac_c" 1>&6 Xecho "configure:9950: checking if struct mtget contains mt_dsreg1" >&5 Xif eval "test \"`echo '$''{'ac_cv_struct_mtget_dsreg1'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#include Xint main() { Xstruct mtget t; t.mt_dsreg1 = 0; X; return 0; } XEOF Xif { eval echo configure:9963: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_struct_mtget_dsreg1=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_struct_mtget_dsreg1=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_struct_mtget_dsreg1" 1>&6 Xif test $ac_cv_struct_mtget_dsreg1 = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_MTGET_DSREG1 1 XEOF X Xfi Xecho $ac_n "checking if struct mtget contains mt_dsreg2""... $ac_c" 1>&6 Xecho "configure:9983: checking if struct mtget contains mt_dsreg2" >&5 Xif eval "test \"`echo '$''{'ac_cv_struct_mtget_dsreg2'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#include Xint main() { Xstruct mtget t; t.mt_dsreg2 = 0; X; return 0; } XEOF Xif { eval echo configure:9996: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_struct_mtget_dsreg2=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_struct_mtget_dsreg2=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_struct_mtget_dsreg2" 1>&6 Xif test $ac_cv_struct_mtget_dsreg2 = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_MTGET_DSREG2 1 XEOF X Xfi Xecho $ac_n "checking if struct mtget contains mt_gstat""... $ac_c" 1>&6 Xecho "configure:10016: checking if struct mtget contains mt_gstat" >&5 Xif eval "test \"`echo '$''{'ac_cv_struct_mtget_gstat'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#include Xint main() { Xstruct mtget t; t.mt_gstat = 0; X; return 0; } XEOF Xif { eval echo configure:10029: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_struct_mtget_gstat=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_struct_mtget_gstat=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_struct_mtget_gstat" 1>&6 Xif test $ac_cv_struct_mtget_gstat = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_MTGET_GSTAT 1 XEOF X Xfi Xecho $ac_n "checking if struct mtget contains mt_erreg""... $ac_c" 1>&6 Xecho "configure:10049: checking if struct mtget contains mt_erreg" >&5 Xif eval "test \"`echo '$''{'ac_cv_struct_mtget_erreg'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#include Xint main() { Xstruct mtget t; t.mt_erreg = 0; X; return 0; } XEOF Xif { eval echo configure:10062: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_struct_mtget_erreg=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_struct_mtget_erreg=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_struct_mtget_erreg" 1>&6 Xif test $ac_cv_struct_mtget_erreg = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_MTGET_ERREG 1 XEOF X Xfi Xecho $ac_n "checking if struct mtget contains mt_resid""... $ac_c" 1>&6 Xecho "configure:10082: checking if struct mtget contains mt_resid" >&5 Xif eval "test \"`echo '$''{'ac_cv_struct_mtget_resid'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#include Xint main() { Xstruct mtget t; t.mt_resid = 0; X; return 0; } XEOF Xif { eval echo configure:10095: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_struct_mtget_resid=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_struct_mtget_resid=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_struct_mtget_resid" 1>&6 Xif test $ac_cv_struct_mtget_resid = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_MTGET_RESID 1 XEOF X Xfi Xecho $ac_n "checking if struct mtget contains mt_fileno""... $ac_c" 1>&6 Xecho "configure:10115: checking if struct mtget contains mt_fileno" >&5 Xif eval "test \"`echo '$''{'ac_cv_struct_mtget_fileno'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#include Xint main() { Xstruct mtget t; t.mt_fileno = 0; X; return 0; } XEOF Xif { eval echo configure:10128: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_struct_mtget_fileno=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_struct_mtget_fileno=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_struct_mtget_fileno" 1>&6 Xif test $ac_cv_struct_mtget_fileno = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_MTGET_FILENO 1 XEOF X Xfi Xecho $ac_n "checking if struct mtget contains mt_blkno""... $ac_c" 1>&6 Xecho "configure:10148: checking if struct mtget contains mt_blkno" >&5 Xif eval "test \"`echo '$''{'ac_cv_struct_mtget_blkno'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#include Xint main() { Xstruct mtget t; t.mt_blkno = 0; X; return 0; } XEOF Xif { eval echo configure:10161: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_struct_mtget_blkno=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_struct_mtget_blkno=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_struct_mtget_blkno" 1>&6 Xif test $ac_cv_struct_mtget_blkno = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_MTGET_BLKNO 1 XEOF X Xfi Xecho $ac_n "checking if struct mtget contains mt_flags""... $ac_c" 1>&6 Xecho "configure:10181: checking if struct mtget contains mt_flags" >&5 Xif eval "test \"`echo '$''{'ac_cv_struct_mtget_flags'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#include Xint main() { Xstruct mtget t; t.mt_flags = 0; X; return 0; } XEOF Xif { eval echo configure:10194: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_struct_mtget_flags=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_struct_mtget_flags=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_struct_mtget_flags" 1>&6 Xif test $ac_cv_struct_mtget_flags = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_MTGET_FLAGS 1 XEOF X Xfi Xecho $ac_n "checking if struct mtget contains mt_bf""... $ac_c" 1>&6 Xecho "configure:10214: checking if struct mtget contains mt_bf" >&5 Xif eval "test \"`echo '$''{'ac_cv_struct_mtget_bf'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#include Xint main() { Xstruct mtget t; t.mt_bf = 0; X; return 0; } XEOF Xif { eval echo configure:10227: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_struct_mtget_bf=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_struct_mtget_bf=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_struct_mtget_bf" 1>&6 Xif test $ac_cv_struct_mtget_bf = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_MTGET_BF 1 XEOF X Xfi Xecho $ac_n "checking if struct rusage is declared in sys/resource.h""... $ac_c" 1>&6 Xecho "configure:10247: checking if struct rusage is declared in sys/resource.h" >&5 Xif eval "test \"`echo '$''{'ac_cv_struct_rusage'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#include Xint main() { Xstruct rusage r; X; return 0; } XEOF Xif { eval echo configure:10260: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_struct_rusage=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_struct_rusage=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_struct_rusage" 1>&6 Xif test $ac_cv_struct_rusage = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_STRUCT_RUSAGE 1 XEOF X Xfi Xecho $ac_n "checking if struct siginfo contains si_utime""... $ac_c" 1>&6 Xecho "configure:10280: checking if struct siginfo contains si_utime" >&5 Xif eval "test \"`echo '$''{'ac_cv_struct_si_utime'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#include Xint main() { Xstruct siginfo si; si.si_utime = 0; X; return 0; } XEOF Xif { eval echo configure:10293: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_struct_si_utime=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_struct_si_utime=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_struct_si_utime" 1>&6 Xif test $ac_cv_struct_si_utime = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_SI_UTIME 1 XEOF X Xfi Xecho $ac_n "checking if struct sockaddr_storage is declared in socket.h""... $ac_c" 1>&6 Xecho "configure:10313: checking if struct sockaddr_storage is declared in socket.h" >&5 Xif eval "test \"`echo '$''{'ac_cv_struct_sockaddr_storage'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < Xint main() { Xstruct sockaddr_storage ss; ss.ss_family = 0; exit (ss.ss_family == 0); X; return 0; } XEOF Xif { eval echo configure:10325: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_struct_sockaddr_storage=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_struct_sockaddr_storage=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_struct_sockaddr_storage" 1>&6 Xif test $ac_cv_struct_sockaddr_storage = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_SOCKADDR_STORAGE 1 XEOF X Xfi Xecho $ac_n "checking if an illegal declaration for union semun in sys/sem.h exists""... $ac_c" 1>&6 Xecho "configure:10345: checking if an illegal declaration for union semun in sys/sem.h exists" >&5 Xif eval "test \"`echo '$''{'ac_cv_struct_union_semun'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#include X#include Xint main() { Xunion semun s; X; return 0; } XEOF Xif { eval echo configure:10359: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_struct_union_semun=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_struct_union_semun=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_struct_union_semun" 1>&6 Xif test $ac_cv_struct_union_semun = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_UNION_SEMUN 1 XEOF X Xfi Xecho $ac_n "checking if union wait is declared in wait.h or sys/wait.h""... $ac_c" 1>&6 Xecho "configure:10379: checking if union wait is declared in wait.h or sys/wait.h" >&5 Xif eval "test \"`echo '$''{'ac_cv_struct_union_wait'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#if defined(HAVE_WAIT_H) X# include X#else X#include X#endif Xint main() { Xunion wait w; X; return 0; } XEOF Xif { eval echo configure:10396: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_struct_union_wait=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_struct_union_wait=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_struct_union_wait" 1>&6 Xif test $ac_cv_struct_union_wait = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_UNION_WAIT 1 XEOF X Xfi Xecho $ac_n "checking if union wait is used by default""... $ac_c" 1>&6 Xecho "configure:10416: checking if union wait is used by default" >&5 Xif eval "test \"`echo '$''{'ac_cv_use_union_wait'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#if defined(HAVE_WAIT_H) X# include X#else X#include X#endif Xxxzzy WTERMSIG(status) Xxxzzy WCOREDUMP(status) Xxxzzy WEXITSTATUS(status) Xxxzzy WSTOPSIG(status) Xxxzzy WIFSTOPPED(status) Xxxzzy WIFSIGNALED(status) Xxxzzy WIFEXITED(status) XEOF Xif (eval "$ac_cpp conftest.$ac_ext") 2>&5 | X egrep "xxzzy.*x_|xxzzy.*union" >/dev/null 2>&1; then X rm -rf conftest* X ac_cv_use_union_wait=yes Xelse X rm -rf conftest* X ac_cv_use_union_wait=no Xfi Xrm -f conftest* X Xfi Xeval echo "$ac_t""$ac_cv_use_union_wait" 1>&6 Xif test $ac_cv_use_union_wait = yes; then X cat >> confdefs.h <<\EOF X#define USE_UNION_WAIT 1 XEOF X Xfi Xecho $ac_n "checking if struct stat contains st_spare1""... $ac_c" 1>&6 Xecho "configure:10456: checking if struct stat contains st_spare1" >&5 Xif eval "test \"`echo '$''{'ac_cv_struct_st_spare1'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#include Xint main() { Xstruct stat s; s.st_spare1 = 0; X; return 0; } XEOF Xif { eval echo configure:10469: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_struct_st_spare1=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_struct_st_spare1=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_struct_st_spare1" 1>&6 Xif test $ac_cv_struct_st_spare1 = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_ST_SPARE1 1 XEOF X Xfi Xecho $ac_n "checking if struct stat contains st_atimensec""... $ac_c" 1>&6 Xecho "configure:10489: checking if struct stat contains st_atimensec" >&5 Xif eval "test \"`echo '$''{'ac_cv_struct_st_atimensec'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#include Xint main() { Xstruct stat s; s.st_atimensec = 0; X; return 0; } XEOF Xif { eval echo configure:10502: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_struct_st_atimensec=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_struct_st_atimensec=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_struct_st_atimensec" 1>&6 Xif test $ac_cv_struct_st_atimensec = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_ST_ATIMENSEC 1 XEOF X Xfi Xecho $ac_n "checking if struct stat contains st_atime_n""... $ac_c" 1>&6 Xecho "configure:10522: checking if struct stat contains st_atime_n" >&5 Xif eval "test \"`echo '$''{'ac_cv_struct_st_atime_n'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#include Xint main() { Xstruct stat s; s.st_atime_n = 0; X; return 0; } XEOF Xif { eval echo configure:10535: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_struct_st_atime_n=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_struct_st_atime_n=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_struct_st_atime_n" 1>&6 Xif test $ac_cv_struct_st_atime_n = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_ST_ATIME_N 1 XEOF X Xfi Xecho $ac_n "checking if struct stat contains st_atim.tv_nsec""... $ac_c" 1>&6 Xecho "configure:10555: checking if struct stat contains st_atim.tv_nsec" >&5 Xif eval "test \"`echo '$''{'ac_cv_struct_st_nsec'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#include Xint main() { Xstruct stat s; s.st_atim.tv_nsec = 0; X; return 0; } XEOF Xif { eval echo configure:10568: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_struct_st_nsec=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_struct_st_nsec=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_struct_st_nsec" 1>&6 Xif test $ac_cv_struct_st_nsec = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_ST_NSEC 1 XEOF X Xfi Xecho $ac_n "checking if struct stat contains st_atim.st__tim.tv_nsec""... $ac_c" 1>&6 Xecho "configure:10588: checking if struct stat contains st_atim.st__tim.tv_nsec" >&5 Xif eval "test \"`echo '$''{'ac_cv_struct_st__tim'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#include Xint main() { Xstruct stat s; s.st_atim.st__tim.tv_nsec = 0; X; return 0; } XEOF Xif { eval echo configure:10601: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_struct_st__tim=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_struct_st__tim=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_struct_st__tim" 1>&6 Xif test $ac_cv_struct_st__tim = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_ST__TIM 1 XEOF X Xfi Xecho $ac_n "checking if struct stat contains st_atimespec.tv_nsec""... $ac_c" 1>&6 Xecho "configure:10621: checking if struct stat contains st_atimespec.tv_nsec" >&5 Xif eval "test \"`echo '$''{'ac_cv_struct_st_atimespec'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#include Xint main() { Xstruct stat s; s.st_atimespec.tv_nsec = 0; X; return 0; } XEOF Xif { eval echo configure:10634: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_struct_st_atimespec=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_struct_st_atimespec=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_struct_st_atimespec" 1>&6 Xif test $ac_cv_struct_st_atimespec = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_ST_ATIMESPEC 1 XEOF X Xfi Xecho $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>&6 Xecho "configure:10654: checking for st_blksize in struct stat" >&5 Xif eval "test \"`echo '$''{'ac_cv_struct_st_blksize'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#include Xint main() { Xstruct stat s; s.st_blksize; X; return 0; } XEOF Xif { eval echo configure:10667: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_struct_st_blksize=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_struct_st_blksize=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_struct_st_blksize" 1>&6 Xif test $ac_cv_struct_st_blksize = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_ST_BLKSIZE 1 XEOF X Xfi X Xecho $ac_n "checking for st_blocks in struct stat""... $ac_c" 1>&6 Xecho "configure:10688: checking for st_blocks in struct stat" >&5 Xif eval "test \"`echo '$''{'ac_cv_struct_st_blocks'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#include Xint main() { Xstruct stat s; s.st_blocks; X; return 0; } XEOF Xif { eval echo configure:10701: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_struct_st_blocks=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_struct_st_blocks=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_struct_st_blocks" 1>&6 Xif test $ac_cv_struct_st_blocks = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_ST_BLOCKS 1 XEOF X Xelse X LIBOBJS="$LIBOBJS fileblocks.${ac_objext}" Xfi X Xecho $ac_n "checking if struct stat contains st_fstype""... $ac_c" 1>&6 Xecho "configure:10724: checking if struct stat contains st_fstype" >&5 Xif eval "test \"`echo '$''{'ac_cv_struct_st_fstype'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#include Xint main() { Xstruct stat s; s.st_fstype[0] = 0; X; return 0; } XEOF Xif { eval echo configure:10737: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_struct_st_fstype=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_struct_st_fstype=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_struct_st_fstype" 1>&6 Xif test $ac_cv_struct_st_fstype = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_ST_FSTYPE 1 XEOF X Xfi Xecho $ac_n "checking if struct stat contains st_aclcnt""... $ac_c" 1>&6 Xecho "configure:10757: checking if struct stat contains st_aclcnt" >&5 Xif eval "test \"`echo '$''{'ac_cv_struct_st_aclcnt'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#include Xint main() { Xstruct stat s; s.st_aclcnt = 0; X; return 0; } XEOF Xif { eval echo configure:10770: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_struct_st_aclcnt=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_struct_st_aclcnt=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_struct_st_aclcnt" 1>&6 Xif test $ac_cv_struct_st_aclcnt = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_ST_ACLCNT 1 XEOF X Xfi Xecho $ac_n "checking for st_rdev in struct stat""... $ac_c" 1>&6 Xecho "configure:10790: checking for st_rdev in struct stat" >&5 Xif eval "test \"`echo '$''{'ac_cv_struct_st_rdev'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#include Xint main() { Xstruct stat s; s.st_rdev; X; return 0; } XEOF Xif { eval echo configure:10803: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_struct_st_rdev=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_struct_st_rdev=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_struct_st_rdev" 1>&6 Xif test $ac_cv_struct_st_rdev = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_ST_RDEV 1 XEOF X Xfi X Xecho $ac_n "checking if struct stat contains st_flag""... $ac_c" 1>&6 Xecho "configure:10824: checking if struct stat contains st_flag" >&5 Xif eval "test \"`echo '$''{'ac_cv_struct_st_flag'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#include Xint main() { Xstruct stat s; s.st_flag = 0; X; return 0; } XEOF Xif { eval echo configure:10837: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_struct_st_flag=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_struct_st_flag=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_struct_st_flag" 1>&6 Xif test $ac_cv_struct_st_flag = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_ST_FLAG 1 XEOF X Xfi Xecho $ac_n "checking if struct stat contains st_flags""... $ac_c" 1>&6 Xecho "configure:10857: checking if struct stat contains st_flags" >&5 Xif eval "test \"`echo '$''{'ac_cv_struct_st_flags'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#include Xint main() { Xstruct stat s; s.st_flags = 0; X; return 0; } XEOF Xif { eval echo configure:10870: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_struct_st_flags=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_struct_st_flags=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_struct_st_flags" 1>&6 Xif test $ac_cv_struct_st_flags = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_ST_FLAGS 1 XEOF X Xfi Xecho $ac_n "checking if struct dirent contains d_ino""... $ac_c" 1>&6 Xecho "configure:10890: checking if struct dirent contains d_ino" >&5 Xif eval "test \"`echo '$''{'ac_cv_struct_dirent_d_ino'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#endif X#ifdef HAVE_SYS_STAT_H X# include X#endif X# ifdef HAVE_DIRENT_H /* This a POSIX compliant system */ X# include X# define _FOUND_DIR_ X# else /* This is a Pre POSIX system */ X X# define dirent direct X X# if defined(HAVE_SYS_DIR_H) X# include X# define _FOUND_DIR_ X# endif X X# if defined(HAVE_NDIR_H) && !defined(_FOUND_DIR_) X# include X# define _FOUND_DIR_ X# endif X X# if defined(HAVE_SYS_NDIR_H) && !defined(_FOUND_DIR_) X# include X# define _FOUND_DIR_ X# endif X# endif /* HAVE_DIRENT_H */ X Xint main() { Xstruct dirent d; d.d_ino = 0; X; return 0; } XEOF Xif { eval echo configure:10934: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_struct_dirent_d_ino=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_struct_dirent_d_ino=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_struct_dirent_d_ino" 1>&6 Xif test $ac_cv_struct_dirent_d_ino = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_DIRENT_D_INO 1 XEOF X Xfi Xecho $ac_n "checking if struct dirent contains d_type""... $ac_c" 1>&6 Xecho "configure:10954: checking if struct dirent contains d_type" >&5 Xif eval "test \"`echo '$''{'ac_cv_struct_dirent_d_type'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#endif X#ifdef HAVE_SYS_STAT_H X# include X#endif X# ifdef HAVE_DIRENT_H /* This a POSIX compliant system */ X# include X# define _FOUND_DIR_ X# else /* This is a Pre POSIX system */ X X# define dirent direct X X# if defined(HAVE_SYS_DIR_H) X# include X# define _FOUND_DIR_ X# endif X X# if defined(HAVE_NDIR_H) && !defined(_FOUND_DIR_) X# include X# define _FOUND_DIR_ X# endif X X# if defined(HAVE_SYS_NDIR_H) && !defined(_FOUND_DIR_) X# include X# define _FOUND_DIR_ X# endif X# endif /* HAVE_DIRENT_H */ X Xint main() { Xstruct dirent d; d.d_type = 0; X; return 0; } XEOF Xif { eval echo configure:10998: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_struct_dirent_d_type=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_struct_dirent_d_type=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_struct_dirent_d_type" 1>&6 Xif test $ac_cv_struct_dirent_d_type = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_DIRENT_D_TYPE 1 XEOF X Xfi Xecho $ac_n "checking if DIR * contains dd_fd""... $ac_c" 1>&6 Xecho "configure:11018: checking if DIR * contains dd_fd" >&5 Xif eval "test \"`echo '$''{'ac_cv_struct_dir_dd_fd'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < Xint main() { XDIR d; d.dd_fd = 0; exit (d.dd_fd == 0); X; return 0; } XEOF Xif { eval echo configure:11030: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_struct_dir_dd_fd=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_struct_dir_dd_fd=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_struct_dir_dd_fd" 1>&6 Xif test $ac_cv_struct_dir_dd_fd = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_DIR_DD_FD 1 XEOF X Xfi Xecho $ac_n "checking if struct utsname contains arch""... $ac_c" 1>&6 Xecho "configure:11050: checking if struct utsname contains arch" >&5 Xif eval "test \"`echo '$''{'ac_cv_struct_utsname_arch'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < Xint main() { Xstruct utsname u; u.arch[0] = 0; X; return 0; } XEOF Xif { eval echo configure:11062: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_struct_utsname_arch=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_struct_utsname_arch=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_struct_utsname_arch" 1>&6 Xif test $ac_cv_struct_utsname_arch = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_UTSNAME_ARCH 1 XEOF X Xfi Xecho $ac_n "checking if struct utsname contains processor""... $ac_c" 1>&6 Xecho "configure:11082: checking if struct utsname contains processor" >&5 Xif eval "test \"`echo '$''{'ac_cv_struct_utsname_processor'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < Xint main() { Xstruct utsname u; u.processor[0] = 0; X; return 0; } XEOF Xif { eval echo configure:11094: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_struct_utsname_processor=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_struct_utsname_processor=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_struct_utsname_processor" 1>&6 Xif test $ac_cv_struct_utsname_processor = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_UTSNAME_PROCESSOR 1 XEOF X Xfi Xecho $ac_n "checking if struct utsname contains sysname_host""... $ac_c" 1>&6 Xecho "configure:11114: checking if struct utsname contains sysname_host" >&5 Xif eval "test \"`echo '$''{'ac_cv_struct_utsname_sysname_host'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < Xint main() { Xstruct utsname u; u.sysname_host[0] = 0; X; return 0; } XEOF Xif { eval echo configure:11126: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_struct_utsname_sysname_host=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_struct_utsname_sysname_host=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_struct_utsname_sysname_host" 1>&6 Xif test $ac_cv_struct_utsname_sysname_host = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_UTSNAME_SYSNAME_HOST 1 XEOF X Xfi Xecho $ac_n "checking if struct utsname contains release_host""... $ac_c" 1>&6 Xecho "configure:11146: checking if struct utsname contains release_host" >&5 Xif eval "test \"`echo '$''{'ac_cv_struct_utsname_release_host'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < Xint main() { Xstruct utsname u; u.release_host[0] = 0; X; return 0; } XEOF Xif { eval echo configure:11158: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_struct_utsname_release_host=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_struct_utsname_release_host=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_struct_utsname_release_host" 1>&6 Xif test $ac_cv_struct_utsname_release_host = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_UTSNAME_RELEASE_HOST 1 XEOF X Xfi Xecho $ac_n "checking if struct utsname contains version_host""... $ac_c" 1>&6 Xecho "configure:11178: checking if struct utsname contains version_host" >&5 Xif eval "test \"`echo '$''{'ac_cv_struct_utsname_version_host'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < Xint main() { Xstruct utsname u; u.version_host[0] = 0; X; return 0; } XEOF Xif { eval echo configure:11190: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_struct_utsname_version_host=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_struct_utsname_version_host=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_struct_utsname_version_host" 1>&6 Xif test $ac_cv_struct_utsname_version_host = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_UTSNAME_VERSION_HOST 1 XEOF X Xfi X Xecho $ac_n "checking whether iconv() uses const char **""... $ac_c" 1>&6 Xecho "configure:11211: checking whether iconv() uses const char **" >&5 Xif eval "test \"`echo '$''{'ac_cv_iconv_const'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.c < XEOF Xif { ac_try='${CC-cc} -E conftest.c'; { eval echo configure:11218: \"$ac_try\" 1>&5; eval $ac_try 2>&5; }; } | grep 'size_t.*iconv.*iconv_t.*const' >/dev/null 2>&1; then X ac_cv_iconv_const=yes Xelse X ac_cv_iconv_const=no Xfi Xfi X Xeval echo "$ac_t""$ac_cv_iconv_const" 1>&6 Xif test $ac_cv_iconv_const = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_ICONV_CONST 1 XEOF X Xfi X Xecho $ac_n "checking if stat is declared""... $ac_c" 1>&6 Xecho "configure:11234: checking if stat is declared" >&5 Xif eval "test \"`echo '$''{'ac_cv_have_decl_stat'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#include Xint main() { X char *p = (char *) stat; exit (p != (char *)0 && *p != 0); X; return 0; } XEOF Xif { eval echo configure:11248: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X eval ac_cv_have_decl_stat=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval ac_cv_have_decl_stat=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_have_decl_stat" 1>&6 X ac_tr_decl=HAVE_DECL_`echo stat | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` Xif test $ac_cv_have_decl_stat = yes; then X cat >> confdefs.h <&6 Xecho "configure:11269: checking if lstat is declared" >&5 Xif eval "test \"`echo '$''{'ac_cv_have_decl_lstat'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#include Xint main() { X char *p = (char *) lstat; exit (p != (char *)0 && *p != 0); X; return 0; } XEOF Xif { eval echo configure:11283: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X eval ac_cv_have_decl_lstat=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval ac_cv_have_decl_lstat=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_have_decl_lstat" 1>&6 X ac_tr_decl=HAVE_DECL_`echo lstat | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` Xif test $ac_cv_have_decl_lstat = yes; then X cat >> confdefs.h <&6 Xecho "configure:11305: checking for wait3 that fills in rusage" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_wait3_rusage'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X ac_cv_func_wait3_rusage=no Xelse X cat > conftest.$ac_ext < X#include X#include X#include X/* HP-UX has wait3 but does not fill in rusage at all. */ Xmain() { X struct rusage r; X int i; X /* Use a field that we can force nonzero -- X voluntary context switches. X For systems like NeXT and OSF/1 that don't set it, X also use the system CPU time. And page faults (I/O) for Linux. */ X r.ru_nvcsw = 0; X r.ru_utime.tv_sec = 0; X r.ru_utime.tv_usec = 0; X r.ru_stime.tv_sec = 0; X r.ru_stime.tv_usec = 0; X r.ru_majflt = r.ru_minflt = 0; X switch (fork()) { X case 0: /* Child. */ X sleep(1); /* Give up the CPU. */ X for (i=200000; --i > 0;) getpid(); /* Use up some CPU time */ X _exit(0); X case -1: _exit(0); /* What can we do? */ X default: /* Parent. */ X wait3(&i, 0, &r); X sleep(2); /* Avoid "text file busy" from rm on fast HP-UX machines. */ X exit(r.ru_nvcsw == 0 && r.ru_majflt == 0 && r.ru_minflt == 0 X && r.ru_utime.tv_sec == 0 && r.ru_utime.tv_usec == 0 X && r.ru_stime.tv_sec == 0 && r.ru_stime.tv_usec == 0); X } X} XEOF Xif { eval echo configure:11348: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_func_wait3_rusage=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_func_wait3_rusage=no Xfi Xrm -fr conftest* Xfi X Xfi X Xeval echo "$ac_t""$ac_cv_func_wait3_rusage" 1>&6 Xif test $ac_cv_func_wait3_rusage = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_WAIT3 1 XEOF X Xfi X Xecho $ac_n "checking for mlock""... $ac_c" 1>&6 Xecho "configure:11371: checking for mlock" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_mlock'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext < X#include X#ifndef HAVE_ERRNO_DEF Xextern int errno; X#endif X Xmain() X{ X if (mlock(0, 0) < 0) { X if (errno == EINVAL || errno == ENOMEM || X errno == EPERM || errno == EACCES) X exit(0); X exit(-1); X } X exit(0); X} XEOF Xif { eval echo configure:11399: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_func_mlock=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_func_mlock=no Xfi Xrm -fr conftest* Xfi X Xrm -f core core.* *.core Xfi X Xeval echo "$ac_t""$ac_cv_func_mlock" 1>&6 Xif test $ac_cv_func_mlock = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_MLOCK 1 XEOF X Xfi Xecho $ac_n "checking for mlockall""... $ac_c" 1>&6 Xecho "configure:11422: checking for mlockall" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_mlockall'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext < X#include X#include X#ifndef HAVE_ERRNO_DEF Xextern int errno; X#endif X Xint Xmain() X{ X if (mlockall(MCL_CURRENT|MCL_FUTURE) < 0) { X if (errno == EINVAL || errno == ENOMEM || X errno == EPERM || errno == EACCES) X exit(0); X exit(-1); X } X exit(0); X} X XEOF Xif { eval echo configure:11453: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_func_mlockall=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_func_mlockall=no Xfi Xrm -fr conftest* Xfi X Xrm -f core core.* *.core Xfi X Xeval echo "$ac_t""$ac_cv_func_mlockall" 1>&6 Xif test $ac_cv_func_mlockall = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_MLOCKALL 1 XEOF X Xfi Xecho $ac_n "checking for va_copy""... $ac_c" 1>&6 Xecho "configure:11476: checking for va_copy" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_va_copy'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#else X# include X#endif Xint main() { X Xva_list a, b; X Xva_copy(a, b); X; return 0; } XEOF Xif { eval echo configure:11496: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X ac_cv_func_va_copy=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_func_va_copy=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_func_va_copy" 1>&6 Xif test $ac_cv_func_va_copy = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_VA_COPY 1 XEOF X Xfi Xecho $ac_n "checking for __va_copy""... $ac_c" 1>&6 Xecho "configure:11516: checking for __va_copy" >&5 Xif eval "test \"`echo '$''{'ac_cv_func__va_copy'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#else X# include X#endif Xint main() { X Xva_list a, b; X X__va_copy(a, b); X; return 0; } XEOF Xif { eval echo configure:11536: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X ac_cv_func__va_copy=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_func__va_copy=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_func__va_copy" 1>&6 Xif test $ac_cv_func__va_copy = yes; then X cat >> confdefs.h <<\EOF X#define HAVE__VA_COPY 1 XEOF X Xfi Xecho $ac_n "checking for working ecvt() ""... $ac_c" 1>&6 Xecho "configure:11556: checking for working ecvt() " >&5 Xif eval "test \"`echo '$''{'ac_cv_func_ecvt'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_func_ecvt=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_func_ecvt=no Xfi Xrm -fr conftest* Xfi X Xfi X Xeval echo "$ac_t""$ac_cv_func_ecvt" 1>&6 Xif test $ac_cv_func_ecvt = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_ECVT 1 XEOF X Xfi Xecho $ac_n "checking for working fcvt() ""... $ac_c" 1>&6 Xecho "configure:11606: checking for working fcvt() " >&5 Xif eval "test \"`echo '$''{'ac_cv_func_fcvt'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_func_fcvt=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_func_fcvt=no Xfi Xrm -fr conftest* Xfi X Xfi X Xeval echo "$ac_t""$ac_cv_func_fcvt" 1>&6 Xif test $ac_cv_func_fcvt = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_FCVT 1 XEOF X Xfi Xecho $ac_n "checking for working gcvt() ""... $ac_c" 1>&6 Xecho "configure:11656: checking for working gcvt() " >&5 Xif eval "test \"`echo '$''{'ac_cv_func_gcvt'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_func_gcvt=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_func_gcvt=no Xfi Xrm -fr conftest* Xfi X Xfi X Xeval echo "$ac_t""$ac_cv_func_gcvt" 1>&6 Xif test $ac_cv_func_gcvt = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_GCVT 1 XEOF X Xfi Xecho $ac_n "checking for __dtoa""... $ac_c" 1>&6 Xecho "configure:11706: checking for __dtoa" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_dtoa'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X ac_cv_func_dtoa=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_func_dtoa=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_func_dtoa" 1>&6 Xif test $ac_cv_func_dtoa = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_DTOA 1 XEOF X Xfi Xecho $ac_n "checking for __dtoa that needs result ptr""... $ac_c" 1>&6 Xecho "configure:11739: checking for __dtoa that needs result ptr" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_dtoa_r'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_func_dtoa_r=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_func_dtoa_r=no Xfi Xrm -fr conftest* Xfi X Xfi X Xeval echo "$ac_t""$ac_cv_func_dtoa_r" 1>&6 Xif test $ac_cv_func_dtoa_r = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_DTOA_R 1 XEOF X Xfi Xecho $ac_n "checking if getpagesize is defined or function""... $ac_c" 1>&6 Xecho "configure:11790: checking if getpagesize is defined or function" >&5 Xif eval "test \"`echo '$''{'"ac_cv_have_getpagesize"'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#endif X Xint main() { X X#ifndef getpagesize X char *p = (char *) getpagesize; X exit (p != (char *)0 && *p != 0); X#endif X; return 0; } XEOF Xif { eval echo configure:11810: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval ac_cv_have_getpagesize=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval ac_cv_have_getpagesize=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$"ac_cv_have_getpagesize"" 1>&6 X ac_tr_dfunc=HAVE_`echo getpagesize | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` Xif eval "test \"`echo '$ac_cv_have_'getpagesize`\" = yes"; then X cat >> confdefs.h <&6 Xecho "configure:11835: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:11845: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone Xecho $ac_n "checking for mmap that needs ptr to size""... $ac_c" 1>&6 Xecho "configure:11871: checking for mmap that needs ptr to size" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_mmap_sizep'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X ac_cv_func_mmap_sizep=no Xelse X cat > conftest.$ac_ext < X#include X#include X#include X#include X X#ifndef MAP_FILE X#define MAP_FILE 0 /* Needed on Apollo Domain/OS */ X#endif X X/* This mess was copied from the GNU getpagesize.h. */ X#ifndef HAVE_GETPAGESIZE X# ifdef HAVE_UNISTD_H X# include X# endif X X/* Assume that all systems that can run configure have sys/param.h. */ X# ifndef HAVE_SYS_PARAM_H X# define HAVE_SYS_PARAM_H 1 X# endif X X# ifdef _SC_PAGESIZE X# define getpagesize() sysconf(_SC_PAGESIZE) X# else /* no _SC_PAGESIZE */ X# ifdef HAVE_SYS_PARAM_H X# include X# ifdef EXEC_PAGESIZE X# define getpagesize() EXEC_PAGESIZE X# else /* no EXEC_PAGESIZE */ X# ifdef NBPG X# define getpagesize() NBPG * CLSIZE X# ifndef CLSIZE X# define CLSIZE 1 X# endif /* no CLSIZE */ X# else /* no NBPG */ X# ifdef NBPC X# define getpagesize() NBPC X# else /* no NBPC */ X# ifdef PAGESIZE X# define getpagesize() PAGESIZE X# endif /* PAGESIZE */ X# endif /* no NBPC */ X# endif /* no NBPG */ X# endif /* no EXEC_PAGESIZE */ X# else /* no HAVE_SYS_PARAM_H */ X# define getpagesize() 8192 /* punt totally */ X# endif /* no HAVE_SYS_PARAM_H */ X# endif /* no _SC_PAGESIZE */ X X#endif /* no HAVE_GETPAGESIZE */ X X#ifdef __cplusplus Xextern "C" { void *malloc(unsigned); } X#else Xchar *malloc(); X#endif X Xjmp_buf jenv; X Xint Xintr() X{ X signal(SIGSEGV, intr); X longjmp(jenv, 1); X} X Xint Xmain() X{ X char *data, *data2; X int i, pagesize, ps; X int fd; X X pagesize = getpagesize(); X X /* X * First, make a file with some known garbage in it. X */ X data = malloc(pagesize); X if (!data) X exit(1); X for (i = 0; i < pagesize; ++i) X *(data + i) = rand(); X umask(0); X fd = creat("conftestmmap", 0600); X if (fd < 0) X exit(1); X if (write(fd, data, pagesize) != pagesize) X exit(1); X close(fd); X X /* X * Next, try to mmap the file at a fixed address which X * already has something else allocated at it. If we can, X * also make sure that we see the same garbage. X */ X fd = open("conftestmmap", O_RDWR); X if (fd < 0) X exit(1); X X /* X * Keep a copy, Apollo modifies the value... X */ X ps = pagesize; X X /* X * Apollo mmap() is not a syscall but a library function and fails X * if it tries to dereference 'ps'. We must use setjmp in order to X * catch the failure. X */ X signal(SIGSEGV, intr); X if (setjmp(jenv) == 0) { X data2 = mmap(0, ps, PROT_READ, MAP_FILE | MAP_PRIVATE, fd, 0L); X } else { X data2 = (char *)-1; X } X if (data2 != (char *)-1) X exit(1); X X signal(SIGSEGV, intr); X if (setjmp(jenv) == 0) { X data2 = mmap(0, &ps, PROT_READ, MAP_FILE | MAP_PRIVATE, fd, 0L); X } else { X data2 = (char *)-1; X } X if (data2 == (char *)-1) X exit(1); X X for (i = 0; i < pagesize; ++i) X if (*(data + i) != *(data2 + i)) X exit(1); X X close(fd); X unlink("conftestmmap"); X exit(0); X} X XEOF Xif { eval echo configure:12020: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_func_mmap_sizep=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_func_mmap_sizep=no Xfi Xrm -fr conftest* Xfi X Xfi X Xeval echo "$ac_t""$ac_cv_func_mmap_sizep" 1>&6 Xif test $ac_cv_func_mmap_sizep = yes; then X cat >> confdefs.h <<\EOF X#define _MMAP_WITH_SIZEP 1 XEOF X Xfi X Xfor ac_hdr in unistd.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:12046: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:12056: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone Xecho $ac_n "checking for working mmap""... $ac_c" 1>&6 Xecho "configure:12082: checking for working mmap" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X ac_cv_func_mmap_fixed_mapped=no Xelse X cat > conftest.$ac_ext < X#include X#include X X/* X * Needed for Apollo Domain/OS and may be for others? X */ X#ifdef _MMAP_WITH_SIZEP X# define mmap_sizeparm(s) (&(s)) X#else X# define mmap_sizeparm(s) (s) X#endif X X/* This mess was copied from the GNU getpagesize.h. */ X#ifndef HAVE_GETPAGESIZE X# ifdef HAVE_UNISTD_H X# include X# endif X X/* Assume that all systems that can run configure have sys/param.h. */ X# ifndef HAVE_SYS_PARAM_H X# define HAVE_SYS_PARAM_H 1 X# endif X X# ifdef _SC_PAGESIZE X# define getpagesize() sysconf(_SC_PAGESIZE) X# else /* no _SC_PAGESIZE */ X# ifdef HAVE_SYS_PARAM_H X# include X# ifdef EXEC_PAGESIZE X# define getpagesize() EXEC_PAGESIZE X# else /* no EXEC_PAGESIZE */ X# ifdef NBPG X# define getpagesize() NBPG * CLSIZE X# ifndef CLSIZE X# define CLSIZE 1 X# endif /* no CLSIZE */ X# else /* no NBPG */ X# ifdef NBPC X# define getpagesize() NBPC X# else /* no NBPC */ X# ifdef PAGESIZE X# define getpagesize() PAGESIZE X# endif /* PAGESIZE */ X# endif /* no NBPC */ X# endif /* no NBPG */ X# endif /* no EXEC_PAGESIZE */ X# else /* no HAVE_SYS_PARAM_H */ X# define getpagesize() 8192 /* punt totally */ X# endif /* no HAVE_SYS_PARAM_H */ X# endif /* no _SC_PAGESIZE */ X X#endif /* no HAVE_GETPAGESIZE */ X X#ifdef __cplusplus Xextern "C" { void *malloc(unsigned); } X#else Xchar *malloc(); X#endif X Xint Xmain() X{ X char *data, *data2, *data3; X int i, pagesize; X int fd; X X pagesize = getpagesize(); X X /* X * First, make a file with some known garbage in it. X */ X data = malloc(pagesize); X if (!data) X exit(1); X for (i = 0; i < pagesize; ++i) X *(data + i) = rand(); X umask(0); X fd = creat("conftestmmap", 0600); X if (fd < 0) X exit(1); X if (write(fd, data, pagesize) != pagesize) X exit(1); X close(fd); X X /* X * Next, try to mmap the file at a fixed address which X * already has something else allocated at it. If we can, X * also make sure that we see the same garbage. X */ X fd = open("conftestmmap", O_RDWR); X if (fd < 0) X exit(1); X data2 = malloc(2 * pagesize); X if (!data2) X exit(1); X data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1); X if (data2 != mmap(data2, mmap_sizeparm(pagesize), PROT_READ | PROT_WRITE, X MAP_PRIVATE | MAP_FIXED, fd, 0L)) X exit(1); X for (i = 0; i < pagesize; ++i) X if (*(data + i) != *(data2 + i)) X exit(1); X X /* X * Finally, make sure that changes to the mapped area X * do not percolate back to the file as seen by read(). X * (This is a bug on some variants of i386 svr4.0.) X */ X for (i = 0; i < pagesize; ++i) X *(data2 + i) = *(data2 + i) + 1; X data3 = malloc(pagesize); X if (!data3) X exit(1); X if (read(fd, data3, pagesize) != pagesize) X exit(1); X for (i = 0; i < pagesize; ++i) X if (*(data + i) != *(data3 + i)) X exit(1); X close(fd); X unlink("conftestmmap"); X exit(0); X} X XEOF Xif { eval echo configure:12239: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_func_mmap_fixed_mapped=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_func_mmap_fixed_mapped=no Xfi Xrm -fr conftest* Xfi X Xfi X Xeval echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6 Xif test $ac_cv_func_mmap_fixed_mapped = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_MMAP 1 XEOF X Xfi X Xfor ac_hdr in unistd.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:12265: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:12275: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone Xecho $ac_n "checking for mmap that needs ptr to size""... $ac_c" 1>&6 Xecho "configure:12301: checking for mmap that needs ptr to size" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_mmap_sizep'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X ac_cv_func_mmap_sizep=no Xelse X cat > conftest.$ac_ext < X#include X#include X#include X#include X X#ifndef MAP_FILE X#define MAP_FILE 0 /* Needed on Apollo Domain/OS */ X#endif X X/* This mess was copied from the GNU getpagesize.h. */ X#ifndef HAVE_GETPAGESIZE X# ifdef HAVE_UNISTD_H X# include X# endif X X/* Assume that all systems that can run configure have sys/param.h. */ X# ifndef HAVE_SYS_PARAM_H X# define HAVE_SYS_PARAM_H 1 X# endif X X# ifdef _SC_PAGESIZE X# define getpagesize() sysconf(_SC_PAGESIZE) X# else /* no _SC_PAGESIZE */ X# ifdef HAVE_SYS_PARAM_H X# include X# ifdef EXEC_PAGESIZE X# define getpagesize() EXEC_PAGESIZE X# else /* no EXEC_PAGESIZE */ X# ifdef NBPG X# define getpagesize() NBPG * CLSIZE X# ifndef CLSIZE X# define CLSIZE 1 X# endif /* no CLSIZE */ X# else /* no NBPG */ X# ifdef NBPC X# define getpagesize() NBPC X# else /* no NBPC */ X# ifdef PAGESIZE X# define getpagesize() PAGESIZE X# endif /* PAGESIZE */ X# endif /* no NBPC */ X# endif /* no NBPG */ X# endif /* no EXEC_PAGESIZE */ X# else /* no HAVE_SYS_PARAM_H */ X# define getpagesize() 8192 /* punt totally */ X# endif /* no HAVE_SYS_PARAM_H */ X# endif /* no _SC_PAGESIZE */ X X#endif /* no HAVE_GETPAGESIZE */ X X#ifdef __cplusplus Xextern "C" { void *malloc(unsigned); } X#else Xchar *malloc(); X#endif X Xjmp_buf jenv; X Xint Xintr() X{ X signal(SIGSEGV, intr); X longjmp(jenv, 1); X} X Xint Xmain() X{ X char *data, *data2; X int i, pagesize, ps; X int fd; X X pagesize = getpagesize(); X X /* X * First, make a file with some known garbage in it. X */ X data = malloc(pagesize); X if (!data) X exit(1); X for (i = 0; i < pagesize; ++i) X *(data + i) = rand(); X umask(0); X fd = creat("conftestmmap", 0600); X if (fd < 0) X exit(1); X if (write(fd, data, pagesize) != pagesize) X exit(1); X close(fd); X X /* X * Next, try to mmap the file at a fixed address which X * already has something else allocated at it. If we can, X * also make sure that we see the same garbage. X */ X fd = open("conftestmmap", O_RDWR); X if (fd < 0) X exit(1); X X /* X * Keep a copy, Apollo modifies the value... X */ X ps = pagesize; X X /* X * Apollo mmap() is not a syscall but a library function and fails X * if it tries to dereference 'ps'. We must use setjmp in order to X * catch the failure. X */ X signal(SIGSEGV, intr); X if (setjmp(jenv) == 0) { X data2 = mmap(0, ps, PROT_READ, MAP_FILE | MAP_PRIVATE, fd, 0L); X } else { X data2 = (char *)-1; X } X if (data2 != (char *)-1) X exit(1); X X signal(SIGSEGV, intr); X if (setjmp(jenv) == 0) { X data2 = mmap(0, &ps, PROT_READ, MAP_FILE | MAP_PRIVATE, fd, 0L); X } else { X data2 = (char *)-1; X } X if (data2 == (char *)-1) X exit(1); X X for (i = 0; i < pagesize; ++i) X if (*(data + i) != *(data2 + i)) X exit(1); X X close(fd); X unlink("conftestmmap"); X exit(0); X} X XEOF Xif { eval echo configure:12450: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_func_mmap_sizep=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_func_mmap_sizep=no Xfi Xrm -fr conftest* Xfi X Xfi X Xeval echo "$ac_t""$ac_cv_func_mmap_sizep" 1>&6 Xif test $ac_cv_func_mmap_sizep = yes; then X cat >> confdefs.h <<\EOF X#define _MMAP_WITH_SIZEP 1 XEOF X Xfi X Xecho $ac_n "checking if mmap works to get shared memory""... $ac_c" 1>&6 Xecho "configure:12473: checking if mmap works to get shared memory" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_smmap'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X ac_cv_func_smmap=no Xelse X cat > conftest.$ac_ext < X#include X X#ifndef MAP_ANONYMOUS X# ifdef MAP_ANON X# define MAP_ANONYMOUS MAP_ANON X# endif X#endif X X/* X * Needed for Apollo Domain/OS and may be for others? X */ X#ifdef _MMAP_WITH_SIZEP X# define mmap_sizeparm(s) (&(s)) X#else X# define mmap_sizeparm(s) (s) X#endif X Xchar * Xmkshare() X{ X int size = 8192; X int f; X char *addr; X X#ifdef MAP_ANONYMOUS /* HP/UX */ X f = -1; X addr = mmap(0, mmap_sizeparm(size), PROT_READ|PROT_WRITE, MAP_SHARED|MAP_ANONYMOUS, f, 0); X#else X if ((f = open("/dev/zero", 2)) < 0) X exit(1); X addr = mmap(0, mmap_sizeparm(size), PROT_READ|PROT_WRITE, MAP_SHARED, f, 0); X#endif X if (addr == (char *)-1) X exit(1); X close(f); X X return (addr); X} X Xint Xmain() X{ X char *addr; X X addr = mkshare(); X *addr = 'I'; X X switch (fork()) { X X case -1: X printf("help\n"); exit(1); X X case 0: /* child */ X *addr = 'N'; X _exit(0); X break; X default: /* parent */ X wait(0); X sleep(1); X break; X } X X if (*addr != 'N') X exit(1); X exit(0); X} X XEOF Xif { eval echo configure:12553: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_func_smmap=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_func_smmap=no Xfi Xrm -fr conftest* Xfi X Xfi X Xeval echo "$ac_t""$ac_cv_func_smmap" 1>&6 Xif test $ac_cv_func_smmap = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_SMMAP 1 XEOF X Xfi Xecho $ac_n "checking if shmget works to get shared memory""... $ac_c" 1>&6 Xecho "configure:12575: checking if shmget works to get shared memory" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_shmget'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X ac_cv_func_shmget=no Xelse X cat > conftest.$ac_ext < X#include X#include Xint Xmain() X{ X int id; X X id = shmget(IPC_PRIVATE, 0x1, IPC_CREAT|0600); X if (id == -1) X exit(1); X shmctl(id, IPC_RMID, 0); X exit(0); X} X XEOF Xif { eval echo configure:12602: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_func_shmget=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_func_shmget=no Xfi Xrm -fr conftest* Xfi X Xfi X Xeval echo "$ac_t""$ac_cv_func_shmget" 1>&6 Xif test $ac_cv_func_shmget = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_SHMGET 1 XEOF X Xfi X# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works X# for constant arguments. Useless! Xecho $ac_n "checking for working alloca.h""... $ac_c" 1>&6 Xecho "configure:12626: checking for working alloca.h" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < Xint main() { Xchar *p = alloca(2 * sizeof(int)); X; return 0; } XEOF Xif { eval echo configure:12638: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X ac_cv_header_alloca_h=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_header_alloca_h=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_header_alloca_h" 1>&6 Xif test $ac_cv_header_alloca_h = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_ALLOCA_H 1 XEOF X Xfi X Xecho $ac_n "checking for alloca""... $ac_c" 1>&6 Xecho "configure:12659: checking for alloca" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X# define alloca _alloca X# else X# if HAVE_ALLOCA_H X# include X# else X# ifdef _AIX X #pragma alloca X# else X# ifndef alloca /* predefined by HP cc +Olibcalls */ Xchar *alloca (); X# endif X# endif X# endif X# endif X#endif X Xint main() { Xchar *p = (char *) alloca(1); X; return 0; } XEOF Xif { eval echo configure:12692: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X ac_cv_func_alloca_works=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_func_alloca_works=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_func_alloca_works" 1>&6 Xif test $ac_cv_func_alloca_works = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_ALLOCA 1 XEOF X Xfi X Xif test $ac_cv_func_alloca_works = no; then X # The SVR3 libPW and SVR4 libucb both contain incompatible functions X # that cause trouble. Some versions do not even contain alloca or X # contain a buggy version. If you still want to use their alloca, X # use ar to extract alloca.o from them instead of compiling alloca.c. X ALLOCA=alloca.${ac_objext} X cat >> confdefs.h <<\EOF X#define C_ALLOCA 1 XEOF X X Xecho $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 Xecho "configure:12724: checking whether alloca needs Cray hooks" >&5 Xif eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext <&5 | X egrep "webecray" >/dev/null 2>&1; then X rm -rf conftest* X ac_cv_os_cray=yes Xelse X rm -rf conftest* X ac_cv_os_cray=no Xfi Xrm -f conftest* X Xfi X Xeval echo "$ac_t""$ac_cv_os_cray" 1>&6 Xif test $ac_cv_os_cray = yes; then Xfor ac_func in _getb67 GETB67 getb67; do X echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:12754: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:12782: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X cat >> confdefs.h <&6 Xfi X Xdone Xfi X Xecho $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 Xecho "configure:12809: checking stack direction for C alloca" >&5 Xif eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X ac_cv_c_stack_direction=0 Xelse X cat > conftest.$ac_ext < addr) ? 1 : -1; X} Xmain () X{ X exit (find_stack_direction() < 0); X} XEOF Xif { eval echo configure:12836: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_c_stack_direction=1 Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_c_stack_direction=-1 Xfi Xrm -fr conftest* Xfi X Xfi X Xeval echo "$ac_t""$ac_cv_c_stack_direction" 1>&6 Xcat >> confdefs.h <&6 Xecho "configure:12858: checking if quotactl is an ioctl" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_quotaioctl'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#include Xint main() { Xstruct quotctl q; ioctl(0, Q_QUOTACTL, &q) X; return 0; } XEOF Xif { eval echo configure:12871: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X ac_cv_func_quotaioctl=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_func_quotaioctl=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_func_quotaioctl" 1>&6 Xif test $ac_cv_func_quotaioctl = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_QUOTAIOCTL 1 XEOF X Xfi Xecho $ac_n "checking for file locking via fcntl""... $ac_c" 1>&6 Xecho "configure:12891: checking for file locking via fcntl" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_fcntl_lock'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#include Xint main() { X Xstruct flock fl; Xfcntl(0, F_SETLK, &fl); X; return 0; } XEOF Xif { eval echo configure:12907: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X ac_cv_func_fcntl_lock=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_func_fcntl_lock=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_func_fcntl_lock" 1>&6 Xif test $ac_cv_func_fcntl_lock = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_FCNTL_LOCKF 1 XEOF X Xfi Xecho $ac_n "checking for uname""... $ac_c" 1>&6 Xecho "configure:12927: checking for uname" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_uname'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < Xint main() { Xstruct utsname un; Xuname(&un); X; return 0; } XEOF Xif { eval echo configure:12940: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X ac_cv_func_uname=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_func_uname=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_func_uname" 1>&6 Xif test $ac_cv_func_uname = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_UNAME 1 XEOF X Xfi Xfor ac_func in execl Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:12962: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:12990: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xac_safe=`echo "vfork.h" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for vfork.h""... $ac_c" 1>&6 Xecho "configure:13016: checking for vfork.h" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:13026: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X cat >> confdefs.h <<\EOF X#define HAVE_VFORK_H 1 XEOF X Xelse X eval echo "$ac_t""no" 1>&6 Xfi X Xecho $ac_n "checking for working vfork""... $ac_c" 1>&6 Xecho "configure:13051: checking for working vfork" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_vfork_works'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X echo $ac_n "checking for vfork""... $ac_c" 1>&6 Xecho "configure:13057: checking for vfork" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_vfork'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar vfork(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_vfork) || defined (__stub___vfork) Xchoke me X#else Xvfork(); X#endif X X; return 0; } XEOF Xif { eval echo configure:13085: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_vfork=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_vfork=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'vfork`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X : Xelse X eval echo "$ac_t""no" 1>&6 Xfi X Xac_cv_func_vfork_works=$ac_cv_func_vfork Xelse X cat > conftest.$ac_ext < X#include X#include X#ifdef HAVE_UNISTD_H X#include X#endif X#ifdef HAVE_VFORK_H X#include X#endif X#ifdef HAVE_STDLIB_H X#include X#endif X#if defined(HAVE_WAIT_H) X#include X#else X#include X#endif X/* On some sparc systems, changes by the child to local and incoming X argument registers are propagated back to the parent. X The compiler is told about this with #include , X but some compilers (e.g. gcc -O) don't grok . X Test for this by using a static variable whose address X is put into a register that is clobbered by the vfork. */ X#ifndef VMS Xstatic int X#ifdef __cplusplus Xsparc_address_test (int arg) X#else Xsparc_address_test (arg) int arg; X#endif X{ X static pid_t child; X if (!child) { X child = vfork (); X if (child < 0) { X perror ("vfork"); X _exit(2); X } X if (!child) { X arg = getpid(); X write(-1, "", 0); X _exit (arg); X } X } X return (0); X} X#endif Xint exc = 0; Xint data = 0; X Xint Xmain() { X pid_t parent = getpid (); X pid_t child; X X#ifndef VMS X sparc_address_test(0); X#endif X X child = vfork (); X X if (child == 0) { X /* Here is another test for sparc vfork register problems. X This test uses lots of local variables, at least X as many local variables as main has allocated so far X including compiler temporaries. 4 locals are enough for X gcc 1.40.3 on a Solaris 4.1.3 sparc, but we use 8 to be safe. X A buggy compiler should reuse the register of parent X for one of the local variables, since it will think that X parent can't possibly be used any more in this routine. X Assigning to the local variable will thus munge parent X in the parent process. */ X pid_t X p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), X p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); X /* Convince the compiler that p..p7 are live; otherwise, it might X use the same hardware register for all 8 local variables. */ X if (p != p1 || p != p2 || p != p3 || p != p4 X || p != p5 || p != p6 || p != p7) X exc = 1; X X /* On some systems (e.g. IRIX 3.3), X vfork doesn't separate parent from child file descriptors. X If the child closes a descriptor before it execs or exits, X this munges the parent's descriptor as well. X Test for this by closing stdout in the child. */ X if (exc == 0) X exc = close(fileno(stdout)) != 0; X X /* X * Check whether a modification in the data segment of the child X * is forwarded to the data segment of the parent, vfork() on Haiku X * fails to do this. We cannot use vfork() in this case as vfork() X * children usually signal things to their parent by modifying the X * data segment. X */ X data = 1; X X /* X * VMS hangs if we do not call execl() X */ X#ifdef HAVE_EXECL X /* X * On VMS, things hang unless the child calls exec() X */ X if (exc == 0) X execl("/bin/true", "true", (char *)0); X else X execl("/bin/false", "false", (char *)0); X#endif X _exit(exc); X } else { X int status; X struct stat st; X X while (wait(&status) != child) X ; X exit( X /* Was there some problem with vforking? */ X child < 0 X X /* Did the child fail? (This shouldn't happen.) */ X || status X X /* Did the vfork/compiler bug occur? */ X || parent != getpid() X X || data == 0 X X /* Did the file descriptor bug occur? */ X || fstat(fileno(stdout), &st) != 0 X ); X } X} XEOF Xif { eval echo configure:13245: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_func_vfork_works=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_func_vfork_works=no Xfi Xrm -fr conftest* Xfi X Xfi X Xeval echo "$ac_t""$ac_cv_func_vfork_works" 1>&6 Xif test $ac_cv_func_vfork_works = no; then X cat >> confdefs.h <<\EOF X#define vfork fork XEOF X Xelse X cat >> confdefs.h <<\EOF X#define HAVE_VFORK 1 XEOF X Xfi X Xecho $ac_n "checking for sys_siglist""... $ac_c" 1>&6 Xecho "configure:13273: checking for sys_siglist" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_sys_siglist'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_func_sys_siglist=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_func_sys_siglist=no Xfi Xrm -fr conftest* Xfi X Xfi X Xeval echo "$ac_t""$ac_cv_func_sys_siglist" 1>&6 Xif test $ac_cv_func_sys_siglist = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_SYS_SIGLIST 1 XEOF X Xfi Xecho $ac_n "checking for BSD compliant getpgrp""... $ac_c" 1>&6 Xecho "configure:13313: checking for BSD compliant getpgrp" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_bsd_getpgrp'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_func_bsd_getpgrp=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_func_bsd_getpgrp=no Xfi Xrm -fr conftest* Xfi X Xfi X Xeval echo "$ac_t""$ac_cv_func_bsd_getpgrp" 1>&6 Xif test $ac_cv_func_bsd_getpgrp = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_BSD_GETPGRP 1 XEOF X Xfi Xecho $ac_n "checking for BSD compliant setpgrp""... $ac_c" 1>&6 Xecho "configure:13357: checking for BSD compliant setpgrp" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_bsd_setpgrp'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext < X#ifndef HAVE_ERRNO_DEF Xextern int errno; X#endif Xint Xmain() X{ errno = 0; X/* X * Force illegal pid on BSD X */ Xif (setpgrp(-1, 100) < 0 && errno == ESRCH) X exit(0); Xexit(1);} XEOF Xif { eval echo configure:13382: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_func_bsd_setpgrp=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_func_bsd_setpgrp=no Xfi Xrm -fr conftest* Xfi X Xfi X Xeval echo "$ac_t""$ac_cv_func_bsd_setpgrp" 1>&6 Xif test $ac_cv_func_bsd_setpgrp = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_BSD_SETPGRP 1 XEOF X Xfi Xecho $ac_n "checking for C99 compliant isinf""... $ac_c" 1>&6 Xecho "configure:13404: checking for C99 compliant isinf" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_c99_isinf'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < Xint main() { X double d; X#ifndef isinf XThe isinf macro is not defined X#endif Xreturn (isinf(d)); X X; return 0; } XEOF Xif { eval echo configure:13421: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X ac_cv_func_c99_isinf=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_func_c99_isinf=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_func_c99_isinf" 1>&6 Xif test $ac_cv_func_c99_isinf = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_C99_ISINF 1 XEOF X Xfi Xecho $ac_n "checking for C99 compliant isnan""... $ac_c" 1>&6 Xecho "configure:13441: checking for C99 compliant isnan" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_c99_isnan'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < Xint main() { X double d; X#ifndef isnan XThe isnan macro is not defined X#endif Xreturn (isnan(d)); X X; return 0; } XEOF Xif { eval echo configure:13458: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X ac_cv_func_c99_isnan=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_func_c99_isnan=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_func_c99_isnan" 1>&6 Xif test $ac_cv_func_c99_isnan = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_C99_ISNAN 1 XEOF X Xfi Xecho $ac_n "checking for sigsetjmp""... $ac_c" 1>&6 Xecho "configure:13478: checking for sigsetjmp" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_sigsetjmp'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < Xint main() { X Xsigjmp_buf jb; Xsigsetjmp(jb, 1); X; return 0; } XEOF Xif { eval echo configure:13493: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X ac_cv_func_sigsetjmp=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_func_sigsetjmp=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_func_sigsetjmp" 1>&6 Xif test $ac_cv_func_sigsetjmp = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_SIGSETJMP 1 XEOF X Xfi Xecho $ac_n "checking for siglongjmp""... $ac_c" 1>&6 Xecho "configure:13513: checking for siglongjmp" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_siglongjmp'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < Xint main() { X Xsigjmp_buf jb; Xsigsetjmp(jb, 1); Xsiglongjmp(jb, 1); X; return 0; } XEOF Xif { eval echo configure:13529: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X ac_cv_func_siglongjmp=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_func_siglongjmp=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_func_siglongjmp" 1>&6 Xif test $ac_cv_func_siglongjmp = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_SIGLONGJMP 1 XEOF X Xfi Xecho $ac_n "checking whether *printf() supports %jd""... $ac_c" 1>&6 Xecho "configure:13549: checking whether *printf() supports %jd" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_printf_j'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext < Xint Xmain() X{ intmax_t m = 123456789012LL; Xchar buf[32]; Xsprintf(buf, "%jd", m); Xif (strcmp(buf, "123456789012") == 0) X exit(0); Xexit(1);} XEOF Xif { eval echo configure:13570: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_func_printf_j=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_func_printf_j=no Xfi Xrm -fr conftest* Xfi X Xfi X Xeval echo "$ac_t""$ac_cv_func_printf_j" 1>&6 Xif test $ac_cv_func_printf_j = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_PRINTF_J 1 XEOF X Xfi Xecho $ac_n "checking whether *printf() supports %zd""... $ac_c" 1>&6 Xecho "configure:13592: checking whether *printf() supports %zd" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_printf_z'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext < Xint Xmain() X{ size_t m = 1234567890; Xchar buf[32]; Xsprintf(buf, "%zd", m); Xif (strcmp(buf, "1234567890") == 0) X exit(0); Xexit(1);} XEOF Xif { eval echo configure:13613: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_func_printf_z=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_func_printf_z=no Xfi Xrm -fr conftest* Xfi X Xfi X Xeval echo "$ac_t""$ac_cv_func_printf_z" 1>&6 Xif test $ac_cv_func_printf_z = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_PRINTF_Z 1 XEOF X Xfi Xecho $ac_n "checking whether *printf() supports %lld""... $ac_c" 1>&6 Xecho "configure:13635: checking whether *printf() supports %lld" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_printf_ll'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_func_printf_ll=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_func_printf_ll=no Xfi Xrm -fr conftest* Xfi X Xfi X Xeval echo "$ac_t""$ac_cv_func_printf_ll" 1>&6 Xif test $ac_cv_func_printf_ll = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_PRINTF_LL 1 XEOF X Xfi Xfor ac_hdr in stdlib.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:13680: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:13690: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xecho $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 Xecho "configure:13717: checking return type of signal handlers" >&5 Xif eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#include X#ifdef signal X#undef signal X#endif X#ifdef __cplusplus Xextern "C" void (*signal (int, void (*)(int)))(int); X#else Xvoid (*signal ()) (); X#endif X Xint main() { Xint i; X; return 0; } XEOF Xif { eval echo configure:13739: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_type_signal=void Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_type_signal=int Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_type_signal" 1>&6 Xcat >> confdefs.h <&6 Xecho "configure:13758: checking if realloc() does implement realloc(NULL, size)" >&5 Xif eval "test \"`echo '$''{'ac_cv_realloc_null'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext < X#endif X#include X XRETSIGTYPE Xsig(s) X int s; X{ X exit(1); X} Xint Xmain() X{ X char *p; X X signal(SIGSEGV, sig); X p = realloc((char *)0, 10); X if (p == (char *)0) X exit(1); X exit(0); X} XEOF Xif { eval echo configure:13792: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_realloc_null=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_realloc_null=no Xfi Xrm -fr conftest* Xfi X Xfi X Xeval echo "$ac_t""$ac_cv_realloc_null" 1>&6 Xif test $ac_cv_realloc_null = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_REALLOC_NULL 1 XEOF X Xfi Xfor ac_hdr in stdlib.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:13817: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:13827: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in unistd.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:13857: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:13867: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_hdr in wait.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:13897: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:13907: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xecho $ac_n "checking for sys/wait.h that is POSIX.1 compatible""... $ac_c" 1>&6 Xecho "configure:13934: checking for sys/wait.h that is POSIX.1 compatible" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_sys_wait_h'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#include X#ifndef WEXITSTATUS X#define WEXITSTATUS(stat_val) ((unsigned)(stat_val) >> 8) X#endif X#ifndef WIFEXITED X#define WIFEXITED(stat_val) (((stat_val) & 255) == 0) X#endif Xint main() { Xint s; Xwait (&s); Xs = WIFEXITED (s) ? WEXITSTATUS (s) : 1; X; return 0; } XEOF Xif { eval echo configure:13955: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_header_sys_wait_h=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_header_sys_wait_h=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_header_sys_wait_h" 1>&6 Xif test $ac_cv_header_sys_wait_h = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_SYS_WAIT_H 1 XEOF X Xfi X Xecho $ac_n "checking for halfway POSIX compliant waitid()""... $ac_c" 1>&6 Xecho "configure:13976: checking for halfway POSIX compliant waitid()" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_waitid'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext < X#endif X#ifdef HAVE_UNISTD_H X#include X#endif X#if defined(HAVE_WAIT_H) X# include X#else X#include X#endif X#include X/* X * Non-standard compliant platforms may need X * #include or something similar X * in addition to the include files above. X */ X Xint Xmain() X{ X siginfo_t si; X pid_t pid; X int ret; X X if ((pid = fork()) < 0) X exit(1); X if (pid == 0) { X _exit(1234567890); X } X ret = waitid(P_PID, pid, &si, WEXITED); X if (ret < 0) X exit(1); X if (pid != si.si_pid) /* Mac OS X has si.si_pid == 0 */ X exit(2); X if (si.si_code != CLD_EXITED) /* Mac OS X has si.si_code == 0 */ X exit(3); X if ((si.si_status & 0xFFFF) != (1234567890 & 0xFFFF)) X exit(4); /* Should deliver more than 8 bits */ X /* Linux only delivers 8 bits */ X /* Mac OS X delivers 24 bits */ X X exit(0); X} XEOF Xif { eval echo configure:14032: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_func_waitid=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_func_waitid=no Xfi Xrm -fr conftest* Xfi X Xfi X Xeval echo "$ac_t""$ac_cv_func_waitid" 1>&6 Xif test $ac_cv_func_waitid = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_WAITID 1 XEOF X Xfi Xfor ac_func in access eaccess euidaccess Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:14056: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:14084: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in memchr memcmp memcpy memccpy memmove memset Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:14111: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:14139: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in brk sbrk strerror nice flock lockf fchdir statvfs quotactl Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:14166: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:14194: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in realpath resolvepath Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:14221: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:14249: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in dup dup2 Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:14276: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:14304: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in getcwd shmat semget Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:14331: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:14359: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in lstat readlink symlink link rename mkfifo mknod Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:14386: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:14414: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in setreuid setresuid seteuid setuid Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:14441: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:14469: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in setregid setresgid setegid setgid Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:14496: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:14524: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in getuid geteuid getgid getegid Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:14551: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:14579: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in getpid getppid Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:14606: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:14634: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in getpgid setpgid getsid setsid Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:14661: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:14689: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in getpgrp setpgrp Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:14716: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:14744: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in getpwnam getpwent getpwuid setpwent endpwent Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:14771: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:14799: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in getgrnam getgrent getgrgid setgrent endgrent Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:14826: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:14854: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in getspnam getspwnam Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:14881: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:14909: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in getlogin Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:14936: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:14964: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in sync fsync fork forkx vforkx forkall forkallx wait wait4 wait6 waitpid getrusage getrlimit setrlimit ulimit Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:14991: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:15019: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in execl execle execlp execv execve execvp Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:15046: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:15074: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in spawnl spawnle spawnlp spawnlpe Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:15101: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:15129: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in spawnv spawnve spawnvp spawnvpe Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:15156: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:15184: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in cwait Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:15211: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:15239: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in getexecname Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:15266: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:15294: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in getprogname setprogname Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:15321: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:15349: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in proc_pidpath Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:15376: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:15404: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in getloadavg Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:15431: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:15459: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in gethostid gethostname getdomainname getdtablesize Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:15486: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:15514: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in gettimeofday settimeofday time stime gethrtime Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:15541: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:15569: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in ftime tzset mktime gmtime localtime timegm timelocal Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:15596: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:15624: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in ctime cftime ascftime strftime Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:15651: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:15679: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in poll select isastream Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:15706: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:15734: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in chown fchown lchown chmod fchmod lchmod times utime utimes futimes lutimes Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:15761: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:15789: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in utimens lutimens Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:15816: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:15844: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in futimens utimensat Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:15871: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:15899: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in ioctl fcntl Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:15926: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:15954: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in qecvt qfcvt qgcvt Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:15981: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:16009: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in _qecvt _qfcvt _qgcvt Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:16036: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:16064: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in _qecvt_r _qfcvt_r _qgcvt_r Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:16091: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:16119: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in _ldecvt _ldfcvt _ldgcvt Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:16146: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:16174: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in ecvt_r fcvt_r gcvt_r Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:16201: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:16229: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in _ldecvt_r _ldfcvt_r _ldgcvt_r Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:16256: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:16284: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in econvert fconvert gconvert Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:16311: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:16339: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in qeconvert qfconvert qgconvert Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:16366: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:16394: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in isinf isnan Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:16421: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:16449: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in getc_unlocked getchar_unlocked putc_unlocked putchar_unlocked Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:16476: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:16504: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in flockfile funlockfile ftrylockfile Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:16531: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:16559: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in rand drand48 Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:16586: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:16614: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in strtol strtoll strtoul strtoull strtod Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:16641: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:16669: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in setpriority DosSetPriority Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:16696: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:16724: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in DosAllocSharedMem Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:16751: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:16779: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in getdelim Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:16806: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:16834: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in seekdir fdopendir Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:16861: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:16889: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in openat fstatat fchownat futimesat renameat unlinkat Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:16916: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:16944: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in attropen Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:16971: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:16999: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in __accessat Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:17026: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:17054: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in accessat Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:17081: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:17109: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in mkdirat faccessat fchmodat linkat mkfifoat mknodat readlinkat symlinkat Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:17136: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:17164: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in pipe _pipe Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:17191: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:17219: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in popen pclose _popen _pclose Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:17246: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:17274: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in closefrom Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:17301: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:17329: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in strsignal str2sig sig2str Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:17356: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:17384: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in kill killpg Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:17411: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:17439: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in signal sighold sigrelse sigignore sigpause sigprocmask sigsetmask sigset sigaltstack sigblock Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:17466: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:17494: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in alarm sleep usleep yield Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:17521: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:17549: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in atexit on_exit Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:17576: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:17604: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xecho $ac_n "checking if tcgetattr is defined or function""... $ac_c" 1>&6 Xecho "configure:17629: checking if tcgetattr is defined or function" >&5 Xif eval "test \"`echo '$''{'"ac_cv_have_tcgetattr"'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#endif X Xint main() { X X#ifndef tcgetattr X char *p = (char *) tcgetattr; X exit (p != (char *)0 && *p != 0); X#endif X; return 0; } XEOF Xif { eval echo configure:17649: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval ac_cv_have_tcgetattr=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval ac_cv_have_tcgetattr=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$"ac_cv_have_tcgetattr"" 1>&6 X ac_tr_dfunc=HAVE_`echo tcgetattr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` Xif eval "test \"`echo '$ac_cv_have_'tcgetattr`\" = yes"; then X cat >> confdefs.h <&6 Xecho "configure:17671: checking if tcsetattr is defined or function" >&5 Xif eval "test \"`echo '$''{'"ac_cv_have_tcsetattr"'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#endif X Xint main() { X X#ifndef tcsetattr X char *p = (char *) tcsetattr; X exit (p != (char *)0 && *p != 0); X#endif X; return 0; } XEOF Xif { eval echo configure:17691: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval ac_cv_have_tcsetattr=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval ac_cv_have_tcsetattr=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$"ac_cv_have_tcsetattr"" 1>&6 X ac_tr_dfunc=HAVE_`echo tcsetattr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` Xif eval "test \"`echo '$ac_cv_have_'tcsetattr`\" = yes"; then X cat >> confdefs.h <&6 Xecho "configure:17715: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:17743: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in getenv putenv setenv unsetenv Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:17770: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:17798: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in snprintf strcasecmp strncasecmp Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:17825: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:17853: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in vprintf vfprintf vsprintf vsnprintf Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:17880: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:17908: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X X Xfor ac_func in strcat strncat strcmp strncmp strcpy strlcat strlcpy strncpy strdup strndup strlen strnlen strchr strrchr strstr strspn strcspn Xdo Xecho $ac_n "checking if $ac_func is defined or function""... $ac_c" 1>&6 Xecho "configure:17936: checking if $ac_func is defined or function" >&5 Xif eval "test \"`echo '$''{'"ac_cv_have_$ac_func"'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#endif X Xint main() { X X#ifndef $ac_func X char *p = (char *) $ac_func; X exit (p != (char *)0 && *p != 0); X#endif X; return 0; } XEOF Xif { eval echo configure:17956: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval ac_cv_have_$ac_func=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval ac_cv_have_$ac_func=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$"ac_cv_have_$ac_func"" 1>&6 X ac_tr_dfunc=HAVE_`echo $ac_func | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` Xif eval "test \"`echo '$ac_cv_have_'$ac_func`\" = yes"; then X cat >> confdefs.h <&6 Xecho "configure:17981: checking if $ac_func is defined or function" >&5 Xif eval "test \"`echo '$''{'"ac_cv_have_$ac_func"'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#endif X Xint main() { X X#ifndef $ac_func X char *p = (char *) $ac_func; X exit (p != (char *)0 && *p != 0); X#endif X; return 0; } XEOF Xif { eval echo configure:18001: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval ac_cv_have_$ac_func=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval ac_cv_have_$ac_func=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$"ac_cv_have_$ac_func"" 1>&6 X ac_tr_dfunc=HAVE_`echo $ac_func | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` Xif eval "test \"`echo '$ac_cv_have_'$ac_func`\" = yes"; then X cat >> confdefs.h <&6 Xecho "configure:18027: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:18055: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in basename dirname Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:18082: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:18110: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in pathconf fpathconf lpathconf Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:18137: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:18165: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in malloc calloc valloc realloc memalign posix_memalign Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:18192: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:18220: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in madvise Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:18247: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:18275: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in mktemp mkstemp Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:18302: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:18330: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in chflags fchflags fflagstostr strtofflags Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:18357: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:18385: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in fnmatch Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:18412: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:18440: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in truncate ftruncate Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:18467: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:18495: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in getppriv setppriv priv_set Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:18522: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:18550: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in issetugid Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:18577: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:18605: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in getroles privbit_set Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:18632: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:18660: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in setlocale localeconv nl_langinfo Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:18687: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:18715: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in setbuf setvbuf Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:18742: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:18770: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in clone_area create_area delete_area Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:18797: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:18825: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X X Xecho Checking for POSIX violations by the POSIX.1-2008 standard: Xfor ac_func in fexecl fexecle fexecv fexecve Xdo Xecho $ac_n "checking for raw availability of $ac_func""... $ac_c" 1>&6 Xecho "configure:18854: checking for raw availability of $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_rfunc_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_rfunc_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_rfunc_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_rfunc_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_RAW_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in fspawnv fspawnl fspawnv_nowait Xdo Xecho $ac_n "checking for raw availability of $ac_func""... $ac_c" 1>&6 Xecho "configure:18899: checking for raw availability of $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_rfunc_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_rfunc_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_rfunc_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_rfunc_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_RAW_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X X Xfor ac_func in getline fgetline Xdo Xecho $ac_n "checking for raw availability of $ac_func""... $ac_c" 1>&6 Xecho "configure:18945: checking for raw availability of $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_rfunc_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_rfunc_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_rfunc_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_rfunc_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_RAW_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xecho End of tests for POSIX violations by the POSIX.1-2008 standard. X Xecho $ac_n "checking if dirfd is defined or function""... $ac_c" 1>&6 Xecho "configure:18990: checking if dirfd is defined or function" >&5 Xif eval "test \"`echo '$''{'"ac_cv_have_dirfd"'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < Xint main() { X X#ifndef dirfd X char *p = (char *) dirfd; X exit (p != (char *)0 && *p != 0); X#endif X; return 0; } XEOF Xif { eval echo configure:19006: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval ac_cv_have_dirfd=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval ac_cv_have_dirfd=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$"ac_cv_have_dirfd"" 1>&6 X ac_tr_dfunc=HAVE_`echo dirfd | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` Xif eval "test \"`echo '$ac_cv_have_'dirfd`\" = yes"; then X cat >> confdefs.h <&6 Xecho "configure:19029: checking if iswprint is defined or function" >&5 Xif eval "test \"`echo '$''{'"ac_cv_have_iswprint"'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#endif X#ifdef HAVE_WCTYPE_H X#include X#endif X Xint main() { X X#ifndef iswprint X char *p = (char *) iswprint; X exit (p != (char *)0 && *p != 0); X#endif X; return 0; } XEOF Xif { eval echo configure:19052: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval ac_cv_have_iswprint=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval ac_cv_have_iswprint=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$"ac_cv_have_iswprint"" 1>&6 X ac_tr_dfunc=HAVE_`echo iswprint | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` Xif eval "test \"`echo '$ac_cv_have_'iswprint`\" = yes"; then X cat >> confdefs.h <&6 Xecho "configure:19075: checking if iswblank is defined or function" >&5 Xif eval "test \"`echo '$''{'"ac_cv_have_iswblank"'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#endif X#ifdef HAVE_WCTYPE_H X#include X#endif X Xint main() { X X#ifndef iswblank X char *p = (char *) iswblank; X exit (p != (char *)0 && *p != 0); X#endif X; return 0; } XEOF Xif { eval echo configure:19098: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval ac_cv_have_iswblank=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval ac_cv_have_iswblank=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$"ac_cv_have_iswblank"" 1>&6 X ac_tr_dfunc=HAVE_`echo iswblank | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` Xif eval "test \"`echo '$ac_cv_have_'iswblank`\" = yes"; then X cat >> confdefs.h <&6 Xecho "configure:19121: checking if isblank is defined or function" >&5 Xif eval "test \"`echo '$''{'"ac_cv_have_isblank"'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#endif X Xint main() { X X#ifndef isblank X char *p = (char *) isblank; X exit (p != (char *)0 && *p != 0); X#endif X; return 0; } XEOF Xif { eval echo configure:19141: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval ac_cv_have_isblank=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval ac_cv_have_isblank=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$"ac_cv_have_isblank"" 1>&6 X ac_tr_dfunc=HAVE_`echo isblank | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` Xif eval "test \"`echo '$ac_cv_have_'isblank`\" = yes"; then X cat >> confdefs.h <&6 Xecho "configure:19164: checking if mbsinit is defined or function" >&5 Xif eval "test \"`echo '$''{'"ac_cv_have_mbsinit"'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#endif X#ifdef HAVE_WCTYPE_H X#include X#endif X Xint main() { X X#ifndef mbsinit X char *p = (char *) mbsinit; X exit (p != (char *)0 && *p != 0); X#endif X; return 0; } XEOF Xif { eval echo configure:19187: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval ac_cv_have_mbsinit=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval ac_cv_have_mbsinit=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$"ac_cv_have_mbsinit"" 1>&6 X ac_tr_dfunc=HAVE_`echo mbsinit | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` Xif eval "test \"`echo '$ac_cv_have_'mbsinit`\" = yes"; then X cat >> confdefs.h <&6 Xecho "configure:19210: checking if mbtowc is defined or function" >&5 Xif eval "test \"`echo '$''{'"ac_cv_have_mbtowc"'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#endif X Xint main() { X X#ifndef mbtowc X char *p = (char *) mbtowc; X exit (p != (char *)0 && *p != 0); X#endif X; return 0; } XEOF Xif { eval echo configure:19230: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval ac_cv_have_mbtowc=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval ac_cv_have_mbtowc=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$"ac_cv_have_mbtowc"" 1>&6 X ac_tr_dfunc=HAVE_`echo mbtowc | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` Xif eval "test \"`echo '$ac_cv_have_'mbtowc`\" = yes"; then X cat >> confdefs.h <&6 Xecho "configure:19253: checking if wctomb is defined or function" >&5 Xif eval "test \"`echo '$''{'"ac_cv_have_wctomb"'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#endif X Xint main() { X X#ifndef wctomb X char *p = (char *) wctomb; X exit (p != (char *)0 && *p != 0); X#endif X; return 0; } XEOF Xif { eval echo configure:19273: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval ac_cv_have_wctomb=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval ac_cv_have_wctomb=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$"ac_cv_have_wctomb"" 1>&6 X ac_tr_dfunc=HAVE_`echo wctomb | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` Xif eval "test \"`echo '$ac_cv_have_'wctomb`\" = yes"; then X cat >> confdefs.h <&6 Xecho "configure:19296: checking if mbrtowc is defined or function" >&5 Xif eval "test \"`echo '$''{'"ac_cv_have_mbrtowc"'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#endif X#ifdef HAVE_WCTYPE_H X#include X#endif X Xint main() { X X#ifndef mbrtowc X char *p = (char *) mbrtowc; X exit (p != (char *)0 && *p != 0); X#endif X; return 0; } XEOF Xif { eval echo configure:19319: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval ac_cv_have_mbrtowc=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval ac_cv_have_mbrtowc=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$"ac_cv_have_mbrtowc"" 1>&6 X ac_tr_dfunc=HAVE_`echo mbrtowc | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` Xif eval "test \"`echo '$ac_cv_have_'mbrtowc`\" = yes"; then X cat >> confdefs.h <&6 Xecho "configure:19342: checking if wcrtomb is defined or function" >&5 Xif eval "test \"`echo '$''{'"ac_cv_have_wcrtomb"'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#endif X#ifdef HAVE_WCTYPE_H X#include X#endif X Xint main() { X X#ifndef wcrtomb X char *p = (char *) wcrtomb; X exit (p != (char *)0 && *p != 0); X#endif X; return 0; } XEOF Xif { eval echo configure:19365: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval ac_cv_have_wcrtomb=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval ac_cv_have_wcrtomb=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$"ac_cv_have_wcrtomb"" 1>&6 X ac_tr_dfunc=HAVE_`echo wcrtomb | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` Xif eval "test \"`echo '$ac_cv_have_'wcrtomb`\" = yes"; then X cat >> confdefs.h <&6 Xecho "configure:19388: checking if finite is defined or function" >&5 Xif eval "test \"`echo '$''{'"ac_cv_have_finite"'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < Xint main() { X X#ifndef finite X char *p = (char *) finite; X exit (p != (char *)0 && *p != 0); X#endif X; return 0; } XEOF Xif { eval echo configure:19404: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval ac_cv_have_finite=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval ac_cv_have_finite=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$"ac_cv_have_finite"" 1>&6 X ac_tr_dfunc=HAVE_`echo finite | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` Xif eval "test \"`echo '$ac_cv_have_'finite`\" = yes"; then X cat >> confdefs.h <&6 Xecho "configure:19426: checking if isnand is defined or function" >&5 Xif eval "test \"`echo '$''{'"ac_cv_have_isnand"'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < Xint main() { X X#ifndef isnand X char *p = (char *) isnand; X exit (p != (char *)0 && *p != 0); X#endif X; return 0; } XEOF Xif { eval echo configure:19442: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval ac_cv_have_isnand=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval ac_cv_have_isnand=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$"ac_cv_have_isnand"" 1>&6 X ac_tr_dfunc=HAVE_`echo isnand | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` Xif eval "test \"`echo '$ac_cv_have_'isnand`\" = yes"; then X cat >> confdefs.h <&6 Xecho "configure:19465: checking if we may not define our own malloc()" >&5 Xif eval "test \"`echo '$''{'ac_cv_no_user_malloc'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_no_user_malloc=no Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_no_user_malloc=yes Xfi Xrm -fr conftest* Xfi X Xfi X Xeval echo "$ac_t""$ac_cv_no_user_malloc" 1>&6 Xif test $ac_cv_no_user_malloc = yes; then X cat >> confdefs.h <<\EOF X#define NO_USER_MALLOC 1 XEOF X Xfi Xecho $ac_n "checking for working extern long timezone ""... $ac_c" 1>&6 Xecho "configure:19530: checking for working extern long timezone " >&5 Xif eval "test \"`echo '$''{'ac_cv_var_timezone'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_var_timezone=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_var_timezone=no Xfi Xrm -fr conftest* Xfi X Xfi X Xeval echo "$ac_t""$ac_cv_var_timezone" 1>&6 Xif test $ac_cv_var_timezone = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_VAR_TIMEZONE 1 XEOF X Xfi Xecho $ac_n "checking for extern timezone in time.h or sys/time.h""... $ac_c" 1>&6 Xecho "configure:19571: checking for extern timezone in time.h or sys/time.h" >&5 Xif eval "test \"`echo '$''{'ac_cv_var_timezone_def'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#ifdef TIME_WITH_SYS_TIME_H X# include X# include X#else X#ifdef HAVE_SYS_TIME_H X# include X#else X# include X#endif X#endif Xint main() { Xtimezone = 1; X; return 0; } XEOF Xif { eval echo configure:19594: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_var_timezone_def=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_var_timezone_def=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_var_timezone_def" 1>&6 Xif test $ac_cv_var_timezone_def = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_VAR_TIMEZONE_DEF 1 XEOF X Xfi Xecho $ac_n "checking for working extern char *__progname ""... $ac_c" 1>&6 Xecho "configure:19614: checking for working extern char *__progname " >&5 Xif eval "test \"`echo '$''{'ac_cv_var___progname'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_var___progname=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_var___progname=no Xfi Xrm -fr conftest* Xfi X Xfi X Xeval echo "$ac_t""$ac_cv_var___progname" 1>&6 Xif test $ac_cv_var___progname = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_VAR___PROGNAME 1 XEOF X Xfi Xecho $ac_n "checking for working extern char *__progname_full ""... $ac_c" 1>&6 Xecho "configure:19655: checking for working extern char *__progname_full " >&5 Xif eval "test \"`echo '$''{'ac_cv_var___progname_full'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_var___progname_full=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_var___progname_full=no Xfi Xrm -fr conftest* Xfi X Xfi X Xeval echo "$ac_t""$ac_cv_var___progname_full" 1>&6 Xif test $ac_cv_var___progname_full = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_VAR___PROGNAME_FULL 1 XEOF X Xfi X Xecho $ac_n "checking if link() allows hard links on symlinks""... $ac_c" 1>&6 Xecho "configure:19697: checking if link() allows hard links on symlinks" >&5 Xif eval "test \"`echo '$''{'ac_cv_hard_symlinks'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_hard_symlinks=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_hard_symlinks=no Xfi Xrm -fr conftest* Xfi X Xfi X Xeval echo "$ac_t""$ac_cv_hard_symlinks" 1>&6 Xif test $ac_cv_hard_symlinks = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_HARD_SYMLINKS 1 XEOF X Xfi Xecho $ac_n "checking if link() does not folow symlinks""... $ac_c" 1>&6 Xecho "configure:19749: checking if link() does not folow symlinks" >&5 Xif eval "test \"`echo '$''{'ac_cv_link_nofollow'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext < X#include X Xmain() X{ X int ret = 0; X int f; X struct stat sb; X X unlink("confdefs.f1"); X unlink("confdefs.l1"); X unlink("confdefs.h1"); X X f = creat("confdefs.f1", 0666); X close(f); X if (symlink("confdefs.f1", "confdefs.l1") < 0) X ret = 1; X if (link("confdefs.l1", "confdefs.h1") < 0) X ret = 1; X X stat("confdefs.f1", &sb); X if (sb.st_nlink == 2) X ret = 1; X X unlink("confdefs.f1"); X unlink("confdefs.l1"); X unlink("confdefs.h1"); X X exit(ret); X} XEOF Xif { eval echo configure:19791: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_link_nofollow=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_link_nofollow=no Xfi Xrm -fr conftest* Xfi X Xfi X Xeval echo "$ac_t""$ac_cv_link_nofollow" 1>&6 Xif test $ac_cv_link_nofollow = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_LINK_NOFOLLOW 1 XEOF X Xfi Xfor ac_hdr in unistd.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:19816: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:19826: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xecho $ac_n "checking if access() does implement E_OK""... $ac_c" 1>&6 Xecho "configure:19853: checking if access() does implement E_OK" >&5 Xif eval "test \"`echo '$''{'ac_cv_access_e_ok'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext < X# endif X#ifndef R_OK X#define R_OK 4 /* Test for Read permission */ X#define W_OK 2 /* Test for Write permission */ X#define X_OK 1 /* Test for eXecute permission */ X#define F_OK 0 /* Test for existence of File */ X#endif X X#ifndef E_OK X#ifdef EFF_ONLY_OK X#define E_OK EFF_ONLY_OK /* Irix */ X#else X#ifdef EUID_OK X#define E_OK EUID_OK /* UNICOS (0400) */ X#else X#define E_OK 010 /* Test effective uids */ X#endif X#endif X#endif X X#include X#ifndef HAVE_ERRNO_DEF Xextern int errno; X#endif X Xmain() X{ X#ifdef _MSC_VER X/* X * If we use "cl" to compile and call access(".", E_OK|F_OK), the program will X * cause an exception that results in a popup window. For this reason, the test X * is disabled for "cl", it would not work anyway. X */ X int ret = 1; X#else X int ret = 0; X X if (access(".", F_OK) != 0) X ret = 1; X else if (access(".", E_OK|F_OK) != 0) X ret = 1; X else if (access(".", (R_OK<<4)|F_OK) == 0) X ret = 1; X#endif X X exit(ret); X} XEOF Xif { eval echo configure:19914: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_access_e_ok=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_access_e_ok=no Xfi Xrm -fr conftest* Xfi X Xfi X Xeval echo "$ac_t""$ac_cv_access_e_ok" 1>&6 Xif test $ac_cv_access_e_ok = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_ACCESS_E_OK 1 XEOF X Xfi Xfor ac_hdr in fnmatch.h Xdo Xac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 Xecho "configure:19939: checking for $ac_hdr" >&5 Xif eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < XEOF Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" X{ eval echo configure:19949: \"$ac_try\" 1>&5; eval $ac_try 2>&5; } Xac_err=`tr -d '\015' < conftest.out | grep -v '^ *+' | grep -v "^conftest.${ac_ext}\$"` Xif test -z "$ac_err"; then X rm -rf conftest* X eval "ac_cv_header_$ac_safe=yes" Xelse X echo "$ac_err" >&5 X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_header_$ac_safe=no" Xfi Xrm -f conftest* Xfi Xif eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 Xfi Xdone X Xecho $ac_n "checking if fnmatch() does implement FNM_IGNORECASE or FNM_CASEFOLD""... $ac_c" 1>&6 Xecho "configure:19976: checking if fnmatch() does implement FNM_IGNORECASE or FNM_CASEFOLD" >&5 Xif eval "test \"`echo '$''{'ac_cv_fnmatch_igncase'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext < X#endif X X#ifndef FNM_IGNORECASE X#ifdef FNM_CASEFOLD X#define FNM_IGNORECASE FNM_CASEFOLD X#endif X#endif X Xmain() X{ X int ret; X X ret = fnmatch("a", "A", FNM_IGNORECASE); X exit(ret); X} XEOF Xif { eval echo configure:20005: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X ac_cv_fnmatch_igncase=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X ac_cv_fnmatch_igncase=no Xfi Xrm -fr conftest* Xfi X Xfi X Xeval echo "$ac_t""$ac_cv_fnmatch_igncase" 1>&6 Xif test $ac_cv_fnmatch_igncase = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_FNMATCH_IGNORECASE 1 XEOF X Xfi X Xecho $ac_n "checking for fseeko()""... $ac_c" 1>&6 Xecho "configure:20028: checking for fseeko()" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_fseeko'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < Xint main() { Xreturn !fseeko; X; return 0; } XEOF Xif { eval echo configure:20040: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X ac_cv_func_fseeko=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_func_fseeko=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_func_fseeko" 1>&6 Xif test $ac_cv_func_fseeko = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_FSEEKO 1 XEOF X Xfi Xecho $ac_n "checking for ftello()""... $ac_c" 1>&6 Xecho "configure:20060: checking for ftello()" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_ftello'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < Xint main() { Xreturn !ftello; X; return 0; } XEOF Xif { eval echo configure:20072: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X ac_cv_func_ftello=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_func_ftello=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_func_ftello" 1>&6 Xif test $ac_cv_func_ftello = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_FTELLO 1 XEOF X Xfi X Xecho $ac_n "checking for dlopen in -lc""... $ac_c" 1>&6 Xecho "configure:20093: checking for dlopen in -lc" >&5 Xac_lib_var=`echo c'_'dlopen | sed 'y%./+-%__p_%'` Xif eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_save_LIBS="$LIBS" XLIBS=`echo "-lc $LIBS" | sed -e 's/-lc //'` Xcat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=no" Xfi Xrm -f conftest* XLIBS="$ac_save_LIBS" X Xfi Xif eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X lib_dl="" Xelse X eval echo "$ac_t""no" 1>&6 Xecho $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 Xecho "configure:20131: checking for dlopen in -ldl" >&5 Xac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'` Xif eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_save_LIBS="$LIBS" XLIBS=`echo "-ldl $LIBS" | sed -e 's/-lc //'` Xcat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=no" Xfi Xrm -f conftest* XLIBS="$ac_save_LIBS" X Xfi Xif eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X lib_dl="-ldl" Xelse X eval echo "$ac_t""no" 1>&6 Xfi X Xfi X Xac_save_LIBS="$LIBS" XLIBS="$LIBS $lib_dl" Xfor ac_func in dlopen dlclose dlsym dlerror dlinfo Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:20177: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:20205: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in shl_load shl_unload shl_gethandle Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:20232: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:20260: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X XLIBS="$ac_save_LIBS" Xif test ."$lib_dl" = .""; then X cat >> confdefs.h <<\EOF X#define HAVE_DLOPEN_IN_LIBC 1 XEOF X Xfi X Xfor ac_func in LoadLibrary FreeLibrary GetProcAddress Xdo Xecho $ac_n "checking if $ac_func is defined or function""... $ac_c" 1>&6 Xecho "configure:20295: checking if $ac_func is defined or function" >&5 Xif eval "test \"`echo '$''{'"ac_cv_have_$ac_func"'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#endif X Xint main() { X X#ifndef $ac_func X char *p = (char *) $ac_func; X exit (p != (char *)0 && *p != 0); X#endif X; return 0; } XEOF Xif { eval echo configure:20319: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval ac_cv_have_$ac_func=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval ac_cv_have_$ac_func=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$"ac_cv_have_$ac_func"" 1>&6 X ac_tr_dfunc=HAVE_`echo $ac_func | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` Xif eval "test \"`echo '$ac_cv_have_'$ac_func`\" = yes"; then X cat >> confdefs.h <&6 Xecho "configure:20344: checking for socket in -lc" >&5 Xac_lib_var=`echo c'_'socket | sed 'y%./+-%__p_%'` Xif eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_save_LIBS="$LIBS" XLIBS=`echo "-lc $LIBS" | sed -e 's/-lc //'` Xcat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=no" Xfi Xrm -f conftest* XLIBS="$ac_save_LIBS" X Xfi Xif eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X lib_socket="" Xelse X eval echo "$ac_t""no" 1>&6 Xecho $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6 Xecho "configure:20382: checking for socket in -lsocket" >&5 Xac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'` Xif eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_save_LIBS="$LIBS" XLIBS=`echo "-lsocket $LIBS" | sed -e 's/-lc //'` Xcat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=no" Xfi Xrm -f conftest* XLIBS="$ac_save_LIBS" X Xfi Xif eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X lib_socket="-lsocket" Xelse X eval echo "$ac_t""no" 1>&6 Xfi X Xfi X XLIBS="$ac_save_LIBS" Xecho $ac_n "checking for gethostbyname in -lc""... $ac_c" 1>&6 Xecho "configure:20425: checking for gethostbyname in -lc" >&5 Xac_lib_var=`echo c'_'gethostbyname | sed 'y%./+-%__p_%'` Xif eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_save_LIBS="$LIBS" XLIBS=`echo "-lc $LIBS" | sed -e 's/-lc //'` Xcat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=no" Xfi Xrm -f conftest* XLIBS="$ac_save_LIBS" X Xfi Xif eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X lib_nsl="" Xelse X eval echo "$ac_t""no" 1>&6 Xecho $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 Xecho "configure:20463: checking for gethostbyname in -lnsl" >&5 Xac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` Xif eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_save_LIBS="$LIBS" XLIBS=`echo "-lnsl $LIBS" | sed -e 's/-lc //'` Xcat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=no" Xfi Xrm -f conftest* XLIBS="$ac_save_LIBS" X Xfi Xif eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X lib_nsl="-lnsl" Xelse X eval echo "$ac_t""no" 1>&6 Xecho $ac_n "checking for gethostbyname in -lnetwork""... $ac_c" 1>&6 Xecho "configure:20501: checking for gethostbyname in -lnetwork" >&5 Xac_lib_var=`echo network'_'gethostbyname | sed 'y%./+-%__p_%'` Xif eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_save_LIBS="$LIBS" XLIBS=`echo "-lnetwork $LIBS" | sed -e 's/-lc //'` Xcat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=no" Xfi Xrm -f conftest* XLIBS="$ac_save_LIBS" X Xfi Xif eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X lib_nsl="-lnetwork" Xelse X eval echo "$ac_t""no" 1>&6 Xfi X Xfi X Xfi X XLIBS="$ac_save_LIBS" XLIBS="$LIBS $lib_nsl $lib_socket" Xfor ac_func in rcmd socket socketpair Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:20549: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:20577: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in getservbyname inet_ntoa Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:20604: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:20632: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in getaddrinfo getnameinfo Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:20659: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:20687: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in host2netname netname2host Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:20714: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:20742: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X XLIBS="$ac_save_LIBS" X Xac_save_LIBS="$LIBS" Xecho $ac_n "checking for res_init in -lc""... $ac_c" 1>&6 Xecho "configure:20770: checking for res_init in -lc" >&5 Xac_lib_var=`echo c'_'res_init | sed 'y%./+-%__p_%'` Xif eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_save_LIBS="$LIBS" XLIBS=`echo "-lc $LIBS" | sed -e 's/-lc //'` Xcat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=no" Xfi Xrm -f conftest* XLIBS="$ac_save_LIBS" X Xfi Xif eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X lib_resolv="" Xelse X eval echo "$ac_t""no" 1>&6 Xecho $ac_n "checking for res_init in -lresolv""... $ac_c" 1>&6 Xecho "configure:20808: checking for res_init in -lresolv" >&5 Xac_lib_var=`echo resolv'_'res_init | sed 'y%./+-%__p_%'` Xif eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_save_LIBS="$LIBS" XLIBS=`echo "-lresolv $LIBS" | sed -e 's/-lc //'` Xcat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=no" Xfi Xrm -f conftest* XLIBS="$ac_save_LIBS" X Xfi Xif eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X lib_resolv="-lresolv" Xelse X eval echo "$ac_t""no" 1>&6 Xfi X Xfi X XLIBS="$ac_save_LIBS" Xif test ."$lib_resolv" = .""; then X cat >> confdefs.h <<\EOF X#define HAVE_RESOLV_IN_LIBC 1 XEOF X Xfi X X# Check whether --enable-largefile or --disable-largefile was given. Xif test "${enable_largefile+set}" = set; then X enableval="$enable_largefile" X : Xfi X X if test "$enable_largefile" != no; then X X echo $ac_n "checking for special C compiler options needed for large files""... $ac_c" 1>&6 Xecho "configure:20866: checking for special C compiler options needed for large files" >&5 Xif eval "test \"`echo '$''{'ac_cv_sys_largefile_CC'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_cv_sys_largefile_CC=no X largefile_cc_opt="" X if test "$GCC" != yes; then X # IRIX 6.2 and later do not support large files by default, X # so use the C compiler's -n32 option if that helps. X cat > conftest.$ac_ext < X /* Check that off_t can represent 2**63 - 1 correctly. X We can't simply "#define LARGE_OFF_T 9223372036854775807", X since some C++ compilers masquerading as C compilers X incorrectly reject 9223372036854775807. */ X# define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) X int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 X && LARGE_OFF_T % 2147483647 == 1) X ? 1 : -1]; X Xint main() { X X; return 0; } XEOF Xif { eval echo configure:20892: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X : Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_save_CC="${CC-cc}" X CC="$CC -n32" X cat > conftest.$ac_ext < X /* Check that off_t can represent 2**63 - 1 correctly. X We can't simply "#define LARGE_OFF_T 9223372036854775807", X since some C++ compilers masquerading as C compilers X incorrectly reject 9223372036854775807. */ X# define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) X int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 X && LARGE_OFF_T % 2147483647 == 1) X ? 1 : -1]; X Xint main() { X X; return 0; } XEOF Xif { eval echo configure:20917: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_sys_largefile_CC=' -n32' Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 Xfi Xrm -f conftest* X CC="$ac_save_CC" Xfi Xrm -f conftest* X fi Xfi X Xeval echo "$ac_t""$ac_cv_sys_largefile_CC" 1>&6 X if test "$ac_cv_sys_largefile_CC" != no; then X CC="$CC$ac_cv_sys_largefile_CC" X largefile_cc_opt="$ac_cv_sys_largefile_CC" X fi X X echo $ac_n "checking for _FILE_OFFSET_BITS value needed for large files""... $ac_c" 1>&6 Xecho "configure:20938: checking for _FILE_OFFSET_BITS value needed for large files" >&5 Xif eval "test \"`echo '$''{'ac_cv_sys_file_offset_bits'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_cv_sys_file_offset_bits=no X cat > conftest.$ac_ext < X /* Check that off_t can represent 2**63 - 1 correctly. X We can't simply "#define LARGE_OFF_T 9223372036854775807", X since some C++ compilers masquerading as C compilers X incorrectly reject 9223372036854775807. */ X# define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) X int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 X && LARGE_OFF_T % 2147483647 == 1) X ? 1 : -1]; X Xint main() { X X; return 0; } XEOF Xif { eval echo configure:20960: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X : Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X cat > conftest.$ac_ext < X /* Check that off_t can represent 2**63 - 1 correctly. X We can't simply "#define LARGE_OFF_T 9223372036854775807", X since some C++ compilers masquerading as C compilers X incorrectly reject 9223372036854775807. */ X# define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) X int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 X && LARGE_OFF_T % 2147483647 == 1) X ? 1 : -1]; X X Xint main() { X X; return 0; } XEOF Xif { eval echo configure:20985: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_sys_file_offset_bits=64 Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 Xfi Xrm -f conftest* Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_sys_file_offset_bits" 1>&6 X if test "$ac_cv_sys_file_offset_bits" != no; then X cat >> confdefs.h <&6 Xecho "configure:21005: checking for _LARGE_FILES value needed for large files" >&5 Xif eval "test \"`echo '$''{'ac_cv_sys_large_files'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_cv_sys_large_files=no X cat > conftest.$ac_ext < X /* Check that off_t can represent 2**63 - 1 correctly. X We can't simply "#define LARGE_OFF_T 9223372036854775807", X since some C++ compilers masquerading as C compilers X incorrectly reject 9223372036854775807. */ X# define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) X int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 X && LARGE_OFF_T % 2147483647 == 1) X ? 1 : -1]; X Xint main() { X X; return 0; } XEOF Xif { eval echo configure:21027: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X : Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X cat > conftest.$ac_ext < X /* Check that off_t can represent 2**63 - 1 correctly. X We can't simply "#define LARGE_OFF_T 9223372036854775807", X since some C++ compilers masquerading as C compilers X incorrectly reject 9223372036854775807. */ X# define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) X int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 X && LARGE_OFF_T % 2147483647 == 1) X ? 1 : -1]; X X Xint main() { X X; return 0; } XEOF Xif { eval echo configure:21052: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_sys_large_files=1 Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 Xfi Xrm -f conftest* Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_sys_large_files" 1>&6 X if test "$ac_cv_sys_large_files" != no; then X cat >> confdefs.h <&6 Xecho "configure:21072: checking for _LARGEFILE_SOURCE value needed for large files" >&5 Xif eval "test \"`echo '$''{'ac_cv_sys_largefile_source'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_cv_sys_largefile_source=no X cat > conftest.$ac_ext < Xint main() { Xreturn !fseeko; X; return 0; } XEOF Xif { eval echo configure:21085: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X : Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X cat > conftest.$ac_ext < X Xint main() { Xreturn !fseeko; X; return 0; } XEOF Xif { eval echo configure:21101: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_sys_largefile_source=1 Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 Xfi Xrm -f conftest* Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_sys_largefile_source" 1>&6 X if test "$ac_cv_sys_largefile_source" != no; then X cat >> confdefs.h <&6 Xecho "configure:21123: checking if system supports Large Files at all" >&5 Xif eval "test \"`echo '$''{'ac_cv_largefiles'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#include Xint main() { X X/* X * Check that off_t can represent 2**63 - 1 correctly. X * We can't simply "#define LARGE_OFF_T 9223372036854775807", X * since some C++ compilers masquerading as C compilers X * incorrectly reject 9223372036854775807. X */ X# define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) X int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 X && LARGE_OFF_T % 2147483647 == 1) X ? 1 : -1]; Xreturn !fseeko; Xreturn !ftello; X; return 0; } XEOF Xif { eval echo configure:21148: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_largefiles=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_largefiles=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_largefiles" 1>&6 X if test $ac_cv_largefiles = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_LARGEFILES 1 XEOF X X fi X Xcat >> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <> confdefs.h <&6 Xecho "configure:21191: checking for crypt in -lc" >&5 Xac_lib_var=`echo c'_'crypt | sed 'y%./+-%__p_%'` Xif eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_save_LIBS="$LIBS" XLIBS=`echo "-lc $LIBS" | sed -e 's/-lc //'` Xcat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=no" Xfi Xrm -f conftest* XLIBS="$ac_save_LIBS" X Xfi Xif eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X lib_crypt="" Xelse X eval echo "$ac_t""no" 1>&6 Xecho $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6 Xecho "configure:21229: checking for crypt in -lcrypt" >&5 Xac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'` Xif eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_save_LIBS="$LIBS" XLIBS=`echo "-lcrypt $LIBS" | sed -e 's/-lc //'` Xcat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=no" Xfi Xrm -f conftest* XLIBS="$ac_save_LIBS" X Xfi Xif eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X lib_crypt="-lcrypt" Xelse X eval echo "$ac_t""no" 1>&6 Xfi X Xfi X Xif test ."$lib_crypt" = .""; then X cat >> confdefs.h <<\EOF X#define HAVE_CRYPT_IN_LIBC 1 XEOF X Xfi X Xac_save_LIBS="$LIBS" XLIBS="$LIBS $lib_crypt" Xfor ac_func in crypt Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:21282: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:21310: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X XLIBS="$ac_save_LIBS" X Xecho $ac_n "checking for gettext in -lc""... $ac_c" 1>&6 Xecho "configure:21337: checking for gettext in -lc" >&5 Xac_lib_var=`echo c'_'gettext | sed 'y%./+-%__p_%'` Xif eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_save_LIBS="$LIBS" XLIBS="-lc $LIBS" Xcat > conftest.$ac_ext < Xint main() { X X char *p = (char *) gettext; X X return ((int)p); X X; return 0; } XEOF Xif { eval echo configure:21356: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=no" Xfi Xrm -f conftest* XLIBS="$ac_save_LIBS" X Xfi Xif eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X lib_intl="" Xelse X eval echo "$ac_t""no" 1>&6 Xecho $ac_n "checking for gettext in -lintl""... $ac_c" 1>&6 Xecho "configure:21375: checking for gettext in -lintl" >&5 Xac_lib_var=`echo intl'_'gettext | sed 'y%./+-%__p_%'` Xif eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_save_LIBS="$LIBS" XLIBS="-lintl $LIBS" Xcat > conftest.$ac_ext < Xint main() { X X char *p = (char *) gettext; X X return ((int)p); X X; return 0; } XEOF Xif { eval echo configure:21394: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=no" Xfi Xrm -f conftest* XLIBS="$ac_save_LIBS" X Xfi Xif eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X lib_intl="-lintl" Xelse X eval echo "$ac_t""no" 1>&6 Xfi X Xfi X Xif test ."$lib_intl" = .""; then X cat >> confdefs.h <<\EOF X#define HAVE_GETTEXT_IN_LIBC 1 XEOF X Xfi X Xac_save_LIBS="$LIBS" XLIBS="$LIBS $lib_intl" Xecho $ac_n "checking if gettext is defined or function""... $ac_c" 1>&6 Xecho "configure:21426: checking if gettext is defined or function" >&5 Xif eval "test \"`echo '$''{'"ac_cv_have_gettext"'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < Xint main() { X X#ifndef gettext X char *p = (char *) gettext; X exit (p != (char *)0 && *p != 0); X#endif X; return 0; } XEOF Xif { eval echo configure:21442: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval ac_cv_have_gettext=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval ac_cv_have_gettext=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$"ac_cv_have_gettext"" 1>&6 X ac_tr_dfunc=HAVE_`echo gettext | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` Xif eval "test \"`echo '$ac_cv_have_'gettext`\" = yes"; then X cat >> confdefs.h <&6 Xecho "configure:21466: checking for iconv_open in -lc" >&5 Xac_lib_var=`echo c'_'iconv_open | sed 'y%./+-%__p_%'` Xif eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_save_LIBS="$LIBS" XLIBS="-lc $LIBS" Xcat > conftest.$ac_ext < Xint main() { X X char *p = (char *) iconv_open; X X return ((int)p); X X; return 0; } XEOF Xif { eval echo configure:21485: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=no" Xfi Xrm -f conftest* XLIBS="$ac_save_LIBS" X Xfi Xif eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X lib_iconv="" Xelse X eval echo "$ac_t""no" 1>&6 Xecho $ac_n "checking for iconv_open in -liconv""... $ac_c" 1>&6 Xecho "configure:21504: checking for iconv_open in -liconv" >&5 Xac_lib_var=`echo iconv'_'iconv_open | sed 'y%./+-%__p_%'` Xif eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_save_LIBS="$LIBS" XLIBS="-liconv $LIBS" Xcat > conftest.$ac_ext < Xint main() { X X char *p = (char *) iconv_open; X X return ((int)p); X X; return 0; } XEOF Xif { eval echo configure:21523: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=no" Xfi Xrm -f conftest* XLIBS="$ac_save_LIBS" X Xfi Xif eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X lib_iconv="-liconv" Xelse X eval echo "$ac_t""no" 1>&6 Xfi X Xfi X Xif test ."$lib_iconv" = .""; then X cat >> confdefs.h <<\EOF X#define HAVE_ICONV_IN_LIBC 1 XEOF X Xfi X Xac_save_LIBS="$LIBS" XLIBS="$LIBS $lib_iconv" Xecho $ac_n "checking if iconv is defined or function""... $ac_c" 1>&6 Xecho "configure:21555: checking if iconv is defined or function" >&5 Xif eval "test \"`echo '$''{'"ac_cv_have_iconv"'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < Xint main() { X X#ifndef iconv X char *p = (char *) iconv; X exit (p != (char *)0 && *p != 0); X#endif X; return 0; } XEOF Xif { eval echo configure:21571: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval ac_cv_have_iconv=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval ac_cv_have_iconv=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$"ac_cv_have_iconv"" 1>&6 X ac_tr_dfunc=HAVE_`echo iconv | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` Xif eval "test \"`echo '$ac_cv_have_'iconv`\" = yes"; then X cat >> confdefs.h <&6 Xecho "configure:21593: checking if iconv_open is defined or function" >&5 Xif eval "test \"`echo '$''{'"ac_cv_have_iconv_open"'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < Xint main() { X X#ifndef iconv_open X char *p = (char *) iconv_open; X exit (p != (char *)0 && *p != 0); X#endif X; return 0; } XEOF Xif { eval echo configure:21609: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval ac_cv_have_iconv_open=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval ac_cv_have_iconv_open=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$"ac_cv_have_iconv_open"" 1>&6 X ac_tr_dfunc=HAVE_`echo iconv_open | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` Xif eval "test \"`echo '$ac_cv_have_'iconv_open`\" = yes"; then X cat >> confdefs.h <&6 Xecho "configure:21631: checking if iconv_close is defined or function" >&5 Xif eval "test \"`echo '$''{'"ac_cv_have_iconv_close"'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < Xint main() { X X#ifndef iconv_close X char *p = (char *) iconv_close; X exit (p != (char *)0 && *p != 0); X#endif X; return 0; } XEOF Xif { eval echo configure:21647: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval ac_cv_have_iconv_close=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval ac_cv_have_iconv_close=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$"ac_cv_have_iconv_close"" 1>&6 X ac_tr_dfunc=HAVE_`echo iconv_close | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` Xif eval "test \"`echo '$ac_cv_have_'iconv_close`\" = yes"; then X cat >> confdefs.h <&6 Xecho "configure:21669: checking if libiconv is defined or function" >&5 Xif eval "test \"`echo '$''{'"ac_cv_have_libiconv"'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < Xint main() { X X#ifndef libiconv X char *p = (char *) libiconv; X exit (p != (char *)0 && *p != 0); X#endif X; return 0; } XEOF Xif { eval echo configure:21685: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval ac_cv_have_libiconv=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval ac_cv_have_libiconv=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$"ac_cv_have_libiconv"" 1>&6 X ac_tr_dfunc=HAVE_`echo libiconv | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` Xif eval "test \"`echo '$ac_cv_have_'libiconv`\" = yes"; then X cat >> confdefs.h <&6 Xecho "configure:21707: checking if libiconv_open is defined or function" >&5 Xif eval "test \"`echo '$''{'"ac_cv_have_libiconv_open"'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < Xint main() { X X#ifndef libiconv_open X char *p = (char *) libiconv_open; X exit (p != (char *)0 && *p != 0); X#endif X; return 0; } XEOF Xif { eval echo configure:21723: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval ac_cv_have_libiconv_open=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval ac_cv_have_libiconv_open=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$"ac_cv_have_libiconv_open"" 1>&6 X ac_tr_dfunc=HAVE_`echo libiconv_open | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` Xif eval "test \"`echo '$ac_cv_have_'libiconv_open`\" = yes"; then X cat >> confdefs.h <&6 Xecho "configure:21745: checking if libiconv_close is defined or function" >&5 Xif eval "test \"`echo '$''{'"ac_cv_have_libiconv_close"'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < Xint main() { X X#ifndef libiconv_close X char *p = (char *) libiconv_close; X exit (p != (char *)0 && *p != 0); X#endif X; return 0; } XEOF Xif { eval echo configure:21761: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval ac_cv_have_libiconv_close=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval ac_cv_have_libiconv_close=no Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$"ac_cv_have_libiconv_close"" 1>&6 X ac_tr_dfunc=HAVE_`echo libiconv_close | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` Xif eval "test \"`echo '$ac_cv_have_'libiconv_close`\" = yes"; then X cat >> confdefs.h <&6 Xecho "configure:21785: checking for XML_Parse in -lc" >&5 Xac_lib_var=`echo c'_'XML_Parse | sed 'y%./+-%__p_%'` Xif eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_save_LIBS="$LIBS" XLIBS=`echo "-lc $LIBS" | sed -e 's/-lc //'` Xcat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=no" Xfi Xrm -f conftest* XLIBS="$ac_save_LIBS" X Xfi Xif eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X lib_expat="" Xelse X eval echo "$ac_t""no" 1>&6 Xecho $ac_n "checking for XML_Parse in -lexpat""... $ac_c" 1>&6 Xecho "configure:21823: checking for XML_Parse in -lexpat" >&5 Xac_lib_var=`echo expat'_'XML_Parse | sed 'y%./+-%__p_%'` Xif eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_save_LIBS="$LIBS" XLIBS=`echo "-lexpat $LIBS" | sed -e 's/-lc //'` Xcat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=no" Xfi Xrm -f conftest* XLIBS="$ac_save_LIBS" X Xfi Xif eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X lib_expat="-lexpat" Xelse X eval echo "$ac_t""no" 1>&6 Xfi X Xfi X Xif test ."$lib_expat" = ."" -a "$ac_cv_lib_c_XML_Parse" = yes ; then X cat >> confdefs.h <<\EOF X#define HAVE_EXPAT_IN_LIBC 1 XEOF X Xfi Xac_save_LIBS="$LIBS" XLIBS="$LIBS $lib_expat" Xfor ac_func in XML_Parse Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:21875: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:21903: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X XLIBS="$ac_save_LIBS" X Xif test "$CC" = cl.exe; then X echo configure does not yet support library checks for cl.exe: X echo checking for SCardEstablishContext in -lwinscard... we know it is present X lib_pcsc="-lwinscard" X cat >> confdefs.h <<\EOF X#define HAVE_SCARDESTABLISHCONTEXT 1 XEOF X Xelse X echo $ac_n "checking for SCardEstablishContext in -lc""... $ac_c" 1>&6 Xecho "configure:21939: checking for SCardEstablishContext in -lc" >&5 Xac_lib_var=`echo c'_'SCardEstablishContext | sed 'y%./+-%__p_%'` Xif eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_save_LIBS="$LIBS" XLIBS=`echo "-lc $LIBS" | sed -e 's/-lc //'` Xcat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=no" Xfi Xrm -f conftest* XLIBS="$ac_save_LIBS" X Xfi Xif eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X lib_pcsc="" Xelse X eval echo "$ac_t""no" 1>&6 Xecho $ac_n "checking for SCardEstablishContext in -lwinscard""... $ac_c" 1>&6 Xecho "configure:21977: checking for SCardEstablishContext in -lwinscard" >&5 Xac_lib_var=`echo winscard'_'SCardEstablishContext | sed 'y%./+-%__p_%'` Xif eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_save_LIBS="$LIBS" XLIBS=`echo "-lwinscard $LIBS" | sed -e 's/-lc //'` Xcat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=no" Xfi Xrm -f conftest* XLIBS="$ac_save_LIBS" X Xfi Xif eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X lib_pcsc="-lwinscard" Xelse X eval echo "$ac_t""no" 1>&6 Xecho $ac_n "checking for SCardEstablishContext in -lpcsclite""... $ac_c" 1>&6 Xecho "configure:22015: checking for SCardEstablishContext in -lpcsclite" >&5 Xac_lib_var=`echo pcsclite'_'SCardEstablishContext | sed 'y%./+-%__p_%'` Xif eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_save_LIBS="$LIBS" XLIBS=`echo "-lpcsclite $LIBS" | sed -e 's/-lc //'` Xcat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=no" Xfi Xrm -f conftest* XLIBS="$ac_save_LIBS" X Xfi Xif eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X lib_pcsc="-lpcsclite" Xelse X eval echo "$ac_t""no" 1>&6 Xfi X Xfi X Xfi X X if test ."$lib_pcsc" = ."" -a "$ac_cv_lib_c_SCardEstablishContext" = yes ; then X cat >> confdefs.h <<\EOF X#define HAVE_PCSC_IN_LIBC 1 XEOF X X fi X ac_save_LIBS="$LIBS" X LIBS="$LIBS $lib_pcsc" X for ac_func in SCardEstablishContext Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:22069: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:22097: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X X LIBS="$ac_save_LIBS" Xfi X Xif test "$CC" = cl.exe; then X echo configure does not yet support library checks for cl.exe: X echo checking for CRYPTO_free in -llibeay32... we know it is present X echo checking for SSL_free in -lssleay32... we know it is present X lib_crypto="-llibeay32" X lib_ssl="-lssleay32" Xelse X echo $ac_n "checking for CRYPTO_free in -lc""... $ac_c" 1>&6 Xecho "configure:22132: checking for CRYPTO_free in -lc" >&5 Xac_lib_var=`echo c'_'CRYPTO_free | sed 'y%./+-%__p_%'` Xif eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_save_LIBS="$LIBS" XLIBS=`echo "-lc $LIBS" | sed -e 's/-lc //'` Xcat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=no" Xfi Xrm -f conftest* XLIBS="$ac_save_LIBS" X Xfi Xif eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X lib_crypto="" Xelse X eval echo "$ac_t""no" 1>&6 Xecho $ac_n "checking for CRYPTO_free in -lcrypto""... $ac_c" 1>&6 Xecho "configure:22170: checking for CRYPTO_free in -lcrypto" >&5 Xac_lib_var=`echo crypto'_'CRYPTO_free | sed 'y%./+-%__p_%'` Xif eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_save_LIBS="$LIBS" XLIBS=`echo "-lcrypto $LIBS" | sed -e 's/-lc //'` Xcat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=no" Xfi Xrm -f conftest* XLIBS="$ac_save_LIBS" X Xfi Xif eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X lib_crypto="-lcrypto" Xelse X eval echo "$ac_t""no" 1>&6 Xfi X Xfi X X if test ."$lib_crypto" = ."" -a "$ac_cv_lib_c_CRYPTO_free" = yes ; then X cat >> confdefs.h <<\EOF X#define HAVE_CRYPTO_IN_LIBC 1 XEOF X X fi X ac_save_LIBS="$LIBS" X LIBS="$LIBS $lib_crypto" X for ac_func in CRYPTO_free Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:22222: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:22250: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X X LIBS="$ac_save_LIBS" X echo $ac_n "checking for SSL_free in -lc""... $ac_c" 1>&6 Xecho "configure:22276: checking for SSL_free in -lc" >&5 Xac_lib_var=`echo c'_'SSL_free | sed 'y%./+-%__p_%'` Xif eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_save_LIBS="$LIBS" XLIBS=`echo "-lc $LIBS" | sed -e 's/-lc //'` Xcat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=no" Xfi Xrm -f conftest* XLIBS="$ac_save_LIBS" X Xfi Xif eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X lib_ssl="" Xelse X eval echo "$ac_t""no" 1>&6 Xecho $ac_n "checking for SSL_free in -lssl""... $ac_c" 1>&6 Xecho "configure:22314: checking for SSL_free in -lssl" >&5 Xac_lib_var=`echo ssl'_'SSL_free | sed 'y%./+-%__p_%'` Xif eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_save_LIBS="$LIBS" XLIBS=`echo "-lssl $LIBS" | sed -e 's/-lc //'` Xcat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=no" Xfi Xrm -f conftest* XLIBS="$ac_save_LIBS" X Xfi Xif eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X lib_ssl="-lssl" Xelse X eval echo "$ac_t""no" 1>&6 Xfi X Xfi X X if test ."$lib_ssl" = ."" -a "$ac_cv_lib_c_SSL_free" = yes ; then X cat >> confdefs.h <<\EOF X#define HAVE_SSL_IN_LIBC 1 XEOF X X fi X ac_save_LIBS="$LIBS" X LIBS="$LIBS $lib_ssl" X for ac_func in SSL_free Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:22366: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:22394: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X X LIBS="$ac_save_LIBS" Xfi X Xif test $ac_cv_header_camlib_h = yes; then X scsi_lib=-lcam X lib_scsi=-lcam Xfi X Xif test "$ac_cv_header_sys_acl_h" = yes; then X X echo "checking for Posix Access Control List support" 1>&6 Xecho "configure:22429: checking for Posix Access Control List support" >&5 X echo $ac_n "checking for acl_get_file in -lacl""... $ac_c" 1>&6 Xecho "configure:22431: checking for acl_get_file in -lacl" >&5 Xac_lib_var=`echo acl'_'acl_get_file | sed 'y%./+-%__p_%'` Xif eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_save_LIBS="$LIBS" XLIBS=`echo "-lacl $LIBS" | sed -e 's/-lc //'` Xcat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=no" Xfi Xrm -f conftest* XLIBS="$ac_save_LIBS" X Xfi Xif eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X lib_acl="-lacl" Xelse X eval echo "$ac_t""no" 1>&6 Xfi X X echo $ac_n "checking for acl_get_file in -lpacl""... $ac_c" 1>&6 Xecho "configure:22471: checking for acl_get_file in -lpacl" >&5 Xac_lib_var=`echo pacl'_'acl_get_file | sed 'y%./+-%__p_%'` Xif eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_save_LIBS="$LIBS" XLIBS=`echo "-lpacl $LIBS" | sed -e 's/-lc //'` Xcat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=no" Xfi Xrm -f conftest* XLIBS="$ac_save_LIBS" X Xfi Xif eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X lib_acl="-lpacl" Xelse X eval echo "$ac_t""no" 1>&6 Xfi X X X X if test ".$lib_acl" != .; then X lib_acl_test="$lib_acl" X fi X X ac_save_LIBS="$LIBS" X LIBS="$LIBS $lib_acl" X for ac_func in acl_get_file acl_set_file acl_from_text acl_to_text acl_free acl_delete_def_file Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:22521: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:22549: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X X for ac_func in acl_extended_file Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:22576: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:22604: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X X for ac_func in acl_get_entry Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:22631: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:22659: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X X for ac_func in acl_to_text_np acl_get_brand_np acl_is_trivial_np acl_strip_np Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:22686: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:22714: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X X LIBS="$ac_save_LIBS" X X echo "checking for Solaris UFS Access Control List support" 1>&6 Xecho "configure:22741: checking for Solaris UFS Access Control List support" >&5 X echo $ac_n "checking for acltotext in -lsec""... $ac_c" 1>&6 Xecho "configure:22743: checking for acltotext in -lsec" >&5 Xac_lib_var=`echo sec'_'acltotext | sed 'y%./+-%__p_%'` Xif eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_save_LIBS="$LIBS" XLIBS=`echo "-lsec $LIBS" | sed -e 's/-lc //'` Xcat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=no" Xfi Xrm -f conftest* XLIBS="$ac_save_LIBS" X Xfi Xif eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X lib_acl="-lsec" Xelse X eval echo "$ac_t""no" 1>&6 Xfi X X ac_save_LIBS="$LIBS" X LIBS="$LIBS $lib_acl" X for ac_func in acl facl aclfromtext acltotext Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:22787: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:22815: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X X X echo "checking for NFSv4 Access Control List support" 1>&6 Xecho "configure:22841: checking for NFSv4 Access Control List support" >&5 X for ac_func in acl_get acl_set facl_get facl_set acl_fromtext acl_totext Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:22845: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:22873: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X X LIBS="$ac_save_LIBS" X X X echo "checking for HP-UX Access Control List support" 1>&6 Xecho "configure:22901: checking for HP-UX Access Control List support" >&5 X for ac_func in getacl fgetacl setacl fsetacl strtoacl acltostr cpacl fcpacl chownacl setaclentry fsetaclentry Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:22905: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:22933: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X X X Xfi X Xif test "$ac_cv_header_attr_xattr_h" = yes || test "$ac_cv_header_sys_xattr_h" = yes; then X echo "checking for Linux flavor Extended Attribute support" 1>&6 Xecho "configure:22963: checking for Linux flavor Extended Attribute support" >&5 X echo $ac_n "checking for getxattr in -lc""... $ac_c" 1>&6 Xecho "configure:22965: checking for getxattr in -lc" >&5 Xac_lib_var=`echo c'_'getxattr | sed 'y%./+-%__p_%'` Xif eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_save_LIBS="$LIBS" XLIBS=`echo "-lc $LIBS" | sed -e 's/-lc //'` Xcat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=no" Xfi Xrm -f conftest* XLIBS="$ac_save_LIBS" X Xfi Xif eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X lib_rt="" Xelse X eval echo "$ac_t""no" 1>&6 Xecho $ac_n "checking for getxattr in -lattr""... $ac_c" 1>&6 Xecho "configure:23003: checking for getxattr in -lattr" >&5 Xac_lib_var=`echo attr'_'getxattr | sed 'y%./+-%__p_%'` Xif eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_save_LIBS="$LIBS" XLIBS=`echo "-lattr $LIBS" | sed -e 's/-lc //'` Xcat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=no" Xfi Xrm -f conftest* XLIBS="$ac_save_LIBS" X Xfi Xif eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X lib_attr="-lattr" Xelse X eval echo "$ac_t""no" 1>&6 Xfi X Xfi X X ac_save_LIBS="$LIBS" X LIBS="$LIBS $lib_attr" X for ac_func in getxattr setxattr listxattr lgetxattr lsetxattr llistxattr Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:23049: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:23077: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X X LIBS="$ac_save_LIBS" Xfi X Xecho "checking for RBAC support" 1>&6 Xecho "configure:23105: checking for RBAC support" >&5 Xecho $ac_n "checking for getuserattr in -lsecdb""... $ac_c" 1>&6 Xecho "configure:23107: checking for getuserattr in -lsecdb" >&5 Xac_lib_var=`echo secdb'_'getuserattr | sed 'y%./+-%__p_%'` Xif eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_save_LIBS="$LIBS" XLIBS=`echo "-lsecdb $LIBS" | sed -e 's/-lc //'` Xcat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=no" Xfi Xrm -f conftest* XLIBS="$ac_save_LIBS" X Xfi Xif eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X lib_secdb="-lsecdb" Xelse X eval echo "$ac_t""no" 1>&6 Xfi X Xac_save_LIBS="$LIBS" XLIBS="$LIBS $lib_secdb" Xfor ac_func in getauthattr getuserattr getexecattr getprofattr Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:23151: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:23179: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X XLIBS="$ac_save_LIBS" X Xecho "checking for gmatch() support" 1>&6 Xecho "configure:23206: checking for gmatch() support" >&5 Xecho $ac_n "checking for gmatch in -lgen""... $ac_c" 1>&6 Xecho "configure:23208: checking for gmatch in -lgen" >&5 Xac_lib_var=`echo gen'_'gmatch | sed 'y%./+-%__p_%'` Xif eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_save_LIBS="$LIBS" XLIBS=`echo "-lgen $LIBS" | sed -e 's/-lc //'` Xcat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=no" Xfi Xrm -f conftest* XLIBS="$ac_save_LIBS" X Xfi Xif eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X lib_gen="-lgen" Xelse X eval echo "$ac_t""no" 1>&6 Xfi X Xac_save_LIBS="$LIBS" XLIBS="$LIBS $lib_gen" Xfor ac_func in gmatch Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:23252: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:23280: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X XLIBS="$ac_save_LIBS" X Xecho "checking for ELF support" 1>&6 Xecho "configure:23307: checking for ELF support" >&5 Xecho $ac_n "checking for elf_begin in -lelf""... $ac_c" 1>&6 Xecho "configure:23309: checking for elf_begin in -lelf" >&5 Xac_lib_var=`echo elf'_'elf_begin | sed 'y%./+-%__p_%'` Xif eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_save_LIBS="$LIBS" XLIBS=`echo "-lelf $LIBS" | sed -e 's/-lc //'` Xcat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=no" Xfi Xrm -f conftest* XLIBS="$ac_save_LIBS" X Xfi Xif eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X lib_elf="-lelf" Xelse X eval echo "$ac_t""no" 1>&6 Xfi X Xac_save_LIBS="$LIBS" XLIBS="$LIBS $lib_elf" Xfor ac_func in elf_begin Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:23353: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:23381: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X XLIBS="$ac_save_LIBS" X Xfor ac_func in thr_yield Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:23410: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:23438: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X X X Xecho $ac_n "checking for pthread_create in -lc""... $ac_c" 1>&6 Xecho "configure:23465: checking for pthread_create in -lc" >&5 Xac_lib_var=`echo c'_'pthread_create | sed 'y%./+-%__p_%'` Xif eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_save_LIBS="$LIBS" XLIBS=`echo "-lc $LIBS" | sed -e 's/-lc //'` Xcat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=no" Xfi Xrm -f conftest* XLIBS="$ac_save_LIBS" X Xfi Xif eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X lib_pthread="" Xelse X eval echo "$ac_t""no" 1>&6 Xecho $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 Xecho "configure:23503: checking for pthread_create in -lpthread" >&5 Xac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'` Xif eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_save_LIBS="$LIBS" XLIBS=`echo "-lpthread $LIBS" | sed -e 's/-lc //'` Xcat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=no" Xfi Xrm -f conftest* XLIBS="$ac_save_LIBS" X Xfi Xif eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X lib_pthread="-lpthread" Xelse X eval echo "$ac_t""no" 1>&6 Xfi X Xfi X X Xac_save_LIBS="$LIBS" XLIBS="$LIBS $lib_pthread" Xfor ac_func in pthread_create pthread_kill Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:23550: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:23578: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in pthread_mutex_lock pthread_cond_wait pthread_spin_lock Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:23605: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:23633: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X XLIBS="$ac_save_LIBS" X Xecho $ac_n "checking for clock_gettime in -lc""... $ac_c" 1>&6 Xecho "configure:23660: checking for clock_gettime in -lc" >&5 Xac_lib_var=`echo c'_'clock_gettime | sed 'y%./+-%__p_%'` Xif eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_save_LIBS="$LIBS" XLIBS=`echo "-lc $LIBS" | sed -e 's/-lc //'` Xcat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=no" Xfi Xrm -f conftest* XLIBS="$ac_save_LIBS" X Xfi Xif eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X lib_rt="" Xelse X eval echo "$ac_t""no" 1>&6 Xecho $ac_n "checking for clock_gettime in -lrt""... $ac_c" 1>&6 Xecho "configure:23698: checking for clock_gettime in -lrt" >&5 Xac_lib_var=`echo rt'_'clock_gettime | sed 'y%./+-%__p_%'` Xif eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_save_LIBS="$LIBS" XLIBS=`echo "-lrt $LIBS" | sed -e 's/-lc //'` Xcat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=no" Xfi Xrm -f conftest* XLIBS="$ac_save_LIBS" X Xfi Xif eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X lib_rt="-lrt" Xelse X eval echo "$ac_t""no" 1>&6 Xecho $ac_n "checking for clock_gettime in -lposix4""... $ac_c" 1>&6 Xecho "configure:23736: checking for clock_gettime in -lposix4" >&5 Xac_lib_var=`echo posix4'_'clock_gettime | sed 'y%./+-%__p_%'` Xif eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_save_LIBS="$LIBS" XLIBS=`echo "-lposix4 $LIBS" | sed -e 's/-lc //'` Xcat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=no" Xfi Xrm -f conftest* XLIBS="$ac_save_LIBS" X Xfi Xif eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X lib_rt="-lposix4" Xelse X eval echo "$ac_t""no" 1>&6 Xfi X Xfi X Xfi X Xif test ."$lib_rt" = .""; then X cat >> confdefs.h <<\EOF X#define HAVE_CLOCK_GETTIME_IN_LIBC 1 XEOF X Xfi X Xac_save_LIBS="$LIBS" XLIBS="$LIBS $lib_rt" Xfor ac_func in clock_gettime clock_settime clock_getres Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:23791: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:23819: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in sched_getparam sched_setparam sched_getscheduler sched_setscheduler Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:23846: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:23874: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in sched_yield Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:23901: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:23929: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X Xfor ac_func in nanosleep Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:23956: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:23984: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X XLIBS="$ac_save_LIBS" X Xecho $ac_n "checking for cap_get_proc in -lcap""... $ac_c" 1>&6 Xecho "configure:24011: checking for cap_get_proc in -lcap" >&5 Xac_lib_var=`echo cap'_'cap_get_proc | sed 'y%./+-%__p_%'` Xif eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_save_LIBS="$LIBS" XLIBS=`echo "-lcap $LIBS" | sed -e 's/-lc //'` Xcat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=no" Xfi Xrm -f conftest* XLIBS="$ac_save_LIBS" X Xfi Xif eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X lib_cap="-lcap" Xelse X eval echo "$ac_t""no" 1>&6 Xfi X Xac_save_LIBS="$LIBS" XLIBS="$LIBS $lib_cap" Xfor ac_func in cap_get_proc cap_set_proc cap_set_flag cap_clear_flag Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:24055: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:24083: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X XLIBS="$ac_save_LIBS" X Xif test "$ac_cv_header_selinux_selinux_h" = yes; then X echo "checking for SELinux support" 1>&6 Xecho "configure:24111: checking for SELinux support" >&5 X ac_save_LIBS="$LIBS" X LIBS="$LIBS $lib_attr" X echo $ac_n "checking for is_selinux_enabled in -lselinux""... $ac_c" 1>&6 Xecho "configure:24115: checking for is_selinux_enabled in -lselinux" >&5 Xac_lib_var=`echo selinux'_'is_selinux_enabled | sed 'y%./+-%__p_%'` Xif eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ac_save_LIBS="$LIBS" XLIBS=`echo "-lselinux $LIBS" | sed -e 's/-lc //'` Xcat > conftest.$ac_ext <&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_lib_$ac_lib_var=no" Xfi Xrm -f conftest* XLIBS="$ac_save_LIBS" X Xfi Xif eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X lib_selinux="-lselinux" Xelse X eval echo "$ac_t""no" 1>&6 Xfi X X LIBS="$ac_save_LIBS" X LIBS="$LIBS $lib_selinux $lib_attr" X for ac_func in is_selinux_enabled Xdo Xecho $ac_n "checking for $ac_func""... $ac_c" 1>&6 Xecho "configure:24159: checking for $ac_func" >&5 Xif eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X/* Override any gcc2 internal prototype to avoid an error. */ X/* We use char because int might match the return type of a gcc2 X builtin and then its argument prototype would still apply. */ Xchar $ac_func(); X Xint main() { X X/* The GNU C library defines this for functions which it implements X to always fail with ENOSYS. Some functions are actually named X something starting with __ and the normal name is an alias. */ X#if defined (__stub_$ac_func) || defined (__stub___$ac_func) Xchoke me X#else X$ac_func(); X#endif X X; return 0; } XEOF Xif { eval echo configure:24187: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext}; then X rm -rf conftest* X eval "ac_cv_func_$ac_func=yes" Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X eval "ac_cv_func_$ac_func=no" Xfi Xrm -f conftest* Xfi X Xif eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` X cat >> confdefs.h <&6 Xfi Xdone X X LIBS="$ac_save_LIBS" Xfi X X Xfor ac_file in /dev/tty /dev/null /dev/zero Xdo X Xac_safe=`echo "$ac_file" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_file""... $ac_c" 1>&6 Xecho "configure:24220: checking for $ac_file" >&5 Xif eval "test \"`echo '$''{'ac_cv_file_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext < X#include X Xint Xmain() X{ X struct stat sb; X X exit(stat("$ac_file", &sb) < 0); X} XEOF Xif { eval echo configure:24242: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X eval ac_cv_file_$ac_safe=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X eval ac_cv_file_$ac_safe=no Xfi Xrm -fr conftest* Xfi X Xfi X Xif eval "test \"`echo '$ac_cv_file_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_file=HAVE_`echo $ac_file | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 X Xfi Xdone X Xfor ac_file in /dev/stdin /dev/stdout /dev/stderr Xdo X Xac_safe=`echo "$ac_file" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_file""... $ac_c" 1>&6 Xecho "configure:24274: checking for $ac_file" >&5 Xif eval "test \"`echo '$''{'ac_cv_file_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext < X#include X Xint Xmain() X{ X struct stat sb; X X exit(stat("$ac_file", &sb) < 0); X} XEOF Xif { eval echo configure:24296: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X eval ac_cv_file_$ac_safe=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X eval ac_cv_file_$ac_safe=no Xfi Xrm -fr conftest* Xfi X Xfi X Xif eval "test \"`echo '$ac_cv_file_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_file=HAVE_`echo $ac_file | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 X Xfi Xdone X Xfor ac_file in /dev/fd/0 /dev/fd/1 /dev/fd/2 Xdo X Xac_safe=`echo "$ac_file" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_file""... $ac_c" 1>&6 Xecho "configure:24328: checking for $ac_file" >&5 Xif eval "test \"`echo '$''{'ac_cv_file_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext < X#include X Xint Xmain() X{ X struct stat sb; X X exit(stat("$ac_file", &sb) < 0); X} XEOF Xif { eval echo configure:24350: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X eval ac_cv_file_$ac_safe=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X eval ac_cv_file_$ac_safe=no Xfi Xrm -fr conftest* Xfi X Xfi X Xif eval "test \"`echo '$ac_cv_file_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_file=HAVE_`echo $ac_file | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 X Xfi Xdone X Xfor ac_file in /usr/src/linux/include /usr/xpg4/bin/sh /opt/schily/xpg4/bin/sh Xdo X Xac_safe=`echo "$ac_file" | sed 'y%./+-%__p_%'` Xecho $ac_n "checking for $ac_file""... $ac_c" 1>&6 Xecho "configure:24382: checking for $ac_file" >&5 Xif eval "test \"`echo '$''{'ac_cv_file_$ac_safe'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X if test "$cross_compiling" = yes; then X { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } Xelse X cat > conftest.$ac_ext < X#include X Xint Xmain() X{ X struct stat sb; X X exit(stat("$ac_file", &sb) < 0); X} XEOF Xif { eval echo configure:24404: \"$ac_link\" 1>&5; eval $ac_link 2>&5; } && test -s conftest${ac_exeext} && ($rmtcall ./conftest${ac_xexeext}; exit) 2>/dev/null Xthen X eval ac_cv_file_$ac_safe=yes Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -fr conftest* X eval ac_cv_file_$ac_safe=no Xfi Xrm -fr conftest* Xfi X Xfi X Xif eval "test \"`echo '$ac_cv_file_'$ac_safe`\" = yes"; then X eval echo "$ac_t""yes" 1>&6 X ac_tr_file=HAVE_`echo $ac_file | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` X cat >> confdefs.h <&6 X Xfi Xdone X X XUNAME=`uname || true` X Xif test ."$UNAME" = .Linux; then X X Xecho $ac_n "checking if Linux include file linux/ext2_fs.h is broken""... $ac_c" 1>&6 Xecho "configure:24438: checking if Linux include file linux/ext2_fs.h is broken" >&5 Xif eval "test \"`echo '$''{'ac_cv_broken_linux_ext2_fs_h'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#endif Xint main() { X X; return 0; } XEOF Xif { eval echo configure:24453: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_broken_linux_ext2_fs_h=no Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_broken_linux_ext2_fs_h=yes Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_broken_linux_ext2_fs_h" 1>&6 Xif test $ac_cv_broken_linux_ext2_fs_h = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_BROKEN_LINUX_EXT2_FS_H 1 XEOF X Xfi Xecho $ac_n "checking if Linux include file /usr/src/linux/include/linux/ext2_fs.h is broken""... $ac_c" 1>&6 Xecho "configure:24473: checking if Linux include file /usr/src/linux/include/linux/ext2_fs.h is broken" >&5 Xif eval "test \"`echo '$''{'ac_cv_broken_src_linux_ext2_fs_h'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ___CPPFLAGS=$CPPFLAGS; CPPFLAGS="-I/usr/src/linux/include $CPPFLAGS" X cat > conftest.$ac_ext < X#endif Xint main() { X X; return 0; } XEOF Xif { eval echo configure:24489: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_broken_src_linux_ext2_fs_h=no Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_broken_src_linux_ext2_fs_h=yes Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_broken_src_linux_ext2_fs_h" 1>&6 XCPPFLAGS=$___CPPFLAGS Xif test $ac_cv_broken_src_linux_ext2_fs_h = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_BROKEN_SRC_LINUX_EXT2_FS_H 1 XEOF X Xfi Xif test .$ac_cv_broken_linux_ext2_fs_h = .no -o .$ac_cv_broken_src_linux_ext2_fs_h = .no; then X # X # If either /usr/include/linux/ex2_fs.h works or X # /usr/src/linux/include/linux/ex2_fs.h works, we will X # #define HAVE_USABLE_LINUX_EXT2_FS_H X # X # If HAVE_USABLE_LINUX_EXT2_FS_H is defined, a simple X # #include will work. X # X ac_cv_usable_linux_ext2_fs_h=yes X cat >> confdefs.h <<\EOF X#define HAVE_USABLE_LINUX_EXT2_FS_H 1 XEOF X Xelse X ac_cv_usable_linux_ext2_fs_h=no Xfi Xecho $ac_n "checking if Linux include file scsi/scsi.h is broken""... $ac_c" 1>&6 Xecho "configure:24527: checking if Linux include file scsi/scsi.h is broken" >&5 Xif eval "test \"`echo '$''{'ac_cv_broken_scsi_scsi_h'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#endif Xint main() { X X; return 0; } XEOF Xif { eval echo configure:24542: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_broken_scsi_scsi_h=no Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_broken_scsi_scsi_h=yes Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_broken_scsi_scsi_h" 1>&6 Xif test $ac_cv_broken_scsi_scsi_h = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_BROKEN_SCSI_SCSI_H 1 XEOF X Xfi Xecho $ac_n "checking if Linux include file /usr/src/linux/include/scsi/scsi.h is broken""... $ac_c" 1>&6 Xecho "configure:24562: checking if Linux include file /usr/src/linux/include/scsi/scsi.h is broken" >&5 Xif eval "test \"`echo '$''{'ac_cv_broken_src_scsi_scsi_h'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ___CPPFLAGS=$CPPFLAGS; CPPFLAGS="-I/usr/src/linux/include $CPPFLAGS" X cat > conftest.$ac_ext < X#endif Xint main() { X X; return 0; } XEOF Xif { eval echo configure:24578: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_broken_src_scsi_scsi_h=no Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_broken_src_scsi_scsi_h=yes Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_broken_src_scsi_scsi_h" 1>&6 XCPPFLAGS=$___CPPFLAGS Xif test $ac_cv_broken_src_scsi_scsi_h = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_BROKEN_SRC_SCSI_SCSI_H 1 XEOF X Xfi Xecho $ac_n "checking if Linux include file scsi/sg.h is broken""... $ac_c" 1>&6 Xecho "configure:24599: checking if Linux include file scsi/sg.h is broken" >&5 Xif eval "test \"`echo '$''{'ac_cv_broken_scsi_sg_h'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X cat > conftest.$ac_ext < X#include X#endif Xint main() { X X; return 0; } XEOF Xif { eval echo configure:24615: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_broken_scsi_sg_h=no Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_broken_scsi_sg_h=yes Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_broken_scsi_sg_h" 1>&6 Xif test $ac_cv_broken_scsi_sg_h = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_BROKEN_SCSI_SG_H 1 XEOF X Xfi Xecho $ac_n "checking if Linux include file /usr/src/linux/include/scsi/sg.h is broken""... $ac_c" 1>&6 Xecho "configure:24635: checking if Linux include file /usr/src/linux/include/scsi/sg.h is broken" >&5 Xif eval "test \"`echo '$''{'ac_cv_broken_src_scsi_sg_h'+set}'`\" = set"; then X echo $ac_n "(cached) $ac_c" 1>&6 Xelse X ___CPPFLAGS=$CPPFLAGS; CPPFLAGS="-I/usr/src/linux/include $CPPFLAGS" X cat > conftest.$ac_ext < X#include X#endif Xint main() { X X; return 0; } XEOF Xif { eval echo configure:24652: \"$ac_compile\" 1>&5; eval $ac_compile 2>&5; }; then X rm -rf conftest* X ac_cv_broken_src_scsi_sg_h=no Xelse X echo "configure: failed program was:" >&5 X cat conftest.$ac_ext >&5 X rm -rf conftest* X ac_cv_broken_src_scsi_sg_h=yes Xfi Xrm -f conftest* Xfi X Xeval echo "$ac_t""$ac_cv_broken_src_scsi_sg_h" 1>&6 XCPPFLAGS=$___CPPFLAGS Xif test $ac_cv_broken_src_scsi_sg_h = yes; then X cat >> confdefs.h <<\EOF X#define HAVE_BROKEN_SRC_SCSI_SG_H 1 XEOF X Xfi X Xif test .$ac_cv_broken_src_scsi_scsi_h = .yes; then X may_linux_src_include=no Xfi Xif test .$ac_cv_broken_src_linux_ext2_fs_h = .yes; then X may_linux_src_include=no Xfi Xif test .$ac_cv_file__usr_src_linux_include = .yes; then # only warn if there is /usr/src/linux/include Xif test .$may_linux_src_include = .no; then X echo X echo "Warning: *** /usr/src/linux/include contains broken include files ***" X echo "Warning: *** /usr/src/linux/include is not used this reason ***" X echo "Warning: This may result in the inability to use recent Linux kernel interfaces" X echo Xfi Xfi Xif test .$ac_cv_header_ext2fs_ext2_fs_h = .no; then # only if there is no Xif test .$ac_cv_usable_linux_ext2_fs_h = .no; then X echo X echo "Warning: *** linux/ext2_fs.h is not usable at all ***" X echo "Warning: *** This makes it impossible to support Linux file flags ***" X echo "You may try to compile using 'make COPTX=-DTRY_EXT2_FS'" X echo X echo "Better install the ext2 developer package" X echo X sleep 10 Xfi Xfi # was missing Xfi # Linux only tests X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X Xtrap '' 1 2 15 Xcat > confcache <<\EOF X# This file is a shell script that caches the results of configure X# tests run on this system so they can be shared between configure X# scripts and configure runs. It is not useful on other systems. X# If it contains results you don't want to keep, you may remove or edit it. X# X# By default, configure uses ./config.cache as the cache file, X# creating it if it does not exist already. You can give configure X# the --cache-file=FILE option to use a different cache file; that is X# what configure does when it calls configure scripts in X# subdirectories, so they share the cache. X# Giving --cache-file=/dev/null disables caching, for debugging configure. X# config.status only pays attention to the cache file if you give it the X# --recheck option to rerun configure. X# XEOF X# The following way of writing the cache mishandles newlines in values, X# but we know of no workaround that is simple, portable, and efficient. X# So, don't put newlines in cache variables' values. X# Ultrix sh set writes to stderr and can't be redirected directly, X# and sets the high bit in the cache file unless we assign to the vars. X(set) 2>&1 | X case `(ac_space=' '; set | grep ac_space) 2>&1` in X *ac_space=\ *) X # `set' does not quote correctly, so add quotes (double-quote substitution X # turns \\\\ into \\, and sed turns \\ into \). X sed -n \ X -e "s/'/'\\\\''/g" \ X -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" X ;; X *) X # `set' quotes correctly as required by POSIX, so do not add quotes. X sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' X ;; X esac >> confcache Xif cmp -s $cache_file confcache; then X : Xelse X if test -w $cache_file; then X echo "updating cache $cache_file" X cat confcache > $cache_file X else X echo "not updating unwritable cache $cache_file" X fi Xfi Xrm -f confcache X Xtrap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 X Xtest "x$prefix" = xNONE && prefix=$ac_default_prefix X# Let make expand exec_prefix. Xtest "x$exec_prefix" = xNONE && exec_prefix='${prefix}' X X# Any assignment to VPATH causes Sun make to only execute X# the first set of double-colon rules, so remove it if not needed. X# If there is a colon in the path, we need to keep it. Xif test "x$srcdir" = x.; then X ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' Xfi X Xtrap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 X XDEFS=-DHAVE_CONFIG_H X X# Without the "./", some shells look in PATH for config.status. X: ${CONFIG_STATUS=./config.status} X Xecho creating $CONFIG_STATUS Xrm -f $CONFIG_STATUS Xcat > $CONFIG_STATUS </dev/null | sed 1q`: X# X# $0 $ac_configure_args X# X# Compiler output produced by configure, useful for debugging X# configure, is in ./config.log if it exists. X Xac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" Xfor ac_option Xdo X case "\$ac_option" in X -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) X echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" X exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; X -version | --version | --versio | --versi | --vers | --ver | --ve | --v) X echo "$CONFIG_STATUS generated by autoconf version 2.13 1.17-Schily" X exit 0 ;; X -help | --help | --hel | --he | --h) X echo "\$ac_cs_usage"; exit 0 ;; X *) echo "\$ac_cs_usage"; exit 1 ;; X esac Xdone X Xac_given_srcdir=$srcdir X Xtrap 'rm -fr `echo "rules.cnf xconfig.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 XEOF Xcat >> $CONFIG_STATUS < conftest.subs <<\\CEOF X$ac_vpsub X$extrasub Xs%@SHELL@%$SHELL%g Xs%@CFLAGS@%$CFLAGS%g Xs%@CPPFLAGS@%$CPPFLAGS%g Xs%@CXXFLAGS@%$CXXFLAGS%g Xs%@FFLAGS@%$FFLAGS%g Xs%@DEFS@%$DEFS%g Xs%@LDFLAGS@%$LDFLAGS%g Xs%@LIBS@%$LIBS%g Xs%@exec_prefix@%$exec_prefix%g Xs%@prefix@%$prefix%g Xs%@program_transform_name@%$program_transform_name%g Xs%@bindir@%$bindir%g Xs%@sbindir@%$sbindir%g Xs%@libexecdir@%$libexecdir%g Xs%@datadir@%$datadir%g Xs%@sysconfdir@%$sysconfdir%g Xs%@sharedstatedir@%$sharedstatedir%g Xs%@localstatedir@%$localstatedir%g Xs%@libdir@%$libdir%g Xs%@includedir@%$includedir%g Xs%@oldincludedir@%$oldincludedir%g Xs%@infodir@%$infodir%g Xs%@mandir@%$mandir%g Xs%@host@%$host%g Xs%@host_alias@%$host_alias%g Xs%@host_cpu@%$host_cpu%g Xs%@host_vendor@%$host_vendor%g Xs%@host_os@%$host_os%g Xs%@CC@%$CC%g Xs%@OBJEXT@%$OBJEXT%g Xs%@EXEEXT@%$EXEEXT%g Xs%@XEXEEXT@%$XEXEEXT%g Xs%@CPP@%$CPP%g Xs%@CPPX@%$CPPX%g Xs%@CPPX_IN@%$CPPX_IN%g Xs%@RANLIB@%$RANLIB%g Xs%@SET_MAKE@%$SET_MAKE%g Xs%@YACC@%$YACC%g Xs%@BISON@%$BISON%g Xs%@LORDER@%$LORDER%g Xs%@TSORT@%$TSORT%g Xs%@LIBOBJS@%$LIBOBJS%g Xs%@ALLOCA@%$ALLOCA%g Xs%@may_linux_src_include@%$may_linux_src_include%g Xs%@largefile_cc_opt@%$largefile_cc_opt%g Xs%@sun_cc64_opt@%$sun_cc64_opt%g Xs%@hp_cc_ansi_opt@%$hp_cc_ansi_opt%g Xs%@hp_cc_opt_opt@%$hp_cc_opt_opt%g Xs%@hp_cc_gprof_opt@%$hp_cc_gprof_opt%g Xs%@lib_crypt@%$lib_crypt%g Xs%@lib_resolv@%$lib_resolv%g Xs%@lib_intl@%$lib_intl%g Xs%@lib_iconv@%$lib_iconv%g Xs%@lib_expat@%$lib_expat%g Xs%@lib_pcsc@%$lib_pcsc%g Xs%@lib_crypto@%$lib_crypto%g Xs%@lib_ssl@%$lib_ssl%g Xs%@lib_nsl@%$lib_nsl%g Xs%@scsi_lib@%$scsi_lib%g Xs%@lib_scsi@%$lib_scsi%g Xs%@lib_acl@%$lib_acl%g Xs%@lib_acl_test@%$lib_acl_test%g Xs%@lib_attr@%$lib_attr%g Xs%@lib_secdb@%$lib_secdb%g Xs%@lib_gen@%$lib_gen%g Xs%@lib_elf@%$lib_elf%g Xs%@lib_pthread@%$lib_pthread%g Xs%@lib_rt@%$lib_rt%g Xs%@lib_dl@%$lib_dl%g Xs%@lib_dir@%$lib_dir%g Xs%@lib_cap@%$lib_cap%g Xs%@lib_selinux@%$lib_selinux%g X XCEOF XEOF X Xcat >> $CONFIG_STATUS <<\EOF X X# Split the substitutions into bite-sized pieces for seds with X# small command number limits, like on Digital OSF/1 and HP-UX. Xac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. Xac_file=1 # Number of current file. Xac_beg=1 # First line for current file. Xac_end=$ac_max_sed_cmds # Line after last line for current file. Xac_more_lines=: Xac_sed_cmds="" Xwhile $ac_more_lines; do X if test $ac_beg -gt 1; then X sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file X else X sed "${ac_end}q" conftest.subs > conftest.s$ac_file X fi X if test ! -s conftest.s$ac_file; then X ac_more_lines=false X rm -f conftest.s$ac_file X else X if test -z "$ac_sed_cmds"; then X ac_sed_cmds="sed -f conftest.s$ac_file" X else X ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" X fi X ac_file=`expr $ac_file + 1` X ac_beg=$ac_end X ac_end=`expr $ac_end + $ac_max_sed_cmds` X fi Xdone Xif test -z "$ac_sed_cmds"; then X ac_sed_cmds=cat Xfi XEOF X Xcat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF Xfor ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then X # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". X case "$ac_file" in X *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` X ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; X *) ac_file_in="${ac_file}.in" ;; X esac X X # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. X X # Remove last slash and all that follows it. Not all systems have dirname. X ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` X if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then X # The file is in a subdirectory. X test ! -d "$ac_dir" && mkdir "$ac_dir" X ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" X # A "../" for each directory in $ac_dir_suffix. X ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` X else X ac_dir_suffix= ac_dots= X fi X X case "$ac_given_srcdir" in X .) srcdir=. X if test -z "$ac_dots"; then top_srcdir=. X else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; X /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; X *) # Relative path. X srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" X top_srcdir="$ac_dots$ac_given_srcdir" ;; X esac X X X echo creating "$ac_file" X rm -f "$ac_file" X configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." X case "$ac_file" in X *Makefile*) ac_comsub="1i\\ X# $configure_input" ;; X *) ac_comsub= ;; X esac X X ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` X sed -e "$ac_comsub Xs%@configure_input@%$configure_input%g Xs%@srcdir@%$srcdir%g Xs%@top_srcdir@%$top_srcdir%g X" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file Xfi; done Xrm -f conftest.s* X X# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where X# NAME is the cpp macro being defined and VALUE is the value it is being given. X# X# ac_d sets the value in "#define NAME VALUE" lines. Xac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' Xac_dB='\([ ][ ]*\)[^ ]*%\1#\2' Xac_dC='\3' Xac_dD='%g' X# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". Xac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' Xac_uB='\([ ]\)%\1#\2define\3' Xac_uC=' ' Xac_uD='\4%g' X# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". Xac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' Xac_eB='$%\1#\2define\3' Xac_eC=' ' Xac_eD='%g' X Xif test "${CONFIG_HEADERS+set}" != set; then XEOF Xcat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF Xfi Xfor ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then X # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". X case "$ac_file" in X *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` X ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; X *) ac_file_in="${ac_file}.in" ;; X esac X X echo creating $ac_file X X rm -f conftest.frag conftest.in conftest.out X ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` X cat $ac_file_inputs > conftest.in X XEOF X X# Transform confdefs.h into a sed script conftest.vals that substitutes X# the proper values into config.h.in to produce config.h. And first: X# Protect against being on the right side of a sed subst in config.status. X# Protect against being in an unquoted here document in config.status. Xrm -f conftest.vals Xcat > conftest.hdr <<\EOF Xs/[\\&%]/\\&/g Xs%[\\$`]%\\&%g Xs%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp Xs%ac_d%ac_u%gp Xs%ac_u%ac_e%gp XEOF Xsed -n -f conftest.hdr confdefs.h > conftest.vals Xrm -f conftest.hdr X X# This sed command replaces #undef with comments. This is necessary, for X# example, in the case of _POSIX_SOURCE, which is predefined and required X# on some systems where configure will not decide to define it. Xcat >> conftest.vals <<\EOF Xs%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% XEOF X X# Break up conftest.vals because some shells have a limit on X# the size of here documents, and old seds have small limits too. X Xrm -f conftest.tail Xwhile : Xdo X ac_lines=`grep -c . conftest.vals` X # grep -c gives empty output for an empty file on some AIX systems. X if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi X # Write a limited-size here document to conftest.frag. X echo ' cat > conftest.frag <> $CONFIG_STATUS X sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS X echo 'CEOF X sed -f conftest.frag conftest.in > conftest.out X rm -f conftest.in X mv conftest.out conftest.in X' >> $CONFIG_STATUS X sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail X rm -f conftest.vals X mv conftest.tail conftest.vals Xdone Xrm -f conftest.vals X Xcat >> $CONFIG_STATUS <<\EOF X rm -f conftest.frag conftest.h X echo "/* $ac_file. Generated automatically by configure. */" > conftest.h X cat conftest.in >> conftest.h X rm -f conftest.in X if cmp -s $ac_file conftest.h 2>/dev/null; then X echo "$ac_file is unchanged" X rm -f conftest.h X else X # Remove last slash and all that follows it. Not all systems have dirname. X ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` X if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then X # The file is in a subdirectory. X test ! -d "$ac_dir" && mkdir "$ac_dir" X fi X rm -f $ac_file X mv conftest.h $ac_file X fi Xfi; done X XEOF Xcat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF X Xexit 0 XEOF Xchmod +x $CONFIG_STATUS Xrm -fr confdefs* $ac_clean_files Xtest "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 X END-of-star-1.6/autoconf/configure echo c - star-1.6/librmt mkdir -p star-1.6/librmt > /dev/null 2>&1 echo x - star-1.6/librmt/Makefile sed 's/^X//' >star-1.6/librmt/Makefile << 'END-of-star-1.6/librmt/Makefile' X#ident "%W% %E% %Q%" X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMK_FILES= librmt.mk librmt_p.mk $(NO_SHL)shlrmt.mk X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.mks X########################################################################### END-of-star-1.6/librmt/Makefile echo x - star-1.6/librmt/remote.c sed 's/^X//' >star-1.6/librmt/remote.c << 'END-of-star-1.6/librmt/remote.c' X/*#define NO_LIBSCHILY*/ X/* @(#)remote.c 1.78 18/06/09 Copyright 1990-2018 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)remote.c 1.78 18/06/09 Copyright 1990-2018 J. Schilling"; X#endif X/* X * Remote tape client interface code X * X * Copyright (c) 1990-2018 J. Schilling X * X * TOTO: X * Signal handler for SIGPIPE X * check rmtaborted for exit() / clean abort of connection X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#if !defined(HAVE_FORK) || !defined(HAVE_SOCKETPAIR) || !defined(HAVE_DUP2) X#undef USE_RCMD_RSH X#endif X/* X * We may work without getservbyname() if we restructure the code not to X * use the port number if we only use _rcmdrsh(). X */ X#if !defined(HAVE_GETSERVBYNAME) X#undef USE_REMOTE /* Cannot get rcmd() port # */ X#endif X#if (!defined(HAVE_NETDB_H) || !defined(HAVE_RCMD)) && !defined(USE_RCMD_RSH) X#undef USE_REMOTE /* There is no rcmd() */ X#endif X X#include X#include X#include X#include X#include X#include X#include X#include X#include X#include X#include X#include X#include X#include X#include X#include X#include X#include X X#if defined(SIGDEFER) || defined(SVR4) X#define signal sigset X#endif X X/* X * On Cygwin, there are no privilleged ports. X * On UNIX, rcmd() uses privilleged port that only work for root. X */ X#if defined(IS_CYGWIN) || defined(__MINGW32__) X#define privport_ok() (1) X#else X#if defined(HAVE_SOLARIS_PPRIV) || defined(HAVE_LINUX_CAPS) X#define privport_ok() ppriv_ok() X#else X#define privport_ok() (geteuid() == 0) X#endif X#endif X X X#ifdef NO_LIBSCHILY X X/* >>>>>>>>>> Begin compatibility code for use without libschily <<<<<<<<<<< */ X/* X * This code is needed for applications that like to use librmt but don't X * link against libschily. X * X * A working vfprintf(), snprintf(), strerror(), memmove() and atoll() is X * needed. X * For this reason, the portability in this compilation mode is limited. X */ X#include X#define geterrno() (errno) X#define seterrno(err) (errno = (err)) X#define js_snprintf snprintf X#define _niread _lniread X#define _niwrite _lniwrite X#define movebytes(f, t, n) memmove((t), (f), (n)) X#define astoll(s, np) {*np = atoll(s); } X#define comerrno(e, s) {_errmsgno(e, s); rmt_exit(e); } X#define errmsgno _errmsgno X#define errmsgstr strerror X XLOCAL int _niread __PR((int f, void *buf, int count)); XLOCAL int _niwrite __PR((int f, void *buf, int count)); XLOCAL int errmsgno __PR((int, const char *, ...)); X XLOCAL int X_niread(f, buf, count) X int f; X void *buf; X int count; X{ X int ret; X X while ((ret = read(f, buf, count)) < 0 && geterrno() == EINTR) X ; X return (ret); X} X XLOCAL int X_niwrite(f, buf, count) X int f; X void *buf; X int count; X{ X int ret; X X while ((ret = write(f, buf, count)) < 0 && geterrno() == EINTR) X ; X return (ret); X} X X /* X * On UNIX errno is a small non-negative number, so we assume that X * negative values cannot be a valid errno and don't print the error X * string in this case. Note that this macro does not work on BeOS. X */ X#define silent_error(e) ((e) < 0) X X/* VARARGS2 */ XLOCAL int X#ifdef PROTOTYPES Xerrmsgno(int err, const char *msg, ...) X#else Xerrmsgno(err, msg, va_alist) X int err; X char *msg; X va_dcl X#endif X{ X va_list args; X int ret; X char errbuf[20]; X char *errnam; X X ret = fprintf(stderr, "librmt: "); X if (ret < 0) X return (ret); X X if (!silent_error(err)) { X errnam = errmsgstr(err); X if (errnam == NULL) { X (void) js_snprintf(errbuf, sizeof (errbuf), X "Error %d", err); X errnam = errbuf; X } X ret = fprintf(stderr, "%s. ", errnam); X if (ret < 0) X return (ret); X } X X#ifdef PROTOTYPES X va_start(args, msg); X#else X va_start(args); X#endif X ret = vfprintf(stderr, msg, args); X va_end(args); X return (ret); X} X X/* >>>>>>>>>>> End compatibility code for use without libschily <<<<<<<<<<<< */ X X#endif /* NO_LIBSCHILY */ X X#define CMD_SIZE 80 X XLOCAL BOOL rmt_debug; XLOCAL const char *rmt_program; XLOCAL const char *rsh_program; XLOCAL int (*rmt_errmsgno) __PR((int, const char *, ...)) = errmsgno; XLOCAL void (*rmt_exit) __PR((int)) = exit; X XEXPORT void rmtinit __PR((int (*errmsgn)(int, const char *, ...), X void (*eexit)(int))); XEXPORT int rmtdebug __PR((int dlevel)); XEXPORT const char *rmtrmt __PR((const char *rmt_name)); XEXPORT const char *rmtrsh __PR((const char *rsh_name)); XEXPORT char *rmtfilename __PR((char *name)); XEXPORT char *rmthostname __PR((char *hostname, int hnsize, char *rmtspec)); XEXPORT int rmtgetconn __PR((char *host, int trsize, int excode)); X X#ifdef USE_REMOTE XLOCAL void rmtabrt __PR((int sig)); XLOCAL BOOL okuser __PR((char *name)); XLOCAL void rmtoflags __PR((int fmode, char *cmode)); XEXPORT int rmtopen __PR((int fd, char *fname, int fmode)); XEXPORT int rmtclose __PR((int fd)); XEXPORT int rmtread __PR((int fd, char *buf, int count)); XEXPORT int rmtwrite __PR((int fd, char *buf, int count)); XEXPORT off_t rmtseek __PR((int fd, off_t offset, int whence)); XEXPORT int rmtioctl __PR((int fd, int cmd, int count)); XLOCAL int rmtmapold __PR((int cmd)); XLOCAL int rmtmapnew __PR((int cmd)); XLOCAL Llong rmtxgstatus __PR((int fd, int cmd)); XLOCAL int rmt_v1_status __PR((int fd, struct rmtget *mtp)); XLOCAL int rmt_v0_status __PR((int fd, struct mtget *mtp)); XEXPORT int rmxtstatus __PR((int fd, struct rmtget *mtp)); XEXPORT int rmtstatus __PR((int fd, struct mtget *mtp)); XLOCAL Llong rmtcmd __PR((int fd, char *name, char *cbuf)); XLOCAL void rmtsendcmd __PR((int fd, char *name, char *cbuf)); XLOCAL int rmtfillrdbuf __PR((int fd)); XLOCAL int rmtreadchar __PR((int fd, char *cp)); XLOCAL int rmtreadbuf __PR((int fd, char *buf, int count)); XLOCAL int rmtgetline __PR((int fd, char *line, int count)); XLOCAL Llong rmtgetstatus __PR((int fd, char *name)); XLOCAL int rmtaborted __PR((int fd)); XEXPORT void _rmtg2mtg __PR((struct mtget *mtp, struct rmtget *rmtp)); XEXPORT int _mtg2rmtg __PR((struct rmtget *rmtp, struct mtget *mtp)); X#ifdef USE_RCMD_RSH XLOCAL int _rcmdrsh __PR((char **ahost, int inport, X const char *locuser, X const char *remuser, X const char *cmd, X const char *rsh)); X#if defined(HAVE_SOLARIS_PPRIV) || defined(HAVE_LINUX_CAPS) XLOCAL BOOL ppriv_ok __PR((void)); X#endif X#endif X X#endif X XEXPORT void Xrmtinit(errmsgn, eexit) X int (*errmsgn) __PR((int, const char *, ...)); X void (*eexit) __PR((int)); X{ X rmt_errmsgno = errmsgn; X if (rmt_errmsgno == (int (*) __PR((int, const char *, ...)))0) X rmt_errmsgno = errmsgno; X X rmt_exit = eexit; X if (rmt_exit == (void (*) __PR((int)))0) X rmt_exit = exit; X} X XEXPORT int Xrmtdebug(dlevel) X int dlevel; X{ X int odebug = rmt_debug; X X rmt_debug = dlevel; X return (odebug); X} X XEXPORT const char * Xrmtrmt(rmt_name) X const char *rmt_name; X{ X const char *ormt = rmt_program; X X rmt_program = rmt_name; X X if (ormt && *ormt == '\0') X return ((const char *)NULL); X return (ormt); X} X XEXPORT const char * Xrmtrsh(rsh_name) X const char *rsh_name; X{ X const char *orsh = rsh_program; X X rsh_program = rsh_name; X X if (orsh && *orsh == '\0') X return ((const char *)NULL); X return (orsh); X} X XEXPORT char * Xrmtfilename(name) X char *name; X{ X char *ret; X X if (name[0] == '/') X return (NULL); /* Absolut pathname cannot be remote */ X if (name[0] == '.') { X if (name[1] == '/' || (name[1] == '.' && name[2] == '/')) X return (NULL); /* Relative pathname cannot be remote */ X } X if ((ret = strchr(name, ':')) != NULL) { X if (name[0] == ':') { X /* X * This cannot be a remote filename as the host part X * has zero length. X */ X return (NULL); X } X ret++; /* Skip the colon. */ X } X return (ret); X} X XEXPORT char * Xrmthostname(hostname, hnsize, rmtspec) X char *hostname; X register int hnsize; X char *rmtspec; X{ X register int i; X register char *hp; X register char *fp; X register char *remfn; X X if ((remfn = rmtfilename(rmtspec)) == NULL) { X hostname[0] = '\0'; X return (NULL); X } X remfn--; X for (fp = rmtspec, hp = hostname, i = 1; X fp < remfn && i < hnsize; i++) { X *hp++ = *fp++; X } X *hp = '\0'; X return (hostname); X} X X#ifdef USE_REMOTE X XEXPORT int Xrmtgetconn(host, trsize, excode) X char *host; /* The host name to connect to */ X int trsize; /* Max transfer size for SO_SNDBUF/SO_RCVBUF */ X int excode; /* If != 0 use value to exit() in this func */ X{ X static struct servent *sp = 0; X static struct passwd *pw = 0; X char *name = "root"; X char *p; X const char *rmt = NULL; X const char *rsh = NULL; X int rmtsock; X char *rmtpeer; X char rmtuser[128]; X X X signal(SIGPIPE, rmtabrt); X if (sp == 0) { X sp = getservbyname("shell", "tcp"); X if (sp == 0) { X rmt_errmsgno(EX_BAD, "shell/tcp: unknown service\n"); X if (excode) X rmt_exit(excode); X rmt_exit(EX_BAD); X return (-2); /* exit function did not exit */ X } X pw = getpwuid(getuid()); X if (pw == 0) { X rmt_errmsgno(EX_BAD, X "who are you? No passwd entry found.\n"); X if (excode) X rmt_exit(excode); X rmt_exit(EX_BAD); X return (-2); /* exit function did not exit */ X } X } X if ((p = strchr(host, '@')) != NULL) { X size_t d = p - host; X X if (d > sizeof (rmtuser)) X d = sizeof (rmtuser); X js_snprintf(rmtuser, sizeof (rmtuser), "%.*s", X (int)d, host); X if (! okuser(rmtuser)) { X if (excode) X rmt_exit(excode); X rmt_exit(EX_BAD); X return (-2); /* exit function did not exit */ X } X name = rmtuser; X host = &p[1]; X } else { X name = pw->pw_name; X } X if (rmt_debug) X rmt_errmsgno(EX_BAD, "locuser: '%s' rmtuser: '%s' host: '%s'\n", X pw->pw_name, name, host); X rmtpeer = host; X X if (rmt_program && *rmt_program) X rmt = rmt_program; X p = getenv("RMT"); X if (p != NULL) X rmt = p; X if (rmt == NULL || *rmt == '\0') X rmt = "/etc/rmt"; X if (rsh_program && *rsh_program) X rsh = rsh_program; X p = getenv("RSH"); X if (p != NULL) X rsh = p; X X#ifdef USE_RCMD_RSH X if (!privport_ok() || (rsh != NULL && *rsh != '\0')) X rmtsock = _rcmdrsh(&rmtpeer, (unsigned short)sp->s_port, X pw->pw_name, name, rmt, rsh); X else X#endif X#ifdef HAVE_RCMD X rmtsock = rcmd(&rmtpeer, (unsigned short)sp->s_port, X pw->pw_name, name, rmt, 0); X#else X rmtsock = _rcmdrsh(&rmtpeer, (unsigned short)sp->s_port, X pw->pw_name, name, rmt, rsh); X#endif X X if (rmtsock < 0) X return (-1); X X X#ifdef SO_SNDBUF X while (trsize > 512 && X setsockopt(rmtsock, SOL_SOCKET, SO_SNDBUF, X (char *)&trsize, sizeof (trsize)) < 0) { X trsize -= 512; X } X if (rmt_debug) X rmt_errmsgno(EX_BAD, "sndsize: %d\n", trsize); X#endif X#ifdef SO_RCVBUF X while (trsize > 512 && X setsockopt(rmtsock, SOL_SOCKET, SO_RCVBUF, X (char *)&trsize, sizeof (trsize)) < 0) { X trsize -= 512; X } X if (rmt_debug) X rmt_errmsgno(EX_BAD, "rcvsize: %d\n", trsize); X#endif X X return (rmtsock); X} X XLOCAL void Xrmtabrt(sig) X int sig; X{ X rmtaborted(-1); X} X X/* X * XXX Is such a function really needed? X * XXX A similar function appeared on FreeBSD with a X * XXX misterious change to dump(8) X * XXX N.B. The FreeBSD function excludes '_' in addition. X */ XLOCAL BOOL Xokuser(name) X char *name; X{ X register char *p; X register Uchar c; X X for (p = name; *p; ) { X c = *p++; X if (!isascii(c) || !(isalnum(c) || c == '-')) { X rmt_errmsgno(EX_BAD, "invalid user name %s\n", name); X return (FALSE); X } X } X return (TRUE); X} X XLOCAL void Xrmtoflags(fmode, cmode) X int fmode; X char *cmode; X{ X register char *p; X register int amt; X register int maxcnt = CMD_SIZE; X X switch (fmode & O_ACCMODE) { X X case O_RDONLY: p = "O_RDONLY"; break; X case O_RDWR: p = "O_RDWR"; break; X case O_WRONLY: p = "O_WRONLY"; break; X X default: p = "Cannot Happen"; X } X amt = js_snprintf(cmode, maxcnt, "%s", p); X if (amt < 0) X return; X p = cmode; X p += amt; X maxcnt -= amt; X#ifdef O_TEXT X if (fmode & O_TEXT) { X amt = js_snprintf(p, maxcnt, "|O_TEXT"); X if (amt < 0) X return; X p += amt; X maxcnt -= amt; X } X#endif X#ifdef O_NDELAY X if (fmode & O_NDELAY) { X amt = js_snprintf(p, maxcnt, "|O_NDELAY"); X if (amt < 0) X return; X p += amt; X maxcnt -= amt; X } X#endif X#ifdef O_APPEND X if (fmode & O_APPEND) { X amt = js_snprintf(p, maxcnt, "|O_APPEND"); X if (amt < 0) X return; X p += amt; X maxcnt -= amt; X } X#endif X#ifdef O_SYNC X if (fmode & O_SYNC) { X amt = js_snprintf(p, maxcnt, "|O_SYNC"); X if (amt < 0) X return; X p += amt; X maxcnt -= amt; X } X#endif X#ifdef O_DSYNC X if (fmode & O_DSYNC) { X amt = js_snprintf(p, maxcnt, "|O_DSYNC"); X if (amt < 0) X return; X p += amt; X maxcnt -= amt; X } X#endif X#ifdef O_RSYNC X if (fmode & O_RSYNC) { X amt = js_snprintf(p, maxcnt, "|O_RSYNC"); X if (amt < 0) X return; X p += amt; X maxcnt -= amt; X } X#endif X#ifdef O_NONBLOCK X if (fmode & O_NONBLOCK) { X amt = js_snprintf(p, maxcnt, "|O_NONBLOCK"); X if (amt < 0) X return; X p += amt; X maxcnt -= amt; X } X#endif X#ifdef O_PRIV X if (fmode & O_PRIV) { X amt = js_snprintf(p, maxcnt, "|O_PRIV"); X if (amt < 0) X return; X p += amt; X maxcnt -= amt; X } X#endif X#ifdef O_LARGEFILE X if (fmode & O_LARGEFILE) { X amt = js_snprintf(p, maxcnt, "|O_LARGEFILE"); X if (amt < 0) X return; X p += amt; X maxcnt -= amt; X } X#endif X#ifdef O_CREAT X if (fmode & O_CREAT) { X amt = js_snprintf(p, maxcnt, "|O_CREAT"); X if (amt < 0) X return; X p += amt; X maxcnt -= amt; X } X#endif X#ifdef O_TRUNC X if (fmode & O_TRUNC) { X amt = js_snprintf(p, maxcnt, "|O_TRUNC"); X if (amt < 0) X return; X p += amt; X maxcnt -= amt; X } X#endif X#ifdef O_EXCL X if (fmode & O_EXCL) { X amt = js_snprintf(p, maxcnt, "|O_EXCL"); X if (amt < 0) X return; X p += amt; X maxcnt -= amt; X } X#endif X#ifdef O_NOCTTY X if (fmode & O_NOCTTY) { X amt = js_snprintf(p, maxcnt, "|O_NOCTTY"); X if (amt < 0) X return; X p += amt; X maxcnt -= amt; X } X#endif X} X XEXPORT int Xrmtopen(fd, fname, fmode) X int fd; X char *fname; X int fmode; X{ X char cbuf[4096+CMD_SIZE]; X char cmode[CMD_SIZE]; X int ret; X X /* X * Convert all fmode bits into the symbolic fmode. X * only send the lowest 2 bits in numeric mode as it would be too X * dangerous because the apropriate bits differ between different X * operating systems. X */ X rmtoflags(fmode, cmode); X ret = js_snprintf(cbuf, sizeof (cbuf), "O%s\n%d %s\n", X fname, fmode & O_ACCMODE, cmode); X if (ret < 0 || ret >= sizeof (cbuf)) { X#ifdef ENAMETOOLONG X seterrno(ENAMETOOLONG); X#else X seterrno(EINVAL); X#endif X return (-1); X } X ret = rmtcmd(fd, "open", cbuf); X if (ret < 0) X return (ret); X X /* X * Tell the rmt server that we are aware of Version 1 commands. X */ X (void) rmtioctl(fd, RMTIVERSION, 0); X X return (ret); X} X XEXPORT int Xrmtclose(fd) X int fd; X{ X return (rmtcmd(fd, "close", "C\n")); X} X X/* X * Check all our callers once we make "count" size_t X */ XEXPORT int Xrmtread(fd, buf, count) X int fd; X char *buf; X int count; X{ X char cbuf[CMD_SIZE]; X int n; X int amt = 0; X X n = js_snprintf(cbuf, CMD_SIZE, "R%d\n", count); X if (n < 0 || n >= CMD_SIZE) { /* Paranoia */ X seterrno(EINVAL); X return (-1); X } X n = rmtcmd(fd, "read", cbuf); X if (n < 0) X return (-1); X X /* X * Nice idea from disassembling Solaris ufsdump... X */ X if (n > count) { X rmt_errmsgno(EX_BAD, X "rmtread: expected response size %d, got %d\n", X count, n); X rmt_errmsgno(EX_BAD, X "This means the remote rmt daemon is not compatible.\n"); X return (rmtaborted(fd)); X /* X * XXX Should we better abort (exit) here? X */ X } X amt = rmtreadbuf(fd, buf, n); X X return (amt); X} X X/* X * Check all our callers once we make "count" size_t X */ XEXPORT int Xrmtwrite(fd, buf, count) X int fd; X char *buf; X int count; X{ X char cbuf[CMD_SIZE]; X int n; X X n = js_snprintf(cbuf, CMD_SIZE, "W%d\n", count); X if (n < 0 || n >= CMD_SIZE) { /* Paranoia */ X seterrno(EINVAL); X return (-1); X } X rmtsendcmd(fd, "write", cbuf); X if (_niwrite(fd, buf, count) != count) X rmtaborted(fd); X return (rmtgetstatus(fd, "write")); X} X XEXPORT off_t Xrmtseek(fd, offset, whence) X int fd; X off_t offset; X int whence; X{ X char cbuf[CMD_SIZE]; X int n; X X switch (whence) { X X case SEEK_SET: whence = 0; break; X case SEEK_CUR: whence = 1; break; X case SEEK_END: whence = 2; break; X#ifdef SEEK_DATA X case SEEK_DATA: whence = 3; break; X#endif X#ifdef SEEK_HOLE X case SEEK_HOLE: whence = 4; break; X#endif X X default: X seterrno(EINVAL); X return (-1); X } X X n = js_snprintf(cbuf, CMD_SIZE, "L%lld\n%d\n", (Llong)offset, whence); X if (n < 0 || n >= CMD_SIZE) { /* Paranoia */ X seterrno(EINVAL); X return (-1); X } X return ((off_t)rmtcmd(fd, "seek", cbuf)); X} X XEXPORT int Xrmtioctl(fd, cmd, count) X int fd; X int cmd; X int count; X{ X char cbuf[CMD_SIZE]; X char c = 'I'; X int rmtversion = RMT_NOVERSION; X int i; X X if (cmd != RMTIVERSION) X rmtversion = rmtioctl(fd, RMTIVERSION, 0); X X if (cmd >= 0 && (rmtversion == RMT_VERSION)) { X /* X * Opcodes 0..7 are unique across different architectures. X * But as in many cases Linux does not even follow this rule. X * If we know that we are calling a VERSION 1 client, we may X * safely assume that the client is not using Linux mapping X * but the standard mapping. X */ X i = rmtmapold(cmd); X if (cmd <= 7 && i < 0) { X /* X * We cannot map the current command but it's value is X * within the range 0..7. Do not send it over the wire. X */ X seterrno(EINVAL); X return (-1); X } X if (i >= 0) X cmd = i; X } X if (cmd > 7 && (rmtversion == RMT_VERSION)) { X i = rmtmapnew(cmd); X if (i >= 0) { X cmd = i; X c = 'i'; X } X } X X i = js_snprintf(cbuf, CMD_SIZE, "%c%d\n%d\n", c, cmd, count); X if (i < 0 || i >= CMD_SIZE) { /* Paranoia */ X seterrno(EINVAL); X return (-1); X } X return (rmtcmd(fd, "ioctl", cbuf)); X} X X/* X * Map all old opcodes that should be in range 0..7 to numbers /etc/rmt expects X * This is needed because Linux does not follow the UNIX conventions. X */ XLOCAL int Xrmtmapold(cmd) X int cmd; X{ X switch (cmd) { X X#ifdef MTWEOF X case MTWEOF: return (0); X#endif X X#ifdef MTFSF X case MTFSF: return (1); X#endif X X#ifdef MTBSF X case MTBSF: return (2); X#endif X X#ifdef MTFSR X case MTFSR: return (3); X#endif X X#ifdef MTBSR X case MTBSR: return (4); X#endif X X#ifdef MTREW X case MTREW: return (5); X#endif X X#ifdef MTOFFL X case MTOFFL: return (6); X#endif X X#ifdef MTNOP X case MTNOP: return (7); X#endif X } X return (-1); X} X X/* X * Map all new opcodes that should be in range above 7 to the X * values expected by the 'i' command of /etc/rmt. X */ XLOCAL int Xrmtmapnew(cmd) X int cmd; X{ X switch (cmd) { X X#ifdef MTCACHE X case MTCACHE: return (RMTICACHE); X#endif X X#ifdef MTNOCACHE X case MTNOCACHE: return (RMTINOCACHE); X#endif X X#ifdef MTRETEN X case MTRETEN: return (RMTIRETEN); X#endif X X#ifdef MTERASE X case MTERASE: return (RMTIERASE); X#endif X X#ifdef MTEOM X case MTEOM: return (RMTIEOM); X#endif X X#ifdef MTNBSF X case MTNBSF: return (RMTINBSF); X#endif X } X return (-1); X} X X/* X * Get one (single) member of struct mtget from remote X */ XLOCAL Llong Xrmtxgstatus(fd, cmd) X int fd; X char cmd; X{ X char cbuf[CMD_SIZE]; X int n; X X /* No newline */ X n = js_snprintf(cbuf, CMD_SIZE, "s%c", cmd); X if (n < 0 || n >= CMD_SIZE) { /* Paranoia */ X seterrno(EINVAL); X return (-1); X } X seterrno(0); X return (rmtcmd(fd, "extended status", cbuf)); X} X XLOCAL int Xrmt_v1_status(fd, mtp) X int fd; X struct rmtget *mtp; X{ X mtp->mt_xflags = 0; X X mtp->mt_erreg = rmtxgstatus(fd, MTS_ERREG); /* must be first */ X if (geterrno() == 0) X mtp->mt_xflags |= RMT_ERREG; X X mtp->mt_type = rmtxgstatus(fd, MTS_TYPE); X if (geterrno() == 0) X mtp->mt_xflags |= RMT_TYPE; X X mtp->mt_dsreg = rmtxgstatus(fd, MTS_DSREG); X if (geterrno() == 0) X mtp->mt_xflags |= RMT_DSREG; X X mtp->mt_resid = rmtxgstatus(fd, MTS_RESID); X if (geterrno() == 0) X mtp->mt_xflags |= RMT_RESID; X X mtp->mt_fileno = rmtxgstatus(fd, MTS_FILENO); X if (geterrno() == 0) X mtp->mt_xflags |= RMT_FILENO; X X mtp->mt_blkno = rmtxgstatus(fd, MTS_BLKNO); X if (geterrno() == 0) X mtp->mt_xflags |= RMT_BLKNO; X X mtp->mt_flags = rmtxgstatus(fd, MTS_FLAGS); X if (geterrno() == 0) X mtp->mt_xflags |= RMT_FLAGS; X X mtp->mt_bf = rmtxgstatus(fd, MTS_BF); X if (geterrno() == 0) X mtp->mt_xflags |= RMT_BF; X X if (mtp->mt_xflags == 0) X return (-1); X X return (0); X} X XLOCAL int Xrmt_v0_status(fd, mtp) X int fd; X struct mtget *mtp; X{ X register int i; X register char *cp; X char c; X int n; X X /* No newline */ X if ((n = rmtcmd(fd, "status", "S")) < 0) X return (-1); X X /* X * From disassembling Solaris ufsdump, they seem to check X * only if (n > sizeof (mts)). X */ X if (n != sizeof (struct mtget)) { X rmt_errmsgno(EX_BAD, X "rmtstatus: expected response size %d, got %d\n", X (int)sizeof (struct mtget), n); X rmt_errmsgno(EX_BAD, X "This means the remote rmt daemon is not compatible.\n"); X /* X * XXX should we better abort here? X */ X } X X for (i = 0, cp = (char *)mtp; i < sizeof (struct mtget); i++) X *cp++ = 0; X for (i = 0, cp = (char *)mtp; i < n; i++) { X /* X * Make sure to read all bytes because we otherwise X * would confuse the protocol. Do not copy more X * than the size of our local struct mtget. X */ X if (rmtreadchar(fd, &c) != 1) X return (rmtaborted(fd)); X X if (i < sizeof (struct mtget)) X *cp++ = c; X } X /* X * The GNU remote tape lib tries to swap the structure based on the X * value of mt_type. While this makes sense for UNIX, it will not X * work if one system is running Linux. The Linux mtget structure X * is completely incompatible (mt_type is long instead of short). X */ X return (n); X} X XEXPORT int Xrmtxstatus(fd, mtp) X int fd; X struct rmtget *mtp; X{ X struct mtget mtget; X X if (rmtioctl(fd, RMTIVERSION, 0) == RMT_VERSION) X return (rmt_v1_status(fd, mtp)); X X if (rmt_v0_status(fd, &mtget) < 0) X return (-1); X X if (_mtg2rmtg(mtp, &mtget) < 0) X return (-1); X return (0); X} X XEXPORT int Xrmtstatus(fd, mtp) X int fd; X struct mtget *mtp; X{ X struct rmtget rmtget; X int ret = -1; X X if (rmtioctl(fd, RMTIVERSION, 0) == RMT_VERSION) { X ret = rmt_v1_status(fd, &rmtget); X if (ret < 0) X return (ret); X } else { X if (rmt_debug) { X rmt_errmsgno(EX_BAD, X "Retrieving mt status from old server.\n"); X } X return (rmt_v0_status(fd, mtp)); X } X X _rmtg2mtg(mtp, &rmtget); X return (ret); X} X XLOCAL Llong Xrmtcmd(fd, name, cbuf) X int fd; X char *name; X char *cbuf; X{ X rmtsendcmd(fd, name, cbuf); X return (rmtgetstatus(fd, name)); X} X XLOCAL void Xrmtsendcmd(fd, name, cbuf) X int fd; X char *name; X char *cbuf; X{ X int buflen = strlen(cbuf); X X seterrno(0); X if (_niwrite(fd, cbuf, buflen) != buflen) X rmtaborted(fd); X} X X#define READB_SIZE 128 XLOCAL char readb[READB_SIZE]; XLOCAL char *readbptr; XLOCAL int readbcnt; X XLOCAL int Xrmtfillrdbuf(fd) X int fd; X{ X readbptr = readb; X X return (readbcnt = _niread(fd, readb, READB_SIZE)); X} X XLOCAL int Xrmtreadchar(fd, cp) X int fd; X char *cp; X{ X if (--readbcnt < 0) { X if (rmtfillrdbuf(fd) <= 0) X return (readbcnt); X --readbcnt; X } X *cp = *readbptr++; X return (1); X} X XLOCAL int Xrmtreadbuf(fd, buf, count) X register int fd; X register char *buf; X register int count; X{ X register int amt = 0; X register int cnt; X X if (readbcnt > 0) { X cnt = readbcnt; X if (cnt > count) X cnt = count; X movebytes(readbptr, buf, cnt); X readbptr += cnt; X readbcnt -= cnt; X amt += cnt; X } X while (amt < count) { X if ((cnt = _niread(fd, &buf[amt], count - amt)) <= 0) { X return (rmtaborted(fd)); X } X amt += cnt; X } X return (amt); X} X XLOCAL int Xrmtgetline(fd, line, count) X int fd; X char *line; X int count; X{ X register char *cp; X X for (cp = line; cp < &line[count]; cp++) { X if (rmtreadchar(fd, cp) != 1) X return (rmtaborted(fd)); X X if (*cp == '\n') { X *cp = '\0'; X return (cp - line); X } X } X if (rmt_debug) X rmt_errmsgno(EX_BAD, "Protocol error (in rmtgetline).\n"); X return (rmtaborted(fd)); X} X XLOCAL Llong Xrmtgetstatus(fd, name) X int fd; X char *name; X{ X char cbuf[CMD_SIZE]; X char code; X Llong number; X X rmtgetline(fd, cbuf, sizeof (cbuf)); X code = cbuf[0]; X astoll(&cbuf[1], &number); X X if (code == 'E' || code == 'F') { X rmtgetline(fd, cbuf, sizeof (cbuf)); X if (code == 'F') /* should close file ??? */ X rmtaborted(fd); X if (rmt_debug) X rmt_errmsgno(number, "Remote status(%s): %lld '%s'.\n", X name, number, cbuf); X seterrno(number); X return ((Llong)-1); X } X if (code != 'A') { X /* XXX Hier kommt evt Command not found ... */ X if (rmt_debug) { X rmt_errmsgno(EX_BAD, "Protocol error (got %s).\n", X cbuf); X } X return (rmtaborted(fd)); X } X return (number); X} X XLOCAL int Xrmtaborted(fd) X int fd; X{ X if (rmt_debug) X rmt_errmsgno(EX_BAD, "Lost connection to remote host ??\n"); X /* if fd >= 0 */ X /* close file */ X if (geterrno() == 0) { X /* X * BSD used EIO but EPIPE is better for something like X * sdd -noerror X */ X seterrno(EPIPE); X } X /* X * BSD uses exit(X_ABORT) == 3, we return(-1) and let the caller decide X */ X return (-1); X} X X#else /* USE_REMOTE */ X X/* ARGSUSED */ XEXPORT int Xrmtgetconn(host, trsize, excode) X char *host; /* The host name to connect to */ X int trsize; /* Max transfer size for SO_SNDBUF/SO_RCVBUF */ X int excode; /* If != 0 use value to exit() in this func */ X{ X rmt_errmsgno(EX_BAD, "Remote tape support not present.\n"); X X#ifdef ENOSYS X seterrno(ENOSYS); X#else X seterrno(EINVAL); X#endif X return (-1); X} X X/* ARGSUSED */ XEXPORT int Xrmtopen(fd, fname, fmode) X int fd; X char *fname; X int fmode; X{ X#ifdef ENOSYS X seterrno(ENOSYS); X#else X seterrno(EINVAL); X#endif X return (-1); X} X X/* ARGSUSED */ XEXPORT int Xrmtclose(fd) X int fd; X{ X#ifdef ENOSYS X seterrno(ENOSYS); X#else X seterrno(EINVAL); X#endif X return (-1); X} X X/* ARGSUSED */ XEXPORT int Xrmtread(fd, buf, count) X int fd; X char *buf; X int count; X{ X#ifdef ENOSYS X seterrno(ENOSYS); X#else X seterrno(EINVAL); X#endif X return (-1); X} X X/* ARGSUSED */ XEXPORT int Xrmtwrite(fd, buf, count) X int fd; X char *buf; X int count; X{ X#ifdef ENOSYS X seterrno(ENOSYS); X#else X seterrno(EINVAL); X#endif X return (-1); X} X X/* ARGSUSED */ XEXPORT off_t Xrmtseek(fd, offset, whence) X int fd; X off_t offset; X int whence; X{ X#ifdef ENOSYS X seterrno(ENOSYS); X#else X seterrno(EINVAL); X#endif X return (-1); X} X X/* ARGSUSED */ XEXPORT int Xrmtioctl(fd, cmd, count) X int fd; X int cmd; X int count; X{ X#ifdef ENOSYS X seterrno(ENOSYS); X#else X seterrno(EINVAL); X#endif X return (-1); X} X X/* ARGSUSED */ XEXPORT int Xrmtxstatus(fd, mtp) X int fd; X struct rmtget *mtp; X{ X#ifdef ENOSYS X seterrno(ENOSYS); X#else X seterrno(EINVAL); X#endif X return (-1); X} X X/* ARGSUSED */ XEXPORT int Xrmtstatus(fd, mtp) X int fd; X struct mtget *mtp; X{ X#ifdef ENOSYS X seterrno(ENOSYS); X#else X seterrno(EINVAL); X#endif X return (-1); X} X X#endif /* USE_REMOTE */ X X X XEXPORT void X_rmtg2mtg(mtp, rmtp) X struct mtget *mtp; X struct rmtget *rmtp; X{ X#ifdef HAVE_MTGET_TYPE X if (rmtp->mt_xflags & RMT_TYPE) X mtp->mt_type = rmtp->mt_type; X else X mtp->mt_type = 0; X#endif X#ifdef HAVE_MTGET_DSREG X if (rmtp->mt_xflags & RMT_DSREG) X mtp->mt_dsreg = rmtp->mt_dsreg; X else X mtp->mt_dsreg = 0; X#endif X#ifdef HAVE_MTGET_ERREG X if (rmtp->mt_xflags & RMT_ERREG) X mtp->mt_erreg = rmtp->mt_erreg; X else X mtp->mt_erreg = 0; X#endif X#ifdef HAVE_MTGET_RESID X if (rmtp->mt_xflags & RMT_RESID) X mtp->mt_resid = rmtp->mt_resid; X else X mtp->mt_resid = 0; X#endif X#ifdef HAVE_MTGET_FILENO X if (rmtp->mt_xflags & RMT_FILENO) X mtp->mt_fileno = rmtp->mt_fileno; X else X mtp->mt_fileno = -1; X#endif X#ifdef HAVE_MTGET_BLKNO X if (rmtp->mt_xflags & RMT_BLKNO) X mtp->mt_blkno = rmtp->mt_blkno; X else X mtp->mt_blkno = -1; X#endif X#ifdef HAVE_MTGET_FLAGS X if (rmtp->mt_xflags & RMT_FLAGS) X mtp->mt_flags = rmtp->mt_flags; X else X mtp->mt_flags = 0; X#endif X#ifdef HAVE_MTGET_BF X if (rmtp->mt_xflags & RMT_BF) X mtp->mt_bf = rmtp->mt_bf; X else X mtp->mt_bf = 0; X#endif X} X XEXPORT int X_mtg2rmtg(rmtp, mtp) X struct rmtget *rmtp; X struct mtget *mtp; X{ X rmtp->mt_xflags = 0; X X#ifdef HAVE_MTGET_TYPE X rmtp->mt_xflags |= RMT_TYPE; X rmtp->mt_type = mtp->mt_type; X#else X rmtp->mt_type = 0; X#endif X#ifdef HAVE_MTGET_DSREG X rmtp->mt_xflags |= RMT_DSREG; X rmtp->mt_dsreg = mtp->mt_dsreg; X#else X rmtp->mt_dsreg = 0; X#endif X#ifdef HAVE_MTGET_ERREG X rmtp->mt_xflags |= RMT_ERREG; X rmtp->mt_erreg = mtp->mt_erreg; X#else X rmtp->mt_erreg = 0; X#endif X#ifdef HAVE_MTGET_RESID X rmtp->mt_xflags |= RMT_RESID; X rmtp->mt_resid = mtp->mt_resid; X#else X rmtp->mt_resid = 0; X#endif X#ifdef HAVE_MTGET_FILENO X rmtp->mt_xflags |= RMT_FILENO; X rmtp->mt_fileno = mtp->mt_fileno; X#else X rmtp->mt_fileno = -1; X#endif X#ifdef HAVE_MTGET_BLKNO X rmtp->mt_xflags |= RMT_BLKNO; X rmtp->mt_blkno = mtp->mt_blkno; X#else X rmtp->mt_blkno = -1; X#endif X#ifdef HAVE_MTGET_FLAGS X rmtp->mt_xflags |= RMT_FLAGS; X rmtp->mt_flags = mtp->mt_flags; X#else X rmtp->mt_flags = 0; X#endif X#ifdef HAVE_MTGET_BF X rmtp->mt_xflags |= RMT_BF; X rmtp->mt_bf = mtp->mt_bf; X#else X rmtp->mt_bf = 0; X#endif X if (rmtp->mt_xflags == 0) X return (-1); X X rmtp->mt_xflags |= RMT_COMPAT; X return (0); X} X X/* -------------------------------------------------------------------------- */ X#ifdef USE_REMOTE X#ifdef USE_RCMD_RSH X/* X * If we make a separate file for libschily, we would need these include files: X * X * socketpair(): sys/types.h + sys/socket.h X * dup2(): schily/unistd.h (hat auch sys/types.h) X * strrchr(): schily/string.h X * X * and make sure that we use sigset() instead of signal() if possible. X */ X#include XLOCAL int X_rcmdrsh(ahost, inport, locuser, remuser, cmd, rsh) X char **ahost; X int inport; /* port is ignored */ X const char *locuser; X const char *remuser; X const char *cmd; X const char *rsh; X{ X struct passwd *pw; X int pp[2]; X int pid; X X if (rsh == 0) X rsh = "rsh"; X X /* X * Verify that 'locuser' is present on local host. X */ X if ((pw = getpwnam(locuser)) == NULL) { X rmt_errmsgno(EX_BAD, "Unknown user: %s\n", locuser); X return (-1); X } X /* XXX Check the existence for 'ahost' here? */ X X /* X * rcmd(3) creates a single socket to be used for communication. X * We need a bi-directional pipe to implement the same interface. X * On newer OS that implement bi-directional we could use pipe(2) X * but it makes no sense unless we find an OS that implements a X * bi-directional pipe(2) but no socketpair(). X */ X if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, pp) == -1) { X rmt_errmsgno(geterrno(), "Cannot create socketpair.\n"); X return (-1); X } X X pid = fork(); X if (pid < 0) { X return (-1); X } else if (pid == 0) { X const char *p; X const char *av0; X int xpid; X X (void) close(pp[0]); X if (dup2(pp[1], 0) == -1 || /* Pipe becomes 'stdin' */ X dup2(0, 1) == -1) { /* Pipe becomes 'stdout' */ X X rmt_errmsgno(geterrno(), "dup2 failed.\n"); X _exit(EX_BAD); X /* NOTREACHED */ X } X (void) close(pp[1]); /* We don't need this anymore */ X X /* X * Become 'locuser' to tell the rsh program the local user id. X */ X if (getuid() != pw->pw_uid && X setuid(pw->pw_uid) == -1) { X rmt_errmsgno(geterrno(), "setuid(%lld) failed.\n", X (Llong)pw->pw_uid); X _exit(EX_BAD); X /* NOTREACHED */ X } X if (getuid() != geteuid() && X#ifdef HAVE_SETREUID X setreuid(-1, pw->pw_uid) == -1) { X#else X#ifdef HAVE_SETEUID X seteuid(pw->pw_uid) == -1) { X#else X setuid(pw->pw_uid) == -1) { X#endif X#endif X errmsg("seteuid(%lld) failed.\n", X (Llong)pw->pw_uid); X _exit(EX_BAD); X /* NOTREACHED */ X } X X /* X * Fork again to completely detach from parent X * and avoid the need to wait(2). X */ X if ((xpid = fork()) == -1) { X rmt_errmsgno(geterrno(), X "rcmdsh: fork to lose parent failed.\n"); X _exit(EX_BAD); X /* NOTREACHED */ X } X if (xpid > 0) { X _exit(0); X /* NOTREACHED */ X } X X /* X * Always use remote shell programm (even for localhost). X * The client command may call getpeername() for security X * reasons and this would fail on a simple pipe. X */ X X X /* X * By default, 'rsh' handles terminal created signals X * but this is not what we like. X * For this reason, we tell 'rsh' to ignore these signals. X * Ignoring these signals is important to allow 'star' / 'sdd' X * to e.g. implement SIGQUIT as signal to trigger intermediate X * status printing. X * X * For now (late 2002), we know that the following programs X * are broken and do not implement signal handling correctly: X * X * rsh on SunOS-5.0...SunOS-5.9 X * ssh from ssh.com X * ssh from openssh.org X * X * Sun already did accept a bug report for 'rsh'. For the ssh X * commands we need to send out bug reports. Meanwhile it could X * help to call setsid() if we are running under X so the ssh X * X pop up for passwd reading will work. X */ X signal(SIGINT, SIG_IGN); X signal(SIGQUIT, SIG_IGN); X#ifdef SIGTSTP X signal(SIGTSTP, SIG_IGN); /* We would not be able to continue */ X#endif X X av0 = rsh; X if ((p = strrchr(rsh, '/')) != NULL) X av0 = ++p; X execlp(rsh, av0, *ahost, "-l", remuser, cmd, (char *)NULL); X X rmt_errmsgno(geterrno(), "execlp '%s' failed.\n", rsh); X _exit(EX_BAD); X /* NOTREACHED */ X } else { X (void) close(pp[1]); X /* X * Wait for the intermediate child. X * The real 'rsh' program is completely detached from us. X */ X wait(0); X return (pp[0]); X } X return (-1); /* keep gcc happy */ X} X X#ifdef HAVE_SOLARIS_PPRIV X XLOCAL BOOL Xppriv_ok() X{ X priv_set_t *privset; X BOOL net_privaddr = FALSE; X X X if ((privset = priv_allocset()) == NULL) { X return (FALSE); X } X if (getppriv(PRIV_EFFECTIVE, privset) == -1) { X priv_freeset(privset); X return (FALSE); X } X if (priv_ismember(privset, PRIV_NET_PRIVADDR)) { X net_privaddr = TRUE; X } X priv_freeset(privset); X X return (net_privaddr); X} X#else /* HAVE_SOLARIS_PPRIV */ X X#ifdef HAVE_LINUX_CAPS XLOCAL BOOL Xppriv_ok() X{ X cap_t cset; X cap_flag_value_t val = CAP_CLEAR; X X cset = cap_get_proc(); X X cap_get_flag(cset, CAP_NET_BIND_SERVICE, CAP_EFFECTIVE, &val); X return (val == CAP_SET); X} X#endif /* HAVE_LINUX_CAPS */ X X#endif /* HAVE_SOLARIS_PPRIV */ X X#endif /* USE_RCMD_RSH */ X#endif /* USE_REMOTE */ END-of-star-1.6/librmt/remote.c echo x - star-1.6/librmt/librmt.mk sed 's/^X//' >star-1.6/librmt/librmt.mk << 'END-of-star-1.6/librmt/librmt.mk' X#ident @(#)librmt.mk 1.6 18/06/09 X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X X#.SEARCHLIST: . $(ARCHDIR) stdio $(ARCHDIR) X#VPATH= .:stdio:$(ARCHDIR) XINSDIR= lib XTARGETLIB= rmt XCPPOPTS += -DUSE_REMOTE XCPPOPTS += -DUSE_RCMD_RSH XCPPOPTS += -DUSE_LARGEFILES Xinclude Targets XLIBS= XXMK_FILE= Makefile.man rmtinit.mk3 rmtdebug.mk3 \ X rmtrmt.mk3 rmtrsh.mk3 \ X rmtfilename.mk3 rmthostname.mk3 \ X rmtgetconn.mk3 \ X rmtopen.mk3 rmtclose.mk3 \ X rmtread.mk3 rmtwrite.mk3 rmtseek.mk3 rmtioctl.mk3 \ X rmtstatus.mk3 rmtxstatus.mk3 mtg2rmtg.mk3 rmtg2mtg.mk3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.lib X########################################################################### X#CC= echo " ==> COMPILING \"$@\""; cc X########################################################################### X END-of-star-1.6/librmt/librmt.mk echo x - star-1.6/librmt/Targets sed 's/^X//' >star-1.6/librmt/Targets << 'END-of-star-1.6/librmt/Targets' XCFILES= remote.c END-of-star-1.6/librmt/Targets echo x - star-1.6/librmt/librmt.3 sed 's/^X//' >star-1.6/librmt/librmt.3 << 'END-of-star-1.6/librmt/librmt.3' X. \" @(#)librmt.3 1.7 18/06/09 Copyr 2002-2018 J. Schilling X. \" Manual page for librmt X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH LIBRMT 3L "2018/06/09" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xlibrmt \- remote magtape protocol client interface library X.SH SYNOPSIS X.LP X.B cc X.RI "[ " "flag" " \|.\|.\|. ] " "file" " \|.\|.\|." X.B \-lrmt X.B \-lsocket X.B \-lnsl X.RI "[ " "library" " \|.\|.\|. ]" X.LP X.B X#include X.SH DESCRIPTION X.LP XFunctions in this library provide an interface to a remote tape server program. X.LP XThis implementation takes care of X.B RMT protocol VERSION 1 Xthat is needed in case that X.B rmt Xclient and X.B rmt Xserver do not run on the same OS and use a CPU with the same bit width and byte order. X.LP XIn addition, this implementation supports a GNU extension that allows to use X.BR open (2) Xflags beyond X.BR O_RDONLY ", " O_WRONLY ", " O_RDWR . X X.SH ENVIRONMENT X.LP X.TP X.B RSH XIf the X.B RSH Xenvironment is present, the remote connection will not be created via X.BR rcmd (3) Xbut by calling the program pointed to by X.BR RSH . XUse e.g. X.BR RSH= /usr/bin/ssh Xto create a secure shell connection. X.sp XIf the environment X.B RSH Xis empty, then the default X.B rcmd() Xis used even in case X.B rmtrsh() Xhas been called. X.TP X.B RMT XIf the X.B RMT Xenvironment is present, the remote tape server will not be the program X.B /etc/rmt Xbut the program pointed to by X.BR RMT . X.sp XIf the environment X.B RMT Xis empty, then the default X.B /etc/rmt Xis used even in case X.B rmtrmt() Xhas been called. X.sp XNote that the remote tape server program name will be ignored if you log in Xusing an account that has been created with a remote tape server program as Xlogin shell. X.SH INTERFACES X X.BR rmtinit (), X.BR rmtdebug (), X.BR rmtrmt (3), X.BR rmtrsh (3), X.BR rmthostname (), X.BR rmtfilename (), X.BR rmtgetconn (), X.BR rmtopen (), X.BR rmtioctl (), X.BR rmtclose (), X.BR rmtread (), X.BR rmtwrite (), X.BR rmtseek (), X.BR rmtxstatus (), X.BR rmtstatus (), X.BR _mtg2rmtg (), X.BR _rmtg2mtg () X X.SH FILES X.SH "SEE ALSO" X.BR rmt (1), X.BR rsh (1), X.BR ssh (1), X.BR rcmd (3) X X.\".SH NOTES X.\".SH BUGS X.SH AUTHOR X.LP X.B librmt Xhas been written in 1990 by J\*org Schilling. XIn 1995, support for X.B RMT VERSION 1 Xhas been added. X.B librmt Xis still maintained by J\*org Schilling. X.LP X.nf XJ\*org Schilling XSeestr. 110 XD\-13353 Berlin XGermany X.fi X.PP XMail bugs and suggestions to: X.PP X.B Xjoerg.schilling@fokus.fraunhofer.de Xor X.B Xjoerg@schily.net END-of-star-1.6/librmt/librmt.3 echo x - star-1.6/librmt/mtg2rmtg.3 sed 's/^X//' >star-1.6/librmt/mtg2rmtg.3 << 'END-of-star-1.6/librmt/mtg2rmtg.3' X.so man3/rmtstatus.3 X.\" @(#)mtg2rmtg.3 1.1 02/11/11 Copyright 2002 J. Schilling END-of-star-1.6/librmt/mtg2rmtg.3 echo x - star-1.6/librmt/rmtclose.3 sed 's/^X//' >star-1.6/librmt/rmtclose.3 << 'END-of-star-1.6/librmt/rmtclose.3' X.so man3/rmtopen.3 X.\" @(#)rmtclose.3 1.1 02/11/11 Copyright 2002 J. Schilling END-of-star-1.6/librmt/rmtclose.3 echo x - star-1.6/librmt/rmtdebug.3 sed 's/^X//' >star-1.6/librmt/rmtdebug.3 << 'END-of-star-1.6/librmt/rmtdebug.3' X.so man3/rmtgetconn.3 X.\" @(#)rmtdebug.3 1.1 02/11/11 Copyright 2002 J. Schilling END-of-star-1.6/librmt/rmtdebug.3 echo x - star-1.6/librmt/librmt_p.mk sed 's/^X//' >star-1.6/librmt/librmt_p.mk << 'END-of-star-1.6/librmt/librmt_p.mk' X#ident @(#)librmt_p.mk 1.4 08/01/11 X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XSUBARCHDIR= /profiled XSUBINSDIR= /profiled X#.SEARCHLIST: . $(ARCHDIR) stdio $(ARCHDIR) X#VPATH= .:stdio:$(ARCHDIR) XINSDIR= lib XTARGETLIB= rmt XCPPOPTS += -DUSE_REMOTE XCPPOPTS += -DUSE_RCMD_RSH XCPPOPTS += -DUSE_LARGEFILES XCOPTS += $(COPTGPROF) Xinclude Targets XLIBS= X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.lib X########################################################################### X#CC= echo " ==> COMPILING \"$@\""; cc X########################################################################### END-of-star-1.6/librmt/librmt_p.mk echo x - star-1.6/librmt/shlrmt.mk sed 's/^X//' >star-1.6/librmt/shlrmt.mk << 'END-of-star-1.6/librmt/shlrmt.mk' X#ident @(#)shlrmt.mk 1.6 13/04/22 X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XSUBARCHDIR= /pic X#.SEARCHLIST: . $(ARCHDIR) stdio $(ARCHDIR) X#VPATH= .:stdio:$(ARCHDIR) XINSDIR= lib XTARGETLIB= rmt XCPPOPTS += -DUSE_REMOTE XCPPOPTS += -DUSE_RCMD_RSH XCPPOPTS += -DUSE_LARGEFILES Xinclude Targets X# X# LIB_CAP is needed for Linux capability support in librscg. X# XLIBS= -lschily $(LIB_SOCKET) $(LIB_CAP) -lc X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.shl X########################################################################### X#CC= echo " ==> COMPILING \"$@\""; cc X########################################################################### END-of-star-1.6/librmt/shlrmt.mk echo x - star-1.6/librmt/rmtfilename.3 sed 's/^X//' >star-1.6/librmt/rmtfilename.3 << 'END-of-star-1.6/librmt/rmtfilename.3' X.so man3/rmtgetconn.3 X.\" @(#)rmtfilename.3 1.1 02/11/11 Copyright 2002 J. Schilling END-of-star-1.6/librmt/rmtfilename.3 echo x - star-1.6/librmt/rmtg2mtg.3 sed 's/^X//' >star-1.6/librmt/rmtg2mtg.3 << 'END-of-star-1.6/librmt/rmtg2mtg.3' X.so man3/rmtstatus.3 X.\" @(#)rmtg2mtg.3 1.1 02/11/11 Copyright 2002 J. Schilling END-of-star-1.6/librmt/rmtg2mtg.3 echo x - star-1.6/librmt/rmtgetconn.3 sed 's/^X//' >star-1.6/librmt/rmtgetconn.3 << 'END-of-star-1.6/librmt/rmtgetconn.3' X. \" @(#)rmtgetconn.3 1.4 18/06/09 Copyr 2002-2018 J. Schilling X. \" Manual page for rmtgetconn X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH RMTGETCONN 3L "2018/06/09" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xrmtinit, rmtdebug, rmthostname, rmtfilename, rmtgetconn \- initiate a connection to a remote tape server X.SH SYNOPSIS X.LP X.B cc X.RI "[ " "flag" " \|.\|.\|. ] " "file" " \|.\|.\|." X.B \-lrmt X.B \-lsocket X.B \-lnsl X.RI "[ " "library" " \|.\|.\|. ]" X.LP X.nf X.B X#include X.sp X.B Xvoid rmtinit(errmsgn, eexit) X.B X int (*errmsgn) (int, const char *, ...); X.B X void (*eexit) (int); X.sp X.B Xint rmtdebug(dlevel) X.B X int dlevel; X.sp X.B Xconst char *rmtrmt(rmtname) X.B X const char *rmtname; X.sp X.B Xconst char *rmtrsh(rshname) X.B X const char *rshname; X.sp X.B Xchar *rmtfilename(name) X.B X char *name; X.sp X.B Xchar *rmthostname(hostname, hnsize, rmtspec) X.B X char *hostname; X.B X int hnsize; X.B X char *rmtspec; X.sp X.B Xint rmtgetconn(host, trsize, excode) X.B X char *host; X.B X int trsize; X.B X int excode; X.fi X.SH DESCRIPTION X.TP X.B rmtinit() XIs an optional function that allows to set up a function for Xerror printing and a function to be called to exit the program. XIf X.B rmtinit() Xis not called or any of the function pointers is X.SM NULL, Xthe appropriate default function is used instead. XThe supplied error printing function needs to be compatible with X.BR errmsgno (3) Xand the supplied exit function needs to be compatible with X.BR exit (3). X.TP X.B rmtdebug() Xallows to set the debug level for the library code. The default debug Xlevel is 0 and does not print debug messages. X.TP X.B rmtrmt() Xallows to set up a different default path to the remote X.B rmt Xserver program. The default is otherwise X.BR /etc/rmt . XThe X.B RMT Xenvironment still overwrites the default set up by X.BR rmtrmt() . X.TP X.B rmtrsh() Xallows to set up a different remote login program to the remote X.B rmt Xserver program. The default is otherwise to use X.BR rcmd (3). XThe X.B RSH Xenvironment still overwrites the default set up by X.BR rmtrsh() . X.TP X.B rmtfilename() Xis given a filename that may be either in remote file syntax ( X.I hostname:filename Xor X.I user@hostname:filename X) or not. XIf the argument turns out to be in remote file syntax, a pointer to the Xfilename part is returned. X.TP X.B rmthostname() XThis function copies the user/host part of X.I rmtspec Xwhich should be in remote file syntax. XThe first argument is a character array that should be large enough to hold Xthe user/host part of X.IR rmtspec . XThe second argument is the size of the character array. XThe third argument is a string in remote file syntax. X.TP X.B rmtgetconn() XThis function establishes a connection to the remote tape server process. XThe first parameter is the usr/host part of a string in remote file syntax Xand should be created via X.BR rmthostname(). XThe second parameter is the expected maximum transfer size. It is used to set up Xkernel buffering via X.B setsockopt() Xto increase performance. XThe third parameter is an alternate exit code to be used instead of the library Xdefault if X.B rmtgetconn() Xdecides to call X.BR exit(). XThis allows commands like X.B ufsdump Xto use the documented exit codes for startup errors. X.SH RETURNS X.TP X.B rmtdebug() Xreturns the old debug level. X.TP X.B rmtrmt() Xreturns the old default remote X.B rmt Xserver program path or X.B NULL Xin case that the default was not overwritten. X.TP X.B rmtrsh() Xreturns the old default X.B rmt Xremote login program or X.B NULL Xin case that the default was not overwritten. X.TP X.B rmtfilename() Xreturns the filename part of the argument string or X.SM NULL Xin case the argument turns out to be not in remote file syntax. X.TP X.B rmthostname() Xreturns a pointer to the first argument or X.SM NULL Xin case the X.I rmtspec Xargument turns out to be not in remote file syntax. X.TP X.B rmtgetconn() Xreturn a file descriptor which is suitable to be used as first argument Xfor functions like X.B rmtopen() Xor X.BR rmtwrite() . XIf X.B rmtgetconn() Xfails to set up a connection, -1 is returned. XIf X.B rmtgetconn() Xis unable to find the port number for shell/tcp, the current uid has no Xentry in the passwd file or the user name includes illegal characters, X.B exit() Xis called. XIf you do not like X.B rmtgetconn() Xto exit in this case, call X.B rmtinit() Xbefore and install a non exiting function as X.B exit() Xhandler; X.B rmtgetconn() Xthen will return -2 after this function did return. X. \" .SH ERRORS X X.SH EXAMPLES X.LP X\fB X.nf Xint remfd; Xchar *remfn; Xchar host[256]; X Xif ((remfn = rmtfilename(filename)) != NULL) { X rmthostname(host, sizeof (host), filename); X X if ((remfd = rmtgetconn(host, iosize, 0)) < 0) X comerrno(EX_BAD, "Cannot get connection to '%s'.\en", X /* errno not valid !! */ host); X} X Xif (rmtopen(remfd, remfn, mode) < 0) X comerr("Cannot open '%s'.\en", remfn); X Xif (rmtread(remfd, buf, sizeof(buf) < 0) X comerr("Read error on '%s'.\en", remfn); X Xrmtclose(remfd); X.fi X\fP X.SH ENVIRONMENT X.LP X.TP X.B RSH XIf the X.B RSH Xenvironment is present, the remote connection will not be created via X.BR rcmd (3) Xbut by calling the program pointed to by X.BR RSH . XUse e.g. X.BR RSH= /usr/bin/ssh Xto create a secure shell connection. X.sp XIf the environment X.B RSH Xis empty, then the default X.B rcmd() Xis used even in case X.B rmtrsh() Xhas been called. X.TP X.B RMT XIf the X.B RMT Xenvironment is present, the remote tape server will not be the program X.B /etc/rmt Xbut the program pointed to by X.BR RMT . X.sp XIf the environment X.B RMT Xis empty, then the default X.B /etc/rmt Xis used even in case X.B rmtrmt() Xhas been called. X.sp XNote that the remote tape server program name will be ignored if you log in Xusing an account that has been created with a remote tape server program as Xlogin shell. X.\".SH FILES X.SH "SEE ALSO" X.BR rmt (1), X.BR rsh (1), X.BR ssh (1), X.BR rcmd (3), X.BR rmtinit (3), X.BR rmtdebug (3), X.BR rmtrmt (3), X.BR rmtrsh (3), X.BR rmthostname (3), X.BR rmtfilename (3), X.BR rmtgetconn (3), X.BR rmtopen (3), X.BR rmtioctl (3), X.BR rmtclose (3), X.BR rmtread (3), X.BR rmtwrite (3), X.BR rmtseek (3), X.BR rmtxstatus (3), X.BR rmtstatus (3), X.BR _mtg2rmtg (3), X.BR _rmtg2mtg (3), X.BR errmsgno (3) X X.SH DIAGNOSTICS X.SH NOTES X.SH BUGS X.LP XFor now (late 2002), we know that the following programs Xare broken and do not implement signal handling correctly: X.TP Xrsh Xon SunOS-5.0...SunOS-5.9 X.TP Xssh Xfrom ssh.com X.TP Xssh Xfrom openssh.org X.LP XSun already did accept a bug report for X.BR rsh (1). XOpenssh.org accepted Xa bug for their implementation of X.BR ssh (1). X.LP XIf you use X.B rmtgetconn() Xto create a remote connection via an unfixed X.BR rsh (1) Xor X.BR ssh (1), Xbe prepared that terminal generated signals may interrupt the Xremote connection. X.SH AUTHOR X.LP X.B librmt Xhas been written in 1990 by J\*org Schilling. XIn 1995, support for X.B RMT VERSION 1 Xhas been added. X.B librmt Xis still maintained by J\*org Schilling. X.LP X.nf XJ\*org Schilling XSeestr. 110 XD\-13353 Berlin XGermany X.fi X.PP XMail bugs and suggestions to: X.PP X.B Xjoerg.schilling@fokus.fraunhofer.de Xor X.B Xjoerg@schily.net END-of-star-1.6/librmt/rmtgetconn.3 echo x - star-1.6/librmt/rmthostname.3 sed 's/^X//' >star-1.6/librmt/rmthostname.3 << 'END-of-star-1.6/librmt/rmthostname.3' X.so man3/rmtgetconn.3 X.\" @(#)rmthostname.3 1.1 02/11/11 Copyright 2002 J. Schilling END-of-star-1.6/librmt/rmthostname.3 echo x - star-1.6/librmt/rmtinit.3 sed 's/^X//' >star-1.6/librmt/rmtinit.3 << 'END-of-star-1.6/librmt/rmtinit.3' X.so man3/rmtgetconn.3 X.\" @(#)rmtinit.3 1.1 02/11/11 Copyright 2002 J. Schilling END-of-star-1.6/librmt/rmtinit.3 echo x - star-1.6/librmt/rmtioctl.3 sed 's/^X//' >star-1.6/librmt/rmtioctl.3 << 'END-of-star-1.6/librmt/rmtioctl.3' X.so man3/rmtopen.3 X.\" @(#)rmtioctl.3 1.1 02/11/11 Copyright 2002 J. Schilling END-of-star-1.6/librmt/rmtioctl.3 echo x - star-1.6/librmt/rmtopen.3 sed 's/^X//' >star-1.6/librmt/rmtopen.3 << 'END-of-star-1.6/librmt/rmtopen.3' X. \" @(#)rmtopen.3 1.6 18/06/09 Copyr 2002-2018 J. Schilling X. \" Manual page for rmtopen X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH RMTOPEN 3L "2018/06/09" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xrmtopen, rmtclose, rmtread, rmtwrite, rmtseek, rmtioctl \- operate on a connection to a remote tape server X.SH SYNOPSIS X.LP X.B cc X.RI "[ " "flag" " \|.\|.\|. ] " "file" " \|.\|.\|." X.B \-lrmt X.B \-lsocket X.B \-lnsl X.RI "[ " "library" " \|.\|.\|. ]" X.LP X.nf X.B X#include X.B X#include X.sp X.B Xint rmtopen(int remfd, char *pathname, int fmode); X.sp X.B Xint rmtclose(int remfd); X.sp X.B Xint rmtread(int remfd, char *buf, int count); X.sp X.B Xint rmtwrite(int remfd, char *buf, int count); X.sp X.B Xint rmtseek(int remfd, off_t offset, int whence); X.sp X.B Xint rmtioctl(int remfd, int cmd, int count); X.fi X.SH DESCRIPTION X.TP X.B rmtopen() Xsends an open request to the remote server, X.I remfd Xis a file descriptor previously obtained from a call to X.BR rmtgetconn() , X.I pathname Xis a path to be opened on the server side and X.I fmode Xis the same as the third argument for X.BR open (2). XIf the remote server does not support Xthe GNU open flag enhancements, only the lowest two bits Xin the open flags can be send to the remote server. X.sp XIf the open requests succeeds, X.B rmtopen() Xtakes care of telling the remote side to switch to X.B RMT protocol VERSION 1 X.TP X.B rmtclose() Xsends a close request to the remote server, X.I remfd Xis a file descriptor previously obtained from a call to X.BR rmtgetconn() . X.TP X.B rmtread() Xsends a read request to the remote server, X.I remfd Xis a file descriptor previously obtained from a call to X.BR rmtgetconn() . XThe other parameters are the same as for a local X.B read(2) Xcall. X.B rmtread() Xwill fail if there was no previous successful X.B rmtopen() Xbefore. X.TP X.B rmtwrite() Xsends a write request to the remote server, X.I remfd Xis a file descriptor previously obtained from a call to X.BR rmtgetconn() . XThe other parameters are the same as for a local X.B write(2) Xcall. X.B rmtwrite() Xwill fail if there was no previous successful X.B rmtopen() Xbefore. X.TP X.B rmtseek() Xsends a seek request to the remote server, X.I remfd Xis a file descriptor previously obtained from a call to X.BR rmtgetconn() . XThe other parameters are the same as for a local X.B lseek(2) Xcall. X.B rmtseek() Xwill fail if there was no previous successful X.B rmtopen() Xbefore. X.TP X.B rmtioctl() Xsends a X.B MTIOCTOP Xrequest to the remote server, X.B cmd Xand X.B count Xare the values that should be filled into X.BR "struct mtop" . XSee X.B mtio(7) Xfor more information. X.SH RETURNS X.TP X.B rmtopen() Xreturns a value >= 0 if the remote open succeeds. X.TP X.B rmtclose() Xreturns a value >= 0 if the remote close succeeds. X.TP X.B rmtread() Xreturns the return value obtained the remote X.B read(2) Xrequest. X.TP X.B rmtwrite() Xreturns the return value obtained the remote X.B write(2) Xrequest. X.TP X.B rmtseek() Xreturns the return value obtained the remote X.B lseek(2) Xrequest. X.TP X.B rmtioctl() Xreturns the return value obtained the remote X.B ioctl(f, MTIOCTOP, struct mtop *) Xcall. X X.SH ERRORS XAll functions return -1 on error and set X.B errno Xto the X.B errno Xvalue retrieved from the remote server. X.SH EXAMPLES X.LP X\fB X.nf Xint remfd; Xchar *remfn; Xchar host[256]; X Xif ((remfn = rmtfilename(filename)) != NULL) { X rmthostname(host, sizeof (host), filename); X X if ((remfd = rmtgetconn(host, iosize, 0)) < 0) X comerrno(EX_BAD, "Cannot get connection to '%s'.\en", X /* errno not valid !! */ host); X} X Xif (rmtopen(remfd, remfn, mode) < 0) X comerr("Cannot open '%s'.\en", remfn); X Xif (rmtread(remfd, buf, sizeof(buf)) < 0) X comerr("Read error on '%s'.\en", remfn); X Xrmtclose(remfd); X.fi X\fP X.SH ENVIRONMENT X.\".SH FILES X.SH "SEE ALSO" X.BR rmt (1), X.BR rsh (1), X.BR ssh (1), X.BR rcmd (3), X.BR rmtinit (3), X.BR rmtdebug (3), X.BR rmtrmt (3), X.BR rmtrsh (3), X.BR rmthostname (3), X.BR rmtfilename (3), X.BR rmtgetconn (3), X.BR rmtopen (3), X.BR rmtioctl (3), X.BR rmtclose (3), X.BR rmtread (3), X.BR rmtwrite (3), X.BR rmtseek (3), X.BR rmtxstatus (3), X.BR rmtstatus (3), X.BR _mtg2rmtg (3), X.BR _rmtg2mtg (3), X.BR errmsgno (3), X.BR mtio (7) X X.SH DIAGNOSTICS X.SH NOTES XWhile all other known X.B rmt Ximplementations limit the size of a single X.B rmt Xcommand to 64 bytes, this implementation limits all standard Xcommand lines to 80 bytes and the file name to 4096 bytes. X.LP XNote that this may cause problems if the remote X.B rmt Xserver implementation is directly derived from the historic XBSD server code. This is true for all BSD systems, for SunOS up Xto 5.9 and even for the GNU X.B rmt Xserver. X.LP XAs some of the other X.B rmt Xservers do not even implement bound checking, be prepared that Xother server implementations may dump core or at least stop honoring Xthe X.B rmt Xprotocol. X.LP XIf you like to use long file names, make sure that you also use the X.B schily rmt Xserver. X.SH BUGS X.LP XIf local and remote X.B errno Xvalues do not match, programs may get confused. X.SH AUTHOR X.LP X.B librmt Xhas been written in 1990 by J\*org Schilling. XIn 1995, support for X.B RMT VERSION 1 Xhas been added. X.B librmt Xis still maintained by J\*org Schilling. X.LP X.nf XJ\*org Schilling XSeestr. 110 XD\-13353 Berlin XGermany X.fi X.PP XMail bugs and suggestions to: X.PP X.B Xjoerg.schilling@fokus.fraunhofer.de Xor X.B Xjoerg@schily.net END-of-star-1.6/librmt/rmtopen.3 echo x - star-1.6/librmt/rmtread.3 sed 's/^X//' >star-1.6/librmt/rmtread.3 << 'END-of-star-1.6/librmt/rmtread.3' X.so man3/rmtopen.3 X.\" @(#)rmtread.3 1.1 02/11/11 Copyright 2002 J. Schilling END-of-star-1.6/librmt/rmtread.3 echo x - star-1.6/librmt/rmtseek.3 sed 's/^X//' >star-1.6/librmt/rmtseek.3 << 'END-of-star-1.6/librmt/rmtseek.3' X.so man3/rmtopen.3 X.\" @(#)rmtseek.3 1.1 02/11/11 Copyright 2002 J. Schilling END-of-star-1.6/librmt/rmtseek.3 echo x - star-1.6/librmt/rmtstatus.3 sed 's/^X//' >star-1.6/librmt/rmtstatus.3 << 'END-of-star-1.6/librmt/rmtstatus.3' X. \" @(#)rmtstatus.3 1.5 18/06/09 Copyr 2002-2018 J. Schilling X. \" Manual page for rmtstatus X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH RMTSTATUS 3L "2018/06/09" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xrmtstatus, rmtxstatus, _mtg2rmtg, _rmtg2mtg \- request MTIOCGET on a connection to a remote tape server X.SH SYNOPSIS X.LP X.B cc X.RI "[ " "flag" " \|.\|.\|. ] " "file" " \|.\|.\|." X.B \-lrmt X.B \-lsocket X.B \-lnsl X.RI "[ " "library" " \|.\|.\|. ]" X.LP X.nf X.B X#include X.B X#include X.sp X.B Xint rmtstatus(int remfd, struct mtget *mtp); X.sp X.B Xint rmtxstatus(int remfd, struct rmtget *mtp); X.sp X.B Xvoid _rmtg2mtg(struct mtget *mtp, struct rmtget *rmtp); X.sp X.B Xint _mtg2rmtg(struct rmtget *rmtp, struct mtget *mtp); X.fi X.SH DESCRIPTION X.TP X.BR rmtstatus() " and " rmtxstatus() Xperform a MTIOCGET Xrequest to the remote server, X.I remfd Xis a file descriptor previously obtained from a call to X.BR rmtgetconn() , X.B "struct mtget Xis the local magnetic tape status structure, X.B "struct rmtget Xis the enhanced magnetic tape status structure from X.BR librmt . X.B rmtstatus() Xand X.B rmtxstatus() Xwill fail if there was no previous successful X.B rmtopen() Xbefore. X.B rmtstatus() Xand X.B rmtxstatus() Xtake care of using X.B RMT protocol VERSION 1 Xif the remote side implements support for protocol version 1. XThe function X.B rmtstatus() Xis outdated and should be avoided as the results in X.B "struct mtget Xwill be the least common denominator of the local and remote variants Xof the structure. XUse X.B rmtxstatus() Xinstead. XThe member X.B mt_xflags Xin X.B "struct rmtget Xcontains a bitmap that indicates which members of the structure contain Xvalid values. XSee X.B mtio(7) Xfor more information. X.TP X.B _rmtg2mtg() Xconverts a X.B "struct rmtget Xinto a X.BR "struct mtget" . X.TP X.B _mtg2rmtg() Xconverts a X.B "struct mtget Xinto a X.B "struct rmtget" Xand sets the member X.B mt_xflags Xin X.B "struct rmtget Xto contain a bitmap that indicates which members of X.B "struct mtget Xare present in the local implementation. X.SH RETURNS X.TP X.BR rmtstatus() " and "rmtxstatus() Xreturn a value >= 0 if the remote X.B ioctl(f, MTIOCGET, struct mtget *) Xsucceeds. X X.SH ERRORS X.BR rmtstatus() " and "rmtxstatus() Xreturn -1 on error and set X.B errno Xto the X.B errno Xvalue retrieved from the remote server. X.TP X.B _mtg2rmtg() Xreturns -1 if no value from the local X.B "struct mtget Xcould be converted to the abstract X.BR "struct rmtget" . X.SH EXAMPLES X.LP X\fB X.nf Xint remfd; Xchar *remfn; Xchar host[256]; Xstruct rmtget rmtg; X Xif ((remfn = rmtfilename(filename)) != NULL) { X rmthostname(host, sizeof (host), filename); X X if ((remfd = rmtgetconn(host, iosize, 0)) < 0) X comerrno(EX_BAD, "Cannot get connection to '%s'.\en", X /* errno not valid !! */ host); X} X Xif (rmtopen(remfd, remfn, mode) < 0) X comerr("Cannot open '%s'.\en", remfn); X Xif (rmtxstatus(remfd, &rmtg) < 0) X comerr("Cannot retrieve magnetic tape status fom '%s'.\en", remfn); X Xrmtclose(remfd); X.fi X\fP X.SH ENVIRONMENT X.\".SH FILES X.SH "SEE ALSO" X.BR rmt (1), X.BR rsh (1), X.BR ssh (1), X.BR rcmd (3), X.BR rmtinit (3), X.BR rmtdebug (3), X.BR rmtrmt (3), X.BR rmtrsh (3), X.BR rmthostname (3), X.BR rmtfilename (3), X.BR rmtgetconn (3), X.BR rmtopen (3), X.BR rmtioctl (3), X.BR rmtclose (3), X.BR rmtread (3), X.BR rmtwrite (3), X.BR rmtseek (3), X.BR rmtxstatus (3), X.BR rmtstatus (3), X.BR _mtg2rmtg (3), X.BR _rmtg2mtg (3), X.BR errmsgno (3), X.BR mtio (7) X X.SH DIAGNOSTICS X.SH NOTES X.SH BUGS X.LP XIf local and remote X.B errno Xvalues do not match, programs may get confused. X.SH AUTHOR X.LP X.B librmt Xhas been written in 1990 by J\*org Schilling. XIn 1995, support for X.B RMT VERSION 1 Xhas been added. X.B librmt Xis still maintained by J\*org Schilling. X.LP X.nf XJ\*org Schilling XSeestr. 110 XD\-13353 Berlin XGermany X.fi X.PP XMail bugs and suggestions to: X.PP X.B Xjoerg.schilling@fokus.fraunhofer.de Xor X.B Xjoerg@schily.net END-of-star-1.6/librmt/rmtstatus.3 echo x - star-1.6/librmt/rmtwrite.3 sed 's/^X//' >star-1.6/librmt/rmtwrite.3 << 'END-of-star-1.6/librmt/rmtwrite.3' X.so man3/rmtopen.3 X.\" @(#)rmtwrite.3 1.1 02/11/11 Copyright 2002 J. Schilling END-of-star-1.6/librmt/rmtwrite.3 echo x - star-1.6/librmt/rmtxstatus.3 sed 's/^X//' >star-1.6/librmt/rmtxstatus.3 << 'END-of-star-1.6/librmt/rmtxstatus.3' X.so man3/rmtstatus.3 X.\" @(#)rmtxstatus.3 1.1 02/11/11 Copyright 2002 J. Schilling END-of-star-1.6/librmt/rmtxstatus.3 echo x - star-1.6/librmt/mtg2rmtg.mk3 sed 's/^X//' >star-1.6/librmt/mtg2rmtg.mk3 << 'END-of-star-1.6/librmt/mtg2rmtg.mk3' X#ident @(#)mtg2rmtg.mk3 1.1 02/11/11 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= mtg2rmtg XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= mtg2rmtg.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/librmt/mtg2rmtg.mk3 echo x - star-1.6/librmt/rmtclose.mk3 sed 's/^X//' >star-1.6/librmt/rmtclose.mk3 << 'END-of-star-1.6/librmt/rmtclose.mk3' X#ident @(#)rmtclose.mk3 1.1 02/11/11 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= rmtclose XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= rmtclose.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/librmt/rmtclose.mk3 echo x - star-1.6/librmt/rmtdebug.mk3 sed 's/^X//' >star-1.6/librmt/rmtdebug.mk3 << 'END-of-star-1.6/librmt/rmtdebug.mk3' X#ident @(#)rmtdebug.mk3 1.1 02/11/11 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= rmtdebug XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= rmtdebug.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/librmt/rmtdebug.mk3 echo x - star-1.6/librmt/rmtfilename.mk3 sed 's/^X//' >star-1.6/librmt/rmtfilename.mk3 << 'END-of-star-1.6/librmt/rmtfilename.mk3' X#ident @(#)rmtfilename.mk3 1.1 02/11/11 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= rmtfilename XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= rmtfilename.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/librmt/rmtfilename.mk3 echo x - star-1.6/librmt/rmtg2mtg.mk3 sed 's/^X//' >star-1.6/librmt/rmtg2mtg.mk3 << 'END-of-star-1.6/librmt/rmtg2mtg.mk3' X#ident @(#)rmtg2mtg.mk3 1.1 02/11/11 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= rmtg2mtg XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= rmtg2mtg.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/librmt/rmtg2mtg.mk3 echo x - star-1.6/librmt/rmtgetconn.mk3 sed 's/^X//' >star-1.6/librmt/rmtgetconn.mk3 << 'END-of-star-1.6/librmt/rmtgetconn.mk3' X#ident @(#)rmtgetconn.mk3 1.1 02/11/11 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= rmtgetconn XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= rmtgetconn.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/librmt/rmtgetconn.mk3 echo x - star-1.6/librmt/rmthostname.mk3 sed 's/^X//' >star-1.6/librmt/rmthostname.mk3 << 'END-of-star-1.6/librmt/rmthostname.mk3' X#ident @(#)rmthostname.mk3 1.1 02/11/11 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= rmthostname XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= rmthostname.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/librmt/rmthostname.mk3 echo x - star-1.6/librmt/rmtinit.mk3 sed 's/^X//' >star-1.6/librmt/rmtinit.mk3 << 'END-of-star-1.6/librmt/rmtinit.mk3' X#ident @(#)rmtinit.mk3 1.1 02/11/11 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= rmtinit XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= rmtinit.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/librmt/rmtinit.mk3 echo x - star-1.6/librmt/rmtioctl.mk3 sed 's/^X//' >star-1.6/librmt/rmtioctl.mk3 << 'END-of-star-1.6/librmt/rmtioctl.mk3' X#ident @(#)rmtioctl.mk3 1.1 02/11/11 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= rmtioctl XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= rmtioctl.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/librmt/rmtioctl.mk3 echo x - star-1.6/librmt/rmtopen.mk3 sed 's/^X//' >star-1.6/librmt/rmtopen.mk3 << 'END-of-star-1.6/librmt/rmtopen.mk3' X#ident @(#)rmtopen.mk3 1.1 02/11/11 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= rmtopen XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= rmtopen.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/librmt/rmtopen.mk3 echo x - star-1.6/librmt/rmtread.mk3 sed 's/^X//' >star-1.6/librmt/rmtread.mk3 << 'END-of-star-1.6/librmt/rmtread.mk3' X#ident @(#)rmtread.mk3 1.1 02/11/11 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= rmtread XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= rmtread.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/librmt/rmtread.mk3 echo x - star-1.6/librmt/rmtseek.mk3 sed 's/^X//' >star-1.6/librmt/rmtseek.mk3 << 'END-of-star-1.6/librmt/rmtseek.mk3' X#ident @(#)rmtseek.mk3 1.1 02/11/11 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= rmtseek XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= rmtseek.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/librmt/rmtseek.mk3 echo x - star-1.6/librmt/rmtstatus.mk3 sed 's/^X//' >star-1.6/librmt/rmtstatus.mk3 << 'END-of-star-1.6/librmt/rmtstatus.mk3' X#ident @(#)rmtstatus.mk3 1.1 02/11/11 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= rmtstatus XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= rmtstatus.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/librmt/rmtstatus.mk3 echo x - star-1.6/librmt/rmtwrite.mk3 sed 's/^X//' >star-1.6/librmt/rmtwrite.mk3 << 'END-of-star-1.6/librmt/rmtwrite.mk3' X#ident @(#)rmtwrite.mk3 1.1 02/11/11 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= rmtwrite XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= rmtwrite.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/librmt/rmtwrite.mk3 echo x - star-1.6/librmt/rmtxstatus.mk3 sed 's/^X//' >star-1.6/librmt/rmtxstatus.mk3 << 'END-of-star-1.6/librmt/rmtxstatus.mk3' X#ident @(#)rmtxstatus.mk3 1.1 02/11/11 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= rmtxstatus XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= rmtxstatus.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/librmt/rmtxstatus.mk3 echo x - star-1.6/librmt/noshlrmt.mk sed 's/^X//' >star-1.6/librmt/noshlrmt.mk << 'END-of-star-1.6/librmt/noshlrmt.mk' X#ident "@(#)noshlrmt.mk 1.1 06/07/21 " X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X Xall: X @echo " ==> NO shared libs on this platform (yet)" END-of-star-1.6/librmt/noshlrmt.mk echo x - star-1.6/librmt/librmt-mapvers sed 's/^X//' >star-1.6/librmt/librmt-mapvers << 'END-of-star-1.6/librmt/librmt-mapvers' X# /* @(#)librmt-mapvers 1.3 18/06/09 Copyright 2005-2018 J. Schilling */ X XSCHILY_1.1 { Xglobal: X rmtrmt; X rmtrsh; X} SCHILY_1.0; X XSCHILY_1.0 { Xglobal: X _mtg2rmtg; X _rmtg2mtg; X rmtclose; X rmtdebug; X rmtfilename; X rmtgetconn; X rmthostname; X rmtinit; X rmtioctl; X rmtopen; X rmtread; X rmtseek; X rmtstatus; X rmtwrite; X rmtxstatus; X Xlocal: X *; X}; END-of-star-1.6/librmt/librmt-mapvers echo x - star-1.6/librmt/Makefile.man sed 's/^X//' >star-1.6/librmt/Makefile.man << 'END-of-star-1.6/librmt/Makefile.man' X#ident %W% %E% %Q% X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= librmt XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= librmt.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/librmt/Makefile.man echo x - star-1.6/librmt/rmtrsh.3 sed 's/^X//' >star-1.6/librmt/rmtrsh.3 << 'END-of-star-1.6/librmt/rmtrsh.3' X.so man3/rmtgetconn.3 X.\" @(#)rmtrsh.3 1.1 18/06/09 Copyright 2018 J. Schilling END-of-star-1.6/librmt/rmtrsh.3 echo x - star-1.6/librmt/rmtrmt.3 sed 's/^X//' >star-1.6/librmt/rmtrmt.3 << 'END-of-star-1.6/librmt/rmtrmt.3' X.so man3/rmtgetconn.3 X.\" @(#)rmtrmt.3 1.1 18/06/09 Copyright 2018 J. Schilling END-of-star-1.6/librmt/rmtrmt.3 echo x - star-1.6/librmt/rmtrsh.mk3 sed 's/^X//' >star-1.6/librmt/rmtrsh.mk3 << 'END-of-star-1.6/librmt/rmtrsh.mk3' X#ident @(#)rmtrsh.mk3 1.1 18/06/09 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= rmtrsh XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= rmtrsh.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/librmt/rmtrsh.mk3 echo x - star-1.6/librmt/rmtrmt.mk3 sed 's/^X//' >star-1.6/librmt/rmtrmt.mk3 << 'END-of-star-1.6/librmt/rmtrmt.mk3' X#ident @(#)rmtrmt.mk3 1.1 18/06/09 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= rmtrmt XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= rmtrmt.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/librmt/rmtrmt.mk3 echo c - star-1.6/TARGETS mkdir -p star-1.6/TARGETS > /dev/null 2>&1 echo x - star-1.6/TARGETS/15conf sed 's/^X//' >star-1.6/TARGETS/15conf << 'END-of-star-1.6/TARGETS/15conf' XMakefiles Autoconfiguration part 1. Automated run of configure. END-of-star-1.6/TARGETS/15conf echo x - star-1.6/TARGETS/25inc sed 's/^X//' >star-1.6/TARGETS/25inc << 'END-of-star-1.6/TARGETS/25inc' XMakefiles Autoconfiguration part 2. Create autogenerated include files. END-of-star-1.6/TARGETS/25inc echo x - star-1.6/TARGETS/45librmt sed 's/^X//' >star-1.6/TARGETS/45librmt << 'END-of-star-1.6/TARGETS/45librmt' XRemote TAPE transport library END-of-star-1.6/TARGETS/45librmt echo x - star-1.6/TARGETS/25include sed 's/^X//' >star-1.6/TARGETS/25include << 'END-of-star-1.6/TARGETS/25include' XStatic include files. END-of-star-1.6/TARGETS/25include echo x - star-1.6/TARGETS/45lib sed 's/^X//' >star-1.6/TARGETS/45lib << 'END-of-star-1.6/TARGETS/45lib' XVarious libraries END-of-star-1.6/TARGETS/45lib echo x - star-1.6/TARGETS/55rmt sed 's/^X//' >star-1.6/TARGETS/55rmt << 'END-of-star-1.6/TARGETS/55rmt' Xremote magnetic tape protocol server END-of-star-1.6/TARGETS/55rmt echo x - star-1.6/TARGETS/55star sed 's/^X//' >star-1.6/TARGETS/55star << 'END-of-star-1.6/TARGETS/55star' Xunique standard tape archiver END-of-star-1.6/TARGETS/55star echo x - star-1.6/TARGETS/45libfind sed 's/^X//' >star-1.6/TARGETS/45libfind << 'END-of-star-1.6/TARGETS/45libfind' XLibrary version of the find(1) command END-of-star-1.6/TARGETS/45libfind echo x - star-1.6/TARGETS/55tartest sed 's/^X//' >star-1.6/TARGETS/55tartest << 'END-of-star-1.6/TARGETS/55tartest' Xtest tar archive for POSIX.1-1990 compliance END-of-star-1.6/TARGETS/55tartest echo x - star-1.6/TARGETS/55star_sym sed 's/^X//' >star-1.6/TARGETS/55star_sym << 'END-of-star-1.6/TARGETS/55star_sym' XRead in the star inode data base "star-symtable" and write a human readable version. END-of-star-1.6/TARGETS/55star_sym echo x - star-1.6/TARGETS/55mt sed 's/^X//' >star-1.6/TARGETS/55mt << 'END-of-star-1.6/TARGETS/55mt' Xmagnetic tape control END-of-star-1.6/TARGETS/55mt echo x - star-1.6/TARGETS/55cmd sed 's/^X//' >star-1.6/TARGETS/55cmd << 'END-of-star-1.6/TARGETS/55cmd' XVarious commands END-of-star-1.6/TARGETS/55cmd echo x - star-1.6/TARGETS/85man sed 's/^X//' >star-1.6/TARGETS/85man << 'END-of-star-1.6/TARGETS/85man' XVarious man pages END-of-star-1.6/TARGETS/85man echo x - star-1.6/TARGETS/README sed 's/^X//' >star-1.6/TARGETS/README << 'END-of-star-1.6/TARGETS/README' X05patches X15conf - Autofonfiguration part 1. Automated run of configure. X25inc - Autofonfiguration part 2. Create autogenerated include files. X X35 reserved X X45lib X55cmd X65kern X75 reserved X85man X95 reserved END-of-star-1.6/TARGETS/README echo x - star-1.6/TARGETS/Targetdirs sed 's/^X//' >star-1.6/TARGETS/Targetdirs << 'END-of-star-1.6/TARGETS/Targetdirs' X########################################################################### X# X# This file is intentionally left empty. The targets are now defined by the X# "Slottable Source" feature of the makefile system X# X########################################################################### END-of-star-1.6/TARGETS/Targetdirs echo x - star-1.6/TARGETS/__slot sed 's/^X//' >star-1.6/TARGETS/__slot << 'END-of-star-1.6/TARGETS/__slot' XThis file enables the "slot" feature of the Schily SING makefile system END-of-star-1.6/TARGETS/__slot echo x - star-1.6/TARGETS/44libdeflt sed 's/^X//' >star-1.6/TARGETS/44libdeflt << 'END-of-star-1.6/TARGETS/44libdeflt' XLibrary to read local defaults from /etc/default/* END-of-star-1.6/TARGETS/44libdeflt echo x - star-1.6/TARGETS/43libschily sed 's/^X//' >star-1.6/TARGETS/43libschily << 'END-of-star-1.6/TARGETS/43libschily' XLibrary containing Schily SING (Schily Is Not GNU) extensions END-of-star-1.6/TARGETS/43libschily echo c - star-1.6/libfind mkdir -p star-1.6/libfind > /dev/null 2>&1 echo x - star-1.6/libfind/Makefile sed 's/^X//' >star-1.6/libfind/Makefile << 'END-of-star-1.6/libfind/Makefile' X#ident "%W% %E% %Q%" X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMK_FILES= libfind.mk libfind_p.mk $(NO_SHL)shlfind.mk X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.mks X########################################################################### END-of-star-1.6/libfind/Makefile echo x - star-1.6/libfind/Targets sed 's/^X//' >star-1.6/libfind/Targets << 'END-of-star-1.6/libfind/Targets' X# @(#)Targets 1.8 18/09/27 Copyright 2005-2018 J. Schilling X XCFILES= find.c walk.c fetchdir.c cmpdir.c \ X find_misc.c find_list.c find_main.c \ X idcache.c ptime.c XHFILES= find_misc.h find_list.h find_tok.h version.h END-of-star-1.6/libfind/Targets echo x - star-1.6/libfind/fetchdir.c sed 's/^X//' >star-1.6/libfind/fetchdir.c << 'END-of-star-1.6/libfind/fetchdir.c' X/* @(#)fetchdir.c 1.29 16/03/10 Copyright 2002-2016 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)fetchdir.c 1.29 16/03/10 Copyright 2002-2016 J. Schilling"; X#endif X/* X * Blocked directory handling. X * X * Copyright (c) 2002-2016 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X#include /* needed in case we have no dirent->d_ino */ X#include X#include X#include X#include X X#ifndef HAVE_LSTAT X#define lstat stat X#endif X XEXPORT char *fetchdir __PR((char *dir, int *entp, int *lenp, X ino_t **inop)); X#ifdef HAVE_DIRENT_D_TYPE XLOCAL int fdt __PR((int type)); X#endif XEXPORT char *dfetchdir __PR((DIR *dir, char *dir_name, int *entp, X int *lenp, ino_t **inop)); X XEXPORT char * Xfetchdir(dir, entp, lenp, inop) X char *dir; /* The name of the directory */ X int *entp; /* Pointer to # of entries found */ X int *lenp; /* Pointer to len of returned str */ X ino_t **inop; X{ X char *ret; X DIR *d = opendir(dir); X X if (d == NULL) X return (NULL); X ret = dfetchdir(d, dir, entp, lenp, inop); X closedir(d); X return (ret); X} X X#ifdef HAVE_DIRENT_D_TYPE XLOCAL int Xfdt(type) X int type; X{ X switch (type) { X X#ifdef DT_FIFO X case DT_FIFO: return (FDT_FIFO); X#endif X#ifdef DT_CHR X case DT_CHR: return (FDT_CHR); X#endif X#ifdef DT_DIR X case DT_DIR: return (FDT_DIR); X#endif X#ifdef DT_BLK X case DT_BLK: return (FDT_BLK); X#endif X#ifdef DT_REG X case DT_REG: return (FDT_REG); X#endif X#ifdef DT_LNK X case DT_LNK: return (FDT_LNK); X#endif X#ifdef DT_SOCK X case DT_SOCK: return (FDT_SOCK); X#endif X#ifdef DT_WHT X case DT_WHT: return (FDT_WHT); X#endif X default: return (FDT_UNKN); X } X} X#endif /* HAVE_DIRENT_D_TYPE */ X X/* X * Fetch content of a directory and return all entries (except '.' & '..') X * concatenated in one memory chunk. X * X * Each name is prepended by a binary 1 ('^A') that is used by star to flag X * additional information for this entry. X * The end of the returned string contains two additional null character. X */ XEXPORT char * Xdfetchdir(d, dir_name, entp, lenp, inop) X DIR *d; X char *dir_name; /* The name of the directory */ X int *entp; /* Pointer to # of entries found */ X int *lenp; /* Pointer to len of returned str */ X ino_t **inop; X{ X char *erg = NULL; X int esize = 2; X int msize = getpagesize(); X int off = 0; X ino_t *ino = NULL; X int mino = 0; X struct dirent *dp; X register char *name; X register int nlen; X register int nents = 0; X#ifndef HAVE_DIRENT_D_INO X struct stat sbuf; X char sname[PATH_MAX+1]; X#endif X X if ((erg = ___malloc(esize, "fetchdir")) == NULL) X return (NULL); X erg[0] = '\0'; X erg[1] = '\0'; X X while ((dp = readdir(d)) != NULL) { X name = dp->d_name; X /* X * Skip the following names: "", ".", "..". X */ X if (name[name[0] != '.' ? 0 : name[1] != '.' ? 1 : 2] == '\0') X continue; X if (inop) { X if (mino <= nents) { X if (mino == 0) X mino = 32; X else if (mino < (msize / sizeof (ino_t))) X mino *= 2; X else X mino += msize / sizeof (ino_t); X if ((ino = ___realloc(ino, mino * sizeof (ino_t), "fetchdir")) == NULL) X return (NULL); X } X#ifdef HAVE_DIRENT_D_INO X ino[nents] = dp->d_ino; X#else X /* X * d_ino is currently missing on __DJGPP__ & __CYGWIN__ X * We need to call lstat(2) for every file X * in order to get the needed information. X * Do not care about speed, this should be a rare X * exception. X */ X if (dir_name != NULL) { X snprintf(sname, sizeof (sname), "%s/%s", X dir_name, name); X sbuf.st_ino = (ino_t)0; X lstat(sname, &sbuf); X ino[nents] = sbuf.st_ino; X } else { X ino[nents] = (ino_t)-1; X } X#endif X } X nents++; X nlen = strlen(name); X nlen += 4; /* ^A name ^@ + ^@^@ Platz fuer Ende */ X while (esize < (off + nlen)) { X if (esize < 64) X esize = 32; X if (esize < msize) X esize *= 2; X else X esize += msize; X if (esize < (off + nlen)) X continue; X X if ((erg = ___realloc(erg, esize, "fetchdir")) == NULL) X return (NULL); X } X#ifdef DEBUG X if (off > 0) X erg[off-1] = 2; /* Hack: ^B statt ^@ zwischen Namen */ X#endif X#ifdef HAVE_DIRENT_D_TYPE X erg[off++] = fdt(dp->d_type); /* File type */ X#else X erg[off++] = FDT_UNKN; /* Platzhalter: ^A vor jeden Namen */ X#endif X X strcpy(&erg[off], name); X off += nlen -3; /* ^A + ^@^@ Platz fuer Ende */ X } X#ifdef DEBUG X erg[off-1] = 2; /* Hack: ^B st. ^@ am letzten Namen */ X#endif X erg[off] = 0; X erg[off+1] = 0; X X#ifdef DEBUG X erg[off] = 1; /* Platzhalter: ^A n. letztem Namen */ X erg[off+1] = 0; /* Letztes Null Byte */ X#endif X off++; /* List terminator null Byte zaehlt */ X if (lenp) X *lenp = &erg[off] - erg; /* Alloziert ist 1 Byte mehr */ X X if (entp) X *entp = nents; X if (inop) X *inop = ino; X X return (erg); X} END-of-star-1.6/libfind/fetchdir.c echo x - star-1.6/libfind/find.c sed 's/^X//' >star-1.6/libfind/find.c << 'END-of-star-1.6/libfind/find.c' X/*#define PLUS_DEBUG*/ X/* @(#)find.c 1.118 19/01/08 Copyright 2004-2019 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)find.c 1.118 19/01/08 Copyright 2004-2019 J. Schilling"; X#endif X/* X * Another find implementation... X * X * Copyright (c) 2004-2019 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifdef __FIND__ X#define FIND_MAIN X#endif X X#include X#include X#include X#include X#include X#include X#include X#include X#include X#include /* incl. limits.h (_POSIX_ARG_MAX/ARG_MAX) */ X#include /* #defines NCARGS on old systems */ X#include X#include X#include X#include X#include X#include X#include X#include X#define VMS_VFORK_OK X#include X#include X X#include X X#if defined(_ARG_MAX32) && defined(_ARG_MAX64) X#define MULTI_ARG_MAX /* SunOS only ? */ X#endif X X#include "version.h" XLOCAL char strvers[] = VERSION; /* The pure version string */ X Xtypedef struct find_node findn_t; X X#include X#define FIND_NODE X#include X Xstruct find_node { X char *left; X char *right; X char *this; X int op; X union { X int i; X long l; X dev_t dev; X ino_t ino; X mode_t mode; X nlink_t nlink; X uid_t uid; X gid_t gid; X size_t size; X time_t time; X struct timespec ts; X FILE *fp; X cbfun_t callfun; X } val, val2; X}; X X#include "find_list.h" X#include "find_misc.h" X#define TOKEN_NAMES X#include "find_tok.h" X X/* X * The struct plusargs and the adjacent space that holds the X * arg vector and the string table. The struct plusargs member "av" X * is also part of the ARG_MAX sized space that follows. X * X * --------------------------------- X * | Other struct plusargs fields | Don't count against ARG_MAX X * --------------------------------- X * --------------------------------- X * | New Arg vector[0] | Space for ARG_MAX starts here X * --------------------------------- X * | . | X * | . | Arg space grows upwards X * | V | X * --------------------------------- X * | Arg vector end | "nextargp" points here X * --------------------------------- X * --------------------------------- X * | Space for first arg string | X * --------------------------------- "laststr" points here X * | ^ | X * | . | String space "grows" downwards X * | . | X * --------------------------------- X * | Space for first arg string | Space for ARG_MAX ends here X * --------------------------------- "endp" points here X * X * The Arg vector in struct plusargs uses the native pointer size X * for libfind. ARG_MAX however is based on the pointer size in the X * called program. X * X * If a 32 bit libfind calls a 64 bit program, the arg vector and the X * environment array in the called program needs more space than in the X * calling libfind code. X * X * If a 64 bit libfind calls a 32 bit program, the arg vector and the X * environment array in the called program needs less space than in the X * calling libfind code. X * X * Note that the "avx" entry is only needed in case we have no vfork() X * since we aways need to create an arg vector copy in the vfork() case. X * This copy is created in doexec() and takes care of the extra space. X */ Xstruct plusargs { X struct plusargs *next; /* Next in list for flushing */ X char *endp; /* Points to end of data block */ X char **nextargp; /* Points to next av[] entry */ X char *laststr; /* points to last used string */ X int nenv; /* Number of entries in env */ X int ac; /* The argc for our command */ X char *avx; /* Space for "sh" for scripts */ X char *av[1]; /* The argv for our command */ X}; X X#ifdef PLUS_DEBUG /* We are no longer reentrant */ XLOCAL struct plusargs *plusp; /* Avoid PLUS_DEBUG if possible */ X#endif X X#define MINSECS (60) X#define HOURSECS (60 * MINSECS) X#define DAYSECS (24 * HOURSECS) X#define YEARSECS (365 * DAYSECS) X Xextern time_t find_sixmonth; /* 6 months before limit (ls) */ Xextern time_t find_now; /* now limit (ls) */ XLOCAL time_t find_xnow; /* The exact start time */ X XLOCAL findn_t Printnode = { 0, 0, 0, PRINT }; X XEXPORT void find_argsinit __PR((finda_t *fap)); XEXPORT void find_sqinit __PR((squit_t *quit)); XEXPORT void find_timeinit __PR((time_t now)); XEXPORT findn_t *find_printnode __PR((void)); XEXPORT findn_t *find_addprint __PR((findn_t *np, finda_t *fap)); XLOCAL findn_t *allocnode __PR((finda_t *fap)); XEXPORT void find_free __PR((findn_t *t, finda_t *fap)); XLOCAL void find_freenode __PR((findn_t *t)); XLOCAL void nexttoken __PR((finda_t *fap)); XLOCAL BOOL _nexttoken __PR((finda_t *fap)); XLOCAL void badopt __PR((finda_t *fap, char *word)); XLOCAL void errjmp __PR((finda_t *fap, int err)); XEXPORT int find_token __PR((char *word)); XEXPORT char *find_tname __PR((int op)); XLOCAL char *nextarg __PR((finda_t *fap, findn_t *t)); XEXPORT findn_t *find_parse __PR((finda_t *fap)); XLOCAL findn_t *parse __PR((finda_t *fap)); XLOCAL findn_t *parseand __PR((finda_t *fap)); XLOCAL findn_t *parseprim __PR((finda_t *fap)); XEXPORT void find_firstprim __PR((int *pac, char *const **pav)); XEXPORT BOOL find_primary __PR((findn_t *t, int op)); XEXPORT BOOL find_pname __PR((findn_t *t, char *word)); XEXPORT BOOL find_hasprint __PR((findn_t *t)); XEXPORT BOOL find_hasexec __PR((findn_t *t)); X#ifdef FIND_MAIN XLOCAL int walkfunc __PR((char *nm, struct stat *fs, int type, struct WALK *state)); X#endif X#ifdef __FIND__ XLOCAL inline BOOL find_expr __PR((char *f, char *ff, struct stat *fs, struct WALK *state, findn_t *t)); X#else XEXPORT BOOL find_expr __PR((char *f, char *ff, struct stat *fs, struct WALK *state, findn_t *t)); X#endif XLOCAL BOOL docall __PR((char *f, findn_t *t, int ac, char **av, struct WALK *state)); X#ifdef HAVE_FORK XLOCAL BOOL doexec __PR((char *f, findn_t *t, int ac, char **av, struct WALK *state)); X#endif XLOCAL int countenv __PR((void)); XLOCAL int argsize __PR((finda_t *fap, int xtype)); XLOCAL int extype __PR((char *name)); X#ifdef MULTI_ARG_MAX XLOCAL int xargsize __PR((int xtype, int maxarg)); X#endif XLOCAL BOOL pluscreate __PR((FILE *f, int ac, char **av, finda_t *fap)); X#ifdef HAVE_FORK XLOCAL BOOL plusexec __PR((char *f, findn_t *t, struct WALK *state)); X#endif XEXPORT int find_plusflush __PR((void *p, struct WALK *state)); XEXPORT void find_usage __PR((FILE *f)); XEXPORT char *find_strvers __PR((void)); XEXPORT int find_vers __PR((void)); X#ifdef FIND_MAIN XLOCAL int getflg __PR((char *optstr, long *argp)); XEXPORT int main __PR((int ac, char **av)); X#endif X X XEXPORT void Xfind_argsinit(fap) X finda_t *fap; X{ X fap->Argc = 0; X fap->Argv = (char **)NULL; X fap->std[0] = stdin; X fap->std[1] = stdout; X fap->std[2] = stderr; X fap->primarg = NULL; X fap->primname = NULL; X fap->primtype = 0; X fap->found_action = FALSE; X fap->patlen = 0; X fap->walkflags = 0; X fap->maxdepth = -1; X fap->mindepth = -1; X fap->plusp = (struct plusargs *)NULL; X fap->jmp = NULL; X fap->error = 0; X fap->argsize = 0; X fap->callfun = NULL; X zerobytes(&fap->__reserved, sizeof (fap->__reserved)); X} X XEXPORT void Xfind_sqinit(quit) X squit_t *quit; X{ X zerobytes(quit, sizeof (*quit)); X} X XEXPORT void Xfind_timeinit(now) X time_t now; X{ X find_xnow = now; X find_now = now + 60; X find_sixmonth = now - 6L*30L*24L*60L*60L; X} X XEXPORT findn_t * Xfind_printnode() X{ X return (&Printnode); X} X X/* X * Add a -print node to the parsed tree if there is no action already. X */ XEXPORT findn_t * Xfind_addprint(np, fap) X findn_t *np; X finda_t *fap; X{ X findn_t *n; X X n = allocnode(fap); X if (n == NULL) { X find_freenode(np); X return ((void *)NULL); X } X n->op = AND; X n->left = (char *)np; X n->right = (char *)&Printnode; X return (n); X} X X/* X * allocnode is currently called by: X * find_addprint(), parse(), parseand(), parseprim() X */ XLOCAL findn_t * Xallocnode(fap) X finda_t *fap; X{ X findn_t *n; X X n = __fjmalloc(fap->std[2], sizeof (findn_t), "allocnode", JM_RETURN); X if (n == NULL) X return (n); X n->left = 0; X n->right = 0; X n->this = 0; X n->op = 0; X n->val.l = 0; X n->val2.l = 0; X return (n); X} X XEXPORT void Xfind_free(t, fap) X findn_t *t; X finda_t *fap; X{ X if (fap != NULL) { X struct plusargs *p; X struct plusargs *np = NULL; X X for (p = fap->plusp; p != NULL; p = np) { X np = p->next; X free(p); X } X } X X find_freenode(t); X} X XLOCAL void Xfind_freenode(t) X findn_t *t; X{ X if (t == (findn_t *)NULL || t == &Printnode) X return; X X switch (t->op) { X X case OPEN: X case LNOT: X find_freenode((findn_t *)t->this); X break; X case AND: X case LOR: X find_freenode((findn_t *)t->left); X find_freenode((findn_t *)t->right); X break; X case PAT: X case PPAT: X case LPAT: X if (t->right != NULL) X free(t->right); /* aux array for patcompile() */ X break; X case FLS: X case FPRINT: X case FPRINT0: X case FPRINTNNL: X fclose(t->val.fp); X default: X ; X } X free(t); X} X XLOCAL void Xnexttoken(fap) X register finda_t *fap; X{ X if (!_nexttoken(fap)) { X errjmp(fap, EX_BAD); X /* NOTREACHED */ X } X} X X/* X * No errjmp() variant of nexttoken(), returns FALSE on error. X */ XLOCAL BOOL X_nexttoken(fap) X register finda_t *fap; X{ X register char *word; X register char *tail; X X if (fap->Argc <= 0) { X fap->primtype = FIND_ENDARGS; X return (TRUE); X } X if (fap->primarg) X fap->primname = word = fap->primarg; X else X fap->primname = word = *fap->Argv; X if ((tail = strchr(word, '=')) != NULL) { X#ifdef XXX X if (*tail == '\0') { X fap->Argv++; fap->Argc--; X } else X#endif X fap->primarg = ++tail; X } else { X fap->primarg = NULL; X fap->Argv++; fap->Argc--; X } X if ((fap->primtype = find_token(word)) >= 0) X return (TRUE); X X badopt(fap, word); X return (FALSE); X} X XLOCAL void Xbadopt(fap, word) X finda_t *fap; X char *word; X{ X ferrmsgno(fap->std[2], EX_BAD, _("Bad Option: '%s'.\n"), word); X find_usage(fap->std[2]); X fap->primtype = FIND_ERRARG; /* Mark as "parse aborted" */ X} X XLOCAL void Xerrjmp(fap, err) X register finda_t *fap; X int err; X{ X fap->primtype = FIND_ERRARG; /* Mark as "parse aborted" */ X fap->error = err; /* Set error return */ X X siglongjmp(((sigjmps_t *)fap->jmp)->jb, 1); X /* NOTREACHED */ X} X XEXPORT int Xfind_token(word) X register char *word; X{ X char **tp; X char *tn; X char *equalp; X int type; X X if ((equalp = strchr(word, '=')) != NULL) X *equalp = '\0'; X X if (*word == '-') { X /* X * Do not allow -(, -), -! X */ X if (word[1] == '\0' || !strchr("()!", word[1])) X word++; X } else if (!strchr("()!", word[0]) && (!equalp || equalp[1] == '\0')) { X goto bad; X } X for (type = 0, tp = tokennames; *tp; tp++, type++) { X tn = *tp; X if (*tn != *word) X continue; X if (streql(tn, word)) { X if (equalp) X *equalp = '='; X return (type); X } X } Xbad: X if (equalp) X *equalp = '='; X X return (-1); X} X XEXPORT char * Xfind_tname(op) X int op; X{ X if (op >= 0 && op < NTOK) X return (tokennames[op]); X return ("unknown"); X} X XLOCAL char * Xnextarg(fap, t) X finda_t *fap; X findn_t *t; X{ X if (fap->Argc-- <= 0) { X char *prim = NULL; X int pt = t->op; X X if (pt >= 0 && pt < NTOK) X prim = tokennames[pt]; X if (prim) { X ferrmsgno(fap->std[2], EX_BAD, X _("Missing arg for '%s%s'.\n"), X pt > LNOT ? "-":"", prim); X } else { X ferrmsgno(fap->std[2], EX_BAD, X _("Missing arg.\n")); X } X errjmp(fap, EX_BAD); X /* NOTREACHED */ X return ((char *)0); X } else { X if (fap->primarg) { X char *arg = fap->primarg; X X fap->primarg = NULL; X fap->Argv++; X return (arg); X } X return (*fap->Argv++); X } X} X XEXPORT findn_t * Xfind_parse(fap) X finda_t *fap; X{ X findn_t *ret; X X if (!_nexttoken(fap)) X return ((findn_t *)NULL); /* Immediate parse error */ X if (fap->primtype == FIND_ENDARGS) X return ((findn_t *)NULL); /* Empty command */ X X ret = parse(fap); X if (ret) X return (ret); X X if (fap->primtype == HELP) { X fap->primtype = FIND_ERRARG; X } else if (fap->error == 0) { X fap->primtype = FIND_ERRARG; X fap->error = geterrno(); X if (fap->error == 0) X fap->error = EX_BAD; X } X return (ret); X} X XLOCAL findn_t * Xparse(fap) X finda_t *fap; X{ X findn_t *n; X X n = parseand(fap); X if (n == NULL) X return (n); X if (fap->primtype == LOR) { X findn_t *l = allocnode(fap); X X if (l == NULL) X goto err; X l->left = (char *)n; X l->op = fap->primtype; X if (_nexttoken(fap)) X l->right = (char *)parse(fap); X if (l->right == NULL) { X find_freenode(l); X n = NULL; /* Do not free twice */ X goto err; X } X return (l); X } X return (n); Xerr: X find_freenode(n); X fap->primtype = FIND_ERRARG; /* Mark as "parse aborted" */ X return ((findn_t *)NULL); X} X XLOCAL findn_t * Xparseand(fap) X finda_t *fap; X{ X findn_t *n; X X n = parseprim(fap); X if (n == NULL) X return (n); X X if ((fap->primtype == AND) || X (fap->primtype != LOR && fap->primtype != CLOSE && X fap->primtype != FIND_ENDARGS)) { X findn_t *l = allocnode(fap); X BOOL ok = TRUE; X X if (l == NULL) X goto err; X l->left = (char *)n; X l->op = AND; /* If no Operator, default to AND -a */ X if (fap->primtype == AND) /* Fetch Operator for next node */ X ok = _nexttoken(fap); X if (ok) X l->right = (char *)parseand(fap); X if (l->right == NULL) { X find_freenode(l); X n = NULL; /* Do not free twice */ X goto err; X } X return (l); X } X return (n); Xerr: X find_freenode(n); X fap->primtype = FIND_ERRARG; /* Mark as "parse aborted" */ X return ((findn_t *)NULL); X} X XLOCAL findn_t * Xparseprim(fap) X finda_t *fap; X{ X sigjmps_t jmp; X sigjmps_t *ojmp = fap->jmp; X register findn_t *n; X register char *p; X Llong ll; X X n = allocnode(fap); X if (n == (findn_t *)NULL) { X fap->primtype = FIND_ERRARG; /* Mark as "parse aborted" */ X return ((findn_t *)NULL); X } X X fap->jmp = &jmp; X if (sigsetjmp(jmp.jb, 1) != 0) { X /* X * We come here from siglongjmp() X */ X find_freenode(n); X fap->jmp = ojmp; /* Restore old jump target */ X return ((findn_t *)NULL); X } X switch (n->op = fap->primtype) { X X /* X * Use simple to old (historic) shell globbing. X */ X case INAME: X case ILNAME: X case IPATH: X#ifndef FNM_IGNORECASE X ferrmsgno(fap->std[2], X EX_BAD, _("The primary '-%s' is unsupported on this OS.\n"), X tokennames[n->op]); X errjmp(fap, EX_BAD); X /* NOTREACHED */ X#endif X case NAME: X case PATH: X case LNAME: X#ifndef HAVE_FNMATCH X#define HAVE_FNMATCH /* We have fnmatch() in libschily */ X#endif X#if defined(HAVE_FNMATCH) X n->this = nextarg(fap, n); X nexttoken(fap); X fap->jmp = ojmp; /* Restore old jump target */ X return (n); X#endif X /* FALLTHRU */ X /* Implement "fallback" to patmatch() if we have no fnmatch() */ X X /* X * Use patmatch() which is a regular expression matcher that implements X * extensions that are compatible to old (historic) shell globbing. X */ X case IPAT: X case IPPAT: X case ILPAT: X ferrmsgno(fap->std[2], X EX_BAD, _("The primary '-%s' is currently unsupported.\n"), X tokennames[n->op]); X errjmp(fap, EX_BAD); X /* NOTREACHED */ X case PAT: X case PPAT: X case LPAT: { X int plen; X X plen = strlen(n->this = nextarg(fap, n)); X if (plen > fap->patlen) X fap->patlen = plen; X n->right = __fjmalloc(fap->std[2], sizeof (int)*plen, X "space for pattern", fap->jmp); X X if ((n->val.i = patcompile((Uchar *)n->this, plen, (int *)n->right)) == 0) { X ferrmsgno(fap->std[2], X EX_BAD, _("Bad pattern in '-%s %s'.\n"), X tokennames[n->op], n->this); X errjmp(fap, EX_BAD); X /* NOTREACHED */ X } X nexttoken(fap); X fap->jmp = ojmp; /* Restore old jump target */ X return (n); X } X X case SIZE: { X char *numarg; X X fap->walkflags &= ~WALK_NOSTAT; X X p = n->left = nextarg(fap, n); X numarg = p; X if (p[0] == '-' || p[0] == '+') X numarg = ++p; X p = astoll(p, &ll); X if (p[0] == '\0') { X /* EMPTY */ X ; X } else if (p[0] == 'c' && p[1] == '\0') { X n->this = p; X } else if (getllnum(numarg, &ll) == 1) { X n->this = p; X } else if (*p) { X ferrmsgno(fap->std[2], EX_BAD, X _("Non numeric character '%c' in '-size %s'.\n"), X *p, n->left); X errjmp(fap, EX_BAD); X /* NOTREACHED */ X } X n->val.size = ll; X nexttoken(fap); X fap->jmp = ojmp; /* Restore old jump target */ X return (n); X } X X case EMPTY: X fap->walkflags &= ~WALK_NOSTAT; X nexttoken(fap); X fap->jmp = ojmp; /* Restore old jump target */ X return (n); X X case LINKS: X fap->walkflags &= ~WALK_NOSTAT; X X p = n->left = nextarg(fap, n); X if (p[0] == '-' || p[0] == '+') X p++; X p = astoll(p, &ll); X if (*p) { X ferrmsgno(fap->std[2], EX_BAD, X _("Non numeric character '%c' in '-links %s'.\n"), X *p, n->left); X errjmp(fap, EX_BAD); X /* NOTREACHED */ X } X n->val.nlink = ll; X nexttoken(fap); X fap->jmp = ojmp; /* Restore old jump target */ X return (n); X X case INUM: X fap->walkflags &= ~WALK_NOSTAT; X X p = n->left = nextarg(fap, n); X if (p[0] == '-' || p[0] == '+') X p++; X p = astoll(p, &ll); X if (*p) { X ferrmsgno(fap->std[2], EX_BAD, X _("Non numeric character '%c' in '-inum %s'.\n"), X *p, n->left); X errjmp(fap, EX_BAD); X /* NOTREACHED */ X } X n->val.ino = ll; X nexttoken(fap); X fap->jmp = ojmp; /* Restore old jump target */ X return (n); X X case LINKEDTO: { X struct stat ns; X X fap->walkflags &= ~WALK_NOSTAT; X X if (stat(n->left = nextarg(fap, n), &ns) < 0) { X ferrmsg(fap->std[2], X _("Cannot stat '%s'.\n"), n->left); X errjmp(fap, geterrno()); X /* NOTREACHED */ X } X n->val.ino = ns.st_ino; X n->val2.dev = ns.st_dev; X nexttoken(fap); X fap->jmp = ojmp; /* Restore old jump target */ X return (n); X } X X case AMIN: X case CMIN: X case MMIN: X n->val2.i = 1; X /* FALLTHROUGH */ X case TIME: X case ATIME: X case CTIME: X case MTIME: { X int len; X X fap->walkflags &= ~WALK_NOSTAT; X X p = n->left = nextarg(fap, n); X if (p[0] == '-' || p[0] == '+') X p++; X if (gettnum(p, &n->val.time) != 1) { X ferrmsgno(fap->std[2], EX_BAD, X _("Bad timespec in '-%s %s'.\n"), X tokennames[n->op], n->left); X errjmp(fap, EX_BAD); X /* NOTREACHED */ X } X if (n->val2.i) X n->val.time *= 60; X X len = strlen(p); X if (len > 0) { X len = (Uchar)p[len-1]; X if (!(len >= '0' && len <= '9')) { X if (n->val2.i) { /* -mmin, No ext. time spec */ X ferrmsgno(fap->std[2], EX_BAD, X _("Unsupported timespec in '-%s %s'.\n"), X tokennames[n->op], n->left); X errjmp(fap, geterrno()); X /* NOTREACHED */ X } X n->val2.i = 1; /* Ext. time spec permitted */ X } X } X nexttoken(fap); X fap->jmp = ojmp; /* Restore old jump target */ X return (n); X } X X case NEWERAA: X case NEWERCA: X case NEWERMA: { X struct stat ns; X X fap->walkflags &= ~WALK_NOSTAT; X X if (stat(n->left = nextarg(fap, n), &ns) < 0) { X ferrmsg(fap->std[2], X _("Cannot stat '%s'.\n"), n->left); X errjmp(fap, geterrno()); X /* NOTREACHED */ X } X#if defined(_FOUND_STAT_NSECS_) X n->val.ts.tv_sec = ns.st_atime; X n->val.ts.tv_nsec = stat_ansecs(&ns); X#else X n->val.time = ns.st_atime; X#endif X nexttoken(fap); X fap->jmp = ojmp; /* Restore old jump target */ X return (n); X } X X case NEWERAC: X case NEWERCC: X case NEWERMC: { X struct stat ns; X X fap->walkflags &= ~WALK_NOSTAT; X X if (stat(n->left = nextarg(fap, n), &ns) < 0) { X ferrmsg(fap->std[2], X _("Cannot stat '%s'.\n"), n->left); X errjmp(fap, geterrno()); X /* NOTREACHED */ X } X#if defined(_FOUND_STAT_NSECS_) X n->val.ts.tv_sec = ns.st_ctime; X n->val.ts.tv_nsec = stat_cnsecs(&ns); X#else X n->val.time = ns.st_ctime; X#endif X nexttoken(fap); X fap->jmp = ojmp; /* Restore old jump target */ X return (n); X } X X case NEWERAM: X case NEWERCM: X case NEWERMM: X case NEWER: { X struct stat ns; X X fap->walkflags &= ~WALK_NOSTAT; X X if (stat(n->left = nextarg(fap, n), &ns) < 0) { X ferrmsg(fap->std[2], X _("Cannot stat '%s'.\n"), n->left); X errjmp(fap, geterrno()); X /* NOTREACHED */ X } X#if defined(_FOUND_STAT_NSECS_) X n->val.ts.tv_sec = ns.st_mtime; X n->val.ts.tv_nsec = stat_mnsecs(&ns); X#else X n->val.time = ns.st_mtime; X#endif X nexttoken(fap); X fap->jmp = ojmp; /* Restore old jump target */ X return (n); X } X X case CHATIME: X case CHCTIME: X case CHMTIME: X X case NEWERAT: X case NEWERCT: X case NEWERMT: { X struct timespec ts; X const char *te; X X fap->walkflags &= ~WALK_NOSTAT; X X te = parsetime(n->left = nextarg(fap, n), &ts); X if (te == NULL || *te != '\0') { X ferrmsgno(fap->std[2], EX_BAD, X _("Cannot use '%s' as timestamp.\n"), n->left); X errjmp(fap, EX_BAD); X /* NOTREACHED */ X } X#if defined(_FOUND_STAT_NSECS_) X n->val.ts.tv_sec = ts.tv_sec; X n->val.ts.tv_nsec = ts.tv_nsec; X#else X n->val.time = ts.tv_sec; X#endif X nexttoken(fap); X fap->jmp = ojmp; /* Restore old jump target */ X return (n); X } X X case TYPE: X fap->walkflags &= ~WALK_NOSTAT; X X n->this = (char *)nextarg(fap, n); X switch (*(n->this)) { X X /* X * 'b'lock, 'c'har, 'd'ir, 'D'oor, X * 'e'ventcount, 'f'ile, 'l'ink, 'p'ipe, X * 'P'ort event, 's'ocket X */ X case 'b': case 'c': case 'd': case 'D': X case 'e': case 'f': case 'l': case 'p': X case 'P': case 's': X if ((n->this)[1] == '\0') { X nexttoken(fap); X fap->jmp = ojmp; /* Restore old jump target */ X return (n); X } X } X ferrmsgno(fap->std[2], EX_BAD, X _("Bad type '%c' in '-type %s'.\n"), X *n->this, n->this); X errjmp(fap, EX_BAD); X /* NOTREACHED */ X break; X X case FSTYPE: X fap->walkflags &= ~WALK_NOSTAT; X X#ifdef HAVE_ST_FSTYPE X n->this = (char *)nextarg(fap, n); X#else X ferrmsgno(fap->std[2], EX_BAD, X _("-fstype not supported by this OS.\n")); X errjmp(fap, EX_BAD); X /* NOTREACHED */ X#endif X nexttoken(fap); X fap->jmp = ojmp; /* Restore old jump target */ X return (n); X X case LOCL: X fap->walkflags &= ~WALK_NOSTAT; X X#ifndef HAVE_ST_FSTYPE X ferrmsgno(fap->std[2], EX_BAD, X _("-local not supported by this OS.\n")); X errjmp(fap, EX_BAD); X /* NOTREACHED */ X#endif X nexttoken(fap); X fap->jmp = ojmp; /* Restore old jump target */ X return (n); X X#ifdef CHOWN X case CHOWN: X#endif X case USER: { X struct passwd *pw; X char *u; X X fap->walkflags &= ~WALK_NOSTAT; X X u = n->left = nextarg(fap, n); X if (u[0] == '-' || u[0] == '+') X u++; X if ((pw = getpwnam(u)) != NULL) { X n->val.uid = pw->pw_uid; X } else { X if (*astoll(n->left, &ll)) { X ferrmsgno(fap->std[2], EX_BAD, X _("User '%s' not in passwd database.\n"), X n->left); X errjmp(fap, EX_BAD); X /* NOTREACHED */ X } X n->val.uid = ll; X } X nexttoken(fap); X fap->jmp = ojmp; /* Restore old jump target */ X return (n); X } X X#ifdef CHGRP X case CHGRP: X#endif X case GROUP: { X struct group *gr; X char *g; X X fap->walkflags &= ~WALK_NOSTAT; X X g = n->left = nextarg(fap, n); X if (g[0] == '-' || g[0] == '+') X g++; X if ((gr = getgrnam(g)) != NULL) { X n->val.gid = gr->gr_gid; X } else { X if (*astoll(n->left, &ll)) { X ferrmsgno(fap->std[2], EX_BAD, X _("Group '%s' not in group database.\n"), X n->left); X errjmp(fap, EX_BAD); X /* NOTREACHED */ X } X n->val.gid = ll; X } X nexttoken(fap); X fap->jmp = ojmp; /* Restore old jump target */ X return (n); X } X X#ifdef CHMOD X case CHMOD: X#endif X case PERM: X fap->walkflags &= ~WALK_NOSTAT; X X p = n->left = nextarg(fap, n); X if (n->op == PERM) { X if (p[0] == '+') { X if (p[1] == '0' || /* +0777 is not in POSIX */ X p[1] == 'a') { /* +a=rwx is not in POSIX */ X p[0] = '/'; X p++; X } else { X n->left = ""; X } X } else if (p[0] == '/') { X p++; X } X } X if (getperm(fap->std[2], p, tokennames[n->op], X &n->val.mode, (mode_t)0, X n->op == PERM ? GP_FPERM|GP_XERR:GP_NOX) < 0) { X errjmp(fap, EX_BAD); X /* NOTREACHED */ X } X nexttoken(fap); X fap->jmp = ojmp; /* Restore old jump target */ X return (n); X X case MODE: X fap->walkflags &= ~WALK_NOSTAT; X X ferrmsgno(fap->std[2], EX_BAD, X _("-mode not yet implemented.\n")); X errjmp(fap, EX_BAD); X /* NOTREACHED */ X nexttoken(fap); X fap->jmp = ojmp; /* Restore old jump target */ X return (n); X X case MOUNT: X fap->walkflags &= ~WALK_NOSTAT; X fap->walkflags |= WALK_MOUNT; X nexttoken(fap); X fap->jmp = ojmp; /* Restore old jump target */ X return (n); X case XDEV: /* POSIX alias set up on */ X case MOUNTPLUS: /* 27.9.2018 */ X fap->walkflags &= ~WALK_NOSTAT; X fap->walkflags |= WALK_XDEV; X nexttoken(fap); X fap->jmp = ojmp; /* Restore old jump target */ X return (n); X case DEPTH: X fap->walkflags |= WALK_DEPTH; X nexttoken(fap); X fap->jmp = ojmp; /* Restore old jump target */ X return (n); X case FOLLOW: X fap->walkflags &= ~WALK_PHYS; X nexttoken(fap); X fap->jmp = ojmp; /* Restore old jump target */ X return (n); X X case MAXDEPTH: X case MINDEPTH: X p = n->left = nextarg(fap, n); X p = astoll(p, &ll); X if (*p) { X ferrmsgno(fap->std[2], EX_BAD, X _("Non numeric character '%c' in '-%s %s'.\n"), X *p, tokennames[n->op], n->left); X errjmp(fap, EX_BAD); X /* NOTREACHED */ X } X n->val.l = ll; X if (n->op == MAXDEPTH) X fap->maxdepth = ll; X else X fap->mindepth = ll; X nexttoken(fap); X fap->jmp = ojmp; /* Restore old jump target */ X return (n); X X case NOUSER: X case NOGRP: X case PACL: X case XATTR: X case SPARSE: X case DOSTAT: X fap->walkflags &= ~WALK_NOSTAT; X /* FALLTHRU */ X case PRUNE: X case LTRUE: X case LFALSE: X case READABLE: X case WRITABLE: X case EXECUTABLE: X case CHFILE: X nexttoken(fap); X fap->jmp = ojmp; /* Restore old jump target */ X return (n); X X case OK_EXEC: X case OK_EXECDIR: X case CALL: X case CALLDIR: X case EXEC: X case EXECDIR: { X int i = 1; X char **Cargv = NULL; X char *arg0 = NULL; X X if (fap->primarg) { X /* X * Create a contiguous arg vector X */ X Cargv = fap->Argv; X arg0 = *Cargv; X *Cargv = fap->primarg; X } X fap->argsize = 0; X n->this = (char *)fap->Argv; /* Cheat: Pointer is pointer */ X nextarg(fap, n); /* Eat up cmd name */ X while ((p = nextarg(fap, n)) != NULL) { X if (streql(p, ";")) X break; X else if (streql(p, "+") && streql(fap->Argv[-2], "{}")) { X if (n->op == OK_EXECDIR || n->op == EXECDIR || X n->op == CALL || n->op == CALLDIR) { X ferrmsgno(fap->std[2], EX_BAD, X _("'-%s' does not yet work with '+'.\n"), X tokennames[n->op]); X if (Cargv) X *Cargv = arg0; X errjmp(fap, EX_BAD); X /* NOTREACHED */ X } X n->op = fap->primtype = EXECPLUS; X if (!pluscreate(fap->std[2], --i, (char **)n->this, fap)) { X if (Cargv) X *Cargv = arg0; X errjmp(fap, EX_BAD); X /* NOTREACHED */ X } X n->this = (char *)fap->plusp; X break; X } X i++; X } X n->val.i = i; X if (n->op == CALL || n->op == CALLDIR) { X if (fap->callfun == NULL) { X badopt(fap, tokennames[n->op]); X errjmp(fap, EX_BAD); X } X n->val2.callfun = fap->callfun; X } X if (Cargv) X *Cargv = arg0; X#ifdef PLUS_DEBUG X if (0) { X char **pp = (char **)n->this; X for (i = 0; i < n->val.i; i++, pp++) X printf("ARG %d '%s'\n", i, *pp); X } X#endif X } X /* FALLTHRU */ X X case LS: X fap->walkflags &= ~WALK_NOSTAT; X goto found_action; X case FLS: X fap->walkflags &= ~WALK_NOSTAT; X /* FALLTHROUGH */ X case FPRINT: X case FPRINT0: X case FPRINTNNL: X p = nextarg(fap, n); X n->val.fp = fileopen(p, "wcta"); X if (n->val.fp == NULL) { X ferrmsg(fap->std[2], X _("Cannot open '%s' for '-%s'.\n"), X p, tokennames[n->op]); X errjmp(fap, EX_BAD); X /* NOTREACHED */ X } X case PRINT: X case PRINT0: X case PRINTNNL: X found_action: X fap->found_action = TRUE; X nexttoken(fap); X fap->jmp = ojmp; /* Restore old jump target */ X return (n); X X case FIND_ENDARGS: X#ifdef DEBUG X ferrmsgno(fap->std[2], EX_BAD, X _("ENDARGS in parseprim()\n")); X#endif X ferrmsgno(fap->std[2], EX_BAD, X _("Incomplete expression.\n")); X find_freenode(n); X fap->jmp = ojmp; /* Restore old jump target */ X return ((findn_t *)NULL); X X case OPEN: X nexttoken(fap); X n->this = (char *)parse(fap); X if (n->this == NULL) { X find_freenode(n); X fap->jmp = ojmp; /* Restore old jump target */ X return ((findn_t *)NULL); X } X if (fap->primtype != CLOSE) { X ferrmsgno(fap->std[2], EX_BAD, X _("Found '%s', but ')' expected.\n"), X fap->Argv[-1]); X errjmp(fap, EX_BAD); X /* NOTREACHED */ X } else { X nexttoken(fap); X fap->jmp = ojmp; /* Restore old jump target */ X return (n); X } X break; X X case CLOSE: X /* X * The triggering arg is at fap->Argv[-2]. X */ X ferrmsgno(fap->std[2], EX_BAD, _("Missing '('.\n")); X errjmp(fap, EX_BAD); X /* NOTREACHED */ X X case LNOT: X nexttoken(fap); X n->this = (char *)parseprim(fap); X if (n->this == NULL) { X find_freenode(n); X n = (findn_t *)NULL; X } X fap->jmp = ojmp; /* Restore old jump target */ X return (n); X X case AND: X case LOR: X ferrmsgno(fap->std[2], EX_BAD, X _("Invalid expression with '-%s'.\n"), tokennames[n->op]); X errjmp(fap, EX_BAD); X /* NOTREACHED */ X X case HELP: X find_usage(fap->std[2]); X find_freenode(n); X fap->jmp = ojmp; /* Restore old jump target */ X return ((findn_t *)NULL); X X default: X ferrmsgno(fap->std[2], EX_BAD, X _("Internal malfunction, found unknown primary '-%s' (%d).\n"), X find_tname(n->op), n->op); X errjmp(fap, EX_BAD); X /* NOTREACHED */ X } X fap->jmp = ojmp; /* Restore old jump target */ X fap->primtype = FIND_ERRARG; /* Mark as "parse aborted" */ X return (0); X} X X#define S_ALLPERM (S_IRWXU|S_IRWXG|S_IRWXO) X#define S_ALLFLAGS (S_ISUID|S_ISGID|S_ISVTX) X#define S_ALLMODES (S_ALLFLAGS | S_ALLPERM) X XEXPORT void Xfind_firstprim(pac, pav) X int *pac; X char *const *pav[]; X{ X register int cac = *pac; X register char *const *cav = *pav; X register char c; X X while (cac > 0 && X (c = **cav) != '-' && c != '(' && c != ')' && c != '!') { X cav++; X cac--; X } X *pac = cac; X *pav = cav; X} X XEXPORT BOOL Xfind_primary(t, op) X findn_t *t; X int op; X{ X BOOL ret = FALSE; X X if (t->op == op) { X return (TRUE); X } X switch (t->op) { X X case OPEN: X ret = find_primary((findn_t *)t->this, op); X break; X case LNOT: X ret = find_primary((findn_t *)t->this, op); X break; X case AND: X ret = find_primary((findn_t *)t->left, op); X if (ret) X return (ret); X ret = find_primary((findn_t *)t->right, op); X break; X case LOR: X ret = find_primary((findn_t *)t->left, op); X if (ret) X return (ret); X ret = find_primary((findn_t *)t->right, op); X break; X X default: X ; X } X return (ret); X} X XEXPORT BOOL Xfind_pname(t, word) X findn_t *t; X char *word; X{ X if (streql(word, "-exec+")) X return (find_primary(t, EXECPLUS)); X if (streql(word, "-execdir+")) X return (find_primary(t, EXECDIRPLUS)); X return (find_primary(t, find_token(word))); X} X XEXPORT BOOL Xfind_hasprint(t) X findn_t *t; X{ X if (t == NULL) X return (FALSE); X X if (find_primary(t, PRINT) || find_primary(t, PRINTNNL) || X find_primary(t, PRINT0)) X return (TRUE); X if (find_primary(t, LS)) X return (TRUE); X return (FALSE); X} X XEXPORT BOOL Xfind_hasexec(t) X findn_t *t; X{ X if (t == NULL) X return (FALSE); X X if (find_primary(t, EXEC) || find_primary(t, EXECPLUS)) X return (TRUE); X if (find_primary(t, EXECDIR) || find_primary(t, EXECDIRPLUS)) X return (TRUE); X if (find_primary(t, OK_EXEC) || find_primary(t, OK_EXECDIR)) X return (TRUE); X if (find_primary(t, CALL) || find_primary(t, CALLDIR)) X return (TRUE); X return (FALSE); X} X X#ifdef FIND_MAIN XLOCAL int Xwalkfunc(nm, fs, type, state) X char *nm; X struct stat *fs; X int type; X struct WALK *state; X{ X if (type == WALK_NS) { X ferrmsg(state->std[2], _("Cannot stat '%s'.\n"), nm); X state->err = 1; X return (0); X } else if (type == WALK_SLN && (state->walkflags & WALK_PHYS) == 0) { X ferrmsg(state->std[2], X _("Cannot follow symlink '%s'.\n"), nm); X state->err = 1; X return (0); X } else if (type == WALK_DNR) { X if (state->flags & WALK_WF_NOCHDIR) { X ferrmsg(state->std[2], X _("Cannot chdir to '%s'.\n"), nm); X } else { X ferrmsg(state->std[2], X _("Cannot read '%s'.\n"), nm); X } X state->err = 1; X return (0); X } X X if (state->maxdepth >= 0 && state->level >= state->maxdepth) X state->flags |= WALK_WF_PRUNE; X if (state->mindepth >= 0 && state->level < state->mindepth) X return (0); X X find_expr(nm, nm + state->base, fs, state, state->tree); X return (0); X} X#endif X X#ifdef __FIND__ XLOCAL inline BOOL X#else XEXPORT BOOL X#endif Xfind_expr(f, ff, fs, state, t) X char *f; /* path name */ X char *ff; /* file name */ X struct stat *fs; X struct WALK *state; X findn_t *t; X{ X time_t xtime; X FILE *fp = state->std[1]; X char *p; X char lname[8192]; X int fnflags = 0; X X switch (t->op) { X X case ILNAME: X#ifdef FNM_IGNORECASE X fnflags = FNM_IGNORECASE; X#endif X /* FALLTHROUGH */ X case LNAME: { X int lsize; X X if (!S_ISLNK(fs->st_mode)) X return (FALSE); X X if (state->lname != NULL) { X p = state->lname; X goto nmatch; X } X lname[0] = '\0'; X /* X * For file names from the command line, we did not perform X * a chdir() before, so we need to use the full path name. X */ X lsize = readlink(state->level ? ff : f, lname, sizeof (lname)); X if (lsize < 0) { X ferrmsg(state->std[2], X _("Cannot read link '%s'.\n"), ff); X return (FALSE); X } X lname[sizeof (lname)-1] = '\0'; X if (lsize >= 0) X lname[lsize] = '\0'; X p = lname; X goto nmatch; X } X case IPATH: X#ifdef FNM_IGNORECASE X fnflags = FNM_IGNORECASE; X#endif X /* FALLTHROUGH */ X case PATH: X p = f; X goto nmatch; X case INAME: X#ifdef FNM_IGNORECASE X fnflags = FNM_IGNORECASE; X#endif X /* FALLTHROUGH */ X case NAME: X p = ff; X nmatch: X#if defined(HAVE_FNMATCH) X return (!fnmatch(t->this, p, fnflags)); X#else X goto pattern; /* Use patmatch() as "fallback" */ X#endif X X case LPAT: { X int lsize; X X if (!S_ISLNK(fs->st_mode)) X return (FALSE); X X if (state->lname != NULL) { X p = state->lname; X goto pattern; X } X lname[0] = '\0'; X /* X * For file names from the command line, we did not perform X * a chdir() before, so we need to use the full path name. X */ X lsize = readlink(state->level ? ff : f, lname, sizeof (lname)); X if (lsize < 0) { X ferrmsg(state->std[2], X _("Cannot read link '%s'.\n"), ff); X return (FALSE); X } X lname[sizeof (lname)-1] = '\0'; X if (lsize >= 0) X lname[lsize] = '\0'; X p = lname; X goto pattern; X } X case PPAT: X p = f; X goto pattern; X case PAT: X p = ff; X pattern: { X Uchar *pr; /* patmatch() return */ X X pr = patmatch((Uchar *)t->this, (int *)t->right, X (Uchar *)p, 0, strlen(p), t->val.i, state->patstate); X return (*p && pr && (*pr == '\0')); X } X X case SIZE: X switch (*(t->left)) { X case '+': X if (t->this) X return (fs->st_size > t->val.size); X return ((fs->st_size+511)/512 > t->val.size); X case '-': X if (t->this) X return (fs->st_size < t->val.size); X return ((fs->st_size+511)/512 < t->val.size); X default: X if (t->this) X return (fs->st_size == t->val.size); X return ((fs->st_size+511)/512 == t->val.size); X } X X case EMPTY: X if (S_ISREG(fs->st_mode) && fs->st_size == 0) X return (TRUE); X /* X * For file names from the command line, we did not perform X * a chdir() before, so we need to use the full path name. X */ X if (S_ISDIR(fs->st_mode)) { X struct dirent *dp; X DIR *d = opendir(state->level ? ff : f); X X if (d == NULL) { X ferrmsg(state->std[2], X _("Cannot open directory '%s'.\n"), X ff); X return (FALSE); X } X while ((dp = readdir(d)) != NULL) { X register char *name = dp->d_name; X /* X * Skip the following names: "", ".", "..". X */ X if (name[name[0] != '.' ? 0 : X name[1] != '.' ? 1 : 2] == '\0') X continue; X closedir(d); X return (FALSE); X } X closedir(d); X return (TRUE); X } X return (FALSE); X X case LINKS: X switch (*(t->left)) { X case '+': X return (fs->st_nlink > t->val.nlink); X case '-': X return (fs->st_nlink < t->val.nlink); X default: X return (fs->st_nlink == t->val.nlink); X } X X case INUM: X switch (*(t->left)) { X case '+': X return (fs->st_ino > t->val.ino); X case '-': X return (fs->st_ino < t->val.ino); X default: X return (fs->st_ino == t->val.ino); X } X X case LINKEDTO: X return ((fs->st_ino == t->val.ino) && X (fs->st_dev == t->val2.dev)); X X case READABLE: X t->val.i = R_OK; X goto check_access; X case WRITABLE: X t->val.i = W_OK; X goto check_access; X case EXECUTABLE: X t->val.i = X_OK; X check_access: X /* X * For file names from the command line, we did not perform X * a chdir() before, so we need to use the full path name. X */ X if (access(state->level ? ff : f, t->val.i) < 0) X return (FALSE); X return (TRUE); X X case AMIN: X case ATIME: X xtime = fs->st_atime; X goto times; X case CMIN: X case CTIME: X xtime = fs->st_ctime; X goto times; X case MMIN: X case MTIME: X case TIME: X xtime = fs->st_mtime; X times: X if (t->val2.i != 0) X goto timex; X X switch (*(t->left)) { X case '+': X return ((find_xnow-xtime)/DAYSECS > t->val.time); X case '-': X return ((find_xnow-xtime)/DAYSECS < t->val.time); X default: X return ((find_xnow-xtime)/DAYSECS == t->val.time); X } X timex: X switch (*(t->left)) { X case '+': X return ((find_xnow-xtime) > t->val.time); X case '-': X return ((find_xnow-xtime) < t->val.time); X default: X return ((find_xnow-xtime) == t->val.time); X } X X case NEWERAA: X case NEWERAC: X case NEWERAM: X case NEWERAT: X#if defined(_FOUND_STAT_NSECS_) X if (t->val.ts.tv_sec < fs->st_atime) X return (TRUE); X return ((t->val.ts.tv_sec == fs->st_atime) && X (t->val.ts.tv_nsec < stat_ansecs(fs))); X#else X return (t->val.time < fs->st_atime); X#endif X X case NEWERCA: X case NEWERCC: X case NEWERCM: X case NEWERCT: X#if defined(_FOUND_STAT_NSECS_) X if (t->val.ts.tv_sec < fs->st_ctime) X return (TRUE); X return ((t->val.ts.tv_sec == fs->st_ctime) && X (t->val.ts.tv_nsec < stat_cnsecs(fs))); X#else X return (t->val.time < fs->st_ctime); X#endif X X case NEWER: X case NEWERMA: X case NEWERMC: X case NEWERMM: X case NEWERMT: X#if defined(_FOUND_STAT_NSECS_) X if (t->val.ts.tv_sec < fs->st_mtime) X return (TRUE); X return ((t->val.ts.tv_sec == fs->st_mtime) && X (t->val.ts.tv_nsec < stat_mnsecs(fs))); X#else X return (t->val.time < fs->st_mtime); X#endif X X case TYPE: X switch (*(t->this)) { X case 'b': X return (S_ISBLK(fs->st_mode)); X case 'c': X return (S_ISCHR(fs->st_mode)); X case 'd': X return (S_ISDIR(fs->st_mode)); X case 'D': X return (S_ISDOOR(fs->st_mode)); X case 'e': X return (S_ISEVC(fs->st_mode)); X case 'f': X return (S_ISREG(fs->st_mode)); X case 'l': X return (S_ISLNK(fs->st_mode)); X case 'p': X return (S_ISFIFO(fs->st_mode)); X case 'P': X return (S_ISPORT(fs->st_mode)); X case 's': X return (S_ISSOCK(fs->st_mode)); X default: X return (FALSE); X } X X case FSTYPE: X#ifdef HAVE_ST_FSTYPE X return (streql(t->this, fs->st_fstype)); X#else X return (TRUE); X#endif X X case LOCL: X#ifdef HAVE_ST_FSTYPE X if (streql("nfs", fs->st_fstype) || X streql("autofs", fs->st_fstype) || X streql("cachefs", fs->st_fstype)) X return (FALSE); X#endif X return (TRUE); X X case CHATIME: X#if defined(_FOUND_STAT_NSECS_) X fs->st_atime = t->val.ts.tv_sec; X stat_set_ansecs(fs, t->val.ts.tv_nsec); X#else X fs->st_atime = t->val.time; X#endif X state->flags |= WALK_WF_CHTIME; /* Impossible to keep old */ X return (TRUE); X X case CHCTIME: X#if defined(_FOUND_STAT_NSECS_) X fs->st_ctime = t->val.ts.tv_sec; X stat_set_cnsecs(fs, t->val.ts.tv_nsec); X#else X fs->st_ctime = t->val.time; X#endif X state->flags |= WALK_WF_CHTIME; /* Impossible to keep old */ X return (TRUE); X X case CHMTIME: X#if defined(_FOUND_STAT_NSECS_) X fs->st_mtime = t->val.ts.tv_sec; X stat_set_mnsecs(fs, t->val.ts.tv_nsec); X#else X fs->st_mtime = t->val.time; X#endif X state->flags |= WALK_WF_CHTIME; /* Impossible to keep old */ X return (TRUE); X X#ifdef CHOWN X case CHOWN: X if (fs->st_uid != t->val.uid) X state->flags |= WALK_WF_CHOWN; X fs->st_uid = t->val.uid; X return (TRUE); X#endif X X case USER: X switch (*(t->left)) { X case '+': X return (fs->st_uid > t->val.uid); X case '-': X return (fs->st_uid < t->val.uid); X default: X return (fs->st_uid == t->val.uid); X } X X#ifdef CHGRP X case CHGRP: X if (fs->st_gid != t->val.gid) X state->flags |= WALK_WF_CHOWN; X fs->st_gid = t->val.gid; X return (TRUE); X#endif X X case GROUP: X switch (*(t->left)) { X case '+': X return (fs->st_gid > t->val.gid); X case '-': X return (fs->st_gid < t->val.gid); X default: X return (fs->st_gid == t->val.gid); X } X X#ifdef CHMOD X case CHMOD: X getperm(state->std[2], t->left, tokennames[t->op], X &t->val.mode, fs->st_mode & S_ALLMODES, X (S_ISDIR(fs->st_mode) || X (fs->st_mode & (S_IXUSR|S_IXGRP|S_IXOTH)) != 0) ? X GP_DOX:GP_NOX); X if ((fs->st_mode & S_ALLMODES) != t->val.mode) X state->flags |= WALK_WF_CHMOD; X fs->st_mode &= ~S_ALLMODES; X fs->st_mode |= t->val.mode; X return (TRUE); X#endif X X case CHFILE: { X BOOL ret = TRUE; X X if (state->flags & WALK_WF_CHMOD) { X#ifdef HAVE_CHMOD X#ifndef HAVE_LCHMOD X#undef lchmod X#define lchmod chmod X if (!S_ISLNK(fs->st_mode)) X#endif X if (lchmod(state->level ? ff : f, fs->st_mode) < 0) { X ferrmsg(state->std[2], _("Cannot chmod '%s'.\n"), ff); X ret = FALSE; X } X#else X ferrmsg(state->std[2], _("Cannot chmod: unsupported.\n")); X ret = FALSE; X#endif X } X if (state->flags & WALK_WF_CHOWN) { X#ifdef HAVE_CHOWN X#ifndef HAVE_LCHOWN X#undef lchown X#define lchown chown X if (!S_ISLNK(fs->st_mode)) X#endif X if (lchown(state->level ? ff : f, fs->st_uid, fs->st_gid) < 0) { X ferrmsg(state->std[2], _("Cannot chown '%s'.\n"), ff); X ret = FALSE; X } X#else X ferrmsg(state->std[2], _("Cannot chown: unsupported.\n")); X ret = FALSE; X#endif X } X if (state->flags & WALK_WF_CHTIME) { X#if defined(HAVE_UTIMENSAT) || defined(HAVE_LUTIMES) || defined(HAVE_LUTIME) || defined(HAVE_UTIMES) X struct timespec tp[3]; X X tp[0].tv_sec = fs->st_atime; X#if defined(_FOUND_STAT_NSECS_) X tp[0].tv_nsec = stat_ansecs(fs); X#else X tp[0].tv_nsec = 0; X#endif X tp[1].tv_sec = fs->st_mtime; X#if defined(_FOUND_STAT_NSECS_) X tp[1].tv_nsec = stat_mnsecs(fs); X#else X tp[1].tv_nsec = 0; X#endif X#if defined(HAVE_UTIMENSAT) || defined(HAVE_LUTIMES) || defined(HAVE_LUTIME) X#define NOFOLLOW AT_SYMLINK_NOFOLLOW X#else X#define NOFOLLOW 0 X if (!S_ISLNK(fs->st_mode)) X#endif X if (utimensat(AT_FDCWD, state->level ? ff : f, tp, NOFOLLOW) < 0) { X ferrmsg(state->std[2], _("Cannot set time on '%s'.\n"), ff); X ret = FALSE; X } X#else X ferrmsg(state->std[2], _("Cannot set time: unsupported.\n")); X ret = FALSE; X#endif X } X return (ret); X } X X case PERM: X if (t->left[0] == '/') X return ((fs->st_mode & t->val.mode) != 0); X else if (t->left[0] == '-') X return ((fs->st_mode & t->val.mode) == t->val.mode); X else X return ((fs->st_mode & S_ALLMODES) == t->val.mode); X X case MODE: X return (TRUE); X X case XDEV: X case MOUNT: X case MOUNTPLUS: X case DEPTH: X case FOLLOW: X case DOSTAT: X return (TRUE); X X case NOUSER: X return (getpwuid(fs->st_uid) == NULL); X X case NOGRP: X return (getgrgid(fs->st_gid) == NULL); X X case PRUNE: X state->flags |= WALK_WF_PRUNE; X return (TRUE); X X case MAXDEPTH: X case MINDEPTH: X return (TRUE); X X case PACL: X if (state->pflags & PF_ACL) { X return ((state->pflags & PF_HAS_ACL) != 0); X } X return (has_acl(state->std[2], f, ff, fs)); X X case XATTR: X if (state->pflags & PF_XATTR) { X return ((state->pflags & PF_HAS_XATTR) != 0); X } X return (has_xattr(state->std[2], ff)); X X case SPARSE: X if (!S_ISREG(fs->st_mode)) X return (FALSE); X#ifdef HAVE_ST_BLOCKS X return (fs->st_size > (fs->st_blocks * DEV_BSIZE + DEV_BSIZE)); X#else X return (FALSE); X#endif X X case OK_EXEC: X case OK_EXECDIR: { X char qbuf[32]; X X fflush(state->std[1]); X fprintf(state->std[2], "< %s ... %s > ? ", ((char **)t->this)[0], f); X fflush(state->std[2]); X fgetline(state->std[0], qbuf, sizeof (qbuf) - 1); X X switch (qbuf[0]) { X case 'y': X if (qbuf[1] == '\0' || streql(qbuf, "yes")) break; X default: X return (FALSE); X } X } X /* FALLTHRU */ X X case EXEC: X case EXECDIR: X#ifdef HAVE_FORK X return (doexec( X state->level && (t->op == OK_EXECDIR || t->op == EXECDIR)? X ff:f, X t, t->val.i, (char **)t->this, state)); X#else X ferrmsgno(state->std[2], EX_BAD, X _("'-%s' is unsupported on this platform, returning FALSE.\n"), X find_tname(t->op)); X return (FALSE); X#endif X X case EXECPLUS: X#ifdef HAVE_FORK X return (plusexec(f, t, state)); X#else X ferrmsgno(state->std[2], EX_BAD, X _("'-%s' is unsupported on this platform, returning FALSE.\n"), X find_tname(t->op)); X return (FALSE); X#endif X X case CALL: X case CALLDIR: X return (docall( X state->level && (t->op == CALLDIR)? X ff:f, X t, t->val.i, (char **)t->this, state)); X X case FPRINT: X fp = t->val.fp; X /* FALLTHRU */ X case PRINT: X filewrite(fp, f, strlen(f)); X putc('\n', fp); X return (TRUE); X X case FPRINT0: X fp = t->val.fp; X /* FALLTHRU */ X case PRINT0: X filewrite(fp, f, strlen(f)); X putc('\0', fp); X return (TRUE); X X case FPRINTNNL: X fp = t->val.fp; X /* FALLTHRU */ X case PRINTNNL: X filewrite(fp, f, strlen(f)); X putc(' ', fp); X return (TRUE); X X case FLS: X fp = t->val.fp; X /* FALLTHRU */ X case LS: { X FILE *std[3]; X /* X * The third parameter is the file name used for readlink() X * (inside find_list()) relatively to the current working X * directory. For file names from the command line, we did not X * perform a chdir() before, so we need to use the full path X * name. X */ X std[0] = state->std[0]; X std[1] = fp; X std[2] = state->std[2]; X find_list(std, fs, f, state->level ? ff : f, state); X return (TRUE); X } X case LTRUE: X return (TRUE); X X case LFALSE: X return (FALSE); X X case OPEN: X return (find_expr(f, ff, fs, state, (findn_t *)t->this)); X case LNOT: X return (!find_expr(f, ff, fs, state, (findn_t *)t->this)); X case AND: X return (find_expr(f, ff, fs, state, (findn_t *)t->left) ? X find_expr(f, ff, fs, state, (findn_t *)t->right) : 0); X case LOR: X return (find_expr(f, ff, fs, state, (findn_t *)t->left) ? X 1 : find_expr(f, ff, fs, state, (findn_t *)t->right)); X } X if (!(state->pflags & 0x80000000)) { X X ferrmsgno(state->std[2], EX_BAD, X _("Internal malfunction, found unknown primary '-%s' (%d).\n"), X find_tname(t->op), t->op); X state->pflags |= 0x80000000; X } X return (FALSE); /* Unknown operator ??? */ X} X XLOCAL BOOL Xdocall(f, t, ac, av, state) X char *f; X findn_t *t; X int ac; X char **av; X struct WALK *state; X{ X char *xav[32]; X register char **pp = av; X register char **pp2 = xav; X char ** volatile aav = NULL; X register int i; X int retval = 0; X BOOL didhome = FALSE; X X if (f && ac >= 32) { X aav = malloc((ac+1) * sizeof (char **)); X if (aav == NULL) { X ferrmsg(state->std[2], _("Cannot malloc arg vector for -call.\n")); X return (FALSE); X } X pp2 = aav; X } X X if (t != NULL && /* Not called from find_plusflush() */ X t->op != CALLDIR) { X if (walkhome(state) < 0) X ferrmsg(state->std[2], _("Cannot chdir to '.'.\n")); X else X didhome = TRUE; X } X X#define iscurlypair(p) ((p)[0] == '{' && (p)[1] == '}' && (p)[2] == '\0') X X if (f) { /* NULL for -call+ */ X for (i = 0; i < ac; i++, pp++) { X register char *p = *pp; X X if (iscurlypair(p)) /* streql(p, "{}") */ X *pp2++ = f; X else X *pp2++ = p; X } X if (aav) X pp = aav; X else X pp = xav; X pp[ac] = NULL; /* -call {} \; is not NULL terminated */ X X retval = t->val2.callfun(ac, pp); X X } X X if (didhome) X walkcwd(state); X X if (aav != NULL) X free(aav); X return (retval == 0); X} X X#ifdef HAVE_FORK XLOCAL BOOL Xdoexec(f, t, ac, av, state) X char *f; X findn_t *t; X int ac; X char **av; X struct WALK *state; X{ X#ifdef HAVE_VFORK X char ** volatile aav = NULL; X#endif X pid_t pid; X int retval; X X#ifdef HAVE_VFORK X if (f && ac >= 32) { /* This is not exec + */ X /* X * One NULL pointer and one index for "sh". X */ X aav = malloc((ac+1+1) * sizeof (char **)); X if (aav == NULL) { X ferrmsg(state->std[2], _("Cannot malloc arg vector for -exec.\n")); X return (FALSE); X } X } X#endif X if ((pid = vfork()) < 0) { X#ifdef HAVE_VFORK X ferrmsg(state->std[2], _("Cannot vfork child.\n")); X#else X ferrmsg(state->std[2], _("Cannot fork child.\n")); X#endif X#ifdef HAVE_VFORK X /* X * Ugly code as a workaround for broken Linux include files X * that do not specify vfork() as a problem. This may X * cause aav to be != NULL even when malloc() above was never X * called. Freeing a random address on some platforms causes a X * coredump. X * As similar problems may exist on other platforms, where the X * correct fix to mark aav volatile does not work, we keep the X * workaround to check f and ac as well. X */ X if (aav && f && ac >= 32) X free(aav); X#endif X return (FALSE); X } X if (pid) { X while (wait(&retval) != pid) X /* LINTED */ X ; X#ifdef HAVE_VFORK X /* X * Ugly code as a workaround for broken Linux include files X * that do not specify vfork() as a problem. This may X * cause aav to be != NULL even when malloc() above was never X * called. Freeing a random address on some platforms causes a X * coredump. X * As similar problems may exist on other platforms, where the X * correct fix to mark aav volatile does not work, we keep the X * workaround to check f and ac as well. X */ X if (aav && f && ac >= 32) X free(aav); X#endif X return (retval == 0); X } else { X#ifdef HAVE_VFORK X char *xav[32+1]; X register char **pp2 = &xav[1]; X#endif X register int i; X register char **pp = av; X int err; X X /* X * This is the forked process and for this reason, we may X * call fcomerr() here without problems. X */ X if (t != NULL && /* Not called from find_plusflush() */ X t->op != OK_EXECDIR && t->op != EXECDIR && X walkhome(state) < 0) { X fcomerr(state->std[2], X _("Cannot chdir to '.'.\n")); X } X#ifndef F_SETFD X walkclose(state); X#endif X X#define iscurlypair(p) ((p)[0] == '{' && (p)[1] == '}' && (p)[2] == '\0') X X#ifdef HAVE_VFORK X if (aav) X pp2 = &aav[1]; /* Room for "sh" */ X#endif X if (f) { /* NULL for -exec+ */ X for (i = 0; i < ac; i++, pp++) { X register char *p = *pp; X X#ifdef HAVE_VFORK X if (iscurlypair(p)) /* streql(p, "{}") */ X *pp2++ = f; X else X *pp2++ = p; X#else X if (iscurlypair(p)) /* streql(p, "{}") */ X *pp = f; X#endif X } X#ifdef HAVE_VFORK X *pp2 = NULL; /* NULL terminate */ X if (aav) X pp = &aav[1]; X else X pp = &xav[1]; X#else X /* X * "pp" is already NULL terminated. X */ X pp = av; X#endif X } else { X pp = av; X } X#ifdef PLUS_DEBUG X error("argsize %d\n", X (plusp->endp - (char *)&plusp->nextargp[0]) - X (plusp->laststr - (char *)&plusp->nextargp[1])); X#endif X pp[ac] = NULL; /* -exec {} \; is not NULL terminated */ X X fexecve(av[0], state->std[0], state->std[1], state->std[2], X pp, state->env); X err = geterrno(); X#ifdef PLUS_DEBUG X error("argsize %d\n", X (plusp->endp - (char *)&plusp->nextargp[0]) - X (plusp->laststr - (char *)&plusp->nextargp[1])); X#endif X if (err == ENOEXEC) { X char **ps = &pp[-1]; X X#ifndef HAVE_VFORK X if (f && ac >= 32) { /* This is not exec + */ X register char **pp2; X X /* X * One NULL pointer and one index for "sh". X */ X ps = malloc((ac+1+1) * sizeof (char **)); X if (ps == NULL) { X ferrmsg(state->std[2], X _("Cannot malloc arg vector for -exec.\n")); X goto exerr; X } X pp2 = &ps[1]; X for (i = 0; i < ac; i++, pp++) { X *pp2++ = *pp; X } X *pp2 = NULL; X } X#endif X ps[0] = "sh"; X fexecve(ps[0], state->std[0], X state->std[1], X state->std[2], X ps, state->env); X } X /* X * This is the forked process and for this reason, we may X * call _exit() here without problems. X */ X#ifndef HAVE_VFORK Xexerr: X#endif X ferrmsgno(state->std[2], err, X _("Cannot execute '%s'.\n"), av[0]); X _exit(err); X /* NOTREACHED */ X return (-1); X } X} X#endif /* HAVE FORK */ X X#ifndef LINE_MAX X#define LINE_MAX 1024 X#endif X X#if defined(IS_MACOS_X) && defined(HAVE_CRT_EXTERNS_H) X/* X * The MAC OS X linker does not grok "common" varaibles. X * We need to fetch the address of "environ" using a hack. X */ X#include X#define environ *_NSGetEnviron() X#else Xextern char **environ; X#endif X X/* X * Return the number of environment entries including the final NULL pointer. X */ XLOCAL int Xcountenv() X{ X register int evs = 0; X register char **ep; X X for (ep = environ; *ep; ep++) { X evs++; X } X evs++; /* The environ NULL ptr at the end */ X return (evs); X} X X/* X * Return ARG_MAX - LINE_MAX - size of current environment. X * X * The return value is reduced by LINE_MAX to allow the called X * program to do own exec(2) calls with slightly increased arg size. X */ XLOCAL int Xargsize(fap, xtype) X finda_t *fap; X int xtype; X{ X if (fap->argsize == 0) { X register int evs = 0; X register char **ep; X int ret = 0; X X for (ep = environ; *ep; ep++) { X evs += strlen(*ep) + 1 + sizeof (ep); X } X evs += sizeof (char **); /* The environ NULL ptr at the end */ X X#ifdef _SC_ARG_MAX X ret = sysconf(_SC_ARG_MAX); X if (ret < 0) X#ifdef _POSIX_ARG_MAX X ret = _POSIX_ARG_MAX; X#else X ret = ARG_MAX; X#endif X#else /* VV NO _SC_ARG_MAX VV */ X#ifdef ARG_MAX X ret = ARG_MAX; X#else X#ifdef NCARGS X /* X * On Solaris: ARG_MAX = NCARGS - space for other stuff on X * initial stack. This size is 256 for 32 bit and 512 for X * 64 bit programs. X */ X ret = NCARGS - 256; /* Let us do the same */ X#endif X#endif X#endif X X#ifdef MULTI_ARG_MAX X ret = xargsize(xtype, ret); X#endif X X#ifdef PLUS_DEBUG X ret = 3000; X#define LINE_MAX 100 X error("evs %d\n", evs); X#endif X if (ret <= 0) X ret = 10000; /* Just a guess */ X X ret -= evs; /* Subtract current env size */ X if ((ret - LINE_MAX) > 0) X ret -= LINE_MAX; X else X ret -= 100; X fap->argsize = ret; X } X return (fap->argsize); X} X X/* X * Return the executable type: X * X * 0 unknown type -> default X * 32 a 32 bit binary X * 64 a 64 bit binary X */ XLOCAL int Xextype(name) X char *name; X{ X int f; X char *xname; X char elfbuf[8]; X X xname = findinpath(name, X_OK, TRUE, NULL); X if (name == NULL) X xname = name; X X if ((f = open(xname, O_RDONLY|O_BINARY)) < 0) { X if (xname != name) X free(xname); X return (0); X } X if (xname != name) X free(xname); X if (read(f, elfbuf, sizeof (elfbuf)) < sizeof (elfbuf)) { X close(f); X return (0); X } X close(f); X X /* X * We only support ELF binaries X */ X if (elfbuf[0] != 0x7F || X elfbuf[1] != 'E' || elfbuf[2] != 'L' || elfbuf[3] != 'F') X return (0); X X switch (elfbuf[4] & 0xFF) { X X case 1: /* ELFCLASS32 */ X return (32); X X case 2: /* ELFCLASS64 */ X return (64); X } X return (0); X} X X#ifdef MULTI_ARG_MAX X/* X * If we have both _ARG_MAX32 and _ARG_MAX64 (currently on SunOS) X * correct maxarg based on the target binary type. X */ XLOCAL int Xxargsize(xtype, maxarg) X int xtype; X int maxarg; X{ X /* X * Set up a safe fallback in case we are not able to determine the X * binary type. X */ X if (maxarg > _ARG_MAX32) X maxarg = _ARG_MAX32; X X switch (xtype) { X X case 32: X maxarg = _ARG_MAX32; X break; X X case 64: X maxarg = _ARG_MAX64; X break; X } X X return (maxarg); X} X#endif X XLOCAL BOOL Xpluscreate(f, ac, av, fap) X FILE *f; X int ac; X char **av; X finda_t *fap; X{ X struct plusargs *pp; X register char **ap = av; X register int i; X int mxtype; X int xtype; X int maxarg; X int nenv; X X xtype = extype(av[0]); /* Get -exec executable type */ X maxarg = argsize(fap, xtype); /* Get ARG_MAX for executable */ X nenv = countenv(); /* # of ents in current env */ X X mxtype = sizeof (char *) * CHAR_BIT; X if (xtype == 0) X mxtype = 0; X X if (xtype == mxtype) X nenv = 0; /* Easy case */ X else if (xtype > mxtype) X nenv = -nenv; /* Need to reduce arg size */ X X maxarg += nenv * (32 / CHAR_BIT); /* Correct maxarg by ptr size */ X X#ifdef PLUS_DEBUG X printf("Argc %d\n", ac); X ap = av; X for (i = 0; i < ac; i++, ap++) X printf("ARG %d '%s'\n", i, *ap); X#endif X X pp = __fjmalloc(fap->std[2], maxarg + sizeof (struct plusargs), X "-exec args", fap->jmp); X pp->laststr = pp->endp = (char *)(&pp->av[0]) + maxarg; X pp->nenv = nenv; X pp->ac = 0; X pp->nextargp = &pp->av[0]; X X#ifdef PLUS_DEBUG X printf("pp %d\n", pp); X printf("pp->laststr %d\n", pp->laststr); X printf("argsize() %d\n", maxarg); X#endif X X /* X * Copy args from command line. X */ X ap = av; X for (i = 0; i < ac; i++, ap++) { X#ifdef PLUS_DEBUG X printf("ARG %d '%s'\n", i, *ap); X#endif X *(pp->nextargp++) = *ap; X pp->laststr -= strlen(*ap) + 1; X pp->ac++; X if (pp->laststr <= (char *)pp->nextargp) { X ferrmsgno(f, EX_BAD, X _("No space to copy -exec args.\n")); X free(pp); /* The exec plusargs struct */ X return (FALSE); X } X } X#ifdef PLUS_DEBUG X error("lastr %d endp %d diff %d\n", X pp->laststr, pp->endp, pp->endp - pp->laststr); X#endif X pp->endp = pp->laststr; /* Reduce endp by the size of cmdline args */ X X#ifdef PLUS_DEBUG X ap = &pp->av[0]; X for (i = 0; i < pp->ac; i++, ap++) { X printf("ARG %d '%s'\n", i, *ap); X } X#endif X#ifdef PLUS_DEBUG X printf("pp %d\n", pp); X printf("pp->laststr %d\n", pp->laststr); X#endif X pp->next = fap->plusp; X fap->plusp = pp; X#ifdef PLUS_DEBUG X plusp = fap->plusp; /* Makes libfind not MT safe */ X#endif X return (TRUE); X} X X#ifdef HAVE_FORK XLOCAL BOOL Xplusexec(f, t, state) X char *f; X findn_t *t; X struct WALK *state; X{ X register struct plusargs *pp = (struct plusargs *)t->this; X#ifdef PLUS_DEBUG X register char **ap; X register int i; X#endif X size_t size; X size_t slen = strlen(f) + 1; X char *nargp = (char *)&pp->nextargp[2]; X char *cp; X int ret = TRUE; X X size = pp->laststr - (char *)&pp->nextargp[2]; /* Remaining strlen */ X X if (pp->nenv < 0) /* Called cmd has */ X nargp += pp->ac * (32 / CHAR_BIT); /* larger ptr size */ X X if (pp->laststr < nargp || /* Already full */ X slen > size) { /* str does not fit */ X pp->nextargp[0] = NULL; X ret = doexec(NULL, t, pp->ac, pp->av, state); X pp->laststr = pp->endp; X pp->ac = t->val.i; X pp->nextargp = &pp->av[t->val.i]; X size = pp->laststr - (char *)&pp->nextargp[2]; X } X if (pp->laststr < nargp || X slen > size) { X ferrmsgno(state->std[2], EX_BAD, X _("No space for arg '%s'.\n"), f); X return (FALSE); X } X cp = pp->laststr - slen; X strcpy(cp, f); X pp->nextargp[0] = cp; X pp->ac++; X pp->nextargp++; X pp->laststr -= slen; X X#ifdef PLUS_DEBUG X ap = &plusp->av[0]; X for (i = 0; i < plusp->ac; i++, ap++) { X printf("ARG %d '%s'\n", i, *ap); X } X error("EXECPLUS '%s'\n", f); X#endif X return (ret); X} X#endif /* HAVE_FORK */ X XEXPORT int Xfind_plusflush(p, state) X void *p; X struct WALK *state; X{ X struct plusargs *plusp = p; X BOOL ret = TRUE; X X /* X * Execute all unflushed '-exec .... {} +' expressions. X */ X while (plusp) { X#ifdef PLUS_DEBUG X error("lastr %p endp %p\n", plusp->laststr, plusp->endp); X#endif X if (plusp->laststr != plusp->endp) { X plusp->nextargp[0] = NULL; X#ifdef HAVE_FORK X if (!doexec(NULL, NULL, plusp->ac, plusp->av, state)) X ret = FALSE; X#endif X } X plusp = plusp->next; X } X return (ret); X} X XEXPORT void Xfind_usage(f) X FILE *f; X{ X fprintf(f, _("Usage: %s [options] [path_1 ... path_n] [expression]\n"), get_progname()); X fprintf(f, _("Options:\n")); X fprintf(f, _(" -H follow symbolic links encountered on command line\n")); X fprintf(f, _(" -L follow all symbolic links\n")); X fprintf(f, _("* -P do not follow symbolic links (default)\n")); X fprintf(f, _("* -help Print this help.\n")); X fprintf(f, _("* -version Print version number.\n")); X fprintf(f, _("Operators in decreasing precedence:\n")); X fprintf(f, _(" ( ) group an expression\n")); X fprintf(f, _(" !, -a, -o negate a primary (unary NOT), logical AND, logical OR\n")); X fprintf(f, _("Primaries:\n")); X fprintf(f, _("* -acl TRUE if the file has additional ACLs defined\n")); X fprintf(f, _(" -atime # TRUE if st_atime is in specified range\n")); X fprintf(f, _("* -call command [argument ...] \\;\n")); X fprintf(f, _("* -calldir command [argument ...] \\;\n")); X#ifdef CHATIME X fprintf(f, _("* -chatime tspec always TRUE, sets st_atime to tspec\n")); X#endif X#ifdef CHCTIME X fprintf(f, _("* -chctime tspec always TRUE, sets st_ctime to tspec\n")); X#endif X#ifdef CHMTIME X fprintf(f, _("* -chmtime tspec always TRUE, sets st_mtime to tspec\n")); X#endif X#ifdef CHGRP X fprintf(f, _("* -chgrp gname/gid always TRUE, sets st_gid to gname/gid\n")); X#endif X#ifdef CHMOD X fprintf(f, _("* -chmod mode/onum always TRUE, sets permissions to mode/onum\n")); X#endif X#ifdef CHOWN X fprintf(f, _("* -chown uname/uid always TRUE, sets st_uid to uname/uid\n")); X#endif X#ifdef CHFILE X fprintf(f, _("* -chfile sets st_uid/st_gid, st_mode, st_?time in file\n")); X#endif X fprintf(f, _(" -ctime # TRUE if st_ctime is in specified range\n")); X fprintf(f, _(" -depth evaluate directory content before directory (always TRUE)\n")); X fprintf(f, _("* -dostat Do not do stat optimization (always TRUE)\n")); X fprintf(f, _("* -empty TRUE zero sized plain file or empty directory\n")); X fprintf(f, _(" -exec program [argument ...] \\;\n")); X fprintf(f, _(" -exec program [argument ...] {} +\n")); X fprintf(f, _("* -execdir program [argument ...] \\;\n")); X fprintf(f, _("* -executable TRUE if file is executable by real user id\n")); X fprintf(f, _("* -false always FALSE\n")); X fprintf(f, _("* -fls file list files similar to 'ls -ilds' into 'file' (always TRUE)\n")); X fprintf(f, _("* -follow outdated: follow all symbolic links (always TRUE)\n")); X fprintf(f, _("* -fprint file print file names line separated into 'file' (always TRUE)\n")); X fprintf(f, _("* -fprint0 file print file names nul separated into 'file' (always TRUE)\n")); X fprintf(f, _("* -fprintnnl file print file names space separated into 'file' (always TRUE)\n")); X fprintf(f, _("* -fstype type TRUE if st_fstype matches type\n")); X fprintf(f, _(" -group gname/gid TRUE if st_gid matches gname/gid\n")); X fprintf(f, _("* -ilname glob TRUE if symlink name matches shell glob\n")); X fprintf(f, _("* -ilpat pattern TRUE if symlink name matches pattern\n")); X fprintf(f, _("* -iname glob TRUE if path component matches shell glob\n")); X fprintf(f, _("* -inum # TRUE if st_ino is in specified range\n")); X fprintf(f, _("* -ipat pattern TRUE if path component matches pattern\n")); X fprintf(f, _("* -ipath glob TRUE if full path matches shell glob\n")); X fprintf(f, _("* -ippat pattern TRUE if full path matches pattern\n")); X fprintf(f, _("* -linkedto path TRUE if the file is linked to path\n")); X fprintf(f, _(" -links # TRUE if st_nlink is in specified range\n")); X fprintf(f, _("* -lname glob TRUE if symlink name matches shell glob\n")); X fprintf(f, _("* -local TRUE if st_fstype does not match remote fs types\n")); X fprintf(f, _("* -lpat pattern TRUE if symlink name matches pattern\n")); X fprintf(f, _("* -ls list files similar to 'ls -ilds' (always TRUE)\n")); X fprintf(f, _("* -maxdepth # descend at most # directory levels (always TRUE)\n")); X fprintf(f, _("* -mindepth # start tests at directory level # (always TRUE)\n")); X fprintf(f, _(" -mount restrict search to current filesystem (always TRUE)\n")); X fprintf(f, _("* -mount+ do not descend into mounted directories (always TRUE)\n")); X fprintf(f, _(" -mtime # TRUE if st_mtime is in specified range\n")); X fprintf(f, _(" -name glob TRUE if path component matches shell glob\n")); X fprintf(f, _(" -newer file TRUE if st_mtime newer then mtime of file\n")); X fprintf(f, _("* -newerXY file TRUE if [acm]time (X) newer then [acmt]time (Y) of file\n")); X fprintf(f, _(" -nogroup TRUE if not in group database\n")); X fprintf(f, _(" -nouser TRUE if not in user database\n")); X fprintf(f, _(" -ok program [argument ...] \\;\n")); X fprintf(f, _("* -okdir program [argument ...] \\;\n")); X fprintf(f, _("* -pat pattern TRUE if path component matches pattern\n")); X fprintf(f, _("* -path glob TRUE if full path matches shell glob\n")); X fprintf(f, _(" -perm mode/onum TRUE if symbolic/octal permission matches\n")); X fprintf(f, _("* -ppat pattern TRUE if full path matches pattern\n")); X fprintf(f, _(" -print print file names line separated to stdout (always TRUE)\n")); X fprintf(f, _("* -print0 print file names nul separated to stdout (always TRUE)\n")); X fprintf(f, _("* -printnnl print file names space separated to stdout (always TRUE)\n")); X fprintf(f, _(" -prune do not descent current directory (always TRUE)\n")); X fprintf(f, _("* -readable TRUE if file is readable by real user id\n")); X fprintf(f, _(" -size # TRUE if st_size is in specified range\n")); X fprintf(f, _("* -sparse TRUE if file appears to be sparse\n")); X fprintf(f, _("* -true always TRUE\n")); X fprintf(f, _(" -type c TRUE if file type matches, c is from (b c d D e f l p P s)\n")); X fprintf(f, _(" -user uname/uid TRUE if st_uid matches uname/uid\n")); X fprintf(f, _("* -writable TRUE if file is writable by real user id\n")); X fprintf(f, _("* -xattr TRUE if the file has extended attributes\n")); X fprintf(f, _(" -xdev do not descend into mounted directories (always TRUE)\n")); X fprintf(f, _("Primaries marked with '*' are POSIX extensions, avoid them in portable scripts.\n")); X fprintf(f, _("If path is omitted, '.' is used. If expression is omitted, -print is used.\n")); X} X XEXPORT char * Xfind_strvers() X{ X return (strvers); X} X XEXPORT int Xfind_vers() X{ X return (VERSION_NUM); X} X X#ifdef FIND_MAIN X X/* ARGSUSED */ XLOCAL int Xgetflg(optstr, argp) X char *optstr; X long *argp; X{ X if (optstr[1] != '\0') X return (-1); X X switch (*optstr) { X X case 'H': X *(int *)argp |= WALK_ARGFOLLOW; X return (TRUE); X case 'L': X *(int *)argp |= WALK_ALLFOLLOW; X return (TRUE); X case 'P': X *(int *)argp &= ~(WALK_ARGFOLLOW | WALK_ALLFOLLOW); X return (TRUE); X X default: X return (-1); X } X} X XEXPORT int Xmain(ac, av) X int ac; X char **av; X{ X int cac = ac; X char **cav = av; X char **firstpath; X char **firstprim; X BOOL help = FALSE; X BOOL prversion = FALSE; X finda_t fa; X findn_t *Tree; X struct WALK walkstate; X X save_args(ac, av); X X#ifdef USE_NLS X setlocale(LC_ALL, ""); X bindtextdomain("SCHILY_FIND", "/opt/schily/lib/locale"); X textdomain("SCHILY_FIND"); X#endif X find_argsinit(&fa); X fa.walkflags = WALK_CHDIR | WALK_PHYS; X fa.walkflags |= WALK_NOSTAT; X fa.walkflags |= WALK_NOEXIT; X X /* X * Do not check the return code for getargs() as we may get an error X * code from e.g. "find -print" and we do not like to handle this here. X */ X cac--, cav++; X getargs(&cac, (char * const **)&cav, "help,version,&", X &help, &prversion, X getflg, (long *)&fa.walkflags); X if (help) { X find_usage(stderr); X return (0); X } X if (prversion) { X printf("sfind release %s (%s-%s-%s) Copyright (C) 2004-2008 Jörg Schilling\n", X strvers, X HOST_CPU, HOST_VENDOR, HOST_OS); X return (0); X } X X firstpath = cav; /* Remember first file type arg */ X find_firstprim(&cac, (char *const **)&cav); X firstprim = cav; /* Remember first Primary type arg */ X fa.Argv = cav; X fa.Argc = cac; X X if (cac) { X Tree = find_parse(&fa); X if (fa.primtype == FIND_ERRARG) { X find_free(Tree, &fa); X return (fa.error); X } X if (fa.primtype != FIND_ENDARGS) { X ferrmsgno(stderr, EX_BAD, X _("Incomplete expression.\n")); X find_free(Tree, &fa); X return (EX_BAD); X } X if (find_pname(Tree, "-chown") || find_pname(Tree, "-chgrp") || X find_pname(Tree, "-chmod")) { X ferrmsgno(stderr, EX_BAD, X _("Unsupported primary -chown/-chgrp/-chmod.\n")); X find_free(Tree, &fa); X return (EX_BAD); X } X } else { X Tree = 0; X } X if (Tree == 0) { X Tree = find_printnode(); X } else if (!fa.found_action) { X Tree = find_addprint(Tree, &fa); X if (Tree == (findn_t *)NULL) X return (geterrno()); X } X walkinitstate(&walkstate); X if (fa.patlen > 0) { X walkstate.patstate = __jmalloc(sizeof (int) * fa.patlen, X "space for pattern state", JM_RETURN); X if (walkstate.patstate == NULL) X return (geterrno()); X } X X find_timeinit(time(0)); X X walkstate.walkflags = fa.walkflags; X walkstate.maxdepth = fa.maxdepth; X walkstate.mindepth = fa.mindepth; X walkstate.lname = NULL; X walkstate.tree = Tree; X walkstate.err = 0; X walkstate.pflags = 0; X X if (firstpath == firstprim) { X treewalk(".", walkfunc, &walkstate); X } else { X for (cav = firstpath; cav != firstprim; cav++) { X treewalk(*cav, walkfunc, &walkstate); X /* X * XXX hier break wenn treewalk() Fehler gemeldet X */ X } X } X /* X * Execute all unflushed '-exec .... {} +' expressions. X */ X find_plusflush(fa.plusp, &walkstate); X find_free(Tree, &fa); X if (walkstate.patstate != NULL) X free(walkstate.patstate); X return (walkstate.err); X} X X#endif /* FIND_MAIN */ END-of-star-1.6/libfind/find.c echo x - star-1.6/libfind/find_list.c sed 's/^X//' >star-1.6/libfind/find_list.c << 'END-of-star-1.6/libfind/find_list.c' X/* @(#)find_list.c 1.29 19/04/07 Copyright 1985, 1995, 2000-2019 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)find_list.c 1.29 19/04/07 Copyright 1985, 1995, 2000-2019 J. Schilling"; X#endif X/* X * List a file X * X * Copyright (c) 1985, 1995, 2000-2019 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X#include X#include X#include X#include X#include X#include X#include X#include X#include "find_list.h" X#include "find_misc.h" X X#define K_DIV (1024/DEV_BSIZE) X X#if defined(IS_MACOS_X) X/* X * The MAC OS X linker does not grok "common" varaibles. X * Make find_sixmonth/find_now a "data" variable. X */ XEXPORT time_t find_sixmonth = 0; /* 6 months before limit (ls) */ XEXPORT time_t find_now = 0; /* now limit (ls) */ X#else XEXPORT time_t find_sixmonth; /* 6 months before limit (ls) */ XEXPORT time_t find_now; /* now limit (ls) */ X#endif X X#define paxls TRUE Xextern BOOL numeric; Xextern int verbose; X XLOCAL void modstr __PR((FILE *f, struct stat *fs, char *s, X char *name, char *sname, X struct WALK *state)); XEXPORT void find_list __PR((FILE *std[3], struct stat *fs, X char *name, char *sname, X struct WALK *state)); X X/* X * Convert POSIX.1 mode/permission flags into string. X */ XLOCAL void Xmodstr(f, fs, s, name, sname, state) X FILE *f; /* FILE * for error messages */ X struct stat *fs; /* Struct stat for this file */ X char *s; /* String to fill with mode */ X char *name; /* Name to use for stat/readlink */ X char *sname; /* Name to use for stat/readlink */ X struct WALK *state; /* state from treewalk() */ X{ X register char *mstr = "xwrxwrxwr"; X register char *str = s; X register int i; X register mode_t mode = fs->st_mode; X X *str++ = '?'; /* Unknown file type */ X for (i = 9; --i >= 0; ) { X if (mode & (1 << i)) X *str++ = mstr[i]; X else X *str++ = '-'; X } X#ifdef USE_ACL X *str++ = ' '; X#endif X#ifdef USE_XATTR X *str++ = '\0'; /* Don't claim space for '@' */ X#endif X *str = '\0'; X str = s; X if (mode & S_ISVTX) { X if (mode & S_IXOTH) { X str[9] = 't'; /* Sticky & exec. by others */ X } else { X str[9] = 'T'; /* Sticky but !exec. by oth */ X } X } X if (mode & S_ISGID) { X if (mode & S_IXGRP) { X str[6] = 's'; /* Sgid & executable by grp */ X } else { X if (!S_ISREG(mode)) X str[6] = 'S'; /* Sgid directory, or other */ X else X str[6] = 'l'; /* Mandatory lock file */ X } X } X if (mode & S_ISUID) { X if (mode & S_IXUSR) X str[3] = 's'; /* Suid & executable by own. */ X else X str[3] = 'S'; /* Suid but not executable */ X } X i = 10; X#ifdef USE_ACL X if (state->pflags & PF_ACL) { X if (state->pflags & PF_HAS_ACL) X str[i++] = '+'; X } else X if (has_acl(f, name, sname, fs)) X str[i++] = '+'; X#endif X#ifdef USE_XATTR X if (state->pflags & PF_XATTR) { X if (state->pflags & PF_HAS_XATTR) X str[i++] = '@'; X } else X if (has_xattr(f, sname)) X str[i++] = '@'; X#endif X i++; /* Make lint believe that we always use i. */ X} X XEXPORT void Xfind_list(std, fs, name, sname, state) X FILE *std[3]; /* To redirect stdin/stdout/err */ X struct stat *fs; /* Struct stat for this file */ X char *name; /* Complete path name */ X char *sname; /* Name to use for stat/readlink */ X struct WALK *state; /* state from treewalk() */ X{ X time_t *tp; X char *tstr; X char mstr[13]; /* 10 UNIX chars + ACL '+' XATTR '@' + nul */ X char lstr[11]; /* contains link count as string */ X static char nuid[32+1]; X static char ngid[32+1]; X char *add = ""; Xchar lname[8192]; Xchar *lnamep = lname; X int lsize; X X#define verbose 1 X if (verbose) { X char *uname; X char *gname; X int umaxlen; X int gmaxlen; X char ft; X X tp = state->walkflags & WALK_LS_ATIME ? &fs->st_atime : X (state->walkflags & WALK_LS_CTIME ? X &fs->st_ctime : &fs->st_mtime); X tstr = ctime(tp); X X if (ic_nameuid(nuid, sizeof (nuid), fs->st_uid)) { X uname = nuid; X umaxlen = sizeof (nuid)-1; X } else { X sprintf(nuid, "%llu", (Llong)fs->st_uid); X uname = nuid; X umaxlen = sizeof (nuid)-1; X } X X if (ic_namegid(ngid, sizeof (ngid), fs->st_gid)) { X gname = ngid; X gmaxlen = sizeof (ngid)-1; X } else { X sprintf(ngid, "%llu", (Llong)fs->st_gid); X gname = ngid; X gmaxlen = sizeof (ngid)-1; X } X X { X fprintf(std[1], "%7llu ", (Llong)fs->st_ino); X#ifdef HAVE_ST_BLOCKS X fprintf(std[1], "%4llu ", (Llong)fs->st_blocks/K_DIV); X#else X fprintf(std[1], "%4llu ", X (Llong)(fs->st_size+1023)/1024); X#endif X } X if (!paxls) { X if (S_ISBLK(fs->st_mode) || S_ISCHR(fs->st_mode)) X fprintf(std[1], "%3lu %3lu", X (long)major(fs->st_rdev), X (long)minor(fs->st_rdev)); X else X fprintf(std[1], "%7llu", (Llong)fs->st_size); X } X modstr(std[2], fs, mstr, name, sname, state); X X if (paxls || fs->st_nlink > 0) { X /* X * UNIX ls uses %3d for the link count X * and does not claim space for ACL '+' X */ X js_sprintf(lstr, " %2ld", (long)fs->st_nlink); X } else { X lstr[0] = 0; X } X X switch (fs->st_mode & S_IFMT) { X X case S_IFREG: ft = '-'; break; X#ifdef S_IFLNK X case S_IFLNK: ft = 'l'; X if (state->lname != NULL) { X lnamep = state->lname; X break; X } X lname[0] = '\0'; X lsize = readlink(sname, lname, sizeof (lname)); X if (lsize < 0) X ferrmsg(std[2], X _("Cannot read link '%s'.\n"), X name); X lname[sizeof (lname)-1] = '\0'; X if (lsize >= 0) X lname[lsize] = '\0'; X break; X#endif X case S_IFDIR: ft = 'd'; break; X#ifdef S_IFBLK X case S_IFBLK: ft = 'b'; break; X#endif X#ifdef S_IFCHR X case S_IFCHR: ft = 'c'; break; X#endif X#ifdef S_IFIFO X case S_IFIFO: ft = 'p'; break; X#endif X#ifdef S_IFDOOR X case S_IFDOOR: ft = 'D'; break; X#endif X#ifdef S_IFSOCK X case S_IFSOCK: ft = 's'; break; X#endif X#ifdef S_IFPORT X case S_IFPORT: ft = 'P'; break; X#endif X#ifdef S_IFNAM X case S_IFNAM: switch (fs->st_rdev) { X case S_INSEM: X ft = 's'; X break; X case S_INSHD: X ft = 'm'; X break; X default: X ft = '-'; X break; X } X#endif X X default: ft = '?'; break; X } X mstr[0] = ft; X X if (!paxls) { X fprintf(std[1], " %s%s %3.*s/%-3.*s %.12s %4.4s ", X mstr, X lstr, X umaxlen, uname, X gmaxlen, gname, X &tstr[4], &tstr[20]); X } else { X fprintf(std[1], "%s%s %-8.*s %-8.*s ", X mstr, X lstr, X umaxlen, uname, X gmaxlen, gname); X if (S_ISBLK(fs->st_mode) || S_ISCHR(fs->st_mode)) X/* XXXXXXXXXXXXXX */ fprintf(std[1], "%3lu, %3lu", X (long)major(fs->st_rdev), X (long)minor(fs->st_rdev)); X else X fprintf(std[1], "%7llu", (Llong)fs->st_size); X if ((*tp < find_sixmonth) || (*tp > find_now)) { X fprintf(std[1], " %.6s %4.4s ", X &tstr[4], &tstr[20]); X } else { X fprintf(std[1], " %.12s ", X &tstr[4]); X } X } X } X fprintf(std[1], "%s%s", name, add); X X if (S_ISLNK(fs->st_mode)) X fprintf(std[1], " -> %s", lnamep); X X fprintf(std[1], "\n"); X} END-of-star-1.6/libfind/find_list.c echo x - star-1.6/libfind/find_list.h sed 's/^X//' >star-1.6/libfind/find_list.h << 'END-of-star-1.6/libfind/find_list.h' X/* @(#)find_list.h 1.8 09/07/10 Copyright 2004-2008 J. Schilling */ X/* X * Copyright (c) 2004-2008 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _FIND_LIST_H X#define _FIND_LIST_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X#ifndef _SCHILY_STDIO_H X#include X#endif X Xextern void find_list __PR((FILE *std[3], struct stat *fs, char *name, char *sname, struct WALK *state)); X X#endif /* _FIND_LIST_H */ END-of-star-1.6/libfind/find_list.h echo x - star-1.6/libfind/find_misc.c sed 's/^X//' >star-1.6/libfind/find_misc.c << 'END-of-star-1.6/libfind/find_misc.c' X/* @(#)find_misc.c 1.16 15/09/12 Copyright 2004-2009 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)find_misc.c 1.16 15/09/12 Copyright 2004-2009 J. Schilling"; X#endif X/* X * Copyright (c) 2004-2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X#include X X#include "find_misc.h" X X#ifdef USE_ACL X#ifdef HAVE_SYS_ACL_H X# include X#endif X#ifdef HAVE_ACL_LIBACL_H X# include /* Needed for acl_extended_file() */ X#endif X#endif X X/* X * Define some things that either are missing or defined in a different way X * on SCO UnixWare X */ X#if defined(UNIXWARE) && defined(HAVE_ACL) Xtypedef struct acl aclent_t; X#endif X#ifndef GETACL X#define GETACL ACL_GET X#endif X#ifndef SETACL X#define SETACL ACL_SET X#endif X#ifndef GETACLCNT X#define GETACLCNT ACL_CNT X#endif X#ifndef MIN_ACL_ENTRIES X#define MIN_ACL_ENTRIES NACLBASE X#endif X XEXPORT BOOL has_acl __PR((FILE *f, char *name, char *sname, struct stat *sp)); XEXPORT BOOL has_xattr __PR((FILE *f, char *sname)); X XEXPORT BOOL Xhas_acl(f, name, sname, sp) X FILE *f; X char *name; X char *sname; X struct stat *sp; X{ X#ifdef USE_ACL X#ifdef HAVE_SUN_ACL /* Solaris & UnixWare */ X int aclcount; X X /* X * Symlinks don't have ACLs X */ X if (S_ISLNK(sp->st_mode)) X return (FALSE); X#ifdef HAVE_ST_ACLCNT X return (sp->st_aclcnt > MIN_ACL_ENTRIES); X#else X if ((aclcount = acl(sname, GETACLCNT, 0, NULL)) < 0) { X#ifdef ENOSYS X if (geterrno() == ENOSYS) X return (FALSE); X#endif X ferrmsg(f, _("Cannot get ACL count for '%s'.\n"), name); X return (FALSE); X } X return (aclcount > MIN_ACL_ENTRIES); X#endif /* HAVE_ST_ACLCNT */ X#else /* HAVE_SUN_ACL */ X /* X * Non Sun ACL implementations. X */ X#ifdef HAVE_ACL_EXTENDED_FILE X /* X * Linux extension X */ X return (acl_extended_file(sname) == 1); X#else X#ifdef HAVE_POSIX_ACL X acl_t acl; X X if ((acl = acl_get_file(sname, ACL_TYPE_ACCESS)) != NULL) { X#ifdef HAVEACL_GET_ENTRY X int id = ACL_FIRST_ENTRY; X int num; X acl_entry_t dummy; X X for (num = 0; acl_get_entry(acl, id, &dummy); num++) X id = ACL_NEXT_ENTRY; X acl_free(acl); X if (num > 3) X return (TRUE); X#else X#ifdef NACLBASE X if (acl->acl_cnt > NACLBASE) X return (TRUE); X#endif X#endif X } X /* X * Only directories have DEFAULT ACLs X */ X if (!S_ISDIR(sp->st_mode)) X return (FALSE); X if ((acl = acl_get_file(sname, ACL_TYPE_DEFAULT)) != NULL) { X#ifdef HAVEACL_GET_ENTRY X int id = ACL_FIRST_ENTRY; X int num; X acl_entry_t dummy; X X for (num = 0; acl_get_entry(acl, id, &dummy); num++) X id = ACL_NEXT_ENTRY; X acl_free(acl); X if (num > 0) X return (TRUE); X#else X#ifdef NACLBASE X if (acl->acl_cnt > NACLBASE) X return (TRUE); X#endif X#endif X } X#endif /* HAVE_POSIX_ACL */ X X return (FALSE); X X#endif X#endif /* HAVE_SUN_ACL */ X#else /* USE_ACL */ X return (FALSE); X#endif /* USE_ACL */ X} X XEXPORT BOOL Xhas_xattr(f, sname) X FILE *f; X char *sname; X{ X#ifdef _PC_XATTR_EXISTS X return (pathconf(sname, _PC_XATTR_EXISTS) > 0); X#else X return (FALSE); X#endif X} END-of-star-1.6/libfind/find_misc.c echo x - star-1.6/libfind/find_misc.h sed 's/^X//' >star-1.6/libfind/find_misc.h << 'END-of-star-1.6/libfind/find_misc.h' X/* @(#)find_misc.h 1.8 18/08/20 Copyright 2004-2018 J. Schilling */ X/* X * Copyright (c) 2004-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _FIND_MISC_H X#define _FIND_MISC_H X X#ifndef _SCHILY_MCONFIG_H X#include X#endif X#ifndef _SCHILY_UNIXSTD_H X#include X#endif X#ifndef _SCHILY_STDIO_H X#include X#endif X#ifndef _SCHILY_STAT_H X#include X#endif X X#if defined(UNIXWARE) && defined(HAVE_ACL) X# define HAVE_SUN_ACL X# define HAVE_ANY_ACL X#endif X X#ifdef USE_ACL X/* X * HAVE_ANY_ACL currently includes HAVE_POSIX_ACL and HAVE_SUN_ACL. X * HAVE_HP_ACL is currently not included in HAVE_ANY_ACL. X */ X# ifndef HAVE_ANY_ACL X# undef USE_ACL /* Do not try to get or set ACLs */ X# endif X#endif X X#ifdef USE_XATTR X#ifndef _PC_XATTR_EXISTS X#undef USE_XATTR X#endif X#endif X Xextern BOOL has_acl __PR((FILE *f, char *name, char *sname, struct stat *sp)); Xextern BOOL has_xattr __PR((FILE *f, char *sname)); X Xextern const char *parsetime __PR((const char *s, struct timespec *ts)); X X#endif /* _FIND_MISC_H */ END-of-star-1.6/libfind/find_misc.h echo x - star-1.6/libfind/find_main.c sed 's/^X//' >star-1.6/libfind/find_main.c << 'END-of-star-1.6/libfind/find_main.c' X/*#define PLUS_DEBUG*/ X/* @(#)find_main.c 1.74 18/10/29 Copyright 2004-2018 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)find_main.c 1.74 18/10/29 Copyright 2004-2018 J. Schilling"; X#endif X/* X * Another find implementation... X * X * Copyright (c) 2004-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X#include X#include /* To include __jmalloc() */ X#include X X#include X X#include X#include X#include "find_tok.h" X#include "version.h" X XLOCAL int walkfunc __PR((char *nm, struct stat *fs, int type, X struct WALK *state)); XLOCAL int getflg __PR((char *optstr, long *argp)); XEXPORT int find_main __PR((int ac, char **av, char **ev, X FILE *std[3], squit_t *quit)); X XLOCAL int Xwalkfunc(nm, fs, type, state) X char *nm; X struct stat *fs; X int type; X struct WALK *state; X{ X if (state->quitfun) { X /* X * Check for shell builtin signal abort condition. X */ X if ((*state->quitfun)(state->qfarg)) { X state->flags |= WALK_WF_QUIT; X return (0); X } X } X if (type == WALK_NS) { X ferrmsg(state->std[2], X _("Cannot stat '%s'.\n"), nm); X state->err = 1; X return (0); X } else if (type == WALK_SLN && (state->walkflags & WALK_PHYS) == 0) { X ferrmsg(state->std[2], X _("Cannot follow symlink '%s'.\n"), nm); X state->err = 1; X return (0); X } else if (type == WALK_DNR) { X if (state->flags & WALK_WF_NOCHDIR) { X ferrmsg(state->std[2], X _("Cannot chdir to '%s'.\n"), nm); X } else { X ferrmsg(state->std[2], X _("Cannot read '%s'.\n"), nm); X } X state->err = 1; X return (0); X } X X if (state->maxdepth >= 0 && state->level >= state->maxdepth) X state->flags |= WALK_WF_PRUNE; X if (state->mindepth >= 0 && state->level < state->mindepth) X return (0); X X find_expr(nm, nm + state->base, fs, state, state->tree); X return (0); X} X X X X/* ARGSUSED */ XLOCAL int Xgetflg(optstr, argp) X char *optstr; X long *argp; X{ X#ifdef GETFLG_DEBUG X error("optstr: '%s'\n", optstr); X#endif X X if (optstr[1] != '\0') X return (-1); X X switch (*optstr) { X X case 'H': X *(int *)argp |= WALK_ARGFOLLOW; X return (TRUE); X case 'L': X *(int *)argp |= WALK_ALLFOLLOW; X return (TRUE); X case 'P': X *(int *)argp &= ~(WALK_ARGFOLLOW | WALK_ALLFOLLOW); X return (TRUE); X X default: X return (-1); X } X} X XEXPORT int Xfind_main(ac, av, ev, std, quit) X int ac; X char **av; X char **ev; X FILE *std[3]; X squit_t *quit; X{ X int cac = ac; X char **cav = av; X char **firstpath; X char **firstprim; X BOOL help = FALSE; X BOOL prversion = FALSE; X finda_t fa; X findn_t *Tree; X struct WALK walkstate; X int oraise[3]; X int ret = 0; X int i; X X save_args(ac, av); X X#ifdef USE_NLS X setlocale(LC_ALL, ""); X bindtextdomain(TEXT_DOMAIN, "/opt/schily/lib/locale"); X#endif X find_argsinit(&fa); X for (i = 0; i < 3; i++) { X oraise[i] = file_getraise(std[i]); X file_raise(std[i], FALSE); X fa.std[i] = std[i]; X } X fa.walkflags = 0; X fa.walkflags |= WALK_CHDIR; /* Change directory while traversing */ X fa.walkflags |= WALK_PHYS; /* Use lstat() to check files */ X fa.walkflags |= WALK_NOSTAT; /* Try to avoid lstst()/stat() calls */ X fa.walkflags |= WALK_NOEXIT; /* Do not call exit() but return */ X if (quit && quit->flags & SQ_CALL) X fa.callfun = quit->callfun; X X /* X * Do not check the return code for getargs() as we may get an error X * code from e.g. "find -print" and we do not like to handle this here. X */ X cac--, cav++; X getargs(&cac, (char * const **)&cav, "help,version,&", X &help, &prversion, X getflg, (long *)&fa.walkflags); X if (help) { X find_usage(std[2]); X goto out; X } X if (prversion) { X fprintf(std[1], X "sfind release %s %s (%s-%s-%s) Copyright (C) 2004-2018 Jörg Schilling\n", X find_strvers(), VERSION_DATE, X HOST_CPU, HOST_VENDOR, HOST_OS); X goto out; X } X X firstpath = cav; /* Remember first file type arg */ X find_firstprim(&cac, (char *const **)&cav); X firstprim = cav; /* Remember first Primary type arg */ X fa.Argv = cav; X fa.Argc = cac; X X if (cac) { X Tree = find_parse(&fa); X if (fa.primtype == FIND_ERRARG) { X find_free(Tree, &fa); X ret = fa.error; X goto out; X } X if (fa.primtype != FIND_ENDARGS) { X ferrmsgno(std[2], EX_BAD, X _("Incomplete expression.\n")); X find_free(Tree, &fa); X ret = EX_BAD; X goto out; X } X#ifndef CHFILE X if (find_pname(Tree, "-chown") || find_pname(Tree, "-chgrp") || X find_pname(Tree, "-chmod")) { X ferrmsgno(std[2], EX_BAD, X _("Unsupported primary -chown/-chgrp/-chmod.\n")); X find_free(Tree, &fa); X ret = EX_BAD; X goto out; X } X#endif X } else { X Tree = 0; X } X if (Tree == 0) { X Tree = find_printnode(); X } else if (!fa.found_action) { X Tree = find_addprint(Tree, &fa); X if (Tree == (findn_t *)NULL) { X ret = geterrno(); X goto out; X } X } X walkinitstate(&walkstate); X for (i = 0; i < 3; i++) X walkstate.std[i] = std[i]; X if (ev) X walkstate.env = ev; X if (quit) { X walkstate.quitfun = quit->quitfun; X walkstate.qfarg = quit->qfarg; X } X if (fa.patlen > 0) { X walkstate.patstate = __fjmalloc(std[2], X sizeof (int) * fa.patlen, X "space for pattern state", JM_RETURN); X if (walkstate.patstate == NULL) { X ret = geterrno(); X goto out; X } X } X X find_timeinit(time(0)); X X walkstate.walkflags = fa.walkflags; X walkstate.maxdepth = fa.maxdepth; X walkstate.mindepth = fa.mindepth; X walkstate.lname = NULL; X walkstate.tree = Tree; X walkstate.err = 0; X walkstate.pflags = 0; X X if (firstpath == firstprim) { X treewalk(".", walkfunc, &walkstate); X } else { X for (cav = firstpath; cav != firstprim; cav++) { X treewalk(*cav, walkfunc, &walkstate); X /* X * XXX hier break wenn treewalk() Fehler gemeldet X */ X } X } X /* X * Execute all unflushed '-exec .... {} +' expressions. X */ X find_plusflush(fa.plusp, &walkstate); X find_free(Tree, &fa); X if (walkstate.patstate != NULL) X free(walkstate.patstate); X ret = walkstate.err; X Xout: X for (i = 0; i < 3; i++) { X fflush(std[i]); X if (ferror(std[i])) X clearerr(std[i]); X file_raise(std[i], oraise[i]); X } X return (ret); X} END-of-star-1.6/libfind/find_main.c echo x - star-1.6/libfind/libfind-mapvers sed 's/^X//' >star-1.6/libfind/libfind-mapvers << 'END-of-star-1.6/libfind/libfind-mapvers' X# /* @(#)libfind-mapvers 1.15 18/08/30 Copyright 2005-2018 J. Schilling */ X X/* X * Due to a bug in the the C-Preprocessor from SunPro C, we get a syntax X * error in case there is a word with more than one dot inside. X * Making it a string helps and seems to be accepted by the UNIX linker. X * Unfortunately, the GNU linker does not like them, so we run the result X * through tr -d '"' X */ X"SCHILY_0.9.2" { # Not yet a stable interface! Xglobal: X find_strvers; # find.c X find_vers; # find.c X} "SCHILY_0.9.1"; X X"SCHILY_0.9.1" { # Not yet a stable interface! Xglobal: X find_argsinit; # find.c moved here to enforce a higher version X find_parse; # find.c moved here to enforce a higher version X find_sqinit; # find.c X treewalk; # walk.c moved here to enforce a higher version X walkcwd; # walk.c X} SCHILY_0.9; X XSCHILY_0.9 { # Not yet a stable interface! Xglobal: X#ifdef __old_compat__ X find_argsinit; # X find_parse; # X#endif X find_free; # X} SCHILY_0.2; X XSCHILY_0.2 { # Not yet a stable interface! Xglobal: X find_hasexec; # find.c X find_hasprint; # find.c X} SCHILY_0.1; X XSCHILY_0.1 { # Not yet a stable interface! Xglobal: X dfetchdir; # fetchdir.c X fetchdir; # fetchdir.c X cmpdir; # cmpdir.c X sortdir; # cmpdir.c X fdircomp; # cmpdir.c X find_addprint; # find.c X#ifdef __old_compat__ X find_argsinit; # find.c X find_free; # find.c X find_parse; # find.c X#endif X find_expr; # find.c X find_firstprim; # find.c X find_list; # find_list.c X find_main; # find_main.c X find_plusflush; # find.c X find_pname; # find.c X find_primary; # find.c X find_printnode; # find.c X find_timeinit; # find.c X find_tname; # find.c X find_token; # find.c X find_usage; # find.c X has_acl; # find_misc.c X has_xattr; # find_misc.c X#ifdef __old_compat__ X treewalk; # walk.c X#endif X walkopen; # walk.c X walkclose; # walk.c X walkhome; # walk.c X walkgethome; # walk.c X walkinitstate; # walk.c X ic_gidname; # idcache.c X ic_namegid; # idcache.c X ic_nameuid; # idcache.c X ic_uidname; # idcache.c X ic_uid_nobody; # idcache.c X ic_gid_nobody; # idcache.c X Xlocal: X *; X}; END-of-star-1.6/libfind/libfind-mapvers echo x - star-1.6/libfind/libfind.mk sed 's/^X//' >star-1.6/libfind/libfind.mk << 'END-of-star-1.6/libfind/libfind.mk' X#ident @(#)libfind.mk 1.4 15/09/12 X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X X#.SEARCHLIST: . $(ARCHDIR) stdio $(ARCHDIR) X#VPATH= .:stdio:$(ARCHDIR) XINSDIR= lib XTARGETLIB= find X#CPPOPTS += -Istdio X#CPPOPTS += -DUSE_SCANSTACK X X#CPPOPTS += -D__FIND__ XCPPOPTS += -DUSE_LARGEFILES XCPPOPTS += -DUSE_ACL XCPPOPTS += -DUSE_XATTR XCPPOPTS += -DUSE_NLS XCPPOPTS += -DUSE_DGETTEXT # _() -> dgettext() XCPPOPTS += -DTEXT_DOMAIN=\"SCHILY_FIND\" XCPPOPTS += -DSCHILY_PRINT X Xinclude Targets XLIBS= X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.lib X########################################################################### X END-of-star-1.6/libfind/libfind.mk echo x - star-1.6/libfind/libfind_p.mk sed 's/^X//' >star-1.6/libfind/libfind_p.mk << 'END-of-star-1.6/libfind/libfind_p.mk' X#ident @(#)libfind_p.mk 1.5 15/09/12 X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XSUBARCHDIR= /profiled XSUBINSDIR= /profiled X#.SEARCHLIST: . $(ARCHDIR) stdio $(ARCHDIR) X#VPATH= .:stdio:$(ARCHDIR) XINSDIR= lib XTARGETLIB= find XCOPTS += $(COPTGPROF) X#CPPOPTS += -Istdio X#CPPOPTS += -DUSE_SCANSTACK X X#CPPOPTS += -D__FIND__ XCPPOPTS += -DUSE_LARGEFILES XCPPOPTS += -DUSE_ACL XCPPOPTS += -DUSE_XATTR XCPPOPTS += -DUSE_NLS XCPPOPTS += -DUSE_DGETTEXT # _() -> dgettext() XCPPOPTS += -DTEXT_DOMAIN=\"SCHILY_FIND\" XCPPOPTS += -DSCHILY_PRINT X Xinclude Targets XLIBS= X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.lib X########################################################################### END-of-star-1.6/libfind/libfind_p.mk echo x - star-1.6/libfind/idcache.c sed 's/^X//' >star-1.6/libfind/idcache.c << 'END-of-star-1.6/libfind/idcache.c' X/* @(#)idcache.c 1.32 18/05/20 Copyright 1993, 1995-2018 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)idcache.c 1.32 18/05/20 Copyright 1993, 1995-2018 J. Schilling"; X#endif X/* X * UID/GID caching functions X * X * Copyright (c) 1993, 1995-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X#include X X#define TUNMLEN 32 /* Max. UID name len (POSIX) */ X#define TGNMLEN 32 /* Max. GID name len (POSIX) */ X X#define C_SIZE 16 /* Cache size (cache is static) */ X Xtypedef struct u_id { X uid_t uid; X char name[TUNMLEN+1]; X char valid; X} uidc_t; X Xtypedef struct g_id { X gid_t gid; X char name[TGNMLEN+1]; X char valid; X} gidc_t; X XLOCAL uidc_t uidcache[C_SIZE]; XLOCAL int lastuidx; /* Last index for new entry */ X XLOCAL gidc_t gidcache[C_SIZE]; XLOCAL int lastgidx; /* Last index for new entry */ X XLOCAL uid_t _uid_nobody; /* Uid for user "nobody" */ XLOCAL gid_t _gid_nobody; /* Gid for user "nobody" */ XLOCAL BOOL name_init = FALSE; X XEXPORT BOOL ic_nameuid __PR((char *name, int namelen, uid_t uid)); XEXPORT BOOL ic_uidname __PR((char *name, int namelen, uid_t *uidp)); XEXPORT BOOL ic_namegid __PR((char *name, int namelen, gid_t gid)); XEXPORT BOOL ic_gidname __PR((char *name, int namelen, gid_t *gidp)); XLOCAL void nameinit __PR((void)); XEXPORT uid_t ic_uid_nobody __PR((void)); XEXPORT gid_t ic_gid_nobody __PR((void)); XLOCAL BOOL nameascii __PR((char *name)); X X/* X * Get name from uid X */ X#ifdef PROTOTYPES XEXPORT BOOL Xic_nameuid(char *name, int namelen, uid_t uid) X#else XEXPORT BOOL Xic_nameuid(name, namelen, uid) X char *name; X int namelen; X uid_t uid; X#endif X{ X struct passwd *pw; X register int i; X register uidc_t *idp; X X for (i = 0, idp = uidcache; i < C_SIZE; i++, idp++) { X if (idp->valid == 0) { /* Entry not yet filled */ X lastuidx = i; X goto fill; X } X if (idp->uid == uid) X goto out; X } X idp = &uidcache[lastuidx++]; /* Round robin fill next ent */ X if (lastuidx >= C_SIZE) X lastuidx = 0; X Xfill: X idp->uid = uid; X idp->name[0] = '\0'; X idp->valid = 1; X if ((pw = getpwuid(uid)) != NULL) { X strlcpy(idp->name, pw->pw_name, sizeof (idp->name)); X if (!nameascii(idp->name)) X idp->valid = 3; /* Mark name as non-ASCII */ X } Xout: X strlcpy(name, idp->name, namelen); X if (name[0] != '\0') X return (idp->valid); X return (FALSE); X} X X/* X * Get uid from name X */ XEXPORT BOOL Xic_uidname(name, namelen, uidp) X char *name; X int namelen; X uid_t *uidp; X{ X struct passwd *pw; X register int len = namelen > TUNMLEN?TUNMLEN:namelen; X register int i; X register uidc_t *idp; X X if (name[0] == '\0') { X *uidp = ic_uid_nobody(); /* Return UID_NOBODY */ X return (FALSE); X } X X for (i = 0, idp = uidcache; i < C_SIZE; i++, idp++) { X if (idp->valid == 0) { /* Entry not yet filled */ X lastuidx = i; X goto fill; X } X if (name[0] == idp->name[0] && X strncmp(name, idp->name, len) == 0) { X *uidp = idp->uid; X if (idp->valid == 2) { /* Name not found */ X *uidp = ic_uid_nobody(); /* Return UID_NOBODY */ X return (FALSE); X } X return (TRUE); X } X } X idp = &uidcache[lastuidx++]; /* Round robin fill next ent */ X if (lastuidx >= C_SIZE) X lastuidx = 0; X Xfill: X idp->uid = 0; X idp->name[0] = '\0'; X strlcpy(idp->name, name, len+1); /* uidc_t.name is TUNMLEN+1 */ X idp->valid = 1; X if ((pw = getpwnam(idp->name)) != NULL) { X idp->uid = pw->pw_uid; X *uidp = idp->uid; X if (!nameascii(idp->name)) X idp->valid = 3; /* Mark name as non-ASCII */ X return (TRUE); X } else { X idp->valid = 2; /* Mark name as not found */ X *uidp = ic_uid_nobody(); /* Return UID_NOBODY */ X return (FALSE); X } X} X X/* X * Get name from gid X */ X#ifdef PROTOTYPES XEXPORT BOOL Xic_namegid(char *name, int namelen, gid_t gid) X#else XEXPORT BOOL Xic_namegid(name, namelen, gid) X char *name; X int namelen; X gid_t gid; X#endif X{ X struct group *gr; X register int i; X register gidc_t *idp; X X for (i = 0, idp = gidcache; i < C_SIZE; i++, idp++) { X if (idp->valid == 0) { /* Entry not yet filled */ X lastgidx = i; X goto fill; X } X if (idp->gid == gid) X goto out; X } X idp = &gidcache[lastgidx++]; /* Round robin fill next ent */ X if (lastgidx >= C_SIZE) X lastgidx = 0; X Xfill: X idp->gid = gid; X idp->name[0] = '\0'; X idp->valid = 1; X if ((gr = getgrgid(gid)) != NULL) { X strlcpy(idp->name, gr->gr_name, sizeof (idp->name)); X if (!nameascii(idp->name)) X idp->valid = 3; /* Mark name as non-ASCII */ X } Xout: X strlcpy(name, idp->name, namelen); X if (name[0] != '\0') X return (idp->valid); X return (FALSE); X} X X/* X * Get gid from name X */ XEXPORT BOOL Xic_gidname(name, namelen, gidp) X char *name; X int namelen; X gid_t *gidp; X{ X struct group *gr; X register int len = namelen > TGNMLEN?TGNMLEN:namelen; X register int i; X register gidc_t *idp; X X if (name[0] == '\0') { X *gidp = ic_gid_nobody(); /* Return GID_NOBODY */ X return (FALSE); X } X X for (i = 0, idp = gidcache; i < C_SIZE; i++, idp++) { X if (idp->valid == 0) { /* Entry not yet filled */ X lastgidx = i; X goto fill; X } X if (name[0] == idp->name[0] && X strncmp(name, idp->name, len) == 0) { X *gidp = idp->gid; X if (idp->valid == 2) { /* Name not found */ X *gidp = ic_gid_nobody(); /* Return GID_NOBODY */ X return (FALSE); X } X return (TRUE); X } X } X idp = &gidcache[lastgidx++]; /* Round robin fill next ent */ X if (lastgidx >= C_SIZE) X lastgidx = 0; X Xfill: X idp->gid = 0; X idp->name[0] = '\0'; X strlcpy(idp->name, name, len+1); /* gidc_t.name is TGNMLEN+1 */ X idp->valid = 1; X if ((gr = getgrnam(idp->name)) != NULL) { X idp->gid = gr->gr_gid; X *gidp = idp->gid; X if (!nameascii(idp->name)) X idp->valid = 3; /* Mark name as non-ASCII */ X return (TRUE); X } else { X idp->valid = 2; /* Mark name as not found */ X *gidp = ic_gid_nobody(); /* Return GID_NOBODY */ X return (FALSE); X } X} X X#include X X#ifndef UID_NOBODY X#define UID_NOBODY 65534 /* The old SunOS-4.x and *BSD value */ X#endif X#ifndef GID_NOBODY X#define GID_NOBODY 65534 /* The old SunOS-4.x and *BSD value */ X#endif X XLOCAL void Xnameinit() X{ X char *name; X int namelen; X uid_t uid; X gid_t gid; X X /* X * Make sure that uidname()/gidname() do not call nameinit(). X */ X name_init = TRUE; X X name = "nobody"; X namelen = strlen(name); X if (!ic_uidname(name, namelen, &uid)) X uid = UID_NOBODY; X _uid_nobody = uid; X X if (!ic_gidname(name, namelen, &gid)) X gid = GID_NOBODY; X _gid_nobody = gid; X} X XEXPORT uid_t Xic_uid_nobody() X{ X if (!name_init) X nameinit(); X return (_uid_nobody); X} X XEXPORT gid_t Xic_gid_nobody() X{ X if (!name_init) X nameinit(); X return (_gid_nobody); X} X XLOCAL BOOL Xnameascii(name) X register char *name; X{ X register unsigned char c; X while ((c = (unsigned char)*name++) != '\0') { X if (c > 127) X return (FALSE); X } X return (TRUE); X} END-of-star-1.6/libfind/idcache.c echo x - star-1.6/libfind/walk.c sed 's/^X//' >star-1.6/libfind/walk.c << 'END-of-star-1.6/libfind/walk.c' X/* @(#)walk.c 1.59 18/10/28 Copyright 2004-2018 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)walk.c 1.59 18/10/28 Copyright 2004-2018 J. Schilling"; X#endif X/* X * Walk a directory tree X * X * Copyright (c) 2004-2018 J. Schilling X * X * In order to make treewalk() thread safe, we need to make it to not use X * chdir(2)/fchdir(2) which is process global. X * X * chdir(newdir) -> old = dfd; X * dfd = openat(old, newdir, O_RDONLY); X * close(old) X * fchdir(dd) -> close(dfd); dfd = dd; X * stat(name) -> fstatat(dfd, name, statb, 0) X * lstat(name) -> fstatat(dfd, name, statb, AT_SYMLINK_NOFOLLOW) X * opendir(dname) -> dd = openat(dfd, dname, O_RDONLY); X * dir = fdopendir(dd); X * X * Similar changes need to be introduced in fetchdir(). X * X * For an optimized version, we need to have: X * X * dirfd() or DIR->dd_fd To fetch a fd from a DIR * X * and opendir() X * X * fchdir() To change towards and backdwards directories X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#ifdef HAVE_FCHDIR X#include X#else X#include X#endif X#include /* NODEV */ X#include X#include X#include X#include X#include X#include X#include X#include X#include X#include X#include X X#if (defined(HAVE_DIRFD) || defined(HAVE_DIR_DD_FD)) && defined(HAVE_FCHDIR) X#define USE_DIRFD /* Use fchdir() to traverse the tree */ X#endif X X#ifndef _AT_TRIGGER X#define _AT_TRIGGER 0 X#endif X X#ifndef ENAMETOOLONG X#define ENAMETOOLONG EINVAL X#endif X X#if defined(IS_MACOS_X) && defined(HAVE_CRT_EXTERNS_H) X/* X * The MAC OS X linker does not grok "common" varaibles. X * We need to fetch the address of "environ" using a hack. X */ X#include X#define environ *_NSGetEnviron() X#else Xextern char **environ; X#endif X X#ifndef HAVE_LSTAT X#define lstat stat X#endif X#ifndef HAVE_DECL_STAT Xextern int stat __PR((const char *, struct stat *)); X#endif X#ifndef HAVE_DECL_LSTAT Xextern int lstat __PR((const char *, struct stat *)); X#endif X X#define IS_UFS(p) ((p)[0] == 'u' && \ X (p)[1] == 'f' && \ X (p)[2] == 's' && \ X (p)[3] == '\0') X#define IS_ZFS(p) ((p)[0] == 'z' && \ X (p)[1] == 'f' && \ X (p)[2] == 's' && \ X (p)[3] == '\0') X X#define DIR_INCR 1024 /* How to increment Curdir size */ X#define TW_MALLOC 0x01 /* Struct was allocated */ Xstruct twvars { X char *Curdir; /* The current path name */ X int Curdtail; /* Where to append to Curdir */ X int Curdlen; /* Current size of 'Curdir' */ X int Flags; /* Flags related to this struct */ X struct WALK *Walk; /* Backpointer to struct WALK */ X struct stat Sb; /* stat(2) buffer for start dir */ X struct pdirs *pdirs; /* Previous dirs for walkcwd() */ X#ifdef HAVE_FCHDIR X int Home; /* open fd to start CWD */ X#else X char Home[MAXPATHNAME+1]; /* Abspath to start CWD */ X#endif X}; X Xstruct pdirs { X struct pdirs *p_last; /* Previous node in list */ X DIR *p_dir; /* Open directory for this one */ X struct twvars *p_varp; /* Pointer to "Curdir" path */ X dev_t p_dev; /* st_dev for this dir */ X ino_t p_ino; /* st_ino for this dir */ X BOOL p_stat; /* Need to call stat always */ X nlink_t p_nlink; /* Number of subdirs to stat */ X}; X X Xtypedef int (*statfun) __PR((const char *_nm, struct stat *_fs, X struct pdirs *_pd)); Xtypedef DIR *(*opendirfun) __PR((const char *_nm, struct pdirs *_pd)); X XEXPORT int treewalk __PR((char *nm, walkfun fn, X struct WALK *_state)); XLOCAL int walk __PR((char *nm, statfun sf, walkfun fn, X struct WALK *state, X struct pdirs *last)); XLOCAL int incr_dspace __PR((FILE *f, struct twvars *varp, int amt)); XEXPORT void walkinitstate __PR((struct WALK *_state)); XEXPORT void *walkopen __PR((struct WALK *_state)); XEXPORT int walkgethome __PR((struct WALK *_state)); XEXPORT int walkhome __PR((struct WALK *_state)); XEXPORT int walkclose __PR((struct WALK *_state)); XLOCAL int xchdotdot __PR((struct pdirs *last, int tail, X struct WALK *_state)); XLOCAL int xchdir __PR((char *p)); X XLOCAL int wstat __PR((const char *nm, struct stat *sp, X struct pdirs *pd)); XLOCAL int wlstat __PR((const char *nm, struct stat *sp, X struct pdirs *pd)); X XLOCAL int wdstat __PR((const char *nm, struct stat *sp, X struct pdirs *pd)); XLOCAL int wdlstat __PR((const char *nm, struct stat *sp, X struct pdirs *pd)); X X#ifdef USE_DIRFD XLOCAL DIR *nopendir __PR((const char *name, struct pdirs *pd)); XLOCAL DIR *dopendir __PR((const char *name, struct pdirs *pd)); X#endif X XEXPORT int Xtreewalk(nm, fn, state) X char *nm; /* The name to start walking */ X walkfun fn; /* The function to call for each node */ X struct WALK *state; /* Walk state */ X{ X struct twvars vars; X statfun statf = wstat; X int nlen; X X#ifndef USE_DIRFD X /* X * If we have no dirfd(), we currently cannot implement X * the walk mode without chdir(). This mainly excludes DOS. X */ X if ((state->walkflags & WALK_CHDIR) == 0) { X seterrno(EINVAL); X return (-1); X } X#endif X X vars.Curdir = NULL; X vars.Curdlen = 0; X vars.Curdtail = 0; X vars.Flags = 0; X#ifdef HAVE_FCHDIR X vars.Home = -1; X#endif X state->twprivate = &vars; X vars.Walk = state; X if (walkgethome(state) < 0) { X state->twprivate = NULL; X return (-1); X } X X if (nm == NULL || nm[0] == '\0') { X nm = "."; X } else if (state->walkflags & WALK_STRIPLDOT) { X while (nm[0] == '.' && nm[1] == '/') { X for (nm++; nm[0] == '/'; nm++) X /* LINTED */ X ; X } X if (nm[0] == '\0') X nm = "."; X } X X vars.Curdir = __fjmalloc(state->std[2], X DIR_INCR, "path buffer", JM_RETURN); X if (vars.Curdir == NULL) X return (-1); X vars.Curdir[0] = 0; X vars.Curdlen = DIR_INCR; X /* X * If initial Curdir space is not sufficient, expand it. X */ X nlen = strlen(nm); X if ((vars.Curdlen - 2) < nlen) X if (incr_dspace(state->std[2], &vars, nlen + 2) < 0) X return (-1); X X while (lstat(nm, &vars.Sb) < 0 && geterrno() == EINTR) X ; X X state->flags = 0; X state->base = 0; X state->level = 0; X X if ((state->walkflags & WALK_CHDIR) == 0) { X statf = wdstat; X if (state->walkflags & WALK_PHYS) X statf = wdlstat; X X if (state->walkflags & (WALK_ARGFOLLOW|WALK_ALLFOLLOW)) X statf = wdstat; X } else { X if (state->walkflags & WALK_PHYS) X statf = wlstat; X X if (state->walkflags & (WALK_ARGFOLLOW|WALK_ALLFOLLOW)) X statf = wstat; X } X X nlen = walk(nm, statf, fn, state, (struct pdirs *)0); X walkhome(state); X walkclose(state); X X free(vars.Curdir); X state->twprivate = NULL; X return (nlen); X} X XLOCAL int Xwalk(nm, sf, fn, state, last) X char *nm; /* The current name for the walk */ X statfun sf; /* stat() or lstat() */ X walkfun fn; /* The function to call for each node */ X struct WALK *state; /* For communication with (*fn)() */ X struct pdirs *last; /* This helps to avoid loops */ X{ X struct pdirs thisd; X struct stat fs; X int type; X int ret; X int otail; X char *p; X struct twvars *varp = state->twprivate; X X varp->pdirs = last; X#ifdef USE_DIRFD X thisd.p_dir = (DIR *)NULL; X#endif X thisd.p_varp = varp; X otail = varp->Curdtail; X state->base = otail; X if (varp->Curdtail == 0 || varp->Curdir[varp->Curdtail-1] == '/') { X if (varp->Curdtail == 0 && X (state->walkflags & WALK_STRIPLDOT) && X (nm[0] == '.' && nm[1] == '\0')) { X varp->Curdir[0] = '.'; X varp->Curdir[1] = '\0'; X } else { X p = strcatl(&varp->Curdir[varp->Curdtail], nm, X (char *)0); X varp->Curdtail = p - varp->Curdir; X } X } else { X p = strcatl(&varp->Curdir[varp->Curdtail], "/", nm, (char *)0); X varp->Curdtail = p - varp->Curdir; X state->base++; X } X X if ((state->walkflags & WALK_NOSTAT) && X ( X#ifdef HAVE_DIRENT_D_TYPE X (state->flags & WALK_WF_NOTDIR) || X#endif X (last != NULL && !last->p_stat && last->p_nlink <= 0))) { X /* X * Set important fields to useful values to make sure that X * no wrong information is evaluated in the no stat(2) case. X */ X fs.st_mode = 0; X fs.st_ino = 0; X fs.st_dev = NODEV; X fs.st_nlink = 0; X fs.st_size = 0; X X type = WALK_F; X state->flags = 0; X X goto type_known; X } else { X while ((ret = (*sf)(nm, &fs, last)) < 0 && geterrno() == EINTR) X ; X } X state->flags = 0; X if (ret >= 0) { X#ifdef HAVE_ST_FSTYPE X /* X * Check for autofs mount points... X */ X if (fs.st_fstype[0] == 'a' && X strcmp(fs.st_fstype, "autofs") == 0) { X int f = open(nm, O_RDONLY|O_NDELAY); X if (f < 0) { X type = WALK_DNR; X } else { X if (fstat(f, &fs) < 0) X type = WALK_NS; X close(f); X } X } X#endif X if (S_ISDIR(fs.st_mode)) { X type = WALK_D; X if (last != NULL && !last->p_stat && last->p_nlink > 0) X last->p_nlink--; X } else if (S_ISLNK(fs.st_mode)) X type = WALK_SL; X else X type = WALK_F; X } else { X int err = geterrno(); X statfun sp; /* lstat() or fstatat(AT_SYMLINK_NOFOLLOW) */ X X if ((state->walkflags & WALK_CHDIR) == 0) X sp = wdlstat; X else X sp = wlstat; X while ((ret = (*sp)(nm, &fs, last)) < 0 && geterrno() == EINTR) X ; X if (ret >= 0 && X S_ISLNK(fs.st_mode)) { X seterrno(err); X /* X * Found symbolic link that points to nonexistent file. X */ X ret = (*fn)(varp->Curdir, &fs, WALK_SLN, state); X goto out; X } else { X /* X * Found unknown file type because lstat() failed. X */ X ret = (*fn)(varp->Curdir, &fs, WALK_NS, state); X goto out; X } X } X if ((state->walkflags & WALK_MOUNT) != 0 && X varp->Sb.st_dev != fs.st_dev) { X ret = 0; X goto out; X } X Xtype_known: X if (type == WALK_D) { X BOOL need_cd = !(nm[0] == '.' && nm[1] == '\0'); X struct pdirs *pd = last; X#ifdef USE_DIRFD X opendirfun opendirp = nopendir; X#endif X X ret = 0; X if ((state->walkflags & WALK_CHDIR) == 0) { X if ((state->walkflags & (WALK_PHYS|WALK_ALLFOLLOW)) == X WALK_PHYS) { X sf = wdlstat; X } X need_cd = FALSE; X#ifdef USE_DIRFD X opendirp = dopendir; X#endif X } else if ((state->walkflags & (WALK_PHYS|WALK_ALLFOLLOW)) == X WALK_PHYS) { X sf = wlstat; X } X X /* X * Search parent dir structure for possible loops. X * If a loop is found, do not descend. X */ X thisd.p_last = last; X thisd.p_dev = fs.st_dev; X thisd.p_ino = fs.st_ino; X if (state->walkflags & WALK_NOSTAT && fs.st_nlink >= 2) { X thisd.p_stat = FALSE; X thisd.p_nlink = fs.st_nlink - 2; X#ifdef HAVE_ST_FSTYPE X if (!IS_UFS(fs.st_fstype) && X !IS_ZFS(fs.st_fstype)) X thisd.p_stat = TRUE; X#else X thisd.p_stat = TRUE; /* Safe fallback */ X#endif X } else { X thisd.p_stat = TRUE; X thisd.p_nlink = 1; X } X X while (pd) { X if (pd->p_dev == fs.st_dev && X pd->p_ino == fs.st_ino) { X /* X * Found a directory that has been previously X * visited already. This may happen with hard X * linked directories. We found a loop, so do X * not descend this directory. X */ X ret = (*fn)(varp->Curdir, &fs, WALK_DP, state); X goto out; X } X pd = pd->p_last; X } X X if ((state->walkflags & WALK_XDEV) != 0 && X varp->Sb.st_dev != fs.st_dev) { X /* X * A directory that is a mount point. Report and return. X */ X ret = (*fn)(varp->Curdir, &fs, type, state); X goto out; X } X if ((state->walkflags & WALK_DEPTH) == 0) { X /* X * Found a directory, check the content past this dir. X */ X ret = (*fn)(varp->Curdir, &fs, type, state); X X if (state->flags & WALK_WF_PRUNE) X goto out; X } X X#ifdef USE_DIRFD X thisd.p_dir = (*opendirp)(nm, last); X /* X * If we are out of fd's, close the directory above and X * try again. X */ X if (thisd.p_dir == (DIR *)NULL && geterrno() == EMFILE) { X if (last != NULL && last->p_dir) { X closedir(last->p_dir); X last->p_dir = (DIR *)NULL; X } X thisd.p_dir = (*opendirp)(nm, last); X } X /* X * Check whether we opened the same file as we expect. X */ X if ((state->walkflags & WALK_NOSTAT) == 0) { X struct stat fs2; X if (thisd.p_dir && X (fstat(dirfd(thisd.p_dir), &fs2) < 0 || X fs2.st_ino != fs.st_ino || X fs2.st_dev != fs.st_dev)) { X seterrno(EAGAIN); X ret = -1; X goto out; X } X } X if (need_cd && X thisd.p_dir != NULL && fchdir(dirfd(thisd.p_dir)) < 0) { X#else X if (need_cd && chdir(nm) < 0) { X#endif X state->flags |= WALK_WF_NOCHDIR; X /* X * Found a directory that does not allow chdir() into. X */ X ret = (*fn)(varp->Curdir, &fs, WALK_DNR, state); X state->flags &= ~WALK_WF_NOCHDIR; X goto out; X } else { X char *dp; X char *odp; X int nents; X int Dspace; X X /* X * Add space for '/' & '\0' X */ X Dspace = varp->Curdlen - varp->Curdtail - 2; X X#ifdef USE_DIRFD X if (thisd.p_dir == NULL || X (dp = dfetchdir(thisd.p_dir, ".", X &nents, NULL, NULL)) == NULL) { X#else X if ((dp = fetchdir(".", &nents, NULL, NULL)) == NULL) { X#endif X /* X * Found a directory that cannot be read. X */ X ret = (*fn)(varp->Curdir, &fs, WALK_DNR, state); X goto skip; X } X X odp = dp; X while (nents > 0 && ret == 0) { X register char *name; X register int nlen; X X name = &dp[1]; X nlen = strlen(name); X X if (Dspace < nlen) { X int incr = incr_dspace(state->std[2], X varp, nlen + 2); X if (incr < 0) { X ret = -1; X break; X } X Dspace += incr; X } X#ifdef HAVE_DIRENT_D_TYPE X if (dp[0] != FDT_DIR && dp[0] != FDT_UNKN) X state->flags |= WALK_WF_NOTDIR; X#endif X state->level++; X ret = walk(name, sf, fn, state, &thisd); X state->level--; X X if (state->flags & WALK_WF_QUIT) X break; X nents--; X dp += nlen +2; X } X free(odp); X skip: X#ifdef USE_DIRFD X if (thisd.p_dir) { X closedir(thisd.p_dir); X thisd.p_dir = (DIR *)NULL; X } X#endif X if (need_cd && state->level > 0 && xchdotdot(last, X otail, state) < 0) { X ret = geterrno(); X state->flags |= WALK_WF_NOHOME; X if ((state->walkflags & WALK_NOMSG) == 0) { X ferrmsg(state->std[2], X _( X "Cannot chdir to '..' from '%s/'.\n"), X varp->Curdir); X } X if ((state->walkflags & WALK_NOEXIT) == 0) X comexit(ret); X ret = -1; X goto out; X } X if (ret < 0) /* Do not call callback */ X goto out; /* func past fatal errors */ X } X if ((state->walkflags & WALK_DEPTH) != 0) { X if (varp->Curdtail == 0 && X (state->walkflags & WALK_STRIPLDOT) && X (nm[0] == '.' && nm[1] == '\0')) { X varp->Curdir[0] = '.'; X varp->Curdir[1] = '\0'; X } X ret = (*fn)(varp->Curdir, &fs, type, state); X } X } else { X /* X * Any other non-directory and non-symlink file type. X */ X ret = (*fn)(varp->Curdir, &fs, type, state); X } Xout: X#ifdef USE_DIRFD X if (thisd.p_dir) X closedir(thisd.p_dir); X#endif X varp->Curdir[otail] = '\0'; X varp->Curdtail = otail; X return (ret); X} X XLOCAL int Xincr_dspace(f, varp, amt) X FILE *f; X struct twvars *varp; X int amt; X{ X int incr = DIR_INCR; X char *new; X X if (amt < 0) X amt = 0; X while (incr < amt) X incr += DIR_INCR; X new = __fjrealloc(f, varp->Curdir, varp->Curdlen + incr, X "path buffer", JM_RETURN); X if (new == NULL) X return (-1); X varp->Curdir = new; X varp->Curdlen += incr; X return (incr); X} X X/* X * Call first to create a useful WALK state default. X */ XEXPORT void Xwalkinitstate(state) X struct WALK *state; X{ X state->flags = state->base = state->level = state->walkflags = 0; X state->twprivate = NULL; X state->std[0] = stdin; X state->std[1] = stdout; X state->std[2] = stderr; X state->env = environ; X state->quitfun = NULL; X state->qfarg = NULL; X state->maxdepth = state->mindepth = 0; X state->lname = state->tree = state->patstate = NULL; X state->err = state->pflags = state->auxi = 0; X state->auxp = NULL; X} X X/* X * For users that do not call treewalk(), e.g. star in extract mode. X */ XEXPORT void * Xwalkopen(state) X struct WALK *state; X{ X struct twvars *varp = __fjmalloc(state->std[2], X sizeof (struct twvars), "walk vars", X JM_RETURN); X X if (varp == NULL) X return (NULL); X varp->Curdir = NULL; X varp->Curdlen = 0; X varp->Curdtail = 0; X varp->Flags = TW_MALLOC; X#ifdef HAVE_FCHDIR X varp->Home = -1; X#else X varp->Home[0] = '\0'; X#endif X state->twprivate = varp; X varp->Walk = state; X X return ((void *)varp); X} X XEXPORT int Xwalkgethome(state) X struct WALK *state; X{ X struct twvars *varp = state->twprivate; X int err = EX_BAD; X X if (varp == NULL) { X if ((state->walkflags & WALK_NOMSG) == 0) X ferrmsg(state->std[2], X _("walkgethome: NULL twprivate\n")); X if ((state->walkflags & WALK_NOEXIT) == 0) X comexit(err); X return (-1); X } X#ifdef HAVE_FCHDIR X if (varp->Home >= 0) X close(varp->Home); X /* X * Note that we do not need O_RDONLY as we do not like to X * run readdir() on that directory but just fchdir(). X */ X if ((varp->Home = open(".", O_SEARCH|O_DIRECTORY|O_NDELAY)) < 0) { X err = geterrno(); X state->flags |= WALK_WF_NOCWD; X if ((state->walkflags & WALK_NOMSG) == 0) X ferrmsg(state->std[2], X _("Cannot get working directory.\n")); X if ((state->walkflags & WALK_NOEXIT) == 0) X comexit(err); X return (-1); X } X#ifdef F_SETFD X fcntl(varp->Home, F_SETFD, FD_CLOEXEC); X#endif X#else X if (getcwd(varp->Home, sizeof (varp->Home)) == NULL) { X err = geterrno(); X state->flags |= WALK_WF_NOCWD; X if ((state->walkflags & WALK_NOMSG) == 0) X ferrmsg(state->std[2], X _("Cannot get working directory.\n")); X if ((state->walkflags & WALK_NOEXIT) == 0) X comexit(err); X return (-1); X } X#endif X return (0); X} X X/* X * Walk back to the directory from where treewalk() has been started. X */ XEXPORT int Xwalkhome(state) X struct WALK *state; X{ X struct twvars *varp = state->twprivate; X X if (varp == NULL) X return (0); X#ifdef HAVE_FCHDIR X if (varp->Home >= 0) X return (fchdir(varp->Home)); X#else X if (varp->Home[0] != '\0') X return (chdir(varp->Home)); X#endif X return (0); X} X X/* X * Walk back to the previous "cwd". X * This always works with fchdir() and low directory nesting. X * In the other case, it is assumed that walkcwd() is called after walkhome(). X */ XEXPORT int Xwalkcwd(state) X struct WALK *state; X{ X struct twvars *varp = state->twprivate; X char c; X X if (varp == NULL) X return (0); X X if (varp->pdirs == NULL) X return (0); X X#if defined(HAVE_FCHDIR) && defined(USE_DIRFD) X if (varp->pdirs->p_dir) X return (fchdir(dirfd(varp->pdirs->p_dir))); X#endif X c = varp->Curdir[state->base]; X varp->Curdir[state->base] = '\0'; X X if (chdir(varp->Curdir) < 0) { X if (geterrno() != ENAMETOOLONG) { X varp->Curdir[state->base] = c; X return (-1); X } X if (xchdir(varp->Curdir) < 0) { X varp->Curdir[state->base] = c; X return (-1); X } X } X varp->Curdir[state->base] = c; X return (0); X} X XEXPORT int Xwalkclose(state) X struct WALK *state; X{ X int ret = 0; X struct twvars *varp = state->twprivate; X X if (varp == NULL) X return (0); X#ifdef HAVE_FCHDIR X if (varp->Home >= 0) X ret = close(varp->Home); X varp->Home = -1; X#else X varp->Home[0] = '\0'; X#endif X if (varp->Flags & TW_MALLOC) { X free(varp); X state->twprivate = NULL; X } X return (ret); X} X X/* X * We only call xchdotdot() with state->level > 0, X * so "last" is known to be != NULL. X */ XLOCAL int Xxchdotdot(last, tail, state) X struct pdirs *last; X int tail; X struct WALK *state; X{ X struct twvars *varp = state->twprivate; X char c; X struct stat sb; X X#ifdef USE_DIRFD X if (last->p_dir) { X if (fchdir(dirfd(last->p_dir)) >= 0) X return (0); X } X#endif X X if (chdir("..") >= 0) { X seterrno(0); X if (stat(".", &sb) >= 0) { X if (sb.st_dev == last->p_dev && X sb.st_ino == last->p_ino) X return (0); X } X } X X if (walkhome(state) < 0) X return (-1); X X c = varp->Curdir[tail]; X varp->Curdir[tail] = '\0'; X if (chdir(varp->Curdir) < 0) { X if (geterrno() != ENAMETOOLONG) { X varp->Curdir[tail] = c; X return (-1); X } X if (xchdir(varp->Curdir) < 0) { X varp->Curdir[tail] = c; X return (-1); X } X } X varp->Curdir[tail] = c; X seterrno(0); X if (stat(".", &sb) >= 0) { X if (sb.st_dev == last->p_dev && X sb.st_ino == last->p_ino) X return (0); X } X return (-1); X} X XLOCAL int Xxchdir(p) X char *p; X{ X char *p2; X X while (*p) { X if ((p2 = strchr(p, '/')) != NULL) X *p2 = '\0'; X if (chdir(p) < 0) X return (-1); X if (p2 == NULL) X break; X *p2 = '/'; X p = &p2[1]; X } X return (0); X} X X/* X * Get stat() info when WALK_CHDIR is set. X * Use vanilla stat() X */ XLOCAL int Xwstat(nm, sp, pd) X const char *nm; X struct stat *sp; X struct pdirs *pd; X{ X#ifdef HAVE_FSTATAT X return (fstatat(AT_FDCWD, nm, sp, _AT_TRIGGER)); X#else X return (stat(nm, sp)); X#endif X} X X/* X * Get lstat() info when WALK_CHDIR is set. X * Use vanilla lstat() X */ XLOCAL int Xwlstat(nm, sp, pd) X const char *nm; X struct stat *sp; X struct pdirs *pd; X{ X#ifdef HAVE_FSTATAT X return (fstatat(AT_FDCWD, nm, sp, AT_SYMLINK_NOFOLLOW|_AT_TRIGGER)); X#else X return (lstat(nm, sp)); X#endif X} X X/* X * Get stat() info when WALK_CHDIR is not set. X * Use vanilla stat()/statat() based on the directory fd. X */ XLOCAL int Xwdstat(nm, sp, pd) X const char *nm; X struct stat *sp; X struct pdirs *pd; X{ X int fd; X X#ifdef USE_DIRFD X if (pd && pd->p_dir) { X fd = dirfd(pd->p_dir); X } else { X#endif X fd = AT_FDCWD; X if (pd) X nm = pd->p_varp->Curdir; X#ifdef USE_DIRFD X } X#endif X return (fstatat(fd, nm, sp, _AT_TRIGGER)); X} X X/* X * Get lstat() info when WALK_CHDIR is not set. X * Use vanilla lstat()/statat() based on the directory fd. X */ XLOCAL int Xwdlstat(nm, sp, pd) X const char *nm; X struct stat *sp; X struct pdirs *pd; X{ X int fd; X X#ifdef USE_DIRFD X if (pd && pd->p_dir) { X fd = dirfd(pd->p_dir); X } else { X#endif X fd = AT_FDCWD; X if (pd) X nm = pd->p_varp->Curdir; X#ifdef USE_DIRFD X } X#endif X return (fstatat(fd, nm, sp, AT_SYMLINK_NOFOLLOW|_AT_TRIGGER)); X} X X#ifdef USE_DIRFD X/* X * Open directory WALK_CHDIR is set. X */ X/* ARGSUSED */ XLOCAL DIR * Xnopendir(name, pd) X const char *name; X struct pdirs *pd; X{ X return (opendir(name)); X} X X/* X * Open directory WALK_CHDIR is not set. X */ XLOCAL DIR * Xdopendir(name, pd) X const char *name; X struct pdirs *pd; X{ X char *nm; X char *p; X char *p2; X DIR *ret = NULL; X int fd; X int dfd; X X if (pd && pd->p_dir) { X fd = dirfd(pd->p_dir); X } else { X fd = AT_FDCWD; X if (pd) X name = pd->p_varp->Curdir; X } X if (((dfd = openat(fd, name, O_RDONLY|O_DIRECTORY|O_NDELAY)) < 0 && X geterrno() != ENAMETOOLONG) || (ret = fdopendir(dfd)) == NULL) { X return (NULL); X } X if (ret) X return (ret); X if (pd) X name = pd->p_varp->Curdir; X if ((nm = strdup(name)) == NULL) { X seterrno(ENAMETOOLONG); X return ((DIR *)NULL); X } X X p = nm; X fd = AT_FDCWD; X if (*p == '/') { X fd = openat(fd, "/", O_SEARCH|O_DIRECTORY|O_NDELAY); X while (*p == '/') X p++; X } X while (*p) { X if ((p2 = strchr(p, '/')) != NULL) { X if (p2[1] == '\0') X p2 = NULL; X else X *p2++ = '\0'; X } X if ((dfd = openat(fd, p, X p2 ? O_SEARCH|O_DIRECTORY|O_NDELAY : X O_RDONLY|O_DIRECTORY|O_NDELAY)) < 0) { X int err = geterrno(); X X free(nm); X close(fd); X if (err == EMFILE) X seterrno(err); X else X seterrno(ENAMETOOLONG); X return ((DIR *)NULL); X } X close(fd); X fd = dfd; X if (p2 == NULL) X break; X while (*p2 == '/') X p2++; X p = p2; X } X free(nm); X ret = fdopendir(fd); X return (ret); X} X#endif /* USE_DIRFD */ END-of-star-1.6/libfind/walk.c echo x - star-1.6/libfind/noshlfind.mk sed 's/^X//' >star-1.6/libfind/noshlfind.mk << 'END-of-star-1.6/libfind/noshlfind.mk' X#ident %W% %E% %Q% X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X Xall: X @echo " ==> NO shared libs on this platform (yet)" END-of-star-1.6/libfind/noshlfind.mk echo x - star-1.6/libfind/shlfind.mk sed 's/^X//' >star-1.6/libfind/shlfind.mk << 'END-of-star-1.6/libfind/shlfind.mk' X#ident @(#)shlfind.mk 1.7 18/08/01 X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XSUBARCHDIR= /pic XSHL_MAJOR= 3 XSHL_MINOR= 0 X#.SEARCHLIST: . $(ARCHDIR) stdio $(ARCHDIR) X#VPATH= .:stdio:$(ARCHDIR) XINSDIR= lib XTARGETLIB= find X#CPPOPTS += -Istdio X#CPPOPTS += -DUSE_SCANSTACK X X#CPPOPTS += -D__FIND__ XCPPOPTS += -DUSE_LARGEFILES XCPPOPTS += -DUSE_ACL XCPPOPTS += -DUSE_XATTR XCPPOPTS += -DUSE_NLS XCPPOPTS += -DUSE_DGETTEXT # _() -> dgettext() XCPPOPTS += -DTEXT_DOMAIN=\"SCHILY_FIND\" XCPPOPTS += -DSCHILY_PRINT X Xinclude Targets XLIBS= -lschily $(LIB_ACL_TEST) $(LIB_INTL) -lc X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.shl X########################################################################### END-of-star-1.6/libfind/shlfind.mk echo x - star-1.6/libfind/cmpdir.c sed 's/^X//' >star-1.6/libfind/cmpdir.c << 'END-of-star-1.6/libfind/cmpdir.c' X/* @(#)cmpdir.c 1.27 09/07/11 Copyright 2002-2009 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)cmpdir.c 1.27 09/07/11 Copyright 2002-2009 J. Schilling"; X#endif X/* X * Blocked directory sort/compare. X * X * Copyright (c) 2002-2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X#include X#include X XEXPORT int fdircomp __PR((const void *p1, const void *p2)); XEXPORT char **sortdir __PR((char *dir, int *entp)); XEXPORT int cmpdir __PR((int ents1, int ents2, X char **ep1, char **ep2, X char **oa, char **od, X int *alenp, int *dlenp)); X X/* X * Compare directory entries from fetchdir(). X * Ignore first byte, it does not belong to the directory data. X */ XEXPORT int Xfdircomp(p1, p2) X const void *p1; X const void *p2; X{ X register Uchar *s1; X register Uchar *s2; X X s1 = *(Uchar **)p1; X s2 = *(Uchar **)p2; X s1++; X s2++; X while (*s1 == *s2) { X if (*s1 == '\0') X return (0); X s1++; X s2++; X } X return (*s1 - *s2); X} X X/* X * Sort a directory string as returned by fetchdir(). X * X * Return allocated arry with string pointers. X */ XEXPORT char ** Xsortdir(dir, entp) X char *dir; X int *entp; X{ X int ents = -1; X char **ea; X char *d; X char *p; X int i; X X if (entp) X ents = *entp; X if (ents < 0) { X d = dir; X ents = 0; X while (*d) { X ents++; X p = strchr(d, '\0'); X d = &p[1]; X } X } X ea = ___malloc((ents+1)*sizeof (char *), "sortdir"); X for (i = 0; i < ents; i++) { X ea[i] = NULL; X } X for (i = 0; i < ents; i++) { X ea[i] = dir; X p = strchr(dir, '\0'); X if (p == NULL) X break; X dir = ++p; X } X ea[ents] = NULL; X qsort(ea, ents, sizeof (char *), fdircomp); X if (entp) X *entp = ents; X return (ea); X} X XEXPORT int Xcmpdir(ents1, ents2, ep1, ep2, oa, od, alenp, dlenp) X register int ents1; /* # of directory entries in arch */ X register int ents2; /* # of directory entries on disk */ X register char **ep1; /* Directory entry pointer array (arch) */ X register char **ep2; /* Directory entry pointer array (disk) */ X register char **oa; /* Only in arch pointer array */ X register char **od; /* Only on disk pointer array */ X int *alenp; /* Len pointer for "only in arch" array */ X int *dlenp; /* Len pointer for "only on disk" array */ X{ X register int i1; /* Index for 'only in archive' */ X register int i2; /* Index for 'only on disk' */ X register int d; /* 'diff' amount (== 0 means equal) */ X register int alen = 0; /* Number of ents only in archive */ X register int dlen = 0; /* Number of ents only on disk */ X X for (i1 = i2 = 0; i1 < ents1 && i2 < ents2; i1++, i2++) { X d = fdircomp(&ep1[i1], &ep2[i2]); X retry: X X if (d > 0) { X do { X d = fdircomp(&ep1[i1], &ep2[i2]); X if (d <= 0) X goto retry; X if (od) X od[dlen] = ep2[i2]; X dlen++; X i2++; X } while (i1 < ents1 && i2 < ents2); X } X if (d < 0) { X do { X d = fdircomp(&ep1[i1], &ep2[i2]); X if (d >= 0) X goto retry; X if (oa) X oa[alen] = ep1[i1]; X alen++; X i1++; X } while (i1 < ents1 && i2 < ents2); X } X /* X * Do not increment i1 & i2 in case that the last elements are X * not equal and need to be treaten as longer list elements in X * the code below. X */ X if (i1 >= ents1 || i2 >= ents2) X break; X } X /* X * One of both lists is longer after some amount. X */ X if (od == NULL) { X if (i2 < ents2) X dlen += ents2 - i2; X } else { X for (; i2 < ents2; i2++) { X od[dlen] = ep2[i2]; X dlen++; X } X } X if (oa == NULL) { X if (i1 < ents1) X alen += ents1 - i1; X } else { X for (; i1 < ents1; i1++) { X oa[alen] = ep1[i1]; X alen++; X } X } X if (alenp) X *alenp = alen; X if (dlenp) X *dlenp = dlen; X X return (alen + dlen); X} END-of-star-1.6/libfind/cmpdir.c echo x - star-1.6/libfind/find_tok.h sed 's/^X//' >star-1.6/libfind/find_tok.h << 'END-of-star-1.6/libfind/find_tok.h' X/* @(#)find_tok.h 1.11 18/10/29 Copyright 2004-2018 J. Schilling */ X/* X * Copyright (c) 2004-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _FIND_TOK_H X#define _FIND_TOK_H X X#define OPEN 0 /* ( */ X#define CLOSE 1 /* ) */ X#define LNOT 2 /* ! */ X#define AND 3 /* a */ X#define LOR 4 /* o */ X#define ATIME 5 /* -atime */ X#define CTIME 6 /* -ctime */ X#define DEPTH 7 /* -depth */ X#define EXEC 8 /* -exec */ X#define FOLLOW 9 /* -follow POSIX Extension */ X#define FSTYPE 10 /* -fstype POSIX Extension */ X#define GROUP 11 /* -group */ X#define INUM 12 /* -inum POSIX Extension */ X#define LINKS 13 /* -links */ X#define LOCL 14 /* -local POSIX Extension */ X#define LS 15 /* -ls POSIX Extension */ X#define MODE 16 /* -mode POSIX Extension */ X#define MOUNT 17 /* -mount POSIX Extension */ X#define MTIME 18 /* -mtime */ X#define NAME 19 /* -name */ X#define NEWER 20 /* -newer */ X#define NOGRP 21 /* -nogroup */ X#define NOUSER 22 /* -nouser */ X#define OK_EXEC 23 /* -ok */ X#define PERM 24 /* -perm */ X#define PRINT 25 /* -print */ X#define PRINTNNL 26 /* -printnnl POSIX Extension */ X#define PRUNE 27 /* -prune */ X#define SIZE 28 /* -size */ X#define TIME 29 /* -time POSIX Extension */ X#define TYPE 30 /* -type */ X#define USER 31 /* -user */ X#define XDEV 32 /* -xdev */ X#define PATH 33 /* -path POSIX Extension */ X#define LNAME 34 /* -lname POSIX Extension */ X#define PAT 35 /* -pat POSIX Extension */ X#define PPAT 36 /* -ppat POSIX Extension */ X#define LPAT 37 /* -lpat POSIX Extension */ X#define PACL 38 /* -ack POSIX Extension */ X#define XATTR 39 /* -xattr POSIX Extension */ X#define LINKEDTO 40 /* -linkedto POSIX Extension */ X#define NEWERAA 41 /* -neweraa POSIX Extension */ X#define NEWERAC 42 /* -newerac POSIX Extension */ X#define NEWERAM 43 /* -neweram POSIX Extension */ X#define NEWERAT 44 /* -newerat POSIX Extension */ X#define NEWERCA 45 /* -newerca POSIX Extension */ X#define NEWERCC 46 /* -newercc POSIX Extension */ X#define NEWERCM 47 /* -newercm POSIX Extension */ X#define NEWERCT 48 /* -newerct POSIX Extension */ X#define NEWERMA 49 /* -newerma POSIX Extension */ X#define NEWERMC 50 /* -newermc POSIX Extension */ X#define NEWERMM 51 /* -newermm POSIX Extension */ X#define NEWERMT 52 /* -newermt POSIX Extension */ X#define SPARSE 53 /* -sparse POSIX Extension */ X#define LTRUE 54 /* -true POSIX Extension */ X#define LFALSE 55 /* -false POSIX Extension */ X#define MAXDEPTH 56 /* -maxdepth POSIX Extension */ X#define MINDEPTH 57 /* -mindepth POSIX Extension */ X#define HELP 58 /* -help POSIX Extension */ X#define CHOWN 59 /* -chown POSIX Extension */ X#define CHGRP 60 /* -chgrp POSIX Extension */ X#define CHMOD 61 /* -chmod POSIX Extension */ X#define DOSTAT 62 /* -dostat POSIX Extension */ X#define INAME 63 /* -iname POSIX Extension */ X#define ILNAME 64 /* -ilname POSIX Extension */ X#define IPATH 65 /* -ipath POSIX Extension */ X#define IPAT 66 /* -ipat POSIX Extension */ X#define IPPAT 67 /* -ippat POSIX Extension */ X#define ILPAT 68 /* -ilpat POSIX Extension */ X#define AMIN 69 /* -amin POSIX Extension */ X#define CMIN 70 /* -cmin POSIX Extension */ X#define MMIN 71 /* -mmin POSIX Extension */ X#define PRINT0 72 /* -print0 POSIX Extension */ X#define FPRINT 73 /* -fprint POSIX Extension */ X#define FPRINTNNL 74 /* -fprintnnl POSIX Extension */ X#define FPRINT0 75 /* -fprint0 POSIX Extension */ X#define FLS 76 /* -fls POSIX Extension */ X#define EMPTY 77 /* -empty POSIX Extension */ X#define READABLE 78 /* -readable POSIX Extension */ X#define WRITABLE 79 /* -writable POSIX Extension */ X#define EXECUTABLE 80 /* -executable POSIX Extension */ X#define EXECDIR 81 /* -execdir POSIX Extension */ X#define OK_EXECDIR 82 /* -okdir POSIX Extension */ X#define CALL 83 /* -call POSIX Extension */ X#define CALLDIR 84 /* -calldir POSIX Extension */ X#define MOUNTPLUS 85 /* -mount+ POSIX Extension */ X#define CHATIME 86 /* -chatime POSIX Extension */ X#define CHCTIME 87 /* -chctime POSIX Extension */ X#define CHMTIME 88 /* -chmtime POSIX Extension */ X#define CHFILE 89 /* -chfile POSIX Extension */ X#define ENDPRIM 90 /* End of primary list */ X#define EXECPLUS 91 /* -exec */ X#define EXECDIRPLUS 92 /* -execdir */ X#define ENDTLIST 93 /* End of token list */ X X#define tokennames _find_tokennames X X#ifdef TOKEN_NAMES XLOCAL char *tokennames[] = { X "(", /* 0 OPEN */ X ")", /* 1 CLOSE */ X "!", /* 2 LNOT */ X "a", /* 3 AND */ X "o", /* 4 LOR */ X "atime", /* 5 ATIME */ X "ctime", /* 6 CTIME */ X "depth", /* 7 DEPTH */ X "exec", /* 8 EXEC */ X "follow", /* 9 FOLLOW POSIX Extension */ X "fstype", /* 10 FSTYPE POSIX Extension */ X "group", /* 11 GROUP */ X "inum", /* 12 INUM POSIX Extension */ X "links", /* 13 LINKS */ X "local", /* 14 LOCL POSIX Extension */ X "ls", /* 15 LS POSIX Extension */ X "mode", /* 16 MODE POSIX Extension */ X "mount", /* 17 MOUNT POSIX Extension */ X "mtime", /* 18 MTIME */ X "name", /* 19 NAME */ X "newer", /* 20 NEWER */ X "nogroup", /* 21 NOGRP */ X "nouser", /* 22 NOUSER */ X "ok", /* 23 OK_EXEC */ X "perm", /* 24 PERM */ X "print", /* 25 PRINT */ X "printnnl", /* 26 PRINTNNL POSIX Extension */ X "prune", /* 27 PRUNE */ X "size", /* 28 SIZE */ X "time", /* 29 TIME POSIX Extension */ X "type", /* 30 TYPE */ X "user", /* 31 USER */ X "xdev", /* 32 XDEV */ X "path", /* 33 PATH POSIX Extension */ X "lname", /* 34 LNAME POSIX Extension */ X "pat", /* 35 PAT POSIX Extension */ X "ppat", /* 36 PPAT POSIX Extension */ X "lpat", /* 37 LPAT POSIX Extension */ X "acl", /* 38 PACL POSIX Extension */ X "xattr", /* 39 XATTR POSIX Extension */ X "linkedto", /* 40 LINKEDTO POSIX Extension */ X "neweraa", /* 41 NEWERAA POSIX Extension */ X "newerac", /* 42 NEWERAC POSIX Extension */ X "neweram", /* 43 NEWERAM POSIX Extension */ X "newerat", /* 44 NEWERAT POSIX Extension */ X "newerca", /* 45 NEWERCA POSIX Extension */ X "newercc", /* 46 NEWERCC POSIX Extension */ X "newercm", /* 47 NEWERCM POSIX Extension */ X "newerct", /* 48 NEWERCT POSIX Extension */ X "newerma", /* 49 NEWERMA POSIX Extension */ X "newermc", /* 50 NEWERMC POSIX Extension */ X "newermm", /* 51 NEWERMM POSIX Extension */ X "newermt", /* 52 NEWERMT POSIX Extension */ X "sparse", /* 53 SPARSE POSIX Extension */ X "true", /* 54 LTRUE POSIX Extension */ X "false", /* 55 LFALSE POSIX Extension */ X "maxdepth", /* 56 MAXDEPTH POSIX Extension */ X "mindepth", /* 57 MINDEPTH POSIX Extension */ X "help", /* 58 HELP POSIX Extension */ X "chown", /* 59 CHOWN POSIX Extension */ X "chgrp", /* 60 CHGRP POSIX Extension */ X "chmod", /* 61 CHMOD POSIX Extension */ X "dostat", /* 62 DOSTAT POSIX Extension */ X "iname", /* 63 INAME POSIX Extension */ X "ilname", /* 64 ILNAME POSIX Extension */ X "ipath", /* 65 IPATH POSIX Extension */ X "ipat", /* 66 IPAT POSIX Extension */ X "ippat", /* 67 IPPAT POSIX Extension */ X "ilpat", /* 68 ILPAT POSIX Extension */ X "amin", /* 69 AMIN POSIX Extension */ X "cmin", /* 70 CMIN POSIX Extension */ X "mmin", /* 71 MMIN POSIX Extension */ X "print0", /* 72 PRINT0 POSIX Extension */ X "fprint", /* 73 FPRINT POSIX Extension */ X "fprintnnl", /* 74 FPRINTNNL POSIX Extension */ X "fprint0", /* 75 FPRINT0 POSIX Extension */ X "fls", /* 76 FLS POSIX Extension */ X "empty", /* 77 EMPTY POSIX Extension */ X "readable", /* 78 READABLE POSIX Extension */ X "writable", /* 79 WRITABLE POSIX Extension */ X "executable", /* 80 EXECUTABLE POSIX Extension */ X "execdir", /* 81 EXECDIR POSIX Extension */ X "okdir", /* 82 OK_EXECDIR POSIX Extension */ X "call", /* 83 CALL POSIX Extension */ X "calldir", /* 84 CALLDIR POSIX Extension */ X "mount+", /* 85 MOUNTPLUS POSIX Extension */ X "chatime", /* 86 CHATIME POSIX Extension */ X "chctime", /* 87 CHCTIME POSIX Extension */ X "chmtime", /* 88 CHMTIME POSIX Extension */ X "chfile", /* 89 CHFILE POSIX Extension */ X 0, /* 90 End of primary list */ X "exec", /* 91 Map EXECPLUS -> "exec" */ X "execdir", /* 92 Map EXECDIRPLUS -> "execdir" */ X 0 /* 93 End of list */ X}; X#define NTOK ((sizeof (tokennames) / sizeof (tokennames[0])) - 1) X X#else /* TOKEN_NAMES */ X X#define NTOK ENDTLIST X X#endif /* TOKEN_NAMES */ X X#endif /* _FIND_TOK_H */ END-of-star-1.6/libfind/find_tok.h echo x - star-1.6/libfind/README sed 's/^X//' >star-1.6/libfind/README << 'END-of-star-1.6/libfind/README' XLibfind allows to be used for adding find(1) like command line features Xto other programs (e.g. star and mkisofs). It also allows to implement Xa find(1) command in 10 lines of code and it allows to be used as shell Xbuilt in function. X XExample code for a complete find(1) program: X/*--------------------------------------------------------------------------*/ X/* %Z%%M% %I% %E% Copyright 2004-2007 J. Schilling */ X#ifndef lint Xstatic char sccsid[] = X "%Z%%M% %I% %E% Copyright 2004-2007 J. Schilling"; X#endif X/* X * Another find implementation... X * X * Copyright (c) 2004-2007 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X X#include "walk.h" X#include "find.h" X XEXPORT int main __PR((int ac, char **av)); X XEXPORT int Xmain(ac, av) X int ac; X char **av; X{ X FILE *std[3]; X X std[0] = stdin; X std[1] = stdout; X std[2] = stderr; X return (find_main(ac, av, NULL, std, NULL)); X} X/*--------------------------------------------------------------------------*/ X XExample code for redirecting I/O and for catching/handling signals in "bsh": X/*--------------------------------------------------------------------------*/ X#include "../libfind/walk.h" X#include "../libfind/find.h" X XLOCAL int Xquitfun(void *arg) X{ X return (*((int *)arg) != 0); /* Return TRUE is a signal was catched */ X} X X/* ARGSUSED */ XEXPORT void Xbfind(vp, std, flag) X vector *vp; X FILE *std[]; X int flag; X{ X squit_t quit; X X quit.quitfun = quitfun; /* The function to evaluate "ctlc" */ X quit.qfarg = &ctlc; /* The ^C catched counter */ X X ex_status = find_main(vp->v_ac, vp->v_av, evarray, std, &quit); X} X/*--------------------------------------------------------------------------*/ X XExample code for how to redirect I/O in ksh93 and how to catch signals: XNOTE: as th ksh93 does not use stdio but sfio, you need two wrapper Xfunctions in order to run a standard program inside ksh93. X/*--------------------------------------------------------------------------*/ Xa.c: (compiled against sfio) X Xint Xquitfun(void *dummy) X{ X return (cmdquit() != 0); X} X Xint Xb_find(int ac, char **av, void* context)) X{ X int i, o, e; X X cmdinit(ac, av, context, ERROR_CATALOG, ERROR_NOTIFY); X X i = fileno(stdin); X o = fileno(stdout); X e = fileno(stderr); X X return xfind(ac, av, dup(i), dup(o), dup(e), quitfun); X} X X------ Xb.c: (compiled against stdio) X Xint Xxfind(int ac, char **av, int i, int o, int e, int (*quitfun)(void *)) X{ X int ret; X FILE *std[3]; X squit_t quit; X X quit.quitfun = quitfun; /* The function to evaluate "ctlc" */ X quit.qfarg = NULL; /* Dummy */ X X std[0] = fdopen(i, "r+"); X std[1] = fdopen(o, "w"); X std[2] = fdopen(e, "w+"); X ret = find_main(ac, av, NULL, std, &quit); X fclose(std[0]); X fclose(std[1]); X fclose(std[2]); X return (ret); X} X/*--------------------------------------------------------------------------*/ END-of-star-1.6/libfind/README echo x - star-1.6/libfind/ptime.c sed 's/^X//' >star-1.6/libfind/ptime.c << 'END-of-star-1.6/libfind/ptime.c' X/* @(#)ptime.c 1.3 18/10/28 Copyright 2018 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)ptime.c 1.3 18/10/28 Copyright 2018 J. Schilling"; X#endif X/* X * Parse time in a format similar to ISO 8601 X * X * yyyy-mm-ddThh:mm:ss.nnnnnnnnn+0000 X * X * We are as forgiving as possible and accept anything that is similar X * enough. X * X * Copyright (c) 2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X X#include "find_misc.h" X XEXPORT const char *parsetime __PR((const char *s, X struct timespec *ts)); XLOCAL int mosize __PR((int y, int m)); XLOCAL int gnext __PR((const char *str, X const char **next, int num, X int *digits, int *chars)); XLOCAL int gns __PR((const char *str, X const char **next)); XLOCAL int gtz __PR((const char *str, X const char **next)); X X#undef numeric X#define numeric(c) ((c) >= '0' && (c) <= '9') X#define SKIPBLANK(p) while (*(p) == ' ' || *(p) == '\t') (p)++ X X#define DT_NO_ZONE 1 /* Impossible timezone - no zone found */ X#define DT_MIN_ZONE (-89940) /* Minimum zone (-24:59) */ X#define DT_MAX_ZONE 93540 /* Maximum zone (+25:59) */ X X#define dysize(A) (((A)%4)? 365 : (((A)%100) == 0 && ((A)%400)) ? 365 : 366) X Xstatic int dmsize[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; X XEXPORT const char * Xparsetime(s, ts) X const char *s; X struct timespec *ts; X{ X char *p; X struct tm tm; X struct tm tmthis; X time_t t; X int tz = DT_NO_ZONE; X int ns = 999999999; X int nchars; X int ndigit; X int y; X X fillbytes(&tm, sizeof (tm), '\0'); X time(&t); X tmthis = *localtime(&t); X X SKIPBLANK(s); X X if (streql(s, "now")) { X getnstimeofday(ts); X return (&s[3]); X } X X p = strchr(s, 'T'); X if (p == NULL) X p = strchr(s, ' '); X X y = tmthis.tm_year + 1900; X tm.tm_year = tmthis.tm_year; X tm.tm_mon = tmthis.tm_mon + 1; X tm.tm_mday = tmthis.tm_mday; X X if (*s == 'T') { X s++; X goto gtime; X } X if (p && ((p - s) < 4)) X goto gmday; X if (p && ((p - s) < 6)) X goto gmon; X if (*s == '-') { X s++; X goto gmon; X } X X tm.tm_year = gnext(s, &s, 4, &ndigit, &nchars); X if (tm.tm_year < 0) X return (NULL); X if ((ndigit != 2 && ndigit != 4) || nchars != ndigit || X (*s != '/' && *s != '-' && *s != '\0')) X return (NULL); X if (ndigit <= 2) { X if (tm.tm_year < 69) { X tm.tm_year += 100; X } X } else { X tm.tm_year -= 1900; X } X y = tm.tm_year + 1900; /* For Gregorian leap year */ X Xgmon: X if ((tm.tm_mon = gnext(s, &s, 2, &ndigit, &nchars)) == -2) X tm.tm_mon = 12; X if (tm.tm_mon < 1 || tm.tm_mon > 12) X return (NULL); X if (ndigit > 0 && X (ndigit != 2 || (nchars != ndigit && nchars != ndigit+1) || X (*s != '/' && *s != '-' && *s != '\0'))) X return (NULL); X Xgmday: X if ((tm.tm_mday = gnext(s, &s, 2, &ndigit, &nchars)) == -2) X tm.tm_mday = mosize(y, tm.tm_mon); X if (tm.tm_mday < 1 || tm.tm_mday > mosize(y, tm.tm_mon)) X return (NULL); X if (ndigit > 0 && X (ndigit != 2 || (nchars != ndigit && nchars != ndigit+1))) X return (NULL); X Xgtime: X SKIPBLANK(s); X if (*s == 'T') X s++; X X if ((tm.tm_hour = gnext(s, &s, 2, &ndigit, &nchars)) == -2) X tm.tm_hour = 23; X if (tm.tm_hour < 0 || tm.tm_hour > 23) X return (NULL); X X if ((tm.tm_min = gnext(s, &s, 2, &ndigit, &nchars)) == -2) X tm.tm_min = 59; X if (tm.tm_min < 0 || tm.tm_min > 59) X return (NULL); X X if ((tm.tm_sec = gnext(s, &s, 2, &ndigit, &nchars)) == -2) X tm.tm_sec = 59; X if (tm.tm_sec < 0 || tm.tm_sec > 59) X return (NULL); X X tm.tm_mon -= 1; /* tm_mon is 0..11 */ X tm.tm_isdst = -1; /* let mktime() find out */ X X if (*s == '.') X ns = gns(s, &s); X if (*s == '+' || *s == '-') { X tz = gtz(s, &s); X if (tz == DT_NO_ZONE) X return (NULL); X } else if (*s == 'Z') { X s++; X tz = 0; /* GMT */ X } X X if (tz != DT_NO_ZONE) { X t = mkgmtime(&tm); X t -= tz; X } else { X t = mktime(&tm); X } X X ts->tv_sec = t; X ts->tv_nsec = ns; X X return (s); X} X XLOCAL int Xmosize(y, m) X int y; X int m; X{ X X if (m == 2 && dysize(y) == 366) X return (29); X return (dmsize[m-1]); X} X X/* X * Get next value. X * Return converted value or -2 X */ XLOCAL int Xgnext(str, next, num, digits, chars) X const char *str; /* The input string */ X const char **next; /* To return the of the parsed string */ X int num; /* Number of digits to convert */ X int *digits; /* To return number of digits conv. */ X int *chars; /* To return number of chars used */ X{ X register int c = 0; X register int n = 0; X register int m = 0; X X while (*str && !numeric(*str)) { X str++; X m++; X } X if (*str) { X while ((num-- > 0) && numeric(*str)) { X c = (c * 10) + (*str++ - '0'); X n++; X } X } else { X c = -2; X } X if (next) { X *next = str; X } X if (digits) { X *digits = n; X } X if (chars) { X *chars = m + n; X } X X return (c); X} X X/* X * Multiplicator to get nanoseconds from 9 - "number of digits read". X * The 11th entry is for the theoretical case when *str == '\0'. X */ Xstatic int nsmult[] = X { 1, 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000, 0, 0 }; X X/* X * Get nanoseconds of a time stamp. X * Correct the value depending on how many digits have been read. X */ XLOCAL int Xgns(str, next) X const char *str; X const char **next; X{ X register int c = 0; X register int num = 9; /* max resolution is ns */ X X if (*str++) { /* Eat leading '.' */ X while ((--num >= 0) && numeric(*str)) { X c = (c * 10) + (*str++ - '0'); X } X } else { X str--; X } X if (next) { X *next = str; X } X c *= nsmult[++num]; X return (c); X} X X/* X * Get timezone value. X * Leave unexpected characters for our caller. X */ XLOCAL int Xgtz(str, next) X const char *str; X const char **next; X{ X register int c; X register int tz; X int sign = 1; X X c = *str++; X if (c == '-') X sign = -1; X else if (c != '+') /* Syntax error: return current pos */ X return (DT_NO_ZONE); X X c = 0; X if (numeric(*str)) X c = (c * 10) + (*str++ - '0'); X else X return (DT_NO_ZONE); X if (numeric(*str)) X c = (c * 10) + (*str++ - '0'); X else X return (DT_NO_ZONE); X X tz = c * 60; X c = 0; X if (*str == '\0') X return (tz); X if (*str == ':') X str++; X if (numeric(*str)) X c = (c * 10) + (*str++ - '0'); X else X return (DT_NO_ZONE); X if (numeric(*str)) X c = (c * 10) + (*str++ - '0'); X else X return (DT_NO_ZONE); X if (c > 59) X return (DT_NO_ZONE); X X tz += c; X tz *= 60; X tz *= sign; X X if (tz < DT_MIN_ZONE || tz > DT_MAX_ZONE) X tz = DT_NO_ZONE; X /* X * Do not update our read pointer in case zone is not within X * the permitted range from -24:59..+25:59. X */ X if (tz != DT_NO_ZONE && next) { X *next = str; X } X return (tz); X} END-of-star-1.6/libfind/ptime.c echo x - star-1.6/libfind/version.h sed 's/^X//' >star-1.6/libfind/version.h << 'END-of-star-1.6/libfind/version.h' X/* @(#)version.h 1.3 19/01/08 Copyright 2018-2019 J. Schilling */ X X/* X * The version for libfind/sfind X */ X#define VERSION "1.7" X#define VERSION_NUM 0x10007 X#define VERSION_DATE "2019/01/08" END-of-star-1.6/libfind/version.h echo c - star-1.6/star_sym mkdir -p star-1.6/star_sym > /dev/null 2>&1 echo x - star-1.6/star_sym/star_sym.c sed 's/^X//' >star-1.6/star_sym/star_sym.c << 'END-of-star-1.6/star_sym/star_sym.c' X/* @(#)star_sym.c 1.21 18/07/23 Copyright 2005-2018 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)star_sym.c 1.21 18/07/23 Copyright 2005-2018 J. Schilling"; X#endif X/* X * Read in the star inode data base and write a human X * readable version. X * X * Copyright (c) 2005-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include "star.h" X#include "restore.h" X#include "dumpdate.h" X#include /* To include __jmalloc() */ X#include X#define GT_COMERR /* #define comerr gtcomerr */ X#define GT_ERROR /* #define error gterror */ X#include X#include X#include "starsubs.h" X X#ifndef HAVE_LSTAT X#define lstat stat X#endif X X#if S_ISUID == TSUID && S_ISGID == TSGID && S_ISVTX == TSVTX && \ X S_IRUSR == TUREAD && S_IWUSR == TUWRITE && S_IXUSR == TUEXEC && \ X S_IRGRP == TGREAD && S_IWGRP == TGWRITE && S_IXGRP == TGEXEC && \ X S_IROTH == TOREAD && S_IWOTH == TOWRITE && S_IXOTH == TOEXEC X X#define HAVE_POSIX_MODE_BITS /* st_mode bits are equal to TAR mode bits */ X#endif X Xstruct star_stats xstats; /* for printing statistics */ X Xdev_t curfs = NODEV; /* Current st_dev for -M option */ Xchar *vers; /* the full version string */ XBOOL force_remove = FALSE; /* -force-remove on extraction */ XBOOL remove_recursive = FALSE; /* -remove-recursive on extract */ XBOOL dopartial = FALSE; /* -partial in incremental mode */ XBOOL forcerestore = FALSE; /* -force-restore in incremental mode */ XBOOL uncond = FALSE; /* -U unconditional extract */ XBOOL nowarn = FALSE; /* -nowarn has been specified */ Xint xdebug = 0; /* eXtended debug level */ XGINFO _grinfo; /* Global read information */ XGINFO *grip = &_grinfo; /* Global read info pointer */ X XLOCAL void star_mkvers __PR((void)); XLOCAL void usage __PR((int ret)); XEXPORT int main __PR((int ac, char *av[])); XLOCAL void make_symtab __PR((int ac, char *av[])); X X XEXPORT int Xhdr_type(name) X char *name; X{ X return (-1); X} X XEXPORT BOOL Xremove_file(name, isfirst) X register char *name; X BOOL isfirst; X{ X return (FALSE); X} X XEXPORT BOOL Xmake_adir(info) X register FINFO *info; X{ X return (FALSE); X} X X#include XEXPORT BOOL X_getinfo(name, info) X char *name; X register FINFO *info; X{ X struct stat sb; X X if (lstatat(name, &sb, AT_SYMLINK_NOFOLLOW) < 0) X return (FALSE); X X info->f_name = name; X info->f_ino = sb.st_ino; X switch ((int)(sb.st_mode & S_IFMT)) { X X case S_IFREG: info->f_filetype = F_FILE; break; X case S_IFDIR: info->f_filetype = F_DIR; break; X#ifdef S_IFLNK X case S_IFLNK: info->f_filetype = F_SLINK; break; X#endif X X default: info->f_filetype = F_SPEC; X } X return (TRUE); X} X X#ifdef HAVE_POSIX_MODE_BITS /* st_mode bits are equal to TAR mode bits */ X#define OSMODE(tarmode) (tarmode) X#else X#define OSMODE(tarmode) ((tarmode & TSUID ? S_ISUID : 0) \ X | (tarmode & TSGID ? S_ISGID : 0) \ X | (tarmode & TSVTX ? S_ISVTX : 0) \ X | (tarmode & TUREAD ? S_IRUSR : 0) \ X | (tarmode & TUWRITE ? S_IWUSR : 0) \ X | (tarmode & TUEXEC ? S_IXUSR : 0) \ X | (tarmode & TGREAD ? S_IRGRP : 0) \ X | (tarmode & TGWRITE ? S_IWGRP : 0) \ X | (tarmode & TGEXEC ? S_IXGRP : 0) \ X | (tarmode & TOREAD ? S_IROTH : 0) \ X | (tarmode & TOWRITE ? S_IWOTH : 0) \ X | (tarmode & TOEXEC ? S_IXOTH : 0)) X#endif X XEXPORT mode_t X#ifdef PROTOTYPES Xosmode(register mode_t tarmode) X#else Xosmode(tarmode) X register mode_t tarmode; X#endif X{ X register mode_t _osmode; X X _osmode = OSMODE(tarmode); X return (_osmode); X} X X XEXPORT char * Xhdr_name(type) X int type; X{ X return ("XXX"); X} X XEXPORT BOOL Xcreate_dirs(name) X register char *name; X{ X return (TRUE); X} X XEXPORT char * Xdt_name(type) X int type; X{ X return ("unknown"); X} X XEXPORT int Xdt_type(name) X char *name; X{ X return (DT_UNKN); X} X XEXPORT BOOL Xsame_symlink(info) X FINFO *info; X{ X return (FALSE); X} X XEXPORT BOOL Xsame_special(info) X FINFO *info; X{ X return (FALSE); X} X XLOCAL char strvers[] = "1.5"; XLOCAL void Xstar_mkvers() X{ X char buf[512]; X X if (vers != NULL) X return; X X js_snprintf(buf, sizeof (buf), X "%s %s (%s-%s-%s)", "star", strvers, HOST_CPU, HOST_VENDOR, HOST_OS); X X vers = ___savestr(buf); X} X XLOCAL void Xusage(ret) X int ret; X{ X error("Usage:\t%s [options] < file\n", get_progname()); X error("Options:\n"); X error("\t-help\t\tprint this help\n"); X error("\t-version\tPrint version number.\n"); X error("\n%s extracts star incremental restore database\n", get_progname()); X exit(ret); X /* NOTREACHED */ X} X XEXPORT int Xmain(ac, av) X int ac; X char *av[]; X{ Xextern BOOL is_star; X int cac = ac; X char *const *cav = av; X char *opt = "help,h,version"; X BOOL help = FALSE; X BOOL prvers = FALSE; X X is_star = FALSE; X save_args(ac, av); X star_mkvers(); X X cac--; X cav++; X if (getallargs(&cac, &cav, opt, &help, &help, &prvers) < 0) { X errmsgno(EX_BAD, "Bad Option: '%s'.\n", cav[0]); X usage(EX_BAD); X } X if (help) X usage(0); X if (prvers) { X printf("%s: %s\n\n", get_progname(), vers); X gtprintf("Copyright (C) 2005-2018 Jörg Schilling\n"); X gtprintf("This is free software; see the source for copying conditions. There is NO\n"); X gtprintf("warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n"); X exit(0); X } X X /* X * As long as all options cause star_sym to exit, we may continue X * with this lazy arg handling. X */ X if (ac > 2) { X /* X * Reconstruct star-symtable X * Call: X * star_sym X */ X make_symtab(ac, av); X return (0); X } X if (ac < 2) X sym_open(NULL); /* dump ./star-symtable */ X else X sym_open(av[1]); /* sump named symtable */ X printLsym(stderr); X return (0); X} X X/* ------------------------------------------------------------------------- */ X#include X X#include X#include X X XLOCAL int walkfunc __PR((char *nm, struct stat *fs, int type, struct WALK *state)); XEXPORT int doscan __PR((int ac, char **av)); X XLOCAL void Xmake_symtab(ac, av) X int ac; X char *av[]; X{ Xextern BOOL restore_valid; X X sym_initmaps(); X restore_valid = TRUE; X doscan(ac, av); X sym_close(); X} X X XLOCAL int Xwalkfunc(nm, fs, type, state) X char *nm; X struct stat *fs; X int type; X struct WALK *state; X{ X if (state->quitfun) { X /* X * Check for shell builtin signal abort condition. X */ X if ((*state->quitfun)(state->qfarg)) { X state->flags |= WALK_WF_QUIT; X return (0); X } X } X if (type == WALK_NS) { X ferrmsg(state->std[2], X gettext("Cannot stat '%s'.\n"), nm); X state->err = 1; X return (0); X } else if (type == WALK_SLN && (state->walkflags & WALK_PHYS) == 0) { X ferrmsg(state->std[2], X gettext("Cannot follow symlink '%s'.\n"), nm); X state->err = 1; X return (0); X } else if (type == WALK_DNR) { X if (state->flags & WALK_WF_NOCHDIR) { X ferrmsg(state->std[2], X gettext("Cannot chdir to '%s'.\n"), nm); X } else { X ferrmsg(state->std[2], X gettext("Cannot read '%s'.\n"), nm); X } X state->err = 1; X return (0); X } X X if (state->maxdepth >= 0 && state->level >= state->maxdepth) X state->flags |= WALK_WF_PRUNE; X if (state->mindepth >= 0 && state->level < state->mindepth) X return (0); X X { X#ifndef HAVE_FCHDIR X char cwd[MAXPATHNAME+1]; X#else X int f; X#endif X struct stat sb; X char name[4096]; X X sprintf(name, "%s/%s", (char *)state->auxp, &nm[1]); X sb.st_ino = 0; X X#ifndef HAVE_FCHDIR X cwd[0] = '\0'; X getcwd(cwd, sizeof (cwd)); X#else X /* X * Note that we do not need O_RDONLY as we do not like to X * run readdir() on that directory but just fchdir(). X */ X f = open(".", O_SEARCH|O_DIRECTORY); X#endif X walkhome(state); X lstatat(name, &sb, AT_SYMLINK_NOFOLLOW); X#ifndef HAVE_FCHDIR X chdir(cwd); X#else X fchdir(f); X close(f); X#endif X padd_node(nm, sb.st_ino, fs->st_ino, (type == WALK_D) ? I_DIR:0); X } X return (0); X} X X XEXPORT int Xdoscan(ac, av) X int ac; X char **av; X{ X finda_t fa; X findn_t *Tree; X struct WALK walkstate; X int oraise[3]; X int ret = 0; X int i; X FILE *std[3]; X X std[0] = stdin; X std[1] = stdout; X std[2] = stderr; X X find_argsinit(&fa); X for (i = 0; i < 3; i++) { X oraise[i] = file_getraise(std[i]); X file_raise(std[i], FALSE); X fa.std[i] = std[i]; X } X fa.walkflags = WALK_CHDIR | WALK_PHYS; X fa.walkflags |= WALK_NOEXIT; X X Tree = 0; X if (Tree == 0) { X Tree = find_printnode(); X } else if (!fa.found_action) { X Tree = find_addprint(Tree, &fa); X if (Tree == (findn_t *)NULL) { X ret = geterrno(); X goto out; X } X } X walkinitstate(&walkstate); X for (i = 0; i < 3; i++) X walkstate.std[i] = std[i]; X if (fa.patlen > 0) { X walkstate.patstate = __fjmalloc(std[2], X sizeof (int) * fa.patlen, X "space for pattern state", JM_RETURN); X if (walkstate.patstate == NULL) { X ret = geterrno(); X goto out; X } X } X X find_timeinit(time(0)); X X walkstate.walkflags = fa.walkflags; X walkstate.maxdepth = fa.maxdepth; X walkstate.mindepth = fa.mindepth; X walkstate.lname = NULL; X walkstate.tree = Tree; X walkstate.err = 0; X walkstate.pflags = 0; X walkstate.auxp = av[2]; X X treewalk(av[1], walkfunc, &walkstate); X X find_free(Tree, &fa); X ret = walkstate.err; X Xout: X for (i = 0; i < 3; i++) { X fflush(std[i]); X if (ferror(std[i])) X clearerr(std[i]); X file_raise(std[i], oraise[i]); X } X return (ret); X} END-of-star-1.6/star_sym/star_sym.c echo x - star-1.6/star_sym/Makefile sed 's/^X//' >star-1.6/star_sym/Makefile << 'END-of-star-1.6/star_sym/Makefile' X#ident @(#)star_sym.mk 1.11 18/07/14 X########################################################################### X# Sample makefile for general application programs X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XINSDIR= bin XTARGET= star_sym XCPPOPTS += -I../star XCPPOPTS += -DSTAR_SYM XCPPOPTS += -D__STAR__ XCPPOPTS += -DUSE_LARGEFILES XCPPOPTS += -DSCHILY_PRINT X XCFILES= star_sym.c restore.c dumpdate.c lpath_unix.c XLIBS= -lfind -lschily $(LIB_ACL_TEST) $(LIB_INTL) XXMK_FILE= star_sym.mk1 X Xrestore.c dumpdate.c: X @echo " ==> MAKING SYMLINKS in ." && sh ./MKLINKS X$(ALLTARGETS): restore.c dumpdate.c X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.cmd X########################################################################### X END-of-star-1.6/star_sym/Makefile echo x - star-1.6/star_sym/MKLINKS sed 's/^X//' >star-1.6/star_sym/MKLINKS << 'END-of-star-1.6/star_sym/MKLINKS' X#!/bin/sh X########################################################################### X#ident "@(#)MKLINKS 1.4 18/07/14 " X########################################################################### X# Written 2008-2011 by J. Schilling X########################################################################### X# Copyright (c) 2008-2011 J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### Xsymlink="ln -s" XMKLINKS_TEST=${MKLINKS_TEST-:} Xif [ ".$MKLINKS_COPY" = '.' ]; then X rm -f xxzzy.123 xxzzy.345 X echo test > xxzzy.123 X $symlink xxzzy.123 xxzzy.345 X test $? = 0 || symlink=cp X test -r xxzzy.345 || symlink=cp X ${MKLINKS_TEST} -h xxzzy.345 || symlink=cp X rm -f xxzzy.123 xxzzy.345 Xelse X symlink=cp Xfi X########################################################################### X X$symlink ../star/restore.c . X$symlink ../star/dumpdate.c . X$symlink ../star/lpath_unix.c . END-of-star-1.6/star_sym/MKLINKS echo x - star-1.6/star_sym/star_sym.1 sed 's/^X//' >star-1.6/star_sym/star_sym.1 << 'END-of-star-1.6/star_sym/star_sym.1' X. \" @(#)star_sym.1 1.1 10/05/13 Copyright 2005-2010 J. Schilling X. \" Manual page for star_sym X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH STAR_SYM 1L "15. May 2010" "J\*org Schilling" "Schily\'s USER COMMANDS" X.SH NAME Xstar_sym \- Convert inode data base into human readable format X.SH SYNOPSIS X.B Xstar_sym X[ X.I options X] X.SH DESCRIPTION XThe X.B star_sym Xcommand reads a inode data base file from a previous incremental restore via X.BR star (1) Xand prints the data base in a human readable format. X X.SH OPTIONS X.TP X.B \-help XPrints a short summary of the X.BR star_sym (1) Xoptions and exists. X.TP X.B \-version XPrints the X.BR star_sym (1) Xversion number string and exists. X X.SH FILES X.TP X.B star-symtable XThe file that holds the X.B star Xinode data base from an incremental restore. X X.SH "SEE ALSO X.BR star (1) X X.SH NOTES X.SH BUGS END-of-star-1.6/star_sym/star_sym.1 echo x - star-1.6/star_sym/star_sym.mk1 sed 's/^X//' >star-1.6/star_sym/star_sym.mk1 << 'END-of-star-1.6/star_sym/star_sym.mk1' X#ident "@(#)star_sym.mk1 1.1 10/05/13 " X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= star_sym XMANSECT= $(MANSECT_CMD) XMANSUFFIX= $(MANSUFF_CMD) XMANFILE= star_sym.1 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/star_sym/star_sym.mk1 echo x - star-1.6/CDDL.Schily.txt sed 's/^X//' >star-1.6/CDDL.Schily.txt << 'END-of-star-1.6/CDDL.Schily.txt' XCOMMON DEVELOPMENT AND DISTRIBUTION LICENSE Version 1.0 X X1. Definitions. X X 1.1. "Contributor" means each individual or entity that creates X or contributes to the creation of Modifications. X X 1.2. "Contributor Version" means the combination of the Original X Software, prior Modifications used by a Contributor (if any), X and the Modifications made by that particular Contributor. X X 1.3. "Covered Software" means (a) the Original Software, or (b) X Modifications, or (c) the combination of files containing X Original Software with files containing Modifications, in X each case including portions thereof. X X 1.4. "Executable" means the Covered Software in any form other X than Source Code. X X 1.5. "Initial Developer" means the individual or entity that first X makes Original Software available under this License. X X 1.6. "Larger Work" means a work which combines Covered Software or X portions thereof with code not governed by the terms of this X License. X X 1.7. "License" means this document. X X 1.8. "Licensable" means having the right to grant, to the maximum X extent possible, whether at the time of the initial grant or X subsequently acquired, any and all of the rights conveyed X herein. X X 1.9. "Modifications" means the Source Code and Executable form of X any of the following: X X A. Any file that results from an addition to, deletion from or X modification of the contents of a file containing Original X Software or previous Modifications; X X B. Any new file that contains any part of the Original X Software or previous Modifications; or X X C. Any new file that is contributed or otherwise made X available under the terms of this License. X X 1.10. "Original Software" means the Source Code and Executable X form of computer software code that is originally released X under this License. X X 1.11. "Patent Claims" means any patent claim(s), now owned or X hereafter acquired, including without limitation, method, X process, and apparatus claims, in any patent Licensable by X grantor. X X 1.12. "Source Code" means (a) the common form of computer software X code in which modifications are made and (b) associated X documentation included in or with such code. X X 1.13. "You" (or "Your") means an individual or a legal entity X exercising rights under, and complying with all of the terms X of, this License. For legal entities, "You" includes any X entity which controls, is controlled by, or is under common X control with You. For purposes of this definition, X "control" means (a) the power, direct or indirect, to cause X the direction or management of such entity, whether by X contract or otherwise, or (b) ownership of more than fifty X percent (50%) of the outstanding shares or beneficial X ownership of such entity. X X2. License Grants. X X 2.1. The Initial Developer Grant. X X Conditioned upon Your compliance with Section 3.1 below and X subject to third party intellectual property claims, the Initial X Developer hereby grants You a world-wide, royalty-free, X non-exclusive license: X X (a) under intellectual property rights (other than patent or X trademark) Licensable by Initial Developer, to use, X reproduce, modify, display, perform, sublicense and X distribute the Original Software (or portions thereof), X with or without Modifications, and/or as part of a Larger X Work; and X X (b) under Patent Claims infringed by the making, using or X selling of Original Software, to make, have made, use, X practice, sell, and offer for sale, and/or otherwise X dispose of the Original Software (or portions thereof). X X (c) The licenses granted in Sections 2.1(a) and (b) are X effective on the date Initial Developer first distributes X or otherwise makes the Original Software available to a X third party under the terms of this License. X X (d) Notwithstanding Section 2.1(b) above, no patent license is X granted: (1) for code that You delete from the Original X Software, or (2) for infringements caused by: (i) the X modification of the Original Software, or (ii) the X combination of the Original Software with other software X or devices. X X 2.2. Contributor Grant. X X Conditioned upon Your compliance with Section 3.1 below and X subject to third party intellectual property claims, each X Contributor hereby grants You a world-wide, royalty-free, X non-exclusive license: X X (a) under intellectual property rights (other than patent or X trademark) Licensable by Contributor to use, reproduce, X modify, display, perform, sublicense and distribute the X Modifications created by such Contributor (or portions X thereof), either on an unmodified basis, with other X Modifications, as Covered Software and/or as part of a X Larger Work; and X X (b) under Patent Claims infringed by the making, using, or X selling of Modifications made by that Contributor either X alone and/or in combination with its Contributor Version X (or portions of such combination), to make, use, sell, X offer for sale, have made, and/or otherwise dispose of: X (1) Modifications made by that Contributor (or portions X thereof); and (2) the combination of Modifications made by X that Contributor with its Contributor Version (or portions X of such combination). X X (c) The licenses granted in Sections 2.2(a) and 2.2(b) are X effective on the date Contributor first distributes or X otherwise makes the Modifications available to a third X party. X X (d) Notwithstanding Section 2.2(b) above, no patent license is X granted: (1) for any code that Contributor has deleted X from the Contributor Version; (2) for infringements caused X by: (i) third party modifications of Contributor Version, X or (ii) the combination of Modifications made by that X Contributor with other software (except as part of the X Contributor Version) or other devices; or (3) under Patent X Claims infringed by Covered Software in the absence of X Modifications made by that Contributor. X X3. Distribution Obligations. X X 3.1. Availability of Source Code. X X Any Covered Software that You distribute or otherwise make X available in Executable form must also be made available in Source X Code form and that Source Code form must be distributed only under X the terms of this License. You must include a copy of this X License with every copy of the Source Code form of the Covered X Software You distribute or otherwise make available. You must X inform recipients of any such Covered Software in Executable form X as to how they can obtain such Covered Software in Source Code X form in a reasonable manner on or through a medium customarily X used for software exchange. X X 3.2. Modifications. X X The Modifications that You create or to which You contribute are X governed by the terms of this License. You represent that You X believe Your Modifications are Your original creation(s) and/or X You have sufficient rights to grant the rights conveyed by this X License. X X 3.3. Required Notices. X X You must include a notice in each of Your Modifications that X identifies You as the Contributor of the Modification. You may X not remove or alter any copyright, patent or trademark notices X contained within the Covered Software, or any notices of licensing X or any descriptive text giving attribution to any Contributor or X the Initial Developer. X X 3.4. Application of Additional Terms. X X You may not offer or impose any terms on any Covered Software in X Source Code form that alters or restricts the applicable version X of this License or the recipients' rights hereunder. You may X choose to offer, and to charge a fee for, warranty, support, X indemnity or liability obligations to one or more recipients of X Covered Software. However, you may do so only on Your own behalf, X and not on behalf of the Initial Developer or any Contributor. X You must make it absolutely clear that any such warranty, support, X indemnity or liability obligation is offered by You alone, and You X hereby agree to indemnify the Initial Developer and every X Contributor for any liability incurred by the Initial Developer or X such Contributor as a result of warranty, support, indemnity or X liability terms You offer. X X 3.5. Distribution of Executable Versions. X X You may distribute the Executable form of the Covered Software X under the terms of this License or under the terms of a license of X Your choice, which may contain terms different from this License, X provided that You are in compliance with the terms of this License X and that the license for the Executable form does not attempt to X limit or alter the recipient's rights in the Source Code form from X the rights set forth in this License. If You distribute the X Covered Software in Executable form under a different license, You X must make it absolutely clear that any terms which differ from X this License are offered by You alone, not by the Initial X Developer or Contributor. You hereby agree to indemnify the X Initial Developer and every Contributor for any liability incurred X by the Initial Developer or such Contributor as a result of any X such terms You offer. X X 3.6. Larger Works. X X You may create a Larger Work by combining Covered Software with X other code not governed by the terms of this License and X distribute the Larger Work as a single product. In such a case, X You must make sure the requirements of this License are fulfilled X for the Covered Software. X X4. Versions of the License. X X 4.1. New Versions. X X Sun Microsystems, Inc. is the initial license steward and may X publish revised and/or new versions of this License from time to X time. Each version will be given a distinguishing version number. X Except as provided in Section 4.3, no one other than the license X steward has the right to modify this License. X X 4.2. Effect of New Versions. X X You may always continue to use, distribute or otherwise make the X Covered Software available under the terms of the version of the X License under which You originally received the Covered Software. X If the Initial Developer includes a notice in the Original X Software prohibiting it from being distributed or otherwise made X available under any subsequent version of the License, You must X distribute and make the Covered Software available under the terms X of the version of the License under which You originally received X the Covered Software. Otherwise, You may also choose to use, X distribute or otherwise make the Covered Software available under X the terms of any subsequent version of the License published by X the license steward. X X 4.3. Modified Versions. X X When You are an Initial Developer and You want to create a new X license for Your Original Software, You may create and use a X modified version of this License if You: (a) rename the license X and remove any references to the name of the license steward X (except to note that the license differs from this License); and X (b) otherwise make it clear that the license contains terms which X differ from this License. X X5. DISCLAIMER OF WARRANTY. X X COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" X BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, X INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED X SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR X PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND X PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY X COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE X INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY X NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF X WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF X ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS X DISCLAIMER. X X6. TERMINATION. X X 6.1. This License and the rights granted hereunder will terminate X automatically if You fail to comply with terms herein and fail to X cure such breach within 30 days of becoming aware of the breach. X Provisions which, by their nature, must remain in effect beyond X the termination of this License shall survive. X X 6.2. If You assert a patent infringement claim (excluding X declaratory judgment actions) against Initial Developer or a X Contributor (the Initial Developer or Contributor against whom You X assert such claim is referred to as "Participant") alleging that X the Participant Software (meaning the Contributor Version where X the Participant is a Contributor or the Original Software where X the Participant is the Initial Developer) directly or indirectly X infringes any patent, then any and all rights granted directly or X indirectly to You by such Participant, the Initial Developer (if X the Initial Developer is not the Participant) and all Contributors X under Sections 2.1 and/or 2.2 of this License shall, upon 60 days X notice from Participant terminate prospectively and automatically X at the expiration of such 60 day notice period, unless if within X such 60 day period You withdraw Your claim with respect to the X Participant Software against such Participant either unilaterally X or pursuant to a written agreement with Participant. X X 6.3. In the event of termination under Sections 6.1 or 6.2 above, X all end user licenses that have been validly granted by You or any X distributor hereunder prior to termination (excluding licenses X granted to You by any distributor) shall survive termination. X X7. LIMITATION OF LIABILITY. X X UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT X (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE X INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF X COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE X LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR X CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT X LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK X STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER X COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN X INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF X LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL X INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT X APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO X NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR X CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT X APPLY TO YOU. X X8. U.S. GOVERNMENT END USERS. X X The Covered Software is a "commercial item," as that term is X defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial X computer software" (as that term is defined at 48 X C.F.R. 252.227-7014(a)(1)) and "commercial computer software X documentation" as such terms are used in 48 C.F.R. 12.212 X (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 X C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all X U.S. Government End Users acquire Covered Software with only those X rights set forth herein. This U.S. Government Rights clause is in X lieu of, and supersedes, any other FAR, DFAR, or other clause or X provision that addresses Government rights in computer software X under this License. X X9. MISCELLANEOUS. X X This License represents the complete agreement concerning subject X matter hereof. If any provision of this License is held to be X unenforceable, such provision shall be reformed only to the extent X necessary to make it enforceable. This License shall be governed X by the law of the jurisdiction specified in a notice contained X within the Original Software (except to the extent applicable law, X if any, provides otherwise), excluding such jurisdiction's X conflict-of-law provisions. Any litigation relating to this X License shall be subject to the jurisdiction of the courts located X in the jurisdiction and venue specified in a notice contained X within the Original Software, with the losing party responsible X for costs, including, without limitation, court costs and X reasonable attorneys' fees and expenses. The application of the X United Nations Convention on Contracts for the International Sale X of Goods is expressly excluded. Any law or regulation which X provides that the language of a contract shall be construed X against the drafter shall not apply to this License. You agree X that You alone are responsible for compliance with the United X States export administration regulations (and the export control X laws and regulation of any other countries) when You use, X distribute or otherwise make available any Covered Software. X X10. RESPONSIBILITY FOR CLAIMS. X X As between Initial Developer and the Contributors, each party is X responsible for claims and damages arising, directly or X indirectly, out of its utilization of rights under this License X and You agree to work with Initial Developer and Contributors to X distribute such responsibility on an equitable basis. Nothing X herein is intended or shall be deemed to constitute any admission X of liability. X X-------------------------------------------------------------------- X XNOTICE PURSUANT TO SECTION 9 OF THE COMMON DEVELOPMENT AND XDISTRIBUTION LICENSE (CDDL) X XFor Covered Software in this distribution, this License shall Xbe governed by the laws of Germany (excluding conflict-of-law Xprovisions). X XAny litigation relating to this License shall be subject to the Xjurisdiction and the courts of Berlin Germany, with venue lying Xin Berlin Germany. END-of-star-1.6/CDDL.Schily.txt echo x - star-1.6/CDDL.Sun.txt sed 's/^X//' >star-1.6/CDDL.Sun.txt << 'END-of-star-1.6/CDDL.Sun.txt' XCOMMON DEVELOPMENT AND DISTRIBUTION LICENSE Version 1.0 X X1. Definitions. X X 1.1. "Contributor" means each individual or entity that creates X or contributes to the creation of Modifications. X X 1.2. "Contributor Version" means the combination of the Original X Software, prior Modifications used by a Contributor (if any), X and the Modifications made by that particular Contributor. X X 1.3. "Covered Software" means (a) the Original Software, or (b) X Modifications, or (c) the combination of files containing X Original Software with files containing Modifications, in X each case including portions thereof. X X 1.4. "Executable" means the Covered Software in any form other X than Source Code. X X 1.5. "Initial Developer" means the individual or entity that first X makes Original Software available under this License. X X 1.6. "Larger Work" means a work which combines Covered Software or X portions thereof with code not governed by the terms of this X License. X X 1.7. "License" means this document. X X 1.8. "Licensable" means having the right to grant, to the maximum X extent possible, whether at the time of the initial grant or X subsequently acquired, any and all of the rights conveyed X herein. X X 1.9. "Modifications" means the Source Code and Executable form of X any of the following: X X A. Any file that results from an addition to, deletion from or X modification of the contents of a file containing Original X Software or previous Modifications; X X B. Any new file that contains any part of the Original X Software or previous Modifications; or X X C. Any new file that is contributed or otherwise made X available under the terms of this License. X X 1.10. "Original Software" means the Source Code and Executable X form of computer software code that is originally released X under this License. X X 1.11. "Patent Claims" means any patent claim(s), now owned or X hereafter acquired, including without limitation, method, X process, and apparatus claims, in any patent Licensable by X grantor. X X 1.12. "Source Code" means (a) the common form of computer software X code in which modifications are made and (b) associated X documentation included in or with such code. X X 1.13. "You" (or "Your") means an individual or a legal entity X exercising rights under, and complying with all of the terms X of, this License. For legal entities, "You" includes any X entity which controls, is controlled by, or is under common X control with You. For purposes of this definition, X "control" means (a) the power, direct or indirect, to cause X the direction or management of such entity, whether by X contract or otherwise, or (b) ownership of more than fifty X percent (50%) of the outstanding shares or beneficial X ownership of such entity. X X2. License Grants. X X 2.1. The Initial Developer Grant. X X Conditioned upon Your compliance with Section 3.1 below and X subject to third party intellectual property claims, the Initial X Developer hereby grants You a world-wide, royalty-free, X non-exclusive license: X X (a) under intellectual property rights (other than patent or X trademark) Licensable by Initial Developer, to use, X reproduce, modify, display, perform, sublicense and X distribute the Original Software (or portions thereof), X with or without Modifications, and/or as part of a Larger X Work; and X X (b) under Patent Claims infringed by the making, using or X selling of Original Software, to make, have made, use, X practice, sell, and offer for sale, and/or otherwise X dispose of the Original Software (or portions thereof). X X (c) The licenses granted in Sections 2.1(a) and (b) are X effective on the date Initial Developer first distributes X or otherwise makes the Original Software available to a X third party under the terms of this License. X X (d) Notwithstanding Section 2.1(b) above, no patent license is X granted: (1) for code that You delete from the Original X Software, or (2) for infringements caused by: (i) the X modification of the Original Software, or (ii) the X combination of the Original Software with other software X or devices. X X 2.2. Contributor Grant. X X Conditioned upon Your compliance with Section 3.1 below and X subject to third party intellectual property claims, each X Contributor hereby grants You a world-wide, royalty-free, X non-exclusive license: X X (a) under intellectual property rights (other than patent or X trademark) Licensable by Contributor to use, reproduce, X modify, display, perform, sublicense and distribute the X Modifications created by such Contributor (or portions X thereof), either on an unmodified basis, with other X Modifications, as Covered Software and/or as part of a X Larger Work; and X X (b) under Patent Claims infringed by the making, using, or X selling of Modifications made by that Contributor either X alone and/or in combination with its Contributor Version X (or portions of such combination), to make, use, sell, X offer for sale, have made, and/or otherwise dispose of: X (1) Modifications made by that Contributor (or portions X thereof); and (2) the combination of Modifications made by X that Contributor with its Contributor Version (or portions X of such combination). X X (c) The licenses granted in Sections 2.2(a) and 2.2(b) are X effective on the date Contributor first distributes or X otherwise makes the Modifications available to a third X party. X X (d) Notwithstanding Section 2.2(b) above, no patent license is X granted: (1) for any code that Contributor has deleted X from the Contributor Version; (2) for infringements caused X by: (i) third party modifications of Contributor Version, X or (ii) the combination of Modifications made by that X Contributor with other software (except as part of the X Contributor Version) or other devices; or (3) under Patent X Claims infringed by Covered Software in the absence of X Modifications made by that Contributor. X X3. Distribution Obligations. X X 3.1. Availability of Source Code. X X Any Covered Software that You distribute or otherwise make X available in Executable form must also be made available in Source X Code form and that Source Code form must be distributed only under X the terms of this License. You must include a copy of this X License with every copy of the Source Code form of the Covered X Software You distribute or otherwise make available. You must X inform recipients of any such Covered Software in Executable form X as to how they can obtain such Covered Software in Source Code X form in a reasonable manner on or through a medium customarily X used for software exchange. X X 3.2. Modifications. X X The Modifications that You create or to which You contribute are X governed by the terms of this License. You represent that You X believe Your Modifications are Your original creation(s) and/or X You have sufficient rights to grant the rights conveyed by this X License. X X 3.3. Required Notices. X X You must include a notice in each of Your Modifications that X identifies You as the Contributor of the Modification. You may X not remove or alter any copyright, patent or trademark notices X contained within the Covered Software, or any notices of licensing X or any descriptive text giving attribution to any Contributor or X the Initial Developer. X X 3.4. Application of Additional Terms. X X You may not offer or impose any terms on any Covered Software in X Source Code form that alters or restricts the applicable version X of this License or the recipients' rights hereunder. You may X choose to offer, and to charge a fee for, warranty, support, X indemnity or liability obligations to one or more recipients of X Covered Software. However, you may do so only on Your own behalf, X and not on behalf of the Initial Developer or any Contributor. X You must make it absolutely clear that any such warranty, support, X indemnity or liability obligation is offered by You alone, and You X hereby agree to indemnify the Initial Developer and every X Contributor for any liability incurred by the Initial Developer or X such Contributor as a result of warranty, support, indemnity or X liability terms You offer. X X 3.5. Distribution of Executable Versions. X X You may distribute the Executable form of the Covered Software X under the terms of this License or under the terms of a license of X Your choice, which may contain terms different from this License, X provided that You are in compliance with the terms of this License X and that the license for the Executable form does not attempt to X limit or alter the recipient's rights in the Source Code form from X the rights set forth in this License. If You distribute the X Covered Software in Executable form under a different license, You X must make it absolutely clear that any terms which differ from X this License are offered by You alone, not by the Initial X Developer or Contributor. You hereby agree to indemnify the X Initial Developer and every Contributor for any liability incurred X by the Initial Developer or such Contributor as a result of any X such terms You offer. X X 3.6. Larger Works. X X You may create a Larger Work by combining Covered Software with X other code not governed by the terms of this License and X distribute the Larger Work as a single product. In such a case, X You must make sure the requirements of this License are fulfilled X for the Covered Software. X X4. Versions of the License. X X 4.1. New Versions. X X Sun Microsystems, Inc. is the initial license steward and may X publish revised and/or new versions of this License from time to X time. Each version will be given a distinguishing version number. X Except as provided in Section 4.3, no one other than the license X steward has the right to modify this License. X X 4.2. Effect of New Versions. X X You may always continue to use, distribute or otherwise make the X Covered Software available under the terms of the version of the X License under which You originally received the Covered Software. X If the Initial Developer includes a notice in the Original X Software prohibiting it from being distributed or otherwise made X available under any subsequent version of the License, You must X distribute and make the Covered Software available under the terms X of the version of the License under which You originally received X the Covered Software. Otherwise, You may also choose to use, X distribute or otherwise make the Covered Software available under X the terms of any subsequent version of the License published by X the license steward. X X 4.3. Modified Versions. X X When You are an Initial Developer and You want to create a new X license for Your Original Software, You may create and use a X modified version of this License if You: (a) rename the license X and remove any references to the name of the license steward X (except to note that the license differs from this License); and X (b) otherwise make it clear that the license contains terms which X differ from this License. X X5. DISCLAIMER OF WARRANTY. X X COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" X BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, X INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED X SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR X PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND X PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY X COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE X INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY X NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF X WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF X ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS X DISCLAIMER. X X6. TERMINATION. X X 6.1. This License and the rights granted hereunder will terminate X automatically if You fail to comply with terms herein and fail to X cure such breach within 30 days of becoming aware of the breach. X Provisions which, by their nature, must remain in effect beyond X the termination of this License shall survive. X X 6.2. If You assert a patent infringement claim (excluding X declaratory judgment actions) against Initial Developer or a X Contributor (the Initial Developer or Contributor against whom You X assert such claim is referred to as "Participant") alleging that X the Participant Software (meaning the Contributor Version where X the Participant is a Contributor or the Original Software where X the Participant is the Initial Developer) directly or indirectly X infringes any patent, then any and all rights granted directly or X indirectly to You by such Participant, the Initial Developer (if X the Initial Developer is not the Participant) and all Contributors X under Sections 2.1 and/or 2.2 of this License shall, upon 60 days X notice from Participant terminate prospectively and automatically X at the expiration of such 60 day notice period, unless if within X such 60 day period You withdraw Your claim with respect to the X Participant Software against such Participant either unilaterally X or pursuant to a written agreement with Participant. X X 6.3. In the event of termination under Sections 6.1 or 6.2 above, X all end user licenses that have been validly granted by You or any X distributor hereunder prior to termination (excluding licenses X granted to You by any distributor) shall survive termination. X X7. LIMITATION OF LIABILITY. X X UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT X (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE X INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF X COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE X LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR X CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT X LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK X STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER X COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN X INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF X LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL X INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT X APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO X NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR X CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT X APPLY TO YOU. X X8. U.S. GOVERNMENT END USERS. X X The Covered Software is a "commercial item," as that term is X defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial X computer software" (as that term is defined at 48 X C.F.R. 252.227-7014(a)(1)) and "commercial computer software X documentation" as such terms are used in 48 C.F.R. 12.212 X (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 X C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all X U.S. Government End Users acquire Covered Software with only those X rights set forth herein. This U.S. Government Rights clause is in X lieu of, and supersedes, any other FAR, DFAR, or other clause or X provision that addresses Government rights in computer software X under this License. X X9. MISCELLANEOUS. X X This License represents the complete agreement concerning subject X matter hereof. If any provision of this License is held to be X unenforceable, such provision shall be reformed only to the extent X necessary to make it enforceable. This License shall be governed X by the law of the jurisdiction specified in a notice contained X within the Original Software (except to the extent applicable law, X if any, provides otherwise), excluding such jurisdiction's X conflict-of-law provisions. Any litigation relating to this X License shall be subject to the jurisdiction of the courts located X in the jurisdiction and venue specified in a notice contained X within the Original Software, with the losing party responsible X for costs, including, without limitation, court costs and X reasonable attorneys' fees and expenses. The application of the X United Nations Convention on Contracts for the International Sale X of Goods is expressly excluded. Any law or regulation which X provides that the language of a contract shall be construed X against the drafter shall not apply to this License. You agree X that You alone are responsible for compliance with the United X States export administration regulations (and the export control X laws and regulation of any other countries) when You use, X distribute or otherwise make available any Covered Software. X X10. RESPONSIBILITY FOR CLAIMS. X X As between Initial Developer and the Contributors, each party is X responsible for claims and damages arising, directly or X indirectly, out of its utilization of rights under this License X and You agree to work with Initial Developer and Contributors to X distribute such responsibility on an equitable basis. Nothing X herein is intended or shall be deemed to constitute any admission X of liability. X X-------------------------------------------------------------------- X XNOTICE PURSUANT TO SECTION 9 OF THE COMMON DEVELOPMENT AND XDISTRIBUTION LICENSE (CDDL) X XFor Covered Software in this distribution, this License shall Xbe governed by the laws of the State of California (excluding Xconflict-of-law provisions). X XAny litigation relating to this License shall be subject to the Xjurisdiction of the Federal Courts of the Northern District of XCalifornia and the state courts of the State of California, with Xvenue lying in Santa Clara County, California. END-of-star-1.6/CDDL.Sun.txt echo x - star-1.6/LGPL-2.1.txt sed 's/^X//' >star-1.6/LGPL-2.1.txt << 'END-of-star-1.6/LGPL-2.1.txt' X GNU LESSER GENERAL PUBLIC LICENSE X Version 2.1, February 1999 X X Copyright (C) 1991, 1999 Free Software Foundation, Inc. X 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA X Everyone is permitted to copy and distribute verbatim copies X of this license document, but changing it is not allowed. X X[This is the first released version of the Lesser GPL. It also counts X as the successor of the GNU Library Public License, version 2, hence X the version number 2.1.] X X Preamble X X The licenses for most software are designed to take away your Xfreedom to share and change it. By contrast, the GNU General Public XLicenses are intended to guarantee your freedom to share and change Xfree software--to make sure the software is free for all its users. X X This license, the Lesser General Public License, applies to some Xspecially designated software packages--typically libraries--of the XFree Software Foundation and other authors who decide to use it. You Xcan use it too, but we suggest you first think carefully about whether Xthis license or the ordinary General Public License is the better Xstrategy to use in any particular case, based on the explanations below. X X When we speak of free software, we are referring to freedom of use, Xnot price. Our General Public Licenses are designed to make sure that Xyou have the freedom to distribute copies of free software (and charge Xfor this service if you wish); that you receive source code or can get Xit if you want it; that you can change the software and use pieces of Xit in new free programs; and that you are informed that you can do Xthese things. X X To protect your rights, we need to make restrictions that forbid Xdistributors to deny you these rights or to ask you to surrender these Xrights. These restrictions translate to certain responsibilities for Xyou if you distribute copies of the library or if you modify it. X X For example, if you distribute copies of the library, whether gratis Xor for a fee, you must give the recipients all the rights that we gave Xyou. You must make sure that they, too, receive or can get the source Xcode. If you link other code with the library, you must provide Xcomplete object files to the recipients, so that they can relink them Xwith the library after making changes to the library and recompiling Xit. And you must show them these terms so they know their rights. X X We protect your rights with a two-step method: (1) we copyright the Xlibrary, and (2) we offer you this license, which gives you legal Xpermission to copy, distribute and/or modify the library. X X To protect each distributor, we want to make it very clear that Xthere is no warranty for the free library. Also, if the library is Xmodified by someone else and passed on, the recipients should know Xthat what they have is not the original version, so that the original Xauthor's reputation will not be affected by problems that might be Xintroduced by others. X X Finally, software patents pose a constant threat to the existence of Xany free program. We wish to make sure that a company cannot Xeffectively restrict the users of a free program by obtaining a Xrestrictive license from a patent holder. Therefore, we insist that Xany patent license obtained for a version of the library must be Xconsistent with the full freedom of use specified in this license. X X Most GNU software, including some libraries, is covered by the Xordinary GNU General Public License. This license, the GNU Lesser XGeneral Public License, applies to certain designated libraries, and Xis quite different from the ordinary General Public License. We use Xthis license for certain libraries in order to permit linking those Xlibraries into non-free programs. X X When a program is linked with a library, whether statically or using Xa shared library, the combination of the two is legally speaking a Xcombined work, a derivative of the original library. The ordinary XGeneral Public License therefore permits such linking only if the Xentire combination fits its criteria of freedom. The Lesser General XPublic License permits more lax criteria for linking other code with Xthe library. X X We call this license the "Lesser" General Public License because it Xdoes Less to protect the user's freedom than the ordinary General XPublic License. It also provides other free software developers Less Xof an advantage over competing non-free programs. These disadvantages Xare the reason we use the ordinary General Public License for many Xlibraries. However, the Lesser license provides advantages in certain Xspecial circumstances. X X For example, on rare occasions, there may be a special need to Xencourage the widest possible use of a certain library, so that it becomes Xa de-facto standard. To achieve this, non-free programs must be Xallowed to use the library. A more frequent case is that a free Xlibrary does the same job as widely used non-free libraries. In this Xcase, there is little to gain by limiting the free library to free Xsoftware only, so we use the Lesser General Public License. X X In other cases, permission to use a particular library in non-free Xprograms enables a greater number of people to use a large body of Xfree software. For example, permission to use the GNU C Library in Xnon-free programs enables many more people to use the whole GNU Xoperating system, as well as its variant, the GNU/Linux operating Xsystem. X X Although the Lesser General Public License is Less protective of the Xusers' freedom, it does ensure that the user of a program that is Xlinked with the Library has the freedom and the wherewithal to run Xthat program using a modified version of the Library. X X The precise terms and conditions for copying, distribution and Xmodification follow. Pay close attention to the difference between a X"work based on the library" and a "work that uses the library". The Xformer contains code derived from the library, whereas the latter must Xbe combined with the library in order to run. X X GNU LESSER GENERAL PUBLIC LICENSE X TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION X X 0. This License Agreement applies to any software library or other Xprogram which contains a notice placed by the copyright holder or Xother authorized party saying it may be distributed under the terms of Xthis Lesser General Public License (also called "this License"). XEach licensee is addressed as "you". X X A "library" means a collection of software functions and/or data Xprepared so as to be conveniently linked with application programs X(which use some of those functions and data) to form executables. X X The "Library", below, refers to any such software library or work Xwhich has been distributed under these terms. A "work based on the XLibrary" means either the Library or any derivative work under Xcopyright law: that is to say, a work containing the Library or a Xportion of it, either verbatim or with modifications and/or translated Xstraightforwardly into another language. (Hereinafter, translation is Xincluded without limitation in the term "modification".) X X "Source code" for a work means the preferred form of the work for Xmaking modifications to it. For a library, complete source code means Xall the source code for all modules it contains, plus any associated Xinterface definition files, plus the scripts used to control compilation Xand installation of the library. X X Activities other than copying, distribution and modification are not Xcovered by this License; they are outside its scope. The act of Xrunning a program using the Library is not restricted, and output from Xsuch a program is covered only if its contents constitute a work based Xon the Library (independent of the use of the Library in a tool for Xwriting it). Whether that is true depends on what the Library does Xand what the program that uses the Library does. X X 1. You may copy and distribute verbatim copies of the Library's Xcomplete source code as you receive it, in any medium, provided that Xyou conspicuously and appropriately publish on each copy an Xappropriate copyright notice and disclaimer of warranty; keep intact Xall the notices that refer to this License and to the absence of any Xwarranty; and distribute a copy of this License along with the XLibrary. X X You may charge a fee for the physical act of transferring a copy, Xand you may at your option offer warranty protection in exchange for a Xfee. X X 2. You may modify your copy or copies of the Library or any portion Xof it, thus forming a work based on the Library, and copy and Xdistribute such modifications or work under the terms of Section 1 Xabove, provided that you also meet all of these conditions: X X a) The modified work must itself be a software library. X X b) You must cause the files modified to carry prominent notices X stating that you changed the files and the date of any change. X X c) You must cause the whole of the work to be licensed at no X charge to all third parties under the terms of this License. X X d) If a facility in the modified Library refers to a function or a X table of data to be supplied by an application program that uses X the facility, other than as an argument passed when the facility X is invoked, then you must make a good faith effort to ensure that, X in the event an application does not supply such function or X table, the facility still operates, and performs whatever part of X its purpose remains meaningful. X X (For example, a function in a library to compute square roots has X a purpose that is entirely well-defined independent of the X application. Therefore, Subsection 2d requires that any X application-supplied function or table used by this function must X be optional: if the application does not supply it, the square X root function must still compute square roots.) X XThese requirements apply to the modified work as a whole. If Xidentifiable sections of that work are not derived from the Library, Xand can be reasonably considered independent and separate works in Xthemselves, then this License, and its terms, do not apply to those Xsections when you distribute them as separate works. But when you Xdistribute the same sections as part of a whole which is a work based Xon the Library, the distribution of the whole must be on the terms of Xthis License, whose permissions for other licensees extend to the Xentire whole, and thus to each and every part regardless of who wrote Xit. X XThus, it is not the intent of this section to claim rights or contest Xyour rights to work written entirely by you; rather, the intent is to Xexercise the right to control the distribution of derivative or Xcollective works based on the Library. X XIn addition, mere aggregation of another work not based on the Library Xwith the Library (or with a work based on the Library) on a volume of Xa storage or distribution medium does not bring the other work under Xthe scope of this License. X X 3. You may opt to apply the terms of the ordinary GNU General Public XLicense instead of this License to a given copy of the Library. To do Xthis, you must alter all the notices that refer to this License, so Xthat they refer to the ordinary GNU General Public License, version 2, Xinstead of to this License. (If a newer version than version 2 of the Xordinary GNU General Public License has appeared, then you can specify Xthat version instead if you wish.) Do not make any other change in Xthese notices. X X Once this change is made in a given copy, it is irreversible for Xthat copy, so the ordinary GNU General Public License applies to all Xsubsequent copies and derivative works made from that copy. X X This option is useful when you wish to copy part of the code of Xthe Library into a program that is not a library. X X 4. You may copy and distribute the Library (or a portion or Xderivative of it, under Section 2) in object code or executable form Xunder the terms of Sections 1 and 2 above provided that you accompany Xit with the complete corresponding machine-readable source code, which Xmust be distributed under the terms of Sections 1 and 2 above on a Xmedium customarily used for software interchange. X X If distribution of object code is made by offering access to copy Xfrom a designated place, then offering equivalent access to copy the Xsource code from the same place satisfies the requirement to Xdistribute the source code, even though third parties are not Xcompelled to copy the source along with the object code. X X 5. A program that contains no derivative of any portion of the XLibrary, but is designed to work with the Library by being compiled or Xlinked with it, is called a "work that uses the Library". Such a Xwork, in isolation, is not a derivative work of the Library, and Xtherefore falls outside the scope of this License. X X However, linking a "work that uses the Library" with the Library Xcreates an executable that is a derivative of the Library (because it Xcontains portions of the Library), rather than a "work that uses the Xlibrary". The executable is therefore covered by this License. XSection 6 states terms for distribution of such executables. X X When a "work that uses the Library" uses material from a header file Xthat is part of the Library, the object code for the work may be a Xderivative work of the Library even though the source code is not. XWhether this is true is especially significant if the work can be Xlinked without the Library, or if the work is itself a library. The Xthreshold for this to be true is not precisely defined by law. X X If such an object file uses only numerical parameters, data Xstructure layouts and accessors, and small macros and small inline Xfunctions (ten lines or less in length), then the use of the object Xfile is unrestricted, regardless of whether it is legally a derivative Xwork. (Executables containing this object code plus portions of the XLibrary will still fall under Section 6.) X X Otherwise, if the work is a derivative of the Library, you may Xdistribute the object code for the work under the terms of Section 6. XAny executables containing that work also fall under Section 6, Xwhether or not they are linked directly with the Library itself. X X 6. As an exception to the Sections above, you may also combine or Xlink a "work that uses the Library" with the Library to produce a Xwork containing portions of the Library, and distribute that work Xunder terms of your choice, provided that the terms permit Xmodification of the work for the customer's own use and reverse Xengineering for debugging such modifications. X X You must give prominent notice with each copy of the work that the XLibrary is used in it and that the Library and its use are covered by Xthis License. You must supply a copy of this License. If the work Xduring execution displays copyright notices, you must include the Xcopyright notice for the Library among them, as well as a reference Xdirecting the user to the copy of this License. Also, you must do one Xof these things: X X a) Accompany the work with the complete corresponding X machine-readable source code for the Library including whatever X changes were used in the work (which must be distributed under X Sections 1 and 2 above); and, if the work is an executable linked X with the Library, with the complete machine-readable "work that X uses the Library", as object code and/or source code, so that the X user can modify the Library and then relink to produce a modified X executable containing the modified Library. (It is understood X that the user who changes the contents of definitions files in the X Library will not necessarily be able to recompile the application X to use the modified definitions.) X X b) Use a suitable shared library mechanism for linking with the X Library. A suitable mechanism is one that (1) uses at run time a X copy of the library already present on the user's computer system, X rather than copying library functions into the executable, and (2) X will operate properly with a modified version of the library, if X the user installs one, as long as the modified version is X interface-compatible with the version that the work was made with. X X c) Accompany the work with a written offer, valid for at X least three years, to give the same user the materials X specified in Subsection 6a, above, for a charge no more X than the cost of performing this distribution. X X d) If distribution of the work is made by offering access to copy X from a designated place, offer equivalent access to copy the above X specified materials from the same place. X X e) Verify that the user has already received a copy of these X materials or that you have already sent this user a copy. X X For an executable, the required form of the "work that uses the XLibrary" must include any data and utility programs needed for Xreproducing the executable from it. However, as a special exception, Xthe materials to be distributed need not include anything that is Xnormally distributed (in either source or binary form) with the major Xcomponents (compiler, kernel, and so on) of the operating system on Xwhich the executable runs, unless that component itself accompanies Xthe executable. X X It may happen that this requirement contradicts the license Xrestrictions of other proprietary libraries that do not normally Xaccompany the operating system. Such a contradiction means you cannot Xuse both them and the Library together in an executable that you Xdistribute. X X 7. You may place library facilities that are a work based on the XLibrary side-by-side in a single library together with other library Xfacilities not covered by this License, and distribute such a combined Xlibrary, provided that the separate distribution of the work based on Xthe Library and of the other library facilities is otherwise Xpermitted, and provided that you do these two things: X X a) Accompany the combined library with a copy of the same work X based on the Library, uncombined with any other library X facilities. This must be distributed under the terms of the X Sections above. X X b) Give prominent notice with the combined library of the fact X that part of it is a work based on the Library, and explaining X where to find the accompanying uncombined form of the same work. X X 8. You may not copy, modify, sublicense, link with, or distribute Xthe Library except as expressly provided under this License. Any Xattempt otherwise to copy, modify, sublicense, link with, or Xdistribute the Library is void, and will automatically terminate your Xrights under this License. However, parties who have received copies, Xor rights, from you under this License will not have their licenses Xterminated so long as such parties remain in full compliance. X X 9. You are not required to accept this License, since you have not Xsigned it. However, nothing else grants you permission to modify or Xdistribute the Library or its derivative works. These actions are Xprohibited by law if you do not accept this License. Therefore, by Xmodifying or distributing the Library (or any work based on the XLibrary), you indicate your acceptance of this License to do so, and Xall its terms and conditions for copying, distributing or modifying Xthe Library or works based on it. X X 10. Each time you redistribute the Library (or any work based on the XLibrary), the recipient automatically receives a license from the Xoriginal licensor to copy, distribute, link with or modify the Library Xsubject to these terms and conditions. You may not impose any further Xrestrictions on the recipients' exercise of the rights granted herein. XYou are not responsible for enforcing compliance by third parties with Xthis License. X X 11. If, as a consequence of a court judgment or allegation of patent Xinfringement or for any other reason (not limited to patent issues), Xconditions are imposed on you (whether by court order, agreement or Xotherwise) that contradict the conditions of this License, they do not Xexcuse you from the conditions of this License. If you cannot Xdistribute so as to satisfy simultaneously your obligations under this XLicense and any other pertinent obligations, then as a consequence you Xmay not distribute the Library at all. For example, if a patent Xlicense would not permit royalty-free redistribution of the Library by Xall those who receive copies directly or indirectly through you, then Xthe only way you could satisfy both it and this License would be to Xrefrain entirely from distribution of the Library. X XIf any portion of this section is held invalid or unenforceable under any Xparticular circumstance, the balance of the section is intended to apply, Xand the section as a whole is intended to apply in other circumstances. X XIt is not the purpose of this section to induce you to infringe any Xpatents or other property right claims or to contest validity of any Xsuch claims; this section has the sole purpose of protecting the Xintegrity of the free software distribution system which is Ximplemented by public license practices. Many people have made Xgenerous contributions to the wide range of software distributed Xthrough that system in reliance on consistent application of that Xsystem; it is up to the author/donor to decide if he or she is willing Xto distribute software through any other system and a licensee cannot Ximpose that choice. X XThis section is intended to make thoroughly clear what is believed to Xbe a consequence of the rest of this License. X X 12. If the distribution and/or use of the Library is restricted in Xcertain countries either by patents or by copyrighted interfaces, the Xoriginal copyright holder who places the Library under this License may add Xan explicit geographical distribution limitation excluding those countries, Xso that distribution is permitted only in or among countries not thus Xexcluded. In such case, this License incorporates the limitation as if Xwritten in the body of this License. X X 13. The Free Software Foundation may publish revised and/or new Xversions of the Lesser General Public License from time to time. XSuch new versions will be similar in spirit to the present version, Xbut may differ in detail to address new problems or concerns. X XEach version is given a distinguishing version number. If the Library Xspecifies a version number of this License which applies to it and X"any later version", you have the option of following the terms and Xconditions either of that version or of any later version published by Xthe Free Software Foundation. If the Library does not specify a Xlicense version number, you may choose any version ever published by Xthe Free Software Foundation. X X 14. If you wish to incorporate parts of the Library into other free Xprograms whose distribution conditions are incompatible with these, Xwrite to the author to ask for permission. For software which is Xcopyrighted by the Free Software Foundation, write to the Free XSoftware Foundation; we sometimes make exceptions for this. Our Xdecision will be guided by the two goals of preserving the free status Xof all derivatives of our free software and of promoting the sharing Xand reuse of software generally. X X NO WARRANTY X X 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO XWARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. XEXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR XOTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY XKIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE XIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR XPURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE XLIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME XTHE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. X X 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN XWRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY XAND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU XFOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR XCONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE XLIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING XRENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A XFAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF XSUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH XDAMAGES. X X END OF TERMS AND CONDITIONS X X How to Apply These Terms to Your New Libraries X X If you develop a new library, and you want it to be of the greatest Xpossible use to the public, we recommend making it free software that Xeveryone can redistribute and change. You can do so by permitting Xredistribution under these terms (or, alternatively, under the terms of the Xordinary General Public License). X X To apply these terms, attach the following notices to the library. It is Xsafest to attach them to the start of each source file to most effectively Xconvey the exclusion of warranty; and each file should have at least the X"copyright" line and a pointer to where the full notice is found. X X X Copyright (C) X X This library is free software; you can redistribute it and/or X modify it under the terms of the GNU Lesser General Public X License as published by the Free Software Foundation; either X version 2.1 of the License, or (at your option) any later version. X X This library is distributed in the hope that it will be useful, X but WITHOUT ANY WARRANTY; without even the implied warranty of X MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU X Lesser General Public License for more details. X X You should have received a copy of the GNU Lesser General Public X License along with this library; if not, write to the Free Software X Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA X XAlso add information on how to contact you by electronic and paper mail. X XYou should also get your employer (if you work as a programmer) or your Xschool, if any, to sign a "copyright disclaimer" for the library, if Xnecessary. Here is a sample; alter the names: X X Yoyodyne, Inc., hereby disclaims all copyright interest in the X library `Frob' (a library for tweaking knobs) written by James Random Hacker. X X , 1 April 1990 X Ty Coon, President of Vice X XThat's all there is to it! X X END-of-star-1.6/LGPL-2.1.txt echo x - star-1.6/GPL-2.0.txt sed 's/^X//' >star-1.6/GPL-2.0.txt << 'END-of-star-1.6/GPL-2.0.txt' X GNU GENERAL PUBLIC LICENSE X Version 2, June 1991 X X Copyright (C) 1991, 1999 Free Software Foundation, Inc. X 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA X Everyone is permitted to copy and distribute verbatim copies X of this license document, but changing it is not allowed. X X Preamble X X The licenses for most software are designed to take away your Xfreedom to share and change it. By contrast, the GNU General Public XLicense is intended to guarantee your freedom to share and change free Xsoftware--to make sure the software is free for all its users. This XGeneral Public License applies to most of the Free Software XFoundation's software and to any other program whose authors commit to Xusing it. (Some other Free Software Foundation software is covered by Xthe GNU Library General Public License instead.) You can apply it to Xyour programs, too. X X When we speak of free software, we are referring to freedom, not Xprice. Our General Public Licenses are designed to make sure that you Xhave the freedom to distribute copies of free software (and charge for Xthis service if you wish), that you receive source code or can get it Xif you want it, that you can change the software or use pieces of it Xin new free programs; and that you know you can do these things. X X To protect your rights, we need to make restrictions that forbid Xanyone to deny you these rights or to ask you to surrender the rights. XThese restrictions translate to certain responsibilities for you if you Xdistribute copies of the software, or if you modify it. X X For example, if you distribute copies of such a program, whether Xgratis or for a fee, you must give the recipients all the rights that Xyou have. You must make sure that they, too, receive or can get the Xsource code. And you must show them these terms so they know their Xrights. X X We protect your rights with two steps: (1) copyright the software, and X(2) offer you this license which gives you legal permission to copy, Xdistribute and/or modify the software. X X Also, for each author's protection and ours, we want to make certain Xthat everyone understands that there is no warranty for this free Xsoftware. If the software is modified by someone else and passed on, we Xwant its recipients to know that what they have is not the original, so Xthat any problems introduced by others will not reflect on the original Xauthors' reputations. X X Finally, any free program is threatened constantly by software Xpatents. We wish to avoid the danger that redistributors of a free Xprogram will individually obtain patent licenses, in effect making the Xprogram proprietary. To prevent this, we have made it clear that any Xpatent must be licensed for everyone's free use or not licensed at all. X X The precise terms and conditions for copying, distribution and Xmodification follow. X X GNU GENERAL PUBLIC LICENSE X TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION X X 0. This License applies to any program or other work which contains Xa notice placed by the copyright holder saying it may be distributed Xunder the terms of this General Public License. The "Program", below, Xrefers to any such program or work, and a "work based on the Program" Xmeans either the Program or any derivative work under copyright law: Xthat is to say, a work containing the Program or a portion of it, Xeither verbatim or with modifications and/or translated into another Xlanguage. (Hereinafter, translation is included without limitation in Xthe term "modification".) Each licensee is addressed as "you". X XActivities other than copying, distribution and modification are not Xcovered by this License; they are outside its scope. The act of Xrunning the Program is not restricted, and the output from the Program Xis covered only if its contents constitute a work based on the XProgram (independent of having been made by running the Program). XWhether that is true depends on what the Program does. X X 1. You may copy and distribute verbatim copies of the Program's Xsource code as you receive it, in any medium, provided that you Xconspicuously and appropriately publish on each copy an appropriate Xcopyright notice and disclaimer of warranty; keep intact all the Xnotices that refer to this License and to the absence of any warranty; Xand give any other recipients of the Program a copy of this License Xalong with the Program. X XYou may charge a fee for the physical act of transferring a copy, and Xyou may at your option offer warranty protection in exchange for a fee. X X 2. You may modify your copy or copies of the Program or any portion Xof it, thus forming a work based on the Program, and copy and Xdistribute such modifications or work under the terms of Section 1 Xabove, provided that you also meet all of these conditions: X X a) You must cause the modified files to carry prominent notices X stating that you changed the files and the date of any change. X X b) You must cause any work that you distribute or publish, that in X whole or in part contains or is derived from the Program or any X part thereof, to be licensed as a whole at no charge to all third X parties under the terms of this License. X X c) If the modified program normally reads commands interactively X when run, you must cause it, when started running for such X interactive use in the most ordinary way, to print or display an X announcement including an appropriate copyright notice and a X notice that there is no warranty (or else, saying that you provide X a warranty) and that users may redistribute the program under X these conditions, and telling the user how to view a copy of this X License. (Exception: if the Program itself is interactive but X does not normally print such an announcement, your work based on X the Program is not required to print an announcement.) X XThese requirements apply to the modified work as a whole. If Xidentifiable sections of that work are not derived from the Program, Xand can be reasonably considered independent and separate works in Xthemselves, then this License, and its terms, do not apply to those Xsections when you distribute them as separate works. But when you Xdistribute the same sections as part of a whole which is a work based Xon the Program, the distribution of the whole must be on the terms of Xthis License, whose permissions for other licensees extend to the Xentire whole, and thus to each and every part regardless of who wrote it. X XThus, it is not the intent of this section to claim rights or contest Xyour rights to work written entirely by you; rather, the intent is to Xexercise the right to control the distribution of derivative or Xcollective works based on the Program. X XIn addition, mere aggregation of another work not based on the Program Xwith the Program (or with a work based on the Program) on a volume of Xa storage or distribution medium does not bring the other work under Xthe scope of this License. X X 3. You may copy and distribute the Program (or a work based on it, Xunder Section 2) in object code or executable form under the terms of XSections 1 and 2 above provided that you also do one of the following: X X a) Accompany it with the complete corresponding machine-readable X source code, which must be distributed under the terms of Sections X 1 and 2 above on a medium customarily used for software interchange; or, X X b) Accompany it with a written offer, valid for at least three X years, to give any third party, for a charge no more than your X cost of physically performing source distribution, a complete X machine-readable copy of the corresponding source code, to be X distributed under the terms of Sections 1 and 2 above on a medium X customarily used for software interchange; or, X X c) Accompany it with the information you received as to the offer X to distribute corresponding source code. (This alternative is X allowed only for noncommercial distribution and only if you X received the program in object code or executable form with such X an offer, in accord with Subsection b above.) X XThe source code for a work means the preferred form of the work for Xmaking modifications to it. For an executable work, complete source Xcode means all the source code for all modules it contains, plus any Xassociated interface definition files, plus the scripts used to Xcontrol compilation and installation of the executable. However, as a Xspecial exception, the source code distributed need not include Xanything that is normally distributed (in either source or binary Xform) with the major components (compiler, kernel, and so on) of the Xoperating system on which the executable runs, unless that component Xitself accompanies the executable. X XIf distribution of executable or object code is made by offering Xaccess to copy from a designated place, then offering equivalent Xaccess to copy the source code from the same place counts as Xdistribution of the source code, even though third parties are not Xcompelled to copy the source along with the object code. X X 4. You may not copy, modify, sublicense, or distribute the Program Xexcept as expressly provided under this License. Any attempt Xotherwise to copy, modify, sublicense or distribute the Program is Xvoid, and will automatically terminate your rights under this License. XHowever, parties who have received copies, or rights, from you under Xthis License will not have their licenses terminated so long as such Xparties remain in full compliance. X X 5. You are not required to accept this License, since you have not Xsigned it. However, nothing else grants you permission to modify or Xdistribute the Program or its derivative works. These actions are Xprohibited by law if you do not accept this License. Therefore, by Xmodifying or distributing the Program (or any work based on the XProgram), you indicate your acceptance of this License to do so, and Xall its terms and conditions for copying, distributing or modifying Xthe Program or works based on it. X X 6. Each time you redistribute the Program (or any work based on the XProgram), the recipient automatically receives a license from the Xoriginal licensor to copy, distribute or modify the Program subject to Xthese terms and conditions. You may not impose any further Xrestrictions on the recipients' exercise of the rights granted herein. XYou are not responsible for enforcing compliance by third parties to Xthis License. X X 7. If, as a consequence of a court judgment or allegation of patent Xinfringement or for any other reason (not limited to patent issues), Xconditions are imposed on you (whether by court order, agreement or Xotherwise) that contradict the conditions of this License, they do not Xexcuse you from the conditions of this License. If you cannot Xdistribute so as to satisfy simultaneously your obligations under this XLicense and any other pertinent obligations, then as a consequence you Xmay not distribute the Program at all. For example, if a patent Xlicense would not permit royalty-free redistribution of the Program by Xall those who receive copies directly or indirectly through you, then Xthe only way you could satisfy both it and this License would be to Xrefrain entirely from distribution of the Program. X XIf any portion of this section is held invalid or unenforceable under Xany particular circumstance, the balance of the section is intended to Xapply and the section as a whole is intended to apply in other Xcircumstances. X XIt is not the purpose of this section to induce you to infringe any Xpatents or other property right claims or to contest validity of any Xsuch claims; this section has the sole purpose of protecting the Xintegrity of the free software distribution system, which is Ximplemented by public license practices. Many people have made Xgenerous contributions to the wide range of software distributed Xthrough that system in reliance on consistent application of that Xsystem; it is up to the author/donor to decide if he or she is willing Xto distribute software through any other system and a licensee cannot Ximpose that choice. X XThis section is intended to make thoroughly clear what is believed to Xbe a consequence of the rest of this License. X X 8. If the distribution and/or use of the Program is restricted in Xcertain countries either by patents or by copyrighted interfaces, the Xoriginal copyright holder who places the Program under this License Xmay add an explicit geographical distribution limitation excluding Xthose countries, so that distribution is permitted only in or among Xcountries not thus excluded. In such case, this License incorporates Xthe limitation as if written in the body of this License. X X 9. The Free Software Foundation may publish revised and/or new versions Xof the General Public License from time to time. Such new versions will Xbe similar in spirit to the present version, but may differ in detail to Xaddress new problems or concerns. X XEach version is given a distinguishing version number. If the Program Xspecifies a version number of this License which applies to it and "any Xlater version", you have the option of following the terms and conditions Xeither of that version or of any later version published by the Free XSoftware Foundation. If the Program does not specify a version number of Xthis License, you may choose any version ever published by the Free Software XFoundation. X X 10. If you wish to incorporate parts of the Program into other free Xprograms whose distribution conditions are different, write to the author Xto ask for permission. For software which is copyrighted by the Free XSoftware Foundation, write to the Free Software Foundation; we sometimes Xmake exceptions for this. Our decision will be guided by the two goals Xof preserving the free status of all derivatives of our free software and Xof promoting the sharing and reuse of software generally. X X NO WARRANTY X X 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY XFOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN XOTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES XPROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED XOR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF XMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS XTO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE XPROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, XREPAIR OR CORRECTION. X X 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING XWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR XREDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, XINCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING XOUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED XTO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY XYOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER XPROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE XPOSSIBILITY OF SUCH DAMAGES. X X END OF TERMS AND CONDITIONS X X How to Apply These Terms to Your New Programs X X If you develop a new program, and you want it to be of the greatest Xpossible use to the public, the best way to achieve this is to make it Xfree software which everyone can redistribute and change under these terms. X X To do so, attach the following notices to the program. It is safest Xto attach them to the start of each source file to most effectively Xconvey the exclusion of warranty; and each file should have at least Xthe "copyright" line and a pointer to where the full notice is found. X X X Copyright (C) X X This program is free software; you can redistribute it and/or modify X it under the terms of the GNU General Public License version 2 X as published by the Free Software Foundation. X X This program is distributed in the hope that it will be useful, X but WITHOUT ANY WARRANTY; without even the implied warranty of X MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X GNU General Public License for more details. X X You should have received a copy of the GNU General Public License X along with this program; if not, write to the Free Software X Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA X X XAlso add information on how to contact you by electronic and paper mail. X XIf the program is interactive, make it output a short notice like this Xwhen it starts in an interactive mode: X X Gnomovision version 69, Copyright (C) year name of author X Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. X This is free software, and you are welcome to redistribute it X under certain conditions; type `show c' for details. X XThe hypothetical commands `show w' and `show c' should show the appropriate Xparts of the General Public License. Of course, the commands you use may Xbe called something other than `show w' and `show c'; they could even be Xmouse-clicks or menu items--whatever suits your program. X XYou should also get your employer (if you work as a programmer) or your Xschool, if any, to sign a "copyright disclaimer" for the program, if Xnecessary. Here is a sample; alter the names: X X Yoyodyne, Inc., hereby disclaims all copyright interest in the program X `Gnomovision' (which makes passes at compilers) written by James Hacker. X X , 1 April 1989 X Ty Coon, President of Vice X XThis General Public License does not permit incorporating your program into Xproprietary programs. If your program is a subroutine library, you may Xconsider it more useful to permit linking proprietary applications with the Xlibrary. If this is what you want to do, use the GNU Library General XPublic License instead of this License. END-of-star-1.6/GPL-2.0.txt echo x - star-1.6/CONTRIBUTING sed 's/^X//' >star-1.6/CONTRIBUTING << 'END-of-star-1.6/CONTRIBUTING' X# @(#)CONTRIBUTING 1.4 14/12/03 Copyright 2006 J. Schilling X XIf you like to send patches or code to add to the project, you are welcome. X XBefore you send code or patches, please make sure that the following Xrequirements apply to your code: X X§1 Your code does not duplicate existing functionality X X§2 Integrating your code does not take more time than it would X take to write it from scratch X X§3 Your code is cleanly written, is byteorder independent and X does compile on all supported platforms X X§4 Your code does not cause this project to break or otherwise X fail on one of the supported platforms X X§5 Your code does not rely on a specific compiler X X§6 Your code is cleanly indented (matches the coding style X from "Cstyle"). See files: X X http://sf.net/projects/schilytools/files/cstyle/Cstyle X and X http://sf.net/projects/schilytools/files/cstyle/cstyle X X§7 You allow me to publish the code under any OSI approved X license (see http://www.opensource.org/). If you like to X see your code under a specific license and this license X grants less freedom than the CDDL, there is little chance X to integrate your code. X X§8 Include not only the code patches but also include the related X extensions to the man pages. X X§9 If you like to make a bigger contribution, provide white papers X and other documentation that allows to understand your patch X within a reasonable amount of time. X XPleae note for §7: Licenses may not last forever and it may sometimes Xbe apropriate to change the license. In case that contributors did Xinsist in a specific license when contributing and are no longer Xreachable via mail, this undertaking may be impossible and kill the Xfuture of the project. So please help with your contributing to ensure Xthe future of this project. X END-of-star-1.6/CONTRIBUTING echo x - star-1.6/Makefile.old sed 's/^X//' >star-1.6/Makefile.old << 'END-of-star-1.6/Makefile.old' X#ident %W% %E% %Q% X########################################################################### XSRCROOT= . XDIRNAME= SRCROOT XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X X#include Targetdirs.$(M_ARCH) X XDIRS= conf inc lib libdeflt librmt star mt rmt star_sym tartest man X X########################################################################### X# Due to a bug in SunPRO make we need special rules for the root makefile X# Xinclude $(SRCROOT)/$(RULESDIR)/rules.rdi X########################################################################### END-of-star-1.6/Makefile.old echo c - star-1.6/pkgdefs mkdir -p star-1.6/pkgdefs > /dev/null 2>&1 echo c - star-1.6/pkgdefs/CSW mkdir -p star-1.6/pkgdefs/CSW > /dev/null 2>&1 echo c - star-1.6/pkgdefs/CSW/CSWstar mkdir -p star-1.6/pkgdefs/CSW/CSWstar > /dev/null 2>&1 echo x - star-1.6/pkgdefs/CSW/CSWstar/Makefile sed 's/^X//' >star-1.6/pkgdefs/CSW/CSWstar/Makefile << 'END-of-star-1.6/pkgdefs/CSW/CSWstar/Makefile' X#ident %W% %E% %Q% X########################################################################### X# Sample makefile for creating SVr4 packages X########################################################################### XSRCROOT= ../../.. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X Xinclude $(SRCROOT)/$(RULESDIR)/rules.csw X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.pkg X########################################################################### END-of-star-1.6/pkgdefs/CSW/CSWstar/Makefile echo x - star-1.6/pkgdefs/CSW/CSWstar/copyright sed 's/^X//' >star-1.6/pkgdefs/CSW/CSWstar/copyright << 'END-of-star-1.6/pkgdefs/CSW/CSWstar/copyright' XCOMMON DEVELOPMENT AND DISTRIBUTION LICENSE Version 1.0 X X1. Definitions. X X 1.1. "Contributor" means each individual or entity that creates X or contributes to the creation of Modifications. X X 1.2. "Contributor Version" means the combination of the Original X Software, prior Modifications used by a Contributor (if any), X and the Modifications made by that particular Contributor. X X 1.3. "Covered Software" means (a) the Original Software, or (b) X Modifications, or (c) the combination of files containing X Original Software with files containing Modifications, in X each case including portions thereof. X X 1.4. "Executable" means the Covered Software in any form other X than Source Code. X X 1.5. "Initial Developer" means the individual or entity that first X makes Original Software available under this License. X X 1.6. "Larger Work" means a work which combines Covered Software or X portions thereof with code not governed by the terms of this X License. X X 1.7. "License" means this document. X X 1.8. "Licensable" means having the right to grant, to the maximum X extent possible, whether at the time of the initial grant or X subsequently acquired, any and all of the rights conveyed X herein. X X 1.9. "Modifications" means the Source Code and Executable form of X any of the following: X X A. Any file that results from an addition to, deletion from or X modification of the contents of a file containing Original X Software or previous Modifications; X X B. Any new file that contains any part of the Original X Software or previous Modifications; or X X C. Any new file that is contributed or otherwise made X available under the terms of this License. X X 1.10. "Original Software" means the Source Code and Executable X form of computer software code that is originally released X under this License. X X 1.11. "Patent Claims" means any patent claim(s), now owned or X hereafter acquired, including without limitation, method, X process, and apparatus claims, in any patent Licensable by X grantor. X X 1.12. "Source Code" means (a) the common form of computer software X code in which modifications are made and (b) associated X documentation included in or with such code. X X 1.13. "You" (or "Your") means an individual or a legal entity X exercising rights under, and complying with all of the terms X of, this License. For legal entities, "You" includes any X entity which controls, is controlled by, or is under common X control with You. For purposes of this definition, X "control" means (a) the power, direct or indirect, to cause X the direction or management of such entity, whether by X contract or otherwise, or (b) ownership of more than fifty X percent (50%) of the outstanding shares or beneficial X ownership of such entity. X X2. License Grants. X X 2.1. The Initial Developer Grant. X X Conditioned upon Your compliance with Section 3.1 below and X subject to third party intellectual property claims, the Initial X Developer hereby grants You a world-wide, royalty-free, X non-exclusive license: X X (a) under intellectual property rights (other than patent or X trademark) Licensable by Initial Developer, to use, X reproduce, modify, display, perform, sublicense and X distribute the Original Software (or portions thereof), X with or without Modifications, and/or as part of a Larger X Work; and X X (b) under Patent Claims infringed by the making, using or X selling of Original Software, to make, have made, use, X practice, sell, and offer for sale, and/or otherwise X dispose of the Original Software (or portions thereof). X X (c) The licenses granted in Sections 2.1(a) and (b) are X effective on the date Initial Developer first distributes X or otherwise makes the Original Software available to a X third party under the terms of this License. X X (d) Notwithstanding Section 2.1(b) above, no patent license is X granted: (1) for code that You delete from the Original X Software, or (2) for infringements caused by: (i) the X modification of the Original Software, or (ii) the X combination of the Original Software with other software X or devices. X X 2.2. Contributor Grant. X X Conditioned upon Your compliance with Section 3.1 below and X subject to third party intellectual property claims, each X Contributor hereby grants You a world-wide, royalty-free, X non-exclusive license: X X (a) under intellectual property rights (other than patent or X trademark) Licensable by Contributor to use, reproduce, X modify, display, perform, sublicense and distribute the X Modifications created by such Contributor (or portions X thereof), either on an unmodified basis, with other X Modifications, as Covered Software and/or as part of a X Larger Work; and X X (b) under Patent Claims infringed by the making, using, or X selling of Modifications made by that Contributor either X alone and/or in combination with its Contributor Version X (or portions of such combination), to make, use, sell, X offer for sale, have made, and/or otherwise dispose of: X (1) Modifications made by that Contributor (or portions X thereof); and (2) the combination of Modifications made by X that Contributor with its Contributor Version (or portions X of such combination). X X (c) The licenses granted in Sections 2.2(a) and 2.2(b) are X effective on the date Contributor first distributes or X otherwise makes the Modifications available to a third X party. X X (d) Notwithstanding Section 2.2(b) above, no patent license is X granted: (1) for any code that Contributor has deleted X from the Contributor Version; (2) for infringements caused X by: (i) third party modifications of Contributor Version, X or (ii) the combination of Modifications made by that X Contributor with other software (except as part of the X Contributor Version) or other devices; or (3) under Patent X Claims infringed by Covered Software in the absence of X Modifications made by that Contributor. X X3. Distribution Obligations. X X 3.1. Availability of Source Code. X X Any Covered Software that You distribute or otherwise make X available in Executable form must also be made available in Source X Code form and that Source Code form must be distributed only under X the terms of this License. You must include a copy of this X License with every copy of the Source Code form of the Covered X Software You distribute or otherwise make available. You must X inform recipients of any such Covered Software in Executable form X as to how they can obtain such Covered Software in Source Code X form in a reasonable manner on or through a medium customarily X used for software exchange. X X 3.2. Modifications. X X The Modifications that You create or to which You contribute are X governed by the terms of this License. You represent that You X believe Your Modifications are Your original creation(s) and/or X You have sufficient rights to grant the rights conveyed by this X License. X X 3.3. Required Notices. X X You must include a notice in each of Your Modifications that X identifies You as the Contributor of the Modification. You may X not remove or alter any copyright, patent or trademark notices X contained within the Covered Software, or any notices of licensing X or any descriptive text giving attribution to any Contributor or X the Initial Developer. X X 3.4. Application of Additional Terms. X X You may not offer or impose any terms on any Covered Software in X Source Code form that alters or restricts the applicable version X of this License or the recipients' rights hereunder. You may X choose to offer, and to charge a fee for, warranty, support, X indemnity or liability obligations to one or more recipients of X Covered Software. However, you may do so only on Your own behalf, X and not on behalf of the Initial Developer or any Contributor. X You must make it absolutely clear that any such warranty, support, X indemnity or liability obligation is offered by You alone, and You X hereby agree to indemnify the Initial Developer and every X Contributor for any liability incurred by the Initial Developer or X such Contributor as a result of warranty, support, indemnity or X liability terms You offer. X X 3.5. Distribution of Executable Versions. X X You may distribute the Executable form of the Covered Software X under the terms of this License or under the terms of a license of X Your choice, which may contain terms different from this License, X provided that You are in compliance with the terms of this License X and that the license for the Executable form does not attempt to X limit or alter the recipient's rights in the Source Code form from X the rights set forth in this License. If You distribute the X Covered Software in Executable form under a different license, You X must make it absolutely clear that any terms which differ from X this License are offered by You alone, not by the Initial X Developer or Contributor. You hereby agree to indemnify the X Initial Developer and every Contributor for any liability incurred X by the Initial Developer or such Contributor as a result of any X such terms You offer. X X 3.6. Larger Works. X X You may create a Larger Work by combining Covered Software with X other code not governed by the terms of this License and X distribute the Larger Work as a single product. In such a case, X You must make sure the requirements of this License are fulfilled X for the Covered Software. X X4. Versions of the License. X X 4.1. New Versions. X X Sun Microsystems, Inc. is the initial license steward and may X publish revised and/or new versions of this License from time to X time. Each version will be given a distinguishing version number. X Except as provided in Section 4.3, no one other than the license X steward has the right to modify this License. X X 4.2. Effect of New Versions. X X You may always continue to use, distribute or otherwise make the X Covered Software available under the terms of the version of the X License under which You originally received the Covered Software. X If the Initial Developer includes a notice in the Original X Software prohibiting it from being distributed or otherwise made X available under any subsequent version of the License, You must X distribute and make the Covered Software available under the terms X of the version of the License under which You originally received X the Covered Software. Otherwise, You may also choose to use, X distribute or otherwise make the Covered Software available under X the terms of any subsequent version of the License published by X the license steward. X X 4.3. Modified Versions. X X When You are an Initial Developer and You want to create a new X license for Your Original Software, You may create and use a X modified version of this License if You: (a) rename the license X and remove any references to the name of the license steward X (except to note that the license differs from this License); and X (b) otherwise make it clear that the license contains terms which X differ from this License. X X5. DISCLAIMER OF WARRANTY. X X COVERED SOFTWARE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" X BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, X INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED X SOFTWARE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR X PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND X PERFORMANCE OF THE COVERED SOFTWARE IS WITH YOU. SHOULD ANY X COVERED SOFTWARE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE X INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY X NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF X WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF X ANY COVERED SOFTWARE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS X DISCLAIMER. X X6. TERMINATION. X X 6.1. This License and the rights granted hereunder will terminate X automatically if You fail to comply with terms herein and fail to X cure such breach within 30 days of becoming aware of the breach. X Provisions which, by their nature, must remain in effect beyond X the termination of this License shall survive. X X 6.2. If You assert a patent infringement claim (excluding X declaratory judgment actions) against Initial Developer or a X Contributor (the Initial Developer or Contributor against whom You X assert such claim is referred to as "Participant") alleging that X the Participant Software (meaning the Contributor Version where X the Participant is a Contributor or the Original Software where X the Participant is the Initial Developer) directly or indirectly X infringes any patent, then any and all rights granted directly or X indirectly to You by such Participant, the Initial Developer (if X the Initial Developer is not the Participant) and all Contributors X under Sections 2.1 and/or 2.2 of this License shall, upon 60 days X notice from Participant terminate prospectively and automatically X at the expiration of such 60 day notice period, unless if within X such 60 day period You withdraw Your claim with respect to the X Participant Software against such Participant either unilaterally X or pursuant to a written agreement with Participant. X X 6.3. In the event of termination under Sections 6.1 or 6.2 above, X all end user licenses that have been validly granted by You or any X distributor hereunder prior to termination (excluding licenses X granted to You by any distributor) shall survive termination. X X7. LIMITATION OF LIABILITY. X X UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT X (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE X INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF X COVERED SOFTWARE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE X LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR X CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT X LIMITATION, DAMAGES FOR LOST PROFITS, LOSS OF GOODWILL, WORK X STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER X COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN X INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF X LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL X INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT X APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO X NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR X CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT X APPLY TO YOU. X X8. U.S. GOVERNMENT END USERS. X X The Covered Software is a "commercial item," as that term is X defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial X computer software" (as that term is defined at 48 X C.F.R. 252.227-7014(a)(1)) and "commercial computer software X documentation" as such terms are used in 48 C.F.R. 12.212 X (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 X C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all X U.S. Government End Users acquire Covered Software with only those X rights set forth herein. This U.S. Government Rights clause is in X lieu of, and supersedes, any other FAR, DFAR, or other clause or X provision that addresses Government rights in computer software X under this License. X X9. MISCELLANEOUS. X X This License represents the complete agreement concerning subject X matter hereof. If any provision of this License is held to be X unenforceable, such provision shall be reformed only to the extent X necessary to make it enforceable. This License shall be governed X by the law of the jurisdiction specified in a notice contained X within the Original Software (except to the extent applicable law, X if any, provides otherwise), excluding such jurisdiction's X conflict-of-law provisions. Any litigation relating to this X License shall be subject to the jurisdiction of the courts located X in the jurisdiction and venue specified in a notice contained X within the Original Software, with the losing party responsible X for costs, including, without limitation, court costs and X reasonable attorneys' fees and expenses. The application of the X United Nations Convention on Contracts for the International Sale X of Goods is expressly excluded. Any law or regulation which X provides that the language of a contract shall be construed X against the drafter shall not apply to this License. You agree X that You alone are responsible for compliance with the United X States export administration regulations (and the export control X laws and regulation of any other countries) when You use, X distribute or otherwise make available any Covered Software. X X10. RESPONSIBILITY FOR CLAIMS. X X As between Initial Developer and the Contributors, each party is X responsible for claims and damages arising, directly or X indirectly, out of its utilization of rights under this License X and You agree to work with Initial Developer and Contributors to X distribute such responsibility on an equitable basis. Nothing X herein is intended or shall be deemed to constitute any admission X of liability. X X-------------------------------------------------------------------- X XNOTICE PURSUANT TO SECTION 9 OF THE COMMON DEVELOPMENT AND XDISTRIBUTION LICENSE (CDDL) X XFor Covered Software in this distribution, this License shall Xbe governed by the laws of Germany (excluding conflict-of-law Xprovisions). X XAny litigation relating to this License shall be subject to the Xjurisdiction and the courts of Berlin Germany, with venue lying Xin Berlin Germany. END-of-star-1.6/pkgdefs/CSW/CSWstar/copyright echo x - star-1.6/pkgdefs/CSW/CSWstar/depend sed 's/^X//' >star-1.6/pkgdefs/CSW/CSWstar/depend << 'END-of-star-1.6/pkgdefs/CSW/CSWstar/depend' XP CSWcommon common - common files and dirs for CSW packages XP CSWschilybase Basic framework from J. Schilling XP CSWschilyutils A collection of utilities from J. Schilling XP SUNWcsl Core Solaris, (Shared Libs) XP SUNWcsr Core Solaris, (Root) END-of-star-1.6/pkgdefs/CSW/CSWstar/depend echo x - star-1.6/pkgdefs/CSW/CSWstar/pkginfo sed 's/^X//' >star-1.6/pkgdefs/CSW/CSWstar/pkginfo << 'END-of-star-1.6/pkgdefs/CSW/CSWstar/pkginfo' XARCH=i386 XPKG=CSWstar X#PKG=XXXstar XNAME=star - Standard TAR (a POSIX compliant TAR and a configurable secure RMT remote tape server) XVERSION=1.5a81,REV=2006.07.30 XCATEGORY=application XVENDOR=http://cdrecord.berlios.de/old/private/star.html packaged for CSW by Jörg Schilling XHOTLINE=http://www.blastwave.org/bugtrack/ XEMAIL=joerg@blastwave.org XBASEDIR=/opt/csw END-of-star-1.6/pkgdefs/CSW/CSWstar/pkginfo echo x - star-1.6/pkgdefs/CSW/CSWstar/prototype sed 's/^X//' >star-1.6/pkgdefs/CSW/CSWstar/prototype << 'END-of-star-1.6/pkgdefs/CSW/CSWstar/prototype' Xi pkginfo Xi depend Xi copyright Xd none bin ? ? ? Xf none bin/star 4711 root bin Xs none bin/ustar=star Xs none bin/gnutar=star Xs none bin/scpio=star Xs none bin/spax=star Xs none bin/suntar=star Xs none bin/tar=star Xf none bin/star_sym 0755 root bin Xf none bin/smt 0755 root bin Xs none bin/mt=smt Xf none bin/tartest 0755 root bin Xd none sbin ? ? ? Xf none sbin/rmt 0755 root bin Xd none share ? ? ? Xd none share/man ? ? ? Xd none share/man/man1 ? ? ? Xf none share/man/man1/smt.1 0444 root bin Xf none share/man/man1/star.1 0444 root bin Xf none share/man/man1/gnutar.1 0444 root bin Xf none share/man/man1/scpio.1 0444 root bin Xf none share/man/man1/spax.1 0444 root bin Xf none share/man/man1/suntar.1 0444 root bin Xf none share/man/man1/rmt.1 0444 root bin Xf none share/man/man1/tartest.1 0444 root bin Xd none share/man/man4 ? ? ? Xf none share/man/man4/star.4 0444 root bin Xd none share/doc ? ? ? Xd none share/doc/rmt 0755 root bin Xf none share/doc/rmt/default-rmt.sample 0644 root bin Xd none share/doc/star 0755 root bin Xd none share/doc/star/testscripts 0755 root bin Xf none share/doc/star/testscripts/00INDEX 0644 root bin Xf none share/doc/star/testscripts/100char_longlink.tar 0644 root bin Xf none share/doc/star/testscripts/100char_longlink.tar-non-compliant 0644 root bin Xf none share/doc/star/testscripts/README.create-and-remove 0644 root bin Xf none share/doc/star/testscripts/README.gtarfail 0644 root bin Xf none share/doc/star/testscripts/README.largefiles 0644 root bin Xf none share/doc/star/testscripts/README.longnames 0644 root bin Xf none share/doc/star/testscripts/README.paxbug 0644 root bin Xf none share/doc/star/testscripts/README.quicktest 0644 root bin Xf none share/doc/star/testscripts/create-and-remove.tar 0644 root bin Xf none share/doc/star/testscripts/dirloop.tar 0644 root bin Xf none share/doc/star/testscripts/g-hdr.pax.gz 0644 root bin Xf none share/doc/star/testscripts/gtarfail.tar 0644 root bin Xf none share/doc/star/testscripts/gtarfail2.tar 0644 root bin Xf none share/doc/star/testscripts/long.ustar.gz 0644 root bin Xf none share/doc/star/testscripts/mk 0755 root bin Xf none share/doc/star/testscripts/mk2 0755 root bin Xf none share/doc/star/testscripts/not_a_tar_file 0644 root bin Xf none share/doc/star/testscripts/not_a_tar_file2 0644 root bin Xf none share/doc/star/testscripts/old-file.tar 0644 root bin Xf none share/doc/star/testscripts/remove.tar 0644 root bin Xf none share/doc/star/testscripts/pax-big-10g.tar.bz2 0644 root bin Xf none share/doc/star/testscripts/quicktest.filelist 0644 root bin Xf none share/doc/star/testscripts/tartest-quicktest.out 0644 root bin Xf none share/doc/star/testscripts/typescript 0644 root bin Xf none share/doc/star/testscripts/ustar-all-filetypes.tar 0644 root bin Xf none share/doc/star/testscripts/ustar-all-quicktest-past-contig.tar 0644 root bin Xf none share/doc/star/testscripts/ustar-all-quicktest.tar 0644 root bin Xf none share/doc/star/testscripts/ustar-all-quicktest.tar-without-cont-file 0644 root bin Xf none share/doc/star/testscripts/ustar-bad-filetypes.tar 0644 root bin Xf none share/doc/star/testscripts/ustar-bad-signedsum.tar 0644 root bin Xf none share/doc/star/testscripts/ustar-big-2g.tar.bz2 0644 root bin Xf none share/doc/star/testscripts/ustar-big-8g.tar.bz2 0644 root bin Xf none share/doc/star/README 0644 root bin Xf none share/doc/star/README.ACL 0644 root bin X#f none share/doc/star/README.SSPM 0644 root bin X#f none share/doc/star/README.compile 0644 root bin Xf none share/doc/star/README.crash 0644 root bin Xf none share/doc/star/README.largefiles 0644 root bin Xf none share/doc/star/README.mtio 0644 root bin Xf none share/doc/star/README.otherbugs 0644 root bin Xf none share/doc/star/README.pattern 0644 root bin Xf none share/doc/star/README.posix-2001 0644 root bin X#f none share/doc/star/README.solaris 0644 root bin X#f none share/doc/star/README.sunos 0644 root bin Xf none share/doc/star/STARvsGNUTAR 0644 root bin Xs none man=share/man END-of-star-1.6/pkgdefs/CSW/CSWstar/prototype echo x - star-1.6/Mcsw sed 's/^X//' >star-1.6/Mcsw << 'END-of-star-1.6/Mcsw' X#ident %W% %E% %Q% X########################################################################### Xdeftgt: XSRCROOT= . XDIRNAME= SRCROOT XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X X#include $(SRCROOT)/TARGETS/Targetdirs_s X#DIRS= lib/.aonly libdeflt libscg libedc X XPROJECTNAME= CSWschily-10.06.2006 XTARGET_AR= opt-schily-0.99 XINS_BASE= /opt/csw XCOPTX="-DSEEK_DATA=3 -DSEEK_HOLE=4 -D_PC_MIN_HOLE_SIZE=21 -DNO_DOIT" X Xdeftgt: X $(MAKE) -f Mcsw INS_BASE=$(INS_BASE) COPTX=$(COPTX) all X $(MAKE) -f Mcsw INS_BASE=$(INS_BASE) COPTX=$(COPTX) all X #$(MAKE) -f Mcsw INS_BASE=/ COPTX=$(COPTX) pkg1 X $(MAKE) -f Mcsw INS_BASE=$(INS_BASE) COPTX=$(COPTX) pkg1 X fakeroot '$(MAKE) -f Mcsw INS_BASE=$(INS_BASE) COPTX=$(COPTX) package PKGTYPE=CSW' X XSTRIPLIST= ./$(INS_BASE)/*bin/* ./$(INS_BASE)/ccs/bin/* XSTRIPXLIST= ./$(INS_BASE)/lib/*.so.* XMCSLIST= $(STRIPLIST) $(STRIPXLIST) XMAKE_FILE= -f Mcsw XPRE_INST_CMDS= mkdir -p etc/default XPOST_INST_CMDS= mkdir -p usr/bin; \ X (cd usr/bin; ln -s ../../$(INS_BASE)/bin/* . ; rm -f cut paste label tar mt); \ X (cd ./$(INS_BASE)/bin; ln -s ../ccs/bin/sccs sccs); \ X mkdir -p usr/ccs/bin; \ X mv ./$(INS_BASE)/etc/default/* etc/default XPOST_STRIP_CMDS= chmod -f u=rwx,g=x,o=x,u+s \ X ./$(INS_BASE)/bin/readcd ./$(INS_BASE)/bin/cdda2wav \ X ./$(INS_BASE)/bin/smt ./$(INS_BASE)/bin/sdd \ X ./$(INS_BASE)/bin/star ./$(INS_BASE)/bin/cdrecord \ X ./$(INS_BASE)/sbin/rscsi ;\ X chmod -f u=rx,g=rx,o=rx ./$(INS_BASE)/lib/lib*.so.* X X#POST_STRIP_CMDS= chmod u=rx,g=rx,o=rx ./$(INS_BASE)/lib/lib*.so.* X X########################################################################### X# Due to a bug in SunPRO make we need special rules for the root makefile X# X#include $(SRCROOT)/$(RULESDIR)/rules.tpk Xinclude $(SRCROOT)/$(RULESDIR)/rules.pkg Xinclude $(SRCROOT)/$(RULESDIR)/rules.rdi X########################################################################### END-of-star-1.6/Mcsw echo c - star-1.6/proto mkdir -p star-1.6/proto > /dev/null 2>&1 echo c - star-1.6/packages mkdir -p star-1.6/packages > /dev/null 2>&1 echo x - star-1.6/AN-1.5.1 sed 's/^X//' >star-1.6/AN-1.5.1 << 'END-of-star-1.6/AN-1.5.1' XStar is the fastest tar archiver for UNIX X XStar has many improvements compared to other tar Ximplementations (including gnu tar). See below for a short description Xof the highlight of star. X XStar is located on: X Xftp://ftp.berlios.de/pub/star X XChanges since star-1.5: X X/*--------------------------------------------------------------------------*/ XBetween star-1.5 and star-1.5.1, there have been mostly changes that enhance Xthe portability and stability. X X- New support for ATARI-ST using FreeMiNT X X- New support for Haiku X X- New support for Syllable X X- New support for Cygwin on Vista-64-Bit platforms X X- New support for DragonFly BSD X X- Added support for 64 bit compilation on HP-HX using "cc". X Use make CCOM=cc64 as usual to switch to 64 bit compilation. X X- Added support for 64 bit compilation on IRIX using "cc" and "gcc". X Use make CCOM=cc64 or CCOM=gcc64 as usual to switch to 64 bit compilation. X X- Enhanced config.guess to support DragonFly BSD and OpenVMS X X- The build exnvironment is cleaned up if the compilation is controlled X by smake or gmake (LC_* are set to "C"). X X- Added GMAKE_NOWARN=true to allow to disable the gmake warning X X- Now supporting dynamic libraries on Mac OS X X X- Avoid problems with tr(1) when compiling with gmake os SunPro-Make. X X- Avoid simple suffix rules for smake to speed up implicit rule search. X X- Added rules for OpenVMS X X- Enhanced include/schily/priv.h to distinct Solaris and AIX process privileges X X- New file include/schily/math.h X X- New file include/schily/dbgmalloc.h X X- VMS specific devide definitions have been added to include/schily/device.h X X- The file include/schily/wait.h now uses definitions that better deal with X platforms that have both: "union wait" and a POSIX style "int *" wait(2) X parameter. X X- Beware in include/schily/utypes.h: VMS on VAX has no long long X X- The file include/schily/vfork.h adds definitions to allow to use vfork() X on VMS X X- Schily autoconf now implements a better way to check whether a function X is defined in libc and avoids to define -lc for the related library name. X X- Schily autoconf now implements a better check gor bash that includes X support for bash-1.x that is still used on OpenVMS. X X- Schily autoconf now checks for struct utsname.arch to support VMS X X- Schily autoconf now implements a better check for opendir() and a related X library name. X X- Schily autoconf now implements a vfork() check that does not hang X infinitely on OpenVMS X X- conf/oarch.sh was enhanced to match the code in the make file rules. X X- New align test for long double in incs/align_test.c X X- New "max align" type in incs/align_test.c X X- libschily/*bytes.c now support 64 bit compilation and use a "ssize_t" X typed count parameter instead of "int". X X- libschily/fconv.c now contains better support for isinf()/isnan() X for several platforms that do not offer a C99 complient base. X This includes HP-UX 11.11 and newer AIX versions. X There now are local macros as a fallback that work for IEEE compliant X floating point coding. X X- The libshcily/fexec*() functions now use a I/O redirection method X that is compatible with the vfork() behavior on OpenVMS. X X- libfind was rewritten to use vfork() instead of fork() to allow to X support OpenVMS. X X- fixed a typo in libfind/idcache.c X X- Added $(LIB_ACL_TEST) to the libs for libfind to allow a shared libfind X with ACL support on Linux. X X- fixed a bug in star that caused star to print the list output X on stderr if the archive was read from stdin. X X- star -c -dump -acl -find . X now works correctly as it now uses short names for retrieving ACLs. X- star H=help now marks the default archive type X X- star does no longer allow to read/write the archive data from/to a X terminal X X- tartest and star_sym now include a -version option X X- star_sym no honors the autoconf result HAVE_FCHDIR X X- Fixed a bug in star introduced with the new check for: X "Archive cannot be a tty." that could cause star to dump X core when in copy mode. X X- star now better checks the parameter for the -s substitute option. X This is needed in order to catch typos in arg lists. X X- star check for same filedescriptor on archive and stdout had a typo X that caused undfined behavior and sometimes star -tv output did go to X stderr. X X- star/checkerr.c now correctly handles the "WARN" directive. X X- star -C missing-dir now correctly sets the exitcode from star X X- star -C missing-dir may now be handled by a new errctl= tag "CHRDIR" X X- star -X is now working correctly, thanks to a Johannes Geiss X who detected a copy/paste error made while -X was copied from list= X X- Correctly abort the FIFO in cdrecord and star on BeOS and Haiku X in case that the clone ara cannot be made shared. X X- The directory "testscripts" has been renamed to "star/testscripts" X X- Fixed the debug print code in the sparse file handling code to X use %zd instead of just %d for size_t parameters. X X- star/fifo.c rewritten to avoid a core dump from the optimizer program X of the SGI IRIX C-compiler. X X- Added autoconf test to distinct Linux ACLs from IRIX ACLs X X- let libfind deal with the differences between Linux ACLs and IRIX ACLs X X X XTODO: X X - Complete the man page for spax X X - Implement multi volume continuation headers that work for X files > 8 GB where the last tar header X (a POSIX.1-2001 'x'-header) was split across volumes. X In this case, if only POSIX compliant TAR features are allowed, X the extracting TAR would not be able to correctly skip the X large file as it does not know the content of the POSIX.1-2001 X 'x'-header. For this reason, later star versions need to implement X a method to create multi volume continuation (skip) headers that X include the size of the split POSIX.1-2001 'x'-header and the X size of the following large file. X X Note that even with this method we would need a new method X (different from the current bitmap) to deal with multi volume X continuation headers for split files in case the FIFO in star X may be larger than 8 GB. X X - Implement a autoconf extension to to deal with Linux with XFS X where not all ACL handling is inside -lacl ??? is this still true? X XRevision history (short) X X1982 First version on UNOS (extract only) X1985 Port to UNIX (fully functional version) X1985 Added pre Posix method of handling special files/devices X1986 First experiments with fifo as external process. X1993 Remote tape access X1993 diff option X1994 Fifo with shared memory integrated into star X1994 Very long filenames and sparse files X1994 Gnutar and Ustar(Posix.1-1988) handling added X1994 Xstar format (extended Posix.1-1988) defined and introduced X1995 Ported to many platforms X1999 Support for Win32 (Cygwin) X1999 base 256 support to overcome limitation with octal fields X2001 Large file support X2001 Support for POSIX.1-2001 extended headers X2001 Support for ACLs in POSIX.1-2001 extended headers X2002 Support for extended file flags in POSIX.1-2001 extended headers X2002 Support for extended inode meta data and meta files X2003 New program tartest allows to verify POSIX.1-1990 tar archive compliance X2003 Error control added to allow to selectively ignore error contitions X2003 ED like pattern based file name substitution with -s '/from/to/[gp]' X2003 Efficient built in -copy mode X2003 Basic support for incremental dumps (incremental restore not yet ready) X2003 CPIO archive support X2003 New command 'pax/spax' for POSIX.1 command line compatibility. X2003 New command 'cpio/scpio' for SUSv2 command line compatibility. X2003 New command 'suntar' for Solaris command line compatibility. X2003 New command 'gnutar' for GNU tar command line compatibility. X2003 Support for reliable multi-volume archives with media size detection X2005 Support for full and incremental dumps and restores. X2005 The find(1) code has been integrated via libfind and allows to use find on archives X2005 Changed license from GPL to CDDL X2005 Added support for a reliable sparse file interface in Solaris X XSupported platforms: X XVirtually any! Known to work: X XSunOS 4.x, Solaris (SunOS 5.x), Linux, XHP-UX, DG/UX, IRIX, AIX, FreeBSD, NetBSD, OpenBSD, XOSF-1, True-64, QNX, BeOS, Apollo Domain/OS, Next-STep, XOS/2, SCO-openserver, SCO-unixware, Caldera OpenUnix, XCygwin (Win32), Sony NewsOS, BSDi (BSD/OS), QNX, XApple Rhapsody, MacOS X, AmigaOS, GNU Hurd X XJoerg X X------------------------------------------------------------- XStar is the fastest known implementation of a tar archiver. X XStar development started 1982, the first complete implementation has Xbeen done in 1985. I never did my backups with other tools than star. X XIts main advantages over other tar implementations are: X X fifo - keeps the tape streaming. X This gives you faster backups than X you can achieve with ufsdump, if the X size of the filesystem is > 1 GByte. X X remote tape support - a fast RMT implementation that has no X probems to saturate a 100 Mb/s network. X X accurate sparse files - star is able to reproduce holes in sparse X files accurately if the OS includes X the needed support functions. This is X currently true for Solaris-2.3 to X Solaris-2.5.1 X X pattern matcher - for a convenient user interface X (see manual page for more details). X To archive/extract a subset of files. X X sophisticated diff - user tailorable interface for comparing X tar archives against file trees X This is one of the most interesting parts X of the star implementation. X X no namelen limitation - Pathnames up to 1024 Bytes may be archived. X (The same limitation applies to linknames) X This limit may be expanded in future X without changing the method to record X long names. X X deals with all 3 times - stores/restores all 3 times of a file X (even creation time) X With POSIX.1-2001 the times are in nanosecond X granularity. X Star may reset access time after doing X backup. On Solaris this can be done without X changing the ctime. X X does not clobber files - more recent copies on disk will not be X clobbered from tape X This may be the main advantage over other X tar implementations. This allows X automatically repairing of corruptions X after a crash & fsck (Check for differences X after doing this with the diff option). X X automatic byte swap - star automatically detects swapped archives X and transparently reads them the right way X X automatic format detect - star automatically detects several common X archive formats and adopts to them. X Supported archive types are: X Old tar, gnu tar, ansi tar, star, X POSIX.1-2001 PAX, Sun's Solaris tar. X X X automatic compression detect - star automatically detects whether the X archive is compressed. If it has been X compressed with a compression program that X is compatible to decompression with "gzip" X or "bzip2", star automatically activates X decompression. X X fully ansi compatible - Star is fully ANSI/Posix 1003.1 compatible. X See README.otherbugs for a complete X description of bugs found in other tar X implementations. Star is the first tar X implementation that supports POSIX.1-2001. X X support for ACLs and file flags - star supports Access Control Lists X and extended file flags (as found on FreeBSD X and Linux). Support to archive and restore X other file properties may be easily added. X X support for all inode metadata - star supports to put all inode X metadata on the archive. This allows future X versions of star to perform true X incremental dumps. X X sophisticated error control - allows to tell star which error types X should be ignored for wich file name pattern. X This allows to write backup scripts that give X no error messages for all problems that are X tolerable (e.g. growing log files). X X ED like filename substitution - star supports automated pattern rule based X file name substitution as documented for 'pax'. X X A fast built in -copy mode - allows to make fast and accurate copies and X directory tree comparisons. X X Integrated find(1) code - allows many interesting new features that would X be possible with a separate find call. X XHave a look at the manual page, it is included in the distribution. X END-of-star-1.6/AN-1.5.1 echo x - star-1.6/.links sed 's/^X//' >star-1.6/.links << 'END-of-star-1.6/.links' X./RULES/9000-710-hp-ux-cc.rul X./RULES/9000-710-hp-ux-cc64.rul X./RULES/9000-710-hp-ux-gcc.rul X./RULES/9000-712-hp-ux-cc.rul X./RULES/9000-712-hp-ux-cc64.rul X./RULES/9000-712-hp-ux-gcc.rul X./RULES/9000-715-hp-ux-cc.rul X./RULES/9000-715-hp-ux-cc64.rul X./RULES/9000-715-hp-ux-gcc.rul X./RULES/9000-725-hp-ux-cc64.rul X./RULES/9000-735-hp-ux-cc.rul X./RULES/9000-735-hp-ux-cc64.rul X./RULES/9000-735-hp-ux-gcc.rul X./RULES/9000-743-hp-ux-cc.rul X./RULES/9000-743-hp-ux-cc64.rul X./RULES/9000-743-hp-ux-gcc.rul X./RULES/9000-755-hp-ux-cc.rul X./RULES/9000-755-hp-ux-cc64.rul X./RULES/9000-755-hp-ux-gcc.rul X./RULES/9000-777-hp-ux-cc.rul X./RULES/9000-777-hp-ux-cc64.rul X./RULES/9000-777-hp-ux-gcc.rul X./RULES/9000-778-hp-ux-cc.rul X./RULES/9000-778-hp-ux-cc64.rul X./RULES/9000-778-hp-ux-gcc.rul X./RULES/9000-780-hp-ux-cc.rul X./RULES/9000-780-hp-ux-cc64.rul X./RULES/9000-780-hp-ux-gcc.rul X./RULES/9000-782-hp-ux-cc.rul X./RULES/9000-782-hp-ux-cc64.rul X./RULES/9000-782-hp-ux-gcc.rul X./RULES/9000-785-hp-ux-cc.rul X./RULES/9000-785-hp-ux-cc64.rul X./RULES/9000-785-hp-ux-gcc.rul X./RULES/9000-800-hp-ux-cc.rul X./RULES/9000-800-hp-ux-cc64.rul X./RULES/9000-800-hp-ux-gcc.rul X./RULES/9000-820-hp-ux-cc.rul X./RULES/9000-820-hp-ux-cc64.rul X./RULES/9000-820-hp-ux-gcc.rul X./RULES/9000-831-hp-ux-cc.rul X./RULES/9000-831-hp-ux-cc64.rul X./RULES/9000-831-hp-ux-gcc.rul X./RULES/9000-899-hp-ux-cc.rul X./RULES/9000-899-hp-ux-cc64.rul X./RULES/9000-899-hp-ux-gcc.rul X./RULES/aarch64-linux-cc.rul X./RULES/aarch64-linux-clang.rul X./RULES/aarch64-linux-clang32.rul X./RULES/aarch64-linux-clang64.rul X./RULES/aarch64-linux-gcc.rul X./RULES/aarch64-linux-gcc32.rul X./RULES/aarch64-linux-gcc64.rul X./RULES/aarch64-sunos5-clang.rul X./RULES/aarch64-sunos5-clang32.rul X./RULES/aarch64-sunos5-clang64.rul X./RULES/aarch64-sunos5-gcc.rul X./RULES/aarch64-sunos5-gcc32.rul X./RULES/aarch64-sunos5-gcc64.rul X./RULES/alpha-linux-cc.rul X./RULES/alpha-linux-gcc.rul X./RULES/alpha-netbsd-cc.rul X./RULES/alpha-netbsd-gcc.rul X./RULES/sparc-netbsd-clang64.rul X./RULES/amd64-netbsd-clang.rul X./RULES/amd64-netbsd-clang32.rul X./RULES/amd64-netbsd-clang64.rul X./RULES/alpha-netbsd-clang.rul X./RULES/alpha-netbsd-clang32.rul X./RULES/alpha-netbsd-clang64.rul X./RULES/sparc-netbsd-clang.rul X./RULES/sparc-netbsd-clang32.rul X./RULES/amd64-netbsd-gcc32.rul X./RULES/amd64-netbsd-gcc64.rul X./RULES/alpha-netbsd-cc32.rul X./RULES/alpha-netbsd-cc64.rul X./RULES/alpha-netbsd-gcc32.rul X./RULES/alpha-netbsd-gcc64.rul X./RULES/sparc-netbsd-cc32.rul X./RULES/sparc-netbsd-cc64.rul X./RULES/sparc-netbsd-gcc32.rul X./RULES/sparc-netbsd-gcc64.rul X./RULES/amd64-netbsd-cc32.rul X./RULES/amd64-netbsd-cc64.rul X./RULES/alphaserver_ds20_500_mhz-openvms-cc.rul X./RULES/amd64-bitrig-clang32.rul X./RULES/amd64-bitrig-clang64.rul X./RULES/amd64-freebsd-cc.rul X./RULES/amd64-freebsd-clang.rul X./RULES/amd64-freebsd-clang32.rul X./RULES/amd64-freebsd-clang64.rul X./RULES/amd64-freebsd-gcc.rul X./RULES/amd64-gnu-kfreebsd-cc.rul X./RULES/amd64-gnu-kfreebsd-gcc.rul X./RULES/amd64-gnu-kfreebsd-gcc32.rul X./RULES/amd64-netbsd-cc.rul X./RULES/amd64-netbsd-gcc.rul X./RULES/amd64-openbsd-cc.rul X./RULES/amd64-openbsd-gcc.rul X./RULES/amiga-netbsd-cc.rul X./RULES/amiga-netbsd-gcc.rul X./RULES/aranym-freemint-gcc.rul X./RULES/arm64-freebsd-clang.rul X./RULES/arm64-freebsd-clang32.rul X./RULES/arm64-freebsd-clang64.rul X./RULES/armv4l-linux-cc.rul X./RULES/armv4l-linux-gcc.rul X./RULES/armv4tl-linux-cc.rul X./RULES/armv4tl-linux-gcc.rul X./RULES/armv5l-linux-cc.rul X./RULES/armv5l-linux-gcc.rul X./RULES/armv5teb-linux-cc.rul X./RULES/armv5teb-linux-gcc.rul X./RULES/armv5tejl-linux-cc.rul X./RULES/armv5tejl-linux-gcc.rul X./RULES/armv5tel-linux-cc.rul X./RULES/armv5tel-linux-gcc.rul X./RULES/armv6l-linux-cc.rul X./RULES/armv6l-linux-gcc.rul X./RULES/armv7l-linux-cc.rul X./RULES/armv7l-linux-gcc.rul X./RULES/atariclone-freemint-gcc.rul X./RULES/atariste-freemint-gcc.rul X./RULES/ataritt-freemint-gcc.rul X./RULES/bemac-beos-gcc.rul X./RULES/bemac-haiku-cc.rul X./RULES/bemac-haiku-gcc.rul X./RULES/cc-clang32.rul X./RULES/cc-clang64.rul X./RULES/cc-gcc32.rul X./RULES/cc-gcc64.rul X./RULES/cc-ibm32.rul X./RULES/cc-ibm64.rul X./RULES/cc-sunpro32.rul X./RULES/cc-sunpro64.rul X./RULES/falcon-freemint-gcc.rul X./RULES/hades-freemint-gcc.rul X./RULES/i386-bitrig-clang.rul X./RULES/i386-cygwin32_nt-cc.rul X./RULES/i386-cygwin32_nt-cl.rul X./RULES/i386-cygwin32_nt-gcc.rul X./RULES/i386-darwin-cc.rul X./RULES/i386-darwin-cc32.rul X./RULES/i386-darwin-cc64.rul X./RULES/i386-darwin-clang32.rul X./RULES/i386-darwin-clang64.rul X./RULES/i386-darwin-gcc.rul X./RULES/i386-darwin-gcc32.rul X./RULES/i386-darwin-gcc64.rul X./RULES/i386-dragonfly-cc.rul X./RULES/i386-dragonfly-gcc.rul X./RULES/i386-freebsd-clang32.rul X./RULES/i386-freebsd-clang64.rul X./RULES/i386-gnu-kfreebsd-cc.rul X./RULES/i386-gnu-kfreebsd-gcc.rul X./RULES/i386-linux-cc.rul X./RULES/i386-linux-gcc.rul X./RULES/i386-linux-suncc.rul X./RULES/i386-nextstep-cc.rul X./RULES/i386-nextstep-gcc.rul X./RULES/i486-cygwin32_nt-cc32.rul X./RULES/i486-cygwin32_nt-cc64.rul X./RULES/i486-cygwin32_nt-gcc32.rul X./RULES/i486-cygwin32_nt-gcc64.rul X./RULES/i486-gnu-kfreebsd-cc.rul X./RULES/i486-gnu-kfreebsd-gcc.rul X./RULES/i486-linux-cc.rul X./RULES/i486-linux-gcc.rul X./RULES/i486-linux-suncc.rul X./RULES/i486-ms-dos-gcc.rul X./RULES/i486-unixware-cc.rul X./RULES/i486-unixware-gcc.rul X./RULES/i586-cygwin32_nt-cc.rul X./RULES/i586-cygwin32_nt-cl.rul X./RULES/i586-cygwin32_nt-gcc.rul X./RULES/i586-gnu-kfreebsd-cc.rul X./RULES/i586-gnu-kfreebsd-gcc.rul X./RULES/i586-linux-cc64.rul X./RULES/i586-linux-clang32.rul X./RULES/i586-linux-clang64.rul X./RULES/i586-linux-gcc32.rul X./RULES/i586-linux-gcc64.rul X./RULES/i586-linux-suncc32.rul X./RULES/i586-linux-suncc64.rul X./RULES/i586-ms-dos-gcc.rul X./RULES/i586-unixware-cc.rul X./RULES/i586-unixware-gcc.rul X./RULES/i686-at386-gnu-cc.rul X./RULES/i686-at386-gnu-gcc.rul X./RULES/i686-cygwin32_nt-cc.rul X./RULES/i686-cygwin32_nt-cl.rul X./RULES/i686-cygwin32_nt-cl64.rul X./RULES/i686-cygwin32_nt-gcc.rul X./RULES/i686-cygwin32_wow-cc.rul X./RULES/i686-cygwin32_wow-cc64.rul X./RULES/i686-cygwin32_wow-cl.rul X./RULES/i686-cygwin32_wow-cl64.rul X./RULES/i686-cygwin32_wow-gcc.rul X./RULES/i686-cygwin32_wow-gcc64.rul X./RULES/i686-cygwin32_wow64-cc.rul X./RULES/i686-cygwin32_wow64-cc64.rul X./RULES/i686-cygwin32_wow64-cl.rul X./RULES/i686-cygwin32_wow64-gcc.rul X./RULES/i686-cygwin32_wow64-gcc64.rul X./RULES/i686-gnu-kfreebsd-cc.rul X./RULES/i686-gnu-kfreebsd-gcc.rul X./RULES/i686-linux-cc.rul X./RULES/i686-linux-gcc.rul X./RULES/i686-linux-suncc.rul X./RULES/i686-linux-suncc64.rul X./RULES/i686-ms-dos-gcc.rul X./RULES/i786-cygwin32_nt-cc.rul X./RULES/i786-cygwin32_nt-cl.rul X./RULES/i786-cygwin32_nt-cl64.rul X./RULES/i786-cygwin32_nt-gcc.rul X./RULES/i786-cygwin32_wow-cc.rul X./RULES/i786-cygwin32_wow-cc64.rul X./RULES/i786-cygwin32_wow-cl.rul X./RULES/i786-cygwin32_wow-cl64.rul X./RULES/i786-cygwin32_wow-gcc.rul X./RULES/i786-cygwin32_wow-gcc64.rul X./RULES/i786-cygwin32_wow64-cc.rul X./RULES/i786-cygwin32_wow64-cc64.rul X./RULES/i786-cygwin32_wow64-cl.rul X./RULES/i786-cygwin32_wow64-gcc.rul X./RULES/i786-cygwin32_wow64-gcc64.rul X./RULES/i786-ms-dos-gcc.rul X./RULES/i86pc-sunos5-cc32.rul X./RULES/i86pc-sunos5-cc64.rul X./RULES/i86pc-sunos5-clang32.rul X./RULES/i86pc-sunos5-clang64.rul X./RULES/i86pc-sunos5-gcc32.rul X./RULES/i86pc-sunos5-gcc64.rul X./RULES/ia64-hp-ux-cc.rul X./RULES/ia64-hp-ux-cc64.rul X./RULES/ia64-hp-ux-gcc.rul X./RULES/ia64-linux-cc.rul X./RULES/ia64-linux-gcc.rul X./RULES/ip17-irix-cc.rul X./RULES/ip17-irix-cc64.rul X./RULES/ip17-irix-gcc.rul X./RULES/ip17-irix-gcc64.rul X./RULES/ip20-irix-cc.rul X./RULES/ip20-irix-cc64.rul X./RULES/ip20-irix-gcc.rul X./RULES/ip20-irix-gcc64.rul X./RULES/ip22-irix-cc64.rul X./RULES/ip22-irix-gcc64.rul X./RULES/ip27-irix-cc.rul X./RULES/ip27-irix-cc64.rul X./RULES/ip27-irix-gcc.rul X./RULES/ip27-irix-gcc64.rul X./RULES/ip28-irix-cc.rul X./RULES/ip28-irix-cc64.rul X./RULES/ip28-irix-gcc.rul X./RULES/ip28-irix-gcc64.rul X./RULES/ip30-irix-cc.rul X./RULES/ip30-irix-cc64.rul X./RULES/ip30-irix-gcc.rul X./RULES/ip30-irix-gcc64.rul X./RULES/ip32-irix-cc.rul X./RULES/ip32-irix-cc64.rul X./RULES/ip32-irix-gcc.rul X./RULES/ip32-irix-gcc64.rul X./RULES/ip35-irix-cc.rul X./RULES/ip35-irix-cc64.rul X./RULES/ip35-irix-gcc.rul X./RULES/ip35-irix-gcc64.rul X./RULES/ldummy.lnk X./RULES/m68k-linux-cc.rul X./RULES/m68k-linux-gcc.rul X./RULES/m68k-nextstep-cc.rul X./RULES/m68k-nextstep-gcc.rul X./RULES/mac68k-netbsd-cc.rul X./RULES/mac68k-netbsd-gcc.rul X./RULES/macppc-netbsd-cc.rul X./RULES/macppc-netbsd-gcc.rul X./RULES/milan-freemint-gcc.rul X./RULES/mips-linux-cc.rul X./RULES/mips-linux-gcc.rul X./RULES/mips64-linux-cc.rul X./RULES/mips64-linux-gcc.rul X./RULES/mips64-linux-gcc32.rul X./RULES/mipsel-linux-cc.rul X./RULES/mipsel-linux-gcc.rul X./RULES/mk-build.id X./RULES/mk-make.id X./RULES/os-cygwin_98-4.0.id X./RULES/os-irix64.id X./RULES/os-openunix.id X./RULES/parisc-linux-cc.rul X./RULES/parisc-linux-gcc.rul X./RULES/parisc64-linux-cc.rul X./RULES/parisc64-linux-gcc.rul X./RULES/parisc64-linux-gcc32.rul X./RULES/pentium-4-unixware-cc.rul X./RULES/pentium-4-unixware-gcc.rul X./RULES/pentium-iii-unixware-cc.rul X./RULES/pentium-iii-unixware-gcc.rul X./RULES/pentium-pro-unixware-cc.rul X./RULES/pentium-pro-unixware-gcc.rul X./RULES/power-macintosh-darwin-cc32.rul X./RULES/power-macintosh-darwin-cc64.rul X./RULES/power-macintosh-darwin-gcc32.rul X./RULES/power-macintosh-darwin-gcc64.rul X./RULES/power-macintosh-mac-os10-cc.rul X./RULES/power-macintosh-mac-os10-gcc.rul X./RULES/ppc-linux-cc.rul X./RULES/ppc-linux-gcc.rul X./RULES/ppc64-linux-cc.rul X./RULES/ppc64-linux-gcc.rul X./RULES/ppc64le-linux-cc.rul X./RULES/ppc64le-linux-gcc.rul X./RULES/r-build.dep X./RULES/r-build.obj X./RULES/r-build.tag X./RULES/r-gmake.obj X./RULES/r-sunpro.tag X./RULES/r-sunpro.obj X./RULES/rs6000-aix-cc32.rul X./RULES/rs6000-aix-cc64.rul X./RULES/rs6000-aix-gcc32.rul X./RULES/rs6000-aix-gcc64.rul X./RULES/s390-linux-cc.rul X./RULES/s390-linux-gcc.rul X./RULES/s390x-linux-cc.rul X./RULES/s390x-linux-gcc.rul X./RULES/sh3-linux-cc.rul X./RULES/sh3-linux-gcc.rul X./RULES/sh4-linux-cc.rul X./RULES/sh4-linux-gcc.rul X./RULES/sh4a-linux-cc.rul X./RULES/sh4a-linux-gcc.rul X./RULES/sparc-bsd-os-cc.rul X./RULES/sparc-bsd-os-gcc.rul X./RULES/sparc-bsd-os3-cc.rul X./RULES/sparc-bsd-os3-gcc.rul X./RULES/sparc-linux-cc.rul X./RULES/sparc-linux-gcc.rul X./RULES/sparc-netbsd-cc.rul X./RULES/sparc-netbsd-gcc.rul X./RULES/sparc-nextstep-cc.rul X./RULES/sparc-nextstep-gcc.rul X./RULES/sparc64-freebsd-cc.rul X./RULES/sparc64-freebsd-gcc.rul X./RULES/sparc64-linux-cc.rul X./RULES/sparc64-linux-gcc.rul X./RULES/sparc64-linux-gcc32.rul X./RULES/sparc64-linux-gcc64.rul X./RULES/sun4-sunos5-cc32.rul X./RULES/sun4-sunos5-cc64.rul X./RULES/sun4-sunos5-clang32.rul X./RULES/sun4-sunos5-clang64.rul X./RULES/sun4-sunos5-gcc32.rul X./RULES/sun4-sunos5-gcc64.rul X./RULES/sun4c-sunos4-cc.rul X./RULES/sun4c-sunos4-gcc.rul X./RULES/sun4c-sunos5-cc.rul X./RULES/sun4c-sunos5-gcc.rul X./RULES/sun4d-sunos5-cc.rul X./RULES/sun4d-sunos5-gcc.rul X./RULES/sun4e-sunos5-cc.rul X./RULES/sun4e-sunos5-gcc.rul X./RULES/sun4L-sunos5-cc.rul X./RULES/sun4L-sunos5-gcc.rul X./RULES/sun4m-sunos4-cc.rul X./RULES/sun4m-sunos4-gcc.rul X./RULES/sun4m-sunos5-cc.rul X./RULES/sun4m-sunos5-gcc.rul X./RULES/sun4u-sunos5-cc.rul X./RULES/sun4u-sunos5-cc64.rul X./RULES/sun4u-sunos5-gcc.rul X./RULES/sun4u-sunos5-gcc64.rul X./RULES/sun4us-sunos5-cc.rul X./RULES/sun4us-sunos5-cc64.rul X./RULES/sun4us-sunos5-gcc.rul X./RULES/sun4us-sunos5-gcc64.rul X./RULES/sun4v-sunos5-cc.rul X./RULES/sun4v-sunos5-cc64.rul X./RULES/sun4v-sunos5-gcc.rul X./RULES/sun4v-sunos5-gcc64.rul X./RULES/x86_64-cygwin32_nt-gcc.rul X./RULES/x86_64-cygwin32_nt-gcc32.rul X./RULES/x86_64-cygwin32_nt-gcc64.rul X./RULES/x86_64-darwin-cc.rul X./RULES/x86_64-darwin-cc32.rul X./RULES/x86_64-darwin-cc64.rul X./RULES/x86_64-darwin-clang.rul X./RULES/x86_64-darwin-clang32.rul X./RULES/x86_64-darwin-clang64.rul X./RULES/x86_64-darwin-gcc.rul X./RULES/x86_64-darwin-gcc32.rul X./RULES/x86_64-darwin-gcc64.rul X./RULES/x86_64-dragonfly-cc.rul X./RULES/x86_64-dragonfly-gcc.rul X./RULES/x86_64-gnu-kfreebsd-cc.rul X./RULES/x86_64-gnu-kfreebsd-gcc.rul X./RULES/x86_64-gnu-kfreebsd-gcc32.rul X./RULES/x86_64-haiku-cc.rul X./RULES/x86_64-haiku-gcc.rul X./RULES/x86_64-linux-cc.rul X./RULES/x86_64-linux-clang.rul X./RULES/x86_64-linux-clang32.rul X./RULES/x86_64-linux-clang64.rul X./RULES/x86_64-linux-gcc.rul X./RULES/x86_64-linux-gcc32.rul X./RULES/x86_64-linux-gcc64.rul X./RULES/x86_64-linux-suncc.rul X./RULES/x86_64-linux-suncc64.rul X X./TEMPLATES/cmd.mk X./TEMPLATES/ldummy.lnk X./TEMPLATES/inc.mk X./TEMPLATES/lib.mk X./TEMPLATES/shl.mk X./TEMPLATES/temp-clang32.rul X./TEMPLATES/temp-clang64.rul X./TEMPLATES/temp-gcc32.rul X./TEMPLATES/temp-gcc64.rul X X./star_sym/dumpdate.c X./star_sym/lpath_unix.c X./star_sym/restore.c END-of-star-1.6/.links echo x - star-1.6/AN-1.5.2 sed 's/^X//' >star-1.6/AN-1.5.2 << 'END-of-star-1.6/AN-1.5.2' XStar is the fastest tar archiver for UNIX X XStar has many improvements compared to other tar Ximplementations (including gnu tar). See below for a short description Xof the highlight of star. X XStar is located on: X Xftp://ftp.berlios.de/pub/star X XSince Summer 2012, star offers more than 30 years of maintained service X XNote that this project includes a stripped down version of libschily. XDo not try to link star dynamically against this library. If you like to link Xdynamically, get the "schily" project bundle from: X Xftp://ftp.berlios.de/pub/schily/ X Xthat includes a complete libschily. X XChanges since star-1.5.1: X X/*--------------------------------------------------------------------------*/ X X- Try to make star immune against signals that appear while opening a X file from a network filesystem. X X- Let the star FIFO better handle the media change operation at the end of X a tape volume in multi volume create mode. X X- Allow star to auto-detect the "EOF" condition on a raw disk when writing X in multi volume create mode. ENXIO has been added as an alias for EFBIG X and ENOSPC. X X- The star.4 manpage was enhanced. X X- star_sym.c now uses O_SEARCH for opening directories. X X- star/longnames.c adds more workarounds against wrong buffer overflow X aborts from gcc. X X- star/extract.c now uses access(name, F_OK) instead of access(name, 0) X X- star now only sets up signal handlers for existing signals to support MSC X X- star fixed a typo in dumpdates.c that hit on WIN-DOS because flock() is X not present X X- star now checks HAVE_FSYNC to support MSC X X- star::findinfo.c now checks whether stat.st_blksize exists X X- star/dumpdates.c works around a problem with LOCK_EX/LOCK_EX/LOCK_UN X defined although the flock() call no longer exists. X X- New (previously missing) man pages: X bsh/pfbsh.1 sh/bosh.1 sh/jsh.1 sh/pfsh.1 mt/mt.1 scgskeleton/scgskeleton.1 label/label.1 X star/ustar.1 star_sym/star_sym.1 ved/ved-e.1 ved/ved-w.1 X X- star now supports automatic recognition of xz(1) compressed archives X and offers a new option -xz X X- star offers new behavior: X X A tar archive created with "star -c -dump -meta ..." does not include X the content for plain files but only the meta data. With "star -c -xmeta" X these files could be extracted as 0 by sized files in case that this would X not overwrite existing files. Star now supports "star -x -xmeta -fore-hole" X to extract these files as files of the original size but as sparse files X without any data inside. This is sufficient as a reference for wget -mirror. X X- The man page star/spax.1 fixed a typo. X X- star/header.c now uses a new structure "ndbuf" that defines X a namelength of 101 instead of 100 in order to be able to access X the 101th element in the arrays without accessing an aray out of X bounds. X X- Fixed a typo in star/buffer.c that caused star to dump core X on Linux with -c -mulvivol due to the unusual memory layout found X on Linux. X X- The star -multivol buffer management now mallocs less memory. X Before it malloc()d the same size as the FIFO size, now it only X malloc()s 2 * bufsize X X- star -c -find is now interruptable by ^C X X- star -x -U -k now works as well as star -x -U -keep-old X X- Some typo fixes in star.4 man page X X- Star -sparse -force-hole now archives all files as sparse files in case X that they at least contain 512 block aligned bytes of nulls. X Thanks to markk@clara.co.uk X X- star -find now removes leading "./" in filenames as star does in X other cases. X X- star -r/-u now correctly depends on the old archive format type. X X- Star adds a new option -lzip and automated support to recognize lzip X compressed archives. X Thanks to markk@clara.co.uk X X- star now accepts a command like: X X star -c -onull -find . -ls X X as there is no archive output to stdout that could mix with the -ls X output X X- Fixed a bug in libfind/walk.c (calling strcatl() with last parameter 0 X instead of (char *)0) X X- libfind bumped to version 1.5 X X- New file libfind/find_tok.h to separate the token names from the rest of the implementation. X X- Moved token definitions from find.c to find_tok.h X X- The primary -perm now implements a new feature: X X -perm +mode will evaluate as true if any of the bits set in mode are set in the X permission bits fro a file. X X- A bug with -exec introduced with using vfork() instead of fork() was fixed. X The replacement of the string "{}" now works correctly again even if the location X of the path in memory was changed during a realloc(). X X- New primary operators: X -amin deprecated - only for GNU find compatibility X -cmin deprecated - only for GNU find compatibility X -mmin deprecated - only for GNU find compatibility X -empty TRUE zero sized plain file or empty directory X -execdir program [argument ...] \\; X -fls file list files similar to 'ls -ilds' into 'file' (always TRUE) X -fprint file print file names line separated into 'file' (always TRUE) X -fprint0 file print file names nul separated into 'file' (always TRUE) X -fprintnnl file print file names space separated into 'file' (always TRUE) X -ilname glob TRUE if symlink name matches shell glob X -ilpat pattern TRUE if symlink name matches pattern X -iname glob TRUE if path component matches shell glob X -ipat pattern TRUE if path component matches pattern X -ipath glob TRUE if full path matches shell glob X -ippat pattern TRUE if full path matches pattern X -okdir program [argument ...] \\; X -print0 print file names nul separated to stdout (always TRUE) X -executable TRUE if file is executable by real user id of process X -readable TRUE if file is readable by real user id of process X -writable TRUE if file is writable by real user id of process X X X- libfind no longer exits the process in treewalk() in case that X the path strings could not be allocated. X X- libfind::walkclose() now free()s the internal data structures X in case of a user that does not call treewalk() (e.g. star -x) X X- The function defltcntl() in libdeflt is now working and allows to X select a case insensitive mode. X X- New function defltsect() in libdeflt allows to create sub-sections X in configuration files. These subsections need to be named: X "[section-name]" and the '[' must be at the beginning of a line. X X X- Support for "pcc" on Solaris x86 was added as a first step. X The C-Compiler "pcc" http://pcc.ludd.ltu.se/ is based on the X Portable C-Comppiler from AT&T from the late 1970s. It is X under BSDl and thus offers compilation with a really free X build environment. X X Note that due to a pcc bug, the autoconf results for X Large File support are incorrect. Unless you edit the file X incs/i386-sunos5-pcc/xconfig.h and manually correct the X file to contain this: X X#define _FILE_OFFSET_BITS 64 /* # of bits in off_t if settable */ X X You will not get working large file support with pcc. X X Support for more Operating system will follow after the issues X in the compiler have been resolved. X X- conf/mkdep-aix.sh now calls "cc -M -qsyntaxonly" instead of X "cc -M -E" as the IBM C-preprocessor does not like X #pragma weak a = b X although the compiler supports it. X X- Added support for DragonFly/x86_64 X X- New autoconf test for nanosecond time stamps on AIX. X X- conf/mkdep-aix.sh was changed to avoid warnings for #pragma weak a = b X as the IBM C-compiler calls a non "#pragma weak" cpp when called with -E X X- include/schily/stat.h now supports nonosecond timestamps in struct stat on AIX. X X- include/schily/stat.h now supports struct stat.st_atime_n X for AIX nanosecond support. X X- Trying to add support for 32 bit compilation on newer Mac OS X X version via smake CCOM=cc32 X This only works if 32 Bit development support is installed on Mac OS X. X X- Trying to add support for 32 bit compilation on newer Linux X version via smake CCOM=cc32 X This only works if 32 Bit development support is installed on Linux. X X- New autoconf test checks whether fnmatch() has a working FNM_IGNORECASE X X- New autoconf tests for supporting stateful multibyte locales X mbsinit() mbrtowc() wcrtomb() X X- New autoconf tests for wctype_t mbstate_t X X- New autoconf tests for basename() dirname() strndup() wcsndup() X X- include/schily/wchar.h enhanced to support mbrtowc() and wcrtomb() X X- include/schily/regex.h added X X- include/schily/libgen.h added X X- New autoconf test for strlcat() wcslcat() strnlen() wcsnlen() X X- New autoconf test for strndup() wcsndup() X X- libschily fnmatch() now supports FNM_IGNORECASE X X- libschily fnmatch() now supports multibyte characters X X- libschily: new files strlcat.c wcslcat.c strnlen.c wcsnlen.c strndup.c wcsndup.c X basename.c dirname.c X X- A new algorithm in libschily X strncat.c strncmp.c strncpy.c strnlen.c wcsncat.c wcsncmp.c wcsncpy.c wcsnlen.c X makes the code faster and smaller. X X- Conf-files in /etc/default are now installed 0644 X X- Man pages are now by default installed in $(INS_BASE)/share/man X The base directory "share" may be changed by caling X X smake DEFMANBASE=something X X- README.compile now mentions: X X INS_RBASE= Set different "root" install path X DEFMANBASE= Set different man base directory X STRIPFLAGS=-s Strip all binaries with "make install" X RUNPATH= Overwrite ELF RUNPATH X DEFUMASK= Set different default permissions for X creating directories X DEFINSUMASK= Set different default permissions for X creating directories in the install path X X- Man pages are now by default installed in $(INS_BASE)/share/man X The base directory "share" may be changed by caling X X- All Makefile.dfl now detect whether /etc/default/* already exists X X- The macros XARCH_GEN & XARCH_OPT are now in RULES/cc-sunpro*.rul X X- The include file include/schily/ccomdefs.h now allows to disable X the printf() format checks for GCC with -DNO_PRINTFLIKE X This is needed in order to allow star to compile in the Solaris ON X cosolidation as GCC id too dumb for the printf() extensions. X X- libschily/?eterrno.c no longer overwrite the _TS_ERRNO definition X in order to pass the compile constrints in the Solaris ON consoliation. X X- Several new global symbols in the mapfile for libschily/libschily-mapvers X X- libschily/wcsndup.c had frgotten code and still did internaly implement X strndup() X X- librmt.so now includes libsocked in the NEEDED ELF tag X X- All include files (even those created by autoconf) are now protected X against multiple inclusion. X X- New autoconf test for pathconf() and fpathconf() X X- The linker map files are now processed via "cpp" (or $CC -E) and X the output is stored in $(ARCHDIR). This allows to have a single X linker map file source for all platforms. X X- New autoconf test for a working cpp. X X- New autoconf test for /dev/stdin, /dev/stdout, /dev/stderr, X /dev/fd/0, /dev/fd/1, /dev/fd2 X X- New autoconf tests for: qecvt() qfcvt() qgcvt() X _ldecvt() _ldfcvt() _ldgcvt() _ldecvt_r() _ldfcvt_r() _ldgcvt_r() X qeconvert() qfconvert() qgconvert() X needed for long double support. X X- All linker map files have been modified to allow platform X dependent #ifdef's X X- libschily now by default renames getline(), fgetline() and X fexec*() into js_getline(), js_fgetline() and js_fexec*(). X This was needed because the POSIX standard commitee ignored X POSIX basic rules not to define functions that are in conflict X with existing published functions. The functions from linschily X have been in the public since more than 25 years and the X functions defined by POSIX.1-2008 even violate POSIX naming rules. X The POSIX fexec*() functions would e.g. have to be correctly called X fdexec*(). X X Existing programs can keep the official names getline(), fgetline() X and fexec*() as they are by default #defined to the new js_*() names. X To disable this convenience, add: X X #define NO_SCHILY_GETLINE To disable schily getline(), fgetline() X #define NO_SCHILY_FEXEC To disable schily fexec*() X #define NO_SCHILY_FSPAWN To disable schily fspawn*() X X- Libschily now has new "long double" support functions: X qftoes() and qftofs() X X- Libschily now supports a locale dependend decimal point for printing X floating point numbers. X X- Libschily now supports to print long double numbers using the X format() based portable printf() implementation. If this does not X work for your platform or if this does not work correctly for X your platform, please report. This was needed for out new "od" X implementation. X X- The option parsing implementation getargs()/getfiles() from X libschily now supports to combine single character boolean X flags even in case the option string mentions to call a callback X function if a valid option was found. This was needed for out new X "od" implementation. X X- filereopen() from libschily no longer calls open() internally X as long as there is no need to create or truncate the file. X X- include/schily/wchar.h now includes a workyround for platforms X that do not have wcwidth(). X X- libschily's findinpath() now includes a new path parameter X to allow to use the function from bsh. X X- fnmatch is now always available as js_fnmatch() X X- New autoconf test for _qecvt() _qfcvt() _qgcvt() X and _qecvt_r() _qfcvt_r() _qgcvt_r() on AIX X X- libschily/getexecpath.c new X X- include/schily/nlsdefs.h now includes macros _(s) and __(s) to support X gettext() and xgettext(1) X X- Disable Simple suffix rules and Sufffix rules in smake to speedup builds X X- Added a comment in RULES/rules.rdi that this rule is no longer needed. X Use RULES/rules.dir in all cases. X X- New configuration files in the Schily makefilesystem for: X X - *BSD on amd64 X X - MacOS X on amd64 X X - kfreebsd (Debian on a FreeBSD kernel) X X - Android X X- The Schily makefilesystem now supports CC_COM for all platforms to X allow to overwrite the low level command for the C-compiler. X X- The Schily makefilesystem now supports CC++_COM for all platforms to X allow to overwrite the low level command for the C++-compiler. X X- Mingw now by default links against -lminwg32 instead of -lmgw32 X X- Mac OS X now by default links against -lgcc_s.1 instead of -lgcc X X- Speed up the dependency generation for cl.exe by pooling some X sed commands in a single sed call X X- Fixed a bug with the dependency generation for HP-UX X X- The Schily makefilesystem restructuresd some dependencies to allow X to run a parallel make. X X- Android is not POSIX (by not defining various functions as functions X in libc as required by POSIX) because it tries to define many X functions that are part of the standard as inline macros in X include files only. This breaks autoconf, so we needed to rewrite X some tests (e.g for getpagesize, tcgetpgrp, tcsetpgrp) X X- The Schily autoconf system has been enhanced to support cross X compilation. Schily autoconf is based on GNU autoconf and X GNU autoconf does not support cross compilation because it needs X to run scripts on the target system for some of the tests. X X The "configure" script that is delivered with the Schily makefile X system runs 718 tests and 68 of them need to be run on the target X system. X X The Schily autoconf system now supports a method to run these 65 X tests natively on a target system. You either need a machine with X remote login features or you need an emulator with a method to X copy files into the emulated system and to run binaries on the X emulated system as e.g. the Android emulator. X X We currently deliver three scripts for "remote" execution of X programs on the target system: X X runrmt_ssh runs the commands remove via ssh X runrmt_rsh runs the commands remove via rsh X runrmt_android runs the commands remove via the debug bridge X X If you need to remotely run programs on a system that is not X supported by one of there three scripts, you need to modify one X of them to match your needs. X X To enable Cross Compilation use the following environment variables: X X CONFIG_RMTCALL= Set up to point to a script that does X the remote execution, e.g.: X X CONFIG_RMTCALL=`pwd`/conf/runrmt_ssh X X CONFIG_RMTHOST= Set up to point to your remote host, e.g.: X X CONFIG_RMTHOST=hostname X or X CONFIG_RMTHOST=user@hostname X X use a dummy if you like to use something X like to the Android emulator. X X CONFIG_RMTDEBUG= Set to something non-null in order to X let the remote execution script mark X remote comands. This will result in X configure messages like: X X checking bits in minor device number... REMOTE 8 X X Note that smake includes automake features that automatically X retrieve system ID information. For this reason, you need to overwrite X related macros from the command line if you like to do a X cross compilation. X X Related make macros: X X K_ARCH= # (sun4v) Kernel ARCH filled from uname -m / arch -k X M_ARCH= # (sun4) Machine filled from arch X P_ARCH= # (sparc) CPU ARCH filled from uname -p / mach X OSNAME= # sunos, linux, .... X OSREL= # 5.11 X OSVERSION= # snv_130 X CCOM= # generic compiler name (e.g. "gcc") X CC_COM= # compiler to call (name + basic args) X X ARCH= overwrites M_ARCH and P_ARCH X X It is usually suffucient to set ARCH and OSNAME. X X In order to use a cross compiler environment instead of a native compiler, X set the make macro CC_COM to something different than "cc". X X If you are on Linux and like to compile for Android, do the following: X X 1) set up CC acording to the instructions from the cross compiler X tool chain X X 2) set environment variables CONFIG_RMTCALL / CONFIG_RMTHOST, e.g.: X setenv CONFIG_RMTCALL `pwd`/conf/runrmt_android X setenv CONFIG_RMTHOST NONE X X 3) call smake: X X smake ARCH=armv5 OSNAME=linux CCOM=gcc "CC_COM=$CC" X X X- Several programs no longer test for HAVE_DEV_* but for HAVE__DEV_* X as we did switch from hand written tests for /dev/tty, /dev/null X and similar to AC_CHECK_FILES(/dev/tty /dev/null /dev/zero) X X- Support for Pyro (a Syllable clone) was added. X Thanks to Flemming H. Sørensen X X- Better support for Win32 sockets when using cl.exe X X- Avoid problems with the non-standard prototypes for link() unlink() X read() and write() from cl.exe X X- Add support for semi-static (preconfigured) include files for Android: X include/schily/armv5tejl-linux-gcc/xconfig.h X X- New include files include/schily/err_*.h are used to encapsulate X #error CPP statements that would otherwise always prevent compilation X with K&R compilers. X X- Added a workaround for a llvm compiler bug that creates code with X endless loops in some cases. X X- Libschily is now linked against $(LIB_INTL) when a shared libschily X is created. X X- Avoid warnings from cl.exe for libschily/gettimeofday.c X X X- The make program specific configuration files for the Schily Makefilesystem X RULES/mk-.id (for SunPro make), RULES/mk-smake.id RULES/mk-gmake.id X now include definitions for the macros: X X SPACE A single space character (' ') X NUMBER_SIGN The ASCII number sing ('#') X X Note that the POSIX standard otherwise requires the make program X to be unable to have the '#' appear in non-comment sections of X Makefiles. X X- Try to work around an imprudent change in the file windef.h from X Cygwin-1.7.17 (Autumn 2012) related to the type BOOL that makes X windefs.h from the recent Cygwin no longer compatible to the X original file from Microsoft. The fix is in include/schily/windows.h X X Thanks to Alain Hoang, Thomas Plank and others for reporting and X help with getting a fix for the problem named above X X- Better comment in libschily/comerr.c to help to understand exit() code X folding to 8 bits and how it may be avoided. X X X/*--------------------------------------------------------------------------*/ X X XTODO: X X - Complete the man page for spax X X - Implement multi volume continuation headers that work for X files > 8 GB where the last tar header X (a POSIX.1-2001 'x'-header) was split across volumes. X In this case, if only POSIX compliant TAR features are allowed, X the extracting TAR would not be able to correctly skip the X large file as it does not know the content of the POSIX.1-2001 X 'x'-header. For this reason, later star versions need to implement X a method to create multi volume continuation (skip) headers that X include the size of the split POSIX.1-2001 'x'-header and the X size of the following large file. X X Note that even with this method we would need a new method X (different from the current bitmap) to deal with multi volume X continuation headers for split files in case the FIFO in star X may be larger than 8 GB. X X - Implement a autoconf extension to to deal with Linux with XFS X where not all ACL handling is inside -lacl ??? is this still true? X XRevision history (short) X X1982 First version on UNOS (extract only) X1985 Port to UNIX (fully functional version) X1985 Added pre Posix method of handling special files/devices X1986 First experiments with fifo as external process. X1993 Remote tape access X1993 diff option X1994 Fifo with shared memory integrated into star X1994 Very long filenames and sparse files X1994 Gnutar and Ustar(Posix.1-1988) handling added X1994 Xstar format (extended Posix.1-1988) defined and introduced X1995 Ported to many platforms X1999 Support for Win32 (Cygwin) X1999 base 256 support to overcome limitation with octal fields X2001 Large file support X2001 Support for POSIX.1-2001 extended headers X2001 Support for ACLs in POSIX.1-2001 extended headers X2002 Support for extended file flags in POSIX.1-2001 extended headers X2002 Support for extended inode meta data and meta files X2003 New program tartest allows to verify POSIX.1-1990 tar archive compliance X2003 Error control added to allow to selectively ignore error contitions X2003 ED like pattern based file name substitution with -s '/from/to/[gp]' X2003 Efficient built in -copy mode X2003 Basic support for incremental dumps (incremental restore not yet ready) X2003 CPIO archive support X2003 New command 'pax/spax' for POSIX.1 command line compatibility. X2003 New command 'cpio/scpio' for SUSv2 command line compatibility. X2003 New command 'suntar' for Solaris command line compatibility. X2003 New command 'gnutar' for GNU tar command line compatibility. X2003 Support for reliable multi-volume archives with media size detection X2004 Options -copyhardlinks/-copysymlinks/-copydlinks allow to extract links on platforms that do not support links X2005 Support for full and incremental dumps and restores. X2005 Support for cumulative incremental dumps and restores. X2005 The find(1) code has been integrated via libfind and allows to use find on archives X2005 Changed license from GPL to CDDL X2005 Added support for a reliable sparse file interface in Solaris using SEEK_HOLE/SEEK_DATA X2005 Added support for reliable multi volume handling X2006 Added support for sparse files that end in a hole X2007 Added new option -install that allows to overwrite live program text (install on a running system) X2007 Added new option -xmeta to extrace meta data only X X XSupported platforms: X XVirtually any! Known to work: X XSunOS 4.x, Solaris (SunOS 5.x), Linux, XHP-UX, DG/UX, IRIX, AIX, FreeBSD, NetBSD, OpenBSD, XOSF-1, True-64, QNX, BeOS, Apollo Domain/OS, Next-STep, XOS/2, SCO-openserver, SCO-unixware, Caldera OpenUnix, XCygwin (Win32), Sony NewsOS, BSDi (BSD/OS), QNX, XApple Rhapsody, MacOS X, AmigaOS, GNU Hurd X XJoerg X X------------------------------------------------------------- XStar is the fastest known implementation of a tar archiver. X XStar development started 1982, the first complete implementation has Xbeen done in 1985. I never did my backups with other tools than star. X XIts main advantages over other tar implementations are: X X fifo - keeps the tape streaming. X This gives you faster backups than X you can achieve with ufsdump, if the X size of the filesystem is > 1 GByte. X X remote tape support - a fast RMT implementation that has no X probems to saturate a 100 Mb/s network. X X accurate sparse files - star is able to reproduce holes in sparse X files accurately if the OS includes X the needed support functions. This is X currently true for Solaris-2.3 to X Solaris-2.5.1 X X pattern matcher - for a convenient user interface X (see manual page for more details). X To archive/extract a subset of files. X X sophisticated diff - user tailorable interface for comparing X tar archives against file trees X This is one of the most interesting parts X of the star implementation. X X no namelen limitation - Pathnames up to 1024 Bytes may be archived. X (The same limitation applies to linknames) X This limit may be expanded in future X without changing the method to record X long names. X X deals with all 3 times - stores/restores all 3 times of a file X (even creation time) X With POSIX.1-2001 the times are in nanosecond X granularity. X Star may reset access time after doing X backup. On Solaris this can be done without X changing the ctime. X X does not clobber files - more recent copies on disk will not be X clobbered from tape X This may be the main advantage over other X tar implementations. This allows X automatically repairing of corruptions X after a crash & fsck (Check for differences X after doing this with the diff option). X X automatic byte swap - star automatically detects swapped archives X and transparently reads them the right way X X automatic format detect - star automatically detects several common X archive formats and adopts to them. X Supported archive types are: X Old tar, gnu tar, ansi tar, star, X POSIX.1-2001 PAX, Sun's Solaris tar. X X X automatic compression detect - star automatically detects whether the X archive is compressed. If it has been X compressed with a compression program that X is compatible to decompression with "gzip" X or "bzip2", star automatically activates X decompression. X X fully ansi compatible - Star is fully ANSI/Posix 1003.1 compatible. X See README.otherbugs for a complete X description of bugs found in other tar X implementations. Star is the first tar X implementation that supports POSIX.1-2001. X X support for ACLs and file flags - star supports Access Control Lists X and extended file flags (as found on FreeBSD X and Linux). Support to archive and restore X other file properties may be easily added. X X support for all inode metadata - star supports to put all inode X metadata on the archive. This allows future X versions of star to perform true X incremental dumps. X X sophisticated error control - allows to tell star which error types X should be ignored for wich file name pattern. X This allows to write backup scripts that give X no error messages for all problems that are X tolerable (e.g. growing log files). X X ED like filename substitution - star supports automated pattern rule based X file name substitution as documented for 'pax'. X X A fast built in -copy mode - allows to make fast and accurate copies and X directory tree comparisons. X X Integrated find(1) code - allows many interesting new features that would X be possible with a separate find call. X XHave a look at the manual page, it is included in the distribution. X END-of-star-1.6/AN-1.5.2 echo x - star-1.6/AN-1.5.3 sed 's/^X//' >star-1.6/AN-1.5.3 << 'END-of-star-1.6/AN-1.5.3' XStar is the fastest tar archiver for UNIX X XStar has many improvements compared to other tar Ximplementations (including gnu tar). See below for a short description Xof the highlight of star. X XStar is located on: X Xftp://ftp.berlios.de/pub/star X XSince Summer 2012, star offers more than 30 years of maintained service X XNote that this project includes a stripped down version of libschily. XDo not try to link star dynamically against this library. If you like to link Xdynamically, get the "schily" project bundle from: X Xftp://ftp.berlios.de/pub/schily/ X Xthat includes a complete libschily. X XChanges since star-1.5.2: X X *** WARNING *** X *** Need new smake *** X X *** Due to the fact that schily-tools 2014-04-03 introduced to use new macro X *** expansions and a related bug fix in smake, you need a new smake X *** to compile this source. To ensure this, get a recent smake source and call X in the smake directory tree: X X cd ./psmake X ./MAKE-all X cd .. X psmake/smake X psmake/smake install X X X- Fixed a problem in star with "star --xattr -find relative_path ..." X Thanks to Philip Spencer for the patch. X X- Star (spax) no longer extracts files with the original UID/GID if X run by root unless the option -po or -pe was in use. Thanks to X a hint from Pavel Raiskup X X- New option -xcopy to star is an alias for -copy -sparse -acl X X- "star" and "mt" now need libcap on Linux as librmt is aware of X Linux capabilities X X- Star now supports to extract time stamps with nanosecond granularity X on platforms that support utimensat(). X X- Star now also supports to extract time stamps for symlinks using X utimensat(AT_FDCWD, name, tp, AT_SYMLINK_NOFOLLOW). X X Note that star could (on some platforms) also permit to set the X file permission for symlinks using fchmodat() but this is already X done using umask() since a long time and the only platform that X is known to support different permissions on symlinks seems to be X HP-UX. X On a recent Solaris, you will not be able to set the file X permissions for symlinks. X X- Star was converted to be completely timespec based. This offers X nanosecond granularity for all times on platforms that support X a nanosecond clock. X X- Star now may be told to modify the path name (in case of -s/o/n/ or X interactive change -w) before the time stamp is compared to X existing files in the filesystem. This is done by using the new option X -uncond-rename X X- Star no longer creates non-conforming archives when calling: X X star -c H=ustar dirname-with_101-chars/ > archive X X instead of: X X star -c H=ustar dirname-with_101-chars > archive X X Star now rejects to create archives with an empty t_name field. X X- "tartest" now warns about non-standard compliance if the X t_name field is empty but the rest of the tar header contains X data. X X- Star now includes support for NFSv4 ACLs on Solaris. X FreeBSD and Linux will follow once these platforms did agree X on a uniform ACL library interface for NFSv4 support. X X Please note that the two changes mentioned above resulted in major X code rearrangements and may even cause star to fail on Linux and X FreeBSD with the withdrawn POSIX.1e draft ACLs. Please test and X report. X X- Star now gives a warning when comppiled on an old version of X Solaris (that does not support NFSv4 ACLs) when NFSv4 ACLs X are seen in extract mode. X X- Star now correctly frees the NFSv4 ACL structure delivered from X calling acl_fromtext(path, &aclp), using acl_free() instead X of just calling free(). X X- Star now compiles on Solaris 10 that missed important include X files for NFSv4 ACLs. Thanks to Dennis Clarke for reporting. X X- Star now contains a new method to deal with arbitrary long pathnames. X This method was based on a method from libfind and currently only serves X the needs of the ACL implementation. X X- If -force-hole was specified and the file is not sparse, only write X it as sparse to the archive if the amount of all-zero data is at X least TBLOCK bytes. X X X/*--------------------------------------------------------------------------*/ X X- The Schily makefilesystem now supports CC++_COM for all platforms to X allow to overwrite the low level command for the C++-compiler. X X- libschily::fexecv() now allows to use the parameter "ac" with the X value -1 to indicate that the arg count is to be determined by the X NULL pointer at the end of the arg list. X X- include/schily/stat.h now contains macros to set the nanoseconds X in timestamps in a OS independent way X X- New autoconf tests for sys/capability.h and cap_*() functions X from Linux -lcap X X WARNING: If you do not see this: X X checking for sys/capability.h... yes X X ... X X checking for cap_get_proc in -lcap... yes X checking for cap_get_proc... yes X checking for cap_set_proc... yes X checking for cap_set_flag... yes X checking for cap_clear_flag... yes X X X your Linux installation is insecure in case you ever use the X command "setcap" to set up file capabilities for executable commands. X X Note that cdrtools (as any other command) need to be capabylity aware X in order to avoid security leaks with enhanced privileges. In most X cases, privileges are only needed for a very limited set of operations. X If cdrtools (cdrecord, cdda2wav, readcd) are installed suid-root, the X functions to control privileges are in the basic set of supported X functions and thus there is no problem for any program to control it's X privileges - if they have been obtained via suid root, you are on a X secure system. X X If you are however on an incomplete installation, that supports to X raise privileges via fcaps but that does not include developer support X for caps, the programs get the privileges without being able to know X about the additional privileges and thus keep them because they cannot X control them. X X WARNING: If you are on a Linux system that includes support for X fcaps (this is seems to be true for all newer systems with X Linux >= 2.6.24) and there is no development support for capabilities X in the base system, you are on an inherently insecure system that allows X to compile and set up programs with enhanced privileges that cannot X control them. X X In such a case, try to educate the security manager for the related X Linux distribution. Note that you may turn your private installation X into a secure installation by installing development support for libcap. X X- Allow to compile without Linux libcap using "smake COPTX=-DNO_LINUX_CAPS LIB_CAP=" X X X- The autofconf tests for broken Linux kernel headers now avoid to X warn for /usr/src/linux/include if this directory is missing. X X- include/schily/priv.h now includes sys/capabilitiy.h if available. X X- Trying to support suid-root-less installation of librmt users on Linux. X librmt now understands that a non-root program may be able to X create sockets for a privileged port. X X- WARNING: the include structure of include/schily/*.h and several sources X has been restructured to cause less warnings with older OS platforms. X If you see any new problem on your personal platform, please report. X X- New includefiles: X X schily/poll.h Support poll() X schily/stdarg.h An alias to schily/varargs.h (but using the std name) X schily/sunos4_proto.h Missing prototypes for SunOS-4.x to make gcc quiet X schily/timeb.h Needed for users of ftime() X X- Many minor bug-fixes for the files include/schily/*.h X X- Added #include to libdeflt X X- Added #include to libschily/fnmatch.c X X- Added #include to libedc X X- Updated README.compile: X X Some typo patches from Jan Engelhardt X X Documented the "LINKMODE=" macro to explain how to create dynamically X linked bynaries. X X- include/schily/archconf.h now defines __SUNOS5 for easier coding X X- include/schily/priv.h now defines platform independent fine grained privileges X X- include/schily/stdio.h now implements #ifndef NO_SCHILY_STDIO_H to X avoid including stdio.h from wchar.h X X- The Schily Makefilesystem no longer uses CC= for internal tasks. X People who now set $CC to a different value will fail in a similar X way as they would fail with other build systems. X X- Allow "static" compilation (a compilation that does not use the X dynamic defines from the Schily Makefilesystem) on Linux x86 X X- Make sure that all schily include files except the primary wrappers X include schily/*.h instead of including the system include files directly. X X- Added automatic support for ARMv5 and ARMv6. This makes compilation X on the RaspberryPI also possible with the non-automake aware gmake. X X- Allow "static" compilation (a compilation that does not use the X dynamic defines from the Schily Makefilesystem) on Linux ARMv6 (which X is used by RaspberryPI). X X- Many sources have been modified to deal __CYGWIN32__ like __CYGWIN__ X This is neded as newer Cygwin versions that run in 64 Bit mode X do no longer define __CYGWIN32__ but __CYGWIN__ X X- Support for NT-6.2 (Win-8) and NT-6.3 (Win-8.1) was aded to the X makefile system X X- The makefile system now includes support for ppc64-linux-*cc to allow X to compile using non automake-aware make programs like gmake. X X- "defltsect" was added as exported global function to libdeflt. X X- libfind now calls closedir() with -empty even on empty directories. X X- New autoconf test on whether includes struct timespec X X- New autoconf tests check whether some functions (such as clock_gettime()) X are in libc or need a separate library X X- New: struct timespec in schily/time.h is granted to exist on all X platforms X X- New functions getnstimeofday() and setnstimeofday() have been X added to libschily. X X/*--------------------------------------------------------------------------*/ X X- Libfind now allows to check for -type P (Solaris event port). X X- Fixed the autoconf test for #pragma weak, so it will not X believe that "clang" supports #pragma weak in a compatible way. X This is needed in order to compile libmdigest/sha2.c using clang. X X- New autoconf tests added for: X X libexpat X libpcsclite / winscard.lib X libcrypto / libeay32.lib X libssl / ssleay32.lib X X- New autoconf test for expat.h X X- The makefile system added the INVERSE_SUBARCHDIR= to allow local X autoconfiguration for shared libraries. X X- RULES/rules.top now also calls MKLINKS in the directory TEMPLATES X X- New compiler configuration files: X X RULES/cc-clang.rul X RULES/cc-clang32.rul X RULES/cc-clang64.rul X X- The Mac OS X related rules now support a new macro: X X LDFRAMEWORKS= X X that allows to add Apple specific libraries. X X- Added a new WIN32_LIBS= macro for Win-DOS specific libraries. X These libraries have to be specified in the portable -lfoo X format for "libfoo" and also work when compiling for MinGW32. X When cl.exe is used, -lfoo is converted to foo.lib. X X- New configuration files: X X RULES/i386-darwin-clang.rul X RULES/i386-darwin-clang32.rul X RULES/i386-darwin-clang64.rul X X- New configuration files: X X RULES/i386-freebsd-clang.rul X RULES/i586-linux-clang.rul X RULES/i86pc-sunos5-clang.rul X RULES/sun4-sunos5-clang.rul X X Note that these files have not been tested yet. X X- RULES/cc-sunpro.rul now also includes rules for X RULES/cc-sunpro32.rul and X RULES/cc-sunpro64.rul X X- RULES/cc-gcc.rul now also includes rules for X RULES/cc-gcc32.rul and X RULES/cc-gcc64.rul X X- RULES/cc-sunpro32.rul added for orthogonality X X- RULES/cc-sunpro32.rul and X RULES/cc-sunpro64.rul are symlinks to RULES/cc-sunpro.rul X and RULES/cc-sunpro.rul uses a macro to include X cc-sunpro.rul X cc-sunpro32.rul X cc-sunpro64.rul X as needed X X- RULES/i86pc-sunos5-cc.rul now also includes rules for X RULES/i86pc-sunos5-cc32.rul and X RULES/i86pc-sunos5-cc64.rul X X- RULES/i86pc-sunos5-gcc.rul now also includes rules for X RULES/i86pc-sunos5-gcc32.rul and X RULES/i86pc-sunos5-gcc64.rul X X- RULES/sun4-sunos5-cc.rul now also includes rules for X RULES/sun4-sunos5-cc32.rul and X RULES/sun4-sunos5-cc64.rul X X- RULES/sun4-sunos5-gcc.rul now also includes rules for X RULES/sun4-sunos5-gcc32.rul and X RULES/sun4-sunos5-gcc64.rul X X- RULES/i586-linux-suncc.rul now also includes rules for X RULES/i586-linux-suncc32.rul and X RULES/i586-linux-suncc64.rul X X- RULES/9000-725-hp-ux-cc.rul now also includes rules for X RULES/9000-725-hp-ux-cc32.rul and X RULES/9000-725-hp-ux-cc64.rul X X- RULES/i486-cygwin32_nt-cc.rul now also includes rules for X RULES/i486-cygwin32_nt-cc32.rul and X RULES/i486-cygwin32_nt-cc64.rul X X- RULES/i486-cygwin32_nt-gcc.rul now also includes rules for X RULES/i486-cygwin32_nt-gcc32.rul and X RULES/i486-cygwin32_nt-gcc64.rul X X- RULES/ip22-irix-cc.rul now also includes rules for X RULES/ip22-irix-cc64.rul X X- RULES/ip22-irix-gcc.rul now also includes rules for X RULES/ip22-irix-gcc64.rul X X- RULES/power-macintosh-darwin-cc.rul now also includes rules for X RULES/power-macintosh-darwin-cc32.rul and X RULES/power-macintosh-darwin-cc64.rul X X- RULES/power-macintosh-darwin-gcc.rul now also includes rules for X RULES/power-macintosh-darwin-gcc32.rul and X RULES/power-macintosh-darwin-gcc64.rul X X- conf/makeinc now knows that a compiler name may not follow X the "cc*" text rule. This helps to support "clang". X X- conf/cc-config.sh has been enhanced to detect whether X "cc" or "gcc" are emulated via "clang". X X- New files in TEMPLATES/ related to "clang" X X- TEMPLATES/ now includes config files for gcc32 and gcc64 X X- TEMPLATES/ now includes config files for clang, clang32 and clang64 X X- Add comment to DEFAULTS_CSW/sparc-cc.defs X X- No longer use fgets() for fgetaline(), fgetline() and fgetstr() X as fgets() cannot deal with embedded '\0' chars before the '\n'. X X- So speudo static compilation environments for Linux & ARM are X now supported X X- Better comment in include/schily/getargs.h X X- include/schily/inttypes.h now includes X X- New #define DEV_NULL that us "NUL" on MinGW X X- Some minor typo corrections in include/schily/prototyp.h X X- Support for setting nanoseconds in include/schily/stat.h X have been added. X X- Struct timespec was added to include/schily/time.h X X- Some minor typo fixes in include/schily/standard.h X X- include/schily/unistd.h now includes schily/inttypes.h X X- va_lists_t as a struct warpper for va_list has been added X to include/schily/varargs.h X X- include/schily/stdio.h now includes a fast putc_unlocked X macro for Solaris in 64 bit mode. X X- include/schily/timeb.h was added X X- include/schily/stdarg.h was added X X- include/schily/poll.h was added X X- include/schily/sunos4_proto.h was added X X- include/schily/shedit.h was added X X- include/schily/err_type.h was added X X- autoconf/config.guess now supports AMD 64 Mac OS X X X- README.compile has been updated X X- New functions xcomerr() and xcomerrno() in libschily/comerr.c X X- libschily/eaccess.c no longer calls access() in case the the OS does not X implement eaccess() but rather first checks whether uid == euid and gid == egid. X X- libschily/getargs.c avoid coredumps in some cases when combining X single char boolean flags into a single arg. X X- libschily::format.c (printf) now supports length modifiers X like h hh l ll t z for the %n format. X X- libschily::format.c has been restructured for parsing the X field width parameters in a way that would allow to later X introduce support for %n$ X X- a bug in libschily/format.c that caused %.*s to be printed X incorrectly has been fixed. X X- libschily/format.c has been redesigned to allow the code to be X reused for fprformat() via #include. X X- libschily/fprformat.c X New function fprformat() in libschily is implementing the same X direct interface as doprnt() from libc and thus allows to implement X printf() faster than the printf() from libc on Solaris. X X- libschily/jsprintf.c X For Solaris, jsprintf() now is implemented based on fprformat(). X This allows printf() from libschily to be aprox. 33% faster than X printf() from libc on Solaris and aprox. 2x as fast as jsprintf() X in libschily has been before. This gives another performance boost X for printf() bound programs like hdump/od that is used as a OSS X replacement for the closed source od(1) on OpenSolaris. This X now makes the OSS od(1) on OpenSolaris typically 5x faster then X the closed source version. X X- libschily/format.c (the low level printf() implementation) now X implements support for %n$ argument repositioning for the X case that "n" is 1..30, or if larger points to an int type arg. X X- libschily/fprformat.c fixed a bug that would prevent to use X stdio macros with newer OpenSolaris versions, making printf() X not as fast as expected. X X- libschily/sleep.c and libschily/usleep.c have been modified to work X with MinGW. X X X X/*--------------------------------------------------------------------------*/ X X XTODO: X X - Complete the man page for spax X X - Implement multi volume continuation headers that work for X files > 8 GB where the last tar header X (a POSIX.1-2001 'x'-header) was split across volumes. X In this case, if only POSIX compliant TAR features are allowed, X the extracting TAR would not be able to correctly skip the X large file as it does not know the content of the POSIX.1-2001 X 'x'-header. For this reason, later star versions need to implement X a method to create multi volume continuation (skip) headers that X include the size of the split POSIX.1-2001 'x'-header and the X size of the following large file. X X Note that even with this method we would need a new method X (different from the current bitmap) to deal with multi volume X continuation headers for split files in case the FIFO in star X may be larger than 8 GB. X X - Implement a autoconf extension to to deal with Linux with XFS X where not all ACL handling is inside -lacl ??? is this still true? X XRevision history (short) X X1982 First version on UNOS (extract only) X1985 Port to UNIX (fully functional version) X1985 Added pre Posix method of handling special files/devices X1986 First experiments with fifo as external process. X1993 Remote tape access X1993 diff option X1994 Fifo with shared memory integrated into star X1994 Very long filenames and sparse files X1994 Gnutar and Ustar(Posix.1-1988) handling added X1994 Xstar format (extended Posix.1-1988) defined and introduced X1995 Ported to many platforms X1999 Support for Win32 (Cygwin) X1999 base 256 support to overcome limitation with octal fields X2001 Large file support X2001 Support for POSIX.1-2001 extended headers X2001 Support for ACLs (based on the 1997 withdrawn POSIX draft) in POSIX.1-2001 extended headers X2002 Support for extended file flags in POSIX.1-2001 extended headers X2002 Support for extended inode meta data and meta files X2003 New program tartest allows to verify POSIX.1-1990 tar archive compliance X2003 Error control added to allow to selectively ignore error contitions X2003 ED like pattern based file name substitution with -s '/from/to/[gp]' X2003 Efficient built in -copy mode X2003 Basic support for incremental dumps (incremental restore not yet ready) X2003 CPIO archive support X2003 New command 'pax/spax' for POSIX.1 command line compatibility. X2003 New command 'cpio/scpio' for SUSv2 command line compatibility. X2003 New command 'suntar' for Solaris command line compatibility. X2003 New command 'gnutar' for GNU tar command line compatibility. X2003 Support for reliable multi-volume archives with media size detection X2004 Options -copyhardlinks/-copysymlinks/-copydlinks allow to extract links on platforms that do not support links X2005 Support for full and incremental dumps and restores. X2005 Support for cumulative incremental dumps and restores. X2005 The find(1) code has been integrated via libfind and allows to use find on archives X2005 Changed license from GPL to CDDL X2005 Added support for a reliable sparse file interface in Solaris using SEEK_HOLE/SEEK_DATA X2005 Added support for reliable multi volume handling X2006 Added support for sparse files that end in a hole X2007 Added new option -install that allows to overwrite live program text (install on a running system) X2007 Added new option -xmeta to extract meta data only X2010 Added support with -xmeta -force-hole to extract meta data as empty files of original size X2013 Added support to extract timestamps in nanosecond granularity X2013 Support for NFSv4 ACLs (identical to NTFS ACLs) in POSIX.1-2001 extended headers X X XSupported platforms: X XVirtually any! Known to work: X XSunOS 4.x, Solaris (SunOS 5.x), Linux, XHP-UX, DG/UX, IRIX, AIX, FreeBSD, NetBSD, OpenBSD, XOSF-1, True-64, QNX, BeOS, Apollo Domain/OS, Next-STep, XOS/2, SCO-openserver, SCO-unixware, Caldera OpenUnix, XCygwin (Win32), Sony NewsOS, BSDi (BSD/OS), QNX, XApple Rhapsody, MacOS X, AmigaOS, GNU Hurd X XJoerg X X------------------------------------------------------------- XStar is the fastest known implementation of a tar archiver. X XStar development started 1982, the first complete implementation has Xbeen done in 1985. I never did my backups with other tools than star. X XIts main advantages over other tar implementations are: X X fifo - keeps the tape streaming. X This gives you faster backups than X you can achieve with ufsdump, if the X size of the filesystem is > 1 GByte. X X remote tape support - a fast RMT implementation that has no X probems to saturate a 100 Mb/s network. X X accurate sparse files - star is able to reproduce holes in sparse X files accurately if the OS includes X the needed support functions. This is X currently true for Solaris-2.3 to X Solaris-2.5.1 X X pattern matcher - for a convenient user interface X (see manual page for more details). X To archive/extract a subset of files. X X sophisticated diff - user tailorable interface for comparing X tar archives against file trees X This is one of the most interesting parts X of the star implementation. X X no namelen limitation - Pathnames up to 1024 Bytes may be archived. X (The same limitation applies to linknames) X This limit may be expanded in future X without changing the method to record X long names. X X deals with all 3 times - stores/restores all 3 times of a file X (even creation time) X With POSIX.1-2001 the times are in nanosecond X granularity. X Star may reset access time after doing X backup. On Solaris this can be done without X changing the ctime. X X does not clobber files - more recent copies on disk will not be X clobbered from tape X This may be the main advantage over other X tar implementations. This allows X automatically repairing of corruptions X after a crash & fsck (Check for differences X after doing this with the diff option). X X automatic byte swap - star automatically detects swapped archives X and transparently reads them the right way X X automatic format detect - star automatically detects several common X archive formats and adopts to them. X Supported archive types are: X Old tar, gnu tar, ansi tar, star, X POSIX.1-2001 PAX, Sun's Solaris tar. X X X automatic compression detect - star automatically detects whether the X archive is compressed. If it has been X compressed with a compression program that X is compatible to decompression with "gzip" X or "bzip2", star automatically activates X decompression. X X fully ansi compatible - Star is fully ANSI/Posix 1003.1 compatible. X See README.otherbugs for a complete X description of bugs found in other tar X implementations. Star is the first tar X implementation that supports POSIX.1-2001. X X support for ACLs and file flags - star supports Access Control Lists X and extended file flags (as found on FreeBSD X and Linux). Support to archive and restore X other file properties may be easily added. X NFSv4 ACLs and the deprecated POSIX draft X ACLs are supported. X X support for all inode metadata - star supports to put all inode X metadata on the archive. This allows future X versions of star to perform true X incremental dumps. X X sophisticated error control - allows to tell star which error types X should be ignored for wich file name pattern. X This allows to write backup scripts that give X no error messages for all problems that are X tolerable (e.g. growing log files). X X ED like filename substitution - star supports automated pattern rule based X file name substitution as documented for 'pax'. X X A fast built in -copy mode - allows to make fast and accurate copies and X directory tree comparisons. X X Integrated find(1) code - allows many interesting new features that would X be possible with a separate find call. X XHave a look at the manual page, it is included in the distribution. X END-of-star-1.6/AN-1.5.3 echo x - star-1.6/AN-1.6 sed 's/^X//' >star-1.6/AN-1.6 << 'END-of-star-1.6/AN-1.6' XStar is the fastest tar archiver for UNIX X XStar has many improvements compared to other tar Ximplementations (including gnu tar). See below for a short description Xof the highlight of star. X XStar is located on: X Xftp://ftp.berlios.de/pub/star X XSince Summer 2017, star offers more than 35 years of maintained service X XNote that this project includes a stripped down version of libschily. XDo not try to link star dynamically against this library. If you like to link Xdynamically, get the "schily" project bundle from: X Xftp://ftp.berlios.de/pub/schily/ X Xthat includes a complete libschily. X XChanges since star-1.5.3: X X *** WARNING *** X *** Need new smake *** X X *** Due to the fact that schily-tools 2014-04-03 introduced to use new macro X *** expansions and a related bug fix in smake, you need a new smake X *** to compile this source. To ensure this, get a recent smake source and call X in the smake directory tree: X X cd ./psmake X ./MAKE-all X cd .. X psmake/smake X psmake/smake install X X XWARNING: the last separate star release has been 1.5.3 and this release was Xpublished in 2014. Since then, frequent star updates have been available inside Xthe "schilytools" tar ball. X XIn case the "schily"-libraries are going to be installed as shared libraries, Xis highly recommended to install star from the "schilytools" bundle instead of Xusing this star only archive. This is the only way to have the commonly used Xcode always at a recent development state. X X BUG WARNING: Please never report bugs to Linux distributions as they X usually do not forward these bug reports upstream and as the X Linux distributions typically do not let skilled people check X the bugs. We did not hear about a FIFO problem in star for a X long time and since the problem that (on Linux) occurred once X every 6000-10000 tries did not happen on Solaris after X 10 million tries, it was not known otherwise. X XThis changelog may not be complete; for a complete changelog, please ceck the Xchangelog files from the schilytools. The changelog for the support libraries Xand the build system has been taken from the SCCS-5.09 release and thus misses Xthe time-frame between October 1 2014 and May 21 2015. X X Short overview for what changed since the last "stable" version: X X - Support for "infinitely" long path names has been added. X X - Support for base-256 numbers in timestams and uid/gid X has been added. This has been planned in the 1990s already, X when star invented the base-256 coding, but it has been X forgotten in favor of the POSIX.1-2001 enhanded archive X headers. X X - Support for comparing timestamps with nanosecond granularity X X - -secure-links has been made the default when extracting X archived (except when doing an incremental restore). X X - Added Support for NFSv4 ACLs on FreeBSD. Solaris has been X supported since 2013. X X - Added Support to archive SELinix attributes. X X - Allow to configure whether "star -fsync" is the default in X order to support filesystems that are slow with granted X transactions (like ZFS) or platforms that are genrally X slow with fsync() (like Linux). X X - Full UNICODE support has been added for tar headers. X X - A new option cli=name (must be argv[1]) allows to select all X supported command line interfaces (star, suntar, gnutar, X pax, cpio) when called as star. X X - Support for -zstd compression has been added. X X - Support for -lzma compression has been added. X X - Support for -freeze compression has been added. X X - Some rare FIFO problems have been fixed. X Note that we did recently run more than a billion tests to X verify the FIFO after we identified a method to trigger the X problem on Linux. X X - A set of unit tests have been added. X X X/*--------------------------------------------------------------------------*/ X X- README.compile: added documentation on how to compile with clang X X- README.compile: completely reworked X X- READMEs/* updated X X- "installman" and other new targets have been added to the makefile X system X X- New make rules for the "Bitrig" BSD distro X X- New make rules for the "Minix" X X- New make rules to permit 32 and 64 bit compilations on AIX X X- GCC makefile rules now all use the universal rule for 32 and 64 bit compilation X X- Support for WIN-NT-6.x added (Win-DOS Server 2008 ... Win-DOS 10) X X- Rules for the automated testing "make tests" added to the makefile system X X- Rules for files names from versioned libraries have been added X X- Rules for versioned libraries on Linux and NetBSD have been added X X- Rules for OS400 have been added X X- Rules for the enhanced SunPro Make have been added X X- autoconf: Various new configure tests X X- Schily Makefilesystem: Shared libraries now may have different numbers X than "1" as part of the file name if the related Makefile includes X definitions for SHL_MAJOR and SHL_MINOR. Plenty of RULES files have X been updated to make this change effective. X X This is needed as we needed to introduce a binary incompatible libfind. X See libfind below. All libs used to be hardwired to the filename X "libxxx.so.1". Adding a SHL_MAJOR=2 to the shared library makefile X (see libfind/shlfind.mk) ressults in a "libfind.so.2". X X- Schily Makefilesystem: Shared libraries for HP-UX are no longer only X *.sl files but *.sl.$(SHL_MAJOR) with a symlink from *.sl to X *.sl.$(SHL_MAJOR). X X- Schily Makefilesystem: Before the locale envorinment is set to "C", X we now keep saved versions with the original content under OLD_LC_* X X- inc/avoffset.c: workaround against a clang bug that causes core cumps X X- sha3 support added to libmdigest X X- include/schily/wait.h reworked X X- include/schily/stdint.h & include/schily/utypes.h: added a workarounf for a X Solaris _CHAR_IS_SIGNED / _CHAR_IS_UNSIGNED Bug X X- include/schily/stdio.h enhanced to include speed up code got getc() with X Solaris 64 bit compilations. X X- New autoconf test for haiku posix/malloc.h X X- New autoconf test for arpa/aixrcmds.h X X- New autoconf test for tcgetsid() X X- New autoconf test whether waitpid() supports NOWAIT X X- New autoconf test whether we have d_type in struct dirent X X- inc/align_test.c workaround for wrong "unused" GCC warning X X- inc/getfp.c workaround for a address sanitizer bug X X- include/schily: new files: getopt.h getopt.mk strar.h strar.mk X X- include/schily/checkerr.h: Added E_ICONV X X- include/schily/fcntl.h: Linux uses O_PATH instead of the POSIX O_SEARCH X X- include/schily/find.h: various interface enhancements X X- include/schily/getargs.h: various interface enhancements X X- include/schily/maxpath.h: fixed some typos X X- include/schily/mconfig.h: Added ASAN support X X- include/schily/stdint.h: Use a new macro for Two's complement machines X to avoid undefined C behavior X X- include/schily/walk.h: various interface enhancements X X- include/schily/values.h: new include file. X X- include/schily/dbgmalloc.h: added more prototypes for libdbgmalloc. X X- libschily/astoul.c added X X- libschily/jsdprintf.c added X X- libschily/movecbytes.c added X X- libschily/cmpbytes.3 added X X- libschily/cmpbytes.mk3 added X X- libschily/fgtcomerr.c added X X- libschily/format.h added X X- libschily/fpoff.c added X X- libschily/fstatat64.c added X X- libschily/gtcomerr.c added X X- libschily/gterror.c added X X- libschily/gtprintf.c added X X- libschily/matchmb.c added X X- libschily/matchmbl.c added X X- libschily/openat64.c added X X- libschily/ovstrcpy.c added X X- libschily/putenv.c added X X- libschily/unsetenv.c added X X- libschily/waitid.c added X X- libschily/wctype.c added X X- libschily/astoi.c and libschily/astoll.c now check for overflows X and report ERANGE X X- libschily/*printf.c now support a locale dependent decimal separator X X- libschily/format.c (the printf worker code) has been enhanced to X be faster with STDIO on most platforms. X X- libschily: getargs, getallargs and getfiles man pages have been reworked X X- libschily/getargs.c: combined single char boolean flags now work X with callback type formats. X X- libschily/searchinpath.c added a new flag SIP_NO_STRIPBIN X X- libschily::breakline() fixed a bug that caused the return code to be X larger than the number of array elements in some cases. X X- libschily::checkerr() added new category "ICONV" X X- libschily::comerr() A new environemtn variable "COMERR_EXCODE" disables X exit code mapping of codes that cannot be returned via the outdated X waitpid() call. X X- libschily::opendir() added a missing nul byte for the Win32 opendir() X emulation X X- libschily::format() the schily printf implementation now prints X floating point numbers in a POSIX compliant way. X X- libschily::fnmatch() a new algorithm avoids recursion and is much X faster. X X- libschily::fnmatch() Support for [:alpha:] and similar has been added. X X- libschily::patmatch() Support for [:alpha:] and similar has been added. X X- libschily: resolvenpath() did not work as expected when some path names X do not exist. A stat() call that should check whether we already X reached the "/" directory caused a return (-1) even with X (flags & RSPF_EXIST) == 0 X X- libschily: Fixed the behavior of the umask/chmod perm parser for the X case where "who" was not specified and the operator is '='. POSIX X requires here to first clear all bits in the old value before adding X new bits. The old implementation did clear only the bits retrieved X from umask(2). X X- libschily: The umask/chmod perm parser now returns -1 for the mode X string "u", since the operator is missing. Before, it just printed an X error message but did not return -1. X X- libschily: astoul() and astoull() now by default permit to prefix X the unsigned number by a "-". This is required by POSIX for strtoul() X and strtoull() and our implementation needs to be compatible to POSIX X to make the printf(1) implementation in the Bourne Shell POSIX X compatible on older platforms. X X Thanks to Robert Elz for reporting X X- libschily: emulations for *at() have been fixed. X X- libschily/stdio/fgetstr.c now includes a speedup for AT&T stdio using X the new movecbytes() X X- libschily/stdio/getdelim.c now includes a speedup for AT&T stdio using X the new movecbytes() X X- libschily/ man pages reworked. X X- libschily::format.c The schily printf is now able to do %.*s with X a significance > 8192 without overwriting the internal buffer. X X The new code is implemented via strnlen() and no longer copies X the string - thus it should be even faster. X X- libschily::fnmatch.c: added a forgotten fix (from last January) for X a problem with missing brackets with if/then/else related to X [:upper:] and [:lower:] X X- libschily::fnmatch.c: added a forgotten _partial_ enhancement from X last January for [= ... =] and [. ... .] support. X X Warning: this is not yet fully functional since the POSIX standard X does not include an interface to get this functionality from the X i18n part of libc. X X- libschily::match.c: Added a missing /* FALLTHROUGH */ comment. X X Thanks to Pavel Raiskup for poiting to a related Coverity message. X X- libschily::fstream.c: Added a /* NOTREACHED */ comment to make coverity X quiet. X X Thanks to Pavel Raiskup for poiting to a related Coverity message. X X- libfind: the code now supports the *BSD enhancement "d_ino" in struct dirent. X This speeds up stat()less jobs. X X- libfind: the code now supports the *BSD enhancement "d_type" in struct dirent. X This speeds up stat()less jobs. X X- libfind: localization in libfind no longer affects the calling program X X- libfind: Arguments containing a '=' character did result in the related X argument to become incremented inside the input arg vector. This caused X problems with a free() loop on the arg vector. X X ********** X Warning: the fix causes a binary incompatibility as the struct finda_t X changed it's size. As a result, we now install libfind.so.2 and changed X the map file in order to require newer versions of the interface X functions that are affected by the finda_t size change. X ********** X X Thanks to Heiko Eißfeldt for reporting. X X- libfind: the -newer and -newerXY primaries now compare nanoseconds X as well. X X- libfind: removed blank line in the linker map file X X- libfind: the id cache (uid/gid <->name mapping) now helps star to find X whether a user name or group name is not completely 7 bit ASCII and X thus needs a locale conversion in star POSIX.1-2001 extended headers. X X- libfind: Some open() calls now use O_DIRECTORY X X- libfind: walk.c now uses fchdir() on platforms that support dirfd(DIR*) X and by this change, libfind is now aprox. 30% faster than before and X makes libfind faster than other find implementations. X X- libfind: walk.c: "!isdot" has been renamed to "need_cd" for better X readability of the code. X X- libfind: WALK_STRIPLDOT now strips even multiple occurences of "./" X and if there is no text after that, it replaces the empty string by ".". X X- libfind: new functions wstat() and wlstat() have been added (both are X based on fstatat()). X X- libfind: treewalk() now works even without fa.walkflags |= WALK_CHDIR X X- libfind: The code compiles again on platforms without dirfd(), like X e.g. DOS. On such a platform, there is currently however no way to X use libfind without WALK_CHDIR. X X- libfind: Added a better ENAMETOOLONG discovery for the function X dopendir() that is able to open a directory with a very long name. X X- libfind: In case of very long path names, the intermediate directories X are now opened with O_SEARCH instead of O_RDONLY. X X- libfind/bsh/Bourne Shell: The "long" stat() implementation now works X with absolute path names as well. X X- libfind: added support for a new feature: -call allows to do calls into X the shell that started "find" as a builtin program. This is approx. X 40x faster than using -exec. X X- libfind: A new function walkcwd() allows to chdir() back from the start X directory (that has been reached by calling walkhome()) to the X directory where the treewalker has been before calling walkhome(). X X- libfind: new source ptime.c X X- libfind: new source version.h X X- libfind: the major file name version number was bumped from 2 to 3 X since the new code causes binary incompatibility with the previous X libfind. X X- libfind: A set of new primiary operators has been added: X X -newerat X -newerct X -newermt X X These primaries allow to check whether a file is newer than a time X stamp description in it's argument. The argument to this primary X is a date and time description that is similar to ISO 8601. X X The time description may look like: X X yyyy-mm-ddThh:mm:ss.nnnnnnnnn+-zzzz X X for a time with timezone or X X yyyy-mm-ddThh:mm:ss.nnnnnnnnnZ X X for GMT based time or X X yyyy-mm-ddThh:mm:ss.nnnnnnnnn X X for local time. X X The 'T' may be replaced by a space. The description may be shortened X from the right side, in this case the missing fields are assumed to X have the maximum value. It can be shortened from the left side and in X that case, the missing fields are substituted by the current date. X X The call X X find . -newermt 2017 X X will find all files with a modification time with the start of 2018 X or newer. X X The call X X find . -mewermt T X X will check for files that have a modification time of the start of X tomorrow or newer. X X- libfind: The "-perm +mode" feature before has been recognised if the X + sign appeared before any character from the set "ugoa", but since X the string "+u" represents a POSIXly valid "permcopy" operation, the X new version of libfind only accepts this specific feature if the X mode string starts with a "a". Since (with find) the start value of X the perm parser is 0, any valid mode string may be prefixed by "a+," X without changing the resulting value, the feature is usable with X "-perm +a+,mode". X X- libfind: The phrase "-perm /mode" has been added as an alias for X "-perm +mode", but since "/" is not permitted in a POSIX mode string, X this methos does not require to prefix the mode string with "a+," to X work. "-perm /mode" also helps to give comptibility with GNU find. X X- libfind: "-chmod mode" no longer causes a wrong treatment in some X cases as the special treatment for "-perm +mode" no longer applies X to -chmod too. X X- libfind: new function find_strvers() returns the version string. X X- libfind: version bumped to 1.7 X X- libfind: treewalk() now supports a new flag WALK_MOUNTPLUS. X X This new flag reports mount points but does not descend into them. X X The existing flag WALK_MOUNT does not report mount points and does X not descend into them. X X The background for this change is: X X 1) "star -cM ..." and "star -c -find . -xdev ..." differ X in their behavior and there was no way to get the X star -M behavior from libfind. X X 2) The POSIX standard for "find -xdev ..." is in conflict X with the documented behavior for "find -xdev ..." on X UNIX and with the documented and POSIX standard behavior X of nftw() with the FTW_MOUNT flag (The UNIX find(1) X implementation is based on nftw()). X X 3) There is a general need to have the other behavior where X mount points are reported. X X- libfind: find(1) gets a new primary operator "-mount+" as a X supplement to the historic UNIX "-mount" behavior that is based X on WALK_MOUNT. -mount+ is based on WALK_MOUNTPLUS X X- libfind: Added a date to the -version output and added version.h X X- libfind/star/mkisofs/bsh/Bourne Shell: "find -xdev" is no longer X UNIX compatible but rather POSIX compatible. X X *** Incompatible change *** X *** POSIX wording from 1992 is in conflict with UNIX implementation *** X X Background: POSIX in 1992 introduced a wording for -xdev that was in X conflict with existing implementations and required a behavior that X is impossible to implement with nftw(3). X X Today, half of the implementations follow the UNIX rules and half of X the implementations follow the POSIX text. X X To solve the conflict, POSIX decided to add the old UNIX "find -mount" X (that was intended as an alias to "find -xdev") and to be implemented X with the old UNIX behavior and requires "find -xdev" to follow the X POSIX text from 1992. At the same time, POSIX introduced a new nftw(3) X flag FTW_XDEV as a complement to FTW_MOUNT with the behavior that X matches the POSIX requirements for "find -xdev". X X As a result, libfind now makes -xdev an alias to -mount+ and keeps X the -mount primary with the old behavior. The difference is: X X -mount does not lists mount points at all and does not descend X into them. X X -xdev lists directories that are mount points but does not X descend into these directories. X X- libfind: walkcwd() no longer tries to call dirfd() unless it exists or X DIR->dd_fd exists. X X This should make it compile with DJGPP again. X X- libfind: the time parser now supports the new time spec "now" for X the current time. X X- libfind: The new primaries -chatime, -chctime, -chmtime allow to X set the time stamps in struct stat to arbitrary values. X X- libfind: A new primaries -chfile allows to set the modified struct X stat values from -chown, -chgrp, -chmod, -chatime, -chctime, -chmtime X to the file. X X On platforms where chmod() is not possible on a symbolic link, symbolic X links are skipped with that change. X X On platforms where it is not possible to set times on symbolic links, X symbolic linkes are skipped with that change. X X- libfind: Added support for being able to use simple shell scripts X (scripts that do not start with a #! line) as commands for the X -exec and -exec + primaries. X X This requires a reordering of the arg vector and to insert a "sh" X as new argv[0] before the original arguments. X X- libfind: added a new timestamp to the libfind version. X X- libfind::find.c: Added a missing /* FALLTHROUGH */ comment. X X Thanks to Pavel Raiskup for poiting to a related Coverity message. X X- libdeflt: avoid a double fclose(dfltfile) X X- librmt: a new function rmtrsh() has been added to set up a different X method to initiate a remote connection. This allows to tell librmt X to make connections with "ssh" instead of using "rcmd()" or "rsh". X X Thanks to a hint from Kristýna Streitová X X- librmt: a new function rmtrmt() has been added to set up a different X path to the remote rmt server program. This allows to tell librmt X to make connections to servers that are on a path other than "/etc/rmt". X X- librmt: The man pages have been enhanced. X X X- Fixed a bug in star's pax CLI that caused spax -X to dump core. X Thanks to Pavel Raiskup for reporting. X X- The programs cdrecord, star and cdda2wav adopt to the recent Haiku X changes with a randomized address space and now use B_EXACT_ADDRESS X instead of B_ANY_ADDRESS for the clone_area() call to get shared memory X for a FIFO. X X- star now again stores up tp 16 bytes for uname in the old star X archive format - not null terminated in case all bytes are used. X X- star -diff now correctly deals with the non null-terminated uname/gname X strings from the old star archive format. X X- mkisofs and star have also been corrected to use X S_IFCTG and S_ISCTG instead of the S_IFCNT and S_ISCNT X X- star now flushes the verbose file stream before checking for missing X links. This tries to avoid mixed output when people call X star 2>&1 | tee X X- star: avoid a warning from GCC-4.8.3 X X- star/acltext.c: fixed a memory leak in case that malloc() failed X in acltotext(). X Thanks to heiko Eißfeldt for reporting. X X- Star now supports "star -copy -find /from ... /to" X Thanks to a report from Stéphane Chazelas. A minor piece of code X was forgotten when the final -find integration did take place. X X- Star now supports "-C directory" before a -find option. This allows to X call e.g.: X star -copy -C /from/path -find . /to/path X X and thus permits to avoid long path prefixes to be copied into the X /to/path hierarchy. X X- Star now calls setlocale() and thus correctly supports -find -name X with multibyte locales. X Thanks to a report from Stéphane Chazelas. X X- star: Manpage now mentions star_sym and tartest in the SEE ALSO section X X- Star: star in "-dump" mode and when using the FIFO did overwrite the X tar header for a file with the POSIX.1-2001 extended tar header for X efficiency. This unfortumately did overwrite data that was later X used by: X X star -c -dump -vv X X for the verbose listing and caused username/groupname to be "root". X We no longer allocate the PTB from the FIFO buffer in this case and X introduce a minor performance penalty when using "star -c -vv". X X- Star: now calling strlcpy() instead of strcpy() when copying CPIO X file names as CPIO has no checksum and may observe rotten archives. X Thanks to Hanno Böck for the report. X X- Star: Only check CPIO-BIN filenames for swapped bytes when the filename X would fit into a 512 byte header. Cpio officially only support 256 bytes X in the filename. In theory 65k is possible but with star -no-fifo, X we only have 10k to check. X Thanks to Hanno Böck for the report. X X- Star: Abort with CPIO-BIN archives when the symlink target name size is X seen as a number <= 0 in the cpio header. This avoids a core dump from X rotten CPIO archives. X Thanks to Hanno Böck for the report. X X- Star: When using the outdated signed checksums, star could incorrectly X assume that a block o characters that sums up to 0 is an EOF block. X Star now defines such a block as a potential EOF block and repeats the X the computation using unsigned chars to verify whether it really is X an EOF block. X Thanks to Heiko Eißfeldt for the report. X X- Star: Avoid to read cpio file names and link names that are longer X than PATH_MAX. X Thanks to Heiko Eißfeldt for the report. X X- Star: check for EOF while trying to read long TAR filenames. X Thanks to Heiko Eißfeldt for the report. X X- Star: avoid to access the name field in the historical tar header. X This could cause directories not to be recognized because the X name field could be non-null terminated. X Thanks to Heiko Eißfeldt for the report. X X- Star: try to avoid accessing data from outside the uname/gname fields X in case a broken tar archive is used. Star now inserts a null byte at the X end to prevent str*() functions to scan the data with probably no end. X Thanks to Heiko Eißfeldt for the report. X X- Star: try to avoid data from outside a tar header while looking for an X octal number in a field that does not contain the expected characters. X Thanks to Heiko Eißfeldt for the report. X X- Star: In list mode, use longer character arrays to convert the X link count, uname and gname. The linkcount array did miss the X space for a space character. X Thanks to Heiko Eißfeldt for the report. X X- Star: Abort when a CPIO archive claims to havea zero sized filename. X Thanks to Heiko Eißfeldt for the report. X X- Star: star -i no longer tries to access memory before the file name X array when the file name field starts with a nul byte. X Thanks to Heiko Eißfeldt for the report. X X- Star: Check whether the devminorbits value is reasonable to avoid X an array out of bound read access. X Thanks to Heiko Eißfeldt for the report. X X- Star: remove a left over debug printf in create.c that was inserted X while fixing the star -dump -vv bug in schilytools-2016-06-28. X X- Star: The man page now includes a link to the star sources. X X- Star: Add support for NFSv4 ACLs on FreeBSD based on a patch from X Martin Matuska X X- star: Linux xattrs are now set after chown() as Linux resets xattrs X with a chown() call. X Thanks to Kristýna Streitová X X- star: fixed a typo in star.4 X X- star: The string conversion from the POSIX.1-2001 extended header X SCHILY.filetype has been speed up with a string length table. X X- star: fixed a bug with star -r and star -u that could cause star to X use the wrong offset for appending to the archive which then created X an unappendable archive. X Thanks to Steffen Nurpmeso for reporting. X X- star: A workaround in star for a SSH TCP-IP problem seen on Linux in X 2003 is now disabled by default but may be activated by setting the X environment STAR_WORKAROUNDS=ssh-tcpip X X- star: The man page now documents that ZFS and other COW filesystems X slow down in extract mode by the star default of calling fsync(fd) X for every file. X X- star: the README files in the directory testscripts now mention X sourceforge instead of berlios. X X- star: a first version of a test suite has been added X X- star: testscripts X X- star: table.c & table.h: changed some tables from signed char X to uint8_t as the values are used as index for other tables. X X- star: The NFSv4 ACL format was redesigned following a proposal from X Martin Matuska from FreeBSD. X X The new format omits the '-' signs in the output from X X acl_totext(aclp, ACL_COMPACT_FMT | ACL_APPEND_ID | ACL_SID_FMT); X X to save space in order to be able to hold more ACL entries in a X single 512 byte block. This change actually permits most files to have X all meta data inside a single 512 byte block with extended TAR data. X X- star: star.1 Now uses 4-digit year numbers for the last changed date X X- star: star.4 Now uses 4-digit year numbers for the last changed date X X- star: star.4 documents the new ACL format for NFSv4 ACLs. X X- star: The conformance tests that check the star -tv behavior now set X the timezone to GMT to get a test result that does not depend on the X configured timezone of the system. X X Thanks to Heiko Eißfeldt for reporting X X- tartest fixed some GCC warnings for unused variables. X X- TARGETS/55star_sym added a newline to make "make tinfo" work when X /bin/sh is not a classical Bourne Shell. The code worked before because X there was a bug in the classical Bourne Shell with sh -ce cmd. X X Thanks to Heiko Eißfeldt for reporting X X- star: added a missing '{' in commented out code. X X Thanks to Heiko Eißfeldt for reporting X X- Star (pax): Option parsing is now done in a POSIX compliant way. X Before, pax did not permit calls like "pax -vffile". X X This is the first step in making star's pax implementation X to pass the POSIX certification. X X- star: Added a new extended header: SCHILY.devminorbits X This is needed because Solaris uses a different makedev() for 64 bit X commands and 32 bit commands. X X The new SCHILY.devminorbits allows to convert struct stat.st_dev X as used by SCHILY.dev into a number that is compatible to the system X used by the local program. Note that SCHILY.dev is currently not X used in extract mode, but a value in the archive that does not fit X into the local dev_t type was flagged by star. This caused a warning X like this: X X star: WARNING: SCHILY.dev '124554051655' in extended header at 3 exceeds local range. X X when the archive created by a 64 bit star on Solaris was fed into X a 32 bit star. X X Ad a result, tar archives from 64 bit star binaries and 32 bit star X binaries are now compatible. X X- include/schily/device.h: XDEV_T is now Ullong. This file was forgotten X to distribute with schilytools-2017-10-10. The change is however needed X for a bugfix in "star". X X- star: When in list or diff mode on an "exustar" typed archive, star did X believe a hardlinked symlink is both hardlink and symlink but only the X hardlink target is present in the archive. We thus only list or compare X the hardlink now. X X- star: When star is in interactive extract mode, it now asks for file X removal in case that the attempt to create a new file returns ELOOP. X This helps to extract archives that change the current symlink X structure and that may result in an intermediate endless symlink loop. X X- star: Avoiding a warning from the HP-UX K&R compiler X X- star: A problem in btrfs on Linux may cause stat.st_blocks == 0 for X huge files that start with a big hole and end with data. While this X seems to be a bug in btrfs (stat.st_blocks has been reported to X become != 0 later), there is the theoretical case where a huge hole X is followed by data that may fit in compressed form into the "inode" X and legally result in stat.st_blocks == 0. X X We thus disabled the F_ALL_HOLE test. A modern filesystem should X implement support for SEEK_HOLE, for performance reasons. Note that X SEEK_HOLE exists since 13 years already. An operating system or X filesystem that today does not support SEEK_HOLE must be seen as X outdated. X X- star/pax.c: Removed a leftover debug print statement that was added in X September 2017 while adding support for the POSIX option parser X requirement that the last character in a combined option string may X have an argument. X X Thanks to Leah Neukirchen for reporting. X X- star: Fixed some typos X X Thanks to Leah Neukirchen for reporting. X X- star: we now add a null byte past a possible tar checksum in the first X header while trying to find out which archive type is in use. X X This avoids useless warnings: "WARNING: Unterminated octal number at..." X with cpio archives. The bug and the message have been introduced in X July 2016. X X- star: 64 new unit tests for archive autodetection have been added X X- star: star_fat.mk has been enhanced to import newer content from X Makefile X X- star: star.mk has been enhanced to import newer content from X Makefile X X- star: cpiohdr.c and the star man page have been modified to explain X that the CPIO CRC archive format uses a 32-bit checksum and no CRC. X X- star: A new message "Badly formed number '%s'.\n" has been introduced to X help to identify illegal arguments to complex options like fs=. X X- star: The man page has been enhanced in order to reduce the chance X to missunderstand descriptions. X X- star: We now better check for the results of an ignored SIGTTIN X X Thanks to Robert Clausecker for reporting. X X- star: star -diff is now able to compare nanoseconds in timestamps. X This requires a tar archive with full POSIX.1-2001 extended tar X header extensions. If the archive does not include sub-second X resolution, star -diff implements a silent fallback to what previously X has been done: just compare the seconds. X X- various files: as a side effect of the new nanosecond resolution in X smake and star, many files in this distribution did get an updated X CDDL header with an additional URL X X http://www.opensource.org/licenses/cddl1.txt X X- star: Since 1985, star by default only extracts files from an X archive if they are newer than the file on disk. The check whether X files in the archive are newer than in the filesystem has been X extended. Star now checks nanoseconds as well when in extract mode X in case the archive contains timestamps with sub-second resolution. X X Warning: since historic tar archives store timestamps only with X second resolution, extrating such an archive results in files that X have the nanoseconds of the timestamps set to 0. If you later extract X another archive with POSIX.1-2001 extenden headers that include X nanosecond timestamps, all files on disk are considered to be older X than the same files in the archive and thus extracted again. X X Note that since an incremental back usually takes much longer than a X second, star currently still only compares seconds in the timestamps X of files when deciding whether a file is put into an incremental X backup. Files that have been created with the same second timestamp X as the start of the last incremental are included in the next X incremental, so no file is lost because of this decision. X X- star: The nanosecond handling in append mode has been verified and X the related comment has been enhanced. X X- star: "star -c -newer ..." now checks nanoseconds as well. X X- star: Added a new archive format "epax". This is the same as "pax", X but it always includes a POSIX.1-2001 extended header with timestamps X with nanosecond resolution. X X- star: Better comment in unicode.c X X- star.c: unicode.c is now based on iconv() to permit other locale encodings X than ISO-8859-1 X X- star: The POSIX.1-2001 extended header keyword hdrcharset=BINARY now X works. X X- star: When in copy mode, star now uses hdrcharset=BINARY to avoid charset X conversion problems. X X- star: Now using version 1.5.4 X X- star: user name, group name, path and linkpath are now automatically X added to the POSIX.1-2001 extended header in case that they include X non-ASCII characters (outside the 7-bit range). X X- star: if mtime is negative, mtime is too large for a POSIX.1-1988 X TAR header or if nanoseconds are non-null and the archive format X supports POSIX.1-2001 extended headers, the times are now always X recorded in an extended header. This is a requirement from newer X POSIX versions. X X- star: Since the probability for creating POSIX.1-2001 x-headers X did raise, we cannot make assumptions anymore just from the existence X of an x-header. While doing archive format detection, star is no longer X happy with a 'x' or 'g' header to decide that an archive is in X "exustar" format but requires a SCHILY.archtype keyword. X X- star: The fifo is now using a better autoconfiguration in order to X prevent it to try to use shmget() on DOS. This makes star compile X with DJGPP. X X- star: a new option (-pax-o) has been added. This currently only X implelents the flag "binary" that tells star to add a field X hdrcharset=BINARY to the extended headers. X X- star: better comment in Makefile X X- star: fixed an ununitialized finfo.f_flags in flush_link() X X Thanks to Martin Liska from Suse for reporting X X- star: updated the mail addresses in the man pages. X X- mt: updated the mail addresses in the man pages. X X- rmt: updated the mail addresses in the man pages. X X- star: add $(LIB_ICONV) to the Makefile X X- star: man pages no longer have star(4/5) in the SEE ALSO section but X star(4), so the automatic links from man2html(1) work. X X- star: the function has_dotdot() that checks for dangerous filenames X that contain ../../ which has been written 15 years ago (as the first X tar archiver to make this security check), now also checks for ..\.. X attacks on Cygwin and other DOS based platforms. X X- star: added a check for the exit code from the compress rogram. This X helps to detect certain problems and to make star exit != 0 in such a X case. The current code is based on siginfo_t. This is a "new" feature X that has been introduced by SVr4 in 1989 and that has been standardized X by SUSv1 in 1995. So it needs an OS platform that is actively X maintained after the period 1989/1995. X X Thanks to a hint from Kristýna Streitová X X- star: A hard EOF on the input now causes star to exit with a non-zero X exit code. This is a fallback method to grant a non-zero exit code X on platforms with an unmaintained kernel (such as Linux) where still X no working waitid()/siginfo_t exists even though the feature has been X introduced in 1989 (29 years ago). X X- star: The Makefile now contains a #define "USE_SSH" to compile in X a new default to make remote tape connections using the ssh protocol X by default instead of the previous "rsh". X X Thanks to a hint from Kristýna Streitová X X- star: A new option rsh=path has been added to specify a different X remote login program on the command line. X X WARNING: since the new default for star is to use "ssh", users that X rely on the speed of a rcmd() connection need to either put an empty X RSH= variable into the environment or need to specify rsh='' on the X star command line. X X- star: A new option rmt=path has been added to specify a different X path to the remote tape server program on the command line. X X Since star defaults to the UNIX default path "/etc/rmt", for the server X at the remote side, and since most /etc/rmt implementations are X dangerous in case that the OS on server and client differ, it is X recommended to put "RMT=/opt/schily/sbin/rmt" into the environment or X to specify "rmt=/opt/schily/sbin/rmt" on the star command line. X X- star: The environment STAR_FSYNC=N may establish a default in star X that enables -no-fsync by default in order to prevent star from being X slow on a platform with inefficient buffer cache (like Linux) or on X transactional copy on write filesystem like ZFS. X X Note that on Solaris with UFS, the performance degradation from using X the reliable mode (and issuing fsync()) is much less than 10%, while on X Linux with the UFS clone EXT4, the performance degradation is 400%. X X If this fsync()-less default is enabled, star is always faster than other X archivers that never had such a check, but may no longer detect whether a X file could not be extracted correctly, since not all problems can be X flagged in the close() return code. X X X- star: The entry STAR_FSYNC=N in /etc/default/star may establish a X default in star were -no-fifo is enabled by default. X X- star: A new option -do-fsync may reverse the default from the X STAR_FSYNC=N environment or from /etc/default/star. X X- rmt: the man page has been enhanced. X X- rmt: the comment in the program has been enhanced. X X- tartest: Some warnings that have been printed to stderr are now on stdout X to make them all appear in the same file. X X- star_sym: added the O_DIRECTORY openflag X X- star::pathname.c: New function strlcpy_pspace() helps to implement X path names of arbitrary length more efficient. X X- star::pathname.c: make the realloc() implementation more correct X with respect to all return possible codes specified by POSIX. X X- star::unicode.c: iconv() results are now terminated with a '\0' byte X X- star::unicode.c: _from_utf8() now honors "fromlen". This is needed X for the new POSIX.1-2001 extended header handling. X X- star::subst.c: The code has been rewritten to use strlcpy() instead of X strncpy(). X X- star::subst.c: The code no longer uses the result path storage for X getting the result from Y/N questions. X X- star::subst.c: -s'/from/to/g' did only substitute once, while X -s'/from/to&/g' did work as expected. X X- star::subst.c: There is no longer any limitation on the length of the X path as long as there is sufficient memory for malloc(). X X- star::subst.c: The path name read function has been rewritten to use X getdelim(). X X- star::buffer.c Added a new error message in checkerrs() for a buffer X overflow in path name substitution. X X- star::dirtime.c: new function flushdirtimes() allows to flush the dir X stack as a callback from the comexit() procedure. X X- star::dirtime.c: the code is now able to handle file names with X unlimited length even though the low level calls to utimes() and chmod() X still may result in an ENAMETOOLONG. X X- star::pathname.h: This file now is also able to work in case stdio.h has X not been included before. X X- star: added several functions as callback for comexit() to give better X messages when star is terminated by severe problems. X X- star: the man page now prints the star magic 'tar\0' in bold chars. X X- star: The archive type tests have been adopted to the slightly different X output format in case of errors. We now print buffer statistics in X such a case. X X- star: The first stage of code rework for unlimited path len has been X implemented for the "extract" case (list, extract, diff, append). The X code may still cause an ENAMETOOLONG error. X X The next planned stages: X X - Make "star -c -find . ..." able to archive path names of X arbitrary length. X X - Add methods to avoid ENAMETOOLONG in extract or diff mode. X X - Make "star -c . ..." able to archive path names of X arbitrary length. X X - Make Make "star -c . ..." as fast as "star -c -find . ..." X X- star: SELinux support has been added. The related code is based on code X that was most likely written by X X Daniel Walsh X X The code has been reported to the star team by X X Kristýna Streitová X X Note that the new code correctly clears inherited SELinux attributes X for files that haveno such attributes in the archive. So it is X important to upgrade. X X- star: the SELinux support was revised with feedback from X Pavel Raiskup X X- star: star -version on Linux now prints: X X star: star 1.5.4 (x86_64-unknown-linux-gnu) X X Options: acl-POSIX.1e-draft find fflags remote Linux-xattr SELinux X X and make it visible whether there is SELinux support compiled in. X X- star: a typo in acl_unix.c has been fixed. This typo could in X rare situations cause a buffer overflow as the wrong strlen() was X checked. X X Thanks to Pavel Raiskup for reporting X X- star: converted the code in preparation for a localization. X star now calls the new gt*() functions wit builtin gettext() X call for the format string. X X This has been done for most cases by a #define GT_COMERR X and #define GT_ERROR X X In some special cases, there are calls to gtprintf() and fgtprintf(). X X- Shells & star long pathname enhancements: X X These enhancements have been implemented in a way that X they do not affect the behavior with pathnames shorter X than PATH_MAX. X X If a very long path name is encountered, things become X slow since this typically results in hopping over a dozen X or more single openat() calls. X X Star may have general problems as a result from new dynamic X path name storage handling. X X Star did not yet replace all static path name stuff by X dynamic path handling but the typical usage should be covered X by the current state. What is missing is support for X -install, file unlinking and file renaming. X X Star may have problems with long path names under some X rare conditions. X X- star: new functions lchdir() & lgetcwd() have been added for dealing X with very long path names with the -C option. X X- star: the option list= is now implemented using getdelim() and thus X supports to read arbitrary path name length from files or stdin. X X- star: volhdrs are now without a PATH_MAX limit. X X- star: added a new function _lgetinfo() that always does an lstat() X independent of -L and -h. This is needed in order to check whether X a filesystem object exists and needs to be deleted before extraction. X X- star: line reading functions that deal with the inode database in X "star-symtable" in the incremental restore code now support arbitrary X line length. X X- star: the "remove" code now supports to remove file system trees of X arbitrary depth and path length. X X- star: incremental restores, in case they are not run as root, could X under some rare cases (nearly full target filesystem) when inode X numbers are reused faster than usual, result in "permission denied" X errors while extracting files. X X This happened when such a reused inode has no write permission for X the owner. A similar case with changing file type has been fixed X in February 2005 as the only bug that ever appeared in star's X incremental backup/restore system fater incrementals have been X introduced in September 2004. Since February 2005, we remove files X with a different type before we create new ones. X X As we previously assumed that incremental restores are always run X as root, this permission problem did never cause any harm in the X past. This is since root is allowed to create files in readonly X directories and since root can write into readonly files. X X We now first run a chmod() +w on directories and files with no X write permissions before we extract the content. X X This modification now allows star to be used for private backups X and restores without the need to become root for the task. X X- star_sym: Added a new function osmode() because restore.c now X needs this function because of the above change and we do not like X to add star_unix.c to star_sym. X X- star: Previously, star needed the option -force-restore in order to X restore partial dumps. A new option -partial now allows partial X restores without at the same time permitting dump level mismatches X or reference date mismatches. X X- star: star -Hgnutar now also creates long path names. GNU tar-1.30 X started to create long path names under some conditions, even though X it is unable to extract archives with long path names. Our archives X thus are not more challenging to GNU tar than archives created X by GNU tar itself ;-) X X- star: mention the GNU tar long path name problem in the man page. X X- star: mktemp() destroys it's argument even when it fails because X of ENAMETOOLONG. We need to save and restore the original name X argument to make our long path workaround working. X X- star: "star -x -install ..." now works with very long path names X as we have a mktemp() workaround for long path names. X X- star: Long names using the pre-POSIX long pathname header method now X works since the related extraction routine in longname.c now manages X dynamic path store as well. X X- star: extraction with symlink emulation (that creates copies) now also X supports long path names. X X- star: incremental restores now support long path names. X X- star: "star -c" (without "-find") is now able to handle long X path names. This is the final change to make star a fully long path X name supporting program. X X- star: star_unix.c: a new function getinfoat() has been added. X It uses fstatat() if this function supported by the current platform X and not emulated in libschily. X X- star: "star -c" now uses fstatat() via getinfoat() if possible. X This causes a 30% performance win in case of "star -c -onull" and X makes "star -c" now nearly as fast as "star -c -find". X X- star: pathname.c: New function clear_pspace() X X- star: star -xattr now aborts with an error message that -xattr X is reserved for NFSv4 xattrs and that Linux needs -xattr-linux X X- star long path name state report: X X - All known places that previously used static path name store X or system calls directly have been converted to use dynamic X path storage and long path name aware functions. This has been X extended to any place (even those locations that never reach X ENAMETOOLONG) in order to be able to verify the correctness X of the change via "nm". X X - Most long path name features work even on older platforms if X at least fchdir() is supported, so this does not need a very X recent platform. X X - Hard links between long path names only work on platforms X that natively support the linkat() system call. X X - The code is not yet optimized for good performance and is X currently approx. 30% slower when long paths (> PATH_MAX) are X actually used. X X- star: using -xattr now only prints a hint on -xattr-linux in case X that this happens on a platform that does not support NFSv4 Extended X Attribute files, e.g. Linux. X X- star: using -xattr on a platform with NFSv4 Extended Attribute files X now prints that this feature is not yet supported in star. X X- star: Release 2018-07-16 caused star not to compile anymore on Mac OS X. X This is because sys/xattr.h on Linux and sys/xattr.h on Mac OS X are X very similar but incompatible. X X A first quick fix, was to disable Linux xattr support in case that X XATTR_NOFOLLOW is defined (which is part of the incompatibility). X X Since things did look simple, we now support these simple xattr method X on Mac OS X as well. X X- star: Release 2018-07-16 introduced a bug in the diff code that caused X star to dump core while comparing symbolic links. Since the symlink X target name cannot be longer than PATH_MAX, we are now using a static X path buffer again in this case. X X- star: The routines that read Y/N answers now use fgetstr() instead of X fgetline() in order to detect a buffer overrun. X X In case of an overrun, we now read until a newline is seen, in order to X get a new sane start for the next question. X X- star: New file version.c include a datefield besides the version X number. X X- star: The star archive format man page has been updated to match the X current state. X X- star: The archive format detection for the XUSTAR format now also X checks for base 256 numbers in atime/ctime. X X- bsh/Bourne Shell/star: a very long path name could cause a core dump X with a "chdir()" operation in some cases, as there was no check for X pointer != NULL when restoring the '/' character while hopping over X parts of the path name. X X Thanks to Heiko Eißfeldt for reporting. X X- star: "star -c H=exustar -pax-o binary" now correctly results in X unencoded strings for uname/gname/path/linkpath. There was preliminary X code for the -copy mode but the final changes for this binary mode X have been forgotten. This was caused by a change of a variable name X from "copyflag" to "binflag" in May 2018. X X WARNING: If you created archives during the past three months using the X option "-pax-o binary", you definitely need to recreate the archives X in case there are non-ascii characters in values for the named X keywords. X X- star: The code to set the time stamp for extracted files has been X changed to correctly deal with symbolic links. X X In former times, time stamps for symlinks have not been set at all X as there was n way to do that. X X Later, with the availability if utimensat() This could be done for X symlinks as well, if the target systen supports utimensat(). X X Recently, the code was rearranged to always use utimensat(), but X to use an emulation on older systems. This resulted in sometimes X setting the timestamp of the symlink target instead of the X symlink, depending on how the emulation could be implemented. X X The new code knows how the emulation is done and avoids to set X the times for the symlink targets on older platforms where the X emulation does not (cannot) support to set the time of symlinks. X X Thanks to Stephane Chazelas for reporting. X X- star: star -x -to-stdout no longer tries to set the "not extracted" X file to Jan 1 1970 in case of an extraction error. X X- star: The option -secure-links has been made the default except when X extracting dumps with the -restore option. X X The reason for that change is that a handcrafted tar archive could X first include a symlink with absolute target name, e.g. x -> /etc X and then include a file x/passwd that would be extracted using X the 'x' link to result in /etc/passwd. X X Our solution with -secure-links is the same since 20 years: do not X extract the problematic symlink and as a result, the later file X will be extracted into the local directory tree. X X- star: a new option -no-secure-links allows to disable the secure X default behavior. X X- star: Added a new help output to the error statistics in case that X a file has been skipped because it contains /../ or when a symbolic X link has been skipped because it points to an absolute path or X because the symlink target contains /../. This help-text mentions X the options -.. and -secure-links respectively. X X- star: the archive format man page now correctly explains that in X BINRAY mode, the values for uname/gname/path/linkpath are not X coded in UTF-8. X X- star: The README file now mentions very long path names and X uses recent mail addresses X X- star: the function getpriv() has been renamed to getpaxpriv() X since a function getpriv() is part of libc on OS400. X X Thanks to Jack Woehr for reporting X X- libfind/star/mkisofs/bsh/Bourne Shell: "find -xdev" is no longer X UNIX compatible but rather POSIX compatible. X X *** Incompatible change *** X *** POSIX wording from 1992 is in conflict with UNIX implementation *** X X Background: POSIX in 1992 introduced a wording for -xdev that was in X conflict with existing implementations and required a behavior that X is impossible to implement with nftw(3). X X Today, half of the implementations follow the UNIX rules and half of X the implementations follow the POSIX text. X X To solve the conflict, POSIX decided to add the old UNIX "find -mount" X (that was intended as an alias to "find -xdev") and to be implemented X with the old UNIX behavior and requires "find -xdev" to follow the X POSIX text from 1992. At the same time, POSIX introduced a new nftw(3) X flag FTW_XDEV as a complement to FTW_MOUNT with the behavior that X matches the POSIX requirements for "find -xdev". X X As a result, libfind now makes -xdev an alias to -mount+ and keeps X the -mount primary with the old behavior. The difference is: X X -mount does not lists mount points at all and does not descend X into them. X X -xdev lists directories that are mount points but does not X descend into these directories. X X- star: changed the members of struct dumpdates to have the prefix dd_ in X all members. X X- star: Enhanced the comment in fifo.c and fifo.h X X- star: Added "volatile" to a selection of struct members in struct m_head. X This should help to avoid specific optimization from newer compilers X that could cause problems with the synchronization of the fifo. X X- star: added new flag members (eflags & pflags) to struct m_head to make X sure that the probability of changing too much with &= and |= operators X in only a single flag word is reduced. We added: X X eflags for flags that are only used in preparation of an exit X X pflags for flags that are modified only by the put side of the FIFO X when doing changes at unpredictive time slots. X X- star: make sure that "star -c" results in a non-zero exit code if it X is interupted by ^C. X X Note that star catches ^C in order to avoid to create defective tar X archives (similar to a GNU tar bug) in such a case, but previously X behaved like SunOS tar that finishes with the current file, writes X a correct EOF record to the archive and then exits with 0. X X The star exit code in case of a ^C with star -c is -4. X X- star: Added new code to allow to debug a hanging FIFO. X X If the FIFO hangs, use "ps -efc| grep star" to find the two process X IDs for the two star processes and then call: X X kill -RTMAX X kill -RTMAX X X and report the output that appears after sending this signal to both X processes. X X- star: the path name length and the link name length are now set from X the POSIX 2001 extended tar headers in case that a name appears in that X extended meta data. This may speed up thigs that need to know the path X name length. X X- star: Star now retrieves the current working directory in extract mode. X If this fails, it is not seen as a severe error and star continues to X work. X X- star: the behavior for links in the default case (with X -secure-links active) has been made more user friendly. X X Star now only flags links that point outside the current working X directory. This makes all tar extractions in default mode safe as long X as they are done inside an empty diretory. X X- star: various Cstyle changes X X- star: documented the new primaries -chatime, -chctime, -chmtime X X These primaries allow to archive files with aribitrary time stamps. X X If you e.g. like to archive all files with the current time, use: X X star -c -find . -chmtime now X X- star: A typo in the function dolchmodat() has been fixed. The bug has been X introduced in July 2018 while adding support for very long path names. X X dolchmodat() is needed/used when a platform uses different file mode X bits than defined by POSIX. In this case, the fix allows to compile X star with DJGPP again. X X- star: added a new timestamp to the star version. X X- star: The man page now mentions incremental backups and restores in the X FEATURES section. X X- smt: smt -wready now checks whether the last open really failed before X retrying the open operation. X X Thanks to Pavel Raiskup for reporting this coverity result. X X- star: hole.c: A memory leak in in hole.c::put_sparse() has been fixed. X X Thanks to Pavel Raiskup for reporting this coverity result. X X- star: xheader.c: the macro scopy() no longer has a semicolon at the end. X X Thanks to Pavel Raiskup for reporting this coverity result. X X- star: added support for auto detection of "zstd" compressed archives. X X- star: added a new option -zstd to support compression and uncompression X using the program "zstd". X X- star: Recently, star did hang in the FIFO code on Solaris. This did X not happen on Solaris over 20 years before... X X On Linux - on fast multi CPU machines - the probability that a X child process from fork() starts up before the parent is 1000x higher X than on Solaris, where 10 million tries were needed to reproduce the X same problem. X X As a result, the FIFO in star on Linux could in rare cases (1 of X ~ 10000 tries) even finish the 1st read() from the input file before X the "tar"-process starts with e.g. command lines like "star -tv" or X "star -x". Since star introduced auto-byte-order detection and handling X in 1985, star needs a special start up sequence to do that. X X Star introduced the FIFO in the late 1980s and the machines from that X time did always restart the parent before the fork()ed child starts. X The new OS behavior thus caused a situation that was not forseeable X when the FIFO has been designed. This new OS behavior caused a X deadlock in aprox. 1 of 10000 star calls on Linux and 1 of 10000000 X star calls on Solaris. X X Star now waits when entering the FIFO fill-process until the X FIFO get-process did start up before trying to wake up a waiting X get process. X X- star: On Linux, in 1 of 1.5 million tries, star did die from SIGPIPE. X Note that this did never happen on Solaris. X X Star now ignores SIGPIPE and it seems that this fixed the problem X since it did not happen again after that change with even 100 million X tries. X X- star: The debug printing for the FIFO has been enhanced to print more X information from the FIFO control structure to make it easier to debug X problems like the ones mentioned above. X X- star: There seems to be a problem in pipe handling in the Linux kernel. X It seems that in rare cases, the read(2) on a pipe returns 0 even though X the write side did write(2) one byte to the pipe just before calling X exit(). Unfortunately, this problem is hard to debug as it happens only X once every ~30 million tries. Our workaround is to behave as if the X expected byte could be read and star currently prints something like: X X star: Erfolg. Sync pipe read error pid 8141 ret 0 X star: Erfolg. Ib 0 Ob 1 e 0 p 1 g 0 chan 5. X star: Erfolg. Trying to work around Kernel Pipe botch. X X before it continues. Since the star exit code in such a case is 0, X we assume that this is a correct workaround and this case thus may X be made completely silent in the future. X X- star: an even less frequent FIFO problem (occurs once every 50 million X tries on fast multi CPU machines) has been identified. Star reports a X hard EOF on input even though the complete file with logical EOF has X been read and there is still input to process. In order to debug this X problem a debug message has been added to the code. X X With this debug message, it turned out, that this problem happened X because a context switch occurred in the FIFO read process after it did X see an empty FIFO and later, after the process was resumed, the X following check for the FIFO_MEOF flag did see EOF. We now first check X for the FIFO_MEOF flag and later for the amount of data inside as the X FIFO as FIFO_MEOF is set after the FIFO content has been updated and X thus a context switch is no longer able to cause a wrong assumption X about the content of the FIFO. X X If you still see this, please send a report. X X- star: added support to print debug malloc statistics to better debug X memory problems in star. X X- star: pathname.c:: free_pspace() now only frees the path buffer if it X is != NULL X X- star: fixed a bug in the file create.c that caused star to incorrectly X grow the path buffer by 2 bytes for every archived file. This caused X star to constantly grow if a larger amount of files are archived and X eat up all memory available to 32 bit processes if the archived X filesystem is larger than approx. 1 TB. X X- star: If the path name now cannot be handled because of low memory, X we print a warning that includes the text "out of memory". X X- star: Now checking whether open of /dev/null failed while running a X compress pipe. This avoids a core dump on defective OS installations. X X Thanks to Pavel Raiskup for poiting to a related Coverity message. X X- star: props.c: Added a missing /* FALLTHROUGH */ comment. X X Thanks to Pavel Raiskup for poiting to a related Coverity message. X X- star: create.c: Add more comment for the CPIO CRC format handler to X explain why the last instance if a series of hard links for a file X needs to archive the data. X X- star: diff.c: added a filling fillbytes(&finfo, ...) to make sure that X ACL pointers are initialized. X X Thanks to Pavel Raiskup for poiting to a related Coverity message. X X- star: Several /* NOTREACHED */ comments have been added to tell X programs like coverity that after a NULL pointer check, there is no X continuation of the program X X Thanks to Pavel Raiskup for poiting to a related Coverity message. X X- star: extract.c: A if (path->ps_path == '\0') has been corrected to X if (path->ps_path[0] == '\0') after a mktemp() call. This was a typo X introduced with the new support for extremely long path names. X X Thanks to Pavel Raiskup for poiting to a related Coverity message. X X- star: extract.c An initalization for a struct pathstore has been X moved to the front to verify that path.ps_path is always initialized. X X Thanks to Pavel Raiskup for poiting to a related Coverity message. X X- star: header.c: isgnumagic(&ptb->dbuf.t_vers) has been changed to X isgnumagic(ptb->ustar_dbuf.t_magic) as it is a "ustar" structure X that is going to be checked. X X Thanks to Pavel Raiskup for poiting to a related Coverity message. X X- star: some Cstyle changes X X- star: another similar problem has been fixed already in the 2019-01-22 X release: X X An even less frequent FIFO problem (occurs once every 50 million X tries on fast multi CPU machines) has been identified. Star reports a X hard EOF on input even though the complete file with logical EOF has X been read and there is still input to process. In order to debug this X problem a debug message has been added to the code. X X With this debug message, it turned out, that this problem happened X because a context switch occurred in the FIFO read process after it did X see an empty FIFO and later, after the process was resumed, the X following check for the FIFO_MEOF flag did see EOF. We now first check X for the FIFO_MEOF flag and later for the amount of data inside as the X FIFO as FIFO_MEOF is set after the FIFO content has been updated and X thus a context switch is no longer able to cause a wrong assumption X about the content of the FIFO. X X We now did run 250 million tests without seeing another problem. X X If you still see this, please send a report. X X- star: Note that the debug output for this problem now has been X disabled. If you need to debug this, call: X X smake clean COPTX=-DFIFO_EOF_DEBUG all X X in the star directory. X X- star: The message "Sync pipe read error" is no longer printed when X the FIFO background process dies instead of sending a final wakeup. X This is needed since there is a possibility for a context switch in X the foreground process that can make it later wait for a wakeup while X the background process misses to see the wait flag and just exits. X X- star: In rare conditions (once every 2 million tries), a hang could X occur with "star -c" if the tar process fills the FIFO and sets the X EOF flag and then calls wait() to wait for the FIFO tape output X process. This happens in case that the tape output did not see the X EOF flag because it has undergone a context switch after it checked X for the not yet existing EOF flag and before waiting for a wakeup X from the tar FIFO fill process. X X Star now closes the sync pipes before calling wait() as this always X wakes up the waiting other side. X X We did run another 300 million tests for this condition and did not X see any problem now. X X- makefile system: A new file include/schily/type_val.h has been added to X allow to use TYPE_MINVAL(), ... without a need to X #include X X- makefile system: include/schily/limits.h now contains some X XXX_MAX/XXX_MIN fallbacks in case the related defintions are missing X in the system include file of the current OS. X X- star: Support for base-256 numbers in timestams and uid/gid has been X added. This has been planned in the 1990s already, when star invented X the base-256 coding, but it has been forgotten in favor of the X POSIX.1-2001 enhanded archive headers. Now it seems that GNU tar X that copied the format from star uses it for timestamps and uid/gid X and we need to implement it in order to get archive compatibility. X X Thanks to Michal Górny (mgorny@gentoo.org) for detecting the missing X feature. X X- star: The t_rdev field in the old star header now may use base-256 X as well. X X- star: The function stoli() added a new parameter "fieldwidth" that X allows to configure when a "unterminated octal number" warning is X printed. This is needed since this function is used for 8 byte and X for 12 byte fields. X X- star: star did print archives with illegal 32 byte user/group X names (where the nul terminator is missing) "correctly", when in X list mode but it used only the first 31 bytes when extractig X such archives X X- star: a new function istarnumber() is used to do better heuristics on X what a valid TAR archive is. We have some special handling to work X around the non-compliance of GNU tar in some known cases. If you X discover other GNU tar archives that are not detected as TAR archive, X please report them to help to make th eheuristics better. X X The background is to make star better in detecting fool archives. X X- star: The directory testscripts added new files: X X testscripts/not_a_tar_file1 and testscripts/not_a_tar_file3 X X with correct checksums that fool tar implementations that use too X few heuristics to identify tar archives. X X- star: fixed a bug in the FIFO related to extracting multi-volume X archives. The bug was introduced with release 2019-02-18 and the X effect was that the FIFO complained at the end of the last volume. X X- star/libschily: Added new error checking codes: X X "ID" allows to control error behaviour with range errors in uid_t X and gid_t values. X X "TIME" allows to control error behaviour with range errors in time_t X X- star: Creating multi volume archives without using the FIFO did dump X core. We thus no longer set mp->chreel = TRUE; when the FIFO has X been disabled. The related bug has been introduced in January 2012. X X- star: Creating multi volume archives with a very small volume size X could cause a hang at the end as the function startvol() did not X check whether the TAR process did already decide to exit while X waiting for the TAR process to calm down (stop) before writing the X next multi volume header. We no longer wait in this case. X X- star: exprstats() now calls fifo_exit(ret) in order to avoid a X FIFO Sync pipe read error message in case that star was terminated X with an error. X X- star: Since we added better Unicode support in May 2018, star did X dump core when a multi volume header with POSIX.1-2001 extensions X was written in multi volume create mode. We now check for NULL X pointers before we call nameascii() to decide whether the file X name needs a UTF-8 translation. X X- star: Creating multi volume archives without POSIX.1-2001 support X no longer sets POSIX.1-2001 extension flags for the volume header. X X- star: The flag XF_NOTIME now works when creating POSIX.1-2001 X extended headers and thus the 'x'-header with time stamps for the X volume header tar header is no longer created. This avoids X to write atime=1 for the volume number 1 since we encode the X volume number in the otherwise useless atime of the volume header X when in POSIX.1-1988 TAR mode. X X- star: the star.1 man page now mentions that the first tar program X appeared in 1979 (3 years before star has been started as a project). X X- star: the star.4 man page now has a "SEE ALSO", a HISTORY and X a AUTHOR section. X X- star: the star.4 man page now has a MULTI VOLUME ARCHIVE HANDLING X section. X X- star: the star.4 man page added a new "BASIC TAR STRUCTURE" section. X X- star: The ACL reference test archives (formerly available from e.g.: X http://sf.net/projects/s-tar/files/alpha/) have been added X to the directory star/testscripts/. The files X X acl-test.tar.gz X acl-test2.tar.gz X acl-test3.tar.gz X acl-test4.tar.gz X acl-test5.tar.gz X X contain ACLs that use the obsolete method from a POSIX proposal X from around 1993 that was withdrawn in 1997 and never has become X part of a standard. This method has been implemented in 1993 for X UFS on Solaris. X X GNU tar claims to support this format but really does not support X it at all. GNU tar fails to extract the reference tar archives from X above and it fails to create a compliant tar archive in create mode. X It is strange to see that GNU tar never has been tested against the X reference archives that have been created in collaboration with X SuSE in 2001 already. X X The files X X acl-nfsv4-test.tar.gz X acl-nfsv4-test2.tar.gz X acl-nfsv4-test3.tar.gz X acl-nfsv4-test4.tar.gz X acl-nfsv4-test5.tar.gz X X contain ACLs that have become part of the NFSv4 standard and that X are also used on NTFS and ZFS. This format is completely unsupported X by GNU tar. X X- star TODO: create unit tests in order to avoid future problems X with multi volume archives similar to the problems we recently X fixed. X X- makefile system: A new file include/schily/type_val.h has been added to X allow to use TYPE_MINVAL(), ... without a need to X #include X X- makefile system: include/schily/limits.h now contains some X XXX_MAX/XXX_MIN fallbacks in case the related defintions are missing X in the system include file of the current OS. X X- star: Support for base-256 numbers in timestams and uid/gid has been X added. This has been planned in the 1990s already, when star invented X the base-256 coding, but it has been forgotten in favor of the X POSIX.1-2001 enhanded archive headers. Now it seems that GNU tar X that copied the format from star uses it for timestamps and uid/gid X and we need to implement it in order to get archive compatibility. X X Thanks to Michal Górny (mgorny@gentoo.org) for detecting the missing X feature. X X- star: The t_rdev field in the old star header now may use base-256 X as well. X X- star: The function stoli() added a new parameter "fieldwidth" that X allows to configure when a "unterminated octal number" warning is X printed. This is needed since this function is used for 8 byte and X for 12 byte fields. X X- star: star did print archives with illegal 32 byte user/group X names (where the nul terminator is missing) "correctly", when in X list mode but it used only the first 31 bytes when extractig X such archives X X- star: a new function istarnumber() is used to do better heuristics on X what a valid TAR archive is. We have some special handling to work X around the non-compliance of GNU tar in some known cases. If you X discover other GNU tar archives that are not detected as TAR archive, X please report them to help to make th eheuristics better. X X The background is to make star better in detecting fool archives. X X- star: The directory testscripts added new files: X X testscripts/not_a_tar_file1 and testscripts/not_a_tar_file3 X X with correct checksums that fool tar implementations that use too X few heuristics to identify tar archives. X X- star: fixed a bug in the FIFO related to extracting multi-volume X archives. The bug was introduced with release 2019-02-18 and the X effect was that the FIFO complained at the end of the last volume. X X- star/libschily: Added new error checking codes: X X "ID" allows to control error behaviour with range errors in uid_t X and gid_t values. X X "TIME" allows to control error behaviour with range errors in time_t X X- star: Creating multi volume archives without using the FIFO did dump X core. We thus no longer set mp->chreel = TRUE; when the FIFO has X been disabled. The related bug has been introduced in January 2012. X X- star: Creating multi volume archives with a very small volume size X could cause a hang at the end as the function startvol() did not X check whether the TAR process did already decide to exit while X waiting for the TAR process to calm down (stop) before writing the X next multi volume header. We no longer wait in this case. X X- star: exprstats() now calls fifo_exit(ret) in order to avoid a X FIFO Sync pipe read error message in case that star was terminated X with an error. X X- star: Since we added better Unicode support in May 2018, star did X dump core when a multi volume header with POSIX.1-2001 extensions X was written in multi volume create mode. We now check for NULL X pointers before we call nameascii() to decide whether the file X name needs a UTF-8 translation. X X- star: Creating multi volume archives without POSIX.1-2001 support X no longer sets POSIX.1-2001 extension flags for the volume header. X X- star: The flag XF_NOTIME now works when creating POSIX.1-2001 X extended headers and thus the 'x'-header with time stamps for the X volume header tar header is no longer created. This avoids X to write atime=1 for the volume number 1 since we encode the X volume number in the otherwise useless atime of the volume header X when in POSIX.1-1988 TAR mode. X X- star: the star.1 man page now mentions that the first tar program X appeared in 1979 (3 years before star has been started as a project). X X- star: the star.4 man page now has a "SEE ALSO", a HISTORY and X a AUTHOR section. X X- star: the star.4 man page now has a MULTI VOLUME ARCHIVE HANDLING X section. X X- star: the star.4 man page added a new "BASIC TAR STRUCTURE" section. X X- star: The ACL reference test archives (formerly available from e.g.: X http://sf.net/projects/s-tar/files/alpha/) have been added X to the directory star/testscripts/. The files X X acl-test.tar.gz X acl-test2.tar.gz X acl-test3.tar.gz X acl-test4.tar.gz X acl-test5.tar.gz X X contain ACLs that use the obsolete method from a POSIX proposal X from around 1993 that was withdrawn in 1997 and never has become X part of a standard. This method has been implemented in 1993 for X UFS on Solaris. X X GNU tar claims to support this format but really does not support X it at all. GNU tar fails to extract the reference tar archives from X above and it fails to create a compliant tar archive in create mode. X It is strange to see that GNU tar never has been tested against the X reference archives that have been created in collaboration with X SuSE in 2001 already. X X The files X X acl-nfsv4-test.tar.gz X acl-nfsv4-test2.tar.gz X acl-nfsv4-test3.tar.gz X acl-nfsv4-test4.tar.gz X acl-nfsv4-test5.tar.gz X X contain ACLs that have become part of the NFSv4 standard and that X are also used on NTFS and ZFS. This format is completely unsupported X by GNU tar. X X- star TODO: create unit tests in order to avoid future problems X with multi volume archives similar to the problems we recently X fixed. X X- star_sym: added forgotten man page X X- autoconf/configure: Added a workaround for a Mac OS X linker bug. X configure now always uses "rm -rf conftest*" instead of just X "rm -f conftest*" to avoid error messages from the stray *.dSYM X and sometimes persistent directories created by the Apple linker. X X- Makefile system: The rules for creating HTML files from man pages X now set the troff variable "h" to 1. This is used by the SCCS X man pages (e.g sccs-prs.1) to be able to let a wide table start X at column 1 without letting man2html(1) result this in making the X table entries a header (big letters). X X- Makefile system: "make tests" now implies a "make all". X X Thanks to Heiko Eißfeldt for reporting. X X- libschily: The gethostname() emulation no longer returns ENOSYS X if namelen is < 0. The error code now is EINVAL. X X- libschily: the lutimens() emulation no longer returns ENOSYS in case X that the lstat() call fails, since this error code may e.g. be X ENAMETOOLONG and used as an important indicator for long path name X handling. X X This bug caused incorrect behavior when star extracted long pathnames X on a platform without utimensat(). X X- star: The code restructuring to openat() from Summer 2018 did not X only cause a noticeable speed up even when not using -find, it at X the same time resulted in a wrong error message when a file type X was seen that is not archivable (e.g. a socket while using the USTAR X format). The correct message was something like "Unsupported filetype", X while the bug caused a "file not found " message. This has been fixed X by adding a new parameter "fd" to the function stat_to_info(). X X- star: header.c::get_xhtype() we did forgot to initialize: X X finfo.f_devminorbits X and X finfo.f_xflags X X This is now done. X X- star: The USTAR format now is able to create base-256 values in X the field "t_devmajor". "t_devminor" did already support base-256. X X- star: The GNU tar format now is able to create base-256 values in X the fields "t_devmajor" and "t_devminor". X X- star: The man page star.4 now mentions which fileds may have X base-256 numbers. X X- star: The man page star.4 now longer contains the doubled "field field" X in the explanation of the added UID/GID number for ACLs. X X- star: The man page star.4 now has a better description for the additional X numeric fields in the ACL entries to prevent GNU tar from continuing X with it's incompatible ACL implementation. X X- star: New ACL reference archives for the ultra compact format, that has X been defined together with the libachive people, have been added to the X directory testscripts/: X X acl-nfsv4-compact-test.tar.gz X acl-nfsv4-compact-test2.tar.gz X acl-nfsv4-compact-test3.tar.gz X acl-nfsv4-compact-test4.tar.gz X acl-nfsv4-compact-test5.tar.gz X X- star: Linux now uses the new instead of X to retrieve file flags. X X Thanks to a hint from Martin Matuska from the X libarchive team. X X- star: Support for the following new BSD Flags: X X compressed hidden offline rdonly reparse sparse system X X has been added. X X Thanks to a hint from Martin Matuska from the X libarchive team. X X- star: Support for the following new Linux flags: X X dirsync nocow notail projinherit topdir X X has been added. X X Thanks to a hint from Martin Matuska from the X libarchive team. X X- star: Support for reading non-comliant libarchive tarballs that use X X "securedeletion" or "journal" X X instead of the documented text has been added. This was used by X libarchive until March 20, when libarchive has been fixed. We introduce X the above names for compatibility with old TARs created by libarchive. X X- star: When an "old star" archive is read and this archive is from a system X like FreeBSD with non-continous minor bits, star no longer warns unless X there is a device file in the archive. X X- star: unit tests: the scripts now contain X X LC_ALL=C export LC_ALL X X instead of just LC_ALL=C to make the environment exported. X X- star/libstrar: The case where iconv() returns -1 and sets errno to E2BIG X is now handled correctly. X X- star: The testscripts/ directory now contains the tar test archives X from the portability tests from Michal Górny. Check X X http://cdrtools.sourceforge.net/private/portability-of-tar-features.html X X for an updated (to match star-1.6) variant of the results from the portability X tests from Michal Górny. X X- star: older versions of star did not print the messages: X X "WARNING: Archive is 'xxx' compressed, trying to use the -xxx option.\n" X X in case that the option -print-artype was in use. Later versions that X added support for more than "gzip" and "bzip2" forgot to add the same X exception for the new compression methods. We now ommit this message X for all compression types. X X- star: older versions of star did not print the messages: X X "WARNING: Archive is 'xxx' compressed, trying to use the -xxx option.\n" X X in case that an expplicit decompression option was in use. Later X versions that added support for more than "gzip" and "bzip2" forgot to X add the same exception for the new compression methods. We now ommit X this message for all compression types. X X- star: Support for the "lzma" compression has been added. X X- star: Support for the "freeze2" compression has been added. X X- star: The compression method name list did not include the text "zstd". X We added the missing text. X X- star: The hint messages that are printed when a compressed input archive X is not seekable did forgot to mention "lzip" and "zstd". We added the X forgotten messages. X X- star: New unit tests check whether star is able to auto-detect and auto X decompress various compression formats. X X- star: The unit tests now include the portability tests from Michal Górny X X- A new option cli=name (must be argv[1]) allows to select all X supported command line interfaces (star, suntar, gnutar, X pax, cpio) when called as star. X X This is needed to be able to test all command line interfaces from X out unit tests since star is not installed in this case and a selection X from argv[0] would not work. X X- include/schily/dbgmalloc.h: The check for stdio.h was wrong in case that X include/schily/dbgmalloc.h is included from include/schily/mconfig.h X that was included from include/schily/stdio.h X X- libfind/star: the verbose listing code has ben restructured to have X the file permissions in the same string as the file type. X This is needed to implement the POSIX pax listformat interpreter X format %M X X- libfind/star: the verbode listing no longer prints "l" for mandatory X record locking for non-directory type file, but rather only X for plain files. X X- star: The gnutar emulation now prints the --help output to stdout as X GNU tar. X X- star: The gnutar.1 man page now mentions that the GNU tar X options -g / -G did never work and it thus makes no sense to X implement them. X X- star: very outdated code in list.c has been removed. X X- star: Added new unit tests for incremental backups and restores. X This in special include tests that always fail with GNU tar X as GNU tar is not usable and never was usable for incremental X restores in case that the differences are more than trivial. X X- star: new version date 2019-04-01 X X X XTODO: X X - implement support for NFSv4 system attributes X X - implement support for Trusted Solaris X X - Complete the man page for spax X X - Implement multi volume continuation headers that work for X files > 8 GB where the last tar header X (a POSIX.1-2001 'x'-header) was split across volumes. X In this case, if only POSIX compliant TAR features are allowed, X the extracting TAR would not be able to correctly skip the X large file as it does not know the content of the POSIX.1-2001 X 'x'-header. For this reason, later star versions need to implement X a method to create multi volume continuation (skip) headers that X include the size of the split POSIX.1-2001 'x'-header and the X size of the following large file. X X Note that even with this method we would need a new method X (different from the current bitmap) to deal with multi volume X continuation headers for split files in case the FIFO in star X may be larger than 8 GB. X X - Implement an autoconf extension to to deal with Linux with XFS X where not all ACL handling is inside -lacl ??? is this still true? X XRevision history (short) X X1982 First version on UNOS (extract only) X1985 Port to UNIX (fully functional version) X1985 Added pre Posix method of handling special files/devices X1986 First experiments with fifo as external process. X1993 Remote tape access X1993 diff option X1994 Fifo with shared memory integrated into star X1994 Very long filenames and sparse files X1994 Gnutar and Ustar(Posix.1-1988) handling added X1994 Xstar format (extended Posix.1-1988) defined and introduced X1995 Ported to many platforms X1999 Support for Win32 (Cygwin) X1999 base 256 support to overcome limitation with octal fields X2001 Large file support X2001 Support for POSIX.1-2001 extended headers X2001 Support for ACLs (based on the 1997 withdrawn POSIX draft) in POSIX.1-2001 extended headers X2002 Support for extended file flags in POSIX.1-2001 extended headers X2002 Support for extended inode meta data and meta files X2003 New program tartest allows to verify POSIX.1-1990 tar archive compliance X2003 Error control added to allow to selectively ignore error contitions X2003 ED like pattern based file name substitution with -s '/from/to/[gp]' X2003 Efficient built in -copy mode X2003 Basic support for incremental dumps (incremental restore not yet ready) X2003 CPIO archive support X2003 New command 'pax/spax' for POSIX.1 command line compatibility. X2003 New command 'cpio/scpio' for SUSv2 command line compatibility. X2003 New command 'suntar' for Solaris command line compatibility. X2003 New command 'gnutar' for GNU tar command line compatibility. X2003 Support for reliable multi-volume archives with media size detection X2004 Options -copyhardlinks/-copysymlinks/-copydlinks allow to extract links on platforms that do not support links X2005 Support for full and incremental dumps and restores. X2005 Support for cumulative incremental dumps and restores. X2005 The find(1) code has been integrated via libfind and allows to use find on archives X2005 Changed license from GPL to CDDL X2005 Added support for a reliable sparse file interface in Solaris using SEEK_HOLE/SEEK_DATA X2005 Added support for reliable multi volume handling X2006 Added support for sparse files that end in a hole X2007 Added new option -install that allows to overwrite live program text (install on a running system) X2007 Added new option -xmeta to extract meta data only X2010 Added support with -xmeta -force-hole to extract meta data as empty files of original size X2013 Added support to extract timestamps in nanosecond granularity X2013 Support for NFSv4 ACLs (identical to NTFS ACLs) in POSIX.1-2001 extended headers X2018 Added support to compare timestamps in nanosecond granularity X2018 Support for path name lengths up to 8 GB has been added. X2019 Support for the cli= option has been added. X X XSupported platforms: X XVirtually any! Known to work: X XSunOS 4.x, Solaris (SunOS 5.x), Linux, XHP-UX, DG/UX, IRIX, AIX, FreeBSD, NetBSD, OpenBSD, XOSF-1, True-64, QNX, BeOS, Apollo Domain/OS, Next-STep, XOS/2, SCO-openserver, SCO-unixware, Caldera OpenUnix, XCygwin (Win32), Sony NewsOS, BSDi (BSD/OS), QNX, XApple Rhapsody, MacOS X, AmigaOS, GNU Hurd X XJoerg X X------------------------------------------------------------- XStar is the fastest known implementation of a tar archiver. X XStar development started 1982, the first complete implementation has Xbeen done in 1985. I never did my backups with other tools than star. X XIts main advantages over other tar implementations are: X X fifo - keeps the tape streaming. X This gives you faster backups than X you can achieve with ufsdump, if the X size of the filesystem is > 1 GByte. X X remote tape support - a fast RMT implementation that has no X probems to saturate a 100 Mb/s network. X in the mid 1990s and today is evenmuch X faster. X X selectable cli - star cli=xxx allows to select a command X line interface from the list "star", X "suntar", "gnutar", "pax", "cpio". X X accurate sparse files - star is able to reproduce holes in sparse X files accurately if the OS includes X the needed support functions. This is X currently true for Solaris-2.3 to X Solaris-2.5.1 X X pattern matcher - for a convenient user interface X (see manual page for more details). X To archive/extract a subset of files. X X sophisticated diff - user tailorable interface for comparing X tar archives against file trees X This is one of the most interesting parts X of the star implementation. X X no namelen limitation - Before July 2018, star did archive and extract X Pathnames up to 1024 Bytes. Since July 2018, X star deals with long names of arbitrary X length. The same limitation applies to X linknames. X X deals with all 3 times - stores/restores all 3 times of a file X (even creation time) X With POSIX.1-2001 the times are in nanosecond X granularity. X Star may reset access time after doing X backup. On Solaris this can be done without X changing the ctime. X X does not clobber files - more recent copies on disk will not be X clobbered from tape X This may be the main advantage over other X tar implementations. This allows X automatically repairing of corruptions X after a crash & fsck (Check for differences X after doing this with the diff option). X X automatic byte swap - star automatically detects swapped archives X and transparently reads them the right way X X automatic format detect - star automatically detects several common X archive formats and adopts to them. X Supported archive types are: X Old tar, gnu tar, ansi tar, star, X POSIX.1-2001 PAX, Sun's Solaris tar. X X X automatic compression detect - star automatically detects whether the X archive is compressed. If it has been X compressed with a compression program that X is compatible to decompression with "gzip". X "bzip2", "lzop", "p7zip", "xz", "zstd", X ...,, star automatically activates X decompression for 14 different compression X types. X X fully ansi compatible - Star is fully ANSI/Posix 1003.1 compatible. X See README.otherbugs for a complete X description of bugs found in other tar X implementations. Star is the first tar X implementation that supports POSIX.1-2001. X X support for ACLs and file flags - star supports Access Control Lists X with the withdrawn POSIX method and the X NFSv4 standard ACL method as well as X extended file flags (as found on FreeBSD X and Linux). Support to archive and restore X other file properties may be easily added. X NFSv4 ACLs and the deprecated POSIX draft X ACLs are supported. X X support for all inode metadata - star supports to put all inode X metadata on the archive. This allows future X versions of star to perform true X incremental dumps. X X sophisticated error control - allows to tell star which error types X should be ignored for wich file name pattern. X This allows to write backup scripts that give X no error messages for all problems that are X tolerable (e.g. growing log files). X X ED like filename substitution - star supports automated pattern rule based X file name substitution as documented for 'pax'. X X A fast built in -copy mode - allows to make fast and accurate copies and X directory tree comparisons. X X Integrated find(1) code - allows many interesting new features that would X be possible with a separate find call. X XHave a look at the manual page, it is included in the distribution. X END-of-star-1.6/AN-1.6 echo c - star-1.6/libschily mkdir -p star-1.6/libschily > /dev/null 2>&1 echo x - star-1.6/libschily/Makefile sed 's/^X//' >star-1.6/libschily/Makefile << 'END-of-star-1.6/libschily/Makefile' X#ident "@(#)Makefile 1.5 06/07/21 " X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMK_FILES= libschily.mk libschily_p.mk $(NO_SHL)shlschily.mk X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.mks X########################################################################### END-of-star-1.6/libschily/Makefile echo c - star-1.6/libschily/stdio mkdir -p star-1.6/libschily/stdio > /dev/null 2>&1 echo x - star-1.6/libschily/stdio/fgetline.c sed 's/^X//' >star-1.6/libschily/stdio/fgetline.c << 'END-of-star-1.6/libschily/stdio/fgetline.c' X/* @(#)fgetline.c 1.16 18/10/10 Copyright 1986, 1996-2018 J. Schilling */ X/* X * Copyright (c) 1986, 1996-2018 J. Schilling X * X * This is an interface that exists in the public since 1982. X * The POSIX.1-2008 standard did ignore POSIX rules not to X * redefine existing public interfaces and redefined the interfaces X * forcing us to add a js_*() prefix to the original functions. X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#define fgetline __no__fgetline__ X#define getline __no__getline__ X X#define FAST_GETC_PUTC /* Will be reset if not possible */ X#include "schilyio.h" X X#ifdef LIB_SHEDIT X#undef HAVE_USG_STDIO X#undef FAST_GETC_PUTC X#endif X X#ifndef NO_GETLINE_COMPAT /* Define to disable backward compatibility */ X#undef fgetline X#undef getline X#ifdef HAVE_PRAGMA_WEAK X#pragma weak fgetline = js_fgetline X#pragma weak getline = js_getline X#else X XEXPORT int fgetline __PR((FILE *, char *, int)); XEXPORT int getline __PR((char *, int)); X XEXPORT int Xfgetline(f, buf, len) X FILE *f; X char *buf; X int len; X{ X return (js_fgetline(f, buf, len)); X} X XEXPORT int Xgetline(buf, len) X char *buf; X int len; X{ X return (js_fgetline(stdin, buf, len)); X} X#endif X#endif X X#if !defined(getc) && defined(USE_FGETS_FOR_FGETLINE) X#include X X/* X * Warning: this prevents us from being able to have embedded null chars. X */ XEXPORT int Xjs_fgetline(f, buf, len) X register FILE *f; X char *buf; X register int len; X{ X char *bp = fgets(buf, len, f); X X if (bp) { X len = strlen(bp); X X if (len > 0) { X if (bp[len-1] == '\n') X bp[--len] = '\0'; X } X return (len); X } X buf[0] = '\0'; X return (-1); X} X X#else XEXPORT int Xjs_fgetline(f, buf, len) X register FILE *f; X char *buf; X register int len; X{ X register char *bp = buf; X#if defined(HAVE_USG_STDIO) || defined(FAST_GETC_PUTC) X register char *p; X#else X register int nl = '\n'; X register int c = '\0'; X#endif X X down2(f, _IOREAD, _IORW); X X if (len <= 0) X return (0); X X *bp = '\0'; X for (;;) { X#if defined(HAVE_USG_STDIO) || defined(FAST_GETC_PUTC) X size_t n; X X if ((__js_fp f)->_cnt <= 0) { X if (usg_filbuf(f) == EOF) { X /* X * If buffer is empty and we hit EOF, return EOF X */ X if (bp == buf) X return (EOF); X break; X } X (__js_fp f)->_cnt++; X (__js_fp f)->_ptr--; X } X X n = len; X if (n > (__js_fp f)->_cnt) X n = (__js_fp f)->_cnt; X p = movecbytes((__js_fp f)->_ptr, bp, '\n', n); X if (p) { X n = p - bp; X } X (__js_fp f)->_ptr += n; X (__js_fp f)->_cnt -= n; X bp += n; X len -= n; X if (p != NULL) { X bp--; /* Remove '\n' */ X break; X } X if (len <= 0) X break; X#else X if ((c = getc(f)) < 0) { X /* X * If buffer is empty and we hit EOF, return EOF X */ X if (bp == buf) X return (c); X break; X } X if (c == nl) X break; X if (--len > 0) { X *bp++ = (char)c; X } else { X#ifdef __never__ X /* X * Read up to end of line X */ X while ((c = getc(f)) >= 0 && c != nl) X /* LINTED */ X ; X#endif X break; X } X#endif X } X *bp = '\0'; X X return (bp - buf); X} X#endif X XEXPORT int Xjs_getline(buf, len) X char *buf; X int len; X{ X return (js_fgetline(stdin, buf, len)); X} END-of-star-1.6/libschily/stdio/fgetline.c echo x - star-1.6/libschily/stdio/filewrite.c sed 's/^X//' >star-1.6/libschily/stdio/filewrite.c << 'END-of-star-1.6/libschily/stdio/filewrite.c' X/* @(#)filewrite.c 1.18 12/02/26 Copyright 1986, 1995-2012 J. Schilling */ X/* X * Copyright (c) 1986, 1995-2012 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include "schilyio.h" X Xstatic char _writeerr[] = "file_write_err"; X X#ifdef HAVE_USG_STDIO X XEXPORT ssize_t Xfilewrite(f, vbuf, len) X register FILE *f; X void *vbuf; X size_t len; X{ X register int n; X ssize_t cnt; X char *buf = vbuf; X X down2(f, _IOWRT, _IORW); X X if (f->_flag & _IONBF) { X cnt = _niwrite(fileno(f), buf, len); X if (cnt < 0) { X f->_flag |= _IOERR; X if (!(my_flag(f) & _JS_IONORAISE)) X raisecond(_writeerr, 0L); X } X return (cnt); X } X cnt = 0; X while (len > 0) { X if (f->_cnt <= 0) { X if (usg_flsbuf((unsigned char) *buf++, f) == EOF) X break; X cnt++; X if (--len == 0) X break; X } X if ((n = f->_cnt >= len ? len : f->_cnt) > 0) { X f->_ptr = (unsigned char *)movebytes(buf, f->_ptr, n); X buf += n; X f->_cnt -= n; X cnt += n; X len -= n; X } X } X if (!ferror(f)) X return (cnt); X if (!(my_flag(f) & _JS_IONORAISE) && !(_io_glflag & _JS_IONORAISE)) X raisecond(_writeerr, 0L); X return (-1); X} X X#else X XEXPORT ssize_t Xfilewrite(f, vbuf, len) X register FILE *f; X void *vbuf; X size_t len; X{ X ssize_t cnt; X char *buf = vbuf; X X down2(f, _IOWRT, _IORW); X X if (my_flag(f) & _JS_IOUNBUF) X return (_niwrite(fileno(f), buf, len)); X cnt = fwrite(buf, 1, len, f); X X if (!ferror(f)) X return (cnt); X if (!(my_flag(f) & _JS_IONORAISE) && !(_io_glflag & _JS_IONORAISE)) X raisecond(_writeerr, 0L); X return (-1); X} X X#endif /* HAVE_USG_STDIO */ END-of-star-1.6/libschily/stdio/filewrite.c echo x - star-1.6/libschily/stdio/flag.c sed 's/^X//' >star-1.6/libschily/stdio/flag.c << 'END-of-star-1.6/libschily/stdio/flag.c' X/* @(#)flag.c 2.14 10/11/06 Copyright 1986-2010 J. Schilling */ X/* X * Copyright (c) 1986-2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include "schilyio.h" X#include X X#ifdef DO_MYFLAG X X#define FL_INIT 10 X X#if defined(IS_MACOS_X) X/* X * The MAC OS X linker does not grok "common" varaibles. X * Make _io_glflag a "data" variable. X */ XEXPORT int _io_glflag = 0; /* global default flag */ X#else XEXPORT int _io_glflag; /* global default flag */ X#endif XLOCAL int _fl_inc = 10; /* increment to expand flag struct */ XEXPORT int _fl_max = FL_INIT; /* max fd currently in _io_myfl */ XLOCAL _io_fl _io_smyfl[FL_INIT]; /* initial static space */ XEXPORT _io_fl *_io_myfl = _io_smyfl; /* init to static space */ X XLOCAL int _more_flags __PR((FILE *)); X XLOCAL int X_more_flags(fp) X FILE *fp; X{ X register int f = fileno(fp); X register int n = _fl_max; X register _io_fl *np; X X while (n <= f) X n += _fl_inc; X X if (_io_myfl == _io_smyfl) { X np = (_io_fl *) malloc(n * sizeof (*np)); X fillbytes(np, n * sizeof (*np), '\0'); X movebytes(_io_smyfl, np, sizeof (_io_smyfl)/sizeof (*np)); X } else { X np = (_io_fl *) realloc(_io_myfl, n * sizeof (*np)); X if (np) X fillbytes(&np[_fl_max], (n-_fl_max)*sizeof (*np), '\0'); X } X if (np) { X _io_myfl = np; X _fl_max = n; X return (_io_get_my_flag(fp)); X } else { X return (_JS_IONORAISE); X } X} X XEXPORT int X_io_get_my_flag(fp) X register FILE *fp; X{ X register int f = fileno(fp); X register _io_fl *fl; X X if (f >= _fl_max) X return (_more_flags(fp)); X X fl = &_io_myfl[f]; X X if (fl->fl_io == 0 || fl->fl_io == fp) X return (fl->fl_flags); X X while (fl && fl->fl_io != fp) X fl = fl->fl_next; X X if (fl == 0) X return (0); X X return (fl->fl_flags); X} X XEXPORT void X_io_set_my_flag(fp, flag) X FILE *fp; X int flag; X{ X register int f = fileno(fp); X register _io_fl *fl; X register _io_fl *fl2; X X if (f >= _fl_max) X (void) _more_flags(fp); X X fl = &_io_myfl[f]; X X if (fl->fl_io != (FILE *)0) { X fl2 = fl; X X while (fl && fl->fl_io != fp) X fl = fl->fl_next; X if (fl == 0) { X if ((fl = (_io_fl *) malloc(sizeof (*fl))) == 0) X return; X fl->fl_next = fl2->fl_next; X fl2->fl_next = fl; X } X } X fl->fl_io = fp; X fl->fl_flags = flag; X} X XEXPORT void X_io_add_my_flag(fp, flag) X FILE *fp; X int flag; X{ X int oflag = _io_get_my_flag(fp); X X oflag |= flag; X X _io_set_my_flag(fp, oflag); X} X X#endif /* DO_MYFLAG */ END-of-star-1.6/libschily/stdio/flag.c echo x - star-1.6/libschily/stdio/flush.c sed 's/^X//' >star-1.6/libschily/stdio/flush.c << 'END-of-star-1.6/libschily/stdio/flush.c' X/* @(#)flush.c 1.7 04/08/08 Copyright 1986 J. Schilling */ X/* X * Copyright (c) 1986 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include "schilyio.h" X XEXPORT int Xflush() X{ X return (fflush(stdout)); X} END-of-star-1.6/libschily/stdio/flush.c echo x - star-1.6/libschily/stdio/fileopen.c sed 's/^X//' >star-1.6/libschily/stdio/fileopen.c << 'END-of-star-1.6/libschily/stdio/fileopen.c' X/* @(#)fileopen.c 1.12 10/08/21 Copyright 1986, 1995-2010 J. Schilling */ X/* X * Copyright (c) 1986, 1995-2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include "schilyio.h" X XEXPORT FILE * Xfileopen(name, mode) X const char *name; X const char *mode; X{ X int ret; X int omode = 0; X int flag = 0; X X if (!_cvmod(mode, &omode, &flag)) X return ((FILE *)NULL); X X if ((ret = _openfd(name, omode)) < 0) X return ((FILE *)NULL); X X return (_fcons((FILE *)0, ret, flag | FI_CLOSE)); X} END-of-star-1.6/libschily/stdio/fileopen.c echo x - star-1.6/libschily/stdio/fileread.c sed 's/^X//' >star-1.6/libschily/stdio/fileread.c << 'END-of-star-1.6/libschily/stdio/fileread.c' X/* @(#)fileread.c 1.17 12/02/26 Copyright 1986, 1995-2012 J. Schilling */ X/* X * Copyright (c) 1986, 1995-2012 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include "schilyio.h" X Xstatic char _readerr[] = "file_read_err"; X X#ifdef HAVE_USG_STDIO X XEXPORT ssize_t Xfileread(f, buf, len) X register FILE *f; X void *buf; X size_t len; X{ X ssize_t cnt; X register int n; X X down2(f, _IOREAD, _IORW); X X if (f->_flag & _IONBF) { X cnt = _niread(fileno(f), buf, len); X if (cnt < 0) { X f->_flag |= _IOERR; X if (!(my_flag(f) & _JS_IONORAISE)) X raisecond(_readerr, 0L); X } X if (cnt == 0 && len) X f->_flag |= _IOEOF; X return (cnt); X } X cnt = 0; X while (len > 0) { X if (f->_cnt <= 0) { X if (usg_filbuf(f) == EOF) X break; X f->_cnt++; X f->_ptr--; X } X n = f->_cnt >= len ? len : f->_cnt; X buf = (void *)movebytes(f->_ptr, buf, n); X f->_ptr += n; X f->_cnt -= n; X cnt += n; X len -= n; X } X if (!ferror(f)) X return (cnt); X if (!(my_flag(f) & _JS_IONORAISE) && !(_io_glflag & _JS_IONORAISE)) X raisecond(_readerr, 0L); X return (-1); X} X X#else X XEXPORT ssize_t Xfileread(f, buf, len) X register FILE *f; X void *buf; X size_t len; X{ X ssize_t cnt; X X down2(f, _IOREAD, _IORW); X X if (my_flag(f) & _JS_IOUNBUF) X return (_niread(fileno(f), buf, len)); X cnt = fread(buf, 1, len, f); X X if (!ferror(f)) X return (cnt); X if (!(my_flag(f) & _JS_IONORAISE) && !(_io_glflag & _JS_IONORAISE)) X raisecond(_readerr, 0L); X return (-1); X} X X#endif /* HAVE_USG_STDIO */ END-of-star-1.6/libschily/stdio/fileread.c echo x - star-1.6/libschily/stdio/cvmod.c sed 's/^X//' >star-1.6/libschily/stdio/cvmod.c << 'END-of-star-1.6/libschily/stdio/cvmod.c' X/* @(#)cvmod.c 2.9 04/08/08 Copyright 1986, 1995-2003 J. Schilling */ X/* X * Copyright (c) 1986, 1995-2003 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include "schilyio.h" X X#ifndef O_BINARY X#define O_BINARY 0 X#endif X#ifndef O_LARGEFILE X#define O_LARGEFILE 0 X#endif X XEXPORT int X_cvmod(mode, omode, flag) X const char *mode; X int *omode; X int *flag; X{ X while (*mode) { X switch (*mode) { X X case 'r': *omode |= O_RDONLY; *flag |= FI_READ; break; X case 'w': *omode |= O_WRONLY; *flag |= FI_WRITE; break; X case 'e': *omode |= O_EXCL; break; X case 'c': *omode |= O_CREAT; *flag |= FI_CREATE; break; X case 't': *omode |= O_TRUNC; *flag |= FI_TRUNC; break; X case 'a': *omode |= O_APPEND; *flag |= FI_APPEND; break; X case 'u': *flag |= FI_UNBUF; break; X /* dummy on UNIX */ X case 'b': *omode |= O_BINARY; *flag |= FI_BINARY; break; X /* X * XXX do we need this ? X * XXX May this be a problem? X */ X case 'l': *omode |= O_LARGEFILE; break; X default: raisecond(_badmode, 0L); X return (0); X } X mode++; X } X if (*flag & FI_READ && *flag & FI_WRITE) { X *omode &= ~(O_RDONLY|O_WRONLY); X *omode |= O_RDWR; X } X return (1); X} END-of-star-1.6/libschily/stdio/cvmod.c echo x - star-1.6/libschily/stdio/fcons.c sed 's/^X//' >star-1.6/libschily/stdio/fcons.c << 'END-of-star-1.6/libschily/stdio/fcons.c' X/* @(#)fcons.c 2.20 10/11/06 Copyright 1986, 1995-2010 J. Schilling */ X/* X * Copyright (c) 1986, 1995-2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include "schilyio.h" X X/* X * Note that because of a definition in schilyio.h we are using X * fseeko()/ftello() instead of fseek()/ftell() if available. X */ X XLOCAL char *fmtab[] = { X "", /* 0 FI_NONE */ X "r", /* 1 FI_READ */ X "w", /* 2 FI_WRITE **1) */ X "r+", /* 3 FI_READ | FI_WRITE */ X "b", /* 4 FI_NONE | FI_BINARY */ X "rb", /* 5 FI_READ | FI_BINARY */ X "wb", /* 6 FI_WRITE | FI_BINARY **1) */ X "r+b", /* 7 FI_READ | FI_WRITE | FI_BINARY */ X X/* + FI_APPEND */ "", /* 0 FI_NONE */ X/* ... */ "r", /* 1 FI_READ */ X "a", /* 2 FI_WRITE **1) */ X "a+", /* 3 FI_READ | FI_WRITE */ X "b", /* 4 FI_NONE | FI_BINARY */ X "rb", /* 5 FI_READ | FI_BINARY */ X "ab", /* 6 FI_WRITE | FI_BINARY **1) */ X "a+b", /* 7 FI_READ | FI_WRITE | FI_BINARY */ X }; X/* X * NOTES: X * 1) fdopen() guarantees not to create/trunc files in this case X * X * "w" will create/trunc files with fopen() X * "a" will create files with fopen() X */ X X XEXPORT FILE * X_fcons(fd, f, flag) X register FILE *fd; X int f; X int flag; X{ X int my_gflag = _io_glflag; X X if (fd == (FILE *)NULL) X fd = fdopen(f, X fmtab[flag&(FI_READ|FI_WRITE|FI_BINARY | FI_APPEND)]); X X if (fd != (FILE *)NULL) { X if (flag & FI_APPEND) { X (void) fseek(fd, (off_t)0, SEEK_END); X } X if (flag & FI_UNBUF) { X setbuf(fd, NULL); X my_gflag |= _JS_IOUNBUF; X } X set_my_flag(fd, my_gflag); /* must clear it if fd is reused */ X return (fd); X } X if (flag & FI_CLOSE) X close(f); X X return ((FILE *)NULL); X} END-of-star-1.6/libschily/stdio/fcons.c echo x - star-1.6/libschily/stdio/niread.c sed 's/^X//' >star-1.6/libschily/stdio/niread.c << 'END-of-star-1.6/libschily/stdio/niread.c' X/* @(#)niread.c 1.14 09/06/30 Copyright 1986, 1996-2009 J. Schilling */ X/* X * Non interruptable read X * X * Copyright (c) 1986, 1996-2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include "schilyio.h" X XEXPORT ssize_t X_niread(f, buf, count) X int f; X void *buf; X size_t count; X{ X ssize_t ret; X int oerrno = geterrno(); X X if ((ret = (ssize_t)count) < 0) { X seterrno(EINVAL); X return ((ssize_t)-1); X } X while ((ret = read(f, buf, count)) < 0 && geterrno() == EINTR) { X /* X * Set back old 'errno' so we don't change the errno visible X * to the outside if we did not fail. X */ X seterrno(oerrno); X } X return (ret); X} END-of-star-1.6/libschily/stdio/niread.c echo x - star-1.6/libschily/stdio/dat.c sed 's/^X//' >star-1.6/libschily/stdio/dat.c << 'END-of-star-1.6/libschily/stdio/dat.c' X/* @(#)dat.c 1.3 03/06/15 Copyright 1986, 1996-2003 J. Schilling */ X/* X * Copyright (c) 1986, 1996-2003 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X Xchar _badfile[] = "bad_file"; Xchar _badmode[] = "bad_file_mode"; Xchar _badop[] = "bad_file_op"; END-of-star-1.6/libschily/stdio/dat.c echo x - star-1.6/libschily/stdio/fcons64.c sed 's/^X//' >star-1.6/libschily/stdio/fcons64.c << 'END-of-star-1.6/libschily/stdio/fcons64.c' X/* @(#)fcons64.c 1.7 10/08/23 Copyright 2000 J. Schilling */ X/* X * Copyright (c) 2000 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#define USE_LARGEFILES X X#include "schilyio.h" X X#ifdef HAVE_LARGEFILES X X#include "fcons.c" X X#endif END-of-star-1.6/libschily/stdio/fcons64.c echo x - star-1.6/libschily/stdio/fileopen64.c sed 's/^X//' >star-1.6/libschily/stdio/fileopen64.c << 'END-of-star-1.6/libschily/stdio/fileopen64.c' X/* @(#)fileopen64.c 1.7 10/08/23 Copyright 2000 J. Schilling */ X/* X * Copyright (c) 2000 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#define USE_LARGEFILES X X#include "schilyio.h" X X#ifdef HAVE_LARGEFILES X X#include "fileopen.c" X X#endif END-of-star-1.6/libschily/stdio/fileopen64.c echo x - star-1.6/libschily/stdio/filesize.c sed 's/^X//' >star-1.6/libschily/stdio/filesize.c << 'END-of-star-1.6/libschily/stdio/filesize.c' X/* @(#)filesize.c 1.14 06/09/13 Copyright 1986, 1995-2003 J. Schilling */ X/* X * Copyright (c) 1986, 1995-2003 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include "schilyio.h" X#include X XEXPORT off_t Xfilesize(f) X register FILE *f; X{ X struct stat buf; X X down(f); X if (fstat(fileno(f), &buf) < 0) { X raisecond("filesize", 0L); X return (-1); X } X return (buf.st_size); X} END-of-star-1.6/libschily/stdio/filesize.c echo x - star-1.6/libschily/stdio/filesize64.c sed 's/^X//' >star-1.6/libschily/stdio/filesize64.c << 'END-of-star-1.6/libschily/stdio/filesize64.c' X/* @(#)filesize64.c 1.7 10/08/23 Copyright 2000 J. Schilling */ X/* X * Copyright (c) 2000 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#define USE_LARGEFILES X X#include "schilyio.h" X X#ifdef HAVE_LARGEFILES X X#include "filesize.c" X X#endif END-of-star-1.6/libschily/stdio/filesize64.c echo x - star-1.6/libschily/stdio/niwrite.c sed 's/^X//' >star-1.6/libschily/stdio/niwrite.c << 'END-of-star-1.6/libschily/stdio/niwrite.c' X/* @(#)niwrite.c 1.7 09/06/30 Copyright 1986, 2001-2009 J. Schilling */ X/* X * Non interruptable write X * X * Copyright (c) 1986, 2001-2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include "schilyio.h" X XEXPORT ssize_t X_niwrite(f, buf, count) X int f; X void *buf; X size_t count; X{ X ssize_t ret; X int oerrno = geterrno(); X X if ((ret = (ssize_t)count) < 0) { X seterrno(EINVAL); X return ((ssize_t)-1); X } X while ((ret = write(f, buf, count)) < 0 && geterrno() == EINTR) { X /* X * Set back old 'errno' so we don't change the errno visible X * to the outside if we did not fail. X */ X seterrno(oerrno); X } X return (ret); X} END-of-star-1.6/libschily/stdio/niwrite.c echo x - star-1.6/libschily/stdio/nixread.c sed 's/^X//' >star-1.6/libschily/stdio/nixread.c << 'END-of-star-1.6/libschily/stdio/nixread.c' X/* @(#)nixread.c 1.14 09/06/30 Copyright 1986, 1996-2009 J. Schilling */ X/* X * Non interruptable extended read X * X * Copyright (c) 1986, 1996-2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include "schilyio.h" X XEXPORT ssize_t X_nixread(f, buf, count) X int f; X void *buf; X size_t count; X{ X register char *p = (char *)buf; X register ssize_t ret; X register int total = 0; X int oerrno = geterrno(); X X if ((ret = (ssize_t)count) < 0) { X seterrno(EINVAL); X return ((ssize_t)-1); X } X while (count > 0) { X while ((ret = read(f, p, count)) < 0) { X if (geterrno() == EINTR) { X /* X * Set back old 'errno' so we don't change the X * errno visible to the outside if we did X * not fail. X */ X seterrno(oerrno); X continue; X } X return (ret); /* Any other error */ X } X if (ret == 0) /* Something went wrong */ X break; X X total += ret; X count -= ret; X p += ret; X } X return (total); X} END-of-star-1.6/libschily/stdio/nixread.c echo x - star-1.6/libschily/stdio/nixwrite.c sed 's/^X//' >star-1.6/libschily/stdio/nixwrite.c << 'END-of-star-1.6/libschily/stdio/nixwrite.c' X/* @(#)nixwrite.c 1.7 09/06/30 Copyright 1986, 2001-2009 J. Schilling */ X/* X * Non interruptable extended write X * X * Copyright (c) 1986, 2001-2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include "schilyio.h" X XEXPORT ssize_t X_nixwrite(f, buf, count) X int f; X void *buf; X size_t count; X{ X register char *p = (char *)buf; X register ssize_t ret; X register int total = 0; X int oerrno = geterrno(); X X if ((ret = (ssize_t)count) < 0) { X seterrno(EINVAL); X return ((ssize_t)-1); X } X while (count > 0) { X while ((ret = write(f, p, count)) < 0) { X if (geterrno() == EINTR) { X /* X * Set back old 'errno' so we don't change the X * errno visible to the outside if we did X * not fail. X */ X seterrno(oerrno); X continue; X } X return (ret); /* Any other error */ X } X if (ret == 0) /* EOF */ X break; X X total += ret; X count -= ret; X p += ret; X } X return (total); X} END-of-star-1.6/libschily/stdio/nixwrite.c echo x - star-1.6/libschily/stdio/openfd.c sed 's/^X//' >star-1.6/libschily/stdio/openfd.c << 'END-of-star-1.6/libschily/stdio/openfd.c' X/* @(#)openfd.c 1.11 10/11/06 Copyright 1986, 1995-2010 J. Schilling */ X/* X * Copyright (c) 1986, 1995-2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include "schilyio.h" X X#if defined(_openfd) && !defined(USE_LARGEFILES) X#undef _openfd X#endif X XEXPORT int X_openfd(name, omode) X const char *name; X int omode; X{ X return (open(name, omode, (mode_t)0666)); X} END-of-star-1.6/libschily/stdio/openfd.c echo x - star-1.6/libschily/stdio/openfd64.c sed 's/^X//' >star-1.6/libschily/stdio/openfd64.c << 'END-of-star-1.6/libschily/stdio/openfd64.c' X/* @(#)openfd64.c 1.7 04/08/08 Copyright 2000-2003 J. Schilling */ X/* X * Copyright (c) 2000-2003 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#define USE_LARGEFILES X X#define _OPENFD_SRC X#include "schilyio.h" X X#ifdef HAVE_LARGEFILES X X#include "openfd.c" X X#endif END-of-star-1.6/libschily/stdio/openfd64.c echo x - star-1.6/libschily/stdio/fpipe.c sed 's/^X//' >star-1.6/libschily/stdio/fpipe.c << 'END-of-star-1.6/libschily/stdio/fpipe.c' X/* @(#)fpipe.c 1.12 04/08/08 Copyright 1986, 1995-2003 J. Schilling */ X/* X * Copyright (c) 1986, 1995-2003 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include "schilyio.h" X XEXPORT int Xfpipe(pipef) X FILE *pipef[]; X{ X int filedes[2]; X X if (pipe(filedes) < 0) X return (0); X X if ((pipef[0] = _fcons((FILE *)0, X filedes[0], FI_READ|FI_CLOSE)) != (FILE *)0) { X if ((pipef[1] = _fcons((FILE *)0, X filedes[1], FI_WRITE|FI_CLOSE)) != (FILE *)0) { X return (1); X } X fclose(pipef[0]); X } X close(filedes[1]); X return (0); X} END-of-star-1.6/libschily/stdio/fpipe.c echo x - star-1.6/libschily/stdio/fdown.c sed 's/^X//' >star-1.6/libschily/stdio/fdown.c << 'END-of-star-1.6/libschily/stdio/fdown.c' X/* @(#)fdown.c 1.10 04/08/08 Copyright 1986, 1995-2003 J. Schilling */ X/* X * Copyright (c) 1986, 1995-2003 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include "schilyio.h" X XEXPORT int Xfdown(f) X register FILE *f; X{ X down(f); X return (fileno(f)); X} END-of-star-1.6/libschily/stdio/fdown.c echo x - star-1.6/libschily/stdio/fileseek.c sed 's/^X//' >star-1.6/libschily/stdio/fileseek.c << 'END-of-star-1.6/libschily/stdio/fileseek.c' X/* @(#)fileseek.c 1.15 12/02/26 Copyright 1986, 1996-2012 J. Schilling */ X/* X * Copyright (c) 1986, 1996-2012 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include "schilyio.h" X X/* X * Note that because of a definition in schilyio.h we are using X * fseeko()/ftello() instead of fseek()/ftell() if available. X */ X Xstatic char _seekerr[] = "file_seek_err"; X XEXPORT int Xfileseek(f, pos) X register FILE *f; X off_t pos; X{ X int ret; X X down(f); X ret = fseek(f, pos, SEEK_SET); X if (ret < 0 && !(my_flag(f) & _JS_IONORAISE) && X !(_io_glflag & _JS_IONORAISE)) X raisecond(_seekerr, 0L); X return (ret); X} END-of-star-1.6/libschily/stdio/fileseek.c echo x - star-1.6/libschily/stdio/fileseek64.c sed 's/^X//' >star-1.6/libschily/stdio/fileseek64.c << 'END-of-star-1.6/libschily/stdio/fileseek64.c' X/* @(#)fileseek64.c 1.7 10/08/23 Copyright 2000 J. Schilling */ X/* X * Copyright (c) 2000 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#define USE_LARGEFILES X X#include "schilyio.h" X X#ifdef HAVE_LARGEFILES X X#include "fileseek.c" X X#endif END-of-star-1.6/libschily/stdio/fileseek64.c echo x - star-1.6/libschily/stdio/file_raise.c sed 's/^X//' >star-1.6/libschily/stdio/file_raise.c << 'END-of-star-1.6/libschily/stdio/file_raise.c' X/* @(#)file_raise.c 1.9 07/04/03 Copyright 1986, 1995-2007 J. Schilling */ X/* X * Copyright (c) 1986, 1995-2007 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include "schilyio.h" X XEXPORT void Xfile_raise(f, flg) X register FILE *f; X int flg; X{ X int oflag; Xextern int _io_glflag; X X if (f == (FILE *)NULL) { X if (flg) X _io_glflag &= ~_JS_IONORAISE; X else X _io_glflag |= _JS_IONORAISE; X return; X } X down(f); X X oflag = my_flag(f); X X if (flg) X oflag &= ~_JS_IONORAISE; X else X oflag |= _JS_IONORAISE; X X set_my_flag(f, oflag); X} END-of-star-1.6/libschily/stdio/file_raise.c echo x - star-1.6/libschily/stdio/schilyio.h sed 's/^X//' >star-1.6/libschily/stdio/schilyio.h << 'END-of-star-1.6/libschily/stdio/schilyio.h' X/* @(#)schilyio.h 2.32 18/10/10 Copyright 1986, 1995-2018 J. Schilling */ X/* X * Copyright (c) 1986, 1995-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _STDIO_SCHILYIO_H X#define _STDIO_SCHILYIO_H X X#include X#include X#include X#include X#include X#include X#include X#include X X#ifdef NO_USG_STDIO X# ifdef HAVE_USG_STDIO X# undef HAVE_USG_STDIO X# endif X#endif X X#ifdef HAVE_LARGEFILES X/* X * XXX We may need to put this code to a more global place to allow all X * XXX users of fseek()/ftell() to automaticaly use fseeko()/ftello() X * XXX if the latter are available. X * X * If HAVE_LARGEFILES is defined, it is guaranteed that fseeko()/ftello() X * both are available. X */ X# define fseek fseeko X# define ftell ftello X X#else /* !HAVE_LARGEFILES */ X/* X * If HAVE_LARGEFILES is not defined, we depend on specific tests for X * fseeko()/ftello() which must have been done before the tests for X * Large File support have been done. X * Note that this only works if the tests used below are really done before X * the Large File autoconf test is run. This is because autoconf does no X * clean testing but instead cumulatively modifes the envivonment used for X * testing. X */ X#ifdef HAVE_FSEEKO X# define fseek fseeko X#endif X#ifdef HAVE_FTELLO X# define ftell ftello X#endif X X#endif X X/* X * speed things up... X */ X#ifndef _OPENFD_SRC X#ifdef _openfd X#undef _openfd X#endif X#define _openfd(name, omode) (open(name, omode, (mode_t)0666)) X#endif X X#define DO_MYFLAG /* use local flags */ X X/* X * Flags used during fileopen(), ... by _fcons()/ _cvmod() X */ X#define FI_NONE 0x0000 /* no flags defined */ X X#define FI_READ 0x0001 /* open for reading */ X#define FI_WRITE 0x0002 /* open for writing */ X#define FI_BINARY 0x0004 /* open in binary mode */ X#define FI_APPEND 0x0008 /* append on each write */ X X#define FI_CREATE 0x0010 /* create if nessecary */ X#define FI_TRUNC 0x0020 /* truncate file on open */ X#define FI_UNBUF 0x0080 /* dont't buffer io */ X#define FI_CLOSE 0x1000 /* close file on error */ X X/* X * Additional Schily FILE * flags that are not present with the X * standard stdio implementation. X */ X#define _JS_IONORAISE 01 /* do no raisecond() on errors */ X#define _JS_IOUNBUF 02 /* do unbuffered i/o */ X X X#ifdef DO_MYFLAG X Xstruct _io_flags { X FILE *fl_io; /* file pointer */ X struct _io_flags /* pointer to next struct */ X *fl_next; /* if more file pointer to same fd */ X int fl_flags; /* my flags */ X}; X Xtypedef struct _io_flags _io_fl; X Xextern int _io_glflag; /* global default flag */ Xextern _io_fl *_io_myfl; /* array of structs to hold my flags */ Xextern int _fl_max; /* max fd currently in _io_myfl */ X X/* X * if fileno > max X * expand X * else if map[fileno].pointer == 0 X * return 0 X * else if map[fileno].pointer == p X * return map[fileno].flags X * else X * search list X */ X#define flp(p) (&_io_myfl[fileno(p)]) X X#ifdef MY_FLAG_IS_MACRO X#define my_flag(p) ((int)fileno(p) >= _fl_max ? \ X _io_get_my_flag(p) : \ X ((flp(p)->fl_io == 0 || flp(p)->fl_io == p) ? \ X flp(p)->fl_flags : \ X _io_get_my_flag(p))) X#else X#define my_flag(p) _io_get_my_flag(p) X#endif X X#define set_my_flag(p, v) _io_set_my_flag(p, v) X#define add_my_flag(p, v) _io_add_my_flag(p, v) X Xextern int _io_get_my_flag __PR((FILE *)); Xextern void _io_set_my_flag __PR((FILE *, int)); Xextern void _io_add_my_flag __PR((FILE *, int)); X X#else /* DO_MYFLAG */ X X#define my_flag(p) _JS_IONORAISE /* Always noraise */ X#define set_my_flag(p, v) /* Ignore */ X#define add_my_flag(p, v) /* Ignore */ X X#endif /* DO_MYFLAG */ X X#if defined(HAVE_USG_STDIO) || defined(FAST_GETC_PUTC) X/* X * We are on a system with AT&T compatible stdio implementation X */ X X/* X * Use the right filbuf()/flsbuf() function. X */ X#ifdef FAST_GETC_PUTC X X#define __js_fp (struct SCHILY__FILE_TAG *) X X#ifndef HAVE___FILBUF X#define HAVE___FILBUF X#endif X#endif X#ifdef HAVE___FILBUF X# define usg_filbuf(fp) __filbuf(fp) X# define usg_flsbuf(c, fp) __flsbuf(c, fp) X/* X * Define prototypes to verify if our interface is right X */ Xextern int __filbuf __PR((FILE *)); X#else /* !HAVE___FILBUF */ X# ifdef HAVE__FILBUF X# define usg_filbuf(fp) _filbuf(fp) X# define usg_flsbuf(c, fp) _flsbuf(c, fp) X/* X * Define prototypes to verify if our interface is right X */ Xextern int _filbuf __PR((FILE *)); X# else X/* X * no filbuf() but this will not happen on USG_STDIO systems. X */ X# endif X#endif /* !HAVE___FILBUF */ X/* X * Do not check this because flsbuf()'s 1st parameter may be X * int SunOS X * unsigned int Apollo X * unsigned char HP-UX-11 X * X * Note that the interface is now checked by autoconf. X */ X#else /* !HAVE_USG_STDIO */ X/* X * If we are on a non USG system we cannot down file pointers X * and we do not know about the internals of the FILE structure. X */ X#undef DO_DOWN X#endif /* !HAVE_USG_STDIO */ X X#ifndef __js_fp X#define __js_fp X#endif X X#ifndef DO_DOWN X/* X * No stream checking X */ X#define down(f) X#define down1(f, fl1) X#define down2(f, fl1, fl2) X#else X/* X * Do stream checking (works only on USG stdio) X * X * New version of USG stdio. X * _iob[] holds only a small amount of pointers. X * Aditional space is allocated. X * We may check only if the file pointer is != NULL X * and if iop->_flag refers to a stream with appropriate modes. X * If _iob[] gets expanded by malloc() we cannot check upper bound. X */ X#define down(f) ((f) == 0 || (__js_fp f)->_flag == 0 ? \ X (raisecond(_badfile, 0L), (FILE *)0) : (f)) X X#define down1(f, fl1) ((f) == 0 || (__js_fp f)->_flag == 0 ? \ X (raisecond(_badfile, 0L), (FILE *)0) : \ X (((__js_fp f)->_flag & fl1) != fl1 ? \ X (raisecond(_badop, 0L), (FILE *)0) : \ X (f))) X X#define down2(f, fl1, fl2) ((f) == 0 || (__js_fp f)->_flag == 0 ? \ X (raisecond(_badfile, 0L), (FILE *)0) : \ X (((__js_fp f)->_flag & fl1) != fl1 && \ X ((__js_fp f)->_flag & fl2) != fl2 ? \ X (raisecond(_badop, 0L), (FILE *)0) : \ X (f))) X#endif /* DO_DOWN */ X Xextern char _badfile[]; Xextern char _badmode[]; Xextern char _badop[]; X X#endif /* _STDIO_SCHILYIO_H */ END-of-star-1.6/libschily/stdio/schilyio.h echo x - star-1.6/libschily/stdio/ffileread.c sed 's/^X//' >star-1.6/libschily/stdio/ffileread.c << 'END-of-star-1.6/libschily/stdio/ffileread.c' X/* @(#)ffileread.c 1.13 09/06/30 Copyright 1986, 1996-2009 J. Schilling */ X/* X * Copyright (c) 1986, 1996-2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include "schilyio.h" X XEXPORT ssize_t Xffileread(f, buf, len) X register FILE *f; X void *buf; X size_t len; X{ X register int fd; X register ssize_t ret; X int oerrno = geterrno(); X X down2(f, _IOREAD, _IORW); X fd = fileno(f); X X while ((ret = read(fd, buf, len)) < 0 && geterrno() == EINTR) { X /* X * Set back old 'errno' so we don't change the errno visible X * to the outside if we did not fail. X */ X seterrno(oerrno); X } X return (ret); X} END-of-star-1.6/libschily/stdio/ffileread.c echo x - star-1.6/libschily/stdio/ffilewrite.c sed 's/^X//' >star-1.6/libschily/stdio/ffilewrite.c << 'END-of-star-1.6/libschily/stdio/ffilewrite.c' X/* @(#)ffilewrite.c 1.8 09/06/30 Copyright 1986-2009 J. Schilling */ X/* X * Copyright (c) 1986-2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include "schilyio.h" X XEXPORT ssize_t Xffilewrite(f, buf, len) X register FILE *f; X void *buf; X size_t len; X{ X register int fd; X register ssize_t ret; X int oerrno = geterrno(); X X down2(f, _IORWT, _IORW); X fd = fileno(f); X X while ((ret = write(fd, buf, len)) < 0 && geterrno() == EINTR) { X /* X * Set back old 'errno' so we don't change the errno visible X * to the outside if we did not fail. X */ X seterrno(oerrno); X } X return (ret); X} END-of-star-1.6/libschily/stdio/ffilewrite.c echo x - star-1.6/libschily/stdio/fdup.c sed 's/^X//' >star-1.6/libschily/stdio/fdup.c << 'END-of-star-1.6/libschily/stdio/fdup.c' X/* @(#)fdup.c 1.16 10/11/06 Copyright 1986, 1995-2010 J. Schilling */ X/* X * Copyright (c) 1986, 1995-2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include "schilyio.h" X X/* X * Note that because of a definition in schilyio.h we are using X * fseeko()/ftello() instead of fseek()/ftell() if available. X */ X XEXPORT FILE * Xfdup(f) X register FILE *f; X{ X int newfd; X X down(f); X if ((newfd = dup(fileno(f))) < 0) X return ((FILE *)NULL); X X lseek(newfd, ftell(f), SEEK_SET); X return (_fcons((FILE *)0, newfd, (FI_READ | FI_WRITE | FI_CLOSE))); X} END-of-star-1.6/libschily/stdio/fdup.c echo x - star-1.6/libschily/stdio/fdup64.c sed 's/^X//' >star-1.6/libschily/stdio/fdup64.c << 'END-of-star-1.6/libschily/stdio/fdup64.c' X/* @(#)fdup64.c 1.7 10/08/23 Copyright 2000 J. Schilling */ X/* X * Copyright (c) 2000 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#define USE_LARGEFILES X X#include "schilyio.h" X X#ifdef HAVE_LARGEFILES X X#include "fdup.c" X X#endif END-of-star-1.6/libschily/stdio/fdup64.c echo x - star-1.6/libschily/stdio/fgetstr.c sed 's/^X//' >star-1.6/libschily/stdio/fgetstr.c << 'END-of-star-1.6/libschily/stdio/fgetstr.c' X/* @(#)fgetstr.c 1.14 18/10/10 Copyright 1986, 1996-2018 J. Schilling */ X/* X * Copyright (c) 1986, 1996-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#define FAST_GETC_PUTC /* Will be reset if not possible */ X#include "schilyio.h" X X#if !defined(getc) && defined(USE_FGETS_FOR_FGETSTR) X#include X X/* X * Warning: this prevents us from being able to have embedded null chars. X */ XEXPORT int Xfgetstr(f, buf, len) X register FILE *f; X char *buf; X register int len; X{ X char *bp = fgets(buf, len, f); X X if (bp) { X return (strlen(bp)); X } X buf[0] = '\0'; X return (-1); X} X X#else X XEXPORT int Xfgetstr(f, buf, len) X register FILE *f; X char *buf; X register int len; X{ X register char *bp = buf; X#if defined(HAVE_USG_STDIO) || defined(FAST_GETC_PUTC) X register char *p; X#else X register int c = '\0'; X register int nl = '\n'; X#endif X X down2(f, _IOREAD, _IORW); X X if (len <= 0) X return (0); X X *bp = '\0'; X for (;;) { X#if defined(HAVE_USG_STDIO) || defined(FAST_GETC_PUTC) X size_t n; X X if ((__js_fp f)->_cnt <= 0) { X if (usg_filbuf(f) == EOF) { X /* X * If buffer is empty and we hit EOF, return EOF X */ X if (bp == buf) X return (EOF); X break; X } X (__js_fp f)->_cnt++; X (__js_fp f)->_ptr--; X } X X n = len; X if (n > (__js_fp f)->_cnt) X n = (__js_fp f)->_cnt; X p = movecbytes((__js_fp f)->_ptr, bp, '\n', n); X if (p) { X n = p - bp; X } X (__js_fp f)->_ptr += n; X (__js_fp f)->_cnt -= n; X bp += n; X len -= n; X if (p != NULL || len == 0) X break; X#else X if ((c = getc(f)) < 0) { X /* X * If buffer is empty and we hit EOF, return EOF X */ X if (bp == buf) X return (c); X break; X } X if (--len > 0) X *bp++ = (char)c; X else X break; X if (c == nl) X break; X#endif X } X *bp = '\0'; X X return (bp - buf); X} X X#endif X XEXPORT int Xgetstr(buf, len) X char *buf; X int len; X{ X return (fgetstr(stdin, buf, len)); X} END-of-star-1.6/libschily/stdio/fgetstr.c echo x - star-1.6/libschily/stdio/fileclose.c sed 's/^X//' >star-1.6/libschily/stdio/fileclose.c << 'END-of-star-1.6/libschily/stdio/fileclose.c' X/* @(#)fileclose.c 1.7 04/08/08 Copyright 1986 J. Schilling */ X/* X * Copyright (c) 1988 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include "schilyio.h" X XEXPORT int Xfileclose(f) X FILE *f; X{ X down(f); X return (fclose(f)); X} END-of-star-1.6/libschily/stdio/fileclose.c echo x - star-1.6/libschily/stdio/fileluopen.c sed 's/^X//' >star-1.6/libschily/stdio/fileluopen.c << 'END-of-star-1.6/libschily/stdio/fileluopen.c' X/* @(#)fileluopen.c 1.19 10/11/06 Copyright 1986, 1995-2010 J. Schilling */ X/* X * Copyright (c) 1986, 1995-2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include "schilyio.h" X X/* X * Note that because of a definition in schilyio.h we are using X * fseeko()/ftello() instead of fseek()/ftell() if available. X */ X X#ifndef O_NDELAY /* This is undefined on BeOS :-( */ X#define O_NDELAY 0 X#endif X#ifndef O_CREAT X#define O_CREAT 0 X#endif X#ifndef O_TRUNC X#define O_TRUNC 0 X#endif X#ifndef O_EXCL X#define O_EXCL 0 X#endif X X/* X * fileluopen - open a stream for lun X */ XEXPORT FILE * Xfileluopen(f, mode) X int f; X const char *mode; X{ X int omode = 0; X int flag = 0; X X if (!_cvmod(mode, &omode, &flag)) X return ((FILE *)NULL); X X if (omode & (O_NDELAY|O_CREAT|O_TRUNC|O_EXCL)) { X raisecond(_badmode, 0L); X return ((FILE *)NULL); X } X X#ifdef F_GETFD X if (fcntl(f, F_GETFD, 0) < 0) { X raisecond(_badfile, 0L); X return ((FILE *)NULL); X } X#endif X X#ifdef O_APPEND X if (omode & O_APPEND) X lseek(f, (off_t)0, SEEK_END); X#endif X X return (_fcons((FILE *)0, f, flag)); X} END-of-star-1.6/libschily/stdio/fileluopen.c echo x - star-1.6/libschily/stdio/fileluopen64.c sed 's/^X//' >star-1.6/libschily/stdio/fileluopen64.c << 'END-of-star-1.6/libschily/stdio/fileluopen64.c' X/* @(#)fileluopen64.c 1.7 10/08/23 Copyright 2000 J. Schilling */ X/* X * Copyright (c) 2000 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#define USE_LARGEFILES X X#include "schilyio.h" X X#ifdef HAVE_LARGEFILES X X#include "fileluopen.c" X X#endif END-of-star-1.6/libschily/stdio/fileluopen64.c echo x - star-1.6/libschily/stdio/filepos.c sed 's/^X//' >star-1.6/libschily/stdio/filepos.c << 'END-of-star-1.6/libschily/stdio/filepos.c' X/* @(#)filepos.c 1.11 10/11/06 Copyright 1986, 1996-2010 J. Schilling */ X/* X * Copyright (c) 1986, 1996-2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include "schilyio.h" X X/* X * Note that because of a definition in schilyio.h we are using X * fseeko()/ftello() instead of fseek()/ftell() if available. X */ X XEXPORT off_t Xfilepos(f) X register FILE *f; X{ X down(f); X return (ftell(f)); X} END-of-star-1.6/libschily/stdio/filepos.c echo x - star-1.6/libschily/stdio/filepos64.c sed 's/^X//' >star-1.6/libschily/stdio/filepos64.c << 'END-of-star-1.6/libschily/stdio/filepos64.c' X/* @(#)filepos64.c 1.7 10/08/23 Copyright 2000 J. Schilling */ X/* X * Copyright (c) 2000 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#define USE_LARGEFILES X X#include "schilyio.h" X X#ifdef HAVE_LARGEFILES X X#include "filepos.c" X X#endif END-of-star-1.6/libschily/stdio/filepos64.c echo x - star-1.6/libschily/stdio/filereopen.c sed 's/^X//' >star-1.6/libschily/stdio/filereopen.c << 'END-of-star-1.6/libschily/stdio/filereopen.c' X/* @(#)filereopen.c 1.18 10/11/06 Copyright 1986, 1995-2010 J. Schilling */ X/* X * open new file on old stream X * X * Copyright (c) 1986, 1995-2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include "schilyio.h" X X/* X * Note that because of a definition in schilyio.h we are using X * fseeko()/ftello() instead of fseek()/ftell() if available. X */ X XLOCAL char *fmtab[] = { X "", /* 0 FI_NONE */ X "r", /* 1 FI_READ */ X "r+", /* 2 FI_WRITE **1) */ X "r+", /* 3 FI_READ | FI_WRITE */ X "b", /* 4 FI_NONE | FI_BINARY */ X "rb", /* 5 FI_READ | FI_BINARY */ X "r+b", /* 6 FI_WRITE | FI_BINARY **1) */ X "r+b", /* 7 FI_READ | FI_WRITE | FI_BINARY */ X X/* + FI_APPEND */ "", /* 0 FI_NONE */ X/* ... */ "r", /* 1 FI_READ */ X "a", /* 2 FI_WRITE **1) */ X "a+", /* 3 FI_READ | FI_WRITE */ X "b", /* 4 FI_NONE | FI_BINARY */ X "rb", /* 5 FI_READ | FI_BINARY */ X "ab", /* 6 FI_WRITE | FI_BINARY **1) */ X "a+b", /* 7 FI_READ | FI_WRITE | FI_BINARY */ X }; X/* X * NOTES: X * 1) there is no fopen() mode that opens for writing X * without creating/truncating at the same time. X * X * "w" will create/trunc files with fopen() X * "a" will create files with fopen() X */ X XEXPORT FILE * Xfilereopen(name, mode, fp) X const char *name; X const char *mode; X FILE *fp; X{ X int ret = -1; X int omode = 0; X int flag = 0; X X if (!_cvmod(mode, &omode, &flag)) X return ((FILE *)NULL); X X /* X * create/truncate file if necessary X */ X if ((flag & (FI_CREATE | FI_TRUNC)) != 0) { X if ((ret = _openfd(name, omode)) < 0) X return ((FILE *)NULL); X close(ret); X } X X fp = freopen(name, X fmtab[flag & (FI_READ | FI_WRITE | FI_BINARY | FI_APPEND)], fp); X X if (fp != (FILE *)NULL) { X set_my_flag(fp, 0); /* must clear it if fp is reused */ X X if (flag & FI_APPEND) { X (void) fseek(fp, (off_t)0, SEEK_END); X } X if (flag & FI_UNBUF) { X setbuf(fp, NULL); X add_my_flag(fp, _JS_IOUNBUF); X } X } X return (fp); X} END-of-star-1.6/libschily/stdio/filereopen.c echo x - star-1.6/libschily/stdio/filereopen64.c sed 's/^X//' >star-1.6/libschily/stdio/filereopen64.c << 'END-of-star-1.6/libschily/stdio/filereopen64.c' X/* @(#)filereopen64.c 1.7 04/08/08 Copyright 2000-2003 J. Schilling */ X/* X * Copyright (c) 2000-2003 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#define USE_LARGEFILES X X#include "schilyio.h" X X#ifdef HAVE_LARGEFILES X X#include "filereopen.c" X X#endif END-of-star-1.6/libschily/stdio/filereopen64.c echo x - star-1.6/libschily/stdio/filestat.c sed 's/^X//' >star-1.6/libschily/stdio/filestat.c << 'END-of-star-1.6/libschily/stdio/filestat.c' X/* @(#)filestat.c 1.10 06/09/13 Copyright 1985 J. Schilling */ X/* X * Copyright (c) 1985 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include "schilyio.h" X#include X XEXPORT int Xfilestat(f, stbuf) X FILE *f; X struct stat *stbuf; X{ X down(f); X return (fstat(fileno(f), stbuf)); X} END-of-star-1.6/libschily/stdio/filestat.c echo x - star-1.6/libschily/stdio/filestat64.c sed 's/^X//' >star-1.6/libschily/stdio/filestat64.c << 'END-of-star-1.6/libschily/stdio/filestat64.c' X/* @(#)filestat64.c 1.7 10/08/23 Copyright 2000 J. Schilling */ X/* X * Copyright (c) 2000 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#define USE_LARGEFILES X X#include "schilyio.h" X X#ifdef HAVE_LARGEFILES X X#include "filestat.c" X X#endif END-of-star-1.6/libschily/stdio/filestat64.c echo x - star-1.6/libschily/stdio/peekc.c sed 's/^X//' >star-1.6/libschily/stdio/peekc.c << 'END-of-star-1.6/libschily/stdio/peekc.c' X/* @(#)peekc.c 1.7 04/08/08 Copyright 1986, 1996-2003 J. Schilling */ X/* X * Copyright (c) 1986, 1996-2003 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include "schilyio.h" X XEXPORT int Xpeekc(f) X FILE *f; X{ X int c; X X down2(f, _IOREAD, _IORW); X X if (ferror(f)) X return (EOF); X if ((c = getc(f)) != EOF) X ungetc(c, f); X return (c); X} END-of-star-1.6/libschily/stdio/peekc.c echo x - star-1.6/libschily/stdio/filemopen.c sed 's/^X//' >star-1.6/libschily/stdio/filemopen.c << 'END-of-star-1.6/libschily/stdio/filemopen.c' X/* @(#)filemopen.c 1.5 10/08/21 Copyright 1986, 1995-2010 J. Schilling */ X/* X * Copyright (c) 1986, 1995-2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include "schilyio.h" X XEXPORT FILE * X#ifdef PROTOTYPES Xfilemopen(const char *name, const char *mode, mode_t cmode) X#else Xfilemopen(name, mode, cmode) X const char *name; X const char *mode; X mode_t cmode; X#endif X{ X int ret; X int omode = 0; X int flag = 0; X X if (!_cvmod(mode, &omode, &flag)) X return ((FILE *)NULL); X X if ((ret = open(name, omode, cmode)) < 0) X return ((FILE *)NULL); X X return (_fcons((FILE *)0, ret, flag | FI_CLOSE)); X} END-of-star-1.6/libschily/stdio/filemopen.c echo x - star-1.6/libschily/stdio/filemopen64.c sed 's/^X//' >star-1.6/libschily/stdio/filemopen64.c << 'END-of-star-1.6/libschily/stdio/filemopen64.c' X/* @(#)filemopen64.c 1.3 10/08/23 Copyright 2000-2004 J. Schilling */ X/* X * Copyright (c) 2000-2004 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#define USE_LARGEFILES X X#include "schilyio.h" X X#ifdef HAVE_LARGEFILES X X#include "filemopen.c" X X#endif END-of-star-1.6/libschily/stdio/filemopen64.c echo x - star-1.6/libschily/stdio/file_getraise.c sed 's/^X//' >star-1.6/libschily/stdio/file_getraise.c << 'END-of-star-1.6/libschily/stdio/file_getraise.c' X/* @(#)file_getraise.c 1.1 07/04/03 Copyright 2007 J. Schilling */ X/* X * Copyright (c) 2007 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include "schilyio.h" X XEXPORT int Xfile_getraise(f) X register FILE *f; X{ X int oflag; Xextern int _io_glflag; X X if (f == (FILE *)NULL) X return ((_io_glflag & _JS_IONORAISE) != 0); X X down(f); X X oflag = my_flag(f); X return ((oflag & _JS_IONORAISE) != 0); X} END-of-star-1.6/libschily/stdio/file_getraise.c echo x - star-1.6/libschily/stdio/fgetaline.c sed 's/^X//' >star-1.6/libschily/stdio/fgetaline.c << 'END-of-star-1.6/libschily/stdio/fgetaline.c' X/* @(#)fgetaline.c 1.5 15/05/09 Copyright 2011-2015 J. Schilling */ X/* X * Copyright (c) 2011-2015 J. Schilling X * X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include "schilyio.h" X#include X#include X XEXPORT ssize_t fgetaline __PR((FILE *, char **, size_t *)); XEXPORT ssize_t getaline __PR((char **, size_t *)); X X#define DEF_LINE_SIZE 128 X XEXPORT ssize_t Xfgetaline(f, bufp, lenp) X register FILE *f; X char **bufp; X register size_t *lenp; X{ X#if defined(HAVE_GETDELIM) || !defined(USE_FGETS_FOR_FGETALINE) X return (getdelim(bufp, lenp, '\n', f)); X#else X /* X * WARNING: fgets() cannot signal that the read line-buffer X * WARNING: has embedded nul bytes. We cannot distinguish X * WARNING: read nul bytes from the inserted nul past '\n' X * WARNING: without knowing file positions before and after. X */ X int eof; X register size_t used = 0; X register size_t line_size; X register char *line; X X if (bufp == NULL || lenp == NULL) { X seterrno(EINVAL); X return (-1); X } X X line_size = *lenp; X line = *bufp; X if (line == NULL || line_size == 0) { X if (line_size == 0) X line_size = DEF_LINE_SIZE; X if (line == NULL) X line = (char *) malloc(line_size); X if (line == NULL) X return (-1); X } X /* read until EOF or newline encountered */ X line[0] = '\0'; X do { X line[line_size - 1] = '\t'; /* arbitrary non-zero char */ X line[line_size - 2] = ' '; /* arbitrary non-newline char */ X if (!(eof = (fgets(line+used, X line_size-used, X f) == NULL))) { X X if (line[line_size - 1] != '\0' || X line[line_size - 2] == '\n') X break; X X used = line_size - 1; X X line_size += DEF_LINE_SIZE; X line = (char *) realloc(line, line_size); X if (line == NULL) X return (-1); X } X } while (!eof); X used += strlen(&line[used]); X *bufp = line; X *lenp = line_size; X if (eof && (used == 0)) X return (-1); X return (used); X#endif X} X XEXPORT ssize_t Xgetaline(bufp, lenp) X char **bufp; X size_t *lenp; X{ X return (fgetaline(stdin, bufp, lenp)); X} END-of-star-1.6/libschily/stdio/fgetaline.c echo x - star-1.6/libschily/stdio/getdelim.c sed 's/^X//' >star-1.6/libschily/stdio/getdelim.c << 'END-of-star-1.6/libschily/stdio/getdelim.c' X/* @(#)getdelim.c 1.4 18/10/10 Copyright 2015-2018 J. Schilling */ X/* X * Copyright (c) 2015-2018 J. Schilling X * X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#define FAST_GETC_PUTC X#include "schilyio.h" X#include X X#ifndef HAVE_GETDELIM XEXPORT ssize_t getdelim __PR((char **, size_t *, int, FILE *)); X X#define DEF_LINE_SIZE 128 X XEXPORT ssize_t Xgetdelim(bufp, lenp, delim, f) X char **bufp; X size_t *lenp; X register int delim; X register FILE *f; X{ X register char *lp; X register char *ep; X register size_t line_size; X register char *line; X#if defined(HAVE_USG_STDIO) || defined(FAST_GETC_PUTC) X char *p; X#else X register int c; X#endif X X if (bufp == NULL || lenp == NULL || X delim < 0 || delim > UINT8_MAX) { X seterrno(EINVAL); X return (-1); X } X X line_size = *lenp; X line = *bufp; X if (line == NULL || line_size == 0) { X if (line_size == 0) X line_size = DEF_LINE_SIZE; X if (line == NULL) X line = (char *) malloc(line_size); X if (line == NULL) X return (-1); X *bufp = line; X *lenp = line_size; X } X /* read until EOF or delim encountered */ X lp = line; X ep = &line[line_size - 1]; X do { X#if defined(HAVE_USG_STDIO) || defined(FAST_GETC_PUTC) X size_t n; X X if ((__js_fp f)->_cnt <= 0) { X if (usg_filbuf(f) == EOF) X break; X (__js_fp f)->_cnt++; X (__js_fp f)->_ptr--; X } X X n = ep - lp; X if (n > (__js_fp f)->_cnt) X n = (__js_fp f)->_cnt; X p = movecbytes((__js_fp f)->_ptr, lp, delim, n); X if (p) { X n = p - lp; X } X (__js_fp f)->_ptr += n; X (__js_fp f)->_cnt -= n; X lp += n; X#else X c = getc(f); X if (c == EOF) X break; X *lp++ = c; X#endif X if (lp >= ep) { X ep = line; X line_size += DEF_LINE_SIZE; X line = (char *) realloc(line, line_size); X if (line == NULL) { X *lp = '\0'; X return (-1); X } X lp = line + (lp - ep); X ep = &line[line_size - 1]; X *bufp = line; X *lenp = line_size; X } X#if defined(HAVE_USG_STDIO) || defined(FAST_GETC_PUTC) X } while (p == NULL); X#else X } while (c != delim); X#endif X *lp = '\0'; X line_size = lp - line; X if (line_size > SSIZE_T_MAX) { X#ifdef EOVERFLOW X seterrno(EOVERFLOW); X#else X seterrno(EINVAL); X#endif X return (-1); X } X return (line_size ? line_size : -1); X} X#endif /* HAVE_GETDELIM */ END-of-star-1.6/libschily/stdio/getdelim.c echo x - star-1.6/libschily/getdomainname.c sed 's/^X//' >star-1.6/libschily/getdomainname.c << 'END-of-star-1.6/libschily/getdomainname.c' X/* @(#)getdomainname.c 1.23 10/08/23 Copyright 1995-2010 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)getdomainname.c 1.23 10/08/23 Copyright 1995-2010 J. Schilling"; X#endif X/* X * Copyright (c) 1995-2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X X#ifndef HAVE_GETDOMAINNAME XEXPORT int getdomainname __PR((char *name, int namelen)); X#endif X X X#if !defined(HAVE_GETDOMAINNAME) && defined(SI_SRPC_DOMAIN) X#define FUNC_GETDOMAINNAME X XEXPORT int Xgetdomainname(name, namelen) X char *name; X int namelen; X{ X if (sysinfo(SI_SRPC_DOMAIN, name, namelen) < 0) X return (-1); X return (0); X} X#endif X X#if !defined(HAVE_GETDOMAINNAME) && !defined(FUNC_GETDOMAINNAME) X#define FUNC_GETDOMAINNAME X X#include X#include X#include X XEXPORT int Xgetdomainname(name, namelen) X char *name; X int namelen; X{ X FILE *f; X char name1[1024]; X char *p; X char *p2; X X name[0] = '\0'; X X f = fileopen("/etc/resolv.conf", "r"); X X if (f == NULL) X return (-1); X X while (fgetline(f, name1, sizeof (name1)) >= 0) { X if ((p = strchr(name1, '#')) != NULL) X *p = '\0'; X X /* X * Skip leading whitespace. X */ X p = name1; X while (*p != '\0' && (*p == ' ' || *p == '\t')) X p++; X X if (strncmp(p, "domain", 6) == 0) { X p += 6; X while (*p != '\0' && (*p == ' ' || *p == '\t')) X p++; X if ((p2 = strchr(p, ' ')) != NULL) X *p2 = '\0'; X if ((p2 = strchr(p, '\t')) != NULL) X *p2 = '\0'; X X strncpy(name, p, namelen); X X fclose(f); X return (0); X } X } X fclose(f); X return (0); X} X#endif END-of-star-1.6/libschily/getdomainname.c echo x - star-1.6/libschily/astoi.c sed 's/^X//' >star-1.6/libschily/astoi.c << 'END-of-star-1.6/libschily/astoi.c' X/* @(#)astoi.c 1.11 15/12/10 Copyright 1985, 1995-2015 J. Schilling */ X/* X * astoi() converts a string to int X * astol() converts a string to long X * X * Leading tabs and spaces are ignored. X * Both return pointer to the first char that has not been used. X * Caller must check if this means a bad conversion. X * X * leading "+" is ignored X * leading "0" makes conversion octal (base 8) X * leading "0x" makes conversion hex (base 16) X * X * Copyright (c) 1985, 1995-2015 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X X#define is_space(c) ((c) == ' ' || (c) == '\t') X#define is_digit(c) ((c) >= '0' && (c) <= '9') X#define is_hex(c) (\ X ((c) >= 'a' && (c) <= 'f') || \ X ((c) >= 'A' && (c) <= 'F')) X X#define is_lower(c) ((c) >= 'a' && (c) <= 'z') X#define is_upper(c) ((c) >= 'A' && (c) <= 'Z') X#define to_lower(c) (((c) >= 'A' && (c) <= 'Z') ? (c) - 'A'+'a' : (c)) X X#if ('i' + 1) < 'j' X#define BASE_MAX ('i' - 'a' + 10 + 1) /* This is EBCDIC */ X#else X#define BASE_MAX ('z' - 'a' + 10 + 1) /* This is ASCII */ X#endif X X#ifdef notdef XEXPORT int Xatoi(s) X char *s; X{ X long l; X X (void) astol(s, &l); X return ((int)l); X} X XEXPORT long Xatol(s) X char *s; X{ X long l; X X (void) astol(s, &l); X return (l); X} X#endif X XEXPORT char * Xastoi(s, i) X const char *s; X int *i; X{ X long l; X char *ret; X X ret = astol(s, &l); X *i = l; X#if SIZEOF_INT != SIZEOF_LONG_INT X if (*i != l) { X if (l < 0) { X *i = TYPE_MINVAL(int); X } else { X *i = TYPE_MAXVAL(int); X } X seterrno(ERANGE); X } X#endif X return (ret); X} X XEXPORT char * Xastol(s, l) X register const char *s; X long *l; X{ X return (astolb(s, l, 0)); X} X XEXPORT char * Xastolb(s, l, base) X register const char *s; X long *l; X register int base; X{ X int neg = 0; X register unsigned long ret = 0L; X unsigned long maxmult; X unsigned long maxval; X register int digit; X register char c; X X if (base > BASE_MAX || base == 1 || base < 0) { X seterrno(EINVAL); X return ((char *)s); X } X X while (is_space(*s)) X s++; X X if (*s == '+') { X s++; X } else if (*s == '-') { X s++; X neg++; X } X X if (base == 0) { X if (*s == '0') { X base = 8; X s++; X if (*s == 'x' || *s == 'X') { X s++; X base = 16; X } X } else { X base = 10; X } X } X if (neg) { X /* X * Portable way to compute the positive value of "min-long" X * as -TYPE_MINVAL(long) does not work. X */ X maxval = ((unsigned long)(-1 * (TYPE_MINVAL(long)+1))) + 1; X } else { X maxval = TYPE_MAXVAL(long); X } X maxmult = maxval / base; X for (; (c = *s) != 0; s++) { X X if (is_digit(c)) { X digit = c - '0'; X } else if (is_lower(c)) { X digit = c - 'a' + 10; X } else if (is_upper(c)) { X digit = c - 'A' + 10; X } else { X break; X } X X if (digit < base) { X if (ret > maxmult) X goto overflow; X ret *= base; X if (maxval - ret < digit) X goto overflow; X ret += digit; X } else { X break; X } X } X if (neg) { X *l = (Llong)-1 * ret; X } else { X *l = (Llong)ret; X } X return ((char *)s); Xoverflow: X for (; (c = *s) != 0; s++) { X X if (is_digit(c)) { X digit = c - '0'; X } else if (is_lower(c)) { X digit = c - 'a' + 10; X } else if (is_upper(c)) { X digit = c - 'A' + 10; X } else { X break; X } X if (digit >= base) X break; X } X if (neg) { X *l = TYPE_MINVAL(long); X } else { X *l = TYPE_MAXVAL(long); X } X seterrno(ERANGE); X return ((char *)s); X} END-of-star-1.6/libschily/astoi.c echo x - star-1.6/libschily/comerr.c sed 's/^X//' >star-1.6/libschily/comerr.c << 'END-of-star-1.6/libschily/comerr.c' X/* @(#)comerr.c 1.46 17/11/03 Copyright 1985-1989, 1995-2017 J. Schilling */ X/* X * Routines for printing command errors X * X * Copyright (c) 1985-1989, 1995-2017 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include /* include try to get size_t */ X#include /* Try again for size_t */ X#include /* Try again for size_t */ X#include X#include X#include X#include X#include X XEXPORT int on_comerr __PR((void (*fun)(int, void *), void *arg)); XEXPORT void comerr __PR((const char *, ...)); XEXPORT void xcomerr __PR((int, const char *, ...)); XEXPORT void comerrno __PR((int, const char *, ...)); XEXPORT void xcomerrno __PR((int, int, const char *, ...)); XEXPORT int errmsg __PR((const char *, ...)); XEXPORT int errmsgno __PR((int, const char *, ...)); XEXPORT int _comerr __PR((FILE *, int, int, int, X const char *, va_list)); XLOCAL int _ex_clash __PR((int)); XEXPORT void comexit __PR((int)); XEXPORT char *errmsgstr __PR((int)); X Xtypedef struct ex { X struct ex *next; X void (*func) __PR((int, void *)); X void *arg; X} ex_t; X XLOCAL ex_t *exfuncs; X X/* X * Set list of callback functions to call with *comerr() and comexit(). X * The function set up last with on_comerr() is called first on exit; X * in other words: call order is the reverse order of registration. X */ XEXPORT int Xon_comerr(func, arg) X void (*func) __PR((int, void *)); X void *arg; X{ X ex_t *fp; X X fp = malloc(sizeof (*fp)); X if (fp == NULL) X return (-1); X X fp->func = func; X fp->arg = arg; X fp->next = exfuncs; X exfuncs = fp; X return (0); X} X X/* X * Fetch current errno, print a related message and exit(errno). X */ X/* VARARGS1 */ X#ifdef PROTOTYPES XEXPORT void Xcomerr(const char *msg, ...) X#else XEXPORT void Xcomerr(msg, va_alist) X char *msg; X va_dcl X#endif X{ X va_list args; X X#ifdef PROTOTYPES X va_start(args, msg); X#else X va_start(args); X#endif X (void) _comerr(stderr, COMERR_EXIT, 0, geterrno(), msg, args); X /* NOTREACHED */ X va_end(args); X} X X/* X * Fetch current errno, print a related message and exit(exc). X */ X/* VARARGS2 */ X#ifdef PROTOTYPES XEXPORT void Xxcomerr(int exc, const char *msg, ...) X#else XEXPORT void Xxcomerr(exc, msg, va_alist) X int exc; X char *msg; X va_dcl X#endif X{ X va_list args; X X#ifdef PROTOTYPES X va_start(args, msg); X#else X va_start(args); X#endif X (void) _comerr(stderr, COMERR_EXCODE, exc, geterrno(), msg, args); X /* NOTREACHED */ X va_end(args); X} X X/* X * Print a message related to err and exit(err). X */ X/* VARARGS2 */ X#ifdef PROTOTYPES XEXPORT void Xcomerrno(int err, const char *msg, ...) X#else XEXPORT void Xcomerrno(err, msg, va_alist) X int err; X char *msg; X va_dcl X#endif X{ X va_list args; X X#ifdef PROTOTYPES X va_start(args, msg); X#else X va_start(args); X#endif X (void) _comerr(stderr, COMERR_EXIT, 0, err, msg, args); X /* NOTREACHED */ X va_end(args); X} X X/* X * Print a message related to err and exit(exc). X */ X/* VARARGS3 */ X#ifdef PROTOTYPES XEXPORT void Xxcomerrno(int exc, int err, const char *msg, ...) X#else XEXPORT void Xxcomerrno(exc, err, msg, va_alist) X int exc; X int err; X char *msg; X va_dcl X#endif X{ X va_list args; X X#ifdef PROTOTYPES X va_start(args, msg); X#else X va_start(args); X#endif X (void) _comerr(stderr, COMERR_EXCODE, exc, err, msg, args); X /* NOTREACHED */ X va_end(args); X} X X/* X * Fetch current errno, print a related message and return(errno). X */ X/* VARARGS1 */ X#ifdef PROTOTYPES XEXPORT int Xerrmsg(const char *msg, ...) X#else XEXPORT int Xerrmsg(msg, va_alist) X char *msg; X va_dcl X#endif X{ X va_list args; X int ret; X X#ifdef PROTOTYPES X va_start(args, msg); X#else X va_start(args); X#endif X ret = _comerr(stderr, COMERR_RETURN, 0, geterrno(), msg, args); X va_end(args); X return (ret); X} X X/* X * Print a message related to err and return(err). X */ X/* VARARGS2 */ X#ifdef PROTOTYPES XEXPORT int Xerrmsgno(int err, const char *msg, ...) X#else XEXPORT int Xerrmsgno(err, msg, va_alist) X int err; X char *msg; X va_dcl X#endif X{ X va_list args; X int ret; X X#ifdef PROTOTYPES X va_start(args, msg); X#else X va_start(args); X#endif X ret = _comerr(stderr, COMERR_RETURN, 0, err, msg, args); X va_end(args); X return (ret); X} X X#if defined(__BEOS__) || defined(__HAIKU__) X /* X * On BeOS errno is a big negative number (0x80000000 + small number). X * We assume that small negative numbers are safe to be used as special X * values that prevent printing the errno text. X * X * We tried to use #if EIO < 0 but this does not work because EIO is X * defined to a enum. ENODEV may work as ENODEV is defined to a number X * directly. X */ X#define silent_error(e) ((e) < 0 && (e) >= -1024) X#else X /* X * On UNIX errno is a small non-negative number, so we assume that X * negative values cannot be a valid errno and don't print the error X * string in this case. However the value may still be used as exit() X * code if 'exflg' is set. X */ X#define silent_error(e) ((e) < 0) X#endif XEXPORT int X_comerr(f, exflg, exc, err, msg, args) X FILE *f; /* FILE * to print to */ X int exflg; /* COMERR_RETURN, COMERR_EXIT, COMERR_EXCODE */ X int exc; /* Use for exit() if exflg & COMERR_EXCODE */ X int err; /* Errno for text, exit(err) if !COMERR_EXIT */ X const char *msg; /* printf() format */ X va_list args; /* printf() args for format */ X{ X char errbuf[20]; X char *errnam; X char *prognam = get_progname(); X X if (silent_error(err)) { X js_fprintf(f, "%s: %r", prognam, msg, args); X } else { X errnam = errmsgstr(err); X if (errnam == NULL) { X (void) js_snprintf(errbuf, sizeof (errbuf), X "Error %d", err); X errnam = errbuf; X } X js_fprintf(f, "%s: %s. %r", prognam, errnam, msg, args); X } X if (exflg) { X if (exflg & COMERR_EXCODE) X err = exc; X else X err = _ex_clash(err); X comexit(err); X /* NOTREACHED */ X } X return (err); X} X XLOCAL int X_ex_clash(exc) X int exc; X{ X int exmod = exc % 256; X X /* X * On a recent POSIX System that supports waitid(), siginfo.si_status X * holds the exit(2) value as an int. So if waitid() is used to wait X * for the process, we do not have problems from folded exit codes. X * All other wait*() functions fold the exit code by masking it X * with 0377. X * X * Exit codes used with comerr*()/comexit() are frequently errno values X * that have been in the range 0..31 with UNIX.V5 in the mid 1970s and X * that now are in the range 0..151 on Solaris. These values do not X * cause problems from folding to 8 bits, but "sysexits.h" contains X * definitions in the range 64..79 that cause (even unfolded) clashes X * with errno values. X * X * To avoid clashes with errno values, "schily/standard.h" defines X * EX_BAD (-1) as default error exit code and X * EX_CLASH (-64) as marker for clashes. X * Exit codes in the range -2..-63 (254..193 seen as unsigned two's X * complement) are available as software specific exit codes. X * We map all other negative exit codes to EX_CLASH if they would fold X * to -2..-63. X * X * Do not map exit codes in case that the "COMERR_EXCODE" environment X * is present. X */ X if (getenv("COMERR_EXCODE")) X return (exc); X if (exc != exmod && exmod <= 0 && exmod >= EX_CLASH) X exc = EX_CLASH; X return (exc); X} X X/* X * Do a program exit() with previously calling functions registered via X * on_comerr(). X */ XEXPORT void Xcomexit(err) X int err; X{ X while (exfuncs) { X ex_t *fp; X X (*exfuncs->func)(err, exfuncs->arg); X fp = exfuncs; X exfuncs = exfuncs->next; X free(fp); X } X exit(err); X /* NOTREACHED */ X} X X/* X * Wrapper around the strange POSIX strerror(). X * If there is a problem with retrieving the correct error text, X * return NULL. X */ XEXPORT char * Xerrmsgstr(err) X int err; X{ X#ifdef HAVE_STRERROR X /* X * POSIX compliance may look strange... X */ X int errsav = geterrno(); X char *ret; X X seterrno(0); X ret = strerror(err); X err = geterrno(); X seterrno(errsav); X X if (ret == NULL || err) X return (NULL); X return (ret); X#else X if (err < 0 || err >= sys_nerr) { X return (NULL); X } else { X return (sys_errlist[err]); X } X#endif X} END-of-star-1.6/libschily/comerr.c echo x - star-1.6/libschily/error.c sed 's/^X//' >star-1.6/libschily/error.c << 'END-of-star-1.6/libschily/error.c' X/* @(#)error.c 1.18 15/08/01 Copyright 1985, 1989, 1995-2015 J. Schilling */ X/* X * fprintf() on standard error stdio stream X * X * Copyright (c) 1985, 1989, 1995-2015 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X X#undef error X X#ifndef NO_WEAK_SYMBOLS X/* X * The Cygwin compile environment incorrectly implements #pragma weak. X * The weak symbols are only defined as local symbols making it impossible X * to use them from outside the scope of this source file. X * A platform that allows linking with global symbols has HAVE_LINK_WEAK X * defined. X */ X#if defined(HAVE_PRAGMA_WEAK) && defined(HAVE_LINK_WEAK) X#pragma weak error = js_error X#else X/* VARARGS1 */ X#ifdef PROTOTYPES XEXPORT int Xerror(const char *fmt, ...) X#else XEXPORT int Xerror(fmt, va_alist) X char *fmt; X va_dcl X#endif X{ X va_list args; X int ret; X X#ifdef PROTOTYPES X va_start(args, fmt); X#else X va_start(args); X#endif X ret = js_fprintf(stderr, "%r", fmt, args); X va_end(args); X return (ret); X} X#endif X#endif /* NO_WEAK_SYMBOLS */ X X/* VARARGS1 */ X#ifdef PROTOTYPES XEXPORT int Xjs_error(const char *fmt, ...) X#else XEXPORT int Xjs_error(fmt, va_alist) X char *fmt; X va_dcl X#endif X{ X va_list args; X int ret; X X#ifdef PROTOTYPES X va_start(args, fmt); X#else X va_start(args); X#endif X ret = js_fprintf(stderr, "%r", fmt, args); X va_end(args); X return (ret); X} END-of-star-1.6/libschily/error.c echo x - star-1.6/libschily/movebytes.c sed 's/^X//' >star-1.6/libschily/movebytes.c << 'END-of-star-1.6/libschily/movebytes.c' X/* @(#)movebytes.c 1.18 09/10/17 Copyright 1985, 1989, 1995-2009 J. Schilling */ X/* X * move data X * X * Copyright (c) 1985, 1989, 1995-2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X X#define DO8(a) a; a; a; a; a; a; a; a; X X/* X * movebytes(from, to, cnt) is the same as memmove(to, from, cnt) X */ XEXPORT char * Xmovebytes(fromv, tov, cnt) X const void *fromv; X void *tov; X ssize_t cnt; X{ X register const char *from = fromv; X register char *to = tov; X register ssize_t n; X X /* X * If we change cnt to be unsigned, check for == instead of <= X */ X if ((n = cnt) <= 0) X return (to); X X if (from >= to) { X /* X * source is on higher addresses than destination: X * move bytes forwards X */ X if (n >= (ssize_t)(8 * sizeof (long))) { X if (l2aligned(from, to)) { X register const long *froml = (const long *)from; X register long *tol = (long *)to; X register ssize_t rem = n % (8 * sizeof (long)); X X n /= (8 * sizeof (long)); X do { X DO8 (*tol++ = *froml++); X } while (--n > 0); X X from = (const char *)froml; X to = (char *)tol; X n = rem; X } X X if (n >= 8) { X n -= 8; X do { X DO8 (*to++ = *from++); X } while ((n -= 8) >= 0); X n += 8; X } X X if (n > 0) do { X *to++ = *from++; X } while (--n > 0); X return (to); X } X if (n > 0) do { X *to++ = *from++; X } while (--n > 0); X return (to); X } else { X char *ep; X X /* X * source is on lower addresses than destination: X * move bytes backwards X */ X to += n; X from += n; X ep = to; X if (n >= (ssize_t)(8 * sizeof (long))) { X if (l2aligned(from, to)) { X register const long *froml = (const long *)from; X register long *tol = (long *)to; X register ssize_t rem = n % (8 * sizeof (long)); X X n /= (8 * sizeof (long)); X do { X DO8 (*--tol = *--froml); X } while (--n > 0); X X from = (const char *)froml; X to = (char *)tol; X n = rem; X } X if (n >= 8) { X n -= 8; X do { X DO8 (*--to = *--from); X } while ((n -= 8) >= 0); X n += 8; X } X if (n > 0) do { X *--to = *--from; X } while (--n > 0); X return (ep); X } X if (n > 0) do { X *--to = *--from; X } while (--n > 0); X return (ep); X } X} END-of-star-1.6/libschily/movebytes.c echo x - star-1.6/libschily/format.c sed 's/^X//' >star-1.6/libschily/format.c << 'END-of-star-1.6/libschily/format.c' X/* @(#)format.c 1.73 18/11/21 Copyright 1985-2018 J. Schilling */ X/* X * format X * common code for printf fprintf & sprintf X * X * allows recursive printf with "%r", used in: X * error, comerr, comerrno, errmsg, errmsgno and the like X * X * Copyright (c) 1985-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#ifdef DEBUG X#include X#endif X#if !defined(HAVE_STDLIB_H) || !defined(HAVE_GCVT) Xextern char *gcvt __PR((double, int, char *)); X#endif X#include X#include X#include X#include X#include "format.h" X X/* X * As Llong is currently a 'best effort' long long, we usually need to X * include long long print formats. X * This may go away, if we implement maxint_t formats. X */ X#ifndef USE_LONGLONG X#define USE_LONGLONG X#endif X X#ifdef NO_LONGLONG X#undef USE_LONGLONG X#endif X X#ifndef USE_NL_ARGS X#define USE_NL_ARGS X#endif X X#ifdef NO_NL_ARGS X#undef USE_NL_ARGS X#endif X X/* X * Avoid to keep copies of the variable arg list in case that X * format() was compiled without including NL support for X * argument reordering. X */ X#ifdef USE_NL_ARGS X#define args fargs.ap /* Use working copy */ X#else X#define args oargs /* Directly use format() arg */ X#endif X X/* X * We may need to decide whether we should check whether all X * flags occur according to the standard which is either directly past: X * "%" or directly past "%n$". X * X * This however may make printf() slower in some cases. X */ X#ifdef USE_CHECKFLAG X#define CHECKFLAG() if (fa.flags & GOTSTAR) goto flagerror X#else X#define CHECKFLAG() X#endif X X#ifdef NO_USER_XCVT X /* X * We cannot define our own gcvt() so we need to use a X * local name instead. X */ X#ifndef HAVE_GCVT X# define gcvt js_gcvt XEXPORT char *gcvt __PR((double value, int ndigit, char *buf)); X#endif X#endif X X/* X * Some CPU's (e.g. PDP-11) cannot do logical shifts. X * They use rotate instead. Masking the low bits before, X * makes rotate work too. X */ X#define allmask(t) ((unsigned t)~((unsigned t)0)) X#define lowmask(t, x) ((unsigned t)~((unsigned t)((1 << (x))-1))) X#define rshiftmask(t, s)((allmask(t) & lowmask(t, s)) >> (s)) X X#define CHARMASK makemask(char) X#define SHORTMASK makemask(short) X#define INTMASK makemask(int) X#define LONGMASK makemask(long) X X#ifdef DIVLBYS Xextern long divlbys(); Xextern long modlbys(); X#else X#define divlbys(val, base) ((val)/(base)) X#define modlbys(val, base) ((val)%(base)) X#endif X X/* X * We use macros here to avoid the need to link to the international X * character routines. X * We don't need internationalization for our purpose. X */ X#define is_dig(c) (((c) >= '0') && ((c) <= '9')) X#define is_cap(c) ((c) >= 'A' && (c) <= 'Z') X#define to_cap(c) (is_cap(c) ? c : c - 'a' + 'A') X#define cap_ty(c) (is_cap(c) ? 'L' : 'I') X X#ifdef HAVE_LONGLONG Xtypedef union { X Ullong ll; X Ulong l[2]; X char c[8]; X} quad_u; X#endif X Xtypedef struct f_args { X#ifdef FORMAT_BUFFER X#define BFSIZ 256 X char *ptr; /* Current ptr in buf */ X int cnt; /* Free char count in buf */ X#else X void (*outf)__PR((char, void *)); /* Func from format(fun, arg) */ X#endif X void *farg; /* Arg from format (fun, arg) */ X int minusflag; /* Fieldwidth is negative */ X int flags; /* General flags (+-#) */ X int fldwidth; /* Field width as in %3d */ X int signific; /* Significant chars as in %.4d */ X int lzero; /* Left '0' pad flag */ X char *buf; /* Out print buffer */ X char *bufp; /* Write ptr into buffer */ X char fillc; /* Left fill char (' ' or '0') */ X char *prefix; /* Prefix to print before buf */ X int prefixlen; /* Len of prefix ('+','-','0x') */ X ssize_t maxlen; X#ifdef FORMAT_BUFFER X /* rarely used members last: */ X char iobuf[BFSIZ]; /* buffer for stdio */ X FILE *fp; /* FILE * for fprformat() */ X int err; /* FILE * I/O error */ X#endif X} f_args; X X#define FMT_ARGMAX 30 /* Number of fast args */ X XLOCAL void prnum __PR((Ulong, unsigned, f_args *)); XLOCAL void prdnum __PR((Ulong, f_args *)); XLOCAL void pronum __PR((Ulong, f_args *)); XLOCAL void prxnum __PR((Ulong, f_args *)); XLOCAL void prXnum __PR((Ulong, f_args *)); X#ifdef USE_LONGLONG XLOCAL void prlnum __PR((Ullong, unsigned, f_args *)); XLOCAL void prldnum __PR((Ullong, f_args *)); XLOCAL void prlonum __PR((Ullong, f_args *)); XLOCAL void prlxnum __PR((Ullong, f_args *)); XLOCAL void prlXnum __PR((Ullong, f_args *)); X#endif XLOCAL int prbuf __PR((const char *, f_args *)); XLOCAL int prc __PR((char, f_args *)); XLOCAL int prstring __PR((const char *, f_args *)); X#ifdef DEBUG XLOCAL void dbg_print __PR((char *fmt, int a, int b, int c, int d, int e, int f, int g, int h, int i)); X#endif X X#ifdef USE_NL_ARGS X#ifndef FORMAT_FUNC_NAME X#define FORMAT_IMPL XEXPORT void _fmtarglist __PR((const char *fmt, va_lists_t, va_lists_t arglist[])); XEXPORT void _fmtgetarg __PR((const char *fmt, int num, va_lists_t *)); X#else Xextern void _fmtarglist __PR((const char *fmt, va_lists_t, va_lists_t arglist[])); Xextern void _fmtgetarg __PR((const char *fmt, int num, va_lists_t *)); X#endif X#endif X X#ifdef FORMAT_BUFFER XLOCAL char xflsbuf __PR((int c, f_args *ap)); X XLOCAL char Xxflsbuf(c, ap) X int c; X f_args *ap; X{ X *ap->ptr++ = c; X if (filewrite((FILE *)ap->fp, ap->iobuf, ap->ptr - ap->iobuf) < 0) X ap->err = 1; X X ap->cnt = BFSIZ; X ap->ptr = ap->iobuf; X return (c); X} X X#undef ofun X#define ofun(c, xp) (--((f_args *)xp)->cnt <= 0 ? \ X xflsbuf(c, (f_args *)xp) : \ X (*(((f_args *)xp)->ptr)++ = (c))) X X#endif X X#ifndef FORMAT_FUNC_NAME X#define FORMAT_FUNC_NAME format X#define FORMAT_FUNC_PARM X X#define FORMAT_FUNC_PROTO_DECL void (*fun)(char, void *), X#define FORMAT_FUNC_KR_DECL register void (*fun)(); X#define FORMAT_FUNC_KR_ARGS fun, X X#define ofun(c, fp) (*fun)(c, fp) X#endif X X#ifdef FORMAT_BUFFER X#define FARG ((void *)((UIntptr_t)farg|1)) X#else X#define FARG farg X#endif X X#ifdef PROTOTYPES XEXPORT int XFORMAT_FUNC_NAME(FORMAT_FUNC_PROTO_DECL X void *farg, X const char *fmt, X va_list oargs) X#else XEXPORT int XFORMAT_FUNC_NAME(FORMAT_FUNC_KR_ARGS farg, fmt, oargs) X FORMAT_FUNC_KR_DECL X register void *farg; X register char *fmt; X va_list oargs; X#endif X{ X#ifdef FORMAT_LOW_MEM X#define FORMAT_BSIZE 512 X char buf[512+1]; X#else X#define FORMAT_BSIZE 8192 X char buf[8192+1]; X#endif X const char *sfmt; X register int unsflag; X register long val; X register char type; X register char mode; X register char c; X int count; X int num; X int i; X short sh; X const char *str; X double dval; X#ifdef USE_LONGLONG X Llong llval = 0; X#endif X Ulong res; X char *rfmt; X f_args fa; X#ifdef USE_NL_ARGS X va_lists_t fargs; /* Used to get arguments */ X va_lists_t sargs; /* Saved argument state */ X va_lists_t arglist[FMT_ARGMAX+1]; /* List of fast args */ X const char *ofmt = fmt; /* Saved original format */ X BOOL didlist = FALSE; /* Need to scan arguments */ X#endif X X#ifdef FORMAT_BUFFER X if (((UIntptr_t)farg & 1) == 0) { /* Called externally */ X fa.cnt = BFSIZ; X fa.ptr = fa.iobuf; X fa.fp = (FILE *)farg; X fa.err = 0; X farg = fa.farg = &fa; X } else { /* recursion */ X farg = (void *)((UIntptr_t)farg & ~1); X } X#endif X#ifdef FORMAT_FUNC_PARM X fa.outf = fun; X#endif X fa.farg = farg; X count = 0; X X#ifdef USE_NL_ARGS X va_copy(sargs.ap, oargs); /* Keep a copy in sargs */ X fargs = sargs; /* Make a working copy */ X#endif X X /* X * Main loop over the format string. X * Increment and check for end of string is made here. X */ X for (; *fmt != '\0'; fmt++) { X c = *fmt; X while (c != '%') { X if (c == '\0') X goto out; X ofun(c, farg); X c = *(++fmt); X count++; X } X X /* X * We reached a '%' sign. X */ X buf[0] = '\0'; X fa.buf = fa.bufp = buf; X fa.minusflag = 0; X fa.flags = 0; X fa.fldwidth = 0; X fa.signific = -1; X fa.lzero = 0; X fa.fillc = ' '; X fa.prefixlen = 0; X fa.maxlen = -1; X sfmt = fmt; X unsflag = FALSE; X type = '\0'; X mode = '\0'; X /* X * %f.s X * %*.* X * %n$f.s X * %n$*n$.*n$ X */ X newflag: X switch (*(++fmt)) { X X case '+': X CHECKFLAG(); X fa.flags |= PLUSFLG; X goto newflag; X X case '-': X CHECKFLAG(); X fa.minusflag++; X fa.flags |= MINUSFLG; X goto newflag; X X case ' ': X CHECKFLAG(); X /* X * If the space and the + flag are present, X * the space flag will be ignored. X */ X fa.flags |= SPACEFLG; X goto newflag; X X case '#': X CHECKFLAG(); X fa.flags |= HASHFLG; X goto newflag; X X case '\'': X CHECKFLAG(); X fa.flags |= APOFLG; X goto newflag; X X case '.': X fa.flags |= GOTDOT; X fa.signific = 0; X goto newflag; X X case '*': X fa.flags |= GOTSTAR; X#ifdef USE_NL_ARGS X if (is_dig(fmt[1])) { /* *n$ */ X fmt++; /* Eat up '*' */ X goto dodig; X } X#endif X if (!(fa.flags & GOTDOT)) { X fa.fldwidth = va_arg(args, int); X /* X * A negative fieldwith is a minus flag with a X * positive fieldwidth. X */ X if (fa.fldwidth < 0) { X fa.fldwidth = -fa.fldwidth; X fa.minusflag = 1; X fa.flags |= MINUSFLG; X } X } else { X /* X * A negative significance (precision) is taken X * as if the precision and '.' were omitted. X */ X fa.signific = va_arg(args, int); X if (fa.signific < 0) X fa.signific = -1; X } X goto newflag; X X case '0': X /* X * '0' may be a flag. X */ X if (!(fa.flags & (GOTDOT | GOTSTAR | MINUSFLG))) { X fa.fillc = '0'; X fa.flags |= PADZERO; X } X /* FALLTHRU */ X case '1': case '2': case '3': case '4': X case '5': case '6': case '7': case '8': case '9': X#ifdef USE_NL_ARGS X dodig: X#endif X num = *fmt++ - '0'; X while (c = *fmt, is_dig(c)) { X num *= 10; X num += c - '0'; X fmt++; X } X#ifdef USE_NL_ARGS X if (c == '$') X goto doarglist; X#endif X fmt--; /* backup to last digit */ X if (!(fa.flags & GOTDOT)) X fa.fldwidth = num; X else X fa.signific = num; X goto newflag; X X#ifdef USE_NL_ARGS X doarglist: X { X va_lists_t tmp; /* Temporary arg state */ X if (num <= 0) /* Illegal arg offset */ X goto newflag; /* Continue after '$' */ X if (!didlist) { /* Need to init arglist */ X _fmtarglist(ofmt, sargs, arglist); X didlist = TRUE; X } X if (num <= FMT_ARGMAX) { X tmp = arglist[num-1]; X } else { X tmp = arglist[FMT_ARGMAX-1]; X _fmtgetarg(ofmt, num, &tmp); X } X if (!(fa.flags & GOTSTAR)) { X fargs = tmp; X } else { X if (!(fa.flags & GOTDOT)) { X fa.fldwidth = va_arg(tmp.ap, int); X /* X * A negative fieldwith is a minus flag X * with a positive fieldwidth. X */ X if (fa.fldwidth < 0) { X fa.fldwidth = -fa.fldwidth; X fa.minusflag = 1; X fa.flags |= MINUSFLG; X } X } else { X /* X * A negative significance (precision) X * is taken as if the precision and '.' X * were omitted. X */ X fa.signific = va_arg(tmp.ap, int); X if (fa.signific < 0) X fa.signific = -1; X } X } X goto newflag; X } X#endif X X#ifdef USE_CHECKFLAG X flagerror: X fmt = ++sfmt; /* Don't print '%' */ X continue; X#endif X } X /* X * If the space and the + flag are present, X * the space flag will be ignored. X */ X if ((fa.flags & (PLUSFLG|SPACEFLG)) == (PLUSFLG|SPACEFLG)) X fa.flags &= ~SPACEFLG; X /* X * If the 0 and the - flag are present, X * the 0 flag will be ignored. X */ X if ((fa.flags & (MINUSFLG|PADZERO)) == (MINUSFLG|PADZERO)) X fa.flags &= ~PADZERO; X X if (strchr("UCSIL", *fmt)) { X /* X * Enhancements to K&R and ANSI: X * X * got a type specifyer X * X * XXX 'S' in C99 is %ls, 'S' should become 'H' X */ X if (*fmt == 'U') { X fmt++; X unsflag = TRUE; X } X if (!strchr("CSILZODX", *fmt)) { X /* X * Got only 'U'nsigned specifyer, X * use default type and mode. X */ X type = 'I'; X mode = 'D'; X fmt--; X } else if (!strchr("CSIL", *fmt)) { X /* X * no type, use default X */ X type = 'I'; X mode = *fmt; X } else { X /* X * got CSIL type X */ X type = *fmt++; X if (!strchr("ZODX", mode = *fmt)) { X /* X * Check long double "Le", "Lf" or "Lg" X */ X if (type == 'L' && X (mode == 'e' || mode == 'E' || X mode == 'f' || mode == 'F' || X mode == 'g' || mode == 'G')) X goto checkfmt; X fmt--; X mode = 'D'; /* default mode */ X } X } X } else { X checkfmt: X switch (*fmt) { X X case 'h': X if (!type) X type = 'H'; /* convert to short type */ X goto getmode; X X case 'l': X if (!type) X type = 'L'; /* convert to long type */ X goto getmode; X X case 'j': X if (!type) X type = 'J'; /* convert to intmax_t type */ X goto getmode; X X case 'z': /* size_t */ X#if SIZEOF_SIZE_T == SIZEOF_INT X if (!type) X type = 'I'; /* convert to int type */ X#else X#if SIZEOF_SIZE_T == SIZEOF_LONG_INT X if (!type) X type = 'L'; /* convert to long type */ X#else X#if SIZEOF_SIZE_T == SIZEOF_LLONG X if (!type) X type = 'Q'; /* convert to long long type */ X#else Xerror sizeof (size_t) is unknown X#endif X#endif X#endif X goto getmode; X X case 't': /* ptrdiff_t */ X#if SIZEOF_PTRDIFF_T == SIZEOF_INT X if (!type) X type = 'I'; /* convert to int type */ X#else X#if SIZEOF_PTRDIFF_T == SIZEOF_LONG_INT X if (!type) X type = 'L'; /* convert to long type */ X#else X#if SIZEOF_PTRDIFF_T == SIZEOF_LLONG X if (!type) X type = 'Q'; /* convert to long long type */ X#else Xerror sizeof (ptrdiff_t) is unknown X#endif X#endif X#endif X /* X * XXX Future length modifiers: X * XXX 'L' with double: long double X */ X X getmode: X if (!strchr("udioxXn", *(++fmt))) { X /* X * %hhd -> char in decimal X */ X if (type == 'H' && *fmt == 'h') { X type = 'C'; X goto getmode; X } X#ifdef USE_LONGLONG X if (type == 'L' && *fmt == 'l') { X type = 'Q'; X goto getmode; X } X#endif X fmt--; X mode = 'D'; X } else { /* One of "udioxXn": */ X mode = *fmt; X if (mode == 'n') X goto gotn; X if (mode != 'x') X mode = to_cap(mode); X if (mode == 'U') X unsflag = TRUE; X else if (mode == 'I') /* XXX */ X mode = 'D'; X } X break; X case 'x': X mode = 'x'; X goto havemode; X case 'X': X mode = 'X'; X type = 'I'; X goto havemode; X case 'u': X unsflag = TRUE; X /* X * XXX Need to remove uppercase letters for 'long' X * XXX in future for POSIX/C99 compliance. X */ X /* FALLTHRU */ X case 'o': case 'O': X case 'd': case 'D': X case 'i': case 'I': X case 'Z': X mode = to_cap(*fmt); X havemode: X if (!type) X type = cap_ty(*fmt); X#ifdef DEBUG X dbg_print("*fmt: '%c' mode: '%c' type: '%c'\n", X *fmt, mode, type); X#endif X if (mode == 'I') /* XXX kann entfallen */ X mode = 'D'; /* wenn besseres uflg */ X break; X case 'p': X mode = 'P'; X type = 'L'; X break; X X case '%': X count += prc('%', &fa); X continue; X case ' ': X count += prbuf("", &fa); X continue; X case 'c': X c = va_arg(args, int); X count += prc(c, &fa); X continue; X case 's': X str = va_arg(args, char *); X count += prstring(str, &fa); X continue; X case 'b': X str = va_arg(args, char *); X fa.signific = va_arg(args, int); X count += prstring(str, &fa); X continue; X X#ifndef NO_FLOATINGPOINT X case 'e': X case 'E': { X int signific; X int fwidth = 0; X X if (fa.signific == -1) X fa.signific = 6; X signific = fa.signific; X if (!fa.minusflag) X fwidth = fa.fldwidth; X if (*fmt == 'E') X fa.flags |= UPPERFLG; X if (type == 'L') { X#ifdef HAVE_LONGDOUBLE X long double ldval = va_arg(args, long double); X X#if (defined(HAVE_QECVT) || defined(HAVE__LDECVT)) X _qftoes(buf, ldval, fwidth, signific, fa.flags); X fa.fillc = ' '; X count += prbuf(buf, &fa); X continue; X#else X dval = ldval; X#endif X#endif X } else { X dval = va_arg(args, double); X } X _ftoes(buf, dval, fwidth, signific, fa.flags); X fa.fillc = ' '; X count += prbuf(buf, &fa); X continue; X } X case 'f': X case 'F': { X int signific; X int fwidth = 0; X X if (fa.signific == -1) X fa.signific = 6; X signific = fa.signific; X if (!fa.minusflag) X fwidth = fa.fldwidth; X if (*fmt == 'F') X fa.flags |= UPPERFLG; X if (type == 'L') { X#ifdef HAVE_LONGDOUBLE X long double ldval = va_arg(args, long double); X X#if (defined(HAVE_QFCVT) || defined(HAVE__LDFCVT)) X _qftofs(buf, ldval, fwidth, signific, fa.flags); X fa.fillc = ' '; X count += prbuf(buf, &fa); X continue; X#else X dval = ldval; X#endif X#endif X } else { X dval = va_arg(args, double); X } X _ftofs(buf, dval, fwidth, signific, fa.flags); X fa.fillc = ' '; X count += prbuf(buf, &fa); X continue; X } X case 'g': X case 'G': { X int signific; X int fwidth = 0; X X if (fa.signific == -1) X fa.signific = 6; X if (fa.signific == 0) X fa.signific = 1; X signific = fa.signific; X if (!fa.minusflag) X fwidth = fa.fldwidth; X if (*fmt == 'G') X fa.flags |= UPPERFLG; X if (type == 'L') { X#ifdef HAVE_LONGDOUBLE X long double ldval = va_arg(args, long double); X X#if (defined(HAVE_QECVT) || defined(HAVE__LDECVT)) X _qftogs(buf, ldval, fwidth, signific, fa.flags); X fa.fillc = ' '; X count += prbuf(buf, &fa); X continue; X#else X dval = ldval; X#endif X#endif X } else { X dval = va_arg(args, double); X } X _ftogs(buf, dval, fwidth, signific, fa.flags); X fa.fillc = ' '; X count += prbuf(buf, &fa); X continue; X } X#else X# ifdef USE_FLOATINGARGS X case 'e': X case 'E': X case 'f': X case 'F': X case 'g': X case 'G': X dval = va_arg(args, double); X continue; X# endif X#endif X X case 'r': /* recursive printf */ X case 'R': /* recursive printf */ X rfmt = va_arg(args, char *); X /* X * I don't know any portable way to get an arbitrary X * C object from a var arg list so I use a X * system-specific routine __va_arg_list() that knows X * if 'va_list' is an array. You will not be able to X * assign the value of __va_arg_list() but it works X * to be used as an argument of a function. X * It is a requirement for recursive printf to be able X * to use this function argument. If your system X * defines va_list to be an array you need to know this X * via autoconf or another mechanism. X * It would be nice to have something like X * __va_arg_list() in stdarg.h X */ X count += FORMAT_FUNC_NAME(FORMAT_FUNC_KR_ARGS X FARG, rfmt, __va_arg_list(args)); X continue; X X gotn: X case 'n': X switch (type) { X X case 'C': { X signed char *cp = va_arg(args, signed char *); X X *cp = count; X } X continue; X case 'H': { X short *sp = va_arg(args, short *); X X *sp = count; X } X continue; X case 'L': { X long *lp = va_arg(args, long *); X X *lp = count; X } X continue; X#ifdef USE_LONGLONG X case 'J': /* For now Intmax_t is Llong */ X case 'Q': { X Llong *qp = va_arg(args, Llong *); X X *qp = count; X } X continue; X#endif X default: { X int *ip = va_arg(args, int *); X X *ip = count; X } X continue; X } X X default: /* Unknown '%' format */ X sfmt++; /* Dont't print '%' */ X count += fmt - sfmt; X while (sfmt < fmt) X ofun(*(sfmt++), farg); X if (*fmt == '\0') { X fmt--; X continue; X } else { X ofun(*fmt, farg); X count++; X continue; X } X } X } X /* X * print numbers: X * first prepare type 'C'har, s'H'ort, 'I'nt, or 'L'ong X * or 'Q'ad and 'J'==maxint_t X */ X switch (type) { X X case 'C': X c = va_arg(args, int); X val = c; /* extend sign here */ X if (unsflag || mode != 'D') X#ifdef DO_MASK X val &= CHARMASK; X#else X val = (unsigned char)val; X#endif X break; X case 'H': X case 'S': /* XXX remove 'S' in future */ X sh = va_arg(args, int); X val = sh; /* extend sign here */ X if (unsflag || mode != 'D') X#ifdef DO_MASK X val &= SHORTMASK; X#else X val = (unsigned short)val; X#endif X break; X case 'I': X default: X i = va_arg(args, int); X val = i; /* extend sign here */ X if (unsflag || mode != 'D') X#ifdef DO_MASK X val &= INTMASK; X#else X val = (unsigned int)val; X#endif X break; X case 'P': X case 'L': X val = va_arg(args, long); X break; X#ifdef USE_LONGLONG X case 'J': /* For now Intmax_t is Llong */ X type = 'Q'; /* use 'Q' for processing */ X case 'Q': X llval = va_arg(args, Llong); X val = llval != 0; X break; X#endif X } X X /* X * Final print out, take care of mode: X * mode is one of: 'O'ctal, 'D'ecimal, or he'X' X * oder 'Z'weierdarstellung. X */ X fa.bufp = &buf[sizeof (buf)-1]; X *--fa.bufp = '\0'; X X if (val == 0 && mode != 'D') { X printzero: X /* X * Printing '0' with fieldwidth 0 results in no chars. X */ X fa.lzero = -1; X if (fa.signific >= 0) X fa.fillc = ' '; X count += prstring("0", &fa); X continue; X } else switch (mode) { X X case 'D': X#ifdef USE_LONGLONG X if (type == 'Q') { X if (!unsflag && llval < 0) { X fa.prefix = "-"; X fa.prefixlen = 1; X llval = -llval; X } else if (fa.flags & PLUSFLG) { X fa.prefix = "+"; X fa.prefixlen = 1; X } else if (fa.flags & SPACEFLG) { X fa.prefix = " "; X fa.prefixlen = 1; X } X if (llval == 0) X goto printzero; X goto prunsigned; X } X#endif X if (!unsflag && val < 0) { X fa.prefix = "-"; X fa.prefixlen = 1; X val = -val; X } else if (fa.flags & PLUSFLG) { X fa.prefix = "+"; X fa.prefixlen = 1; X } else if (fa.flags & SPACEFLG) { X fa.prefix = " "; X fa.prefixlen = 1; X } X if (val == 0) X goto printzero; X /* FALLTHRU */ X case 'U': X /* output a long unsigned decimal number */ X#ifdef USE_LONGLONG X prunsigned: X if (type == 'Q') X prldnum(llval, &fa); X else X#endif X prdnum(val, &fa); X break; X case 'O': { X /* output a long octal number */ X X char *p = fa.bufp; X#ifdef USE_LONGLONG X if (type == 'Q') { X prlonum(llval, &fa); X } else X#endif X { X X pronum(val & 07, &fa); X if ((res = (val>>3) & rshiftmask(long, 3)) != 0) X pronum(res, &fa); X } X if ((fa.flags & HASHFLG) && X (p - fa.bufp) >= fa.signific) { X /* X * Add '0' only if not left zero filled X * otherwise. X */ X fa.prefix = "0"; X fa.prefixlen = 1; X } X break; X } X case 'p': X case 'x': X /* output a hex long */ X if (fa.flags & HASHFLG) { X fa.prefix = "0x"; X fa.prefixlen = 2; X } X#ifdef USE_LONGLONG X if (type == 'Q') X prlxnum(llval, &fa); X else X#endif X { X prxnum(val & 0xF, &fa); X if ((res = (val>>4) & rshiftmask(long, 4)) != 0) X prxnum(res, &fa); X } X break; X case 'P': X case 'X': X /* output a hex long */ X if (fa.flags & HASHFLG) { X fa.prefix = "0X"; X fa.prefixlen = 2; X } X#ifdef USE_LONGLONG X if (type == 'Q') X prlXnum(llval, &fa); X else X#endif X { X prXnum(val & 0xF, &fa); X if ((res = (val>>4) & rshiftmask(long, 4)) != 0) X prXnum(res, &fa); X } X break; X case 'Z': X /* output a binary long */ X#ifdef USE_LONGLONG X if (type == 'Q') X prlnum(llval, 2, &fa); X else X#endif X { X prnum(val & 0x1, 2, &fa); X if ((res = (val>>1) & rshiftmask(long, 1)) != 0) X prnum(res, 2, &fa); X } X } X fa.lzero = -1; X /* X * If a precision (fielwidth) is specified X * on diouXx conversions, the '0' flag is ignored. X */ X if (fa.signific >= 0) X fa.fillc = ' '; X count += prbuf(fa.bufp, &fa); X } Xout: X#ifdef FORMAT_BUFFER X if (farg == &fa) { /* Top level call, flush buffer */ X if (fa.err) X return (EOF); X if ((fa.ptr != fa.iobuf) && X (filewrite(fa.fp, fa.iobuf, fa.ptr - fa.iobuf) < 0)) X return (EOF); X } X#endif X return (count); X} X X/* X * Routines to print (not negative) numbers in an arbitrary base X */ XLOCAL unsigned char dtab[] = "0123456789abcdef"; XLOCAL unsigned char udtab[] = "0123456789ABCDEF"; X XLOCAL void Xprnum(val, base, fa) X register Ulong val; X register unsigned base; X f_args *fa; X{ X register char *p = fa->bufp; X X do { X *--p = dtab[modlbys(val, base)]; X val = divlbys(val, base); X } while (val > 0); X X fa->bufp = p; X} X XLOCAL void Xprdnum(val, fa) X register Ulong val; X f_args *fa; X{ X register char *p = fa->bufp; X X do { X *--p = dtab[modlbys(val, (unsigned)10)]; X val = divlbys(val, (unsigned)10); X } while (val > 0); X X fa->bufp = p; X} X X/* X * We may need to use division here too (PDP-11, non two's complement ...) X */ XLOCAL void Xpronum(val, fa) X register Ulong val; X f_args *fa; X{ X register char *p = fa->bufp; X X do { X *--p = dtab[val & 7]; X val >>= 3; X } while (val > 0); X X fa->bufp = p; X} X XLOCAL void Xprxnum(val, fa) X register Ulong val; X f_args *fa; X{ X register char *p = fa->bufp; X X do { X *--p = dtab[val & 15]; X val >>= 4; X } while (val > 0); X X fa->bufp = p; X} X XLOCAL void XprXnum(val, fa) X register Ulong val; X f_args *fa; X{ X register char *p = fa->bufp; X X do { X *--p = udtab[val & 15]; X val >>= 4; X } while (val > 0); X X fa->bufp = p; X} X X#ifdef USE_LONGLONG XLOCAL void Xprlnum(val, base, fa) X register Ullong val; X register unsigned base; X f_args *fa; X{ X register char *p = fa->bufp; X X do { X *--p = dtab[modlbys(val, base)]; X val = divlbys(val, base); X } while (val > 0); X X fa->bufp = p; X} X XLOCAL void Xprldnum(val, fa) X register Ullong val; X f_args *fa; X{ X register char *p = fa->bufp; X X do { X *--p = dtab[val % (unsigned)10]; X val = val / (unsigned)10; X } while (val > 0); X X fa->bufp = p; X} X XLOCAL void Xprlonum(val, fa) X register Ullong val; X f_args *fa; X{ X register char *p = fa->bufp; X X do { X *--p = dtab[val & 7]; X val >>= 3; X } while (val > 0); X X fa->bufp = p; X} X XLOCAL void Xprlxnum(val, fa) X register Ullong val; X f_args *fa; X{ X register char *p = fa->bufp; X X do { X *--p = dtab[val & 15]; X val >>= 4; X } while (val > 0); X X fa->bufp = p; X} X XLOCAL void XprlXnum(val, fa) X register Ullong val; X f_args *fa; X{ X register char *p = fa->bufp; X X do { X *--p = udtab[val & 15]; X val >>= 4; X } while (val > 0); X X fa->bufp = p; X} X X#endif X X/* X * Final buffer print out routine. X */ XLOCAL int Xprbuf(s, fa) X register const char *s; X f_args *fa; X{ X register int diff; X register int rfillc; X register void *arg = fa->farg; X#ifdef FORMAT_FUNC_PARM X register void (*fun) __PR((char, void *)) = fa->outf; X#endif X register int count; X register int lzero = 0; X X if (fa->maxlen < 0) X count = strlen(s); X else X count = fa->maxlen; X X /* X * lzero becomes the number of left fill chars needed to reach signific X */ X if (fa->lzero < 0 && count < fa->signific) X lzero = fa->signific - count; X count += lzero + fa->prefixlen; X diff = fa->fldwidth - count; X if (diff > 0) X count += diff; X X if (fa->prefixlen && fa->fillc != ' ') { X while (*fa->prefix != '\0') X ofun(*fa->prefix++, arg); X } X if (!fa->minusflag) { X rfillc = fa->fillc; X while (--diff >= 0) X ofun(rfillc, arg); X } X if (fa->prefixlen && fa->fillc == ' ') { X while (*fa->prefix != '\0') X ofun(*fa->prefix++, arg); X } X if (lzero > 0) { X rfillc = '0'; X while (--lzero >= 0) X ofun(rfillc, arg); X } X if (fa->maxlen < 0) { X while (*s != '\0') X ofun(*s++, arg); X } else { X register size_t len = fa->maxlen; X X if (len > 0) { X len++; X while (--len > 0) X ofun(*s++, arg); X } X } X if (fa->minusflag) { X rfillc = ' '; X while (--diff >= 0) X ofun(rfillc, arg); X } X return (count); X} X X/* X * Print out one char, allowing prc('\0') X * Similar to prbuf() X */ X#ifdef PROTOTYPES X XLOCAL int Xprc(char c, f_args *fa) X X#else X XLOCAL int Xprc(c, fa) X char c; X f_args *fa; X#endif X{ X register int diff; X register int rfillc; X register void *arg = fa->farg; X#ifdef FORMAT_FUNC_PARM X register void (*fun) __PR((char, void *)) = fa->outf; X#endif X register int count; X X count = 1; X diff = fa->fldwidth - 1; X if (diff > 0) X count += diff; X X if (!fa->minusflag) { X rfillc = fa->fillc; X while (--diff >= 0) X ofun(rfillc, arg); X } X ofun(c, arg); X if (fa->minusflag) { X rfillc = ' '; X while (--diff >= 0) X ofun(rfillc, arg); X } X return (count); X} X X/* X * String output routine. X * If fa->signific is >= 0, it uses only fa->signific chars. X * If fa->signific is 0, print no characters. X */ XLOCAL int Xprstring(s, fa) X register const char *s; X f_args *fa; X{ X if (s == NULL) X return (prbuf("(NULL POINTER)", fa)); X X if (fa->signific < 0) X return (prbuf(s, fa)); X X fa->maxlen = strnlen(s, fa->signific); X return (prbuf(s, fa)); X} X X#ifdef DEBUG XLOCAL void Xdbg_print(fmt, a, b, c, d, e, f, g, h, i) Xchar *fmt; X{ X char ff[1024]; X X sprintf(ff, fmt, a, b, c, d, e, f, g, h, i); X write(STDERR_FILENO, ff, strlen(ff)); X} X#endif X X#ifdef USE_NL_ARGS X#ifdef FORMAT_IMPL X/* X * The following code is shared between format() and fprformat(). X */ X X/* X * Format argument types. X * As "char" and "short" type arguments are fetched as "int" X * we start with size "int" and ignore the 'h' modifier when X * parsing sizes. X */ X#define AT_NONE 0 X#define AT_INT 1 X#define AT_LONG 2 X#define AT_LONG_LONG 3 X#define AT_DOUBLE 4 X#define AT_LONG_DOUBLE 5 X#define AT_VOID_PTR 6 X#define AT_CHAR_PTR 7 X#define AT_SHORT_PTR 8 X#define AT_INT_PTR 9 X#define AT_LONG_PTR 10 X#define AT_LONG_LONG_PTR 11 X#define AT_R_FMT 12 X#define AT_R_VA_LIST 13 X#define AT_BOUNDS 14 X X#define AF_NONE 0 X#define AF_LONG 1 X#define AF_LONG_LONG 2 X#define AF_LONG_DOUBLE 4 X#define AF_STAR 8 X Xstatic const char skips[] = "+- #'.$h1234567890"; Xstatic const char *digits = &skips[8]; X X/* X * Parse the format string and store the first FMT_ARGMAX args in the arglist X * parameter. X * X * This is done in two stages: X * 1 parse the format string and store the types in argtypes[]. X * 2 use the type list in argtypes[], fetch the args in order and X * store the related va_list state in arglist[] X */ XEXPORT void X_fmtarglist(fmt, fargs, arglist) X const char *fmt; X va_lists_t fargs; X va_lists_t arglist[]; X{ X int i; X int argindex; X int maxindex; X int thistype; X int thisflag; X int argtypes[FMT_ARGMAX+1]; X X for (i = 0; i < FMT_ARGMAX; i++) X argtypes[i] = AT_NONE; X X maxindex = -1; X argindex = 0; X while ((fmt = strchr(fmt, '%')) != NULL) { X fmt++; X i = strspn(fmt, digits); X if (fmt[i] == '$') { X int c; X X argindex = *fmt++ - '0'; X while (c = *fmt, is_dig(c)) { X argindex *= 10; X argindex += c - '0'; X fmt++; X } X argindex -= 1; X } X thistype = AT_NONE; X thisflag = AF_NONE; X newarg: X fmt += strspn(fmt, skips); X switch (*fmt++) { X X case '%': /* %% format no arg */ X continue; X X case 'l': X if (thisflag & AF_LONG) { X thisflag |= AF_LONG_LONG; X } else { X thisflag |= AF_LONG; X } X goto newarg; X case 'j': /* intmax_t for now is long long */ X thisflag |= AF_LONG_LONG; X goto newarg; X case 'z': /* size_t */ X#if SIZEOF_SIZE_T == SIZEOF_INT X if (thistype == AT_NONE) X thistype = AT_INT; X#else X#if SIZEOF_SIZE_T == SIZEOF_LONG_INT X if (thistype == AT_NONE) X thistype = AT_LONG; X#else X#if SIZEOF_SIZE_T == SIZEOF_LLONG X if (thistype == AT_NONE) X thistype = AT_LONG_LONG; X#else Xerror sizeof (size_t) is unknown X#endif X#endif X#endif X goto newarg; X case 't': /* ptrdiff_t */ X#if SIZEOF_PTRDIFF_T == SIZEOF_INT X if (thistype == AT_NONE) X thistype = AT_INT; X#else X#if SIZEOF_PTRDIFF_T == SIZEOF_LONG_INT X if (thistype == AT_NONE) X thistype = AT_LONG; X#else X#if SIZEOF_PTRDIFF_T == SIZEOF_LLONG X if (thistype == AT_NONE) X thistype = AT_LONG_LONG; X#else Xerror sizeof (ptrdiff_t) is unknown X#endif X#endif X#endif X goto newarg; X#ifndef NO_UCSIL X /* X * Enhancements to K&R and ANSI: X * X * got a type specifyer X * X * XXX 'S' in C99 is %ls, 'S' should become 'H' X */ X case 'U': X if (!strchr("CSILZODX", *fmt)) { X /* X * Got only 'U'nsigned specifyer, X * use default type and mode. X */ X thistype = AT_INT; X break; X } X if (!strchr("CSIL", *fmt)) { X /* X * Got 'U' and ZODX. X * no type, use default X */ X thistype = AT_INT; X fmt++; /* Skip ZODX */ X break; X } X fmt++; /* Unsigned, skip 'U', get CSIL */ X /* FALLTHRU */ X case 'C': X case 'S': X case 'I': X case 'L': X fmt--; /* Undo fmt++ from switch() */ X { X /* X * got CSIL type X */ X int type = *fmt++; /* Undo above fmt-- */ X int mode = *fmt; X if (!strchr("ZODX", mode)) { X /* X * Check long double "Le", "Lf" or "Lg" X */ X if (type == 'L' && X (mode == 'e' || X mode == 'f' || X mode == 'g')) { X thisflag |= AF_LONG_DOUBLE; X goto newarg; X } X } else { X fmt++; /* Skip ZODX */ X } X if (type == 'L') X thistype = AT_LONG; X else X thistype = AT_INT; X } X break; X#else X case 'L': X thisflag |= AF_LONG_DOUBLE; X goto newarg; X#endif X X case 'e': X case 'E': X case 'f': X case 'F': X case 'g': X case 'G': X if (thisflag & AF_LONG_DOUBLE) X thistype = AT_LONG_DOUBLE; X else X thistype = AT_DOUBLE; X break; X X case 'p': X thistype = AT_VOID_PTR; X break; X case 's': X thistype = AT_CHAR_PTR; X break; X case 'b': X thistype = AT_BOUNDS; X break; X case 'n': X if (thisflag & AF_LONG_LONG) X thistype = AT_LONG_LONG_PTR; X else if (thistype & AF_LONG) X thistype = AT_LONG_PTR; X else X thistype = AT_INT_PTR; X break; X case 'r': X thistype = AT_R_FMT; X break; X default: X if (thistype == AT_NONE) { X if (thisflag & AF_LONG_LONG) X thistype = AT_LONG_LONG; X else if (thistype & AF_LONG) X thistype = AT_LONG; X else X thistype = AT_INT; X } X break; X X case '*': X if (is_dig(*fmt)) { X int c; X int starindex; X X starindex = *fmt++ - '0'; X while (c = *fmt, is_dig(c)) { X starindex *= 10; X starindex += c - '0'; X fmt++; X } X starindex -= 1; X if (starindex >= 0 && starindex < FMT_ARGMAX) { X argtypes[starindex] = AT_INT; X if (starindex > maxindex) X maxindex = starindex; X } X goto newarg; X } X thistype = AT_INT; X thisflag |= AF_STAR; /* Make sure to rescan for type */ X break; X } X if (argindex >= 0 && argindex < FMT_ARGMAX) { X argtypes[argindex] = thistype; X if (thistype == AT_R_FMT) X argtypes[++argindex] = AT_R_VA_LIST; X else if (thistype == AT_BOUNDS) X argtypes[++argindex] = AT_INT; X X if (argindex > maxindex) X maxindex = argindex; X } X ++argindex; /* Default to next arg in list */ X if (thisflag & AF_STAR) { /* Found '*', continue for type */ X thisflag &= ~AF_STAR; X goto newarg; X } X } X X for (i = 0; i <= maxindex; i++) { /* Do not fetch more args than known */ X arglist[i] = fargs; /* Save state before fetching this */ X X switch (argtypes[i]) { X X default: X /* FALLTHRU */ X case AT_NONE: /* This matches '*' args */ X /* FALLTHRU */ X case AT_INT: X (void) va_arg(fargs.ap, int); X break; X case AT_LONG: X (void) va_arg(fargs.ap, long); X break; X case AT_LONG_LONG: X (void) va_arg(fargs.ap, Llong); X break; X case AT_DOUBLE: X (void) va_arg(fargs.ap, double); X break; X case AT_LONG_DOUBLE: X#ifdef HAVE_LONGDOUBLE X (void) va_arg(fargs.ap, long double); X#endif X break; X case AT_VOID_PTR: X (void) va_arg(fargs.ap, void *); X break; X case AT_CHAR_PTR: X (void) va_arg(fargs.ap, char *); X break; X case AT_SHORT_PTR: X (void) va_arg(fargs.ap, short *); X break; X case AT_INT_PTR: X (void) va_arg(fargs.ap, int *); X break; X case AT_LONG_PTR: X (void) va_arg(fargs.ap, long *); X break; X case AT_LONG_LONG_PTR: X (void) va_arg(fargs.ap, Llong *); X break; X case AT_R_FMT: X (void) va_arg(fargs.ap, char *); X arglist[++i] = fargs; X (void) __va_arg_list(fargs.ap); X break; X case AT_R_VA_LIST: X break; X case AT_BOUNDS: X (void) va_arg(fargs.ap, char *); X arglist[++i] = fargs; X (void) va_arg(fargs.ap, int); X break; X } X } X} X X/* X * In case that the format references an argument > FMT_ARGMAX, we use this X * implementation. It is slow (n*n - where n is (argno - FMT_ARGMAX)). X * Fortunately, it is most unlikely that there are more positional args than X * the current FMT_ARGMAX definition of 30. X */ XEXPORT void X_fmtgetarg(fmt, num, fargs) X const char *fmt; X int num; X va_lists_t *fargs; X{ X const char *sfmt = fmt; X int i; X X /* X * Hacky preliminary support for all int type args bejond FMT_ARGMAX. X */ X for (i = FMT_ARGMAX; i < num; i++) X (void) va_arg((*fargs).ap, int); X} X#endif /* FORMAT_IMPL */ X#endif /* USE_NL_ARGS */ END-of-star-1.6/libschily/format.c echo x - star-1.6/libschily/getfp.c sed 's/^X//' >star-1.6/libschily/getfp.c << 'END-of-star-1.6/libschily/getfp.c' X/* @(#)getfp.c 1.20 18/04/09 Copyright 1988-2018 J. Schilling */ X/* X * Get frame pointer X * X * Copyright (c) 1988-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X X#ifndef IS_AVOFFSET X/* X * We usually don't like to compile a getfp() that returns junk data in case X * we cannot scan the stack. X * The only way to find this out is by including avoffset.h. Unfortunately, we X * need to be able to use getfp() from avoffset.c in order to check if the X * return value is usable or junk. To be able to do this, we include getfp.c X * from avoffset.c and define IS_AVOFFSET before. X */ X#include X X#if !defined(AV_OFFSET) || !defined(FP_INDIR) X# ifdef HAVE_SCANSTACK X# undef HAVE_SCANSTACK X# endif X#endif X#endif X X#ifdef HAVE_SCANSTACK X#include X X#define MAXWINDOWS 32 X#define NWINDOWS 7 X X#if defined(sparc) && defined(__GNUC__) X# define FP_OFF 0x10 /* some strange things on sparc gcc */ X#else X# define FP_OFF 0 X#endif X X#if defined(__clang__) || \ X (defined(__GNUC__) && \ X ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ > 7))) X#define ATTRIBUTE_NO_SANITIZE_ADDRESS __attribute__((no_sanitize_address)) X#else X#define ATTRIBUTE_NO_SANITIZE_ADDRESS X#endif X XEXPORT void **___fpoff __PR((char *cp)); X XATTRIBUTE_NO_SANITIZE_ADDRESS XEXPORT void ** Xgetfp() X{ X long **dummy[1]; X X#ifdef sparc X flush_reg_windows(MAXWINDOWS-2); X#endif X return ((void **)((struct frame *)___fpoff((char *)&dummy[0]))->fr_savfp); X} X X#ifdef sparc XEXPORT int Xflush_reg_windows(n) X int n; X{ X if (--n > 0) X flush_reg_windows(n); X return (0); X} X#endif X X#else /* HAVE_SCANSTACK */ X XEXPORT void ** Xgetfp() X{ X raisecond("getfp", 0); X return ((void **)0); X} X X#endif /* HAVE_SCANSTACK */ END-of-star-1.6/libschily/getfp.c echo x - star-1.6/libschily/geterrno.c sed 's/^X//' >star-1.6/libschily/geterrno.c << 'END-of-star-1.6/libschily/geterrno.c' X/* @(#)geterrno.c 1.14 10/08/23 Copyright 1985, 1995-2010 J. Schilling */ X/* X * Get error number X * X * Copyright (c) 1985, 1995-2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _TS_ERRNO X#define _TS_ERRNO /* Solaris: get thread safe errno value */ X#endif X#ifndef _LIBC_REENTRANT X#define _LIBC_REENTRANT /* Linux: get thread safe errno value */ X#endif X#include X#include X#include X X#ifdef geterrno X#undef geterrno X#endif X XEXPORT int Xgeterrno() X X{ X return (errno); X} END-of-star-1.6/libschily/geterrno.c echo x - star-1.6/libschily/fconv.c sed 's/^X//' >star-1.6/libschily/fconv.c << 'END-of-star-1.6/libschily/fconv.c' X/* @(#)fconv.c 1.59 18/09/10 Copyright 1985, 1995-2018 J. Schilling */ X/* X * Convert floating point numbers to strings for format.c X * Should rather use the MT-safe routines [efg]convert() X * X * Copyright (c) 1985, 1995-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include /* <- may define NO_FLOATINGPOINT */ X#ifndef NO_FLOATINGPOINT X X#ifndef __DO_LONG_DOUBLE__ X#include X#include X#include X#include X#include /* The default place for isinf()/isnan() */ X#include X#include X#include "format.h" X X#if !defined(HAVE_STDLIB_H) || defined(HAVE_DTOA) Xextern char *ecvt __PR((double, int, int *, int *)); Xextern char *fcvt __PR((double, int, int *, int *)); X#endif X X#if defined(HAVE_ISNAN) && defined(HAVE_ISINF) X/* X * *BSD alike libc X */ X#define FOUND_ISNAN X#define FOUND_ISINF X#define FOUND_ISXX X#endif X X#if defined(HAVE_C99_ISNAN) && defined(HAVE_C99_ISINF) X#ifndef FOUND_ISXX X#define FOUND_ISXX X#endif X#define FOUND_C99_ISNAN X#define FOUND_C99_ISINF X#define FOUND_C99_ISXX X#endif X X#if defined(HAVE_FP_H) && !defined(FOUND_ISXX) X/* X * WAS: X * #if defined(__osf__) || defined(_IBMR2) || defined(_AIX) X */ X/* X * Moved before HAVE_IEEEFP_H for True64 due to a hint X * from Bert De Knuydt X * X * True64 has both fp.h & ieeefp.h but the functions X * isnand() & finite() seem to be erreneously not implemented X * as a macro and the function lives in libm. X * Let's hope that we will not get problems with the new order. X */ X#include X#if !defined(isnan) && defined(IS_NAN) X#define isnan IS_NAN X#define FOUND_ISNAN X#endif X#if !defined(isinf) && defined(FINITE) X#define isinf !FINITE X#define FOUND_ISINF X#endif X#if defined(FOUND_ISNAN) && defined(FOUND_ISINF) X#define FOUND_ISXX X#endif X#endif X X#if defined(HAVE_IEEEFP_H) && !defined(FOUND_ISXX) && \ X !defined(FOUND_C99_ISXX) X/* X * SVR4 X */ X#include X#ifdef HAVE_ISNAND X#ifndef isnan X#define isnan isnand X#define FOUND_ISNAN X#endif X#endif X#ifdef HAVE_FINITE X#ifndef isinf X#define isinf !finite X#define FOUND_ISINF X#endif X#endif X#if defined(FOUND_ISNAN) && defined(FOUND_ISINF) X#define FOUND_ISXX X#endif X#endif X X/* X * WAS: X * #if defined(__hpux) || defined(VMS) || defined(_SCO_DS) || defined(__QNX__) X */ X#ifdef __nneded__ X#if defined(__hpux) || defined(__QNX__) || defined(__DJGPP__) X#ifndef FOUND_C99_ISXX X#undef isnan X#undef isinf X#endif X#endif X#endif /* __needed__ */ X X/* X * As we no longer check for defined(isnan)/defined(isinf), the next block X * should also handle the problems with DJGPP, HP-UX, QNX and VMS. X */ X#if !defined(FOUND_ISNAN) && !defined(HAVE_C99_ISNAN) X#undef isnan X#define isnan(val) (0) X#define NO_ISNAN X#endif X#if !defined(FOUND_ISINF) && !defined(HAVE_C99_ISINF) X#undef isinf X#define isinf(val) (0) X#define NO_ISINF X#endif X X#if defined(NO_ISNAN) || defined(NO_ISINF) X#include /* For values.h */ X#if (_IEEE - 0) > 0 /* We know that there is IEEE FP */ X/* X * Note that older HP-UX versions have different #defines for MAXINT in X * values.h and sys/param.h X */ X#include X#include X X#ifdef WORDS_BIGENDIAN X#define fpw_high(x) ((UInt32_t *)&x)[0] X#define fpw_low(x) ((UInt32_t *)&x)[1] X#else X#define fpw_high(x) ((UInt32_t *)&x)[1] X#define fpw_low(x) ((UInt32_t *)&x)[0] X#endif X#define FP_EXP 0x7FF00000 X#define fp_exp(x) (fpw_high(x) & FP_EXP) X#define fp_exc(x) (fp_exp(x) == FP_EXP) X X#ifdef NO_ISNAN X#undef isnan X#define isnan(val) (fp_exc(val) && \ X (fpw_low(val) != 0 || (fpw_high(val) & 0xFFFFF) != 0)) X#endif X#ifdef NO_ISINF X#undef isinf X#define isinf(val) (fp_exc(val) && \ X fpw_low(val) == 0 && (fpw_high(val) & 0xFFFFF) == 0) X#endif X#endif /* We know that there is IEEE FP */ X#endif /* defined(NO_ISNAN) || defined(NO_ISINF) */ X X X#if !defined(HAVE_ECVT) || !defined(HAVE_FCVT) || !defined(HAVE_GCVT) X X#ifdef NO_USER_XCVT X /* X * We cannot define our own ecvt()/fcvt()/gcvt() so we need to use X * local names instead. X */ X#ifndef HAVE_ECVT X#define ecvt js_ecvt X#endif X#ifndef HAVE_FCVT X#define fcvt js_fcvt X#endif X#ifndef HAVE_GCVT X#define gcvt js_gcvt X#endif X#endif X X#include "cvt.c" X#endif X X#ifdef JOS_COMPAT Xstatic char _js_nan[] = "(NaN)"; Xstatic char _js_inf[] = "(Infinity)"; X#else Xstatic char _js_nan[] = "nan"; Xstatic char _js_inf[] = "inf"; X#endif X Xstatic int _ferr __PR((char *, double, int)); X Xstatic int _ecv __PR((char *s, char *b, int fieldwidth, int ndigits, X int decpt, int sign, int flags)); Xstatic int _fcv __PR((char *s, char *b, int fieldwidth, int ndigits, X int decpt, int sign, int flags)); X X#endif /* __DO_LONG_DOUBLE__ */ X X#ifdef __DO_LONG_DOUBLE__ X#undef MDOUBLE X#define MDOUBLE long double X#else X#undef MDOUBLE X#define MDOUBLE double X#endif X X#ifdef abs X#undef abs X#endif X#define abs(i) ((i) < 0 ? -(i) : (i)) X XEXPORT int Xftoes(s, val, fieldwidth, ndigits) X register char *s; X MDOUBLE val; X register int fieldwidth; X register int ndigits; X{ X int flags = 0; X X if (ndigits < 0) { X ndigits = -ndigits; X flags |= UPPERFLG; X } X return (_ftoes(s, val, fieldwidth, ndigits, flags)); X} X XEXPORT int X_ftoes(s, val, fieldwidth, ndigits, flags) X register char *s; X MDOUBLE val; X register int fieldwidth; X register int ndigits; X int flags; X{ X register char *b; X register int len; X register int rdecpt; X int decpt; X int sign; X#ifdef __DO_LONG_DOUBLE__ X int Efmt = FALSE; X X if (flags & UPPERFLG) X Efmt = TRUE; X#endif X#ifndef __DO_LONG_DOUBLE__ X if ((len = _ferr(s, val, flags)) > 0) X return (len); X#endif X#ifdef V7_FLOATSTYLE X b = ecvt(val, ndigits, &decpt, &sign); X rdecpt = decpt; X#else X b = ecvt(val, ndigits+1, &decpt, &sign); X rdecpt = decpt-1; X#endif X#ifdef __DO_LONG_DOUBLE__ X len = *b; X if (len == '-' || len == '+') X len = b[1]; X if (len < '0' || len > '9') { /* Inf/NaN */ X char *p; X X for (p = b; *p; p++) X *s++ = Efmt ? toupper(*p) : *p; X *s = '\0'; X return (strlen(b)); X } X#endif X return (_ecv(s, b, fieldwidth, ndigits, rdecpt, sign, flags)); X} X X#ifndef __DO_LONG_DOUBLE__ Xint X_ecv(s, b, fieldwidth, ndigits, rdecpt, sign, flags) X register char *s; X register char *b; X register int fieldwidth; X register int ndigits; X register int rdecpt; X int sign; X int flags; X{ X register int len; X register char *rs = s; X char dpoint; X char *pp; X X#if defined(HAVE_LOCALECONV) && defined(USE_LOCALE) X dpoint = *(localeconv()->decimal_point); X#else X dpoint = '.'; X#endif X len = ndigits + 6; /* Punkt e +/- nnn */ X if (sign) X len++; X else if (flags & PLUSFLG) X len++; X else if (flags & SPACEFLG) X len++; X if ((flags & PADZERO) == 0 && fieldwidth > len) { X while (fieldwidth-- > len) X *rs++ = ' '; X } X if (sign) X *rs++ = '-'; X else if (flags & PLUSFLG) X *rs++ = '+'; X else if (flags & SPACEFLG) X *rs++ = ' '; X if ((flags & PADZERO) && fieldwidth > len) { X while (fieldwidth-- > len) X *rs++ = '0'; X } X#ifndef V7_FLOATSTYLE X if (*b) X *rs++ = *b++; X#endif X pp = rs; X if ((flags & HASHFLG) || ndigits != 0) /* Add '.'? */ X *rs++ = dpoint; X X while (*b && ndigits-- > 0) X *rs++ = *b++; X if (flags & STRIPZERO) { X register char *rpp = pp; X X while (--rs > rpp) { X if (*rs != '0') X break; X } X if (*rs == dpoint) X rs--; X rs++; X } X if (flags & UPPERFLG) X *rs++ = 'E'; X else X *rs++ = 'e'; X *rs++ = rdecpt >= 0 ? '+' : '-'; X rdecpt = abs(rdecpt); X#ifdef HAVE_LONGDOUBLE X if (rdecpt >= 1000) { /* Max-Exp is > 4000 */ X *rs++ = rdecpt / 1000 + '0'; X rdecpt %= 1000; X } X#endif X#ifndef V7_FLOATSTYLE X if (rdecpt >= 100) X#endif X { X *rs++ = rdecpt / 100 + '0'; X rdecpt %= 100; X } X *rs++ = rdecpt / 10 + '0'; X *rs++ = rdecpt % 10 + '0'; X *rs = '\0'; X return (rs - s); X} X#endif /* __DO_LONG_DOUBLE__ */ X X X/* X * fcvt() from Cygwin32 is buggy. X */ X#if !defined(HAVE_FCVT) && defined(HAVE_ECVT) X#define USE_ECVT X#endif X XEXPORT int Xftofs(s, val, fieldwidth, ndigits) X register char *s; X MDOUBLE val; X register int fieldwidth; X register int ndigits; X{ X int flags = 0; X X if (ndigits < 0) { X ndigits = -ndigits; X flags |= UPPERFLG; X } X return (_ftofs(s, val, fieldwidth, ndigits, flags)); X} X XEXPORT int X_ftofs(s, val, fieldwidth, ndigits, flags) X register char *s; X MDOUBLE val; X register int fieldwidth; X register int ndigits; X int flags; X{ X register char *b; X register int len; X int decpt; X int sign; X#ifdef __DO_LONG_DOUBLE__ X int Ffmt = FALSE; X X if (flags & UPPERFLG) X Ffmt = TRUE; X#endif X#ifndef __DO_LONG_DOUBLE__ X if ((len = _ferr(s, val, flags)) > 0) X return (len); X#endif X#ifdef USE_ECVT X /* X * Needed on systems with broken fcvt() implementation X * (e.g. Cygwin32) X */ X b = ecvt(val, ndigits, &decpt, &sign); X /* X * The next call is needed to force higher precision. X */ X if (decpt > 0) X b = ecvt(val, ndigits+decpt, &decpt, &sign); X#else X b = fcvt(val, ndigits, &decpt, &sign); X#endif X#ifdef __DO_LONG_DOUBLE__ X len = *b; X if (len == '-' || len == '+') X len = b[1]; X if (len < '0' || len > '9') { /* Inf/NaN */ X char *p; X X for (p = b; *p; p++) X *s++ = Ffmt ? toupper(*p) : *p; X *s = '\0'; X return (strlen(b)); X } X#endif X return (_fcv(s, b, fieldwidth, ndigits, decpt, sign, flags)); X} X X#ifndef __DO_LONG_DOUBLE__ XLOCAL int X_fcv(s, b, fieldwidth, ndigits, rdecpt, sign, flags) X register char *s; X register char *b; X register int fieldwidth; X register int ndigits; X register int rdecpt; X int sign; X int flags; X{ X register int len; X register char *rs = s; X char dpoint; X char *pp; X X#if defined(HAVE_LOCALECONV) && defined(USE_LOCALE) X dpoint = *(localeconv()->decimal_point); X#else X dpoint = '.'; X#endif X X len = rdecpt + ndigits + 1; X if (rdecpt < 0) X len -= rdecpt; X if (sign) X len++; X else if (flags & PLUSFLG) X len++; X else if (flags & SPACEFLG) X len++; X if ((flags & PADZERO) == 0 && fieldwidth > len) { X while (fieldwidth-- > len) X *rs++ = ' '; X } X if (sign) X *rs++ = '-'; X else if (flags & PLUSFLG) X *rs++ = '+'; X else if (flags & SPACEFLG) X *rs++ = ' '; X if ((flags & PADZERO) && fieldwidth > len) { X while (fieldwidth-- > len) X *rs++ = '0'; X } X if (rdecpt > 0) { X len = rdecpt; X while (*b && len-- > 0) X *rs++ = *b++; X#ifdef USE_ECVT X while (len-- > 0) X *rs++ = '0'; X#endif X } X#ifndef V7_FLOATSTYLE X else { X *rs++ = '0'; X } X#endif X pp = rs; X if ((flags & HASHFLG) || ndigits != 0) /* Add '.'? */ X *rs++ = dpoint; X X if (rdecpt < 0) { X len = rdecpt; X while (len++ < 0 && ndigits-- > 0) X *rs++ = '0'; X } X while (*b && ndigits-- > 0) X *rs++ = *b++; X if (flags & STRIPZERO) { X register char *rpp = pp; X X while (--rs > rpp) { X if (*rs != '0') X break; X } X if (*rs == dpoint) X rs--; X rs++; X } else { X#ifdef USE_ECVT X while (ndigits-- > 0) X *rs++ = '0'; X#endif X } X *rs = '\0'; X return (rs - s); X} X#endif /* __DO_LONG_DOUBLE__ */ X XEXPORT int X_ftogs(s, val, fieldwidth, ndigits, flags) X register char *s; X MDOUBLE val; X register int fieldwidth; X register int ndigits; X int flags; X{ X register char *b; X register int len; X int decpt; X int sign; X#ifdef __DO_LONG_DOUBLE__ X int Gfmt = FALSE; X X if (flags & UPPERFLG) X Gfmt = TRUE; X#endif X#ifndef __DO_LONG_DOUBLE__ X if ((len = _ferr(s, val, flags)) > 0) X return (len); X#endif X b = ecvt(val, ndigits, &decpt, &sign); X#ifdef __DO_LONG_DOUBLE__ X len = *b; X if (len == '-' || len == '+') X len = b[1]; X if (len < '0' || len > '9') { /* Inf/NaN */ X char *p; X X for (p = b; *p; p++) X *s++ = Gfmt ? toupper(*p) : *p; X *s = '\0'; X return (strlen(b)); X } X#endif X if ((flags & HASHFLG) == 0) X flags |= STRIPZERO; X#ifdef V7_FLOATSTYLE X if ((decpt >= 0 && decpt-ndigits > 4) || X#else X if ((decpt >= 0 && decpt-ndigits > 0) || X#endif X (decpt < -3)) { /* e-format */ X decpt--; X return (_ecv(s, b, fieldwidth, ndigits, decpt, sign, flags)); X } else { /* f-format */ X ndigits -= decpt; X return (_fcv(s, b, fieldwidth, ndigits, decpt, sign, flags)); X } X} X X X#ifndef __DO_LONG_DOUBLE__ X X#ifdef HAVE_LONGDOUBLE X#ifdef HAVE__LDECVT X#define qecvt(ld, n, dp, sp) _ldecvt(*(long_double *)&ld, n, dp, sp) X#endif X#ifdef HAVE__LDFCVT X#define qfcvt(ld, n, dp, sp) _ldfcvt(*(long_double *)&ld, n, dp, sp) X#endif X X#if (defined(HAVE_QECVT) || defined(HAVE__LDECVT)) && \ X (defined(HAVE_QFCVT) || defined(HAVE__LDFCVT)) X#define __DO_LONG_DOUBLE__ X#define ftoes qftoes X#define ftofs qftofs X#define _ftoes _qftoes X#define _ftofs _qftofs X#define _ftogs _qftogs X#define ecvt qecvt X#define fcvt qfcvt X#include "fconv.c" X#undef __DO_LONG_DOUBLE__ X#endif X#endif /* HAVE_LONGDOUBLE */ X X/* X * Be careful to avoid a GCC bug: while (*s) *s++ = toupper(*s) is converted X * to while (*s++) *s = toupper(*s). X */ XLOCAL int X_ferr(s, val, flags) X char *s; X double val; X int flags; X{ X char *old = s; X char *p; X int upper; X X upper = flags & UPPERFLG; X if (isnan(val)) { X if (val < 0) /* Should not happen */ X *s++ = '-'; X else if (flags & PLUSFLG) X *s++ = '+'; X for (p = _js_nan; *p; p++) X *s++ = upper ? toupper(*p) : *p; X *s = '\0'; X return (s - old); X } X X /* X * Check first for NaN because finite() will return 1 on Nan too. X */ X if (isinf(val)) { X if (val < 0) X *s++ = '-'; X else if (flags & PLUSFLG) X *s++ = '+'; X for (p = _js_inf; *p; p++) X *s++ = upper ? toupper(*p) : *p; X *s = '\0'; X return (s - old); X } X return (0); X} X#endif /* __DO_LONG_DOUBLE__ */ X#endif /* NO_FLOATINGPOINT */ END-of-star-1.6/libschily/fconv.c echo x - star-1.6/libschily/fillbytes.c sed 's/^X//' >star-1.6/libschily/fillbytes.c << 'END-of-star-1.6/libschily/fillbytes.c' X/* @(#)fillbytes.c 1.18 10/08/21 Copyright 1987, 1995-2010 J. Schilling */ X/* X * fill memory with data X * X * Copyright (c) 1987, 1995-2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X X#define DO8(a) a; a; a; a; a; a; a; a; X X#define cval ((char)lval) X X/* X * fillbytes(to, cnt, val) is the same as memset(to, val, cnt) X */ X#ifdef PROTOTYPES XEXPORT char * Xfillbytes(void *tov, ssize_t cnt, char val) X#else XEXPORT char * Xfillbytes(tov, cnt, val) X void *tov; X ssize_t cnt; X char val; X#endif X{ X register char *to = (char *)tov; X register ssize_t n; X register long lval; X X /* X * If we change cnt to be unsigned, check for == instead of <= X */ X if ((n = cnt) <= 0) X return (to); X X lval = val & 0xFF; X X /* X * Assign byte-wise until properly aligned for a long pointer. X */ X while (--n >= 0 && !laligned(to)) { X *to++ = cval; X } X n++; X X if (n >= (ssize_t)(8 * sizeof (long))) { X register ssize_t rem = n % (8 * sizeof (long)); X X lval |= (lval<<8); X lval |= (lval<<16); X#if SIZE_LONG > SIZE_INT X lval |= (lval<<32); X#endif X X n /= (8 * sizeof (long)); X { X register long *tol = (long *)to; X X do { X DO8 (*tol++ = lval); X } while (--n > 0); X X to = (char *)tol; X } X n = rem; X X if (n >= 8) { X n -= 8; X do { X DO8 (*to++ = cval); X } while ((n -= 8) >= 0); X n += 8; X } X if (n > 0) do { X *to++ = cval; X } while (--n > 0); X return (to); X } X if (n > 0) do { X *to++ = cval; X } while (--n > 0); X return (to); X} END-of-star-1.6/libschily/fillbytes.c echo x - star-1.6/libschily/printf.c sed 's/^X//' >star-1.6/libschily/printf.c << 'END-of-star-1.6/libschily/printf.c' X/* @(#)printf.c 1.17 09/07/10 Copyright 1985, 1989, 1995-2003 J. Schilling */ X/* X * Copyright (c) 1985, 1989, 1995-2003 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X X#ifdef printf X# define __no_undef__ X#else X# define printf __nothing__ X#endif X#ifdef fprintf X# define __no_undef2__ X#else X# define fprintf __nothing2__ X#endif X X#include X#include X#include X#include X X#ifndef __no_undef__ X# undef printf X#endif X#ifndef __no_undef2__ X# undef fprintf X#endif X X#define BFSIZ 256 X Xtypedef struct { X short cnt; X char *ptr; X char buf[BFSIZ]; X int count; X FILE *f; X} *BUF, _BUF; X XLOCAL void _bflush __PR((BUF)); XLOCAL void _bput __PR((char, long)); XEXPORT int fprintf __PR((FILE *, const char *, ...)) __printflike__(2, 3); XEXPORT int printf __PR((const char *, ...)) __printflike__(1, 2); X XLOCAL void X_bflush(bp) X register BUF bp; X{ X bp->count += bp->ptr - bp->buf; X if (filewrite(bp->f, bp->buf, bp->ptr - bp->buf) < 0) X bp->count = EOF; X bp->ptr = bp->buf; X bp->cnt = BFSIZ; X} X X#ifdef PROTOTYPES XLOCAL void X_bput(char c, long l) X#else XLOCAL void X_bput(c, l) X char c; X long l; X#endif X{ X register BUF bp = (BUF)l; X X *bp->ptr++ = c; X if (--bp->cnt <= 0) X _bflush(bp); X} X X/* VARARGS1 */ X#ifdef PROTOTYPES XEXPORT int Xprintf(const char *form, ...) X#else XEXPORT int Xprintf(form, va_alist) X char *form; X va_dcl X#endif X{ X va_list args; X _BUF bb; X X bb.ptr = bb.buf; X bb.cnt = BFSIZ; X bb.count = 0; X bb.f = stdout; X#ifdef PROTOTYPES X va_start(args, form); X#else X va_start(args); X#endif X format(_bput, (long)&bb, form, args); X va_end(args); X if (bb.cnt < BFSIZ) X _bflush(&bb); X return (bb.count); X} X X/* VARARGS2 */ X#ifdef PROTOTYPES XEXPORT int Xfprintf(FILE *file, const char *form, ...) X#else XEXPORT int Xfprintf(file, form, va_alist) X FILE *file; X char *form; X va_dcl X#endif X{ X va_list args; X _BUF bb; X X bb.ptr = bb.buf; X bb.cnt = BFSIZ; X bb.count = 0; X bb.f = file; X#ifdef PROTOTYPES X va_start(args, form); X#else X va_start(args); X#endif X format(_bput, (long)&bb, form, args); X va_end(args); X if (bb.cnt < BFSIZ) X _bflush(&bb); X return (bb.count); X} END-of-star-1.6/libschily/printf.c echo x - star-1.6/libschily/saveargs.c sed 's/^X//' >star-1.6/libschily/saveargs.c << 'END-of-star-1.6/libschily/saveargs.c' X/* @(#)saveargs.c 1.16 10/11/18 Copyright 1995-2010 J. Schilling */ X/* X * save argc, argv for command error printing routines X * X * Copyright (c) 1995-2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X#include X X#if !defined(AV_OFFSET) || !defined(FP_INDIR) X# ifdef HAVE_SCANSTACK X# undef HAVE_SCANSTACK X# endif X#endif X X#ifdef HAVE_VAR___PROGNAME Xextern char *__progname; X#ifdef HAVE_VAR___PROGNAME_FULL Xextern char *__progname_full; X#else X#define __progname_full __progname X#endif X#endif X Xstatic int ac_saved; Xstatic char **av_saved; Xstatic char *av0_saved; Xstatic char *av0_name_saved; Xstatic char *progpath_saved; Xstatic char *progname_saved; X Xstatic char av0_sp[32]; /* av0 space, avoid malloc() in most cases */ Xstatic char prn_sp[32]; /* name space, avoid malloc() in most cases */ Xstatic char dfl_str[] = "?"; X XLOCAL void save_av0 __PR((char *av0)); XLOCAL void init_progname __PR((void)); XLOCAL void init_arginfo __PR((void)); X XEXPORT void Xsave_args(ac, av) X int ac; X char *av[]; X{ X ac_saved = ac; X av_saved = av; X save_av0(av[0]); X} X XLOCAL void Xsave_av0(av0) X char *av0; X{ X int slen; X char *p; X X if (av0_saved && av0_saved != av0_sp) X free(av0_saved); X X slen = strlen(av0) + 1; X X if (slen <= (int)sizeof (av0_sp)) X av0_saved = av0_sp; X else X av0_saved = malloc(slen); X X if (av0_saved) { X strcpy(av0_saved, av0); X av0 = av0_saved; X } X X if ((p = strrchr(av0, '/')) == NULL) X av0_name_saved = av0; X else X av0_name_saved = ++p; X} X XEXPORT int Xsaved_ac() X{ X if (av_saved == NULL) X init_arginfo(); X X return (ac_saved); X} X XEXPORT char ** Xsaved_av() X{ X if (av_saved == NULL) X init_arginfo(); X X return (av_saved); X} X XEXPORT char * Xsaved_av0() X{ X if (av0_saved == NULL) X init_arginfo(); X X return (av0_saved); X} X XEXPORT void Xset_progname(name) X const char *name; X{ X int slen; X char *p; X X if (progpath_saved && progpath_saved != prn_sp) X free(progpath_saved); X X slen = strlen(name) + 1; X X if (slen <= sizeof (prn_sp)) X progpath_saved = prn_sp; X else X progpath_saved = malloc(slen); X X if (progpath_saved) { X strcpy(progpath_saved, name); X name = progpath_saved; X } X X if ((p = strrchr(name, '/')) == NULL) X progname_saved = (char *)name; X else X progname_saved = ++p; X} X XEXPORT char * Xget_progname() X{ X if (progname_saved) X return (progname_saved); X if (av0_name_saved == NULL) X init_progname(); X if (av0_name_saved) X return (av0_name_saved); X return (dfl_str); X} X XEXPORT char * Xget_progpath() X{ X if (progpath_saved) X return (progpath_saved); X if (av0_saved == NULL) X init_progname(); X if (av0_saved) X return (av0_saved); X return (dfl_str); X} X XLOCAL void Xinit_progname() X{ X#if defined(HAVE_SCANSTACK) || defined(HAVE_GETPROGNAME) X char *progname; X#endif X X if (av0_name_saved == NULL) X init_arginfo(); X if (av0_name_saved) X return; X#ifdef HAVE_GETPROGNAME X progname = (char *)getprogname(); X if (progname) { X save_av0(progname); X return; X } X#endif X#ifdef HAVE_VAR___PROGNAME X if (__progname_full) { X save_av0(__progname_full); X return; X } X#endif X#ifdef HAVE_SCANSTACK X progname = getav0(); /* scan stack to get argv[0] */ X if (progname) { X save_av0(progname); X return; X } X#endif X} X XLOCAL void Xinit_arginfo() X{ X#if defined(HAVE_DLINFO) && defined(HAVE_DLOPEN_IN_LIBC) && defined(RTLD_DI_ARGSINFO) X Dl_argsinfo args; X X if (dlinfo(RTLD_SELF, RTLD_DI_ARGSINFO, &args) < 0 || X args.dla_argc <= 0 || X args.dla_argv[0] == NULL) X return; X X if (av_saved == NULL) X save_args(args.dla_argc, args.dla_argv); X#endif X} END-of-star-1.6/libschily/saveargs.c echo x - star-1.6/libschily/streql.c sed 's/^X//' >star-1.6/libschily/streql.c << 'END-of-star-1.6/libschily/streql.c' X/* @(#)streql.c 1.10 09/06/07 Copyright 1985, 1995-2009 J. Schilling */ X/* X * Check if two strings are equal X * X * Copyright (c) 1985, 1995-2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X XEXPORT int Xstreql(a, b) X const char *a; X const char *b; X{ X register const char *s1 = a; X register const char *s2 = b; X X if (s1 == NULL || s2 == NULL) X return (FALSE); X X if (s1 == s2) X return (TRUE); X X while (*s1 == *s2++) X if (*s1++ == '\0') X return (TRUE); X X return (FALSE); X} END-of-star-1.6/libschily/streql.c echo x - star-1.6/libschily/getargs.c sed 's/^X//' >star-1.6/libschily/getargs.c << 'END-of-star-1.6/libschily/getargs.c' X/* @(#)getargs.c 2.78 18/04/21 Copyright 1985, 1988, 1994-2018 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)getargs.c 2.78 18/04/21 Copyright 1985, 1988, 1994-2018 J. Schilling"; X#endif X#define NEW X/* X * Copyright (c) 1985, 1988, 1994-2018 J. Schilling X * X * 1.3.88 Start implementation of release 2 X */ X/* X * Parse arguments on a command line. X * Format string type specifier (appearing directly after flag name): X * '' BOOL size int set to TRUE (1) X * '%' Extended format, next char determines the type: X * '%0' BOOL with size modifier set to FALSE (0) X * '%1' BOOL with size modifier set to TRUE(1) X * '*' string X * '?' char X * '#' number X * '&' call function for any type flag X * '~' call function for BOOLEAN flag X * '+' inctype +++ NEU +++ X * X * The format string 'f* ' may be used to disallow -ffoo for f* X * The same behavior is implemented for 'f# ', 'f? ' and 'f& '. X * The ' ' needs to immediately follow the format type specifier. X * X * The format string 'f*_' may be used to disallow -f foo for f* X * The same behavior is implemented for 'f#_', 'f?_' and 'f&_'. X * The '_' needs to immediately follow the format type specifier. X * This also allows to implement optional arguments to options. X * Note: 'f#_' is only implemented for orthogonality, -f will X * be converted to an integer value of 0. X * X * The '#', '+' and '%[01]' types may have size modifiers added: X * 'c'/'C' char X * 's'/'S' short X * 'i'/'I' int (default == no size modifier) X * 'l'/'L' long X * 'll'/'LL' long long X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X/* LINTLIBRARY */ X#include X#include X#include X#include X#include X#include X#include X#include X X/* X * Various return values X */ X#define RETMAX 2 /* Max. value for getargerror() */ X#define FLAGDELIM 2 /* "--" stopped flag processing */ X#define NOTAFLAG 1 /* Not a flag type argument */ X#define NOARGS 0 /* No more args */ X#define BADFLAG (-1) /* Not a valid flag argument */ X#define BADFMT (-2) /* Error in format string */ X#define NOTAFILE (-3) /* Seems to be a flag type arg */ X#define RETMIN (-3) /* Min. value for getargerror() */ X XLOCAL char *retnames[] = { X "NOTAFILE", X "BADFMT", X "BADFLAG", X "NOARGS", X "NOTAFLAG", X "FLAGDELIM", X}; X#define RNAME(a) (retnames[(a)-RETMIN]) X X#define SCANONLY 0 /* Do not try to set argument values */ X#define SETARGS 1 /* Set argument values from cmdline */ X#define CHECKARGS 2 /* To not update argv and argc */ X#define ARGVECTOR 4 /* Use vector instead of list interface */ X#define NOEQUAL 8 /* -opt=val not allowed for -opt val */ X#define SINGLEARG 16 /* Last singlechar opt may have arg */ X XLOCAL struct ga_props *_getprops __PR((struct ga_props *)); X X int _getargs __PR((int *, char *const **, void *, X int, X struct ga_props *, X va_list)); XLOCAL int dofile __PR((int *, char *const **, const char **, X struct ga_props *)); XLOCAL int doflag __PR((int *, char *const **, const char *, X void *, int, va_list)); XLOCAL int dosflags __PR((const char *, void *, X int *, char *const **, X int, va_list)); XLOCAL int checkfmt __PR((const char *)); XLOCAL int checkeql __PR((const char *)); X XLOCAL va_list va_dummy; X XLOCAL char fmtspecs[] = "#?*&~+%"; X X#define isfmtspec(c) (strchr(fmtspecs, c) != NULL) X XLOCAL struct ga_props props_default = { 0, 0, sizeof (struct ga_props) }; XLOCAL struct ga_props props_posix = { GAF_POSIX_DEFAULT, 0, sizeof (struct ga_props) }; X XEXPORT int X_getarginit(props, size, flags) X struct ga_props *props; X size_t size; X UInt32_t flags; X{ X if (size > sizeof (struct ga_props)) X return (-1); X X /* X * GAF_POSIX may be used as an alias for the flags that currently X * define POSIX behavior. X */ X if (flags == GAF_POSIX) X flags = GAF_POSIX_DEFAULT; X X props->ga_flags = flags; X props->ga_oflags = 0; X props->ga_size = size; X return (0); X} X XLOCAL struct ga_props * X_getprops(props) X struct ga_props *props; X{ X if (props == GA_NO_PROPS) X props = &props_default; X else if (props == GA_POSIX_PROPS) X props = &props_posix; X props->ga_oflags = 0; X /* X * GAF_POSIX may be used as an alias for the flags that currently X * define POSIX behavior. X */ X if (props->ga_flags == GAF_POSIX) X props->ga_flags = GAF_POSIX_DEFAULT; X X return (props); X} X X/* X * get flags until a non flag type argument is reached (old version) X */ X/* VARARGS3 */ X#ifdef PROTOTYPES XEXPORT int Xgetargs(int *pac, char *const **pav, const char *fmt, ...) X#else XEXPORT int Xgetargs(pac, pav, fmt, va_alist) X int *pac; X char **pav[]; X char *fmt; X va_dcl X#endif X{ X va_list args; X int ret; X X#ifdef PROTOTYPES X va_start(args, fmt); X#else X va_start(args); X#endif X ret = _getargs(pac, pav, (void *)fmt, SETARGS, GA_NO_PROPS, args); X va_end(args); X return (ret); X} X X X/* X * get flags until a non flag type argument is reached (list version) X */ X/* VARARGS4 */ X#ifdef PROTOTYPES XEXPORT int Xgetlargs(int *pac, char *const **pav, struct ga_props *props, const char *fmt, ...) X#else XEXPORT int Xgetlargs(pac, pav, props, fmt, va_alist) X int *pac; X char **pav[]; X struct ga_props *props; X char *fmt; X va_dcl X#endif X{ X va_list args; X int ret; X X#ifdef PROTOTYPES X va_start(args, fmt); X#else X va_start(args); X#endif X ret = _getargs(pac, pav, (void *)fmt, SETARGS, props, args); X va_end(args); X return (ret); X} X X X/* X * get flags until a non flag type argument is reached (vector version) X */ XEXPORT int Xgetvargs(pac, pav, props, vfmt) X int *pac; X char * const *pav[]; X struct ga_props *props; X struct ga_flags *vfmt; X{ X return (_getargs(pac, pav, vfmt, SETARGS | ARGVECTOR, props, va_dummy)); X} X X X/* X * get all flags on the command line, do not stop on files (old version) X */ X/* VARARGS3 */ X#ifdef PROTOTYPES XEXPORT int Xgetallargs(int *pac, char *const **pav, const char *fmt, ...) X#else XEXPORT int Xgetallargs(pac, pav, fmt, va_alist) X int *pac; X char **pav[]; X char *fmt; X va_dcl X#endif X{ X va_list args; X int ret; X X#ifdef PROTOTYPES X va_start(args, fmt); X#else X va_start(args); X#endif X for (; ; (*pac)--, (*pav)++) { X if ((ret = _getargs(pac, pav, (void *)fmt, SETARGS, GA_NO_PROPS, args)) < NOTAFLAG) X break; X } X va_end(args); X return (ret); X} X X X/* X * get all flags on the command line, do not stop on files (list version) X */ X/* VARARGS4 */ X#ifdef PROTOTYPES XEXPORT int Xgetlallargs(int *pac, char *const **pav, struct ga_props *props, const char *fmt, ...) X#else XEXPORT int Xgetlallargs(pac, pav, props, fmt, va_alist) X int *pac; X char **pav[]; X struct ga_props *props; X char *fmt; X va_dcl X#endif X{ X va_list args; X int ret; X X#ifdef PROTOTYPES X va_start(args, fmt); X#else X va_start(args); X#endif X props = _getprops(props); X for (; ; (*pac)--, (*pav)++) { X if ((ret = _getargs(pac, pav, (void *)fmt, SETARGS, props, args)) < NOTAFLAG) X break; X /* X * The default is to parse all options on the command line and X * to let "--" only make the next argument a non-option. X */ X if (ret == FLAGDELIM && (props->ga_flags & GAF_DELIM_DASHDASH)) X break; X } X va_end(args); X return (ret); X} X X X/* X * get all flags on the command line, do not stop on files (vector version) X */ XEXPORT int Xgetvallargs(pac, pav, props, vfmt) X int *pac; X char * const *pav[]; X struct ga_props *props; X struct ga_flags *vfmt; X{ X int ret; X X props = _getprops(props); X for (; ; (*pac)--, (*pav)++) { X if ((ret = _getargs(pac, pav, vfmt, SETARGS | ARGVECTOR, props, va_dummy)) < NOTAFLAG) X break; X /* X * The default is to parse all options on the command line and X * to let "--" only make the next argument a non-option. X */ X if (ret == FLAGDELIM && (props->ga_flags & GAF_DELIM_DASHDASH)) X break; X } X return (ret); X} X X X/* X * get next non flag type argument (i.e. a file) (old version) X * getfiles() is a dry run getargs() X */ XEXPORT int Xgetfiles(pac, pav, fmt) X int *pac; X char *const *pav[]; X const char *fmt; X{ X return (_getargs(pac, pav, (void *)fmt, SCANONLY, GA_NO_PROPS, va_dummy)); X} X X X/* X * get next non flag type argument (i.e. a file) (list version) X * getlfiles() is a dry run getlargs() X */ XEXPORT int Xgetlfiles(pac, pav, props, fmt) X int *pac; X char *const *pav[]; X struct ga_props *props; X const char *fmt; X{ X return (_getargs(pac, pav, (void *)fmt, SCANONLY, props, va_dummy)); X} X X X/* X * get next non flag type argument (i.e. a file) (vector version) X * getvfiles() is a dry run getvargs() X */ XEXPORT int Xgetvfiles(pac, pav, props, vfmt) X int *pac; X char *const *pav[]; X struct ga_props *props; X struct ga_flags *vfmt; X{ X return (_getargs(pac, pav, vfmt, SCANONLY | ARGVECTOR, props, va_dummy)); X} X X X/* X * check args until the next non flag type argmument is reached X * *pac is decremented, *pav is incremented so that the X * non flag type argument is at *pav[0] X * X * return code: X * +2 FLAGDELIM "--" stopped flag processing X * +1 NOTAFLAG not a flag type argument (is a file) X * 0 NOARGS no more args X * -1 BADFLAG a non-matching flag type argument X * -2 BADFMT bad syntax in format string X */ X/* LOCAL int */ XEXPORT int X_getargs(pac, pav, vfmt, flags, props, args) X register int *pac; X register char *const **pav; X void *vfmt; X int flags; X struct ga_props *props; X va_list args; X{ X const char *argp; X int ret; X X X props = _getprops(props); X X if (props->ga_flags & GAF_NO_EQUAL) X flags |= NOEQUAL; X if (props->ga_flags & GAF_SINGLEARG) X flags |= SINGLEARG; X X for (; *pac > 0; (*pac)--, (*pav)++) { X argp = **pav; X X ret = dofile(pac, pav, &argp, props); X X if (ret != NOTAFILE) X return (ret); X X ret = doflag(pac, pav, argp, vfmt, flags, args); X X if (ret != NOTAFLAG) X return (ret); X } X return (NOARGS); X} X X X/* X * check if *pargp is a file type argument X */ XLOCAL int Xdofile(pac, pav, pargp, props) X register int *pac; X register char *const **pav; X const char **pargp; X struct ga_props *props; X{ X register const char *argp = *pargp; X X X if (argp[0] == '-') { X /* X * "-" is a special non flag type argument X * that usually means take stdin instead of a named file X */ X if (argp[1] == '\0') X return (NOTAFLAG); X /* X * "--" is a prefix to take the next argument X * as non flag type argument X * NOTE: POSIX requires "--" to indicate the end of the X * flags on the command line. Programs that like to be X * 100% POSIX compliant call only get[lv]args() once X * and then process the list of files from cav[0]. X */ X if (argp[1] == '-' && argp[2] == '\0') { X if (--(*pac) > 0) { X (*pav)++; X return (FLAGDELIM); X } else { X return (NOARGS); X } X } X } X X /* X * Now check if it may be flag type argument at all. X * Flag type arguments begin with a '-', a '+' or contain a '=' X * i.e. -flag +flag or flag= X * The behavior here may be controlled by props->ga_flags to X * allow getargs() to e.g. behave fully POSIX compliant. X */ X if (argp[0] != '-') { X if (argp[0] == '+' && (props->ga_flags & GAF_NO_PLUS) == 0) X return (NOTAFILE); /* This is a flag type arg */ X X /* X * If 'flag=value' is not allowed at all, speed things up X * and do not call checkeql() to check for '='. X */ X if (props->ga_flags & GAF_NO_EQUAL) X return (NOTAFLAG); X if (checkeql(argp) && (props->ga_flags & GAF_NEED_DASH) == 0) X return (NOTAFILE); /* This is a flag type arg */ X return (NOTAFLAG); X } X return (NOTAFILE); /* This is a flag type arg */ X} X X X/* X * compare argp with the format string X * if a match is found store the result a la scanf in one of the X * arguments pointed to in the va_list X * X * If (flags & SETARGS) == 0, only check arguments for getfiles() X * In case that (flags & SETARGS) == 0 or that (flags & ARGVECTOR) != 0, X * va_list may be a dummy argument. X */ XLOCAL int Xdoflag(pac, pav, argp, vfmt, flags, oargs) X int *pac; X char *const **pav; X register const char *argp; X void *vfmt; X int flags; X va_list oargs; X{ X register const char *fmt = (const char *)vfmt; X struct ga_flags *flagp = vfmt; X const char *fmtp; X long val; X Llong llval; X int singlecharflag = 0; X BOOL isspec; X BOOL hasdash = FALSE; X BOOL doubledash = FALSE; X BOOL haseql = checkeql(argp); X const char *sargp; X const char *sfmt; X va_list args; X char *const *spav = *pav; X int spac = *pac; X void *curarg = (void *)0; X X sfmt = fmt; X /* X * flags beginning with '-' don't have to include the '-' in X * the format string. X * flags beginning with '+' have to include it in the format string. X */ X if (argp[0] == '-') { X argp++; X hasdash = TRUE; X /* X * Implement legacy support for --longopt X * If we find a double dash, we do not look for combinations X * of boolean single char flags. X */ X if (argp[0] == '-') { X argp++; X doubledash = TRUE; X /* X * Allow -- only for long options. X */ X if (argp[1] == '\0') { X return (BADFLAG); X } X } X } X sargp = argp; X X /* X * Initialize 'args' to the start of the argument list. X * I don't know any portable way to copy an arbitrary X * C object so I use a system-specific routine X * (probably a macro) from stdarg.h. (Remember that X * if va_list is an array, 'args' will be a pointer X * and '&args' won't be what I would need for memcpy.) X * It is a system requirement for SVr4 compatibility X * to be able to do this assgignement. If your system X * defines va_list to be an array but does not define X * va_copy() you are lost. X * This is needed to make sure, that 'oargs' will not X * be clobbered. X */ X va_copy(args, oargs); X X if (flags & ARGVECTOR) { X sfmt = fmt = flagp->ga_format; X if (fmt == NULL) X sfmt = fmt = ""; X if (flags & SETARGS) X curarg = flagp->ga_arg; X } else if (flags & SETARGS) { X curarg = va_arg(args, void *); X } X /* X * check if the first flag in format string is a singlechar flag X */ Xagain: X if (fmt[0] != '\0' && X (fmt[1] == ',' || fmt[1] == '+' || X fmt[1] == '~' || fmt[1] == '%' || fmt[1] == '\0')) X singlecharflag++; X /* X * check the whole format string for a match X */ X for (;;) { X for (; *fmt; fmt++, argp++) { X if (*fmt == '\\') { X /* X * Allow "#?*&+" to appear inside a flag. X * NOTE: they must be escaped by '\\' only X * inside the the format string. X */ X fmt++; X isspec = FALSE; X } else { X isspec = isfmtspec(*fmt); X } X /* X * If isspec is TRUE, the arg beeing checked starts X * like a valid flag. Argp now points to the rest. X */ X if (isspec) { X /* X * If *argp is '+' and we are on the X * beginning of the arg that is currently X * checked, this cannot be an inc type flag. X */ X if (*argp == '+' && argp == sargp) X continue; X /* X * skip over to arg of flag X */ X if (*argp == '=') { X if (flags & NOEQUAL) X return (BADFLAG); X argp++; X } else if (*argp != '\0' && haseql) { X /* X * Flag and arg are not separated by a X * space. X * Check here for: X * xxxxx=yyyyy match on '&' X * Checked before: X * abc=yyyyy match on 'abc&' X * or 'abc*' X * or 'abc#' X * We come here if 'argp' starts with X * the same sequence as a valid flag X * and contains an equal sign. X * We have tested before if the text X * before 'argp' matches exactly. X * At this point we have no exact match X * and we only allow to match X * the special pattern '&'. X * We need this e.g. for 'make'. X * We allow any flag type argument to X * match the format string "&" to set X * up a function that handles all odd X * stuff that getargs will not grok. X * In addition, to allow getargs to be X * used for CPP type flags we allow to X * match -Dabc=xyz on 'D&'. Note that X * Dabc=xyz will not match 'D&'. X */ X if ((!hasdash && argp != sargp) || *fmt != '&') X goto nextarg; X } X X /* X * The format string 'f* ' may be used X * to disallow -ffoo for f* X * X * The same behavior is implemented for X * 'f# '. 'f? ' and 'f& '. X */ X if (!haseql && *argp != '\0' && X (fmt[0] == '*' || fmt[0] == '#' || X fmt[0] == '?' || fmt[0] == '&') && X fmt[1] == ' ') { X goto nextarg; X } X X /* X * *arpp == '\0' || !haseql X * We come here if 'argp' starts with X * the same sequence as a valid flag. X * This will match on the following args: X * -farg match on 'f*' X * -f12 match on 'f#' X * +12 match on '+#' X * -12 match on '#' X * and all args that are separated from X * their flags. X * In the switch statement below, we check X * if the text after 'argp' (if *argp != 0) or X * the next arg is a valid arg for this flag. X */ X break; X } else if (*fmt == *argp) { X char c; X X if (argp[1] == '\0' && X (fmt[1] == '\0' || fmt[1] == ',')) { X X if (flags & SETARGS) X *((int *)curarg) = TRUE; X X X return (checkfmt(fmt)); /* XXX */ X } X /* X * Check whether the current program argument X * contains characters that are not allowd in X * option names. Check current character. X */ X c = *fmt; X if (c == ',' || (!isalnum(c) && isfmtspec(c))) X goto nextarg; X } else { X /* X * skip over to next format identifier X * & reset arg pointer X */ X nextarg: X while (*fmt != ',' && *fmt != '\0') { X /* function has extra arg on stack */ X if ((*fmt == '&' || *fmt == '~') && X (flags & (SETARGS|ARGVECTOR)) == SETARGS) { X curarg = va_arg(args, void *); X } X fmt++; X } X argp = sargp; X break; X } X } X switch (*fmt) { X X case '\0': X /* X * Boolean type has been tested before. X */ X if (flags & ARGVECTOR) { X if (flagp[1].ga_format != NULL) { X flagp++; X sfmt = fmt = flagp->ga_format; X if (flags & SETARGS) X curarg = flagp->ga_arg; X argp = sargp; X goto again; X } X } X if (singlecharflag && !doubledash && X (val = dosflags(sargp, vfmt, pac, pav, X CHECKARGS | X (flags & ~SETARGS), X va_dummy)) == BADFLAG) { X return (val); X } X if (singlecharflag && !doubledash && X (val = dosflags(sargp, vfmt, pac, pav, X flags, X oargs)) != BADFLAG) { X return (val); X } X return (BADFLAG); X X case ',': X fmt++; X if (fmt[0] == '\0') /* Should we allow "a,b,c,"? */ X return (BADFMT); X if (fmt[1] == ',' || fmt[1] == '+' || fmt[1] == '\0') X singlecharflag++; X if ((flags & (SETARGS|ARGVECTOR)) == SETARGS) X curarg = va_arg(args, void *); X continue; X X case '*': X if (*argp == '\0' && fmt[1] != '_') { X if (*pac > 1) { X (*pac)--; X (*pav)++; X argp = **pav; X } else { X return (BADFLAG); X } X } X if (fmt[1] == '_') /* To disallow -f foo for f* */ X fmt++; X else if (fmt[1] == ' ') /* To disallow -ffoo for f* */ X fmt++; X X if (flags & SETARGS) X *((const char **)curarg) = argp; X X X return (checkfmt(fmt)); X X case '?': X if (*argp == '\0' && fmt[1] != '_') { X if (*pac > 1) { X (*pac)--; X (*pav)++; X argp = **pav; X } else { X return (BADFLAG); X } X } X if (fmt[1] == '_') /* To disallow -f c for f? */ X fmt++; X else if (fmt[1] == ' ') /* To disallow -fc for f? */ X fmt++; X X /* X * Allow -f '' to specify a nul character. X * If more than one char arg, it X * cannot be a character argument. X */ X if (argp[0] != '\0' && argp[1] != '\0') X goto nextchance; X X if (flags & SETARGS) X *((char *)curarg) = *argp; X X X return (checkfmt(fmt)); X X case '+': X /* X * inc type is similar to boolean, X * there is no arg in argp to convert. X */ X if (*argp != '\0') X goto nextchance; X /* X * If *fmt is '+' and we are on the beginning X * of the format desciptor that is currently X * checked, this cannot be an inc type flag. X */ X if (fmt == sfmt || fmt[-1] == ',') X goto nextchance; X X fmtp = fmt; X if (fmt[1] == 'l' || fmt[1] == 'L') { X if (fmt[2] == 'l' || fmt[2] == 'L') { X if (flags & SETARGS) X *((Llong *)curarg) += 1; X fmt += 2; X } else { X if (flags & SETARGS) X *((long *)curarg) += 1; X fmt++; X } X } else if (fmt[1] == 's' || fmt[1] == 'S') { X if (flags & SETARGS) X *((short *)curarg) += 1; X fmt++; X } else if (fmt[1] == 'c' || fmt[1] == 'C') { X if (flags & SETARGS) X *((char *)curarg) += 1; X fmt++; X } else { X if (fmt[1] == 'i' || fmt[1] == 'I') X fmt++; X if (flags & SETARGS) X *((int *)curarg) += 1; X } X X X return (checkfmt(fmt)); X X case '%': X /* X * inc type is similar to boolean, X * there is no arg in argp to convert. X */ X if (*argp != '\0') X goto nextchance; X X fmt++; X if (*fmt == '1') X val = TRUE; X else if (*fmt == '0') X val = FALSE; X else X goto nextchance; X X fmtp = fmt; X llval = (Llong)val; X if (fmt[1] == 'l' || fmt[1] == 'L') { X if (fmt[2] == 'l' || fmt[2] == 'L') { X if (flags & SETARGS) X *((Llong *)curarg) = llval; X fmt += 2; X } else { X if (flags & SETARGS) X *((long *)curarg) = val; X fmt++; X } X } else if (fmt[1] == 's' || fmt[1] == 'S') { X if (flags & SETARGS) X *((short *)curarg) = val; X fmt++; X } else if (fmt[1] == 'c' || fmt[1] == 'C') { X if (flags & SETARGS) X *((char *)curarg) = val; X fmt++; X } else { X if (fmt[1] == 'i' || fmt[1] == 'I') X fmt++; X if (flags & SETARGS) X *((int *)curarg) = val; X } X X X return (checkfmt(fmt)); X X case '#': X if (*argp == '\0' && fmt[1] != '_') { X if (*pac > 1) { X (*pac)--; X (*pav)++; X argp = **pav; X } else { X return (BADFLAG); X } X } X if (fmt[1] == '_') /* To disallow -f 123 for f# */ X fmt++; X else if (fmt[1] == ' ') /* To disallow -f123 for f# */ X fmt++; X X if (*astoll(argp, &llval) != '\0') { X /* X * arg is not a valid number! X * go to next format in the format string X * and check if arg matches any other type X * in the format specs. X */ X nextchance: X while (*fmt != ',' && *fmt != '\0') { X if ((*fmt == '&' || *fmt == '~') && X (flags & (SETARGS|ARGVECTOR)) == SETARGS) { X curarg = va_arg(args, void *); X } X fmt++; X } X argp = sargp; X *pac = spac; X *pav = spav; X continue; X } X fmtp = fmt; X val = (long)llval; X if (fmt[1] == 'l' || fmt[1] == 'L') { X if (fmt[2] == 'l' || fmt[2] == 'L') { X if (flags & SETARGS) X *((Llong *)curarg) = llval; X fmt += 2; X } else { X if (flags & SETARGS) X *((long *)curarg) = val; X fmt++; X } X } else if (fmt[1] == 's' || fmt[1] == 'S') { X if (flags & SETARGS) X *((short *)curarg) = (short)val; X fmt++; X } else if (fmt[1] == 'c' || fmt[1] == 'C') { X if (flags & SETARGS) X *((char *)curarg) = (char)val; X fmt++; X } else { X if (fmt[1] == 'i' || fmt[1] == 'I') X fmt++; X if (flags & SETARGS) X *((int *)curarg) = (int)val; X } X X return (checkfmt(fmt)); X X case '~': X if (*argp != '\0') X goto nextchance; X if (haseql) { X return (BADFLAG); X } X goto callfunc; X X case '&': X if (*argp == '\0' && fmt[1] != '_') { X if (*pac > 1) { X (*pac)--; X (*pav)++; X argp = **pav; X } else { X return (BADFLAG); X } X } X callfunc: X X if (*fmt == '&' && fmt[1] == '_') /* To disallow -f foo for f& */ X fmt++; X else if (fmt[1] == ' ') /* To disallow -ffoo for f& */ X fmt++; X if ((val = checkfmt(fmt)) != NOTAFLAG) X return (val); X X fmtp = sargp; X if (hasdash) X fmtp--; X if (doubledash) X fmtp--; X if ((flags & (SETARGS|ARGVECTOR)) == (SETARGS|ARGVECTOR)) { X int ret; X X if (flagp->ga_funcp == NULL) X return (BADFMT); X X ret = ((*flagp->ga_funcp) (argp, flagp->ga_arg, X pac, pav, fmtp)); X if (ret != NOTAFILE) X return (ret); X fmt++; X } else X if (flags & SETARGS) { X int ret; X void *funarg = va_arg(args, void *); X X if (curarg == NULL) X return (BADFMT); X ret = ((*(getpargfun)curarg) (argp, funarg, X pac, pav, fmtp)); X if (ret != NOTAFILE) X return (ret); X fmt++; X } else { X return (val); X } X /* X * Called function returns NOTAFILE: try next format. X */ X } X } X} X X X/* X * parse args for combined single char flags X */ Xtypedef struct { X void *curarg; /* The pointer to the arg to modify */ X void *curfun; /* The pointer to the function to call */ X char c; /* The single char flag character */ X char type; /* The type of the single char flag */ X char fmt; /* The format type of the single char flag */ X char val; /* The value to assign for BOOL flags */ X} sflags; X XLOCAL int Xdosflags(argp, vfmt, pac, pav, flags, oargs) X register const char *argp; X void *vfmt; X int *pac; X char *const **pav; X int flags; X va_list oargs; X{ X register const char *fmt = (const char *)vfmt; X struct ga_flags *flagp = vfmt; X#define MAXSF 64 X sflags sf[MAXSF]; X char fl[256]; X va_list args; X register sflags *rsf = sf; X register int nsf = 0; X register const char *p = argp; X register int i; X register void *curarg = (void *)0; X getpargfun curfun = 0; X char type; X X /* X * Initialize 'args' to the start of the argument list. X * I don't know any portable way to copy an arbitrary X * C object so I use a system-specific routine X * (probably a macro) from stdarg.h. (Remember that X * if va_list is an array, 'args' will be a pointer X * and '&args' won't be what I would need for memcpy.) X * It is a system requirement for SVr4 compatibility X * to be able to do this assgignement. If your system X * defines va_list to be an array but does not define X * va_copy() you are lost. X * This is needed to make sure, that 'oargs' will not X * be clobbered. X */ X va_copy(args, oargs); X X if (flags & ARGVECTOR) { X fmt = flagp->ga_format; X if (fmt == NULL) X fmt = ""; X if (flags & SETARGS) { X curarg = flagp->ga_arg; X curfun = flagp->ga_funcp; X } X } else if (flags & SETARGS) { X /* X * We set curfun to curarg. We later get the real X * curarg in case that we see a function callback X * but we need curfun first in this case. X */ X curarg = va_arg(args, void *); X curfun = (getpargfun)curarg; X } X X for (i = 0; i < sizeof (fl); i++) { X fl[i] = 0; X } X while (*p) { X for (i = 0; i < nsf; i++) { X if (rsf[i].c == *p) X break; X } X if (i >= MAXSF) { X va_end(args); X return (BADFLAG); X } X if (i == nsf) { X rsf[i].curarg = (void *)0; X rsf[i].curfun = (void *)0; X rsf[i].c = *p; X rsf[i].type = (char)-1; X rsf[i].fmt = '\0'; X rsf[i].val = (char)TRUE; X nsf++; X } X fl[*p & 0xFF] = i; X p++; X } X Xagain: X while (*fmt) { X if ((((flags & SINGLEARG) && X ((fmt[1] == '*' || fmt[1] == '?' || X fmt[1] == '&' || fmt[1] == '#'))) || X (!isfmtspec(*fmt) && X (fmt[1] == ',' || fmt[1] == '+' || X fmt[1] == '~' || fmt[1] == '%' || fmt[1] == '\0'))) && X strchr(argp, *fmt)) { X for (i = 0; i < nsf; i++) { X if (rsf[i].c == *fmt) { X if ((fmt[1] == '+') || X (fmt[1] == '#' && (flags & SINGLEARG))) { X rsf[i].fmt = fmt[1]; X fmt++; X if (fmt[1] == ',' || X fmt[1] == '\0') { X rsf[i].type = 'i'; X } else if ((fmt[1] == 'l' || X fmt[1] == 'L') && X (fmt[2] == 'l' || X fmt[2] == 'L')) { X /* X * Type 'Q'uad (ll) X */ X rsf[i].type = 'Q'; X fmt++; X } else { X /* X * Type 'l','i','s','c' X */ X rsf[i].type = fmt[1]; X } X } else if (fmt[1] == '%') { X fmt++; X rsf[i].fmt = '%'; X if (fmt[1] == '0') X rsf[i].val = (char)FALSE; X else if (fmt[1] == '1') X rsf[i].val = (char)TRUE; X fmt++; X if (fmt[1] == ',' || X fmt[1] == '\0') { X rsf[i].type = 'i'; X } else if ((fmt[1] == 'l' || X fmt[1] == 'L') && X (fmt[2] == 'l' || X fmt[2] == 'L')) { X /* X * Type 'Q'uad (ll) X */ X rsf[i].type = 'Q'; X fmt++; X } else { X /* X * Type 'l','i','s','c' X */ X rsf[i].type = fmt[1]; X } X } else if ((fmt[1] == '*' || X fmt[1] == '?') && X (flags & SINGLEARG)) { X fmt++; X rsf[i].fmt = fmt[0]; X rsf[i].type = fmt[0]; X if (fmt[1] == ' ' || fmt[1] == '_') X rsf[i].type = fmt[1]; X } else if ((fmt[1] == '~') || X (fmt[1] == '&' && (flags & SINGLEARG))) { X rsf[i].fmt = fmt[1]; X rsf[i].type = fmt[1]; X /* X * Let fmt point to ',' to X * prevent to fetch the X * func arg twice. X */ X fmt += 2; X if ((rsf[i].fmt == '&') && X (fmt[0] == ' ' || fmt[0] == '_')) X rsf[i].type = fmt[0]; X rsf[i].curfun = (void *)curfun; X if ((flags & (SETARGS|ARGVECTOR)) == SETARGS) X curarg = va_arg(args, void *); X } else { X /* X * ',' or '\0' for BOOL X */ X rsf[i].type = fmt[1]; X } X rsf[i].curarg = curarg; X break; X } X } X } X while (*fmt != ',' && *fmt != '\0') { X /* X * function has extra arg on stack. The code above X * prevents us from fetching this arg twice. X */ X if ((*fmt == '&' || *fmt == '~') && X (flags & (SETARGS|ARGVECTOR)) == SETARGS) { X curarg = va_arg(args, void *); X } X fmt++; X } X if (*fmt != '\0') X fmt++; X else X break; X X if ((flags & (SETARGS|ARGVECTOR)) == SETARGS) { X /* X * We set curfun to curarg. We later get the real X * curarg in case that we see a function callback X * but we need curfun first in this case. X */ X curarg = va_arg(args, void *); X curfun = (getpargfun)curarg; X } X } X if ((flags & ARGVECTOR) && flagp[1].ga_format != NULL) { X flagp++; X fmt = flagp->ga_format; X if (flags & SETARGS) { X curarg = flagp->ga_arg; X curfun = flagp->ga_funcp; X } X goto again; X } X X for (p = argp; *p; p++) { X char tfmt; X X i = fl[*p & 0xFF]; X tfmt = rsf[i].fmt; X type = rsf[i].type; X if (type == (char)-1) { X return (BADFLAG); X } X X if ((flags & SETARGS) == 0 && X (tfmt == '*' || tfmt == '?' || tfmt == '&' || tfmt == '#')) { X /* X * POSIX 12.2 Guideline 5 requires that any number of X * options without argument may be followed by a X * single option with parameter. So all characters X * past this one belong to the argument of this option. X */ X if (flags & CHECKARGS) X break; X if (*++p == '\0' && type != '_') { X if (*pac > 1) { X (*pac)--; X (*pav)++; X p = **pav; X } else { X return (BADFLAG); X } X } X break; X } X if ((flags & SETARGS) && X (rsf[i].curfun || rsf[i].curarg)) { X Llong llval = 0; X long val = 0; X X if (tfmt == '*' || tfmt == '?' || X tfmt == '&' || tfmt == '#') { X /* X * If type is '_', then -f ... results in an X * empty argument. This is because we disallow X * -f foo for f* in this case. X */ X if (*++p == '\0' && type != '_') { X if (*pac > 1) { X (*pac)--; X (*pav)++; X p = **pav; X } else { X return (BADFLAG); X } X } X } X X if (tfmt == '#' && *astoll(p, &llval) != '\0') { X return (BADFLAG); X } X val = (long)llval; X X if (type == ',' || type == '\0') { X *((int *)rsf[i].curarg) = TRUE; X } else if (type == 'i' || type == 'I') { X if (tfmt == '+') X *((int *)rsf[i].curarg) += 1; X else if (tfmt == '#') X *((int *)rsf[i].curarg) = (int)val; X else X *((int *)rsf[i].curarg) = rsf[i].val; X } else if (type == 'l' || type == 'L') { X if (tfmt == '+') X *((long *)rsf[i].curarg) += 1; X else if (tfmt == '#') X *((long *)rsf[i].curarg) = val; X else X *((long *)rsf[i].curarg) = rsf[i].val; X } else if (type == 'Q') { X if (tfmt == '+') X *((Llong *)rsf[i].curarg) += 1; X else if (tfmt == '#') X *((Llong *)rsf[i].curarg) = llval; X else X *((Llong *)rsf[i].curarg) = rsf[i].val; X } else if (type == 's' || type == 'S') { X if (tfmt == '+') X *((short *)rsf[i].curarg) += 1; X else if (tfmt == '#') X *((short *)rsf[i].curarg) = (short)val; X else X *((short *)rsf[i].curarg) = rsf[i].val; X } else if (type == 'c' || type == 'C') { X if (tfmt == '+') X *((char *)rsf[i].curarg) += 1; X else if (tfmt == '#') X *((char *)rsf[i].curarg) = (char)val; X else X *((char *)rsf[i].curarg) = rsf[i].val; X } else if (tfmt == '*' || tfmt == '?') { X if (tfmt == '*') X *((const char **)rsf[i].curarg) = p; X else X *((char *)rsf[i].curarg) = *p; X break; X } else if (tfmt == '~' || tfmt == '&') { X int ret; X char cfmt[3]; X X cfmt[0] = '-'; X cfmt[1] = rsf[i].c; X cfmt[2] = '\0'; X X if (rsf[i].curfun == NULL) X return (BADFMT); X ret = ((*(getpargfun)rsf[i].curfun) (tfmt == '&' X ?p:"", X rsf[i].curarg, X pac, pav, cfmt)); X if (ret != NOTAFLAG) X return (ret); X if (tfmt == '&') X break; X } else { X return (BADFLAG); X } X if (tfmt == '#') X break; X } X } X return (NOTAFLAG); X} X X/* X * If the next format character is a comma or the string delimiter, X * there are no invalid format specifiers. Return success. X * Otherwise raise the getarg_bad_format condition. X */ XLOCAL int Xcheckfmt(fmt) X const char *fmt; X{ X char c; X X c = *(++fmt); /* non constant expression */ X X X if (c == ',' || c == '\0') { X return (NOTAFLAG); X } else { X raisecond("getarg_bad_format", (long)fmt); X return (BADFMT); X } X} X X/* X * Parse the string as long as valid characters can be found. X * Valid flag identifiers are chosen from the set of X * alphanumeric characters, '-' and '_'. X * If the next character is an equal sign the string X * contains a valid flag identifier. X */ XLOCAL int Xcheckeql(str) X register const char *str; X{ X register unsigned char c; X X for (c = (unsigned char)*str; X isalnum(c) || c == '_' || c == '-' || c == '+'; X c = *++str) X /* LINTED */ X ; X return (c == '='); X} X XEXPORT char * Xgetargerror(err) X int err; X{ X if (err < RETMIN || err > RETMAX) X return ("Illegal arg error"); X return (RNAME(err)); X} END-of-star-1.6/libschily/getargs.c echo x - star-1.6/libschily/raisecond.c sed 's/^X//' >star-1.6/libschily/raisecond.c << 'END-of-star-1.6/libschily/raisecond.c' X/* @(#)raisecond.c 1.22 09/07/10 Copyright 1985, 1989, 1995-2004 J. Schilling */ X/* X * raise a condition (software signal) X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X/* X * Check for installed condition handlers. X * If a handler is found, the function is called with the appropriate args. X * If no handler is found or no handler signals success, X * the program will be aborted. X * X * Copyright (c) 1985, 1989, 1995-2004 J. Schilling X */ X#include X#include X#include X#include X#include X#include X#include X#include X#include X X#if !defined(AV_OFFSET) || !defined(FP_INDIR) X# ifdef HAVE_SCANSTACK X# undef HAVE_SCANSTACK X# endif X#endif X X/* X * Macros to print to stderr without stdio, to avoid screwing up. X */ X#ifndef STDERR_FILENO X#define STDERR_FILENO 2 X#endif X#define eprints(a) (void)write(STDERR_FILENO, (a), sizeof (a)-1) X#define eprintl(a) (void)write(STDERR_FILENO, (a), strlen(a)) X X#define is_even(p) ((((long)(p)) & 1) == 0) X#define even(p) (((long)(p)) & ~1L) X#ifdef __future__ X#define even(p) (((long)(p)) - 1) /* will this work with 64 bit ?? */ X#endif X X XLOCAL void raiseabort __PR((const char *)); X X#ifdef HAVE_SCANSTACK X#include X#define next_frame(vp) do { \ X if (((struct frame *)(vp))->fr_savfp == 0) { \ X vp = (void *)0; \ X break; \ X } \ X if (((struct frame *)(vp))->fr_savpc == 0) { \ X vp = (void *)0; \ X break; \ X } \ X vp = \ X (void *)((struct frame *)(vp))->fr_savfp; \ X } while (vp != NULL && is_even(vp)); \ X vp = (struct frame *)even(vp); X#else X#if defined(IS_MACOS_X) X/* X * The MAC OS X linker does not grok "common" varaibles. X * Make __roothandle a "data" variable. X */ XEXPORT SIGBLK *__roothandle = 0; X#else XEXPORT SIGBLK *__roothandle; X#endif X X#define next_frame(vp) vp = (((SIGBLK *)(vp))->sb_savfp); X#endif X XLOCAL BOOL framehandle __PR((SIGBLK *, const char *, const char *, long)); X X/* X * Loop through the chain of procedure frames on the stack. X * X * Frame pointers normally have even values. X * Frame pointers of procedures with an installed handler are marked odd. X * The even base value, in this case actually points to a SIGBLK which X * holds the saved "real" frame pointer. X * The SIGBLK mentioned above may me the start of a chain of SIGBLK's, X * containing different handlers. X */ XEXPORT void Xraisecond(signame, arg2) X const char *signame; X long arg2; X{ X register void *vp = NULL; X X#ifdef HAVE_SCANSTACK X /* X * As the SCO OpenServer C-Compiler has a bug that may cause X * the first function call to getfp() been done before the X * new stack frame is created, we call getfp() twice. X */ X (void) getfp(); X vp = getfp(); X next_frame(vp); X#else X vp = __roothandle; X#endif X X while (vp) { X if (framehandle((SIGBLK *)vp, signame, signame, arg2)) X return; X else if (framehandle((SIGBLK *)vp, "any_other", signame, arg2)) X return; X#ifdef HAVE_SCANSTACK X vp = (struct frame *)((SIGBLK *)vp)->sb_savfp; X#endif X next_frame(vp); X } X /* X * No matching handler that signals success found. X * Print error message and abort. X */ X raiseabort(signame); X /* NOTREACHED */ X} X X/* X * Loop through the handler chain for a procedure frame. X * X * If no handler with matching name is found, return FALSE, X * otherwise the first handler with matching name is called. X * The return value in the latter case depends on the called function. X */ XLOCAL BOOL Xframehandle(sp, handlename, signame, arg2) X register SIGBLK *sp; X const char *handlename; X const char *signame; X long arg2; X{ X for (; sp; sp = sp->sb_signext) { X if (sp->sb_signame != NULL && X streql(sp->sb_signame, handlename)) { X if (sp->sb_sigfun == NULL) { /* deactivated */ X return (FALSE); X } else { X return (*sp->sb_sigfun)(signame, X sp->sb_sigarg, arg2); X } X } X } X return (FALSE); X} X XLOCAL void Xraiseabort(signame) X const char *signame; X{ X eprints("Condition not caught: "); eprintl(signame); eprints(".\n"); X abort(); X /* NOTREACHED */ X} END-of-star-1.6/libschily/raisecond.c echo x - star-1.6/libschily/Targets sed 's/^X//' >star-1.6/libschily/Targets << 'END-of-star-1.6/libschily/Targets' X# @(#)Targets 1.65 18/10/14 Copyright 1995-2018 J. Schilling X XCFILES_STDIO= cvmod.c dat.c fcons.c fdown.c fdup.c \ X ffileread.c ffilewrite.c \ X fgetaline.c fgetline.c fgetstr.c file_getraise.c file_raise.c \ X fileclose.c fileluopen.c fileopen.c filemopen.c \ X filepos.c fileread.c filereopen.c fileseek.c filesize.c \ X filestat.c filewrite.c flag.c flush.c fpipe.c \ X getdelim.c \ X niread.c niwrite.c nixread.c nixwrite.c openfd.c peekc.c \ X fcons64.c fdup64.c fileluopen64.c fileopen64.c filemopen64.c \ X filepos64.c filereopen64.c fileseek64.c filesize64.c \ X filestat64.c openfd64.c X XHFILES_STDIO= schilyio.h X X# X# Note: getfp.c must be before getav0.c X# Otherwise getfp.o would be made as dependency of avoffset X# X XCFILES_REST= abspath.c astoi.c astoll.c astoul.c astoull.c basename.c breakline.c \ X checkerr.c comerr.c fcomerr.c gtcomerr.c fgtcomerr.c \ X chown.c \ X cmpbytes.c cmpmbytes.c cmpnullbytes.c \ X dirent.c dirname.c diropen.c \ X dlfcn.c \ X eaccess.c error.c gterror.c \ X faccessat.c fchdir.c \ X fchmodat.c fchownat.c fconv.c fdopendir.c fexec.c fillbytes.c \ X findinpath.c \ X findbytes.c findline.c fnmatch.c format.c \ X fpoff.c fprformat.c \ X fstatat.c fstatat64.c fstream.c \ X futimens.c futimesat.c \ X getargs.c getav0.c geterrno.c getexecpath.c getfp.c \ X getgrent.c \ X getdtablesize.c \ X getdomainname.c gethostid.c gethostname.c getpagesize.c \ X getlogin.c \ X getnum.c getxnum.c \ X gettnum.c getxtnum.c \ X getperm.c \ X getpwent.c \ X getnstimeofday.c gettimeofday.c \ X gid.c \ X handlecond.c \ X jsdprintf.c jsprintf.c jssnprintf.c jssprintf.c gtprintf.c \ X kill.c \ X lchmod.c linkat.c lutimens.c \ X lxchdir.c \ X match.c matchl.c matchmb.c matchmbl.c matchw.c matchwl.c \ X movebytes.c movecbytes.c \ X mkdirat.c mkdirs.c mkfifo.c mkfifoat.c mkgmtime.c mknodat.c \ X mkstemp.c \ X mem.c jmem.c fjmem.c \ X openat.c openat64.c \ X ovstrcpy.c \ X permtostr.c \ X procnameat.c putenv.c \ X raisecond.c readlinkat.c rename.c renameat.c resolvepath.c \ X saveargs.c savewd.c \ X searchinpath.c serrmsg.c seterrno.c setfp.c \ X setnstimeofday.c \ X sleep.c \ X snprintf.c \ X spawn.c \ X strcasecmp.c strncasecmp.c strcasemap.c \ X strcat.c strcatl.c strchr.c strcmp.c strcpy.c strcspn.c \ X strdup.c streql.c strlen.c strlcat.c strlcatl.c strlcpy.c strncat.c strncmp.c \ X strncpy.c strndup.c strnlen.c strrchr.c strspn.c strstr.c \ X swabbytes.c \ X symlinkat.c \ X timegm.c \ X uid.c unlinkat.c uname.c unsetenv.c \ X usleep.c utimens.c utimensat.c \ X waitid.c \ X wcscat.c wcscatl.c wcschr.c wcscmp.c wcscpy.c wcscspn.c \ X wcsdup.c wcseql.c wcslen.c wcslcat.c wcslcatl.c wcslcpy.c wcsncat.c wcsncmp.c \ X wcsncpy.c wcsndup.c wcsnlen.c wcsrchr.c wcsspn.c wcsstr.c \ X wctype.c \ X wdabort.c \ X zerobytes.c X XHFILES_REST= at-defs.h format.h X X# X# These interfaces have been moved to libschilypr in order to make X# programs that use libschily compatible with all software. X# X# printf.c snprintf.c sprintf.c X# X# snprintf.c however is needed for portability on systems X# that do not provide snprintf() X XCFILES= $(CFILES_STDIO) $(CFILES_REST) X XHFILES= $(HFILES_STDIO) $(HFILES_REST) END-of-star-1.6/libschily/Targets echo x - star-1.6/libschily/swabbytes.c sed 's/^X//' >star-1.6/libschily/swabbytes.c << 'END-of-star-1.6/libschily/swabbytes.c' X/* @(#)swabbytes.c 1.10 10/08/21 Copyright 1988, 1995-2010 J. Schilling */ X/* X * swab bytes in memory X * X * Copyright (c) 1988, 1995-2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X X#define DO8(a) a; a; a; a; a; a; a; a; X XEXPORT void Xswabbytes(vp, cnt) X void *vp; X register ssize_t cnt; X{ X register char *bp = (char *)vp; X register char c; X X cnt /= 2; /* even count only */ X while ((cnt -= 8) >= 0) { X /* CSTYLED */ X DO8(c = *bp++; bp[-1] = *bp; *bp++ = c;); X } X cnt += 8; X while (--cnt >= 0) { X c = *bp++; bp[-1] = *bp; *bp++ = c; X } X} END-of-star-1.6/libschily/swabbytes.c echo x - star-1.6/libschily/libschily.mk sed 's/^X//' >star-1.6/libschily/libschily.mk << 'END-of-star-1.6/libschily/libschily.mk' X#ident @(#)libschily.mk 1.10 16/11/06 X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X X.SEARCHLIST: . $(ARCHDIR) stdio $(ARCHDIR) XVPATH= .:stdio:$(ARCHDIR) XINSDIR= lib XTARGETLIB= schily XCPPOPTS += -Istdio XCPPOPTS += -DUSE_SCANSTACK # Try to scan stack frames XCPPOPTS += -DPORT_ONLY # Add missing funcs line snprintf for porting Xinclude Targets Xinclude Targets.man XLIBS= X XXMK_FILE= Makefile.man X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.lib X########################################################################### END-of-star-1.6/libschily/libschily.mk echo x - star-1.6/libschily/libschily_p.mk sed 's/^X//' >star-1.6/libschily/libschily_p.mk << 'END-of-star-1.6/libschily/libschily_p.mk' X#ident @(#)libschily_p.mk 1.7 08/01/11 X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XSUBARCHDIR= /profiled XSUBINSDIR= /profiled X.SEARCHLIST: . $(ARCHDIR) stdio $(ARCHDIR) XVPATH= .:stdio:$(ARCHDIR) XINSDIR= lib XTARGETLIB= schily XCPPOPTS += -Istdio XCPPOPTS += -DUSE_SCANSTACK # Try to scan stack frames XCPPOPTS += -DPORT_ONLY # Add missing funcs line snprintf for porting XCOPTS += $(COPTGPROF) Xinclude Targets XLIBS= X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.lib X########################################################################### END-of-star-1.6/libschily/libschily_p.mk echo x - star-1.6/libschily/shlschily.mk sed 's/^X//' >star-1.6/libschily/shlschily.mk << 'END-of-star-1.6/libschily/shlschily.mk' X#ident @(#)shlschily.mk 1.9 18/10/11 X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XSUBARCHDIR= /pic XSHL_MAJOR= 2 XSHL_MINOR= 0 X.SEARCHLIST: . $(ARCHDIR) stdio $(ARCHDIR) XVPATH= .:stdio:$(ARCHDIR) XINSDIR= lib XTARGETLIB= schily XCPPOPTS += -Istdio XCPPOPTS += -DUSE_SCANSTACK # Try to scan stack frames XCPPOPTS += -DPORT_ONLY # Add missing funcs line snprintf for porting Xinclude Targets XLIBS= $(LIB_INTL) -lc # Now needs gettext() X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.shl X########################################################################### END-of-star-1.6/libschily/shlschily.mk echo x - star-1.6/libschily/gethostid.c sed 's/^X//' >star-1.6/libschily/gethostid.c << 'END-of-star-1.6/libschily/gethostid.c' X/* @(#)gethostid.c 1.20 09/08/04 Copyright 1995-2009 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)gethostid.c 1.20 09/08/04 Copyright 1995-2009 J. Schilling"; X#endif X/* X * Copyright (c) 1995-2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X X#ifndef HAVE_GETHOSTID XEXPORT long gethostid __PR((void)); X#endif X X X#if !defined(HAVE_GETHOSTID) X X#if defined(SI_HW_SERIAL) X XEXPORT long Xgethostid() X{ X long id; X X char hbuf[257]; X sysinfo(SI_HW_SERIAL, hbuf, sizeof (hbuf)); X id = atoi(hbuf); X return (id); X} X#else X X#include XEXPORT long Xgethostid() X{ X long id = -1L; X X#ifdef ENOSYS X seterrno(ENOSYS); X#else X seterrno(EINVAL); X#endif X return (id); X} X#endif X X#endif END-of-star-1.6/libschily/gethostid.c echo x - star-1.6/libschily/getav0.c sed 's/^X//' >star-1.6/libschily/getav0.c << 'END-of-star-1.6/libschily/getav0.c' X/* @(#)getav0.c 1.23 09/07/08 Copyright 1985, 1995-2009 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)getav0.c 1.23 09/07/08 Copyright 1985, 1995-2009 J. Schilling"; X#endif X/* X * Get arg vector by scanning the stack X * X * Copyright (c) 1985, 1995-2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X X#if !defined(AV_OFFSET) || !defined(FP_INDIR) X# ifdef HAVE_SCANSTACK X# undef HAVE_SCANSTACK X# endif X#endif X X#ifdef HAVE_SCANSTACK X X#include X X#define is_even(p) ((((long)(p)) & 1) == 0) X#define even(p) (((long)(p)) & ~1L) X#ifdef __future__ X#define even(p) (((long)(p)) - 1) /* will this work with 64 bit ?? */ X#endif X XEXPORT char **getmainfp __PR((void)); XEXPORT char **getavp __PR((void)); XEXPORT char *getav0 __PR((void)); X X XEXPORT char ** Xgetmainfp() X{ X register struct frame *fp; X char **av; X#if FP_INDIR > 0 X register int i = 0; X#endif X X /* X * As the SCO OpenServer C-Compiler has a bug that may cause X * the first function call to getfp() been done before the X * new stack frame is created, we call getfp() twice. X */ X (void) getfp(); X fp = (struct frame *)getfp(); X if (fp == NULL) X return (NULL); X X while (fp->fr_savfp) { X if (fp->fr_savpc == 0) X break; X X if (!is_even(fp->fr_savfp)) { X fp = (struct frame *)even(fp->fr_savfp); X if (fp == NULL) X break; X fp = (struct frame *)((SIGBLK *)fp)->sb_savfp; X continue; X } X fp = (struct frame *)fp->fr_savfp; X X#if FP_INDIR > 0 X i++; X#endif X } X X#if FP_INDIR > 0 X i -= FP_INDIR; X fp = (struct frame *)getfp(); X if (fp == NULL) X return (NULL); X X while (fp->fr_savfp) { X if (fp->fr_savpc == 0) X break; X X if (!is_even(fp->fr_savfp)) { X fp = (struct frame *)even(fp->fr_savfp); X if (fp == NULL) X break; X fp = (struct frame *)((SIGBLK *)fp)->sb_savfp; X continue; X } X fp = (struct frame *)fp->fr_savfp; X X if (--i <= 0) X break; X } X#endif X X av = (char **)fp; X return (av); X} X XEXPORT char ** Xgetavp() X{ X register struct frame *fp; X char **av; X X fp = (struct frame *)getmainfp(); X if (fp == NULL) X return (NULL); X X av = (char **)(((char *)fp) + AV_OFFSET); /* aus avoffset.h */ X /* -> avoffset.c */ X return (av); X} X XEXPORT char * Xgetav0() X{ X return (getavp()[0]); X} X X#else X XEXPORT char ** Xgetmainfp() X{ X raisecond("getmainfp", 0); X return ((char **)0); X} X XEXPORT char ** Xgetavp() X{ X raisecond("getavp", 0); X return ((char **)0); X} X XEXPORT char * Xgetav0() X{ X return ("???"); X} X X#endif /* HAVE_SCANSTACK */ END-of-star-1.6/libschily/getav0.c echo x - star-1.6/libschily/cvt.c sed 's/^X//' >star-1.6/libschily/cvt.c << 'END-of-star-1.6/libschily/cvt.c' X/* @(#)cvt.c 1.11 16/02/08 Copyright 1998-2016 J. Schilling */ X/* X * Compatibility routines for 4.4BSD based C-libraries ecvt()/fcvt() X * and a working gcvt() that is needed on 4.4BSD and GNU libc systems. X * X * On 4.4BSD, gcvt() is missing, the gcvt() implementation from GNU libc X * is not working correctly. X * X * Neither __dtoa() nor [efg]cvt() are MT safe. X * X * Copyright (c) 1998-2016 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X X#ifdef HAVE_DTOA /* 4.4BSD floating point implementation */ X#ifdef HAVE_DTOA_R Xextern char *__dtoa __PR((double value, int mode, int ndigit, int *decpt, X int *sign, char **ep, char **resultp)); X#else Xextern char *__dtoa __PR((double value, int mode, int ndigit, int *decpt, X int *sign, char **ep)); X#endif X#else X X#if !defined(HAVE_ECVT) X/* X * As a hint from Thomas Langer , we use strtod.c in X * hope that we then will be able to print floating point numbers on all X * platforms, even those without *cvt() and without __dtoa() in libc. X * X * ... of course, we need to decide when we need to include strtod.c ... X * X * We come into this file if autoconf found that gcvt(), fcvt() or ecvt() is X * missing. If we are on a *BSD alike system, there is __dtoa() but neither X * gcvt() nor fcvt() or ecvt(), so we emulate all three functions via __dtoa(). X * Glibc has a buggy gcvt() which causes an endless recursion, X * fcvt() from Cygwin32 is buggy, so we emulate fcvt() via ecvt() on Cygwin. X * X * If at least ecvt() is present, we don't need __dtoa() from strtod.c X */ X#include "strtod.c" X#define HAVE_DTOA X#endif /* !defined(HAVE_ECVT) */ X X#endif /* HAVE_DTOA */ X X#ifndef HAVE_ECVT XEXPORT char *ecvt __PR((double value, int ndigit, int *decpt, int *sign)); X#endif X#ifndef HAVE_FCVT XEXPORT char *fcvt __PR((double value, int ndigit, int *decpt, int *sign)); X#endif X#ifndef HAVE_GCVT XEXPORT char *gcvt __PR((double value, int ndigit, char *buf)); X#endif X X#if !defined(HAVE_ECVT) && defined(HAVE_DTOA) X#define HAVE_ECVT Xchar * Xecvt(value, ndigit, decpt, sign) X double value; X int ndigit; X int *decpt; X int *sign; X{ Xstatic Uint bufsize; Xstatic char *buf; X char *bufend; X char *ep; X char *bp; X#ifdef HAVE_DTOA_R Xstatic char *result; X#endif X X#ifdef HAVE_DTOA_R X if (result) { X free(result); X result = NULL; X } X bp = __dtoa(value, 2, ndigit, decpt, sign, &ep, &result); X#else X bp = __dtoa(value, 2, ndigit, decpt, sign, &ep); X#endif X X if (value == 0.0) { X /* X * Handle __dtoa()'s deviation from ecvt(): X * 0.0 is converted to "0" instead of 'ndigit' zeroes. X * The string "0" is not allocated, so X * we need to allocate buffer to hold 'ndigit' zeroes. X */ X if (bufsize < ndigit + 1) { X if (buf != (char *)0) X free(buf); X bufsize = ndigit + 1; X buf = malloc(bufsize); X } X ep = bp = buf; X } X X /* X * Fill up trailing zeroes suppressed by __dtoa() X * From an internal __dtoa() comment: X * Sufficient space is allocated to the return value X * to hold the suppressed trailing zeros. X */ X for (bufend = &bp[ndigit]; ep < bufend; ) X *ep++ = '0'; X *ep = '\0'; X X return (bp); X} X#endif X X#if !defined(HAVE_FCVT) && defined(HAVE_DTOA) X#define HAVE_FCVT Xchar * Xfcvt(value, ndigit, decpt, sign) X double value; X int ndigit; X int *decpt; X int *sign; X{ Xstatic Uint bufsize; Xstatic char *buf; X char *bufend; X char *ep; X char *bp; X#ifdef HAVE_DTOA_R Xstatic char *result; X#endif X X#ifdef HAVE_DTOA_R X if (result) { X free(result); X result = NULL; X } X bp = __dtoa(value, 3, ndigit, decpt, sign, &ep, &result); X#else X bp = __dtoa(value, 3, ndigit, decpt, sign, &ep); X#endif X X if (value == 0.0) { X /* X * Handle __dtoa()'s deviation from fcvt(): X * 0.0 is converted to "0" instead of 'ndigit' zeroes. X * The string "0" is not allocated, so X * we need to allocate buffer to hold 'ndigit' zeroes. X */ X if (bufsize < ndigit + 1) { X if (buf != (char *)0) X free(buf); X bufsize = ndigit + 1; X buf = malloc(bufsize); X } X ep = bp = buf; X *decpt = 0; X } X X /* X * Fill up trailing zeroes suppressed by __dtoa() X * From an internal __dtoa() comment: X * Sufficient space is allocated to the return value X * to hold the suppressed trailing zeros. X */ X for (bufend = &bp[*decpt + ndigit]; ep < bufend; ) X *ep++ = '0'; X *ep = '\0'; X X return (bp); X} X#endif X X#ifndef HAVE_GCVT X#define HAVE_GCVT Xchar * Xgcvt(number, ndigit, buf) X double number; X int ndigit; X char *buf; X{ X int sign; X int decpt; X char dpoint; X register char *b; X register char *rs; X register int i; X X#if defined(HAVE_LOCALECONV) && defined(USE_LOCALE) X dpoint = *(localeconv()->decimal_point); X#else X dpoint = '.'; X#endif X b = ecvt(number, ndigit, &decpt, &sign); X rs = buf; X if (sign) X *rs++ = '-'; X for (i = ndigit-1; i > 0 && b[i] == '0'; i--) X ndigit--; X#ifdef V7_FLOATSTYLE X if ((decpt >= 0 && decpt-ndigit > 4) || X#else X if ((decpt >= 0 && decpt-ndigit > 0) || X#endif X (decpt < -3)) { /* e-format */ X decpt--; X *rs++ = *b++; X *rs++ = dpoint; /* '.' */ X for (i = 1; i < ndigit; i++) X *rs++ = *b++; X *rs++ = 'e'; X if (decpt < 0) { X decpt = -decpt; X *rs++ = '-'; X } else { X *rs++ = '+'; X } X if (decpt >= 100) { X *rs++ = decpt / 100 + '0'; X decpt %= 100; X } X *rs++ = decpt / 10 + '0'; X *rs++ = decpt % 10 + '0'; X } else { /* f-format */ X if (decpt <= 0) { X if (*b != '0') { X#ifndef V7_FLOATSTYLE X *rs++ = '0'; X#endif X *rs++ = dpoint; /* '.' */ X } X while (decpt < 0) { X decpt++; X *rs++ = '0'; X } X } X for (i = 1; i <= ndigit; i++) { X *rs++ = *b++; X if (i == decpt) X *rs++ = dpoint; /* '.' */ X } X if (ndigit < decpt) { X while (ndigit++ < decpt) X *rs++ = '0'; X *rs++ = dpoint; /* '.' */ X } X } X if (rs[-1] == dpoint) /* '.' */ X rs--; X *rs = '\0'; X return (buf); X} X#endif END-of-star-1.6/libschily/cvt.c echo x - star-1.6/libschily/sprintf.c sed 's/^X//' >star-1.6/libschily/sprintf.c << 'END-of-star-1.6/libschily/sprintf.c' X/* @(#)sprintf.c 1.16 10/08/21 Copyright 1985, 1988-2010 J. Schilling */ X/* X * Copyright (c) 1985, 1988-2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X X/* X * Do not include stdio.h, BSD systems define sprintf the wrong way! X */ XEXPORT int sprintf __PR((char *, const char *, ...)); X X#ifdef PROTOTYPES Xstatic void _cput(char c, long ba) X#else Xstatic void _cput(c, ba) X char c; X long ba; X#endif X{ X *(*(char **)ba)++ = c; X} X X/* VARARGS2 */ X#ifdef PROTOTYPES XEXPORT int Xsprintf(char *buf, const char *form, ...) X#else XEXPORT int Xsprintf(buf, form, va_alist) X char *buf; X char *form; X va_dcl X#endif X{ X va_list args; X int cnt; X char *bp = buf; X X#ifdef PROTOTYPES X va_start(args, form); X#else X va_start(args); X#endif X cnt = format(_cput, (long)&bp, form, args); X va_end(args); X *bp = '\0'; X X return (cnt); X} END-of-star-1.6/libschily/sprintf.c echo x - star-1.6/libschily/usleep.c sed 's/^X//' >star-1.6/libschily/usleep.c << 'END-of-star-1.6/libschily/usleep.c' X/* @(#)usleep.c 1.24 14/03/03 Copyright 1995-2014 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)usleep.c 1.24 14/03/03 Copyright 1995-20014 J. Schilling"; X#endif X/* X * Copyright (c) 1995-2014 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#define usleep __nothing_ /* prototype in unistd.h may be different */ X#include X#include X#include X#ifdef HAVE_POLL_H X# include X#else X# ifdef HAVE_SYS_POLL_H X# include X# endif X#endif X#include X#include X#undef usleep X X#ifndef HAVE_USLEEP XEXPORT int usleep __PR((int usec)); X#endif X X#ifdef OPENSERVER X/* X * Don't use the usleep() from libc on SCO's OPENSERVER. X * It will kill our processes with SIGALRM. X * SCO has a usleep() prototype in unistd.h, for this reason we X * #define usleep to __nothing__ before including unistd.h X */ X#undef HAVE_USLEEP X#endif X X#ifdef apollo X/* X * Apollo sys5.3 usleep is broken. Define a version based on time_$wait. X */ X#include X#include X#undef HAVE_USLEEP X#endif X X#if !defined(HAVE_USLEEP) X XEXPORT int Xusleep(usec) X int usec; X{ X#if defined(apollo) X /* X * Need to check apollo before HAVE_SELECT, because Apollo has select, X * but it's time wait feature is also broken :-( X */ X#define HAVE_USLEEP X /* X * XXX Do these vars need to be static on Domain/OS ??? X */ X static time_$clock_t DomainDelay; X static status_$t DomainStatus; X X /* X * DomainDelay is a 48 bit value that defines how many 4uS periods to X * delay. Since the input value range is 32 bits, the upper 16 bits of X * DomainDelay must be zero. So we just divide the input value by 4 to X * determine how many "ticks" to wait X */ X DomainDelay.c2.high16 = 0; X DomainDelay.c2.low32 = usec / 4; X time_$wait(time_$relative, DomainDelay, &DomainStatus); X#endif /* Apollo */ X X#if defined(HAVE_SELECT) && !defined(HAVE_USLEEP) X#define HAVE_USLEEP X X struct timeval tv; X tv.tv_sec = usec / 1000000; X tv.tv_usec = usec % 1000000; X select(0, 0, 0, 0, &tv); X#endif X X#if defined(HAVE_POLL) && !defined(HAVE_USLEEP) X#define HAVE_USLEEP X X if (poll(0, 0, usec/1000) < 0) X comerr("poll delay failed.\n"); X X#endif X X /* X * We cannot use nanosleep() until we found a way to check X * separately for nanosleep() in libc and for nanosleep in librt. X */ X#if defined(xxxHAVE_NANOSLEEP) && !defined(HAVE_USLEEP) X#define HAVE_USLEEP X X struct timespec ts; X X ts.tv_sec = usec / 1000000; X ts.tv_nsec = (usec % 1000000) * 1000; X X nanosleep(&ts, 0); X#endif X X#if (defined(_MSC_VER) || defined(__MINGW32__)) && !defined(HAVE_USLEEP) X#define HAVE_USLEEP X Sleep(usec/1000); X#endif X X#if !defined(HAVE_USLEEP) X#define HAVE_USLEEP X X sleep((usec+500000)/1000000); X#endif X X return (0); X} X#endif END-of-star-1.6/libschily/usleep.c echo x - star-1.6/libschily/jssnprintf.c sed 's/^X//' >star-1.6/libschily/jssnprintf.c << 'END-of-star-1.6/libschily/jssnprintf.c' X/* @(#)jssnprintf.c 1.14 17/08/03 Copyright 1985, 1995-2017 J. Schilling */ X/* X * Copyright (c) 1985, 1995-2017 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include /* include try to get size_t */ X#include /* Try again for size_t */ X#include /* Try again for size_t */ X#include X#include X#include X XEXPORT int js_snprintf __PR((char *, size_t maxcnt, const char *, ...)); X Xtypedef struct { X char *ptr; X int count; X} *BUF, _BUF; X X#ifdef PROTOTYPES Xstatic void X_cput(char c, void *l) X#else Xstatic void X_cput(c, l) X char c; X void *l; X#endif X{ X register BUF bp = (BUF)l; X X if (--bp->count > 0) { X *bp->ptr++ = c; X } else { X /* X * Make sure that there will never be a negative overflow. X */ X bp->count++; X } X} X X/* VARARGS2 */ X#ifdef PROTOTYPES XEXPORT int Xjs_snprintf(char *buf, size_t maxcnt, const char *form, ...) X#else XEXPORT int Xjs_snprintf(buf, maxcnt, form, va_alist) X char *buf; X unsigned maxcnt; X char *form; X va_dcl X#endif X{ X va_list args; X int cnt; X _BUF bb; X X bb.ptr = buf; X bb.count = maxcnt; X X#ifdef PROTOTYPES X va_start(args, form); X#else X va_start(args); X#endif X cnt = format(_cput, &bb, form, args); X va_end(args); X if (maxcnt > 0) X *(bb.ptr) = '\0'; X if (bb.count < 0) X return (-1); X X return (cnt); X} END-of-star-1.6/libschily/jssnprintf.c echo x - star-1.6/libschily/gethostname.c sed 's/^X//' >star-1.6/libschily/gethostname.c << 'END-of-star-1.6/libschily/gethostname.c' X/* @(#)gethostname.c 1.22 19/03/26 Copyright 1995-2019 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)gethostname.c 1.22 19/03/26 Copyright 1995-2019 J. Schilling"; X#endif X/* X * Copyright (c) 1995-2019 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X X#ifndef HAVE_GETHOSTNAME XEXPORT int gethostname __PR((char *name, int namelen)); X X X#ifdef SI_HOSTNAME X XEXPORT int Xgethostname(name, namelen) X char *name; X int namelen; X{ X if (sysinfo(SI_HOSTNAME, name, namelen) < 0) X return (-1); X return (0); X} X#else /* ! SI_HOSTNAME */ X X#ifdef HAVE_UNAME X#include X#include X XEXPORT int Xgethostname(name, namelen) X char *name; X int namelen; X{ X struct utsname uts; X X if (uname(&uts) < 0) X return (-1); X X strncpy(name, uts.nodename, namelen); X return (0); X} X#else /* !HAVE_UNAME */ X X#if defined(__MINGW32__) || defined(_MSC_VER) X#include X#include X#define gethostname __winsock_gethostname X#include X#undef gethostname X XEXPORT int Xgethostname(name, namelen) X char *name; X int namelen; X{ X uint32_t len = namelen; X char nbuf[MAX_COMPUTERNAME_LENGTH+1]; X X if (namelen < 0) { X seterrno(EINVAL); X return (-1); X } X if (namelen == 0) X return (0); X X name[0] = '\0'; X if (!GetComputerName(name, &len)) { X if (len > namelen) { X nbuf[0] = '\0'; X len = sizeof (nbuf); X (void) GetComputerName(nbuf, &len); X strncpy(name, nbuf, namelen); X return (0); X } X seterrno(EIO); X return (-1); X } X return (0); X} X#else X#include X XEXPORT int Xgethostname(name, namelen) X char *name; X int namelen; X{ X if (namelen < 0) { X seterrno(EINVAL); X return (-1); X } X if (namelen > 0) X name[0] = '\0'; X return (0); X} X#endif X#endif /* !HAVE_UNAME */ X X#endif /* !SI_HOSTNAME */ X X#endif /* HAVE_GETHOSTNAME */ END-of-star-1.6/libschily/gethostname.c echo x - star-1.6/libschily/jsprintf.c sed 's/^X//' >star-1.6/libschily/jsprintf.c << 'END-of-star-1.6/libschily/jsprintf.c' X/* @(#)jsprintf.c 1.20 17/08/03 Copyright 1985, 1995-2017 J. Schilling */ X/* X * Copyright (c) 1985, 1995-2017 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X X#ifdef NO_FPRFORMAT X#undef USE_FPRFORMAT X#else X#define USE_FPRFORMAT X#endif X X#ifdef USE_FPRFORMAT X/* X * This is the speed-optimized version that currently only has been tested X * on Solaris. X * It is based on fprformat() instead of format() and is faster than the X * the format() based standard implementation, in case that putc() or X * putc_unlocked() is a macro. X */ X X/* VARARGS1 */ X#ifdef PROTOTYPES XEXPORT int Xjs_printf(const char *form, ...) X#else XEXPORT int Xjs_printf(form, va_alist) X char *form; X va_dcl X#endif X{ X va_list args; X int ret; X X#ifdef PROTOTYPES X va_start(args, form); X#else X va_start(args); X#endif X ret = fprformat(stdout, form, args); X va_end(args); X return (ret); X} X X/* VARARGS2 */ X#ifdef PROTOTYPES XEXPORT int Xjs_fprintf(FILE *file, const char *form, ...) X#else XEXPORT int Xjs_fprintf(file, form, va_alist) X FILE *file; X char *form; X va_dcl X#endif X{ X va_list args; X int ret; X X#ifdef PROTOTYPES X va_start(args, form); X#else X va_start(args); X#endif X ret = fprformat(file, form, args); X va_end(args); X return (ret); X} X X#else /* !USE_FPRFORMAT */ X/* X * This is the portable standard implementation that works anywhere. X */ X X#define BFSIZ 256 X Xtypedef struct { X short cnt; X char *ptr; X char buf[BFSIZ]; X int count; X FILE *f; X} *BUF, _BUF; X XLOCAL void _bflush __PR((BUF)); XLOCAL void _bput __PR((char, void *)); XEXPORT int js_fprintf __PR((FILE *, const char *, ...)); XEXPORT int js_printf __PR((const char *, ...)); X XLOCAL void X_bflush(bp) X register BUF bp; X{ X bp->count += bp->ptr - bp->buf; X if (filewrite(bp->f, bp->buf, bp->ptr - bp->buf) < 0) X bp->count = EOF; X bp->ptr = bp->buf; X bp->cnt = BFSIZ; X} X X#ifdef PROTOTYPES XLOCAL void X_bput(char c, void *l) X#else XLOCAL void X_bput(c, l) X char c; X void *l; X#endif X{ X register BUF bp = (BUF)l; X X *bp->ptr++ = c; X if (--bp->cnt <= 0) X _bflush(bp); X} X X/* VARARGS1 */ X#ifdef PROTOTYPES XEXPORT int Xjs_printf(const char *form, ...) X#else XEXPORT int Xjs_printf(form, va_alist) X char *form; X va_dcl X#endif X{ X va_list args; X _BUF bb; X X bb.ptr = bb.buf; X bb.cnt = BFSIZ; X bb.count = 0; X bb.f = stdout; X#ifdef PROTOTYPES X va_start(args, form); X#else X va_start(args); X#endif X format(_bput, &bb, form, args); X va_end(args); X if (bb.cnt < BFSIZ) X _bflush(&bb); X return (bb.count); X} X X/* VARARGS2 */ X#ifdef PROTOTYPES XEXPORT int Xjs_fprintf(FILE *file, const char *form, ...) X#else XEXPORT int Xjs_fprintf(file, form, va_alist) X FILE *file; X char *form; X va_dcl X#endif X{ X va_list args; X _BUF bb; X X bb.ptr = bb.buf; X bb.cnt = BFSIZ; X bb.count = 0; X bb.f = file; X#ifdef PROTOTYPES X va_start(args, form); X#else X va_start(args); X#endif X format(_bput, &bb, form, args); X va_end(args); X if (bb.cnt < BFSIZ) X _bflush(&bb); X return (bb.count); X} X#endif END-of-star-1.6/libschily/jsprintf.c echo x - star-1.6/libschily/jssprintf.c sed 's/^X//' >star-1.6/libschily/jssprintf.c << 'END-of-star-1.6/libschily/jssprintf.c' X/* @(#)jssprintf.c 1.19 17/08/03 Copyright 1985, 1995-2017 J. Schilling */ X/* X * Copyright (c) 1985, 1995-2017 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X X/* X * Do not include stdio.h, BSD systems define sprintf the wrong way! X */ XEXPORT int js_sprintf __PR((char *, const char *, ...)); X X#ifdef PROTOTYPES Xstatic void X_cput(char c, void *ba) X#else Xstatic void X_cput(c, ba) X char c; X void *ba; X#endif X{ X *(*(char **)ba)++ = c; X} X X/* VARARGS2 */ X#ifdef PROTOTYPES XEXPORT int Xjs_sprintf(char *buf, const char *form, ...) X#else XEXPORT int Xjs_sprintf(buf, form, va_alist) X char *buf; X char *form; X va_dcl X#endif X{ X va_list args; X int cnt; X char *bp = buf; X X#ifdef PROTOTYPES X va_start(args, form); X#else X va_start(args); X#endif X cnt = format(_cput, &bp, form, args); X va_end(args); X *bp = '\0'; X X return (cnt); X} END-of-star-1.6/libschily/jssprintf.c echo x - star-1.6/libschily/cmpbytes.c sed 's/^X//' >star-1.6/libschily/cmpbytes.c << 'END-of-star-1.6/libschily/cmpbytes.c' X/* @(#)cmpbytes.c 1.23 10/08/21 Copyright 1988, 1995-2010 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)cmpbytes.c 1.23 10/08/21 Copyright 1988, 1995-2010 J. Schilling"; X#endif /* lint */ X/* X * compare data X * Return the index of the first differing character X * X * Copyright (c) 1988, 1995-2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X X#define DO8(a) a; a; a; a; a; a; a; a; X X/* X * Return the index of the first differing character X * This interface is not compatible to memcmp() X */ XEXPORT ssize_t Xcmpbytes(fromp, top, cnt) X const void *fromp; X const void *top; X ssize_t cnt; X{ X register const char *from = (char *)fromp; X register const char *to = (char *)top; X register ssize_t n; X register ssize_t i; X X /* X * If we change cnt to be unsigned, check for == instead of <= X */ X if ((n = cnt) <= 0) X return (cnt); X X /* X * Compare byte-wise until properly aligned for a long pointer. X */ X i = sizeof (long) - 1; X while (--n >= 0 && --i >= 0 && !l2aligned(from, to)) { X if (*to++ != *from++) X goto cdiff; X } X n++; X X if (n >= (ssize_t)(8 * sizeof (long))) { X if (l2aligned(from, to)) { X register const long *froml = (const long *)from; X register const long *tol = (const long *)to; X register ssize_t rem = n % (8 * sizeof (long)); X X n /= (8 * sizeof (long)); X do { X /* BEGIN CSTYLED */ X DO8( X if (*tol++ != *froml++) X break; X ); X /* END CSTYLED */ X } while (--n > 0); X X if (n > 0) { X --froml; X --tol; X to = (const char *)tol; X from = (const char *)froml; X goto ldiff; X } X to = (const char *)tol; X from = (const char *)froml; X n = rem; X } X X if (n >= 8) { X n -= 8; X do { X /* BEGIN CSTYLED */ X DO8( X if (*to++ != *from++) X goto cdiff; X ); X /* END CSTYLED */ X } while ((n -= 8) >= 0); X n += 8; X } X if (n > 0) do { X if (*to++ != *from++) X goto cdiff; X } while (--n > 0); X return (cnt); X } X if (n > 0) do { X if (*to++ != *from++) X goto cdiff; X } while (--n > 0); X return (cnt); Xldiff: X n = sizeof (long); X do { X if (*to++ != *from++) X goto cdiff; X } while (--n > 0); Xcdiff: X return ((ssize_t)(--from - (char *)fromp)); X} END-of-star-1.6/libschily/cmpbytes.c echo x - star-1.6/libschily/serrmsg.c sed 's/^X//' >star-1.6/libschily/serrmsg.c << 'END-of-star-1.6/libschily/serrmsg.c' X/* @(#)serrmsg.c 1.5 09/07/10 Copyright 1985, 2000-2003 J. Schilling */ X/* X * Routines for printing command errors X * X * Copyright (c) 1985, 2000-2003 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include /* include try to get size_t */ X#include /* Try again for size_t */ X#include /* Try again for size_t */ X#include X#include X#include X#include X#include X#ifndef HAVE_STRERROR Xextern char *sys_errlist[]; Xextern int sys_nerr; X#endif X XEXPORT int serrmsg __PR((char *buf, size_t maxcnt, const char *, ...)); XEXPORT int serrmsgno __PR((int, char *buf, size_t maxcnt, const char *, ...)); XLOCAL int _serrmsg __PR((int, char *buf, size_t maxcnt, const char *, va_list)); X X/* VARARGS1 */ XEXPORT int X#ifdef PROTOTYPES Xserrmsg(char *buf, size_t maxcnt, const char *msg, ...) X#else Xserrmsg(buf, maxcnt, msg, va_alist) X char *buf; X size_t maxcnt; X char *msg; X va_dcl X#endif X{ X va_list args; X int ret; X X#ifdef PROTOTYPES X va_start(args, msg); X#else X va_start(args); X#endif X ret = _serrmsg(geterrno(), buf, maxcnt, msg, args); X va_end(args); X return (ret); X} X X/* VARARGS2 */ X#ifdef PROTOTYPES XEXPORT int Xserrmsgno(int err, char *buf, size_t maxcnt, const char *msg, ...) X#else Xserrmsgno(err, buf, maxcnt, msg, va_alist) X int err; X char *buf; X size_t maxcnt; X char *msg; X va_dcl X#endif X{ X va_list args; X int ret; X X#ifdef PROTOTYPES X va_start(args, msg); X#else X va_start(args); X#endif X ret = _serrmsg(err, buf, maxcnt, msg, args); X va_end(args); X return (ret); X} X XLOCAL int X_serrmsg(err, buf, maxcnt, msg, args) X int err; X char *buf; X size_t maxcnt; X const char *msg; X va_list args; X{ X int ret; X char errbuf[20]; X char *errnam; X char *prognam = get_progname(); X X if (err < 0) { X ret = js_snprintf(buf, maxcnt, "%s: %r", prognam, msg, args); X } else { X errnam = errmsgstr(err); X if (errnam == NULL) { X (void) js_snprintf(errbuf, sizeof (errbuf), X "Error %d", err); X errnam = errbuf; X } X ret = js_snprintf(buf, maxcnt, X "%s: %s. %r", prognam, errnam, msg, args); X } X return (ret); X} END-of-star-1.6/libschily/serrmsg.c echo x - star-1.6/libschily/match.c sed 's/^X//' >star-1.6/libschily/match.c << 'END-of-star-1.6/libschily/match.c' X/* @(#)match.c 1.33 19/01/08 Copyright 1985, 1995-2019 J. Schilling */ X#include /* For Uchar */ X#include X#include X#define POSIX_CLASS /* Support [[:alpha:]] by default */ X#ifdef NO_POSIX_CLASS /* Allow to disable [[:alpha:]] */ X#undef POSIX_CLASS X#endif X#ifdef POSIX_CLASS X#include /* With [[:alpha:]], we need wctype() */ X#include /* and thus wchar.h and wctype.h */ X#endif X/* X * Pattern matching functions X * X * Copyright (c) 1985, 1995-2019 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X/* X * The pattern matching functions below are based on the algorithm X * presented by Martin Richards in: X * X * "A Compact Function for Regular Expression Pattern Matching", X * Software-Practice and Experience, Vol. 9, 527-534 (1979) X * X * Several changes have been made to the original source which has been X * written in BCPL: X * X * '/' is replaced by '!' (to allow UNIX filenames) X * '(',')' are replaced by '{', '}' X * '\'' is replaced by '\\' (UNIX compatible quote) X * X * Character classes have been added to allow "[]" X * to be used. X * POSIX features like [[:alpha:]] have been added. X * Start of line '^' and end of line '$' have been added. X */ X X#undef CHAR X X#ifdef __LINE_MATCH X#ifdef __WIDE_CHAR X#define patmatch patwlmatch X#else X#define opatmatch opatlmatch X#define patmatch patlmatch X#endif X#endif X X#ifdef __WIDE_CHAR X#ifndef __LINE_MATCH X#define patcompile patwcompile X#define patmatch patwmatch X#endif X#define CHAR wchar_t X#define PCHAR wchar_t X#endif X X#ifdef __MB_CHAR X#undef patmatch X#ifdef __LINE_MATCH X#define patmatch patmblmatch X#else X#define patmatch patmbmatch X#endif X#define PCHAR wchar_t X#endif X X#ifndef CHAR X#define CHAR Uchar X#endif X X#ifndef PCHAR X#define PCHAR Uchar X#endif X X#define ENDSTATE (-1) X X#define CL_SIZE 32 /* Max size for '[: :]' */ X X/* X * The Interpreter X */ X X X/* X * put adds a new state to the active list X */ X#define put(ret, state, sp, n) { \ X register int *lstate = state; \ X register int *lsp = sp; \ X register int ln = n; \ X \ X while (lstate < lsp) { \ X if (*lstate++ == ln) { \ X ret = lsp; \ X lsp = 0; \ X break; \ X } \ X } \ X if (lsp) { \ X *lstate++ = ln; \ X ret = lstate; \ X } \ X} X X X/* X * match a character in class X * X * Syntax errors do not appear here, they are handled by the compiler, X * so in theory we could remove the "return (0)" statements from the X * the POSIX class code. X */ X#ifdef POSIX_CLASS X#define CHK_POSIX_CLASS \ X if (*lpat == LCLASS) { \ X if (lpat[1] == ':') { \ X char class[CL_SIZE+1]; \ X char *pc = class; \ X \ X lpat += 2; /* Eat ':' */ \ X for (;;) { \ X if (*lpat == '\0') { \ X ok = FALSE; \ X goto out; \ X } \ X if (*lpat == ':' && lpat[1] == RCLASS) \ X break; \ X if (pc >= &class[CL_SIZE]) { \ X ok = FALSE; \ X goto out; \ X } \ X *pc++ = *lpat++; \ X } \ X if (pc == class) { \ X ok = FALSE; \ X goto out; \ X } \ X *pc = '\0'; \ X lpat += 2; /* Skip ":]" */ \ X if (iswctype(lc, wctype(class))) { \ X ok = !ok; \ X goto out; \ X } \ X continue; \ X } \ X } else X#else X#define CHK_POSIX_CLASS X#endif X#define in_class(found, pat, c) { \ X register const PCHAR *lpat = pat; \ X register int lc = c; \ X int lo_bound; \ X int hi_bound; \ X BOOL ok = FALSE; \ X \ X if (*lpat == NOT) { \ X lpat++; \ X ok = TRUE; \ X } \ X while (*lpat != RCLASS) { \ X if (*lpat == '\0') { \ X ok = FALSE; \ X goto out; \ X } \ X CHK_POSIX_CLASS \ X if (*lpat == QUOTE) \ X lpat++; \ X lo_bound = *lpat++; \ X if (*lpat == RANGE && lpat[1] != RCLASS) { \ X lpat++; \ X if (*lpat == QUOTE) \ X lpat++; \ X hi_bound = *lpat++; \ X } else { \ X hi_bound = lo_bound; \ X } \ X if (lo_bound <= lc && lc <= hi_bound) { \ X ok = !ok; \ X goto out; \ X } \ X } \ Xout: \ X found = ok; \ X} X X/* X * opatmatch - the old external interpreter interface. X * X * Trys to match a string beginning at offset X * against the compiled pattern. X */ X#if !defined(__WIDE_CHAR) && !defined(__MB_CHAR) XEXPORT CHAR X*opatmatch(pat, aux, str, soff, slen, alt) X const PCHAR *pat; X const int *aux; X const CHAR *str; X int soff; X int slen; X int alt; X{ X int state[MAXPAT]; X X return (patmatch(pat, aux, str, soff, slen, alt, state)); X} X#endif X X/* X * patmatch - the external interpreter interface. X * X * Trys to match a string beginning at offset X * against the compiled pattern. X */ XEXPORT CHAR * Xpatmatch(pat, aux, str, soff, slen, alt, state) X const PCHAR *pat; X const int *aux; X const CHAR *str; X int soff; X int slen; X int alt; X int state[]; X{ X register int *sp; X register int *n; X register int *i; X register int p; X register int q, s, k; X#ifdef __MB_CHAR X wchar_t c; X int mlen = 1; X#else X int c; X#endif X const CHAR *lastp = (CHAR *)NULL; X X#ifdef __LINE_MATCH Xfor (; soff <= slen; soff++) { X#endif X X sp = state; X put(sp, state, state, 0); X if (alt != ENDSTATE) X put(sp, state, sp, alt); X X#ifdef __MB_CHAR X mbtowc(NULL, NULL, 0); X for (s = soff; ; s += mlen) { X#else X for (s = soff; ; s++) { X#endif X /* X * next char from input string X */ X if (s >= slen) { X c = 0; X } else { X#ifdef __MB_CHAR X mlen = mbtowc(&c, (char *)&str[s], slen - s); X if (mlen < 0) { X mbtowc(NULL, NULL, 0); X c = str[s]; X mlen = 1; X } X#else X c = str[s]; X#endif X } X /* X * first complete the closure X */ X for (n = state; n < sp; ) { X p = *n++; /* next state number */ X if (p == ENDSTATE) X continue; X q = aux[p]; /* get next state for pat */ X k = pat[p]; /* get next char from pat */ X switch (k) { X X case REP: X put(sp, state, sp, p+1); X /* FALLTHRU */ X case NIL: /* NIL matches always */ X case STAR: X put(sp, state, sp, q); X break; X case LBRACK: /* alternations */ X case ALT: X put(sp, state, sp, p+1); X if (q != ENDSTATE) X put(sp, state, sp, q); X break; X case START: X if (s == 0) X put(sp, state, sp, q); X break; X case END: X if (c == '\0') X put(sp, state, sp, q); X break; X } X } X X for (i = state; i < sp; ) { X if (*i++ == ENDSTATE) { X lastp = &str[s]; X break; X } X } X if (c == 0) X return ((CHAR *)lastp); X X /* X * now try to match next character X */ X n = sp; X sp = state; X for (i = sp; i < n; ) { X p = *i++; /* next active state number */ X if (p == ENDSTATE) X continue; X k = pat[p]; X switch (k) { X X case ALT: X case REP: X case NIL: X case LBRACK: X case START: X case END: X continue; X case LCLASS: X in_class(q, &pat[p+1], c); X if (!q) X continue; X break; X case STAR: X put(sp, state, sp, p); X continue; X case QUOTE: X k = pat[p+1]; X /* FALLTHRU */ X default: X if (k != c) X continue; X /* FALLTHRU */ X case ANY: X break; X } X put(sp, state, sp, aux[p]); X } X if (sp == state) { /* if no new states return */ X#ifdef __LINE_MATCH X X if (lastp || (soff == slen - 1)) X return ((CHAR *)lastp); X else X break; X#else X return ((CHAR *)lastp); X#endif X } X } X#ifdef __LINE_MATCH X} Xreturn ((CHAR *)lastp); X#endif X} X X X#if !defined(__LINE_MATCH) && !defined(__MB_CHAR) X/* X * The Compiler X */ X Xtypedef struct args { X const PCHAR *pattern; X int *aux; X int patp; X int length; X PCHAR Ch; X} arg_t; X XLOCAL void nextitem __PR((arg_t *)); XLOCAL int prim __PR((arg_t *)); XLOCAL int expr __PR((arg_t *, int *)); XLOCAL void setexits __PR((int *, int, int)); XLOCAL int join __PR((int *, int, int)); X X/* X * 'read' the next character from pattern X */ X#define rch(ap) \ X{ \ X if (++(ap)->patp >= (ap)->length) \ X (ap)->Ch = 0; \ X else \ X (ap)->Ch = (ap)->pattern[(ap)->patp]; \ X} X X/* X * 'peek' the next character from pattern X */ X#define pch(ap) \ X ((((ap)->patp + 1) >= (ap)->length) ? \ X 0 \ X : \ X (ap)->pattern[(ap)->patp+1]) \ X X/* X * get the next item from pattern X */ XLOCAL void Xnextitem(ap) X arg_t *ap; X{ X if (ap->Ch == QUOTE) X rch(ap); X rch(ap); X} X X/* X * parse a primary X */ XLOCAL int Xprim(ap) X arg_t *ap; X{ X int a = ap->patp; X int op = ap->Ch; X int t; X X nextitem(ap); X switch (op) { X X case '\0': X case ALT: X case RBRACK: X return (ENDSTATE); X case LCLASS: X if (ap->Ch == NOT) X nextitem(ap); /* Eat '^' at first position */ X if (ap->Ch != LCLASS) X nextitem(ap); /* Eat char at first position */ X X while (ap->Ch != RCLASS && ap->Ch != '\0') { X#ifdef POSIX_CLASS X if (ap->Ch == LCLASS) { X if (pch(ap) == ':') { /* [:alpha:] */ X char class[CL_SIZE+1]; X char *pc = class; X X nextitem(ap); X nextitem(ap); X while (ap->Ch != ':' && X ap->Ch != '\0') { X if (pc >= &class[CL_SIZE]) X return (ENDSTATE); X *pc = ap->Ch; X if (*pc++ != ap->Ch) X return (ENDSTATE); X nextitem(ap); X } X if (pc == class) X return (ENDSTATE); X *pc = '\0'; X if (ap->Ch == '\0') X return (ENDSTATE); X if (wctype(class) == 0) X return (ENDSTATE); X nextitem(ap); X } X if (ap->Ch != RCLASS) X return (ENDSTATE); X } X#endif X /* X * A '-' before the ending ']' does not have the X * special range meaning. X */ X if (ap->Ch == RANGE && X pch(ap) != RCLASS) /* One more char required */ X nextitem(ap); /* so get char past '-' */ X nextitem(ap); X } X if (ap->Ch == '\0') X return (ENDSTATE); X nextitem(ap); X break; X case REP: X t = prim(ap); X if (t == ENDSTATE) X return (ENDSTATE); X setexits(ap->aux, t, a); X break; X case LBRACK: X a = expr(ap, &ap->aux[a]); X if (a == ENDSTATE || ap->Ch != RBRACK) X return (ENDSTATE); X nextitem(ap); X break; X } X return (a); X} X X/* X * parse an expression (a sequence of primaries) X */ XLOCAL int Xexpr(ap, altp) X arg_t *ap; X int *altp; X{ X int exits = ENDSTATE; X int a; X int *aux = ap->aux; X PCHAR Ch; X X for (;;) { X a = prim(ap); X if (a == ENDSTATE) X return (ENDSTATE); X Ch = ap->Ch; X if (Ch == ALT || Ch == RBRACK || Ch == '\0') { X exits = join(aux, exits, a); X if (Ch != ALT) X return (exits); X *altp = ap->patp; X altp = &aux[ap->patp]; X nextitem(ap); X } else X setexits(aux, a, ap->patp); X } X} X X/* X * set all exits in a list to a specified value X */ XLOCAL void Xsetexits(aux, list, val) X int *aux; X int list; X int val; X{ X int a; X X while (list != ENDSTATE) { X a = aux[list]; X aux[list] = val; X list = a; X } X} X X/* X * concatenate two lists X */ XLOCAL int Xjoin(aux, a, b) X int *aux; X int a; X int b; X{ X int t; X X if (a == ENDSTATE) X return (b); X t = a; X while (aux[t] != ENDSTATE) X t = aux[t]; X aux[t] = b; X return (a); X} X X/* X * patcompile - the external compiler interface. X * X * The pattern is compiled into the aux array. X * Return value on success, is the outermost alternate which is != 0. X * Error is indicated by return of 0. X */ XEXPORT int Xpatcompile(pat, len, aux) X const PCHAR *pat; X int len; X int *aux; X{ X arg_t a; X int alt = ENDSTATE; X int i; X X a.pattern = pat; X a.length = len; X a.aux = aux; X a.patp = -1; X X for (i = 0; i < len; i++) X aux[i] = ENDSTATE; X rch(&a); X i = expr(&a, &alt); X if (i == ENDSTATE) X return (0); X setexits(aux, i, ENDSTATE); X return (alt); X} X#endif /* !defined(__LINE_MATCH) && !defined(__MB_CHAR) */ END-of-star-1.6/libschily/match.c echo x - star-1.6/libschily/astoll.c sed 's/^X//' >star-1.6/libschily/astoll.c << 'END-of-star-1.6/libschily/astoll.c' X/* @(#)astoll.c 1.5 15/12/10 Copyright 1985, 2000-2015 J. Schilling */ X/* X * astoll() converts a string to long long X * X * Leading tabs and spaces are ignored. X * Both return pointer to the first char that has not been used. X * Caller must check if this means a bad conversion. X * X * leading "+" is ignored X * leading "0" makes conversion octal (base 8) X * leading "0x" makes conversion hex (base 16) X * X * Llong is silently reverted to long if the compiler does not X * support long long. X * X * Copyright (c) 1985, 2000-2015 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X X#define is_space(c) ((c) == ' ' || (c) == '\t') X#define is_digit(c) ((c) >= '0' && (c) <= '9') X#define is_hex(c) (\ X ((c) >= 'a' && (c) <= 'f') || \ X ((c) >= 'A' && (c) <= 'F')) X X#define is_lower(c) ((c) >= 'a' && (c) <= 'z') X#define is_upper(c) ((c) >= 'A' && (c) <= 'Z') X#define to_lower(c) (((c) >= 'A' && (c) <= 'Z') ? (c) - 'A'+'a' : (c)) X X#if ('i' + 1) < 'j' X#define BASE_MAX ('i' - 'a' + 10 + 1) /* This is EBCDIC */ X#else X#define BASE_MAX ('z' - 'a' + 10 + 1) /* This is ASCII */ X#endif X X Xchar * Xastoll(s, l) X register const char *s; X Llong *l; X{ X return (astollb(s, l, 0)); X} X Xchar * Xastollb(s, l, base) X register const char *s; X Llong *l; X register int base; X{ X int neg = 0; X register ULlong ret = (ULlong)0; X ULlong maxmult; X ULlong maxval; X register int digit; X register char c; X X if (base > BASE_MAX || base == 1 || base < 0) { X seterrno(EINVAL); X return ((char *)s); X } X X while (is_space(*s)) X s++; X X if (*s == '+') { X s++; X } else if (*s == '-') { X s++; X neg++; X } X X if (base == 0) { X if (*s == '0') { X base = 8; X s++; X if (*s == 'x' || *s == 'X') { X s++; X base = 16; X } X } else { X base = 10; X } X } X if (neg) { X /* X * Portable way to compute the positive value of "min-Llong" X * as -TYPE_MINVAL(Llong) does not work. X */ X maxval = ((ULlong)(-1 * (TYPE_MINVAL(Llong)+1))) + 1; X } else { X maxval = TYPE_MAXVAL(Llong); X } X maxmult = maxval / base; X for (; (c = *s) != 0; s++) { X X if (is_digit(c)) { X digit = c - '0'; X } else if (is_lower(c)) { X digit = c - 'a' + 10; X } else if (is_upper(c)) { X digit = c - 'A' + 10; X } else { X break; X } X X if (digit < base) { X if (ret > maxmult) X goto overflow; X ret *= base; X if (maxval - ret < digit) X goto overflow; X ret += digit; X } else { X break; X } X } X if (neg) { X *l = (Llong)-1 * ret; X } else { X *l = (Llong)ret; X } X return ((char *)s); Xoverflow: X for (; (c = *s) != 0; s++) { X X if (is_digit(c)) { X digit = c - '0'; X } else if (is_lower(c)) { X digit = c - 'a' + 10; X } else if (is_upper(c)) { X digit = c - 'A' + 10; X } else { X break; X } X if (digit >= base) X break; X } X if (neg) { X *l = TYPE_MINVAL(Llong); X } else { X *l = TYPE_MAXVAL(Llong); X } X seterrno(ERANGE); X return ((char *)s); X} END-of-star-1.6/libschily/astoll.c echo x - star-1.6/libschily/seterrno.c sed 's/^X//' >star-1.6/libschily/seterrno.c << 'END-of-star-1.6/libschily/seterrno.c' X/* @(#)seterrno.c 1.13 10/08/23 Copyright 1985, 1995-2010 J. Schilling */ X/* X * Set error number X * X * Copyright (c) 1985, 1995-2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _TS_ERRNO X#define _TS_ERRNO /* Solaris: get thread safe errno value */ X#endif X#ifndef _LIBC_REENTRANT X#define _LIBC_REENTRANT /* Linux: get thread safe errno value */ X#endif X#include X#include X#include X X#ifdef seterrno X#undef seterrno X#endif X XEXPORT int Xseterrno(err) X int err; X{ X int old = errno; X X errno = err; X return (old); X} END-of-star-1.6/libschily/seterrno.c echo x - star-1.6/libschily/strtod.c sed 's/^X//' >star-1.6/libschily/strtod.c << 'END-of-star-1.6/libschily/strtod.c' X/* @(#)strtod.c 1.5 10/08/21 joerg */ X X/* $NetBSD: strtod.c,v 1.23 1996/10/13 00:07:55 christos Exp $ */ X/* X * The layout for this file was done by AT&T, we did not change it. X * Switch off cstyle(1) checks for now. X */ X/* BEGIN CSTYLED */ X X/**************************************************************** X * X * The author of this software is David M. Gay. X * X * Copyright (c) 1991 by AT&T. X * X * Permission to use, copy, modify, and distribute this software for any X * purpose without fee is hereby granted, provided that this entire notice X * is included in all copies of any software which is or includes a copy X * or modification of this software and in all copies of the supporting X * documentation for such software. X * X * THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED X * WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR AT&T MAKES ANY X * REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY X * OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. X * X ***************************************************************/ X X/* Please send bug reports to X David M. Gay X AT&T Bell Laboratories, Room 2C-463 X 600 Mountain Avenue X Murray Hill, NJ 07974-2070 X U.S.A. X dmg@research.att.com or research!dmg X */ X X/* strtod for IEEE-, VAX-, and IBM-arithmetic machines. X * X * This strtod returns a nearest machine number to the input decimal X * string (or sets errno to ERANGE). With IEEE arithmetic, ties are X * broken by the IEEE round-even rule. Otherwise ties are broken by X * biased rounding (add half and chop). X * X * Inspired loosely by William D. Clinger's paper "How to Read Floating X * Point Numbers Accurately" [Proc. ACM SIGPLAN '90, pp. 92-101]. X * X * Modifications: X * X * 1. We only require IEEE, IBM, or VAX double-precision X * arithmetic (not IEEE double-extended). X * 2. We get by with floating-point arithmetic in a case that X * Clinger missed -- when we're computing d * 10^n X * for a small integer d and the integer n is not too X * much larger than 22 (the maximum integer k for which X * we can represent 10^k exactly), we may be able to X * compute (d*10^k) * 10^(e-k) with just one roundoff. X * 3. Rather than a bit-at-a-time adjustment of the binary X * result in the hard case, we use floating-point X * arithmetic to determine the adjustment to within X * one bit; only in really hard cases do we need to X * compute a second residual. X * 4. Because of 3., we don't need a large table of powers of 10 X * for ten-to-e (just some small tables, e.g. of 10^k X * for 0 <= k <= 22). X */ X X/* X * #define IEEE_LITTLE_ENDIAN for IEEE-arithmetic machines where the least X * significant byte has the lowest address. X * #define IEEE_BIG_ENDIAN for IEEE-arithmetic machines where the most X * significant byte has the lowest address. X * #define Long int on machines with 32-bit ints and 64-bit longs. X * #define Sudden_Underflow for IEEE-format machines without gradual X * underflow (i.e., that flush to zero on underflow). X * #define IBM for IBM mainframe-style floating-point arithmetic. X * #define VAX for VAX-style floating-point arithmetic. X * #define Unsigned_Shifts if >> does treats its left operand as unsigned. X * #define No_leftright to omit left-right logic in fast floating-point X * computation of dtoa. X * #define Check_FLT_ROUNDS if FLT_ROUNDS can assume the values 2 or 3. X * #define RND_PRODQUOT to use rnd_prod and rnd_quot (assembly routines X * that use extended-precision instructions to compute rounded X * products and quotients) with IBM. X * #define ROUND_BIASED for IEEE-format with biased rounding. X * #define Inaccurate_Divide for IEEE-format with correctly rounded X * products but inaccurate quotients, e.g., for Intel i860. X * #define Just_16 to store 16 bits per 32-bit Long when doing high-precision X * integer arithmetic. Whether this speeds things up or slows things X * down depends on the machine and the number being converted. X * #define KR_headers for old-style C function headers. X * #define Bad_float_h if your system lacks a float.h or if it does not X * define some or all of DBL_DIG, DBL_MAX_10_EXP, DBL_MAX_EXP, X * FLT_RADIX, FLT_ROUNDS, and DBL_MAX. X * #define MALLOC your_malloc, where your_malloc(n) acts like malloc(n) X * if memory is available and otherwise does something you deem X * appropriate. If MALLOC is undefined, malloc will be invoked X * directly -- and assumed always to succeed. X */ X X#if defined(LIBC_SCCS) && !defined(lint) Xstatic char *rcsid = "$NetBSD: strtod.c,v 1.23 1996/10/13 00:07:55 christos Exp $"; X#endif /* LIBC_SCCS and not lint */ X X#include X#include X X#ifdef __OLD_NETBSD_DEFINES__ X X#if defined(__m68k__) || defined(__sparc__) || defined(__i386__) || \ X defined(__mips__) || defined(__ns32k__) || defined(__alpha__) || \ X defined(__powerpc__) X#include X#if BYTE_ORDER == BIG_ENDIAN X#define IEEE_BIG_ENDIAN X#else X#define IEEE_LITTLE_ENDIAN X#endif X#endif X X#else /* __OLD_NETBSD_DEFINES__ */ X X#if !defined(__arm32__) && !defined(vax) && !defined(IBM) X X/*#ifdef _BIG_ENDIAN*/ X#ifdef WORDS_BIGENDIAN X#define IEEE_BIG_ENDIAN X#else X#define IEEE_LITTLE_ENDIAN X#endif X X#endif /* !defined(__arm32__) && !defined(vax) && !defined(IBM) */ X X#endif /* __OLD_NETBSD_DEFINES__ */ X X#ifdef __arm32__ X/* X * Although the CPU is little endian the FP has different X * byte and word endianness. The byte order is still little endian X * but the word order is big endian. X */ X#define IEEE_BIG_ENDIAN X#endif X X#ifdef vax X#define VAX X#endif X X#include X#define Long Int32_t X#define ULong UInt32_t X X#ifdef DEBUG X#include X#define Bug(x) {fprintf(stderr, "%s\n", x); exit(1);} X#endif X X#ifdef __cplusplus X#include "malloc.h" X#include "memory.h" X#else X#ifndef KR_headers X#include "stdlib.h" X#include "string.h" X#include "locale.h" X#else X#include "malloc.h" X#include "memory.h" X#endif X#endif X X#ifdef MALLOC X#ifdef KR_headers Xextern char *MALLOC(); X#else Xextern void *MALLOC(size_t); X#endif X#else X#define MALLOC malloc X#endif X X#include X#include X X#ifdef Bad_float_h X#undef __STDC__ X#ifdef IEEE_BIG_ENDIAN X#define IEEE_ARITHMETIC X#endif X#ifdef IEEE_LITTLE_ENDIAN X#define IEEE_ARITHMETIC X#endif X X#ifdef IEEE_ARITHMETIC X#define DBL_DIG 15 X#define DBL_MAX_10_EXP 308 X#define DBL_MAX_EXP 1024 X#define FLT_RADIX 2 X#define FLT_ROUNDS 1 X#define DBL_MAX 1.7976931348623157e+308 X#endif X X#ifdef IBM X#define DBL_DIG 16 X#define DBL_MAX_10_EXP 75 X#define DBL_MAX_EXP 63 X#define FLT_RADIX 16 X#define FLT_ROUNDS 0 X#define DBL_MAX 7.2370055773322621e+75 X#endif X X#ifdef VAX X#define DBL_DIG 16 X#define DBL_MAX_10_EXP 38 X#define DBL_MAX_EXP 127 X#define FLT_RADIX 2 X#define FLT_ROUNDS 1 X#define DBL_MAX 1.7014118346046923e+38 X#endif X X#ifndef LONG_MAX X#define LONG_MAX 2147483647 X#endif X X#else /* Bad_float_h */ X#include X#endif /* Bad_float_h */ X/*#ifndef __MATH_H__*/ X#include X/*#endif*/ X X#ifdef __cplusplus Xextern "C" { X#endif X X#ifndef CONST X#ifdef KR_headers X#define CONST /* blank */ X#else X#define CONST const X#endif X#endif X X#ifdef Unsigned_Shifts X#define Sign_Extend(a,b) if (b < 0) a |= 0xffff0000; X#else X#define Sign_Extend(a,b) /*no-op*/ X#endif X X#if defined(IEEE_LITTLE_ENDIAN) + defined(IEEE_BIG_ENDIAN) + defined(VAX) + \ X defined(IBM) != 1 XExactly one of IEEE_LITTLE_ENDIAN IEEE_BIG_ENDIAN, VAX, or XIBM should be defined. X#endif X X#ifdef IEEE_LITTLE_ENDIAN X#define word0(x) ((ULong *)&x)[1] X#define word1(x) ((ULong *)&x)[0] X#else X#define word0(x) ((ULong *)&x)[0] X#define word1(x) ((ULong *)&x)[1] X#endif X X/* The following definition of Storeinc is appropriate for MIPS processors. X * An alternative that might be better on some machines is X * #define Storeinc(a,b,c) (*a++ = b << 16 | c & 0xffff) X */ X#if defined(IEEE_LITTLE_ENDIAN) + defined(VAX) + defined(__arm32__) X#define Storeinc(a,b,c) (((unsigned short *)a)[1] = (unsigned short)b, \ X((unsigned short *)a)[0] = (unsigned short)c, a++) X#else X#define Storeinc(a,b,c) (((unsigned short *)a)[0] = (unsigned short)b, \ X((unsigned short *)a)[1] = (unsigned short)c, a++) X#endif X X/* #define P DBL_MANT_DIG */ X/* Ten_pmax = floor(P*log(2)/log(5)) */ X/* Bletch = (highest power of 2 < DBL_MAX_10_EXP) / 16 */ X/* Quick_max = floor((P-1)*log(FLT_RADIX)/log(10) - 1) */ X/* Int_max = floor(P*log(FLT_RADIX)/log(10) - 1) */ X X#if defined(IEEE_LITTLE_ENDIAN) + defined(IEEE_BIG_ENDIAN) X#define Exp_shift 20 X#define Exp_shift1 20 X#define Exp_msk1 0x100000 X#define Exp_msk11 0x100000 X#define Exp_mask 0x7ff00000 X#define P 53 X#define Bias 1023 X#define IEEE_Arith X#define Emin (-1022) X#define Exp_1 0x3ff00000 X#define Exp_11 0x3ff00000 X#define Ebits 11 X#define Frac_mask 0xfffff X#define Frac_mask1 0xfffff X#define Ten_pmax 22 X#define Bletch 0x10 X#define Bndry_mask 0xfffff X#define Bndry_mask1 0xfffff X#define LSB 1 X#define Sign_bit 0x80000000 X#define Log2P 1 X#define Tiny0 0 X#define Tiny1 1 X#define Quick_max 14 X#define Int_max 14 X#define Infinite(x) (word0(x) == 0x7ff00000) /* sufficient test for here */ X#else X#undef Sudden_Underflow X#define Sudden_Underflow X#ifdef IBM X#define Exp_shift 24 X#define Exp_shift1 24 X#define Exp_msk1 0x1000000 X#define Exp_msk11 0x1000000 X#define Exp_mask 0x7f000000 X#define P 14 X#define Bias 65 X#define Exp_1 0x41000000 X#define Exp_11 0x41000000 X#define Ebits 8 /* exponent has 7 bits, but 8 is the right value in b2d */ X#define Frac_mask 0xffffff X#define Frac_mask1 0xffffff X#define Bletch 4 X#define Ten_pmax 22 X#define Bndry_mask 0xefffff X#define Bndry_mask1 0xffffff X#define LSB 1 X#define Sign_bit 0x80000000 X#define Log2P 4 X#define Tiny0 0x100000 X#define Tiny1 0 X#define Quick_max 14 X#define Int_max 15 X#else /* VAX */ X#define Exp_shift 23 X#define Exp_shift1 7 X#define Exp_msk1 0x80 X#define Exp_msk11 0x800000 X#define Exp_mask 0x7f80 X#define P 56 X#define Bias 129 X#define Exp_1 0x40800000 X#define Exp_11 0x4080 X#define Ebits 8 X#define Frac_mask 0x7fffff X#define Frac_mask1 0xffff007f X#define Ten_pmax 24 X#define Bletch 2 X#define Bndry_mask 0xffff007f X#define Bndry_mask1 0xffff007f X#define LSB 0x10000 X#define Sign_bit 0x8000 X#define Log2P 1 X#define Tiny0 0x80 X#define Tiny1 0 X#define Quick_max 15 X#define Int_max 15 X#endif X#endif X X#ifndef IEEE_Arith X#define ROUND_BIASED X#endif X X#ifdef RND_PRODQUOT X#define rounded_product(a,b) a = rnd_prod(a, b) X#define rounded_quotient(a,b) a = rnd_quot(a, b) X#ifdef KR_headers Xextern double rnd_prod(), rnd_quot(); X#else Xextern double rnd_prod(double, double), rnd_quot(double, double); X#endif X#else X#define rounded_product(a,b) a *= b X#define rounded_quotient(a,b) a /= b X#endif X X#define Big0 (Frac_mask1 | Exp_msk1*(DBL_MAX_EXP+Bias-1)) X#define Big1 0xffffffff X X#ifndef Just_16 X/* When Pack_32 is not defined, we store 16 bits per 32-bit Long. X * This makes some inner loops simpler and sometimes saves work X * during multiplications, but it often seems to make things slightly X * slower. Hence the default is now to store 32 bits per Long. X */ X#ifndef Pack_32 X#define Pack_32 X#endif X#endif X X#define Kmax 15 X X#ifdef __cplusplus Xextern "C" double strtod(const char *s00, char **se); Xextern "C" char *__dtoa(double d, int mode, int ndigits, X int *decpt, int *sign, char **rve); X#endif X X struct XBigint { X struct Bigint *next; X int k, maxwds, sign, wds; X ULong x[1]; X }; X X typedef struct Bigint Bigint; X X static Bigint *freelist[Kmax+1]; X X static Bigint * XBalloc X#ifdef KR_headers X (k) int k; X#else X (int k) X#endif X{ X int x; X Bigint *rv; X X if (rv = freelist[k]) { X freelist[k] = rv->next; X } X else { X x = 1 << k; X rv = (Bigint *)MALLOC(sizeof(Bigint) + (x-1)*sizeof(Long)); X rv->k = k; X rv->maxwds = x; X } X rv->sign = rv->wds = 0; X return rv; X } X X static void XBfree X#ifdef KR_headers X (v) Bigint *v; X#else X (Bigint *v) X#endif X{ X if (v) { X v->next = freelist[v->k]; X freelist[v->k] = v; X } X } X X#define Bcopy(x,y) memcpy((char *)&x->sign, (char *)&y->sign, \ Xy->wds*sizeof(Long) + 2*sizeof(int)) X X static Bigint * Xmultadd X#ifdef KR_headers X (b, m, a) Bigint *b; int m, a; X#else X (Bigint *b, int m, int a) /* multiply by m and add a */ X#endif X{ X int i, wds; X ULong *x, y; X#ifdef Pack_32 X ULong xi, z; X#endif X Bigint *b1; X X wds = b->wds; X x = b->x; X i = 0; X do { X#ifdef Pack_32 X xi = *x; X y = (xi & 0xffff) * m + a; X z = (xi >> 16) * m + (y >> 16); X a = (int)(z >> 16); X *x++ = (z << 16) + (y & 0xffff); X#else X y = *x * m + a; X a = (int)(y >> 16); X *x++ = y & 0xffff; X#endif X } X while(++i < wds); X if (a) { X if (wds >= b->maxwds) { X b1 = Balloc(b->k+1); X Bcopy(b1, b); X Bfree(b); X b = b1; X } X b->x[wds++] = a; X b->wds = wds; X } X return b; X } X X static Bigint * Xs2b X#ifdef KR_headers X (s, nd0, nd, y9) CONST char *s; int nd0, nd; ULong y9; X#else X (CONST char *s, int nd0, int nd, ULong y9) X#endif X{ X Bigint *b; X int i, k; X Long x, y; X X x = (nd + 8) / 9; X for(k = 0, y = 1; x > y; y <<= 1, k++) ; X#ifdef Pack_32 X b = Balloc(k); X b->x[0] = y9; X b->wds = 1; X#else X b = Balloc(k+1); X b->x[0] = y9 & 0xffff; X b->wds = (b->x[1] = y9 >> 16) ? 2 : 1; X#endif X X i = 9; X if (9 < nd0) { X s += 9; X do b = multadd(b, 10, *s++ - '0'); X while(++i < nd0); X s++; X } X else X s += 10; X for(; i < nd; i++) X b = multadd(b, 10, *s++ - '0'); X return b; X } X X static int Xhi0bits X#ifdef KR_headers X (x) register ULong x; X#else X (register ULong x) X#endif X{ X register int k = 0; X X if (!(x & 0xffff0000)) { X k = 16; X x <<= 16; X } X if (!(x & 0xff000000)) { X k += 8; X x <<= 8; X } X if (!(x & 0xf0000000)) { X k += 4; X x <<= 4; X } X if (!(x & 0xc0000000)) { X k += 2; X x <<= 2; X } X if (!(x & 0x80000000)) { X k++; X if (!(x & 0x40000000)) X return 32; X } X return k; X } X X static int Xlo0bits X#ifdef KR_headers X (y) ULong *y; X#else X (ULong *y) X#endif X{ X register int k; X register ULong x = *y; X X if (x & 7) { X if (x & 1) X return 0; X if (x & 2) { X *y = x >> 1; X return 1; X } X *y = x >> 2; X return 2; X } X k = 0; X if (!(x & 0xffff)) { X k = 16; X x >>= 16; X } X if (!(x & 0xff)) { X k += 8; X x >>= 8; X } X if (!(x & 0xf)) { X k += 4; X x >>= 4; X } X if (!(x & 0x3)) { X k += 2; X x >>= 2; X } X if (!(x & 1)) { X k++; X x >>= 1; X if (!x & 1) X return 32; X } X *y = x; X return k; X } X X static Bigint * Xi2b X#ifdef KR_headers X (i) int i; X#else X (int i) X#endif X{ X Bigint *b; X X b = Balloc(1); X b->x[0] = i; X b->wds = 1; X return b; X } X X static Bigint * Xmult X#ifdef KR_headers X (a, b) Bigint *a, *b; X#else X (Bigint *a, Bigint *b) X#endif X{ X Bigint *c; X int k, wa, wb, wc; X ULong carry, y, z; X ULong *x, *xa, *xae, *xb, *xbe, *xc, *xc0; X#ifdef Pack_32 X ULong z2; X#endif X X if (a->wds < b->wds) { X c = a; X a = b; X b = c; X } X k = a->k; X wa = a->wds; X wb = b->wds; X wc = wa + wb; X if (wc > a->maxwds) X k++; X c = Balloc(k); X for(x = c->x, xa = x + wc; x < xa; x++) X *x = 0; X xa = a->x; X xae = xa + wa; X xb = b->x; X xbe = xb + wb; X xc0 = c->x; X#ifdef Pack_32 X for(; xb < xbe; xb++, xc0++) { X if (y = *xb & 0xffff) { X x = xa; X xc = xc0; X carry = 0; X do { X z = (*x & 0xffff) * y + (*xc & 0xffff) + carry; X carry = z >> 16; X z2 = (*x++ >> 16) * y + (*xc >> 16) + carry; X carry = z2 >> 16; X Storeinc(xc, z2, z); X } X while(x < xae); X *xc = carry; X } X if (y = *xb >> 16) { X x = xa; X xc = xc0; X carry = 0; X z2 = *xc; X do { X z = (*x & 0xffff) * y + (*xc >> 16) + carry; X carry = z >> 16; X Storeinc(xc, z, z2); X z2 = (*x++ >> 16) * y + (*xc & 0xffff) + carry; X carry = z2 >> 16; X } X while(x < xae); X *xc = z2; X } X } X#else X for(; xb < xbe; xc0++) { X if (y = *xb++) { X x = xa; X xc = xc0; X carry = 0; X do { X z = *x++ * y + *xc + carry; X carry = z >> 16; X *xc++ = z & 0xffff; X } X while(x < xae); X *xc = carry; X } X } X#endif X for(xc0 = c->x, xc = xc0 + wc; wc > 0 && !*--xc; --wc) ; X c->wds = wc; X return c; X } X X static Bigint *p5s; X X static Bigint * Xpow5mult X#ifdef KR_headers X (b, k) Bigint *b; int k; X#else X (Bigint *b, int k) X#endif X{ X Bigint *b1, *p5, *p51; X int i; X static int p05[3] = { 5, 25, 125 }; X X if (i = k & 3) X b = multadd(b, p05[i-1], 0); X X if (!(k >>= 2)) X return b; X if (!(p5 = p5s)) { X /* first time */ X p5 = p5s = i2b(625); X p5->next = 0; X } X for(;;) { X if (k & 1) { X b1 = mult(b, p5); X Bfree(b); X b = b1; X } X if (!(k >>= 1)) X break; X if (!(p51 = p5->next)) { X p51 = p5->next = mult(p5,p5); X p51->next = 0; X } X p5 = p51; X } X return b; X } X X static Bigint * Xlshift X#ifdef KR_headers X (b, k) Bigint *b; int k; X#else X (Bigint *b, int k) X#endif X{ X int i, k1, n, n1; X Bigint *b1; X ULong *x, *x1, *xe, z; X X#ifdef Pack_32 X n = k >> 5; X#else X n = k >> 4; X#endif X k1 = b->k; X n1 = n + b->wds + 1; X for(i = b->maxwds; n1 > i; i <<= 1) X k1++; X b1 = Balloc(k1); X x1 = b1->x; X for(i = 0; i < n; i++) X *x1++ = 0; X x = b->x; X xe = x + b->wds; X#ifdef Pack_32 X if (k &= 0x1f) { X k1 = 32 - k; X z = 0; X do { X *x1++ = *x << k | z; X z = *x++ >> k1; X } X while(x < xe); X if (*x1 = z) X ++n1; X } X#else X if (k &= 0xf) { X k1 = 16 - k; X z = 0; X do { X *x1++ = *x << k & 0xffff | z; X z = *x++ >> k1; X } X while(x < xe); X if (*x1 = z) X ++n1; X } X#endif X else do X *x1++ = *x++; X while(x < xe); X b1->wds = n1 - 1; X Bfree(b); X return b1; X } X X static int Xcmp X#ifdef KR_headers X (a, b) Bigint *a, *b; X#else X (Bigint *a, Bigint *b) X#endif X{ X ULong *xa, *xa0, *xb, *xb0; X int i, j; X X i = a->wds; X j = b->wds; X#ifdef DEBUG X if (i > 1 && !a->x[i-1]) X Bug("cmp called with a->x[a->wds-1] == 0"); X if (j > 1 && !b->x[j-1]) X Bug("cmp called with b->x[b->wds-1] == 0"); X#endif X if (i -= j) X return i; X xa0 = a->x; X xa = xa0 + j; X xb0 = b->x; X xb = xb0 + j; X for(;;) { X if (*--xa != *--xb) X return *xa < *xb ? -1 : 1; X if (xa <= xa0) X break; X } X return 0; X } X X static Bigint * Xdiff X#ifdef KR_headers X (a, b) Bigint *a, *b; X#else X (Bigint *a, Bigint *b) X#endif X{ X Bigint *c; X int i, wa, wb; X Long borrow, y; /* We need signed shifts here. */ X ULong *xa, *xae, *xb, *xbe, *xc; X#ifdef Pack_32 X Long z; X#endif X X i = cmp(a,b); X if (!i) { X c = Balloc(0); X c->wds = 1; X c->x[0] = 0; X return c; X } X if (i < 0) { X c = a; X a = b; X b = c; X i = 1; X } X else X i = 0; X c = Balloc(a->k); X c->sign = i; X wa = a->wds; X xa = a->x; X xae = xa + wa; X wb = b->wds; X xb = b->x; X xbe = xb + wb; X xc = c->x; X borrow = 0; X#ifdef Pack_32 X do { X y = (*xa & 0xffff) - (*xb & 0xffff) + borrow; X borrow = y >> 16; X Sign_Extend(borrow, y); X z = (*xa++ >> 16) - (*xb++ >> 16) + borrow; X borrow = z >> 16; X Sign_Extend(borrow, z); X Storeinc(xc, z, y); X } X while(xb < xbe); X while(xa < xae) { X y = (*xa & 0xffff) + borrow; X borrow = y >> 16; X Sign_Extend(borrow, y); X z = (*xa++ >> 16) + borrow; X borrow = z >> 16; X Sign_Extend(borrow, z); X Storeinc(xc, z, y); X } X#else X do { X y = *xa++ - *xb++ + borrow; X borrow = y >> 16; X Sign_Extend(borrow, y); X *xc++ = y & 0xffff; X } X while(xb < xbe); X while(xa < xae) { X y = *xa++ + borrow; X borrow = y >> 16; X Sign_Extend(borrow, y); X *xc++ = y & 0xffff; X } X#endif X while(!*--xc) X wa--; X c->wds = wa; X return c; X } X X static double Xulp X#ifdef KR_headers X (x) double x; X#else X (double x) X#endif X{ X register Long L; X double a; X X L = (word0(x) & Exp_mask) - (P-1)*Exp_msk1; X#ifndef Sudden_Underflow X if (L > 0) { X#endif X#ifdef IBM X L |= Exp_msk1 >> 4; X#endif X word0(a) = L; X word1(a) = 0; X#ifndef Sudden_Underflow X } X else { X L = -L >> Exp_shift; X if (L < Exp_shift) { X word0(a) = 0x80000 >> L; X word1(a) = 0; X } X else { X word0(a) = 0; X L -= Exp_shift; X word1(a) = L >= 31 ? 1 : 1 << 31 - L; X } X } X#endif X return a; X } X X static double Xb2d X#ifdef KR_headers X (a, e) Bigint *a; int *e; X#else X (Bigint *a, int *e) X#endif X{ X ULong *xa, *xa0, w, y, z; X int k; X double d; X#ifdef VAX X ULong d0, d1; X#else X#define d0 word0(d) X#define d1 word1(d) X#endif X X xa0 = a->x; X xa = xa0 + a->wds; X y = *--xa; X#ifdef DEBUG X if (!y) Bug("zero y in b2d"); X#endif X k = hi0bits(y); X *e = 32 - k; X#ifdef Pack_32 X if (k < Ebits) { X d0 = Exp_1 | y >> Ebits - k; X w = xa > xa0 ? *--xa : 0; X d1 = y << (32-Ebits) + k | w >> Ebits - k; X goto ret_d; X } X z = xa > xa0 ? *--xa : 0; X if (k -= Ebits) { X d0 = Exp_1 | y << k | z >> 32 - k; X y = xa > xa0 ? *--xa : 0; X d1 = z << k | y >> 32 - k; X } X else { X d0 = Exp_1 | y; X d1 = z; X } X#else X if (k < Ebits + 16) { X z = xa > xa0 ? *--xa : 0; X d0 = Exp_1 | y << k - Ebits | z >> Ebits + 16 - k; X w = xa > xa0 ? *--xa : 0; X y = xa > xa0 ? *--xa : 0; X d1 = z << k + 16 - Ebits | w << k - Ebits | y >> 16 + Ebits - k; X goto ret_d; X } X z = xa > xa0 ? *--xa : 0; X w = xa > xa0 ? *--xa : 0; X k -= Ebits + 16; X d0 = Exp_1 | y << k + 16 | z << k | w >> 16 - k; X y = xa > xa0 ? *--xa : 0; X d1 = w << k + 16 | y << k; X#endif X ret_d: X#ifdef VAX X word0(d) = d0 >> 16 | d0 << 16; X word1(d) = d1 >> 16 | d1 << 16; X#else X#undef d0 X#undef d1 X#endif X return d; X } X X static Bigint * Xd2b X#ifdef KR_headers X (d, e, bits) double d; int *e, *bits; X#else X (double d, int *e, int *bits) X#endif X{ X Bigint *b; X int de, i, k; X ULong *x, y, z; X#ifdef VAX X ULong d0, d1; X d0 = word0(d) >> 16 | word0(d) << 16; X d1 = word1(d) >> 16 | word1(d) << 16; X#else X#define d0 word0(d) X#define d1 word1(d) X#endif X X#ifdef Pack_32 X b = Balloc(1); X#else X b = Balloc(2); X#endif X x = b->x; X X z = d0 & Frac_mask; X d0 &= 0x7fffffff; /* clear sign bit, which we ignore */ X#ifdef Sudden_Underflow X de = (int)(d0 >> Exp_shift); X#ifndef IBM X z |= Exp_msk11; X#endif X#else X if (de = (int)(d0 >> Exp_shift)) X z |= Exp_msk1; X#endif X#ifdef Pack_32 X if (y = d1) { X if (k = lo0bits(&y)) { X x[0] = y | z << 32 - k; X z >>= k; X } X else X x[0] = y; X i = b->wds = (x[1] = z) ? 2 : 1; X } X else { X#ifdef DEBUG X if (!z) X Bug("Zero passed to d2b"); X#endif X k = lo0bits(&z); X x[0] = z; X i = b->wds = 1; X k += 32; X } X#else X if (y = d1) { X if (k = lo0bits(&y)) X if (k >= 16) { X x[0] = y | z << 32 - k & 0xffff; X x[1] = z >> k - 16 & 0xffff; X x[2] = z >> k; X i = 2; X } X else { X x[0] = y & 0xffff; X x[1] = y >> 16 | z << 16 - k & 0xffff; X x[2] = z >> k & 0xffff; X x[3] = z >> k+16; X i = 3; X } X else { X x[0] = y & 0xffff; X x[1] = y >> 16; X x[2] = z & 0xffff; X x[3] = z >> 16; X i = 3; X } X } X else { X#ifdef DEBUG X if (!z) X Bug("Zero passed to d2b"); X#endif X k = lo0bits(&z); X if (k >= 16) { X x[0] = z; X i = 0; X } X else { X x[0] = z & 0xffff; X x[1] = z >> 16; X i = 1; X } X k += 32; X } X while(!x[i]) X --i; X b->wds = i + 1; X#endif X#ifndef Sudden_Underflow X if (de) { X#endif X#ifdef IBM X *e = (de - Bias - (P-1) << 2) + k; X *bits = 4*P + 8 - k - hi0bits(word0(d) & Frac_mask); X#else X *e = de - Bias - (P-1) + k; X *bits = P - k; X#endif X#ifndef Sudden_Underflow X } X else { X *e = de - Bias - (P-1) + 1 + k; X#ifdef Pack_32 X *bits = 32*i - hi0bits(x[i-1]); X#else X *bits = (i+2)*16 - hi0bits(x[i]); X#endif X } X#endif X return b; X } X#undef d0 X#undef d1 X X static double Xratio X#ifdef KR_headers X (a, b) Bigint *a, *b; X#else X (Bigint *a, Bigint *b) X#endif X{ X double da, db; X int k, ka, kb; X X da = b2d(a, &ka); X db = b2d(b, &kb); X#ifdef Pack_32 X k = ka - kb + 32*(a->wds - b->wds); X#else X k = ka - kb + 16*(a->wds - b->wds); X#endif X#ifdef IBM X if (k > 0) { X word0(da) += (k >> 2)*Exp_msk1; X if (k &= 3) X da *= 1 << k; X } X else { X k = -k; X word0(db) += (k >> 2)*Exp_msk1; X if (k &= 3) X db *= 1 << k; X } X#else X if (k > 0) X word0(da) += k*Exp_msk1; X else { X k = -k; X word0(db) += k*Exp_msk1; X } X#endif X return da / db; X } X Xstatic CONST double Xtens[] = { X 1e0, 1e1, 1e2, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, X 1e10, 1e11, 1e12, 1e13, 1e14, 1e15, 1e16, 1e17, 1e18, 1e19, X 1e20, 1e21, 1e22 X#ifdef VAX X , 1e23, 1e24 X#endif X }; X X#ifdef IEEE_Arith Xstatic CONST double bigtens[] = { 1e16, 1e32, 1e64, 1e128, 1e256 }; Xstatic CONST double tinytens[] = { 1e-16, 1e-32, 1e-64, 1e-128, 1e-256 }; X#define n_bigtens 5 X#else X#ifdef IBM Xstatic CONST double bigtens[] = { 1e16, 1e32, 1e64 }; Xstatic CONST double tinytens[] = { 1e-16, 1e-32, 1e-64 }; X#define n_bigtens 3 X#else Xstatic CONST double bigtens[] = { 1e16, 1e32 }; Xstatic CONST double tinytens[] = { 1e-16, 1e-32 }; X#define n_bigtens 2 X#endif X#endif X X double Xstrtod X#ifdef KR_headers X (s00, se) CONST char *s00; char **se; X#else X (CONST char *s00, char **se) X#endif X{ X int bb2, bb5, bbe, bd2, bd5, bbbits, bs2, c, dsign, X e, e1, esign, i, j, k, nd, nd0, nf, nz, nz0, sign; X CONST char *s, *s0, *s1; X double aadj, aadj1, adj, rv, rv0; X Long L; X ULong y, z; X Bigint *bb, *bb1, *bd, *bd0, *bs, *delta; X X#ifndef KR_headers X CONST char decimal_point = localeconv()->decimal_point[0]; X#else X CONST char decimal_point = '.'; X#endif X X sign = nz0 = nz = 0; X rv = 0.; X X X for(s = s00; isspace((unsigned char) *s); s++) X ; X X if (*s == '-') { X sign = 1; X s++; X } else if (*s == '+') { X s++; X } X X if (*s == '\0') { X s = s00; X goto ret; X } X X if (*s == '0') { X nz0 = 1; X while(*++s == '0') ; X if (!*s) X goto ret; X } X s0 = s; X y = z = 0; X for(nd = nf = 0; (c = *s) >= '0' && c <= '9'; nd++, s++) X if (nd < 9) X y = 10*y + c - '0'; X else if (nd < 16) X z = 10*z + c - '0'; X nd0 = nd; X if (c == decimal_point) { X c = *++s; X if (!nd) { X for(; c == '0'; c = *++s) X nz++; X if (c > '0' && c <= '9') { X s0 = s; X nf += nz; X nz = 0; X goto have_dig; X } X goto dig_done; X } X for(; c >= '0' && c <= '9'; c = *++s) { X have_dig: X nz++; X if (c -= '0') { X nf += nz; X for(i = 1; i < nz; i++) X if (nd++ < 9) X y *= 10; X else if (nd <= DBL_DIG + 1) X z *= 10; X if (nd++ < 9) X y = 10*y + c; X else if (nd <= DBL_DIG + 1) X z = 10*z + c; X nz = 0; X } X } X } X dig_done: X e = 0; X if (c == 'e' || c == 'E') { X if (!nd && !nz && !nz0) { X s = s00; X goto ret; X } X s00 = s; X esign = 0; X switch(c = *++s) { X case '-': X esign = 1; X case '+': X c = *++s; X } X if (c >= '0' && c <= '9') { X while(c == '0') X c = *++s; X if (c > '0' && c <= '9') { X L = c - '0'; X s1 = s; X while((c = *++s) >= '0' && c <= '9') X L = 10*L + c - '0'; X if (s - s1 > 8 || L > 19999) X /* Avoid confusion from exponents X * so large that e might overflow. X */ X e = 19999; /* safe for 16 bit ints */ X else X e = (int)L; X if (esign) X e = -e; X } X else X e = 0; X } X else X s = s00; X } X if (!nd) { X if (!nz && !nz0) X s = s00; X goto ret; X } X e1 = e -= nf; X X /* Now we have nd0 digits, starting at s0, followed by a X * decimal point, followed by nd-nd0 digits. The number we're X * after is the integer represented by those digits times X * 10**e */ X X if (!nd0) X nd0 = nd; X k = nd < DBL_DIG + 1 ? nd : DBL_DIG + 1; X rv = y; X if (k > 9) X rv = tens[k - 9] * rv + z; X bd0 = 0; X if (nd <= DBL_DIG X#ifndef RND_PRODQUOT X && FLT_ROUNDS == 1 X#endif X ) { X if (!e) X goto ret; X if (e > 0) { X if (e <= Ten_pmax) { X#ifdef VAX X goto vax_ovfl_check; X#else X /* rv = */ rounded_product(rv, tens[e]); X goto ret; X#endif X } X i = DBL_DIG - nd; X if (e <= Ten_pmax + i) { X /* A fancier test would sometimes let us do X * this for larger i values. X */ X e -= i; X rv *= tens[i]; X#ifdef VAX X /* VAX exponent range is so narrow we must X * worry about overflow here... X */ X vax_ovfl_check: X word0(rv) -= P*Exp_msk1; X /* rv = */ rounded_product(rv, tens[e]); X if ((word0(rv) & Exp_mask) X > Exp_msk1*(DBL_MAX_EXP+Bias-1-P)) X goto ovfl; X word0(rv) += P*Exp_msk1; X#else X /* rv = */ rounded_product(rv, tens[e]); X#endif X goto ret; X } X } X#ifndef Inaccurate_Divide X else if (e >= -Ten_pmax) { X /* rv = */ rounded_quotient(rv, tens[-e]); X goto ret; X } X#endif X } X e1 += nd - k; X X /* Get starting approximation = rv * 10**e1 */ X X if (e1 > 0) { X if (i = e1 & 15) X rv *= tens[i]; X if (e1 &= ~15) { X if (e1 > DBL_MAX_10_EXP) { X ovfl: X errno = ERANGE; X#ifdef __STDC__ X rv = HUGE_VAL; X#else X /* Can't trust HUGE_VAL */ X#ifdef IEEE_Arith X word0(rv) = Exp_mask; X word1(rv) = 0; X#else X word0(rv) = Big0; X word1(rv) = Big1; X#endif X#endif X if (bd0) X goto retfree; X goto ret; X } X if (e1 >>= 4) { X for(j = 0; e1 > 1; j++, e1 >>= 1) X if (e1 & 1) X rv *= bigtens[j]; X /* The last multiplication could overflow. */ X word0(rv) -= P*Exp_msk1; X rv *= bigtens[j]; X if ((z = word0(rv) & Exp_mask) X > Exp_msk1*(DBL_MAX_EXP+Bias-P)) X goto ovfl; X if (z > Exp_msk1*(DBL_MAX_EXP+Bias-1-P)) { X /* set to largest number */ X /* (Can't trust DBL_MAX) */ X word0(rv) = Big0; X word1(rv) = Big1; X } X else X word0(rv) += P*Exp_msk1; X } X X } X } X else if (e1 < 0) { X e1 = -e1; X if (i = e1 & 15) X rv /= tens[i]; X if (e1 &= ~15) { X e1 >>= 4; X if (e1 >= 1 << n_bigtens) X goto undfl; X for(j = 0; e1 > 1; j++, e1 >>= 1) X if (e1 & 1) X rv *= tinytens[j]; X /* The last multiplication could underflow. */ X rv0 = rv; X rv *= tinytens[j]; X if (!rv) { X rv = 2.*rv0; X rv *= tinytens[j]; X if (!rv) { X undfl: X rv = 0.; X errno = ERANGE; X if (bd0) X goto retfree; X goto ret; X } X word0(rv) = Tiny0; X word1(rv) = Tiny1; X /* The refinement below will clean X * this approximation up. X */ X } X } X } X X /* Now the hard part -- adjusting rv to the correct value.*/ X X /* Put digits into bd: true value = bd * 10^e */ X X bd0 = s2b(s0, nd0, nd, y); X X for(;;) { X bd = Balloc(bd0->k); X Bcopy(bd, bd0); X bb = d2b(rv, &bbe, &bbbits); /* rv = bb * 2^bbe */ X bs = i2b(1); X X if (e >= 0) { X bb2 = bb5 = 0; X bd2 = bd5 = e; X } X else { X bb2 = bb5 = -e; X bd2 = bd5 = 0; X } X if (bbe >= 0) X bb2 += bbe; X else X bd2 -= bbe; X bs2 = bb2; X#ifdef Sudden_Underflow X#ifdef IBM X j = 1 + 4*P - 3 - bbbits + ((bbe + bbbits - 1) & 3); X#else X j = P + 1 - bbbits; X#endif X#else X i = bbe + bbbits - 1; /* logb(rv) */ X if (i < Emin) /* denormal */ X j = bbe + (P-Emin); X else X j = P + 1 - bbbits; X#endif X bb2 += j; X bd2 += j; X i = bb2 < bd2 ? bb2 : bd2; X if (i > bs2) X i = bs2; X if (i > 0) { X bb2 -= i; X bd2 -= i; X bs2 -= i; X } X if (bb5 > 0) { X bs = pow5mult(bs, bb5); X bb1 = mult(bs, bb); X Bfree(bb); X bb = bb1; X } X if (bb2 > 0) X bb = lshift(bb, bb2); X if (bd5 > 0) X bd = pow5mult(bd, bd5); X if (bd2 > 0) X bd = lshift(bd, bd2); X if (bs2 > 0) X bs = lshift(bs, bs2); X delta = diff(bb, bd); X dsign = delta->sign; X delta->sign = 0; X i = cmp(delta, bs); X if (i < 0) { X /* Error is less than half an ulp -- check for X * special case of mantissa a power of two. X */ X if (dsign || word1(rv) || word0(rv) & Bndry_mask) X break; X delta = lshift(delta,Log2P); X if (cmp(delta, bs) > 0) X goto drop_down; X break; X } X if (i == 0) { X /* exactly half-way between */ X if (dsign) { X if ((word0(rv) & Bndry_mask1) == Bndry_mask1 X && word1(rv) == 0xffffffff) { X /*boundary case -- increment exponent*/ X word0(rv) = (word0(rv) & Exp_mask) X + Exp_msk1 X#ifdef IBM X | Exp_msk1 >> 4 X#endif X ; X word1(rv) = 0; X break; X } X } X else if (!(word0(rv) & Bndry_mask) && !word1(rv)) { X drop_down: X /* boundary case -- decrement exponent */ X#ifdef Sudden_Underflow X L = word0(rv) & Exp_mask; X#ifdef IBM X if (L < Exp_msk1) X#else X if (L <= Exp_msk1) X#endif X goto undfl; X L -= Exp_msk1; X#else X L = (word0(rv) & Exp_mask) - Exp_msk1; X#endif X word0(rv) = L | Bndry_mask1; X word1(rv) = 0xffffffff; X#ifdef IBM X goto cont; X#else X break; X#endif X } X#ifndef ROUND_BIASED X if (!(word1(rv) & LSB)) X break; X#endif X if (dsign) X rv += ulp(rv); X#ifndef ROUND_BIASED X else { X rv -= ulp(rv); X#ifndef Sudden_Underflow X if (!rv) X goto undfl; X#endif X } X#endif X break; X } X if ((aadj = ratio(delta, bs)) <= 2.) { X if (dsign) X aadj = aadj1 = 1.; X else if (word1(rv) || word0(rv) & Bndry_mask) { X#ifndef Sudden_Underflow X if (word1(rv) == Tiny1 && !word0(rv)) X goto undfl; X#endif X aadj = 1.; X aadj1 = -1.; X } X else { X /* special case -- power of FLT_RADIX to be */ X /* rounded down... */ X X if (aadj < 2./FLT_RADIX) X aadj = 1./FLT_RADIX; X else X aadj *= 0.5; X aadj1 = -aadj; X } X } X else { X aadj *= 0.5; X aadj1 = dsign ? aadj : -aadj; X#ifdef Check_FLT_ROUNDS X switch(FLT_ROUNDS) { X case 2: /* towards +infinity */ X aadj1 -= 0.5; X break; X case 0: /* towards 0 */ X case 3: /* towards -infinity */ X aadj1 += 0.5; X } X#else X if (FLT_ROUNDS == 0) X aadj1 += 0.5; X#endif X } X y = word0(rv) & Exp_mask; X X /* Check for overflow */ X X if (y == Exp_msk1*(DBL_MAX_EXP+Bias-1)) { X rv0 = rv; X word0(rv) -= P*Exp_msk1; X adj = aadj1 * ulp(rv); X rv += adj; X if ((word0(rv) & Exp_mask) >= X Exp_msk1*(DBL_MAX_EXP+Bias-P)) { X if (word0(rv0) == Big0 && word1(rv0) == Big1) X goto ovfl; X word0(rv) = Big0; X word1(rv) = Big1; X goto cont; X } X else X word0(rv) += P*Exp_msk1; X } X else { X#ifdef Sudden_Underflow X if ((word0(rv) & Exp_mask) <= P*Exp_msk1) { X rv0 = rv; X word0(rv) += P*Exp_msk1; X adj = aadj1 * ulp(rv); X rv += adj; X#ifdef IBM X if ((word0(rv) & Exp_mask) < P*Exp_msk1) X#else X if ((word0(rv) & Exp_mask) <= P*Exp_msk1) X#endif X { X if (word0(rv0) == Tiny0 X && word1(rv0) == Tiny1) X goto undfl; X word0(rv) = Tiny0; X word1(rv) = Tiny1; X goto cont; X } X else X word0(rv) -= P*Exp_msk1; X } X else { X adj = aadj1 * ulp(rv); X rv += adj; X } X#else X /* Compute adj so that the IEEE rounding rules will X * correctly round rv + adj in some half-way cases. X * If rv * ulp(rv) is denormalized (i.e., X * y <= (P-1)*Exp_msk1), we must adjust aadj to avoid X * trouble from bits lost to denormalization; X * example: 1.2e-307 . X */ X if (y <= (P-1)*Exp_msk1 && aadj >= 1.) { X aadj1 = (double)(int)(aadj + 0.5); X if (!dsign) X aadj1 = -aadj1; X } X adj = aadj1 * ulp(rv); X rv += adj; X#endif X } X z = word0(rv) & Exp_mask; X if (y == z) { X /* Can we stop now? */ X L = aadj; X aadj -= L; X /* The tolerances below are conservative. */ X if (dsign || word1(rv) || word0(rv) & Bndry_mask) { X if (aadj < .4999999 || aadj > .5000001) X break; X } X else if (aadj < .4999999/FLT_RADIX) X break; X } X cont: X Bfree(bb); X Bfree(bd); X Bfree(bs); X Bfree(delta); X } X retfree: X Bfree(bb); X Bfree(bd); X Bfree(bs); X Bfree(bd0); X Bfree(delta); X ret: X if (se) X *se = (char *)s; X return sign ? -rv : rv; X } X X static int Xquorem X#ifdef KR_headers X (b, S) Bigint *b, *S; X#else X (Bigint *b, Bigint *S) X#endif X{ X int n; X Long borrow, y; X ULong carry, q, ys; X ULong *bx, *bxe, *sx, *sxe; X#ifdef Pack_32 X Long z; X ULong si, zs; X#endif X X n = S->wds; X#ifdef DEBUG X /*debug*/ if (b->wds > n) X /*debug*/ Bug("oversize b in quorem"); X#endif X if (b->wds < n) X return 0; X sx = S->x; X sxe = sx + --n; X bx = b->x; X bxe = bx + n; X q = *bxe / (*sxe + 1); /* ensure q <= true quotient */ X#ifdef DEBUG X /*debug*/ if (q > 9) X /*debug*/ Bug("oversized quotient in quorem"); X#endif X if (q) { X borrow = 0; X carry = 0; X do { X#ifdef Pack_32 X si = *sx++; X ys = (si & 0xffff) * q + carry; X zs = (si >> 16) * q + (ys >> 16); X carry = zs >> 16; X y = (*bx & 0xffff) - (ys & 0xffff) + borrow; X borrow = y >> 16; X Sign_Extend(borrow, y); X z = (*bx >> 16) - (zs & 0xffff) + borrow; X borrow = z >> 16; X Sign_Extend(borrow, z); X Storeinc(bx, z, y); X#else X ys = *sx++ * q + carry; X carry = ys >> 16; X y = *bx - (ys & 0xffff) + borrow; X borrow = y >> 16; X Sign_Extend(borrow, y); X *bx++ = y & 0xffff; X#endif X } X while(sx <= sxe); X if (!*bxe) { X bx = b->x; X while(--bxe > bx && !*bxe) X --n; X b->wds = n; X } X } X if (cmp(b, S) >= 0) { X q++; X borrow = 0; X carry = 0; X bx = b->x; X sx = S->x; X do { X#ifdef Pack_32 X si = *sx++; X ys = (si & 0xffff) + carry; X zs = (si >> 16) + (ys >> 16); X carry = zs >> 16; X y = (*bx & 0xffff) - (ys & 0xffff) + borrow; X borrow = y >> 16; X Sign_Extend(borrow, y); X z = (*bx >> 16) - (zs & 0xffff) + borrow; X borrow = z >> 16; X Sign_Extend(borrow, z); X Storeinc(bx, z, y); X#else X ys = *sx++ + carry; X carry = ys >> 16; X y = *bx - (ys & 0xffff) + borrow; X borrow = y >> 16; X Sign_Extend(borrow, y); X *bx++ = y & 0xffff; X#endif X } X while(sx <= sxe); X bx = b->x; X bxe = bx + n; X if (!*bxe) { X while(--bxe > bx && !*bxe) X --n; X b->wds = n; X } X } X return q; X } X X/* dtoa for IEEE arithmetic (dmg): convert double to ASCII string. X * X * Inspired by "How to Print Floating-Point Numbers Accurately" by X * Guy L. Steele, Jr. and Jon L. White [Proc. ACM SIGPLAN '90, pp. 92-101]. X * X * Modifications: X * 1. Rather than iterating, we use a simple numeric overestimate X * to determine k = floor(log10(d)). We scale relevant X * quantities using O(log2(k)) rather than O(k) multiplications. X * 2. For some modes > 2 (corresponding to ecvt and fcvt), we don't X * try to generate digits strictly left to right. Instead, we X * compute with fewer bits and propagate the carry if necessary X * when rounding the final digit up. This is often faster. X * 3. Under the assumption that input will be rounded nearest, X * mode 0 renders 1e23 as 1e23 rather than 9.999999999999999e22. X * That is, we allow equality in stopping tests when the X * round-nearest rule will give the same floating-point value X * as would satisfaction of the stopping test with strict X * inequality. X * 4. We remove common factors of powers of 2 from relevant X * quantities. X * 5. When converting floating-point integers less than 1e16, X * we use floating-point arithmetic rather than resorting X * to multiple-precision integers. X * 6. When asked to produce fewer than 15 digits, we first try X * to get by with floating-point arithmetic; we resort to X * multiple-precision integer arithmetic only if we cannot X * guarantee that the floating-point calculation has given X * the correctly rounded result. For k requested digits and X * "uniformly" distributed input, the probability is X * something like 10^(k-15) that we must resort to the Long X * calculation. X */ X X char * X__dtoa X#ifdef KR_headers X (d, mode, ndigits, decpt, sign, rve) X double d; int mode, ndigits, *decpt, *sign; char **rve; X#else X (double d, int mode, int ndigits, int *decpt, int *sign, char **rve) X#endif X{ X /* Arguments ndigits, decpt, sign are similar to those X of ecvt and fcvt; trailing zeros are suppressed from X the returned string. If not null, *rve is set to point X to the end of the return value. If d is +-Infinity or NaN, X then *decpt is set to 9999. X X mode: X 0 ==> shortest string that yields d when read in X and rounded to nearest. X 1 ==> like 0, but with Steele & White stopping rule; X e.g. with IEEE P754 arithmetic , mode 0 gives X 1e23 whereas mode 1 gives 9.999999999999999e22. X 2 ==> max(1,ndigits) significant digits. This gives a X return value similar to that of ecvt, except X that trailing zeros are suppressed. X 3 ==> through ndigits past the decimal point. This X gives a return value similar to that from fcvt, X except that trailing zeros are suppressed, and X ndigits can be negative. X 4-9 should give the same return values as 2-3, i.e., X 4 <= mode <= 9 ==> same return as mode X 2 + (mode & 1). These modes are mainly for X debugging; often they run slower but sometimes X faster than modes 2-3. X 4,5,8,9 ==> left-to-right digit generation. X 6-9 ==> don't try fast floating-point estimate X (if applicable). X X Values of mode other than 0-9 are treated as mode 0. X X Sufficient space is allocated to the return value X to hold the suppressed trailing zeros. X */ X X int bbits, b2, b5, be, dig, i, ieps, ilim, ilim0, ilim1, X j, j1, k, k0, k_check, leftright, m2, m5, s2, s5, X spec_case, try_quick; X Long L; X#ifndef Sudden_Underflow X int denorm; X ULong x; X#endif X Bigint *b, *b1, *delta, *mlo, *mhi, *S; X double d2, ds, eps; X char *s, *s0; X static Bigint *result; X static int result_k; X X if (result) { X result->k = result_k; X result->maxwds = 1 << result_k; X Bfree(result); X result = 0; X } X X if (word0(d) & Sign_bit) { X /* set sign for everything, including 0's and NaNs */ X *sign = 1; X word0(d) &= ~Sign_bit; /* clear sign bit */ X } X else X *sign = 0; X X#if defined(IEEE_Arith) + defined(VAX) X#ifdef IEEE_Arith X if ((word0(d) & Exp_mask) == Exp_mask) X#else X if (word0(d) == 0x8000) X#endif X { X /* Infinity or NaN */ X *decpt = 9999; X s = X#ifdef IEEE_Arith X !word1(d) && !(word0(d) & 0xfffff) ? "Infinity" : X#endif X "NaN"; X if (rve) X *rve = X#ifdef IEEE_Arith X s[3] ? s + 8 : X#endif X s + 3; X return s; X } X#endif X#ifdef IBM X d += 0; /* normalize */ X#endif X if (!d) { X *decpt = 1; X s = "0"; X if (rve) X *rve = s + 1; X return s; X } X X b = d2b(d, &be, &bbits); X#ifdef Sudden_Underflow X i = (int)(word0(d) >> Exp_shift1 & (Exp_mask>>Exp_shift1)); X#else X if (i = (int)(word0(d) >> Exp_shift1 & (Exp_mask>>Exp_shift1))) { X#endif X d2 = d; X word0(d2) &= Frac_mask1; X word0(d2) |= Exp_11; X#ifdef IBM X if (j = 11 - hi0bits(word0(d2) & Frac_mask)) X d2 /= 1 << j; X#endif X X /* log(x) ~=~ log(1.5) + (x-1.5)/1.5 X * log10(x) = log(x) / log(10) X * ~=~ log(1.5)/log(10) + (x-1.5)/(1.5*log(10)) X * log10(d) = (i-Bias)*log(2)/log(10) + log10(d2) X * X * This suggests computing an approximation k to log10(d) by X * X * k = (i - Bias)*0.301029995663981 X * + ( (d2-1.5)*0.289529654602168 + 0.176091259055681 ); X * X * We want k to be too large rather than too small. X * The error in the first-order Taylor series approximation X * is in our favor, so we just round up the constant enough X * to compensate for any error in the multiplication of X * (i - Bias) by 0.301029995663981; since |i - Bias| <= 1077, X * and 1077 * 0.30103 * 2^-52 ~=~ 7.2e-14, X * adding 1e-13 to the constant term more than suffices. X * Hence we adjust the constant term to 0.1760912590558. X * (We could get a more accurate k by invoking log10, X * but this is probably not worthwhile.) X */ X X i -= Bias; X#ifdef IBM X i <<= 2; X i += j; X#endif X#ifndef Sudden_Underflow X denorm = 0; X } X else { X /* d is denormalized */ X X i = bbits + be + (Bias + (P-1) - 1); X x = i > 32 ? word0(d) << 64 - i | word1(d) >> i - 32 X : word1(d) << 32 - i; X d2 = x; X word0(d2) -= 31*Exp_msk1; /* adjust exponent */ X i -= (Bias + (P-1) - 1) + 1; X denorm = 1; X } X#endif X ds = (d2-1.5)*0.289529654602168 + 0.1760912590558 + i*0.301029995663981; X k = (int)ds; X if (ds < 0. && ds != k) X k--; /* want k = floor(ds) */ X k_check = 1; X if (k >= 0 && k <= Ten_pmax) { X if (d < tens[k]) X k--; X k_check = 0; X } X j = bbits - i - 1; X if (j >= 0) { X b2 = 0; X s2 = j; X } X else { X b2 = -j; X s2 = 0; X } X if (k >= 0) { X b5 = 0; X s5 = k; X s2 += k; X } X else { X b2 -= k; X b5 = -k; X s5 = 0; X } X if (mode < 0 || mode > 9) X mode = 0; X try_quick = 1; X if (mode > 5) { X mode -= 4; X try_quick = 0; X } X leftright = 1; X switch(mode) { X case 0: X case 1: X ilim = ilim1 = -1; X i = 18; X ndigits = 0; X break; X case 2: X leftright = 0; X /* no break */ X case 4: X if (ndigits <= 0) X ndigits = 1; X ilim = ilim1 = i = ndigits; X break; X case 3: X leftright = 0; X /* no break */ X case 5: X i = ndigits + k + 1; X ilim = i; X ilim1 = i - 1; X if (i <= 0) X i = 1; X } X j = sizeof(ULong); X for(result_k = 0; sizeof(Bigint) - sizeof(ULong) + j <= i; X j <<= 1) result_k++; X result = Balloc(result_k); X s = s0 = (char *)result; X X if (ilim >= 0 && ilim <= Quick_max && try_quick) { X X /* Try to get by with floating-point arithmetic. */ X X i = 0; X d2 = d; X k0 = k; X ilim0 = ilim; X ieps = 2; /* conservative */ X if (k > 0) { X ds = tens[k&0xf]; X j = k >> 4; X if (j & Bletch) { X /* prevent overflows */ X j &= Bletch - 1; X d /= bigtens[n_bigtens-1]; X ieps++; X } X for(; j; j >>= 1, i++) X if (j & 1) { X ieps++; X ds *= bigtens[i]; X } X d /= ds; X } X else if (j1 = -k) { X d *= tens[j1 & 0xf]; X for(j = j1 >> 4; j; j >>= 1, i++) X if (j & 1) { X ieps++; X d *= bigtens[i]; X } X } X if (k_check && d < 1. && ilim > 0) { X if (ilim1 <= 0) X goto fast_failed; X ilim = ilim1; X k--; X d *= 10.; X ieps++; X } X eps = ieps*d + 7.; X word0(eps) -= (P-1)*Exp_msk1; X if (ilim == 0) { X S = mhi = 0; X d -= 5.; X if (d > eps) X goto one_digit; X if (d < -eps) X goto no_digits; X goto fast_failed; X } X#ifndef No_leftright X if (leftright) { X /* Use Steele & White method of only X * generating digits needed. X */ X eps = 0.5/tens[ilim-1] - eps; X for(i = 0;;) { X L = d; X d -= L; X *s++ = '0' + (int)L; X if (d < eps) X goto ret1; X if (1. - d < eps) X goto bump_up; X if (++i >= ilim) X break; X eps *= 10.; X d *= 10.; X } X } X else { X#endif X /* Generate ilim digits, then fix them up. */ X eps *= tens[ilim-1]; X for(i = 1;; i++, d *= 10.) { X L = d; X d -= L; X *s++ = '0' + (int)L; X if (i == ilim) { X if (d > 0.5 + eps) X goto bump_up; X else if (d < 0.5 - eps) { X while(*--s == '0'); X s++; X goto ret1; X } X break; X } X } X#ifndef No_leftright X } X#endif X fast_failed: X s = s0; X d = d2; X k = k0; X ilim = ilim0; X } X X /* Do we have a "small" integer? */ X X if (be >= 0 && k <= Int_max) { X /* Yes. */ X ds = tens[k]; X if (ndigits < 0 && ilim <= 0) { X S = mhi = 0; X if (ilim < 0 || d <= 5*ds) X goto no_digits; X goto one_digit; X } X for(i = 1;; i++) { X L = d / ds; X d -= L*ds; X#ifdef Check_FLT_ROUNDS X /* If FLT_ROUNDS == 2, L will usually be high by 1 */ X if (d < 0) { X L--; X d += ds; X } X#endif X *s++ = '0' + (int)L; X if (i == ilim) { X d += d; X if (d > ds || d == ds && L & 1) { X bump_up: X while(*--s == '9') X if (s == s0) { X k++; X *s = '0'; X break; X } X ++*s++; X } X break; X } X if (!(d *= 10.)) X break; X } X goto ret1; X } X X m2 = b2; X m5 = b5; X mhi = mlo = 0; X if (leftright) { X if (mode < 2) { X i = X#ifndef Sudden_Underflow X denorm ? be + (Bias + (P-1) - 1 + 1) : X#endif X#ifdef IBM X 1 + 4*P - 3 - bbits + ((bbits + be - 1) & 3); X#else X 1 + P - bbits; X#endif X } X else { X j = ilim - 1; X if (m5 >= j) X m5 -= j; X else { X s5 += j -= m5; X b5 += j; X m5 = 0; X } X if ((i = ilim) < 0) { X m2 -= i; X i = 0; X } X } X b2 += i; X s2 += i; X mhi = i2b(1); X } X if (m2 > 0 && s2 > 0) { X i = m2 < s2 ? m2 : s2; X b2 -= i; X m2 -= i; X s2 -= i; X } X if (b5 > 0) { X if (leftright) { X if (m5 > 0) { X mhi = pow5mult(mhi, m5); X b1 = mult(mhi, b); X Bfree(b); X b = b1; X } X if (j = b5 - m5) X b = pow5mult(b, j); X } X else X b = pow5mult(b, b5); X } X S = i2b(1); X if (s5 > 0) X S = pow5mult(S, s5); X X /* Check for special case that d is a normalized power of 2. */ X X if (mode < 2) { X if (!word1(d) && !(word0(d) & Bndry_mask) X#ifndef Sudden_Underflow X && word0(d) & Exp_mask X#endif X ) { X /* The special case */ X b2 += Log2P; X s2 += Log2P; X spec_case = 1; X } X else X spec_case = 0; X } X X /* Arrange for convenient computation of quotients: X * shift left if necessary so divisor has 4 leading 0 bits. X * X * Perhaps we should just compute leading 28 bits of S once X * and for all and pass them and a shift to quorem, so it X * can do shifts and ors to compute the numerator for q. X */ X#ifdef Pack_32 X if (i = ((s5 ? 32 - hi0bits(S->x[S->wds-1]) : 1) + s2) & 0x1f) X i = 32 - i; X#else X if (i = ((s5 ? 32 - hi0bits(S->x[S->wds-1]) : 1) + s2) & 0xf) X i = 16 - i; X#endif X if (i > 4) { X i -= 4; X b2 += i; X m2 += i; X s2 += i; X } X else if (i < 4) { X i += 28; X b2 += i; X m2 += i; X s2 += i; X } X if (b2 > 0) X b = lshift(b, b2); X if (s2 > 0) X S = lshift(S, s2); X if (k_check) { X if (cmp(b,S) < 0) { X k--; X b = multadd(b, 10, 0); /* we botched the k estimate */ X if (leftright) X mhi = multadd(mhi, 10, 0); X ilim = ilim1; X } X } X if (ilim <= 0 && mode > 2) { X if (ilim < 0 || cmp(b,S = multadd(S,5,0)) <= 0) { X /* no digits, fcvt style */ X no_digits: X k = -1 - ndigits; X goto ret; X } X one_digit: X *s++ = '1'; X k++; X goto ret; X } X if (leftright) { X if (m2 > 0) X mhi = lshift(mhi, m2); X X /* Compute mlo -- check for special case X * that d is a normalized power of 2. X */ X X mlo = mhi; X if (spec_case) { X mhi = Balloc(mhi->k); X Bcopy(mhi, mlo); X mhi = lshift(mhi, Log2P); X } X X for(i = 1;;i++) { X dig = quorem(b,S) + '0'; X /* Do we yet have the shortest decimal string X * that will round to d? X */ X j = cmp(b, mlo); X delta = diff(S, mhi); X j1 = delta->sign ? 1 : cmp(b, delta); X Bfree(delta); X#ifndef ROUND_BIASED X if (j1 == 0 && !mode && !(word1(d) & 1)) { X if (dig == '9') X goto round_9_up; X if (j > 0) X dig++; X *s++ = dig; X goto ret; X } X#endif X if (j < 0 || j == 0 && !mode X#ifndef ROUND_BIASED X && !(word1(d) & 1) X#endif X ) { X if (j1 > 0) { X b = lshift(b, 1); X j1 = cmp(b, S); X if ((j1 > 0 || j1 == 0 && dig & 1) X && dig++ == '9') X goto round_9_up; X } X *s++ = dig; X goto ret; X } X if (j1 > 0) { X if (dig == '9') { /* possible if i == 1 */ X round_9_up: X *s++ = '9'; X goto roundoff; X } X *s++ = dig + 1; X goto ret; X } X *s++ = dig; X if (i == ilim) X break; X b = multadd(b, 10, 0); X if (mlo == mhi) X mlo = mhi = multadd(mhi, 10, 0); X else { X mlo = multadd(mlo, 10, 0); X mhi = multadd(mhi, 10, 0); X } X } X } X else X for(i = 1;; i++) { X *s++ = dig = quorem(b,S) + '0'; X if (i >= ilim) X break; X b = multadd(b, 10, 0); X } X X /* Round off last digit */ X X b = lshift(b, 1); X j = cmp(b, S); X if (j > 0 || j == 0 && dig & 1) { X roundoff: X while(*--s == '9') X if (s == s0) { X k++; X *s++ = '1'; X goto ret; X } X ++*s++; X } X else { X while(*--s == '0'); X s++; X } X ret: X Bfree(S); X if (mhi) { X if (mlo && mlo != mhi) X Bfree(mlo); X Bfree(mhi); X } X ret1: X Bfree(b); X if (s == s0) { /* don't return empty string */ X *s++ = '0'; X k = 0; X } X *s = 0; X *decpt = k + 1; X if (rve) X *rve = s; X return s0; X } X#ifdef __cplusplus X} X#endif END-of-star-1.6/libschily/strtod.c echo x - star-1.6/libschily/fexec.c sed 's/^X//' >star-1.6/libschily/fexec.c << 'END-of-star-1.6/libschily/fexec.c' X/* @(#)fexec.c 1.51 15/07/06 Copyright 1985, 1995-2015 J. Schilling */ X/* X * Execute a program with stdio redirection X * X * Copyright (c) 1985, 1995-2015 J. Schilling X * X * This is an interface that exists in the public since 1982. X * The POSIX.1-2008 standard did ignore POSIX rules not to X * redefine existing public interfaces and redefined the interfaces X * forcing us to add a js_*() prefix to the original functions. X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef __DO__FEXEC__ X X#define fexecl __no__fexecl__ X#define fexecle __no__fexecle__ X#define fexecv __no__fexecv__ X#define fexecve __no__fexecve__ X X#include X#include X#include X#include X#include X#include X#include X#include X#include X#include X#include X#include X#define VMS_VFORK_OK X#include X#endif /* __DO__FEXEC__ */ X X#if defined(IS_MACOS_X) && defined(HAVE_CRT_EXTERNS_H) X/* X * The MAC OS X linker does not grok "common" varaibles. X * We need to fetch the address of "environ" using a hack. X */ X#include X#define environ *_NSGetEnviron() X#else Xextern char **environ; X#endif X X/* X * Check whether fexec may be implemented... X */ X#if defined(HAVE_DUP) && (defined(HAVE_DUP2) || defined(F_DUPFD)) X X#define MAX_F_ARGS 16 X X#ifndef __DO__FEXEC__ X#ifndef NO_FEXEC_COMPAT /* Define to disable backward compatibility */ X#undef fexecl X#undef fexecle X#undef fexecv X#undef fexecve X X/* X * The Cygwin compile environment incorrectly implements #pragma weak. X * The weak symbols are only defined as local symbols making it impossible X * to use them from outside the scope of this source file. X * A platform that allows linking with global symbols has HAVE_LINK_WEAK X * defined. X */ X#if defined(HAVE_PRAGMA_WEAK) && defined(HAVE_LINK_WEAK) X#pragma weak fexecl = js_fexecl X#pragma weak fexecle = js_fexecle X#pragma weak fexecv = js_fexecv X#pragma weak fexecve = js_fexecve X#else X XEXPORT int fexecl __PR((const char *, FILE *, FILE *, FILE *, X const char *, ...)); XEXPORT int fexecle __PR((const char *, FILE *, FILE *, FILE *, X const char *, ...)); X /* 6th arg not const, fexecv forces av[ac] = NULL */ XEXPORT int fexecv __PR((const char *, FILE *, FILE *, FILE *, int, X char **)); XEXPORT int fexecve __PR((const char *, FILE *, FILE *, FILE *, X char * const *, char * const *)); X X#define __DO__FEXEC__ X#define js_fexecl fexecl X#define js_fexecle fexecle X#include "fexec.c" X#undef js_fexecl X#undef js_fexecle X#undef __DO__FEXEC__ X X/* X * Use ac == -1 together with a NULL terminated arg vector. X */ XEXPORT int Xfexecv(name, in, out, err, ac, av) X const char *name; X FILE *in, *out, *err; X int ac; X char *av[]; X{ X if (ac >= 0) X av[ac] = NULL; /* force list to be null terminated */ X return (js_fexecve(name, in, out, err, av, environ)); X} X XEXPORT int Xfexecve(name, in, out, err, av, env) X const char *name; X FILE *in, *out, *err; X char * const av[], * const env[]; X{ X return (js_fexecve(name, in, out, err, av, env)); X} X#endif /* HAVE_PRAGMA_WEAK && HAVE_LINK_WEAK */ X#endif /* NO_FEXEC_COMPAT */ X X X#ifdef JOS X#define enofile(t) ((t) == EMISSDIR || \ X (t) == ENOFILE || \ X (t) == EISADIR || \ X (t) == EIOERR) X#else X#define enofile(t) ((t) == ENOENT || \ X (t) == ENOTDIR || \ X (t) == EISDIR || \ X (t) == EIO) X#endif X X#ifndef set_child_standard_fds XLOCAL void fdcopy __PR((int, int)); XLOCAL void fdmove __PR((int, int)); X#endif XLOCAL const char *chkname __PR((const char *, const char *)); XLOCAL const char *getpath __PR((char * const *)); X X#ifdef F_GETFD X#define fd_getfd(fd) fcntl((fd), F_GETFD, 0) X#else X#define fd_getfd(fd) (0) X#endif X#ifdef F_SETFD X#define fd_setfd(fd, val) fcntl((fd), F_SETFD, (val)); X#else X#define fd_setfd(fd, val) (0) X#endif X#endif /* __DO__FEXEC__ */ X X#ifdef PROTOTYPES XEXPORT int Xjs_fexecl(const char *name, FILE *in, FILE *out, FILE *err, const char *arg0, X ...) X#else XEXPORT int Xjs_fexecl(name, in, out, err, arg0, va_alist) X char *name; X FILE *in; X FILE *out; X FILE *err; X const char *arg0; X va_dcl X#endif X{ X va_list args; X int ac = 0; X char *xav[MAX_F_ARGS+1]; X char **av; Xconst char **pav; X char *p; X int ret; X X#ifdef PROTOTYPES X va_start(args, arg0); X#else X va_start(args); X#endif X if (arg0) { X ac++; X while (va_arg(args, char *) != NULL) X ac++; X } X va_end(args); X X if (ac <= MAX_F_ARGS) { X av = xav; X } else { X av = (char **)malloc((ac+1)*sizeof (char *)); X if (av == 0) X return (-1); X } X pav = (const char **)av; X X#ifdef PROTOTYPES X va_start(args, arg0); X#else X va_start(args); X#endif X *pav++ = arg0; X if (arg0) do { X p = va_arg(args, char *); X *pav++ = p; X } while (p != NULL); X va_end(args); X X ret = js_fexecv(name, in, out, err, ac, av); X if (av != xav) X free(av); X return (ret); X} X X#ifdef PROTOTYPES XEXPORT int Xjs_fexecle(const char *name, FILE *in, FILE *out, FILE *err, const char *arg0, X ...) X#else XEXPORT int Xjs_fexecle(name, in, out, err, arg0, va_alist) X char *name; X FILE *in; X FILE *out; X FILE *err; X const char *arg0; X va_dcl X#endif X{ X va_list args; X int ac = 0; X char *xav[MAX_F_ARGS+1]; X char **av; Xconst char **pav; X char *p; X char **env; X int ret; X X#ifdef PROTOTYPES X va_start(args, arg0); X#else X va_start(args); X#endif X if (arg0) { X ac++; X while (va_arg(args, char *) != NULL) X ac++; X } X env = va_arg(args, char **); X va_end(args); X X if (ac <= MAX_F_ARGS) { X av = xav; X } else { X av = (char **)malloc((ac+1)*sizeof (char *)); X if (av == 0) X return (-1); X } X pav = (const char **)av; X X#ifdef PROTOTYPES X va_start(args, arg0); X#else X va_start(args); X#endif X *pav++ = arg0; X if (arg0) do { X p = va_arg(args, char *); X *pav++ = p; X } while (p != NULL); X va_end(args); X X ret = js_fexecve(name, in, out, err, av, env); X if (av != xav) X free(av); X return (ret); X} X X#ifndef __DO__FEXEC__ X/* X * Use ac == -1 together with a NULL terminated arg vector. X */ XEXPORT int Xjs_fexecv(name, in, out, err, ac, av) X const char *name; X FILE *in, *out, *err; X int ac; X char *av[]; X{ X if (ac >= 0) X av[ac] = NULL; /* force list to be null terminated */ X return (js_fexecve(name, in, out, err, av, environ)); X} X XEXPORT int Xjs_fexecve(name, in, out, err, av, env) X const char *name; X FILE *in, *out, *err; X char * const av[], * const env[]; X{ X char nbuf[MAXPATHNAME+1]; X char *np; X const char *path; X#if defined(__BEOS__) || defined(__HAIKU__) X char *av0 = av[0]; X#endif X int ret; X int fin; X int fout; X int ferr; X#ifndef JOS X int o[3]; /* Old fd's for stdin/stdout/stderr */ X int f[3]; /* Old close on exec flags for above */ X int errsav = 0; X X o[0] = o[1] = o[2] = -1; X f[0] = f[1] = f[2] = 0; X#endif X X fflush(out); X fflush(err); X fin = fdown(in); X fout = fdown(out); X ferr = fdown(err); X#ifdef JOS X X /* X * If name contains a pathdelimiter ('/' on unix) X * or name is too long ... X * try exec without path search. X */ X if (find('/', name) || strlen(name) > MAXFILENAME) { X ret = exec_env(name, fin, fout, ferr, av, env); X X } else if ((path = getpath(env)) == NULL) { X ret = exec_env(name, fin, fout, ferr, av, env); X if ((ret == ENOFILE) && strlen(name) <= (sizeof (nbuf) - 6)) { X strcatl(nbuf, "/bin/", name, (char *)NULL); X ret = exec_env(nbuf, fin, fout, ferr, av, env); X if (ret == EMISSDIR) X ret = ENOFILE; X } X } else { X int nlen = strlen(name); X X for (;;) { X np = nbuf; X /* X * JOS always uses ':' as PATH Environ separator X */ X while (*path != ':' && *path != '\0' && X np < &nbuf[MAXPATHNAME-nlen-2]) { X X *np++ = *path++; X } X *np = '\0'; X if (*nbuf == '\0') X strcatl(nbuf, name, (char *)NULL); X else X strcatl(nbuf, nbuf, "/", name, (char *)NULL); X ret = exec_env(nbuf, fin, fout, ferr, av, env); X if (ret == EMISSDIR) X ret = ENOFILE; X if (ret != ENOFILE || *path == '\0') X break; X path++; X } X } X return (ret); X X#else /* JOS */ X X#ifdef set_child_standard_fds X set_child_standard_fds(fin, fout, ferr); X#else X if (fin != STDIN_FILENO) { X f[0] = fd_getfd(STDIN_FILENO); X o[0] = dup(STDIN_FILENO); X fd_setfd(o[0], FD_CLOEXEC); X fdmove(fin, STDIN_FILENO); X } X if (fout != STDOUT_FILENO) { X f[1] = fd_getfd(STDOUT_FILENO); X o[1] = dup(STDOUT_FILENO); X fd_setfd(o[1], FD_CLOEXEC); X fdmove(fout, STDOUT_FILENO); X } X if (ferr != STDERR_FILENO) { X f[2] = fd_getfd(STDERR_FILENO); X o[2] = dup(STDERR_FILENO); X fd_setfd(o[2], FD_CLOEXEC); X fdmove(ferr, STDERR_FILENO); X } X#endif X X /* X * If name contains a pathdelimiter ('/' on unix) X * or name is too long ... X * try exec without path search. X */ X#ifdef FOUND_MAXFILENAME X if (strchr(name, '/') || strlen(name) > (unsigned)MAXFILENAME) { X#else X if (strchr(name, '/')) { X#endif X ret = execve(name, av, env); X X } else if ((path = getpath(env)) == NULL) { X ret = execve(name, av, env); X if ((geterrno() == ENOENT) && strlen(name) <= (sizeof (nbuf) - 6)) { X strcatl(nbuf, "/bin/", name, (char *)NULL); X ret = execve(nbuf, av, env); X#if defined(__BEOS__) || defined(__HAIKU__) X ((char **)av)[0] = av0; /* BeOS destroys things ... */ X#endif X } X } else { X int nlen = strlen(name); X X for (;;) { X int xerr; X X np = nbuf; X while (*path != PATH_ENV_DELIM && *path != '\0' && X np < &nbuf[MAXPATHNAME-nlen-2]) { X X *np++ = *path++; X } X *np = '\0'; X if (*nbuf == '\0') X strcatl(nbuf, name, (char *)NULL); X else X strcatl(nbuf, nbuf, "/", name, (char *)NULL); X ret = execve(nbuf, av, env); X#if defined(__BEOS__) || defined(__HAIKU__) X ((char **)av)[0] = av0; /* BeOS destroys things ... */ X#endif X xerr = geterrno(); X if (errsav == 0 && !enofile(xerr)) X errsav = xerr; X if ((!enofile(xerr) && !(xerr == EACCES)) || *path == '\0') X break; X path++; X } X } X if (errsav == 0) X errsav = geterrno(); X X#ifndef set_child_standard_fds X /* reestablish old files */ X if (ferr != STDERR_FILENO) { X fdmove(STDERR_FILENO, ferr); X fdmove(o[2], STDERR_FILENO); X if (f[2] == 0) X fd_setfd(STDERR_FILENO, 0); X } X if (fout != STDOUT_FILENO) { X fdmove(STDOUT_FILENO, fout); X fdmove(o[1], STDOUT_FILENO); X if (f[1] == 0) X fd_setfd(STDOUT_FILENO, 0); X } X if (fin != STDIN_FILENO) { X fdmove(STDIN_FILENO, fin); X fdmove(o[0], STDIN_FILENO); X if (f[0] == 0) X fd_setfd(STDIN_FILENO, 0); X } X#endif X seterrno(errsav); X return (ret); X X#endif /* JOS */ X} X X#ifndef JOS X#ifndef set_child_standard_fds X XLOCAL void Xfdcopy(fd1, fd2) X int fd1; X int fd2; X{ X close(fd2); X#ifdef F_DUPFD X fcntl(fd1, F_DUPFD, fd2); X#else X#ifdef HAVE_DUP2 X dup2(fd1, fd2); X#endif X#endif X} X XLOCAL void Xfdmove(fd1, fd2) X int fd1; X int fd2; X{ X fdcopy(fd1, fd2); X close(fd1); X} X X#endif X#endif X X/* X * get PATH from env X */ XLOCAL const char * Xgetpath(env) X char * const *env; X{ X char * const *p = env; X const char *p2; X X if (p != NULL) { X while (*p != NULL) { X if ((p2 = chkname("PATH", *p)) != NULL) X return (p2); X p++; X } X } X return (NULL); X} X X X/* X * Check if name is in environment. X * Return pointer to value name is found. X */ XLOCAL const char * Xchkname(name, ev) X const char *name; X const char *ev; X{ X for (;;) { X if (*name != *ev) { X if (*ev == '=' && *name == '\0') X return (++ev); X return (NULL); X } X name++; X ev++; X } X} X#endif /* __DO__FEXEC__ */ X X#endif /* defined(HAVE_DUP) && (defined(HAVE_DUP2) || defined(F_DUPFD)) */ END-of-star-1.6/libschily/fexec.c echo x - star-1.6/libschily/strcatl.c sed 's/^X//' >star-1.6/libschily/strcatl.c << 'END-of-star-1.6/libschily/strcatl.c' X/* @(#)strcatl.c 1.13 06/09/13 Copyright 1985, 1989, 1995-2003 J. Schilling */ X/* X * list version of strcat() X * X * concatenates all past first parameter until a NULL pointer is reached X * X * WARNING: a NULL constant is not a NULL pointer, so a caller must X * cast a NULL constant to a pointer: (char *)NULL X * X * returns pointer past last character (to '\0' byte) X * X * Copyright (c) 1985, 1989, 1995-2003 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X X/* VARARGS3 */ X#ifdef PROTOTYPES XEXPORT char * Xstrcatl(char *to, ...) X#else XEXPORT char * Xstrcatl(to, va_alist) X char *to; X va_dcl X#endif X{ X va_list args; X register char *p; X register char *tor = to; X X#ifdef PROTOTYPES X va_start(args, to); X#else X va_start(args); X#endif X while ((p = va_arg(args, char *)) != NULL) { X while ((*tor = *p++) != '\0') { X tor++; X } X } X *tor = '\0'; X va_end(args); X return (tor); X} END-of-star-1.6/libschily/strcatl.c echo x - star-1.6/libschily/breakline.c sed 's/^X//' >star-1.6/libschily/breakline.c << 'END-of-star-1.6/libschily/breakline.c' X/* @(#)breakline.c 1.12 18/06/03 Copyright 1985, 1995-2018 J. Schilling */ X/* X * break a line pointed to by *buf into fields X * returns the number of tokens, the line was broken into (>= 1) X * X * delim is the delimiter to break at X * array[0 .. found-1] point to strings from broken line X * array[found ... len] point to '\0' X * len is the size of the array X * X * Copyright (c) 1985, 1995-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X X#ifdef PROTOTYPES XEXPORT int Xbreakline(char *buf, X register char delim, X register char *array[], X register int len) X#else XEXPORT int Xbreakline(buf, delim, array, len) X char *buf; X register char delim; X register char *array[]; X register int len; X#endif X{ X register char *bp = buf; X register char *dp; X register int i; X register int found; X X for (i = 0, found = 1; i < len; i++) { X for (dp = bp; *dp != '\0' && *dp != delim; dp++) X /* LINTED */ X ; X X array[i] = bp; X if (*dp == delim) { X *dp++ = '\0'; X found++; X } X bp = dp; X } X if (found > len) X found = len; X return (found); X} END-of-star-1.6/libschily/breakline.c echo x - star-1.6/libschily/findbytes.c sed 's/^X//' >star-1.6/libschily/findbytes.c << 'END-of-star-1.6/libschily/findbytes.c' X/* @(#)findbytes.c 1.7 10/08/23 Copyright 2000-2009 J. Schilling */ X/* X * Find a byte with specific value in memory. X * X * Copyright (c) 2000-2009 J. Schilling X * X * Based on a strlen() idea from Torbjorn Granlund (tege@sics.se) and X * Dan Sahlin (dan@sics.se) and the memchr() suggestion X * from Dick Karpinski (dick@cca.ucsf.edu). X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X#include X#include X X/* X * findbytes(p, cnt, val) is the same as memchr(p, val, cnt) X */ X#ifdef PROTOTYPES XEXPORT char * Xfindbytes(const void *vp, ssize_t cnt, char val) X#else XEXPORT char * Xfindbytes(vp, cnt, val) X const void *vp; X register ssize_t cnt; X char val; X#endif X{ X register Uchar uval = (Uchar)val; X register const Uchar *cp = (Uchar *)vp; X register const Ulong *lp; X register Ulong lval; X register Ulong lmask; X register Ulong magic_mask; X X /* X * Test byte-wise until cp is properly aligned for a long pointer. X */ X while (--cnt >= 0 && !laligned(cp)) { X if (*cp++ == uval) X return ((char *)--cp); X } X cnt++; X X /* X * The magic mask is a long word where all carry bits a clear. X * This are bits 8, 16, 24 ... X * In addition, the top bit is not set (e.g bit 31 or 63). The magic X * mask will look this way: X * X * bits: 01111110 11111110 ... 11111110 11111111 X * bytes: AAAAAAAA BBBBBBBB ... CCCCCCCC DDDDDDDD X * X * If we add anything to this magic number, no carry bit will change if X * it is the first carry bit left to a 0 byte. Adding anything != 0 X * to the magic number will just turn the carry bit left to the byte X * but does not propagate any further. X */ X#if SIZE_LONG == 4 X magic_mask = 0x7EFEFEFFL; X#else X#if SIZE_LONG == 8 X magic_mask = 0x7EFEFEFEFEFEFEFFL; X#else X /* X * #error will not work for all compilers (e.g. sunos4) X * The following line will abort compilation on all compilers X * if none of the above is defines. And that's what we want. X */ X error SIZE_LONG has unknown value X#endif X#endif X X lmask = val & 0xFF; X lmask |= lmask << 8; X lmask |= lmask << 16; X#if SIZE_LONG > 4 X lmask |= lmask << 32; X#endif X#if SIZE_LONG > 8 X error SIZE_LONG has unknown value X#endif X for (lp = (const Ulong *)cp; cnt >= sizeof (long); X cnt -= sizeof (long)) { X /* X * We are not looking for 0 bytes so we need to xor with the X * long mask of repeated bytes. If any of the bytes matches our X * wanted char, we will create a 0 byte in the current long. X * But how will we find if at least one byte in a long is zero? X * X * If we add 'magic_mask' and any of the holes in the magic X * mask do not change, we most likely found a 0 byte in the X * long word. It is only a most likely match because if bits X * 24..30 (ot bits 56..62) are 0 but bit 31 (or bit 63) is set X * we will believe that we found a match but there is none. X * This will happen if there is 0x80nnnnnn / 0x80nnnnnnnnnnnnnn X */ X lval = (*lp++ ^ lmask); /* create 0 byte on match */ X lval = (lval + magic_mask) ^ ~lval; /* + and set unchg. bits */ X if ((lval & ~magic_mask) != 0) { /* a magic hole was set */ X /* X * If any of the hole bits did not change by addition, X * we most likely had a match. X * If this was a correct match, find the matching byte. X */ X cp = (const Uchar *)(lp - 1); X X if (cp[0] == uval) X return ((char *)cp); X if (cp[1] == uval) X return ((char *)&cp[1]); X if (cp[2] == uval) X return ((char *)&cp[2]); X if (cp[3] == uval) X return ((char *)&cp[3]); X#if SIZE_LONG > 4 X if (cp[4] == uval) X return ((char *)&cp[4]); X if (cp[5] == uval) X return ((char *)&cp[5]); X if (cp[6] == uval) X return ((char *)&cp[6]); X if (cp[7] == uval) X return ((char *)&cp[7]); X#endif X#if SIZE_LONG > 8 X error SIZE_LONG has unknown value X#endif X } X } X X for (cp = (const Uchar *)lp; --cnt >= 0; ) { X if (*cp++ == uval) X return ((char *)--cp); X } X return ((char *)NULL); X} END-of-star-1.6/libschily/findbytes.c echo x - star-1.6/libschily/findline.c sed 's/^X//' >star-1.6/libschily/findline.c << 'END-of-star-1.6/libschily/findline.c' X/* @(#)findline.c 1.18 09/07/10 Copyright 1985, 1995-2003 J. Schilling */ X/* X * findline X * get a line from a file with matching string in a given field X * X * ofindline X * get a line from open file with matching string in a given field X * X * getbroken X * separate a line into fields X * X * all fill pointers into the given array, allocated to new storage X * X * Copyright (c) 1985, 1995-2003 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#define USE_LARGEFILES /* We must make this module large file aware */ X X#include X#include X#include X#include X#include /* Include sys/types.h to make off_t available */ X#include X#include X X#define MAXLBUF 4096 X X/* X * Return codes: X */ X#define SUCCESS 1 /* Found match */ X#define NO_MATCH -1 /* Found no line with matching string */ X#define ARG_ERROR -2 /* Bad parameter combination: */ X /* calls raisecond("findline_arg_err") before */ X#define OPEN_ERROR -3 /* Cannot open file */ X#define NO_MEM -4 /* No memory: */ X /* calls raisescond("findline_storage") before */ X XEXPORT int ofindline __PR((FILE *, char, const char *, int, X char **, int)); XEXPORT int findline __PR((const char *, char, const char *, int, X char **, int)); XEXPORT int getbroken __PR((FILE *, char *, char, char **, int)); X XLOCAL char *savestr __PR((const char *)); X X#ifdef PROTOTYPES XEXPORT int Xofindline(FILE *f, X char delim, X const char *string, X int field, X char *array[], X int arraysize) X#else XEXPORT int Xofindline(f, delim, string, field, array, arraysize) X FILE *f; X char delim; X char *string; X int field; X char *array[]; X int arraysize; X#endif X{ X int i; X char lbuf[MAXLBUF]; X X if (field >= arraysize) { X raisecond("findline_arg_err", 0L); X return (ARG_ERROR); X } X X fileseek(f, (off_t)0); /* XXX ??? Interface ändern!!! */ X for (;;) { X if (getbroken(f, lbuf, delim, array, arraysize) < 0) { X return (NO_MATCH); X } X if (streql(string, array[field])) { X for (i = 0; i < arraysize; i++) { X if ((array[i] = savestr(array[i])) == NULL) { X raisecond("findline_storage", 0L); X while (--i >= 0) X free(array[i]); X return (NO_MEM); X } X } X return (SUCCESS); X } X } X} X X#ifdef PROTOTYPES XEXPORT int Xfindline(const char *fname, X char delim, X const char *string, X int field, X char *array[], X int arraysize) X#else XEXPORT int Xfindline(fname, delim, string, field, array, arraysize) X char *fname; X char delim; X char *string; X int field; X char *array[]; X int arraysize; X#endif X{ X FILE *f; X int ret; X X if ((f = fileopen(fname, "r")) == 0) X return (OPEN_ERROR); X X ret = ofindline(f, delim, string, field, array, arraysize); X fclose(f); X return (ret); X} X X#ifdef PROTOTYPES XEXPORT int Xgetbroken(FILE *f, X char *linebuf, X char delim, X char *array[], X int len) X#else XEXPORT int Xgetbroken(f, linebuf, delim, array, len) X FILE *f; X char *linebuf; X char delim; X char *array[]; X int len; X#endif X{ X if (fgetline(f, linebuf, MAXLBUF) < 0) X return (EOF); X X breakline(linebuf, delim, array, len); X return (SUCCESS); X} X XLOCAL char * Xsavestr(s) X register const char *s; X{ X register char *p; X char *ret; X X if ((p = malloc(strlen(s)+1)) == NULL) X return (p); X ret = p; X while ((*p++ = *s++) != '\0') X /* LINTED */ X ; X return (ret); X} END-of-star-1.6/libschily/findline.c echo x - star-1.6/libschily/spawn.c sed 's/^X//' >star-1.6/libschily/spawn.c << 'END-of-star-1.6/libschily/spawn.c' X/* @(#)spawn.c 1.30 15/07/06 Copyright 1985, 1989, 1995-2015 J. Schilling */ X/* X * Spawn another process/ wait for child process X * X * Copyright (c) 1985, 1989, 1995-2015 J. Schilling X * X * This is an interface that exists in the public since 1982. X * The POSIX.1-2008 standard did ignore POSIX rules not to X * redefine existing public interfaces and redefined the interfaces X * forcing us to add a js_*() prefix to the original functions. X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef __DO__FSPAWNL__ X#define fspawnv __no__fspawnv__ X#define fspawnl __no__fspawnl__ X#define fspawnv_nowait __no__fspawnv_nowait__ X X#include X#include X#include X#include X#include X#include X#include X#include X#include X#define VMS_VFORK_OK X#include X#endif /* __DO__FSPAWNL__ */ X X#define MAX_F_ARGS 16 X X#ifndef __DO__FSPAWNL__ X#ifndef NO_FSPAWN_COMPAT /* Define to disable backward compatibility */ X#undef fspawnv X#undef fspawnl X#undef fspawnv_nowait X X/* X * The Cygwin compile environment incorrectly implements #pragma weak. X * The weak symbols are only defined as local symbols making it impossible X * to use them from outside the scope of this source file. X * A platform that allows linking with global symbols has HAVE_LINK_WEAK X * defined. X */ X#if defined(HAVE_PRAGMA_WEAK) && defined(HAVE_LINK_WEAK) X#pragma weak fspawnv = js_fspawnv X#pragma weak fspawnl = js_fspawnl X#pragma weak fspawnv_nowait = js_fspawnv_nowait X#else X XEXPORT int fspawnv __PR((FILE *, FILE *, FILE *, int, char * const *)); XEXPORT int fspawnl __PR((FILE *, FILE *, FILE *, const char *, ...)); XEXPORT int fspawnv_nowait __PR((FILE *, FILE *, FILE *, X const char *, int, char *const*)); XEXPORT int Xfspawnv(in, out, err, argc, argv) X FILE *in; X FILE *out; X FILE *err; X int argc; X char * const argv[]; X{ X return (js_fspawnv(in, out, err, argc, argv)); X} X XEXPORT int Xfspawnv_nowait(in, out, err, name, argc, argv) X FILE *in; X FILE *out; X FILE *err; X const char *name; X int argc; X char * const argv[]; X{ X return (js_fspawnv_nowait(in, out, err, name, argc, argv)); X} X X#define __DO__FSPAWNL__ X#define js_fspawnl fspawnl X#include "spawn.c" X#undef js_fspawnl X#undef __DO__FSPAWNL__ X X#endif /* HAVE_PRAGMA_WEAK && HAVE_LINK_WEAK */ X#endif /* NO_FSPAWN_COMPAT */ X XEXPORT int Xjs_fspawnv(in, out, err, argc, argv) X FILE *in; X FILE *out; X FILE *err; X int argc; X char * const argv[]; X{ X int pid; X X if ((pid = js_fspawnv_nowait(in, out, err, argv[0], argc, argv)) < 0) X return (pid); X X return (wait_chld(pid)); X} X#endif /* __DO__FSPAWNL__ */ X X/* VARARGS3 */ X#ifdef PROTOTYPES XEXPORT int Xjs_fspawnl(FILE *in, FILE *out, FILE *err, const char *arg0, ...) X#else XEXPORT int Xjs_fspawnl(in, out, err, arg0, va_alist) X FILE *in; X FILE *out; X FILE *err; X const char *arg0; X va_dcl X#endif X{ X va_list args; X int ac = 0; X char *xav[MAX_F_ARGS+1]; X char **av; Xconst char **pav; X char *p; X int ret; X X#ifdef PROTOTYPES X va_start(args, arg0); X#else X va_start(args); X#endif X if (arg0) { X ac++; X while (va_arg(args, char *) != NULL) X ac++; X } X va_end(args); X X if (ac <= MAX_F_ARGS) { X av = xav; X } else { X av = (char **)malloc((ac+1)*sizeof (char *)); X if (av == 0) X return (-1); X } X pav = (const char **)av; X X#ifdef PROTOTYPES X va_start(args, arg0); X#else X va_start(args); X#endif X *pav++ = arg0; X if (arg0) do { X p = va_arg(args, char *); X *pav++ = p; X } while (p != NULL); X va_end(args); X X ret = js_fspawnv(in, out, err, ac, av); X if (av != xav) X free(av); X return (ret); X} X X#ifndef __DO__FSPAWNL__ XEXPORT int Xjs_fspawnv_nowait(in, out, err, name, argc, argv) X FILE *in; X FILE *out; X FILE *err; X const char *name; X int argc; X char * const argv[]; X{ X int pid = -1; /* Initialization needed to make GCC happy */ X volatile int i; X X for (i = 1; i < 64; i *= 2) { X if ((pid = vfork()) >= 0) X break; X sleep(i); X } X if (pid != 0) X return (pid); X /* X * silly: fexecv must set av[ac] = NULL X * so we have to cast argv tp (char **) X */ X fexecv(name, in, out, err, argc, (char **)argv); X _exit(geterrno()); X /* NOTREACHED */ X#ifndef lint X return (0); /* keep gnu compiler happy */ X#endif X} X XEXPORT int Xwait_chld(pid) X int pid; X{ X int died; X WAIT_T status; X X do { X do { X died = wait(&status); X } while (died < 0 && geterrno() == EINTR); X if (died < 0) X return (died); X } while (died != pid); X X if (WCOREDUMP(status)) X unlink("core"); X X if (WIFEXITED(status)) X return (WEXITSTATUS(status)); X return (-WTERMSIG(status)); X} X#endif /* __DO__FSPAWNL__ */ END-of-star-1.6/libschily/spawn.c echo x - star-1.6/libschily/snprintf.c sed 's/^X//' >star-1.6/libschily/snprintf.c << 'END-of-star-1.6/libschily/snprintf.c' X/* @(#)snprintf.c 1.15 18/01/17 Copyright 1985, 1996-2018 J. Schilling */ X/* X * Copyright (c) 1985, 1996-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#define snprintf __nothing__ /* prototype may be wrong (e.g. IRIX) */ X#include X#include /* include try to get size_t */ X#include /* Try again for size_t */ X#include /* Try again for size_t */ X#include X#include X#include X#undef snprintf X X/* X * If PORT_ONLY is defined, snprintf() will only be compiled in if it is X * missing on the local platform. This is used by e.g. libschily. X */ X#if !defined(HAVE_SNPRINTF) || !defined(PORT_ONLY) X XEXPORT int snprintf __PR((char *, size_t maxcnt, const char *, ...)); X Xtypedef struct { X char *ptr; X int count; X} *BUF, _BUF; X X#ifdef PROTOTYPES Xstatic void X_cput(char c, void *l) X#else Xstatic void X_cput(c, l) X char c; X void *l; X#endif X{ X register BUF bp = (BUF)l; X X if (--bp->count > 0) { X *bp->ptr++ = c; X } else { X /* X * Make sure that there will never be a negative overflow. X */ X bp->count++; X } X} X X/* VARARGS2 */ X#ifdef PROTOTYPES XEXPORT int Xsnprintf(char *buf, size_t maxcnt, const char *form, ...) X#else XEXPORT int Xsnprintf(buf, maxcnt, form, va_alist) X char *buf; X unsigned maxcnt; X char *form; X va_dcl X#endif X{ X va_list args; X int cnt; X _BUF bb; X X bb.ptr = buf; X bb.count = maxcnt; X X#ifdef PROTOTYPES X va_start(args, form); X#else X va_start(args); X#endif X cnt = format(_cput, &bb, form, args); X va_end(args); X if (maxcnt > 0) X *(bb.ptr) = '\0'; X if (bb.count < 0) X return (-1); X X return (cnt); X} X X#endif /* !defined(HAVE_SNPRINTF) || !defined(PORT_ONLY) */ END-of-star-1.6/libschily/snprintf.c echo x - star-1.6/libschily/setfp.c sed 's/^X//' >star-1.6/libschily/setfp.c << 'END-of-star-1.6/libschily/setfp.c' X/* @(#)setfp.c 1.13 06/10/05 Copyright 1988, 1995-2003 J. Schilling */ X/* X * Set frame pointer X * X * Copyright (c) 1988, 1995-2003 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X X#if !defined(AV_OFFSET) || !defined(FP_INDIR) X# ifdef HAVE_SCANSTACK X# undef HAVE_SCANSTACK X# endif X#endif X X# ifdef HAVE_SCANSTACK X#include X X#define MAXWINDOWS 32 X#define NWINDOWS 7 X Xextern void **___fpoff __PR((char *cp)); X XEXPORT void Xsetfp(fp) X void * const *fp; X{ X long **dummy[1]; X X#ifdef sparc X flush_reg_windows(MAXWINDOWS-2); X#endif X *(long ***)(&((struct frame *)___fpoff((char *)&dummy[0]))->fr_savfp) = X (long **)fp; X#ifdef sparc X flush_reg_windows(MAXWINDOWS-2); X#endif X} X X#else X XEXPORT void Xsetfp(fp) X void * const *fp; X{ X raisecond("setfp_not_implemented", 0L); X} X X#endif END-of-star-1.6/libschily/setfp.c echo x - star-1.6/libschily/matchl.c sed 's/^X//' >star-1.6/libschily/matchl.c << 'END-of-star-1.6/libschily/matchl.c' X/* @(#)matchl.c 1.1 00/11/10 Copyright 1998 J. Schilling */ X/* X * Pattern matching function for line match (grep like). X * X * Copyright (c) 1998 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#define __LINE_MATCH X#include "match.c" END-of-star-1.6/libschily/matchl.c echo x - star-1.6/libschily/handlecond.c sed 's/^X//' >star-1.6/libschily/handlecond.c << 'END-of-star-1.6/libschily/handlecond.c' X/* @(#)handlecond.c 1.25 07/05/23 Copyright 1985-2004 J. Schilling */ X/* X * setup/clear a condition handler for a software signal X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X/* X * A procedure frame is marked to have handlers if the X * previous freme pointer for this procedure is odd. X * The even base value, in this case actually points to a SIGBLK which X * holds the saved "real" frame pointer. X * The SIGBLK mentioned above may me the start of a chain of SIGBLK's, X * containing different handlers. X * X * This will work on processors which support a frame pointer chain X * on the stack. X * On a processor which doesn't support this I think of a method X * where handlecond() has an own chain of frames, holding chains of X * SIGBLK's. X * In this case, a parameter has to be added to handlecond() and X * unhandlecond(). This parameter will be an opaque cookie which is zero X * on the first call to handlecond() in a procedure. X * A new cookie will be returned by handlecond() which must be used on X * each subsequent call to handlecond() and unhandlecond() in the same X * procedure. X * X * Copyright (c) 1985-2004 J. Schilling X */ X#include X#include X#include X#include X#include X#include X#include X#include X X#if !defined(AV_OFFSET) || !defined(FP_INDIR) X# ifdef HAVE_SCANSTACK X# undef HAVE_SCANSTACK X# endif X#endif X X#ifdef HAVE_SCANSTACK X#include X#else Xextern SIGBLK *__roothandle; X#endif /* HAVE_SCANSTACK */ X X#define is_even(p) ((((long)(p)) & 1) == 0) X#define even(p) (((long)(p)) & ~1L) X#if defined(__sun) && (defined(__i386) || defined(__amd64)) X/* X * Solaris x86 has a broken frame.h which defines the frame ptr to int. X */ X#define odd(p) (((Intptr_t)(p)) | 1) X#else X#define odd(p) (void *)(((Intptr_t)(p)) | 1) X#endif X X#ifdef __future__ X#define even(p) (((long)(p)) - 1) /* will this work with 64 bit ?? */ X#endif X XEXPORT void starthandlecond __PR((SIGBLK *sp)); X X#ifdef PROTOTYPES XEXPORT void Xhandlecond(const char *signame, X register SIGBLK *sp, X int (*func)(const char *, long, long), X long arg1) X#else XEXPORT void Xhandlecond(signame, sp, func, arg1) X char *signame; X register SIGBLK *sp; X BOOL (*func)(); X long arg1; X#endif X{ X register SIGBLK *this; X register SIGBLK *last = (SIGBLK *)NULL; X#ifdef HAVE_SCANSTACK X struct frame *fp = (struct frame *)NULL; X#endif X int slen; X X if (signame == NULL || (slen = strlen(signame)) == 0) { X raisecond("handle_bad_name", (long)signame); X abort(); X } X X#ifdef HAVE_SCANSTACK X fp = (struct frame *)getfp(); X fp = (struct frame *)fp->fr_savfp; /* point to frame of caller */ X if (is_even(fp->fr_savfp)) { X /* X * Easy case: no handlers yet X * save real framepointer in sp->sb_savfp X */ X sp->sb_savfp = (long **)fp->fr_savfp; X this = (SIGBLK *)NULL; X } else { X this = (SIGBLK *)even(fp->fr_savfp); X } X#else X this = __roothandle; X#endif X X for (; this; this = this->sb_signext) { X if (this == sp) { X /* X * If a SIGBLK is reused, the name must not change. X */ X if (this->sb_signame != NULL && X !streql(this->sb_signame, signame)) { X raisecond("handle_reused_block", (long)signame); X abort(); X } X sp->sb_sigfun = func; X sp->sb_sigarg = arg1; X return; X } X if (this->sb_signame != NULL && X streql(this->sb_signame, signame)) { X if (last == (SIGBLK *)NULL) { X /* X * 'this' is the first entry in chain X */ X if (this->sb_signext == (SIGBLK *)NULL) { X /* X * only 'this' entry is in chain, copy X * saved real frame pointer into new sp X */ X sp->sb_savfp = this->sb_savfp; X } else { X#ifdef HAVE_SCANSTACK X /* X * make second entry first link in chain X */ X this->sb_signext->sb_savfp = X this->sb_savfp; X fp->fr_savfp = odd(this->sb_signext); X#else X /* X * Cannot happen if scanning the stack X * is not possible... X */ X raisecond("handle_is_empty", (long)0); X abort(); X#endif X } X continue; /* don't trash 'last' ptr */ X } else { X last->sb_signext = this->sb_signext; X } X } X last = this; X } X sp->sb_signext = (SIGBLK *)NULL; X sp->sb_signame = signame; X sp->sb_siglen = slen; X sp->sb_sigfun = func; X sp->sb_sigarg = arg1; X /* X * If there is a chain append to end of the chain, else make it first X */ X if (last) X last->sb_signext = sp; X#ifdef HAVE_SCANSTACK X else X fp->fr_savfp = odd(sp); X#else X /* X * Cannot happen if scanning the stack is not possible... X */ X else { X raisecond("handle_is_empty", (long)0); X abort(); X } X#endif X} X XEXPORT void Xstarthandlecond(sp) X register SIGBLK *sp; X{ X#ifdef HAVE_SCANSTACK X struct frame *fp = NULL; X X /* X * As the SCO OpenServer C-Compiler has a bug that may cause X * the first function call to getfp() been done before the X * new stack frame is created, we call getfp() twice. X */ X (void) getfp(); X#endif X X sp->sb_signext = (SIGBLK *)NULL; X sp->sb_signame = NULL; X sp->sb_siglen = 0; X sp->sb_sigfun = (handlefunc_t)NULL; X sp->sb_sigarg = 0; X X#ifdef HAVE_SCANSTACK X fp = (struct frame *)getfp(); X fp = (struct frame *)fp->fr_savfp; /* point to frame of caller */ X X if (is_even(fp->fr_savfp)) { X /* X * Easy case: no handlers yet X * save real framepointer in sp X */ X sp->sb_savfp = (long **)fp->fr_savfp; X fp->fr_savfp = odd(sp); X } else { X raisecond("handle_not_empty", (long)0); X abort(); X } X#else X sp->sb_savfp = (long **)__roothandle; X __roothandle = sp; X#endif X} X XEXPORT void Xunhandlecond(sp) X register SIGBLK *sp; X{ X#ifdef HAVE_SCANSTACK X register struct frame *fp; X register SIGBLK *sps; X X /* X * As the SCO OpenServer C-Compiler has a bug that may cause X * the first function call to getfp() been done before the X * new stack frame is created, we call getfp() twice. X */ X (void) getfp(); X fp = (struct frame *)getfp(); X fp = (struct frame *)fp->fr_savfp; /* point to frame of caller */ X X if (!is_even(fp->fr_savfp)) { /* if handlers */ X sps = (SIGBLK *)even(fp->fr_savfp); /* point to SIGBLK */ X /* real framepointer */ X#if defined(__sun) && (defined(__i386) || defined(__amd64)) X fp->fr_savfp = (intptr_t)sps->sb_savfp; X#else X fp->fr_savfp = (struct frame *)sps->sb_savfp; X#endif X } X#else X if (__roothandle == NULL) { X raisecond("handle_is_empty", (long)0); X abort(); X } X /* X * Pop top level handler chain. X */ X __roothandle = (SIGBLK *)__roothandle->sb_savfp; X#endif X} END-of-star-1.6/libschily/handlecond.c echo x - star-1.6/libschily/getpagesize.c sed 's/^X//' >star-1.6/libschily/getpagesize.c << 'END-of-star-1.6/libschily/getpagesize.c' X/* @(#)getpagesize.c 1.5 09/07/10 Copyright 2001-2009 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)getpagesize.c 1.5 09/07/10 Copyright 2001-2009 J. Schilling"; X#endif X/* X * Copyright (c) 2001-2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef HAVE_GETPAGESIZE X#include X#include X#include X#include X X#ifdef HAVE_OS_H X#include /* BeOS for B_PAGE_SIZE */ X#endif X XEXPORT int getpagesize __PR((void)); X XEXPORT int Xgetpagesize() X{ X register int pagesize; X X#ifdef _SC_PAGESIZE X pagesize = sysconf(_SC_PAGESIZE); X#else /* ! _SC_PAGESIZE */ X X X#ifdef PAGESIZE /* Traditional UNIX page size from param.h */ X pagesize = PAGESIZE; X X#else /* ! PAGESIZE */ X X#ifdef B_PAGE_SIZE /* BeOS page size from OS.h */ X pagesize = B_PAGE_SIZE; X X#else /* ! B_PAGE_SIZE */ X X pagesize = 512; X#endif /* ! B_PAGE_SIZE */ X#endif /* ! PAGESIZE */ X#endif /* ! _SC_PAGESIZE */ X X return (pagesize); X} X X#endif /* HAVE_GETPAGESIZE */ END-of-star-1.6/libschily/getpagesize.c echo x - star-1.6/libschily/cmpnullbytes.c sed 's/^X//' >star-1.6/libschily/cmpnullbytes.c << 'END-of-star-1.6/libschily/cmpnullbytes.c' X/* @(#)cmpnullbytes.c 1.10 10/08/21 Copyright 1988,2002-2010 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)cmpnullbytes.c 1.10 10/08/21 Copyright 1988,2002-2010 J. Schilling"; X#endif /* lint */ X/* X * compare data against null X * Return the index of the first non-null character X * X * Copyright (c) 1988,2002-2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X X#define DO8(a) a; a; a; a; a; a; a; a; X X/* X * Return the index of the first non-null character X */ XEXPORT ssize_t Xcmpnullbytes(fromp, cnt) X const void *fromp; X ssize_t cnt; X{ X register const char *from = (char *)fromp; X register ssize_t n; X X /* X * If we change cnt to be unsigned, check for == instead of <= X */ X if ((n = cnt) <= 0) X return (cnt); X X /* X * Compare byte-wise until properly aligned for a long pointer. X */ X while (--n >= 0 && !laligned(from)) { X if (*from++ != 0) X goto cdiff; X } X n++; X X if (n >= (ssize_t)(8 * sizeof (long))) { X if (laligned(from)) { X register const long *froml = (const long *)from; X register ssize_t rem = n % (8 * sizeof (long)); X X n /= (8 * sizeof (long)); X do { X /* BEGIN CSTYLED */ X DO8( X if (*froml++ != 0) X break; X ); X /* END CSTYLED */ X } while (--n > 0); X X if (n > 0) { X --froml; X from = (const char *)froml; X goto ldiff; X } X from = (const char *)froml; X n = rem; X } X X if (n >= 8) { X n -= 8; X do { X /* BEGIN CSTYLED */ X DO8( X if (*from++ != 0) X goto cdiff; X ); X /* END CSTYLED */ X } while ((n -= 8) >= 0); X n += 8; X } X if (n > 0) do { X if (*from++ != 0) X goto cdiff; X } while (--n > 0); X return (cnt); X } X if (n > 0) do { X if (*from++ != 0) X goto cdiff; X } while (--n > 0); X return (cnt); Xldiff: X n = sizeof (long); X do { X if (*from++ != 0) X goto cdiff; X } while (--n > 0); Xcdiff: X return ((ssize_t)(--from - (char *)fromp)); X} END-of-star-1.6/libschily/cmpnullbytes.c echo x - star-1.6/libschily/rename.c sed 's/^X//' >star-1.6/libschily/rename.c << 'END-of-star-1.6/libschily/rename.c' X/* @(#)rename.c 1.11 11/06/18 Copyright 1998-2011 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)rename.c 1.11 11/06/18 Copyright 1998-2011 J. Schilling"; X#endif X/* X * rename() for old systems that don't have it. X * X * Copyright (c) 1998-2011 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#define rename __nothing__ X#include X X#ifndef HAVE_RENAME X X#include /* XXX not OK but needed for js_xx() in schily/schily.h */ X#include X#include X#include X#include X#include X#include X#include X#include X#include X#undef rename X#include X X#ifndef MAXPATHNAME X#define MAXPATHNAME 1024 X#endif X X#if MAXPATHNAME < 1024 X#undef MAXPATHNAME X#define MAXPATHNAME 1024 X#endif X X#define MAXNAME MAXPATHNAME X X#define FILEDESC struct stat X X#ifndef HAVE_LSTAT X#define lstat stat X#endif X XEXPORT int Xrename(old, new) X const char *old; X const char *new; X{ X char bakname[MAXNAME]; X char *p; X char strpid[32]; X int strplen; X int plen; X BOOL savpresent = FALSE; X BOOL newpresent = FALSE; X int serrno; X FILEDESC ostat; X FILEDESC xstat; X X serrno = geterrno(); X X if (lstat(old, &ostat) < 0) X return (-1); X X if (lstat(new, &xstat) >= 0) { X newpresent = TRUE; X if (ostat.st_dev == xstat.st_dev && X ostat.st_ino == xstat.st_ino) X return (0); /* old == new we are done */ X } X X#ifndef HAVE_MKTEMP X strplen = js_snprintf(strpid, sizeof (strpid), ".%llx", X (Llong)getpid()); X#else X strplen = 6; X strcpy(strpid, "XXXXXX"); X#endif X X /* X * Save old version of file 'new' to allow us to restore it. X * Platforms without rename() usually only support short filenames X * but limit pid to 32000. X */ X strlcpy(bakname, new, MAXNAME-strplen); X p = strrchr(bakname, '/'); X if (p == NULL) X p = bakname; X else X p++; X plen = strlen(p); X if ((plen + strplen) > 14) X p[14-strplen] = '\0'; X strcat(p, strpid); X#ifdef HAVE_MKTEMP X mktemp(bakname); X#endif X if (bakname[0] != '\0' && link(new, bakname) >= 0) X savpresent = TRUE; X X if (newpresent) { X if (rmdir(new) < 0) { X if (geterrno() == ENOTDIR) { X if (unlink(new) < 0) X return (-1); X } else { X return (-1); X } X } X } X X /* X * Now add 'new' name to 'old'. X */ X if (link(old, new) < 0) { X serrno = geterrno(); X /* X * Make sure not to loose old version of 'new'. X */ X if (savpresent) { X unlink(new); X link(bakname, new); X unlink(bakname); X } X seterrno(serrno); X return (-1); X } X if (unlink(old) < 0) X return (-1); X if (savpresent) X unlink(bakname); /* Fails in most cases... */ X seterrno(serrno); /* ...so restore errno */ X return (0); X} X#endif /* HAVE_RENAME */ END-of-star-1.6/libschily/rename.c echo x - star-1.6/libschily/strdup.c sed 's/^X//' >star-1.6/libschily/strdup.c << 'END-of-star-1.6/libschily/strdup.c' X/* @(#)strdup.c 1.6 10/08/21 Copyright 2003-2010 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)strdup.c 1.6 10/08/21 Copyright 2003-2010 J. Schilling"; X#endif X/* X * strdup() to be used if missing in libc X * X * Copyright (c) 2003-2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X X#ifndef HAVE_STRDUP X XEXPORT char * Xstrdup(s) X const char *s; X{ X unsigned i = strlen(s) + 1; X char *res = malloc(i); X X if (res == NULL) X return (NULL); X if (i > 16) { X movebytes(s, res, (int)i); X } else { X char *s2 = res; X X while ((*s2++ = *s++) != '\0') X ; X } X return (res); X} X#endif /* HAVE_STRDUP */ END-of-star-1.6/libschily/strdup.c echo x - star-1.6/libschily/libschily.com sed 's/^X//' >star-1.6/libschily/libschily.com << 'END-of-star-1.6/libschily/libschily.com' X$ define/nolog scg [-.libscg.scg] X$ set default [-.inc] X$ cc/float=ieee/pref=all/obj/incl=([],[-.include])/define=("VMS") ALIGN_TEST.C X$ link ALIGN_TEST X$ delete ALIGN_TEST.obj;* X$ def/user sys$output [-.libschily]ALIGN.H X$ r ALIGN_TEST X$ cc/float=ieee/pref=all/obj/incl=([],[-.include])/define=("VMS") AVOFFSET.C X$ link AVOFFSET X$ delete AVOFFSET.obj;* X$ def/user sys$output [-.libschily]AVOFFSET.H X$ r AVOFFSET X$ set default [-.libschily] X$ opts = "/float=ieee/pref=all/obj" X$ incs = "/incl=([],[-.include],[-.inc])" X$ cc 'opts' 'incs' /define=("VMS") ASTOI.C X$ cc 'opts' 'incs' /define=("VMS") ASTOLL.C X$ cc 'opts' 'incs' /define=("VMS") COMERR.C X$ cc 'opts' 'incs' /define=("VMS") ERROR.C X$ cc 'opts' 'incs' /define=("VMS") FCONV.C X$ cc 'opts' 'incs' /define=("VMS") FILLBYTES.C X$ cc 'opts' 'incs' /define=("VMS") FORMAT.C X$ cc 'opts' 'incs' /define=("VMS") GETARGS.C X$ cc 'opts' 'incs' /define=("VMS") GETAV0.C X$ cc 'opts' 'incs' /define=("VMS") GETERRNO.C X$ cc 'opts' 'incs' /define=("VMS") GETFP.C X$ cc 'opts' 'incs' /define=("VMS") MOVEBYTES.C X$ cc 'opts' 'incs' /define=("VMS") PRINTF.C X$ cc 'opts' 'incs' /define=("VMS") RAISECOND.C X$ cc 'opts' 'incs' /define=("VMS") SAVEARGS.C X$ cc 'opts' 'incs' /define=("VMS") jsprintf.C X$ cc 'opts' 'incs' /define=("VMS") jssnprintf.C X$ cc 'opts' 'incs' /define=("VMS") STREQL.C X$ cc 'opts' 'incs' /define=("VMS") SWABBYTES.C X$ cc 'opts' 'incs' /define=("VMS") SERRMSG.C X$ cc 'opts' 'incs' /define=("VMS") CMPBYTES.C X$ cc 'opts' 'incs' /define=("VMS") SETERRNO.C X$ libr/crea [-.libs]libschily.olb X$ libr/ins [-.libs]libschily.olb *.obj X$ delete *.obj;* X$ purge/nolog [-.libs]*.olb X$ set default [.stdio] X$ incs1 = "/INCL=([],[--.INCLUDE])" X$ cc'opts' 'incs1'/DEFINE=("VMS") CVMOD.C X$ cc'opts' 'incs1'/DEFINE=("VMS") DAT.C X$ cc'opts' 'incs1'/DEFINE=("VMS") FCONS.C X$ cc'opts' 'incs1'/DEFINE=("VMS") FGETLINE.C X$ cc'opts' 'incs1'/DEFINE=("VMS") FILEOPEN.C X$ cc'opts' 'incs1'/DEFINE=("VMS") FILEREAD.C X$ cc'opts' 'incs1'/DEFINE=("VMS") FILEWRITE.C X$ cc'opts' 'incs1'/DEFINE=("VMS") FLAG.C X$ cc'opts' 'incs1'/DEFINE=("VMS") FLUSH.C X$ cc'opts' 'incs1'/DEFINE=("VMS") NIREAD.C X$ cc'opts' 'incs1'/DEFINE=("VMS") FILELUOPEN.C X$ cc'opts' 'incs1'/DEFINE=("VMS") FILESIZE.C X$ libr/cre [--.libs]stdio.olb X$ libr/ins [--.libs]stdio.olb *.obj X$ delete *.obj;* X$ purge/nolog [--.libs]*.olb X$ set default [-] END-of-star-1.6/libschily/libschily.com echo x - star-1.6/libschily/libschily-mapvers sed 's/^X//' >star-1.6/libschily/libschily-mapvers << 'END-of-star-1.6/libschily/libschily-mapvers' X# /* @(#)libschily-mapvers 1.63 18/10/14 Copyright 2005-2018 J. Schilling */ X#include X XSCHILY_2.0 { X ovstrcpy; X mkfstream; # New allocator because structure did grow X fsgetc; # Always use central funtion in new version X getvargs; # ga_props and ga_flags flipped 23. 10. 2016 X getvallargs; # ga_props and ga_flags flipped 23. 10. 2016 X getvfiles; # ga_props and ga_flags flipped 23. 10. 2016 X} SCHILY_1.10; X XSCHILY_1.10 { Xglobal: X#ifndef HAVE_OPENAT X openat X openat64 X#endif X#ifndef HAVE_FSTATAT X fstatat64; X#endif X#ifndef HAVE_WAITID X js_waitid; X#endif X gterror; X gtprintf; X gtcomerr; X gtxcomerr; X gtcomerrno; X gtxcomerrno; X gterrmsg; X gterrmsgno; X fgtprintf; X fgtcomerr; X fgtxcomerr; X fgtcomerrno; X fgtxcomerrno; X fgterrmsg; X fgterrmsgno; X#ifndef HAVE_STRCSPN X strcspn; X#endif X#ifndef HAVE_STRLCAT X strlcat; X#endif X#ifndef HAVE_STRNLEN X strnlen; X#endif X#ifndef HAVE_STRSPN X strspn; X#endif X#ifndef HAVE_STRSTR X strstr; X#endif X#ifndef HAVE_STRTOD X strtod; X#endif X#ifndef HAVE_WCSCSPN X wcscspn; X#endif X#ifndef HAVE_WCSSPN X wcsspn; X#endif X#ifndef HAVE_WCSSTR X wcsstr; X#endif X} SCHILY_1.9; X XSCHILY_1.9 { Xglobal: X fsgetlen; X#ifndef HAVE_PUTENV X putenv; X#endif X#ifndef HAVE_UNSETENV X unsetenv; X#endif X} SCHILY_1.8; X XSCHILY_1.8 { Xglobal: X astoul; X astoulb; X js_dprintf; X movecbytes; X patmbmatch; X patmblmatch; X} SCHILY_1.7; X XSCHILY_1.7 { Xglobal: X#ifndef HAVE_GETDELIM X getdelim; X#endif X js_fjmexval; X js_jmexval; X js_mexval; X strlcatl; X wcslcatl; X} SCHILY_1.6; X XSCHILY_1.6 { Xglobal: X absfpath; X resolvefpath; X closewd; X fdsetname; X fdclosename; X lxchdir; X qftoes; X qftofs; X restorewd; X savewd; X#ifndef HAVE_FACCESSAT X faccessat; X#endif X#ifndef HAVE_LCHMOD X lchmod; X#endif X#ifndef HAVE_FCHDIR X fchdir; X#endif X#ifndef HAVE_FCHMODAT X fchmodat; X#endif X#ifndef HAVE_FCHOWNAT X fchownat; X#endif X#ifndef HAVE_FDOPENDIR X fdopendir; X#endif X#ifndef HAVE_FSTATAT X fstatat; X#endif X#ifndef HAVE_FUTIMENS X futimens; X#endif X#ifndef HAVE_FUTIMESAT X futimesat; X#endif X#ifndef HAVE_LUTIMENS X lutimens; X#endif X#ifndef HAVE_LINKAT X linkat; X#endif X#ifndef HAVE_MKDIRAT X mkdirat; X#endif X#ifndef HAVE_MKFIFO X mkfifo; X#endif X#ifndef HAVE_MKFIFOAT X mkfifoat; X#endif X#ifndef HAVE_MKNODAT X mknodat; X#endif X#ifndef HAVE_READLINKAT X readlinkat; X#endif X#ifndef HAVE_RENAMEAT X renameat; X#endif X#ifndef HAVE_SYMLINKAT X symlinkat; X#endif X#ifndef HAVE_UNLINKAT X unlinkat; X#endif X#ifndef HAVE_UTIMENS X utimens; X#endif X#ifndef HAVE_UTIMENSAT X utimensat; X#endif X fxcomerr; X fxcomerrno; X xcomerr; X xcomerrno; X fprformat; X X fspush; X fspop; X fspushed; X X#ifndef HAVE_DLOPEN X dlopen; X dlclose; X dlsym; X dlerror; X#endif X} SCHILY_1.5; X XSCHILY_1.5 { Xglobal: X getnstimeofday; X setnstimeofday; X X#ifndef HAVE_GETUID X getuid; X#endif X#ifndef HAVE_GETEUID X geteuid; X#endif X#ifndef HAVE_SETUID X setuid; X#endif X#ifndef HAVE_SETEUID X seteuid; X#endif X X#ifndef HAVE_GETGID X getgid; X#endif X#ifndef HAVE_GETEGID X getegid; X#endif X#ifndef HAVE_SETGID X setgid; X#endif X#ifndef HAVE_SETEGID X setegid; X#endif X#if !defined(HAVE_GETGRNAM) && !defined(HAVE_GETGRENT) && \ X !defined(HAVE_GETGRGID) && !defined(HAVE_SETGRENT) && \ X !defined(HAVE_ENDGRENT) X getgrent; X setgrent; X endgrent; X getgrnam; X getgrgid; X#endif X#if !defined(HAVE_GETPWNAM) && !defined(HAVE_GETPWENT) && \ X !defined(HAVE_GETPWUID) && !defined(HAVE_SETPWENT) && \ X !defined(HAVE_ENDPWENT) X getpwent; X setpwent; X endpwent; X getpwnam; X getpwuid; X#endif X get_progpath; X getexecpath; X X diropen; X dirrdopen; X dirclose; X X fgetaline; X getaline; X X js_fgetline; X js_getline; X X js_fexecl; X js_fexecle; X js_fexecv; X js_fexecve; X X js_fspawnv; X js_fspawnl; X js_fspawnv_nowait; X X _getarginit; X X getlallargs; X getlargs; X getlfiles; X X mkgmtime; X mklgmtime; X mkdirs; X makedirs; X abspath; X absnpath; X#ifndef HAVE_RESOLVEPATH X resolvepath; X#endif X resolvenpath; X X#if !defined(HAVE_FNMATCH) X fnmatch; X#endif X js_fnmatch; X X findinpath; X permtostr; X searchfileinpath; X X#ifndef HAVE_TIMEGM X timegm; X#endif X cmpmbytes; X zerobytes; X X#ifndef HAVE_STRCASECMP X strcasecmp; X#endif X#ifndef HAVE_STRNCASECMP X strncasecmp; X#endif X X} SCHILY_1.4; X XSCHILY_1.4 { Xglobal: X patwcompile; X patwmatch; X patwlmatch; X X#ifndef HAVE_STRNDUP X strndup; X#endif X#ifndef HAVE_WCSCAT X wcscat; X#endif X X wcscatl; X X#ifndef HAVE_WCSCHR X wcschr; X#endif X#ifndef HAVE_WCSCMP X wcscmp; X#endif X#ifndef HAVE_WCSCPY X wcscpy; X#endif X#ifndef HAVE_WCSDUP X wcsdup; X#endif X X wcseql; X X#ifndef HAVE_WCSLCAT X wcslcat; X#endif X#ifndef HAVE_WCSLCPY X wcslcpy; X#endif X#ifndef HAVE_WCSLEN X wcslen; X#endif X#ifndef HAVE_WCSNCAT X wcsncat; X#endif X#ifndef HAVE_WCSNCMP X wcsncmp; X#endif X#ifndef HAVE_WCSNCPY X wcsncpy; X#endif X#ifndef HAVE_WCSNDUP X wcsndup; X#endif X#ifndef HAVE_WCSNLEN X wcsnlen; X#endif X#ifndef HAVE_WCSRCHR X wcsrchr; X#endif X} SCHILY_1.3; X XSCHILY_1.3 { Xglobal: X#ifndef HAVE_EACCESS X eaccess; X#endif X X errabort; # Non stable X errconfig; # Non stable X errhidden; # Non stable X errwarnonly; # Non stable X X getperm; X X#ifdef __old_compat__ X mkfstream; X#endif X fsclose; X#ifdef __old_compat__ X fsgetc; X#endif X fspushcha; X fspushstr; X fssetfile; X X} SCHILY_1.2; X XSCHILY_1.2 { Xglobal: X getnum; X getllnum; X getxnum; X getllxnum; X gettnum; X getlltnum; X getxtnum; X getllxtnum; X#ifdef __old_compat__ X getvargs; X getvallargs; X getvfiles; X#endif X getargerror; X X#ifndef HAVE_STRLCPY X strlcpy; X#endif X#ifndef HAVE_STRNCPY X strncpy; X#endif X X js_malloc; X js_realloc; X js_savestr; X js_jmalloc; X js_jrealloc; X js_jsavestr; X js_fjmalloc; X js_fjrealloc; X js_fjsavestr; X X fcomerr; X fcomerrno; X ferrmsg; X ferrmsgno; X _comerr; X X file_getraise; X} SCHILY_1.1; X XSCHILY_1.1 { Xglobal: X astoull; X astoullb; X} SCHILY_1.0; X XSCHILY_1.0 { Xglobal: X _cvmod; X _fcons; X _fcons64; X _getargs; X _niread; X _niwrite; X _nixread; X _nixwrite; X _openfd; X _openfd64; X astoi; X astol; X astolb; X astoll; X astollb; X breakline; X cmpbytes; X cmpnullbytes; X comerr; X comerrno; X comexit; X errmsg; X errmsgno; X errmsgstr; X error; X fdown; X fdup; X fdup64; X#ifndef NO_FEXEC_COMPAT X fexecl; X fexecle; X fexecv; X fexecve; X#endif X ffileread; X ffilewrite; X#ifndef NO_GETLINE_COMPAT X fgetline; X#endif X fgetstr; X file_raise; X fileclose; X fileluopen; X fileluopen64; X filemopen; X filemopen64; X fileopen; X fileopen64; X filepos; X filepos64; X fileread; X filereopen; X filereopen64; X fileseek; X fileseek64; X filesize; X filesize64; X filestat; X filestat64; X filewrite; X fillbytes; X findbytes; X findline; X flush; X format; X fpipe; X#ifndef NO_FSPAWN_COMPAT X fspawnl; X fspawnv; X fspawnv_nowait; X#endif X ftoes; X ftofs; X get_progname; X getallargs; X getargs; X getav0; X getavp; X getbroken; X getdomainname; X geterrno; X getfiles; X getfp; X#ifndef NO_GETLINE_COMPAT X getline; X#endif X getmainfp; X getstr; X handlecond; X js_fprintf; X js_printf; X js_snprintf; X js_sprintf; X movebytes; X ofindline; X on_comerr; X opatlmatch; X opatmatch; X patcompile; X patlmatch; X patmatch; X peekc; X raisecond; X save_args; X saved_ac; X saved_av; X saved_av0; X serrmsg; X serrmsgno; X set_progname; X seterrno; X setfp; X starthandlecond; X#ifndef HAVE_STRCAT X strcat; X#endif X X strcatl; X X#ifndef HAVE_STRCHR X strchr; X#endif X#ifndef HAVE_STRCMP X strcmp; X#endif X#ifndef HAVE_STRCPY X strcpy; X#endif X#ifndef HAVE_STRDUP X strdup; X#endif X X streql; X X#ifndef HAVE_STRLEN X strlen; X#endif X#ifndef HAVE_STRNCAT X strncat; X#endif X#ifndef HAVE_STRNCMP X strncmp; X#endif X#ifndef HAVE_STRRCHR X strrchr; X#endif X swabbytes; X unhandlecond; X wait_chld; X X#ifdef _should_we_ X fprintf; X printf; X snprintf; X sprintf; X#endif X Xlocal: X *; X}; END-of-star-1.6/libschily/libschily-mapvers echo x - star-1.6/libschily/astoull.c sed 's/^X//' >star-1.6/libschily/astoull.c << 'END-of-star-1.6/libschily/astoull.c' X/* @(#)astoull.c 1.3 18/08/31 Copyright 1985, 2000-2018 J. Schilling */ X/* X * astoll() converts a string to long long X * X * Leading tabs and spaces are ignored. X * Both return pointer to the first char that has not been used. X * Caller must check if this means a bad conversion. X * X * leading "+" is ignored X * leading "0" makes conversion octal (base 8) X * leading "0x" makes conversion hex (base 16) X * X * Llong is silently reverted to long if the compiler does not X * support long long. X * X * Copyright (c) 1985, 2000-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X X#ifndef NO_SIGNED_ULONG X#define DO_SIGNED X#endif X X#define is_space(c) ((c) == ' ' || (c) == '\t') X#define is_digit(c) ((c) >= '0' && (c) <= '9') X#define is_hex(c) (\ X ((c) >= 'a' && (c) <= 'f') || \ X ((c) >= 'A' && (c) <= 'F')) X X#define is_lower(c) ((c) >= 'a' && (c) <= 'z') X#define is_upper(c) ((c) >= 'A' && (c) <= 'Z') X#define to_lower(c) (((c) >= 'A' && (c) <= 'Z') ? (c) - 'A'+'a' : (c)) X X#if ('i' + 1) < 'j' X#define BASE_MAX ('i' - 'a' + 10 + 1) /* This is EBCDIC */ X#else X#define BASE_MAX ('z' - 'a' + 10 + 1) /* This is ASCII */ X#endif X X X XEXPORT char *astoull __PR((const char *s, Ullong *l)); XEXPORT char *astoullb __PR((const char *s, Ullong *l, int base)); X XEXPORT char * Xastoull(s, l) X register const char *s; X Ullong *l; X{ X return (astoullb(s, l, 0)); X} X XEXPORT char * Xastoullb(s, l, base) X register const char *s; X Ullong *l; X register int base; X{ X#ifdef DO_SIGNED X int neg = 0; X#endif X register Ullong ret = (Ullong)0; X Ullong maxmult; X register int digit; X register char c; X X if (base > BASE_MAX || base == 1 || base < 0) { X seterrno(EINVAL); X return ((char *)s); X } X X while (is_space(*s)) X s++; X X if (*s == '+') { X s++; X } else if (*s == '-') { X#ifndef DO_SIGNED X seterrno(EINVAL); X return ((char *)s); X#else X s++; X neg++; X#endif X } X X if (base == 0) { X if (*s == '0') { X base = 8; X s++; X if (*s == 'x' || *s == 'X') { X s++; X base = 16; X } X } else { X base = 10; X } X } X maxmult = TYPE_MAXVAL(Ullong) / base; X for (; (c = *s) != 0; s++) { X X if (is_digit(c)) { X digit = c - '0'; X#ifdef OLD X } else if (is_hex(c)) { X digit = to_lower(c) - 'a' + 10; X#else X } else if (is_lower(c)) { X digit = c - 'a' + 10; X } else if (is_upper(c)) { X digit = c - 'A' + 10; X#endif X } else { X break; X } X X if (digit < base) { X if (ret > maxmult) X goto overflow; X ret *= base; X if (TYPE_MAXVAL(Ullong) - ret < digit) X goto overflow; X ret += digit; X } else { X break; X } X } X#ifdef DO_SIGNED X if (neg) X ret = -ret; X#endif X *l = ret; X return ((char *)s); Xoverflow: X for (; (c = *s) != 0; s++) { X X if (is_digit(c)) { X digit = c - '0'; X } else if (is_lower(c)) { X digit = c - 'a' + 10; X } else if (is_upper(c)) { X digit = c - 'A' + 10; X } else { X break; X } X if (digit >= base) X break; X } X *l = TYPE_MAXVAL(Ullong); X seterrno(ERANGE); X return ((char *)s); X} END-of-star-1.6/libschily/astoull.c echo x - star-1.6/libschily/strlcpy.c sed 's/^X//' >star-1.6/libschily/strlcpy.c << 'END-of-star-1.6/libschily/strlcpy.c' X/* @(#)strlcpy.c 1.4 09/07/08 Copyright 2006-2009 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)strlcpy.c 1.4 09/07/08 Copyright 2006-2009 J. Schilling"; X#endif X/* X * strlcpy() to be used if missing in libc X * X * Copyright (c) 2006-2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X X#ifndef HAVE_STRLCPY X XEXPORT size_t Xstrlcpy(s1, s2, len) X register char *s1; X register const char *s2; X register size_t len; X{ X const char *os2 = s2; X X if (len > 0) { X while (--len > 0 && (*s1++ = *s2++) != '\0') X ; X if (len == 0) { X *s1 = '\0'; X while (*s2++ != '\0') X ; X } X } else { X while (*s2++ != '\0') X ; X } X return (--s2 - os2); X} X#endif /* HAVE_STRLCPY */ END-of-star-1.6/libschily/strlcpy.c echo x - star-1.6/libschily/strncpy.c sed 's/^X//' >star-1.6/libschily/strncpy.c << 'END-of-star-1.6/libschily/strncpy.c' X/* @(#)strncpy.c 1.5 10/05/07 Copyright 2006-2010 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)strncpy.c 1.5 10/05/07 Copyright 2006-2010 J. Schilling"; X#endif X/* X * strncpy() to be used if missing in libc X * X * Copyright (c) 2006-2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X X#ifndef HAVE_STRNCPY X XEXPORT char * Xstrncpy(s1, s2, len) X register char *s1; X register const char *s2; X register size_t len; X{ X char *ret = s1; X X if (len == 0) X return (ret); X X do { X if ((*s1++ = *s2++) == '\0') X break; X } while (--len > 0); X if (len > 0) { X while (--len > 0) X *s1++ = '\0'; X } X return (ret); X} X#endif /* HAVE_STRNCPY */ END-of-star-1.6/libschily/strncpy.c echo x - star-1.6/libschily/fnmatch.c sed 's/^X//' >star-1.6/libschily/fnmatch.c << 'END-of-star-1.6/libschily/fnmatch.c' X/* @(#)fnmatch.c 8.25 18/01/12 2005-2018 J. Schilling from 8.2 (Berkeley) */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)fnmatch.c 8.25 18/01/12 2005-2018 J. Schilling from 8.2 (Berkeley)"; X#endif X/* X * Copyright (c) 1989, 1993, 1994 X * The Regents of the University of California. All rights reserved. X * X * This code is derived from software contributed to Berkeley by X * Guido van Rossum. X * X * Copyright (c) 2005-2018 J. Schilling X * Copyright (c) 2011 The FreeBSD Foundation X * All rights reserved. X * Portions of this software were developed by David Chisnall X * under sponsorship from the FreeBSD Foundation. X * X * Redistribution and use in source and binary forms, with or without X * modification, are permitted provided that the following conditions X * are met: X * 1. Redistributions of source code must retain the above copyright X * notice, this list of conditions and the following disclaimer. X * 2. Redistributions in binary form must reproduce the above copyright X * notice, this list of conditions and the following disclaimer in the X * documentation and/or other materials provided with the distribution. X * 3. Neither the name of the University nor the names of its contributors X * may be used to endorse or promote products derived from this software X * without specific prior written permission. X * X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE X * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF X * SUCH DAMAGE. X */ X X#if defined(LIBC_SCCS) && !defined(lint) Xstatic UConst char sccsid[] = "@(#)fnmatch.c 8.25 (Berkeley) 01/12/18"; X#endif /* LIBC_SCCS and not lint */ X/* "FBSD src/lib/libc/gen/fnmatch.c,v 1.19 2010/04/16 22:29:24 jilles Exp $" */ X X/* X * Function fnmatch() as specified in POSIX 1003.2-1992, section B.6. X * Compares a filename or pathname to a pattern. X */ X X/* X * Some notes on multibyte character support: X * 1. Patterns with illegal byte sequences match nothing. X * 2. Illegal byte sequences in the "string" argument are handled by treating X * them as single-byte characters with a value of the first byte of the X * sequence cast to wchar_t. X * 3. Multibyte conversion state objects (mbstate_t) are passed around and X * used for most, but not all, conversions. Further work will be required X * to support state-dependent encodings. X */ X X#include X#include X#include X#include X#include X#include X#include /* Define missing prototypes */ X X#define EOS '\0' X X#define RANGE_MATCH 1 X#define RANGE_NOMATCH 0 X#define RANGE_ERROR (-1) X X#define CL_SIZE 32 /* Max size for '[: :]' */ X Xstatic int rangematch __PR((const char *, wchar_t, int, char **, mbstate_t *)); Xstatic int fnmatch1 __PR((const char *, const char *, const char *, int, X mbstate_t, mbstate_t)); X X#ifndef HAVE_FNMATCH X#undef fnmatch X X/* X * The Cygwin compile environment incorrectly implements #pragma weak. X * The weak symbols are only defined as local symbols making it impossible X * to use them from outside the scope of this source file. X * A platform that allows linking with global symbols has HAVE_LINK_WEAK X * defined. X */ X#if defined(HAVE_PRAGMA_WEAK) && defined(HAVE_LINK_WEAK) X#pragma weak fnmatch = js_fnmatch X#else Xint Xfnmatch(pattern, string, flags) X const char *pattern; X const char *string; X int flags; X{ X return (js_fnmatch(pattern, string, flags)); X} X#endif X#endif X Xint Xjs_fnmatch(pattern, string, flags) X const char *pattern; X const char *string; X int flags; X{ X /* X * SunPro C gives a warning if we do not initialize an object: X * static const mbstate_t initial; X * GCC gives a warning if we try to initialize it. X * As the POSIX standard forbids mbstate_t from being an array, X * we do not need "const", the var is always copied when used as X * a parapemeter for fnmatch1(); X */ X static mbstate_t initial; X X return (fnmatch1(pattern, string, string, flags, initial, initial)); X} X Xstatic int Xfnmatch1(pattern, string, stringstart, flags, patmbs, strmbs) X const char *pattern; X const char *string; X const char *stringstart; X int flags; X mbstate_t patmbs; X mbstate_t strmbs; X{ X const char *bt_pattern, *bt_string; X mbstate_t bt_patmbs, bt_strmbs; X char *newp; X char c; X wchar_t pc, sc; X size_t pclen, sclen; X X bt_pattern = bt_string = NULL; X for (;;) { X pclen = mbrtowc(&pc, pattern, MB_LEN_MAX, &patmbs); X if (pclen == (size_t)-1 || pclen == (size_t)-2) X return (FNM_NOMATCH); X pattern += pclen; X sclen = mbrtowc(&sc, string, MB_LEN_MAX, &strmbs); X if (sclen == (size_t)-1 || sclen == (size_t)-2) { X sc = (unsigned char)*string; X sclen = 1; X memset(&strmbs, 0, sizeof (strmbs)); X } X switch (pc) { X case EOS: X if ((flags & FNM_LEADING_DIR) && sc == '/') X return (0); X if (sc == EOS) X return (0); X goto backtrack; X case '?': X if (sc == EOS) X return (FNM_NOMATCH); X if (sc == '/' && (flags & FNM_PATHNAME)) X goto backtrack; X if (sc == '.' && (flags & FNM_PERIOD) && X (string == stringstart || X ((flags & FNM_PATHNAME) && *(string - 1) == '/'))) X goto backtrack; X string += sclen; X break; X case '*': X c = *pattern; X /* Collapse multiple stars. */ X while (c == '*') X c = *++pattern; X X if (sc == '.' && (flags & FNM_PERIOD) && X (string == stringstart || X ((flags & FNM_PATHNAME) && *(string - 1) == '/'))) X goto backtrack; X X /* Optimize for pattern with * at end or before /. */ X if (c == EOS) { X if (flags & FNM_PATHNAME) X return ((flags & FNM_LEADING_DIR) || X strchr(string, '/') == NULL ? X 0 : FNM_NOMATCH); X else X return (0); X } else if (c == '/' && flags & FNM_PATHNAME) { X if ((string = strchr(string, '/')) == NULL) X return (FNM_NOMATCH); X break; X } X X /* X * First try the shortest match for the '*' that X * could work. We can forget any earlier '*' since X * there is no way having it match more characters X * can help us, given that we are already here. X */ X bt_pattern = pattern, bt_patmbs = patmbs; X bt_string = string, bt_strmbs = strmbs; X break; X case '[': X if (sc == EOS) X return (FNM_NOMATCH); X if (sc == '/' && (flags & FNM_PATHNAME)) X goto backtrack; X if (sc == '.' && (flags & FNM_PERIOD) && X (string == stringstart || X ((flags & FNM_PATHNAME) && *(string - 1) == '/'))) X goto backtrack; X X switch (rangematch(pattern, sc, flags, &newp, X &patmbs)) { X case RANGE_ERROR: X goto norm; X case RANGE_MATCH: X pattern = newp; X break; X case RANGE_NOMATCH: X goto backtrack; X } X string += sclen; X break; X case '\\': X if (!(flags & FNM_NOESCAPE)) { X pclen = mbrtowc(&pc, pattern, MB_LEN_MAX, X &patmbs); X if (pclen == (size_t)-1 || pclen == (size_t)-2) X return (FNM_NOMATCH); X if (pclen == 0) X return (FNM_NOMATCH); X pattern += pclen; X } X /* FALLTHROUGH */ X default: X norm: X string += sclen; X if (pc == sc) { X ; X } else if ((flags & FNM_CASEFOLD) && X (towlower(pc) == towlower(sc))) { X ; X } else { X backtrack: X /* X * If we have a mismatch (other than hitting X * the end of the string), go back to the last X * '*' seen and have it match one additional X * character. X */ X if (bt_pattern == NULL) X return (FNM_NOMATCH); X sclen = mbrtowc(&sc, bt_string, MB_LEN_MAX, X &bt_strmbs); X if (sclen == (size_t)-1 || X sclen == (size_t)-2) { X sc = (unsigned char)*bt_string; X sclen = 1; X memset(&bt_strmbs, 0, X sizeof (bt_strmbs)); X } X if (sc == EOS) X return (FNM_NOMATCH); X if (sc == '/' && flags & FNM_PATHNAME) X return (FNM_NOMATCH); X bt_string += sclen; X pattern = bt_pattern, patmbs = bt_patmbs; X string = bt_string, strmbs = bt_strmbs; X } X break; X } X } X /* NOTREACHED */ X} X X#ifdef PROTOTYPES Xstatic int Xrangematch(const char *pattern, wchar_t test, int flags, char **newp, X mbstate_t *patmbs) X#else Xstatic int Xrangematch(pattern, test, flags, newp, patmbs) X const char *pattern; X wchar_t test; X int flags; X char **newp; X mbstate_t *patmbs; X#endif X{ X int negate, ok; X wchar_t c, c2; X wchar_t otest = test; X size_t pclen; X const char *origpat; X/*#define XXX_COLLATE*/ X#ifdef XXX_COLLATE X locale_t locale = __get_locale(); X struct xlocale_collate *table = (struct xlocale_collate *) X locale->components[XLC_COLLATE]; X#endif X X /* X * A bracket expression starting with an unquoted circumflex X * character produces unspecified results (IEEE 1003.2-1992, X * 3.13.2). This implementation treats it like '!', for X * consistency with the regular expression syntax. X * J.T. Conklin (conklin@ngai.kaleida.com) X */ X if ((negate = (*pattern == '!' || *pattern == '^'))) X ++pattern; X X if (flags & FNM_CASEFOLD) X test = towlower(test); X X /* X * A right bracket shall lose its special meaning and represent X * itself in a bracket expression if it occurs first in the list. X * -- POSIX.2 2.8.3.2 X */ X ok = 0; X origpat = pattern; X for (;;) { X int quoted = 0; X X if (*pattern == ']' && pattern > origpat) { X pattern++; X break; X } else if (*pattern == '\0') { X return (RANGE_ERROR); X } else if (*pattern == '/' && (flags & FNM_PATHNAME)) { X return (RANGE_NOMATCH); X } else if (*pattern == '\\' && !(flags & FNM_NOESCAPE)) { X pattern++; X quoted++; X } X pclen = mbrtowc(&c, pattern, MB_LEN_MAX, patmbs); X if (pclen == (size_t)-1 || pclen == (size_t)-2) X return (RANGE_NOMATCH); X pattern += pclen; X X /* X * "[" initiates a special expression X * [: :] A character class like [:upper:] X * [= =] An equivalence character class like [=o=] o-like X * [. .] A collating symbol like [.ch.] X */ X if (!quoted && c == '[') { X const char *p; X X if (pattern[0] == ':') { /* [: :] char class */ X char class[CL_SIZE+1]; X char *pc = class; X X p = pattern + 1; /* Eat ':' */ X for (;;) { X if (*p == '\0') X return (RANGE_ERROR); X if (*p == ':' && p[1] == ']') X break; X if (pc >= &class[CL_SIZE]) X return (RANGE_ERROR); X *pc++ = *p++; X } X if (pc == class) X return (RANGE_ERROR); X *pc = '\0'; X pattern = p + 2; /* Skip ":]" */ X if (iswctype(otest, wctype(class))) { X ok = 1; X } else if (flags & FNM_CASEFOLD) { X /* X * Convert to the other case X */ X if (strcmp(class, "upper") == 0) { X if (iswctype(otest, X wctype("lower"))) X ok = 1; X } else if (strcmp(class, "lower") == 0) { X if (iswctype(otest, X wctype("upper"))) X ok = 1; X } X } X continue; X } else if (pattern[0] == '=') { /* [= =] equ. class */ X p = pattern + 1; /* Eat '=' */ X X pclen = mbrtowc(&c, p, MB_LEN_MAX, patmbs); X if (pclen == (size_t)-1 || pclen == (size_t)-2) X return (RANGE_NOMATCH); X p += pclen; X X/* X * Wenn es hier nicht mit =] endet - also länger ist -, dann ist es ein Collating Symbol. X */ X if (*p != '=') X goto is_coll; X#ifdef XXX_COLLATE X __collate_equiv_value(locale, &c, 1); X#endif X X pattern = p + 2; /* Skip "=]" */ X } else if (pattern[0] == '.') { /* [. .] collate sym */ X p = pattern + 1; /* Eat '.' */ Xis_coll: X X pattern = p + 2; /* Skip ".]" */ X } X } X X if (flags & FNM_CASEFOLD) X c = towlower(c); X X if (*pattern == '-' && *(pattern + 1) != EOS && X *(pattern + 1) != ']') { X if (*++pattern == '\\' && !(flags & FNM_NOESCAPE)) X if (*pattern != EOS) X pattern++; X pclen = mbrtowc(&c2, pattern, MB_LEN_MAX, patmbs); X if (pclen == (size_t)-1 || pclen == (size_t)-2) X return (RANGE_NOMATCH); X pattern += pclen; X if (c2 == EOS) X return (RANGE_ERROR); X X if (flags & FNM_CASEFOLD) X c2 = towlower(c2); X X#ifdef XXX_COLLATE X if (table->__collate_load_error ? X c <= test && test <= c2 : X __wcollate_range_cmp(c, test) <= 0 && X __wcollate_range_cmp(test, c2) <= 0) X ok = 1; X#else X if (c <= test && test <= c2) X ok = 1; X#endif X } else if (c == test) X ok = 1; X } X X *newp = (char *)pattern; X return (ok == negate ? RANGE_NOMATCH : RANGE_MATCH); X} END-of-star-1.6/libschily/fnmatch.c echo x - star-1.6/libschily/noshlschily.mk sed 's/^X//' >star-1.6/libschily/noshlschily.mk << 'END-of-star-1.6/libschily/noshlschily.mk' X#ident "@(#)noshlschily.mk 1.1 06/07/21 " X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X Xall: X @echo " ==> NO shared libs on this platform (yet)" END-of-star-1.6/libschily/noshlschily.mk echo x - star-1.6/libschily/mem.c sed 's/^X//' >star-1.6/libschily/mem.c << 'END-of-star-1.6/libschily/mem.c' X/* @(#)mem.c 1.11 15/05/10 Copyright 1998-2015 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)mem.c 1.11 15/05/10 Copyright 1998-2015 J. Schilling"; X#endif X/* X * Memory handling with error checking X * X * Copyright (c) 1998-2015 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X#include X XEXPORT int ___mexval __PR((int exval)); XEXPORT void *___malloc __PR((size_t size, char *msg)); XEXPORT void *___realloc __PR((void *ptr, size_t size, char *msg)); XEXPORT char *___savestr __PR((const char *s)); X XLOCAL int mexval; X XEXPORT int X___mexval(exval) X int exval; X{ X int ret = mexval; X X mexval = exval; X X return (ret); X} X XEXPORT void * X___malloc(size, msg) X size_t size; X char *msg; X{ X void *ret; X X ret = malloc(size); X if (ret == NULL) { X int err = geterrno(); X X errmsg(gettext("Cannot allocate memory for %s.\n"), msg); X if (mexval) X err = mexval; X comexit(err); X /* NOTREACHED */ X } X return (ret); X} X XEXPORT void * X___realloc(ptr, size, msg) X void *ptr; X size_t size; X char *msg; X{ X void *ret; X X if (ptr == NULL) X ret = malloc(size); X else X ret = realloc(ptr, size); X if (ret == NULL) { X int err = geterrno(); X X errmsg(gettext("Cannot realloc memory for %s.\n"), msg); X if (mexval) X err = mexval; X comexit(err); X /* NOTREACHED */ X } X return (ret); X} X XEXPORT char * X___savestr(s) X const char *s; X{ X char *ret = ___malloc(strlen(s)+1, "saved string"); X X strcpy(ret, s); X return (ret); X} END-of-star-1.6/libschily/mem.c echo x - star-1.6/libschily/getnum.c sed 's/^X//' >star-1.6/libschily/getnum.c << 'END-of-star-1.6/libschily/getnum.c' X/* @(#)getnum.c 1.6 09/07/08 Copyright 1984-2009 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)getnum.c 1.6 09/07/08 Copyright 1984-2009 J. Schilling"; X#endif X/* X * Number conversion routines to implement 'dd' like number options. X * X * Copyright (c) 1984-2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X XEXPORT int getnum __PR((char *arg, long *valp)); XEXPORT int getllnum __PR((char *arg, Llong *lvalp)); X XLOCAL gnmult_t nums[] = { X#ifdef HAVE_LONGLONG X { 'e', 1024*1024*1024*1024LL*1024*1024, }, X { 'E', 1024*1024*1024*1024LL*1024*1024, }, X { 'p', 1024*1024*1024*1024LL*1024, }, X { 'P', 1024*1024*1024*1024LL*1024, }, X { 't', 1024*1024*1024*1024LL, }, X { 'T', 1024*1024*1024*1024LL, }, X#endif X { 'g', 1024*1024*1024, }, X { 'G', 1024*1024*1024, }, X { 'm', 1024*1024, }, X { 'M', 1024*1024, }, X X { 'f', 2352, }, X { 'F', 2352, }, X { 's', 2048, }, X { 'S', 2048, }, X X { 'k', 1024, }, X { 'K', 1024, }, X { 'b', 512, }, X { 'B', 512, }, X { 'w', 2, }, X { 'W', 2, }, X { '\0', 0, }, X}; X XEXPORT int Xgetnum(arg, valp) X char *arg; X long *valp; X{ X return (getxnum(arg, valp, nums)); X} X XEXPORT int Xgetllnum(arg, lvalp) X char *arg; X Llong *lvalp; X{ X return (getllxnum(arg, lvalp, nums)); X} END-of-star-1.6/libschily/getnum.c echo x - star-1.6/libschily/gettnum.c sed 's/^X//' >star-1.6/libschily/gettnum.c << 'END-of-star-1.6/libschily/gettnum.c' X/* @(#)gettnum.c 1.9 09/07/08 Copyright 1984-2002, 2004-2009 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)gettnum.c 1.9 09/07/08 Copyright 1984-2002, 2004-2009 J. Schilling"; X#endif X/* X * Generic time conversion routines rewritten from X * 'dd' like number conversion in 'sdd'. X * X * Copyright (c) 1984-2002, 2004-2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X X#define MINSECS (60) X#define HOURSECS (60 * MINSECS) X#define DAYSECS (24 * HOURSECS) X#define WEEKSECS (7 * DAYSECS) X#define YEARSECS (365 * DAYSECS) /* A non leap year */ X X XEXPORT int gettnum __PR((char *arg, time_t *valp)); XEXPORT int getlltnum __PR((char *arg, Llong *lvalp)); X XLOCAL gnmult_t nums[] = { X { 'y', YEARSECS, }, X { 'w', WEEKSECS, }, X { 'd', DAYSECS, }, X { 'h', HOURSECS, }, X { 'm', MINSECS, }, X { 's', 1, }, X { '\0', 0, }, X}; X XEXPORT int Xgettnum(arg, valp) X char *arg; X time_t *valp; X{ X return (getxtnum(arg, valp, nums)); X} X XEXPORT int Xgetlltnum(arg, lvalp) X char *arg; X Llong *lvalp; X{ X return (getllxtnum(arg, lvalp, nums)); X} END-of-star-1.6/libschily/gettnum.c echo x - star-1.6/libschily/getxnum.c sed 's/^X//' >star-1.6/libschily/getxnum.c << 'END-of-star-1.6/libschily/getxnum.c' X/* @(#)getxnum.c 1.6 09/07/08 Copyright 1984-2009 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)getxnum.c 1.6 09/07/08 Copyright 1984-2009 J. Schilling"; X#endif X/* X * Generic number conversion routines. X * Originally taken from sdd.c to implement 'dd' like number options. X * X * Copyright (c) 1984-2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X XLOCAL Llong number __PR((char *arg, int *retp, gnmult_t *mult)); XEXPORT int getxnum __PR((char *arg, long *valp, gnmult_t *mult)); XEXPORT int getllxnum __PR((char *arg, Llong *lvalp, gnmult_t *mult)); X XLOCAL Llong Xnumber(arg, retp, mult) X register char *arg; X int *retp; X gnmult_t *mult; X{ X Llong val = 0; X X if (*retp != 1) X return (val); X if (*arg == '\0') { X *retp = -1; X } else if (*(arg = astoll(arg, &val))) { X gnmult_t *n; X X for (n = mult; n->key; n++) { X if (n->key == *arg) { X val *= n->mult; X arg++; X break; X } X } X if (*arg == '*' || *arg == 'x') X val *= number(++arg, retp, mult); X else if (*arg != '\0') X *retp = -1; X } X return (val); X} X XEXPORT int Xgetxnum(arg, valp, mult) X char *arg; X long *valp; X gnmult_t *mult; X{ X Llong llval; X int ret = 1; X X llval = number(arg, &ret, mult); X *valp = llval; X if (*valp != llval) { X errmsgno(EX_BAD, X "Value %lld is too large for data type 'long'.\n", X llval); X ret = -1; X } X return (ret); X} X XEXPORT int Xgetllxnum(arg, lvalp, mult) X char *arg; X Llong *lvalp; X gnmult_t *mult; X{ X int ret = 1; X X *lvalp = number(arg, &ret, mult); X return (ret); X} END-of-star-1.6/libschily/getxnum.c echo x - star-1.6/libschily/getxtnum.c sed 's/^X//' >star-1.6/libschily/getxtnum.c << 'END-of-star-1.6/libschily/getxtnum.c' X/* @(#)getxtnum.c 1.9 09/07/08 Copyright 1984-2002, 2004-2009 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)getxtnum.c 1.9 09/07/08 Copyright 1984-2002, 2004-2009 J. Schilling"; X#endif X/* X * Generic time conversion routines rewritten from X * 'dd' like number conversion in 'sdd'. X * X * Copyright (c) 1984-2002, 2004-2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X XLOCAL Llong tnumber __PR((char *arg, int *retp, gnmult_t *mult, int level)); XEXPORT int getxtnum __PR((char *arg, time_t *valp, gnmult_t *mult)); XEXPORT int getllxtnum __PR((char *arg, Llong *lvalp, gnmult_t *mult)); X XLOCAL Llong Xtnumber(arg, retp, mult, level) X register char *arg; X int *retp; X gnmult_t *mult; X int level; X{ X Llong val = 0; X X if (*retp != 1) X return (val); X if (*arg == '\0') { X *retp = -1; X } else if (*(arg = astoll(arg, &val))) { X gnmult_t *n; X X for (n = mult; n->key; n++) { X if (n->key == *arg) { X val *= n->mult; X arg++; X break; X } X } X if (*arg >= '0' && *arg <= '9') X val += tnumber(arg, retp, mult, level+1); X else if (*arg != '\0') { X errmsgno(EX_BAD, X gettext("Illegal character '%c' in timespec.\n"), X *arg); X *retp = -1; X } else if (*arg == '\0') X return (val); X } X if (level > 0 && *arg == '\0') X *retp = -1; X return (val); X} X XEXPORT int Xgetxtnum(arg, valp, mult) X char *arg; X time_t *valp; X gnmult_t *mult; X{ X Llong llval; X int ret = 1; X X llval = tnumber(arg, &ret, mult, 0); X *valp = llval; X if (*valp != llval) { X errmsgno(EX_BAD, X gettext("Value %lld is too large for data type 'time_t'.\n"), X llval); X ret = -1; X } X return (ret); X} X XEXPORT int Xgetllxtnum(arg, lvalp, mult) X char *arg; X Llong *lvalp; X gnmult_t *mult; X{ X int ret = 1; X X *lvalp = tnumber(arg, &ret, mult, 0); X return (ret); X} END-of-star-1.6/libschily/getxtnum.c echo x - star-1.6/libschily/jmem.c sed 's/^X//' >star-1.6/libschily/jmem.c << 'END-of-star-1.6/libschily/jmem.c' X/* @(#)jmem.c 1.13 15/05/10 Copyright 1998-2015 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)jmem.c 1.13 15/05/10 Copyright 1998-2015 J. Schilling"; X#endif X/* X * Memory handling with error checking X * X * Copyright (c) 1998-2015 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X#include X#include X XEXPORT int __jmexval __PR((int exval)); XEXPORT void *__jmalloc __PR((size_t size, char *msg, sigjmps_t *jmp)); XEXPORT void *__jrealloc __PR((void *ptr, size_t size, char *msg, sigjmps_t *jmp)); XEXPORT char *__jsavestr __PR((const char *s, sigjmps_t *jmp)); X XLOCAL int jmexval; X XEXPORT int X__jmexval(exval) X int exval; X{ X int ret = jmexval; X X jmexval = exval; X X return (ret); X} X XEXPORT void * X__jmalloc(size, msg, jmp) X size_t size; X char *msg; X sigjmps_t *jmp; X{ X void *ret; X X ret = malloc(size); X if (ret == NULL) { X int err = geterrno(); X X errmsg(gettext("Cannot allocate memory for %s.\n"), msg); X if (jmexval) X err = jmexval; X if (jmp == JM_EXIT) X comexit(err); X if (jmp != NULL) X siglongjmp(jmp->jb, 1); X } X return (ret); X} X XEXPORT void * X__jrealloc(ptr, size, msg, jmp) X void *ptr; X size_t size; X char *msg; X sigjmps_t *jmp; X{ X void *ret; X X if (ptr == NULL) X ret = malloc(size); X else X ret = realloc(ptr, size); X if (ret == NULL) { X int err = geterrno(); X X errmsg(gettext("Cannot realloc memory for %s.\n"), msg); X if (jmexval) X err = jmexval; X if (jmp == JM_EXIT) X comexit(err); X if (jmp != NULL) X siglongjmp(jmp->jb, 1); X } X return (ret); X} X XEXPORT char * X__jsavestr(s, jmp) X const char *s; X sigjmps_t *jmp; X{ X char *ret = __jmalloc(strlen(s)+1, "saved string", jmp); X X if (ret != NULL) X strcpy(ret, s); X return (ret); X} END-of-star-1.6/libschily/jmem.c echo x - star-1.6/libschily/fjmem.c sed 's/^X//' >star-1.6/libschily/fjmem.c << 'END-of-star-1.6/libschily/fjmem.c' X/* @(#)fjmem.c 1.14 15/05/10 Copyright 1998-2015 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)fjmem.c 1.14 15/05/10 Copyright 1998-2015 J. Schilling"; X#endif X/* X * Memory handling with error checking X * X * Copyright (c) 1998-2015 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X#include X#include X XEXPORT int __fjmexval __PR((int exval)); XEXPORT void *__fjmalloc __PR((FILE *f, size_t size, char *msg, sigjmps_t *jmp)); XEXPORT void *__fjrealloc __PR((FILE *f, void *ptr, size_t size, char *msg, sigjmps_t *jmp)); XEXPORT char *__fjsavestr __PR((FILE *f, const char *s, sigjmps_t *jmp)); X XLOCAL int fjmexval; X XEXPORT int X__fjmexval(exval) X int exval; X{ X int ret = fjmexval; X X fjmexval = exval; X X return (ret); X} X XEXPORT void * X__fjmalloc(f, size, msg, jmp) X FILE *f; X size_t size; X char *msg; X sigjmps_t *jmp; X{ X void *ret; X X ret = malloc(size); X if (ret == NULL) { X int err = geterrno(); X X if (f != NULL) { X ferrmsg(f, X gettext("Cannot allocate memory for %s.\n"), X msg); X } X if (fjmexval) X err = fjmexval; X if (jmp == JM_EXIT) X comexit(err); X if (jmp != NULL) X siglongjmp(jmp->jb, 1); X } X return (ret); X} X XEXPORT void * X__fjrealloc(f, ptr, size, msg, jmp) X FILE *f; X void *ptr; X size_t size; X char *msg; X sigjmps_t *jmp; X{ X void *ret; X X if (ptr == NULL) X ret = malloc(size); X else X ret = realloc(ptr, size); X if (ret == NULL) { X int err = geterrno(); X X if (f != NULL) { X ferrmsg(f, X gettext("Cannot realloc memory for %s.\n"), X msg); X } X if (fjmexval) X err = fjmexval; X if (jmp == JM_EXIT) X comexit(err); X if (jmp != NULL) X siglongjmp(jmp->jb, 1); X } X return (ret); X} X XEXPORT char * X__fjsavestr(f, s, jmp) X FILE *f; X const char *s; X sigjmps_t *jmp; X{ X char *ret = __fjmalloc(f, strlen(s)+1, "saved string", jmp); X X if (ret != NULL) X strcpy(ret, s); X return (ret); X} END-of-star-1.6/libschily/fjmem.c echo x - star-1.6/libschily/fcomerr.c sed 's/^X//' >star-1.6/libschily/fcomerr.c << 'END-of-star-1.6/libschily/fcomerr.c' X/* @(#)fcomerr.c 1.6 15/06/28 Copyright 1985-1989, 1995-2015 J. Schilling */ X/* X * Routines for printing command errors on a specified FILE * X * X * Copyright (c) 1985-1989, 1995-2015 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include /* include try to get size_t */ X#include /* Try again for size_t */ X#include /* Try again for size_t */ X#include X#include X#include X#include X#include X XEXPORT void fcomerr __PR((FILE *, const char *, ...)); XEXPORT void fxcomerr __PR((FILE *, int, const char *, ...)); XEXPORT void fcomerrno __PR((FILE *, int, const char *, ...)); XEXPORT void fxcomerrno __PR((FILE *, int, int, const char *, ...)); XEXPORT int ferrmsg __PR((FILE *, const char *, ...)); XEXPORT int ferrmsgno __PR((FILE *, int, const char *, ...)); X X/* X * Fetch current errno, print a related message and exit(errno). X */ X/* VARARGS1 */ X#ifdef PROTOTYPES XEXPORT void Xfcomerr(FILE *f, const char *msg, ...) X#else XEXPORT void Xfcomerr(f, msg, va_alist) X FILE *f; X char *msg; X va_dcl X#endif X{ X va_list args; X X#ifdef PROTOTYPES X va_start(args, msg); X#else X va_start(args); X#endif X (void) _comerr(f, COMERR_EXIT, 0, geterrno(), msg, args); X /* NOTREACHED */ X va_end(args); X} X X/* X * Fetch current errno, print a related message and exit(exc). X */ X/* VARARGS2 */ X#ifdef PROTOTYPES XEXPORT void Xfxcomerr(FILE *f, int exc, const char *msg, ...) X#else XEXPORT void Xfxcomerr(f, exc, msg, va_alist) X int exc; X FILE *f; X char *msg; X va_dcl X#endif X{ X va_list args; X X#ifdef PROTOTYPES X va_start(args, msg); X#else X va_start(args); X#endif X (void) _comerr(f, COMERR_EXCODE, exc, geterrno(), msg, args); X /* NOTREACHED */ X va_end(args); X} X X/* X * Print a message related to err and exit(err). X */ X/* VARARGS2 */ X#ifdef PROTOTYPES XEXPORT void Xfcomerrno(FILE *f, int err, const char *msg, ...) X#else XEXPORT void Xfcomerrno(f, err, msg, va_alist) X FILE *f; X int err; X char *msg; X va_dcl X#endif X{ X va_list args; X X#ifdef PROTOTYPES X va_start(args, msg); X#else X va_start(args); X#endif X (void) _comerr(f, COMERR_EXIT, 0, err, msg, args); X /* NOTREACHED */ X va_end(args); X} X X/* X * Print a message related to err and exit(exc). X */ X/* VARARGS3 */ X#ifdef PROTOTYPES XEXPORT void Xfxcomerrno(FILE *f, int exc, int err, const char *msg, ...) X#else XEXPORT void Xfxcomerrno(f, exc, err, msg, va_alist) X FILE *f; X int exc; X int err; X char *msg; X va_dcl X#endif X{ X va_list args; X X#ifdef PROTOTYPES X va_start(args, msg); X#else X va_start(args); X#endif X (void) _comerr(f, COMERR_EXCODE, exc, err, msg, args); X /* NOTREACHED */ X va_end(args); X} X X/* X * Fetch current errno, print a related message and return(errno). X */ X/* VARARGS1 */ X#ifdef PROTOTYPES XEXPORT int Xferrmsg(FILE *f, const char *msg, ...) X#else XEXPORT int Xferrmsg(f, msg, va_alist) X FILE *f; X char *msg; X va_dcl X#endif X{ X va_list args; X int ret; X X#ifdef PROTOTYPES X va_start(args, msg); X#else X va_start(args); X#endif X ret = _comerr(f, COMERR_RETURN, 0, geterrno(), msg, args); X va_end(args); X return (ret); X} X X/* X * Print a message related to err and return(err). X */ X/* VARARGS2 */ X#ifdef PROTOTYPES XEXPORT int Xferrmsgno(FILE *f, int err, const char *msg, ...) X#else XEXPORT int Xferrmsgno(f, err, msg, va_alist) X FILE *f; X int err; X char *msg; X va_dcl X#endif X{ X va_list args; X int ret; X X#ifdef PROTOTYPES X va_start(args, msg); X#else X va_start(args); X#endif X ret = _comerr(f, COMERR_RETURN, 0, err, msg, args); X va_end(args); X return (ret); X} END-of-star-1.6/libschily/fcomerr.c echo x - star-1.6/libschily/checkerr.c sed 's/^X//' >star-1.6/libschily/checkerr.c << 'END-of-star-1.6/libschily/checkerr.c' X/* @(#)checkerr.c 1.27 19/02/28 Copyright 2003-2019 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)checkerr.c 1.27 19/02/28 Copyright 2003-2019 J. Schilling"; X#endif X/* X * Generic error control for programs that do file i/o. X * The error control is usually used by archiving programs. X * X * The current version does not provide a stable interface. X * It does not support multi-threaded programs and it may call X * comerr() from the parser. If you use the code before there is X * an official stable and "library-compliant" interface, be careful X * and watch for changes. X * X * Copyright (c) 2003-2019 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X#include X Xtypedef struct errconf { X struct errconf *ec_next; /* Next in list */ X const Uchar *ec_pat; /* File name pattern */ X int *ec_aux; /* Aux array from pattern compiler */ X int ec_alt; /* Alt return from pattern compiler */ X int ec_plen; /* String length of pattern */ X UInt32_t ec_flags[E_NFL]; /* Error condition flags */ X} ec_t; X XLOCAL int *ec_state; /* State array for pattern compiler */ XLOCAL ec_t *ec_root; /* Root node of error config list */ XLOCAL ec_t **ec_last = &ec_root; /* Last pointer in root node list */ XLOCAL int maxplen; XLOCAL BOOL _errflag = TRUE; /* Abort on all errors */ X XEXPORT int errconfig __PR((char *name)); XLOCAL char *_endword __PR((char *p)); XLOCAL void parse_errctl __PR((char *line)); XLOCAL UInt32_t errflags __PR((char *eflag, BOOL doexit, UInt32_t fla[E_NFL])); XLOCAL ec_t *_errptr __PR((int etype, const char *fname)); XEXPORT BOOL errhidden __PR((int etype, const char *fname)); XEXPORT BOOL errwarnonly __PR((int etype, const char *fname)); XEXPORT BOOL errabort __PR((int etype, const char *fname, BOOL doexit)); X X/* X * Read and parse error configuration file X */ XEXPORT int Xerrconfig(name) X char *name; X{ X char line[8192]; X FILE *f; X int omaxplen = maxplen; X X if ((f = fileopen(name, "r")) == NULL) { X if (errflags(name, FALSE, NULL) != 0) X parse_errctl(name); X else X comerr("Cannot open '%s'.\n", name); X } else { X while (fgetline(f, line, sizeof (line)) >= 0) { X parse_errctl(line); X } X fclose(f); X } X if (maxplen > omaxplen) { X ec_state = ___realloc(ec_state, (maxplen+1)*sizeof (int), X "pattern state"); X } X return (1); X} X XLOCAL char * X_endword(p) X char *p; X{ X /* X * Find end of word. X */ X for (; *p != '\0' && X *p != '\t' && X *p != ' '; X p++) { X ; X /* LINTED */ X } X return (p); X} X XLOCAL void Xparse_errctl(line) X char *line; X{ X int plen; X char *pattern; X ec_t *ep; X X /* X * Find end of word. X */ X pattern = _endword(line); X X if (pattern == line || *pattern == '\0') { X comerrno(EX_BAD, X "Bad error configuration line '%s'.\n", line); X } X /* X * Find end of white space after word. X */ X for (pattern++; *pattern != '\0' && X (*pattern == '\t' || *pattern == ' '); X pattern++) { X ; X /* LINTED */ X } X ep = ___malloc(sizeof (ec_t), "errcheck node"); X errflags(line, TRUE, ep->ec_flags); X ep->ec_plen = plen = strlen(pattern); X if (ep->ec_plen > maxplen) X maxplen = ep->ec_plen; X ep->ec_pat = (const Uchar *)___savestr(pattern); X ep->ec_aux = ___malloc(plen*sizeof (int), "compiled pattern"); X if ((ep->ec_alt = patcompile((const Uchar *)pattern, X plen, ep->ec_aux)) == 0) X comerrno(EX_BAD, "Bad errctl pattern: '%s'.\n", pattern); X X ep->ec_next = NULL; X *ec_last = ep; X ec_last = &ep->ec_next; X} X XLOCAL struct eflags { X char *fname; X UInt32_t fval; X} eflags[] = { X { "STAT", E_STAT }, X { "GETACL", E_GETACL }, X { "OPEN", E_OPEN }, X { "READ", E_READ }, X { "WRITE", E_WRITE }, X { "GROW", E_GROW }, X { "SHRINK", E_SHRINK }, X { "MISSLINK", E_MISSLINK }, X { "NAMETOOLONG", E_NAMETOOLONG }, X { "FILETOOBIG", E_FILETOOBIG }, X { "SPECIALFILE", E_SPECIALFILE }, X { "READLINK", E_READLINK }, X { "GETXATTR", E_GETXATTR }, X { "CHDIR", E_CHDIR }, X { "ICONV", E_ICONV }, X { "ID", E_ID }, X { "TIME", E_TIME }, X X { "SETTIME", E_SETTIME }, X { "SETMODE", E_SETMODE }, X { "SECURITY", E_SECURITY }, X { "LSECURITY", E_LSECURITY }, X { "SAMEFILE", E_SAMEFILE }, X { "BADACL", E_BADACL }, X { "SETACL", E_SETACL }, X { "SETXATTR", E_SETXATTR }, X X { "ALL", E_ALL }, X X { "DIFF", E_DIFF }, X { "WARN", E_WARN }, X { "ABORT", E_ABORT }, X X { NULL, 0 } X}; X X/* X * Convert error condition string into flag word X */ XLOCAL UInt32_t Xerrflags(eflag, doexit, fla) X char *eflag; X BOOL doexit; X UInt32_t fla[E_NFL]; X{ X register char *p = eflag; X char *ef = _endword(eflag); X register struct eflags *ep; X register int slen; X register UInt32_t nflags = 0; X X do { X for (ep = eflags; ep->fname; ep++) { X slen = strlen(ep->fname); X if ((strncmp(ep->fname, p, slen) == 0) && X (p[slen] == '|' || p[slen] == ' ' || X p[slen] == '\0')) { X UInt32_t nfl = ep->fval; X X nflags |= nfl; X if (fla) { X int idx = (nfl & E_EMASK) >> E_SHIFT; X X fla[idx] |= nfl; X } X break; X } X } X if (ep->fname == NULL) { X if (doexit) X comerrno(EX_BAD, "Bad flag '%s'\n", p); X return (0); X } X p = strchr(p, '|'); X } while (p < ef && p && *p++ == '|'); X X if ((nflags & ~(UInt32_t)(E_ABORT|E_WARN)) == 0) { X if (doexit) X comerrno(EX_BAD, "Bad error condition '%s'.\n", eflag); X return (0); X } X return (nflags); X} X XLOCAL ec_t * X_errptr(etype, fname) X int etype; X const char *fname; X{ X ec_t *ep = ec_root; X char *ret; X const Uchar *name = (const Uchar *)fname; X int nlen; X int idx = (etype & E_EMASK) >> E_SHIFT; X X if (fname == NULL) { X errmsgno(EX_BAD, X "Implementation botch for errhidden(0x%X, NULL)\n", X etype); X errmsgno(EX_BAD, "Please report this bug!\n"); X errmsgno(EX_BAD, "Error cannot be ignored.\n"); X return ((ec_t *)NULL); X } X nlen = strlen(fname); X etype &= ~E_EMASK; X while (ep) { X if ((ep->ec_flags[idx] & etype) != 0) { X ret = (char *)patmatch(ep->ec_pat, ep->ec_aux, X name, 0, X nlen, ep->ec_alt, ec_state); X if (ret != NULL && *ret == '\0') X return (ep); X } X ep = ep->ec_next; X } X return ((ec_t *)NULL); X} X X/* X * Check whether error condition should be ignored for file name. X */ XEXPORT BOOL Xerrhidden(etype, fname) X int etype; X const char *fname; X{ X ec_t *ep; X X if ((ep = _errptr(etype, fname)) != NULL) { X if ((ep->ec_flags[0] & (E_ABORT|E_WARN)) != 0) X return (FALSE); X return (TRUE); X } X return (FALSE); X} X X/* X * Check whether error condition should not affect exit code for file name. X */ XEXPORT BOOL Xerrwarnonly(etype, fname) X int etype; X const char *fname; X{ X ec_t *ep; X X if ((ep = _errptr(etype, fname)) != NULL) { X if ((ep->ec_flags[0] & E_WARN) != 0) X return (TRUE); X return (FALSE); X } X return (FALSE); X} X X/* X * Check whether error condition should be fatal for file name. X */ XEXPORT BOOL Xerrabort(etype, fname, doexit) X int etype; X const char *fname; X BOOL doexit; X{ X ec_t *ep; X X if ((ep = _errptr(etype, fname)) == NULL) { X if (!_errflag) X return (FALSE); X } else if ((ep->ec_flags[0] & E_ABORT) == 0) X return (FALSE); X X if (doexit) { X errmsgno(EX_BAD, "Error is considered fatal, aborting.\n"); X#ifdef CALL_OTHER_FUNCTION X if (other_func != NULL) X (*other_func)(); X else X#endif X comexit(-3); X } X return (TRUE); X} END-of-star-1.6/libschily/checkerr.c echo x - star-1.6/libschily/getperm.c sed 's/^X//' >star-1.6/libschily/getperm.c << 'END-of-star-1.6/libschily/getperm.c' X/* @(#)getperm.c 1.7 18/08/30 Copyright 2004-2018 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)getperm.c 1.7 18/08/30 Copyright 2004-2018 J. Schilling"; X#endif X/* X * Parser for chmod(1)/find(1)/umask(1)-perm, .... X * X * Copyright (c) 2004-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X X#include X XEXPORT int getperm __PR((FILE *f, char *perm, char *opname, X mode_t *modep, int smode, int flag)); XLOCAL char *getsperm __PR((FILE *f, char *p, char *opname, X mode_t *mp, int smode, int flag)); XLOCAL mode_t iswho __PR((int c)); XLOCAL int isop __PR((int c)); XLOCAL mode_t isperm __PR((int c, int isX)); X X/* X * This is the mode bit translation code stolen from star... X */ X#define TSUID 04000 /* Set UID on execution */ X#define TSGID 02000 /* Set GID on execution */ X#define TSVTX 01000 /* On directories, restricted deletion flag */ X#define TUREAD 00400 /* Read by owner */ X#define TUWRITE 00200 /* Write by owner special */ X#define TUEXEC 00100 /* Execute/search by owner */ X#define TGREAD 00040 /* Read by group */ X#define TGWRITE 00020 /* Write by group */ X#define TGEXEC 00010 /* Execute/search by group */ X#define TOREAD 00004 /* Read by other */ X#define TOWRITE 00002 /* Write by other */ X#define TOEXEC 00001 /* Execute/search by other */ X X#define TALLMODES 07777 /* The low 12 bits mentioned in the standard */ X X#define S_ALLPERM (S_IRWXU|S_IRWXG|S_IRWXO) X#define S_ALLFLAGS (S_ISUID|S_ISGID|S_ISVTX) X#define S_ALLMODES (S_ALLFLAGS | S_ALLPERM) X X#if S_ISUID == TSUID && S_ISGID == TSGID && S_ISVTX == TSVTX && \ X S_IRUSR == TUREAD && S_IWUSR == TUWRITE && S_IXUSR == TUEXEC && \ X S_IRGRP == TGREAD && S_IWGRP == TGWRITE && S_IXGRP == TGEXEC && \ X S_IROTH == TOREAD && S_IWOTH == TOWRITE && S_IXOTH == TOEXEC X X#define HAVE_POSIX_MODE_BITS /* st_mode bits are equal to TAR mode bits */ X#endif X X#ifdef HAVE_POSIX_MODE_BITS /* st_mode bits are equal to TAR mode bits */ X#define OSMODE(xmode) (xmode) X#else X#define OSMODE(xmode) ((xmode & TSUID ? S_ISUID : 0) \ X | (xmode & TSGID ? S_ISGID : 0) \ X | (xmode & TSVTX ? S_ISVTX : 0) \ X | (xmode & TUREAD ? S_IRUSR : 0) \ X | (xmode & TUWRITE ? S_IWUSR : 0) \ X | (xmode & TUEXEC ? S_IXUSR : 0) \ X | (xmode & TGREAD ? S_IRGRP : 0) \ X | (xmode & TGWRITE ? S_IWGRP : 0) \ X | (xmode & TGEXEC ? S_IXGRP : 0) \ X | (xmode & TOREAD ? S_IROTH : 0) \ X | (xmode & TOWRITE ? S_IWOTH : 0) \ X | (xmode & TOEXEC ? S_IXOTH : 0)) X#endif X XEXPORT int Xgetperm(f, perm, opname, modep, smode, flag) X FILE *f; /* FILE * to print error messages to */ X char *perm; /* Perm string to parse */ X char *opname; /* find(1) operator name / NULL */ X mode_t *modep; /* The mode result */ X int smode; /* The start mode for the computation */ X int flag; /* Flags, see getperm() flag defs */ X{ X char *p; X Llong ll; X mode_t mm; X X p = perm; X if (p == NULL) X return (-1); X X if ((flag & GP_FPERM) && *p == '-') X p++; X X if (*p >= '0' && *p <= '7') { X p = astollb(p, &ll, 8); X if (*p) { X if (f) { X if (opname) { X ferrmsgno(f, EX_BAD, X gettext("Non octal character '%c' in '-%s %s'.\n"), X *p, opname, perm); X } else { X ferrmsgno(f, EX_BAD, X gettext("Non octal character '%c' in '%s'.\n"), X *p, perm); X } X } X return (-1); X } X mm = ll & TALLMODES; X *modep = OSMODE(mm); X return (0); X } X p = getsperm(f, p, opname, modep, smode, flag); X if (p == NULL) { X return (-1); X } else if (*p != '\0') { X if (f) { X if (opname) { X ferrmsgno(f, EX_BAD, X gettext("Bad perm character '%c' found in '-%s %s'.\n"), X *p, opname, perm); X } else { X ferrmsgno(f, EX_BAD, X gettext("Bad perm character '%c' found in '%s'.\n"), X *p, perm); X } X } X return (-1); X } X#ifdef PERM_DEBUG X error("GETPERM (%s) %4.4lo\n", perm, (long)*modep); X#endif X return (0); X} X XLOCAL char * Xgetsperm(f, p, opname, mp, smode, flag) X FILE *f; X char *p; /* The perm input string */ X char *opname; /* find(1) operator name / NULL */ X mode_t *mp; /* To set the mode */ X int smode; /* The start mode for the computation */ X int flag; /* Flags, see getperm() flag defs */ X{ X#ifdef OLD X mode_t permval = 0; /* POSIX start value for "find" */ X#else X mode_t permval = smode; /* POSIX start value for "find" */ X#endif X mode_t who; X mode_t who_mask = 0; /* Useless init to calm down silly GCC */ X mode_t m; X int op; X mode_t perms; X mode_t pm; X Xnextclause: X#ifdef PERM_DEBUG X error("getsperm(%s, %o)\n", p, smode); X#endif X who = 0; X while ((m = iswho(*p)) != 0) { X p++; X who_mask = who |= m; X } X if (who == 0) { X mode_t mask; X X /* X * If "who" has not been specified, select all bits for umask(1) X * or all reduced by umask(2) in the general case. X */ X if (flag & GP_UMASK) { X who_mask = X who = (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO); X } else { X umask(mask = umask(0)); X who = ~mask; X who &= X (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO); X who_mask = X (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO); X } X } X#ifdef PERM_DEBUG X error("WHO %4.4lo\n", (long)who); X error("getsperm(--->%s)\n", p); X#endif X Xnextop: X if ((op = isop(*p)) != '\0') X p++; X#ifdef PERM_DEBUG X error("OP '%c'\n", op); X error("getsperm(--->%s)\n", p); X#endif X if (op == 0) { X if (f) { X if (opname) { X ferrmsgno(f, EX_BAD, X gettext("Missing -%s op.\n"), opname); X } else { X ferrmsgno(f, EX_BAD, X gettext("Missing op in perm string.\n")); X } X } X if (*p == '\0') X return (NULL); X return (p); X } X X flag &= ~(GP_FPERM|GP_UMASK); X if (flag & GP_XERR) X flag = -1; X perms = 0; X while ((pm = isperm(*p, flag)) != (mode_t)-1) { X p++; X perms |= pm; X } X#ifdef PERM_DEBUG X error("PERM %4.4lo\n", (long)perms); X error("START PERMVAL %4.4lo\n", (long)permval); X#endif X if ((perms == 0) && (*p == 'u' || *p == 'g' || *p == 'o')) { X mode_t what = 0; X X /* X * First select the bit triple we like to copy. X */ X switch (*p) { X X case 'u': X what = permval & S_IRWXU; X break; X case 'g': X what = permval & S_IRWXG; X break; X case 'o': X what = permval & S_IRWXO; X break; X } X /* X * Now copy over bit by bit without relying on shifts X * that would make implicit assumptions on values. X */ X if (what & (S_IRUSR|S_IRGRP|S_IROTH)) X perms |= (who & (S_IRUSR|S_IRGRP|S_IROTH)); X if (what & (S_IWUSR|S_IWGRP|S_IWOTH)) X perms |= (who & (S_IWUSR|S_IWGRP|S_IWOTH)); X if (what & (S_IXUSR|S_IXGRP|S_IXOTH)) X perms |= (who & (S_IXUSR|S_IXGRP|S_IXOTH)); X p++; X#ifdef PERM_DEBUG X error("PERM %4.4lo (copy) WHAT %lo WHO %lo\n", X (long)perms, (long)what, (long)who); X#endif X } X#ifdef PERM_DEBUG X error("getsperm(--->%s)\n", p); X error("PERMVAL %lo WHO %lo WHO_MASK %lo PERM %lo OP '%c'\n", X (long)permval, (long)who, (long)who_mask, (long)perms, op); X#endif X switch (op) { X X case '=': X permval &= ~who_mask; X /* FALLTHRU */ X case '+': X permval |= (who & perms); X break; X X case '-': X permval &= ~(who & perms); X break; X } X#ifdef PERM_DEBUG X error("END PERMVAL %4.4lo\n", (long)permval); X#endif X if (isop(*p)) X goto nextop; X if (*p == ',') { X p++; X goto nextclause; X } X *mp = permval; X return (p); X} X XLOCAL mode_t Xiswho(c) X int c; X{ X switch (c) { X X case 'u': /* user */ X return (S_ISUID|S_ISVTX|S_IRWXU); X case 'g': /* group */ X return (S_ISGID|S_ISVTX|S_IRWXG); X case 'o': /* other */ X return (S_ISVTX|S_IRWXO); X case 'a': /* all */ X return (S_ISUID|S_ISGID|S_ISVTX|S_IRWXU|S_IRWXG|S_IRWXO); X default: X return (0); X } X} X XLOCAL int Xisop(c) X int c; /* The current perm character to parse */ X{ X switch (c) { X X case '+': X case '-': X case '=': X return (c); X default: X return (0); X } X} X XLOCAL mode_t Xisperm(c, isX) X int c; /* The current perm character to parse */ X int isX; /* -1: Ignore X, 0: no dir/X 1: X OK */ X{ X switch (c) { X X case 'r': X return (S_IRUSR|S_IRGRP|S_IROTH); X case 'w': X return (S_IWUSR|S_IWGRP|S_IWOTH); X case 'X': X if (isX < 0) X return ((mode_t)-1); /* Singnal parse error */ X if (isX == 0) X return ((mode_t)0); /* No 'X' handling here */ X /* FALLTHRU */ X case 'x': X return (S_IXUSR|S_IXGRP|S_IXOTH); X case 's': X return (S_ISUID|S_ISGID); X case 'l': X return (S_ISGID); X case 't': X return (S_ISVTX); X default: X return ((mode_t)-1); X } X} END-of-star-1.6/libschily/getperm.c echo x - star-1.6/libschily/fstream.c sed 's/^X//' >star-1.6/libschily/fstream.c << 'END-of-star-1.6/libschily/fstream.c' X/* @(#)fstream.c 1.35 19/01/16 Copyright 1985-2019 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)fstream.c 1.35 19/01/16 Copyright 1985-2019 J. Schilling"; X#endif X/* X * Stream filter module X * X * Copyright (c) 1985-2019 J. Schilling X * X * Exported functions: X * mkfstream(f, fun, rfun, efun) Construct new fstream X * fsclose(fsp) Close a fstream X * fssetfile(fsp, f) Replace file pointer in fstream X * fsgetc(fsp) Get one character from fstream X * fspushcha(fsp, c) Push one character on fstream X * fspushstr(fsp, str) Push a string on fstream X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#define WSTRINGS X#include X#include X#include X#include X#include X#include X XEXPORT fstream *mkfstream __PR((FILE *f, fstr_fun sfun, fstr_rfun rfun, X fstr_efun efun)); XEXPORT fstream *fspush __PR((fstream *fsp, fstr_efun efun)); XEXPORT fstream *fspop __PR((fstream *fsp)); XEXPORT fstream *fspushed __PR((fstream *fsp)); XEXPORT void fsclose __PR((fstream *fsp)); XEXPORT FILE *fssetfile __PR((fstream *fsp, FILE *f)); XEXPORT int fsgetc __PR((fstream *fsp)); XEXPORT void fspushstr __PR((fstream *fsp, char *ss)); XEXPORT void fspushcha __PR((fstream *fsp, int c)); XLOCAL void s_ccpy __PR((CHAR *ts, unsigned char *ss)); XLOCAL void s_scpy __PR((CHAR *ts, CHAR *ss)); XLOCAL void s_scat __PR((CHAR *ts, CHAR *ss)); X X/* X * Set up a new stream X */ XEXPORT fstream * Xmkfstream(f, sfun, rfun, efun) X FILE *f; /* The "file" parameter may be a fstream * */ X fstr_fun sfun; /* The fstream transfer/filter function */ X fstr_rfun rfun; /* The read/input function */ X fstr_efun efun; /* The error function used by this func */ X{ X register fstream *fsp; X X if ((fsp = (fstream *)malloc(sizeof (fstream))) == (fstream *)NULL) { X if (efun) X efun("no memory for new fstream"); X return ((fstream *)NULL); X } X fsp->fstr_bp = fsp->fstr_buf = fsp->fstr_sbuf; X *fsp->fstr_bp = '\0'; X fsp->fstr_file = f; X fsp->fstr_flags = 0; X fsp->fstr_pushed = (fstream *)0; X fsp->fstr_func = sfun; X fsp->fstr_rfunc = rfun; X fsp->fstr_auxp = 0; X return (fsp); X} X X/* X * Push a new stream X */ XEXPORT fstream * Xfspush(fsp, efun) X fstream *fsp; X fstr_efun efun; /* The error function used by this func */ X{ X fstream *new = mkfstream((FILE *)0, (fstr_fun)0, (fstr_rfun)0, efun); X X if (new == (fstream *)NULL) X return (new); X X new->fstr_pushed = fsp->fstr_pushed; X fsp->fstr_pushed = new; X return (new); X} X X/* X * Pop a stream X */ XEXPORT fstream * Xfspop(fsp) X fstream *fsp; X{ X fstream *prev = fsp->fstr_pushed; X X if (prev == (fstream *)NULL) X return (prev); X X fsp->fstr_pushed = prev->fstr_pushed; X fsclose(prev); X X return (fsp); X} X X/* X * Return pushed stream X */ XEXPORT fstream * Xfspushed(fsp) X fstream *fsp; X{ X return (fsp->fstr_pushed); X} X X/* X * close the stream X * Do not close the file fsp->fstr_file! X */ XEXPORT void Xfsclose(fsp) X fstream *fsp; X{ X if (fsp->fstr_buf != fsp->fstr_sbuf) X free(fsp->fstr_buf); X free((char *)fsp); X} X X/* X * Change the FILE * member of the stream. X */ XEXPORT FILE * Xfssetfile(fsp, f) X register fstream *fsp; X FILE *f; X{ X FILE *tmp = fsp->fstr_file; X X fsp->fstr_file = f; X return (tmp); X} X X/* X * get next character from stream X */ XEXPORT int Xfsgetc(fsp) X register fstream *fsp; X{ X /* X * If there are pushed streams, refer to the top of pushed streams. X */ X if (fsp->fstr_pushed != NULL) X fsp = fsp->fstr_pushed; X /* X * If our buffer is non-empty, "read" from the buffer. X */ X while (*fsp->fstr_bp == '\0') { /* buffer is empty */ X if (fsp->fstr_func != (fstr_fun)0) { /* call function */ X int ret; X X /* X * We have a filter function, so call it. X */ X#ifdef DEBUG X printf("filter via function %p\n", fsp->fstr_func); X#endif X if ((ret = (*fsp->fstr_func)(fsp, fsp->fstr_file)) < 0) X return (ret); X } else if (fsp->fstr_file == (FILE *)NULL) { /* no file */ X /* X * If we have no input, return EOF. X */ X return (EOF); X } else { /* read from FILE */ X#ifdef DEBUG X printf("read character from file at %06x\n", fsp->fstr_file); X#endif X if (fsp->fstr_rfunc != (fstr_rfun)0) X return ((*fsp->fstr_rfunc)(fsp)); X return (EOF); X } X } X#ifdef DEBUG X printf("character '%c' from buffer\n", *fsp->fstr_bp); X#endif X return (*fsp->fstr_bp++); /* char from buffer */ X} X X/* X * get # of characters in stream X */ XEXPORT size_t Xfsgetlen(fsp) X register fstream *fsp; X{ X CHAR *bp; X X /* X * If there are pushed streams, refer to the top of pushed streams. X */ X if (fsp->fstr_pushed != NULL) X fsp = fsp->fstr_pushed; X X bp = fsp->fstr_bp; X while (*bp++ != '\0') X ; X return (--bp - fsp->fstr_bp); X} X X/* X * Push a null terminated string on the stream X */ XEXPORT void Xfspushstr(fsp, ss) X register fstream *fsp; X register char *ss; X{ X register CHAR *tp; X CHAR *ts; X CHAR tbuf[STR_SBUF_SIZE + 1]; X unsigned len; X X /* X * If there are pushed streams, refer to the top of pushed streams. X */ X if (fsp->fstr_pushed != NULL) X fsp = fsp->fstr_pushed; X X for (tp = fsp->fstr_bp; *tp; tp++); /* Wide char strlen() */ X len = tp - fsp->fstr_bp + strlen(ss); X if (len > STR_SBUF_SIZE) { /* realloc !!! */ X if ((ts = (CHAR *)malloc(sizeof (*ts)*(len+1))) == NULL) { X raisecond("fspushstr", (long)NULL); X /* NOTREACHED */ X } X#ifdef WSTRINGS X s_ccpy(ts, (unsigned char *)ss); X s_scat(ts, fsp->fstr_bp); X#else X strcatl(ts, ss, fsp->fstr_bp, (char *)NULL); X#endif X if (fsp->fstr_buf != fsp->fstr_sbuf) X free(fsp->fstr_buf); X fsp->fstr_buf = fsp->fstr_bp = ts; X } else { X#ifdef WSTRINGS X s_scpy(tbuf, fsp->fstr_bp); X#else X strcatl(tbuf, fsp->fstr_bp, (char *)NULL); X#endif X if (fsp->fstr_buf != fsp->fstr_sbuf) { X free(fsp->fstr_buf); X fsp->fstr_buf = fsp->fstr_sbuf; X } X#ifdef WSTRINGS X s_ccpy(fsp->fstr_buf, (unsigned char *)ss); X s_scat(fsp->fstr_buf, tbuf); X#else X strcatl(fsp->fstr_buf, ss, tbuf, (char *)NULL); X#endif X fsp->fstr_bp = fsp->fstr_buf; X } X} X X/* X * Push a character on the stream X */ XEXPORT void Xfspushcha(fsp, c) X fstream *fsp; X int c; X{ X char t[2]; X X#ifdef WSTRINGS X t[0] = (char)1; /* Nonzero placeholder */ X#else X t[0] = (char)c; X#endif X t[1] = 0; X fspushstr(fsp, t); X#ifdef WSTRINGS X /* X * Solange es kein fspushstr mit SHORT * gibt, wird zuerst Platz X * geschafft und dann der korrekte Buchstabe eingetragen. X */ X if (fsp->fstr_pushed != NULL) X fsp = fsp->fstr_pushed; X *fsp->fstr_bp = c; X#endif X} X X/* X * Copy from narrow char string to wide char string X */ XLOCAL void Xs_ccpy(ts, ss) X register CHAR *ts; X register unsigned char *ss; X{ X while (*ss) X *ts++ = *ss++; X *ts = 0; X} X X/* X * Copy from wide char string to wide char string X */ XLOCAL void Xs_scpy(ts, ss) X register CHAR *ts; X register CHAR *ss; X{ X while (*ss) X *ts++ = *ss++; X *ts = 0; X} X X#ifdef __needed__ XLOCAL void Xs_ccat(ts, ss) X register string ts; X register unsigned char *ss; X{ X while (*ts) X ts++; X while (*ss) X *ts++ = *ss++; X *ts = 0; X} X#endif X XLOCAL void Xs_scat(ts, ss) X register CHAR *ts; X register CHAR *ss; X{ X while (*ts) X ts++; X while (*ss) X *ts++ = *ss++; X *ts = 0; X} END-of-star-1.6/libschily/fstream.c echo x - star-1.6/libschily/sleep.c sed 's/^X//' >star-1.6/libschily/sleep.c << 'END-of-star-1.6/libschily/sleep.c' X/* @(#)sleep.c 1.6 14/03/03 Copyright 2007-2014 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)sleep.c 1.6 14/03/03 Copyright 2007-2014 J. Schilling"; X#endif X/* X * Emulate sleep where it does not exist X * X * Copyright (c) 2007-2014 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#if !defined(HAVE_SLEEP) && (defined(_MSC_VER) || defined(__MINGW32__)) X#include X#include X XEXPORT unsigned int Xsleep(secs) X unsigned int secs; X{ X DWORD ms; X X if (secs == 0) X return (0); X X ms = secs * 1000; X Sleep(ms); X return (0); X} X XEXPORT int Xusleep(usecs) X unsigned int usecs; X{ X DWORD ms; X X if (usecs == 0) X return (0); X X ms = usecs / 1000; X Sleep(ms); X return (0); X} X#endif END-of-star-1.6/libschily/sleep.c echo x - star-1.6/libschily/gettimeofday.c sed 's/^X//' >star-1.6/libschily/gettimeofday.c << 'END-of-star-1.6/libschily/gettimeofday.c' X/* @(#)gettimeofday.c 1.9 12/11/29 Copyright 2007-2012 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)gettimeofday.c 1.9 12/11/29 Copyright 2007-2012 J. Schilling"; X#endif X/* X * Emulate gettimeofday where it does not exist X * X * Copyright (c) 2007-2012 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#if !defined(HAVE_GETTIMEOFDAY) X#if (defined(_MSC_VER) || defined(__MINGW32__)) X#include X#include X#include X#include X X#ifdef _MSC_VER Xconst __int64 MS_FTIME_ADD = 0x2b6109100i64; Xconst __int64 MS_FTIME_SECS = 10000000i64; X#else Xconst Int64_t MS_FTIME_ADD = 0x2b6109100LL; Xconst Int64_t MS_FTIME_SECS = 10000000LL; X#endif X XEXPORT int Xgettimeofday(tp, dummy) X struct timeval *tp; X void *dummy; /* tzp is unspecified by POSIX */ X{ X FILETIME ft; X Int64_t T; X X if (tp == 0) X return (0); X X GetSystemTimeAsFileTime(&ft); /* 100ns time since 1601 */ X T = ft.dwHighDateTime; X T <<= 32; X T += ft.dwLowDateTime; X X /* X * Cast to avoid a loss of data warning X * MSVC uses long instead of time_t for tv_sec X */ X tp->tv_sec = (long) (T / MS_FTIME_SECS - MS_FTIME_ADD); X tp->tv_usec = (long) (T % MS_FTIME_SECS) / 10; X X return (0); X} X#else /* (defined(_MSC_VER) || defined(__MINGW32__)) */ X X#ifdef HAVE_TIME X#include X#include X XEXPORT int Xgettimeofday(tp, dummy) X struct timeval *tp; X void *dummy; /* tzp is unspecified by POSIX */ X{ X time_t t; X X if (tp == 0) X return (0); X X (void) time(&t); X tp->tv_sec = t; X tp->tv_usec = 0; X X return (0); X} X#endif X X#endif /* (defined(_MSC_VER) || defined(__MINGW32__)) */ X#endif /* !defined(HAVE_GETTIMEOFDAY) */ END-of-star-1.6/libschily/gettimeofday.c echo x - star-1.6/libschily/eaccess.c sed 's/^X//' >star-1.6/libschily/eaccess.c << 'END-of-star-1.6/libschily/eaccess.c' X/* @(#)eaccess.c 1.6 14/05/15 Copyright 2004-2014 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)eaccess.c 1.6 14/05/15 Copyright 2004-2014 J. Schilling"; X#endif X/* X * Implement the best possible emulation for eaccess() X * X * Copyright 2004-2014 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X X#ifndef HAVE_EACCESS XEXPORT int eaccess __PR((const char *name, int mode)); X XEXPORT int Xeaccess(name, mode) X const char *name; X int mode; X{ X#ifdef HAVE_EUIDACCESS X return (euidaccess(name, mode)); X#else X#ifdef HAVE_ACCESS_E_OK X return (access(name, E_OK|mode)); X#else X if (getuid() == geteuid() && getgid() == getegid()) X return (access(name, mode)); X#ifdef EOPNOTSUPP X seterrno(EOPNOTSUPP); X#else X seterrno(EINVAL); X#endif X return (-1); X#endif X#endif X} X#endif END-of-star-1.6/libschily/eaccess.c echo x - star-1.6/libschily/findinpath.c sed 's/^X//' >star-1.6/libschily/findinpath.c << 'END-of-star-1.6/libschily/findinpath.c' X/* @(#)findinpath.c 1.6 10/10/07 Copyright 2004-2010 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)findinpath.c 1.6 10/10/07 Copyright 2004-2010 J. Schilling"; X#endif X/* X * Search a file name in the PATH and return the path name in allocated space. X * X * Copyright 2004-2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X XEXPORT char *findinpath __PR((char *name, int mode, BOOL plain_file, X char *path)); X X#ifdef JOS X#define enofile(t) ((t) == EMISSDIR || \ X (t) == ENOFILE || \ X (t) == EISADIR || \ X (t) == EIOERR) X#else X#define enofile(t) ((t) == ENOENT || \ X (t) == ENOTDIR || \ X (t) == EISDIR || \ X (t) == EIO) X#endif X XEXPORT char * Xfindinpath(name, mode, plain_file, path) X char *name; /* The name to execute */ X int mode; /* Mode for access() e.g. X_OK */ X BOOL plain_file; /* Whether to check only plain files */ X char *path; /* PATH to use if not NULL */ X{ X char *pathlist; X char *p1; X char *p2; X char *tmp; X int err = 0; X int exerr = 0; X struct stat sb; X X if (name == NULL) X return (NULL); X if (strchr(name, '/')) X return (strdup(name)); X X if (path != NULL) X pathlist = path; X else if ((pathlist = getenv("PATH")) == NULL) X pathlist = "/bin"; X p2 = pathlist = strdup(pathlist); X if (pathlist == NULL) X return (NULL); X X for (;;) { X p1 = p2; X if ((p2 = strchr(p2, PATH_ENV_DELIM)) != NULL) X *p2++ = '\0'; X if (*p1 == '\0') { X tmp = strdup(name); X if (tmp == NULL) { X free(pathlist); X return (NULL); X } X } else { X size_t len = strlen(p1) + strlen(name) + 2; X X tmp = malloc(len); X if (tmp == NULL) { X free(pathlist); X return (strdup(name)); X } X strcatl(tmp, p1, PATH_DELIM_STR, name, (char *)NULL); X } X X seterrno(0); X if (stat(tmp, &sb) >= 0) { X if ((!plain_file || S_ISREG(sb.st_mode)) && X (eaccess(tmp, mode) >= 0)) { X free(pathlist); X return (tmp); X } X if ((err = geterrno()) == 0) X err = ENOEXEC; X } else { X err = geterrno(); X } X free(tmp); X if (exerr == 0 && !enofile(err)) X exerr = err; X if ((!enofile(err) && !(err == EACCES)) || p2 == NULL) X break; X } X free(pathlist); X seterrno(exerr); X return (NULL); X} END-of-star-1.6/libschily/findinpath.c echo x - star-1.6/libschily/matchw.c sed 's/^X//' >star-1.6/libschily/matchw.c << 'END-of-star-1.6/libschily/matchw.c' X/* @(#)matchw.c 1.1 09/05/28 Copyright 2009 J. Schilling */ X/* X * Pattern matching function for line match (grep like). X * X * Copyright (c) 2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#define USE_WCHAR X#include X X#define __WIDE_CHAR X#include "match.c" END-of-star-1.6/libschily/matchw.c echo x - star-1.6/libschily/matchwl.c sed 's/^X//' >star-1.6/libschily/matchwl.c << 'END-of-star-1.6/libschily/matchwl.c' X/* @(#)matchwl.c 1.1 09/05/28 Copyright 2009 J. Schilling */ X/* X * Pattern matching function for line match (grep like). X * X * Copyright (c) 2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#define USE_WCHAR X#include X X#define __WIDE_CHAR X#define __LINE_MATCH X#include "match.c" END-of-star-1.6/libschily/matchwl.c echo x - star-1.6/libschily/wcscatl.c sed 's/^X//' >star-1.6/libschily/wcscatl.c << 'END-of-star-1.6/libschily/wcscatl.c' X/* @(#)wcscatl.c 1.14 09/06/05 Copyright 1985, 1989, 1995-2009 J. Schilling */ X/* X * list version of wcscat() X * X * concatenates all past first parameter until a NULL pointer is reached X * X * WARNING: a NULL constant is not a NULL pointer, so a caller must X * cast a NULL constant to a pointer: (wchar_t *)NULL X * X * returns pointer past last character (to '\0' "char") X * X * Copyright (c) 1985, 1989, 1995-2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X X/* VARARGS3 */ X#ifdef PROTOTYPES XEXPORT wchar_t * Xwcscatl(wchar_t *to, ...) X#else XEXPORT wchar_t * Xwcscatl(to, va_alist) X wchar_t *to; X va_dcl X#endif X{ X va_list args; X register wchar_t *p; X register wchar_t *tor = to; X X#ifdef PROTOTYPES X va_start(args, to); X#else X va_start(args); X#endif X while ((p = va_arg(args, wchar_t *)) != NULL) { X while ((*tor = *p++) != '\0') { X tor++; X } X } X *tor = '\0'; X va_end(args); X return (tor); X} END-of-star-1.6/libschily/wcscatl.c echo x - star-1.6/libschily/wcschr.c sed 's/^X//' >star-1.6/libschily/wcschr.c << 'END-of-star-1.6/libschily/wcschr.c' X/* @(#)wcschr.c 1.4 09/06/07 Copyright 1985,2009 J. Schilling */ X/* X * wcschr() to be used if missing in libc X * X * Copyright (c) 1985,2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X X#ifndef HAVE_WCSCHR X XEXPORT wchar_t * Xwcschr(s, c) X register const wchar_t *s; X register wchar_t c; X{ X do { X if (*s == c) X return ((wchar_t *)s); X } while (*s++ != '\0'); X return (0); X} X X#endif END-of-star-1.6/libschily/wcschr.c echo x - star-1.6/libschily/wcscmp.c sed 's/^X//' >star-1.6/libschily/wcscmp.c << 'END-of-star-1.6/libschily/wcscmp.c' X/* @(#)wcscmp.c 1.6 09/06/07 Copyright 1985,2009 J. Schilling */ X/* X * Copyright (c) 1985,2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X X#ifndef HAVE_WCSCMP X XEXPORT int Xwcscmp(s1, s2) X register const wchar_t *s1; X register const wchar_t *s2; X{ X if (s1 == s2) X return (0); X X while (*s1 == *s2++) { X if (*s1++ == '\0') X return (0); X } X return (*s1 - *(--s2)); X} X X#endif END-of-star-1.6/libschily/wcscmp.c echo x - star-1.6/libschily/wcscpy.c sed 's/^X//' >star-1.6/libschily/wcscpy.c << 'END-of-star-1.6/libschily/wcscpy.c' X/* @(#)wcscpy.c 1.2 09/07/08 Copyright 2006-2009 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)wcscpy.c 1.2 09/07/08 Copyright 2006-2009 J. Schilling"; X#endif X/* X * wcscpy() to be used if missing in libc X * X * Copyright (c) 2006-2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X X#ifndef HAVE_WCSCPY X XEXPORT wchar_t * Xwcscpy(s1, s2) X register wchar_t *s1; X register const wchar_t *s2; X{ X wchar_t *ret = s1; X X while ((*s1++ = *s2++) != '\0') X ; X return (ret); X} X#endif /* HAVE_WCSCPY */ END-of-star-1.6/libschily/wcscpy.c echo x - star-1.6/libschily/wcseql.c sed 's/^X//' >star-1.6/libschily/wcseql.c << 'END-of-star-1.6/libschily/wcseql.c' X/* @(#)wcseql.c 1.10 09/06/07 Copyright 1985, 1995-2009 J. Schilling */ X/* X * Check if two wide strings are equal X * X * Copyright (c) 1985, 1995-2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X XEXPORT int Xwcseql(a, b) X const wchar_t *a; X const wchar_t *b; X{ X register const wchar_t *s1 = a; X register const wchar_t *s2 = b; X X if (s1 == s2) X return (TRUE); X X#ifdef __never__ X if (s1 == NULL || s2 == NULL) X return (FALSE); X#endif X X while (*s1 == *s2++) X if (*s1++ == '\0') X return (TRUE); X X return (FALSE); X} END-of-star-1.6/libschily/wcseql.c echo x - star-1.6/libschily/wcslcpy.c sed 's/^X//' >star-1.6/libschily/wcslcpy.c << 'END-of-star-1.6/libschily/wcslcpy.c' X/* @(#)wcslcpy.c 1.5 09/07/08 Copyright 2006-2009 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)wcslcpy.c 1.5 09/07/08 Copyright 2006-2009 J. Schilling"; X#endif X/* X * wcslcpy() to be used if missing in libc X * X * Copyright (c) 2006-2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X X#ifndef HAVE_WCSLCPY X XEXPORT size_t Xwcslcpy(s1, s2, len) X register wchar_t *s1; X register const wchar_t *s2; X register size_t len; X{ X const wchar_t *os2 = s2; X X if (len > 0) { X while (--len > 0 && (*s1++ = *s2++) != '\0') X ; X if (len == 0) { X *s1 = '\0'; X while (*s2++ != '\0') X ; X } X } else { X while (*s2++ != '\0') X ; X } X return (--s2 - os2); X} X#endif /* HAVE_WCSLCPY */ END-of-star-1.6/libschily/wcslcpy.c echo x - star-1.6/libschily/wcslen.c sed 's/^X//' >star-1.6/libschily/wcslen.c << 'END-of-star-1.6/libschily/wcslen.c' X/* @(#)wcslen.c 1.5 09/06/07 Copyright 1985,2009 J. Schilling */ X/* X * wcslen() to be used if missing in libc X * X * Copyright (c) 1985,2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X X#ifndef HAVE_WCSLEN X XEXPORT size_t Xwcslen(s) X register const wchar_t *s; X{ X register const wchar_t *rs = s; X X while (*rs++ != '\0') X ; X return (--rs - s); X} X X#endif END-of-star-1.6/libschily/wcslen.c echo x - star-1.6/libschily/wcsncat.c sed 's/^X//' >star-1.6/libschily/wcsncat.c << 'END-of-star-1.6/libschily/wcsncat.c' X/* @(#)wcsncat.c 1.3 10/05/06 Copyright 2006-2010 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)wcsncat.c 1.3 10/05/06 Copyright 2006-2010 J. Schilling"; X#endif X/* X * wcsncat() to be used if missing in libc X * X * Copyright (c) 2006-2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X X#ifndef HAVE_WCSNCAT X XEXPORT wchar_t * Xwcsncat(s1, s2, len) X register wchar_t *s1; X register const wchar_t *s2; X register size_t len; X{ X wchar_t *ret = s1; X X X if (len == 0) X return (ret); X X while (*s1++ != '\0') X ; X s1--; X do { X if ((*s1++ = *s2++) == '\0') X return (ret); X } while (--len > 0); X *s1 = '\0'; X return (ret); X} X#endif /* HAVE_WCSNCAT */ END-of-star-1.6/libschily/wcsncat.c echo x - star-1.6/libschily/wcsncpy.c sed 's/^X//' >star-1.6/libschily/wcsncpy.c << 'END-of-star-1.6/libschily/wcsncpy.c' X/* @(#)wcsncpy.c 1.6 10/05/07 Copyright 2006-2010 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)wcsncpy.c 1.6 10/05/07 Copyright 2006-2010 J. Schilling"; X#endif X/* X * wcsncpy() to be used if missing in libc X * X * Copyright (c) 2006-2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X X#ifndef HAVE_WCSNCPY X XEXPORT wchar_t * Xwcsncpy(s1, s2, len) X register wchar_t *s1; X register const wchar_t *s2; X register size_t len; X{ X wchar_t *ret = s1; X X if (len == 0) X return (ret); X X do { X if ((*s1++ = *s2++) == '\0') X break; X } while (--len > 0); X if (len > 0) { X while (--len > 0) X *s1++ = '\0'; X } X return (ret); X} X#endif /* HAVE_WCSNCPY */ END-of-star-1.6/libschily/wcsncpy.c echo x - star-1.6/libschily/wcsrchr.c sed 's/^X//' >star-1.6/libschily/wcsrchr.c << 'END-of-star-1.6/libschily/wcsrchr.c' X/* @(#)wcsrchr.c 1.2 09/06/05 Copyright 1985,2009 J. Schilling */ X/* X * wcsrchr() to be used if missing in libc X * X * Copyright (c) 1985,2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X X#ifndef HAVE_WCSRCHR X XEXPORT wchar_t * Xwcsrchr(s, c) X register const wchar_t *s; X register wchar_t c; X{ X register wchar_t *p = NULL; X X do { X if (*s == c) X p = (wchar_t *)s; X } while (*s++ != '\0'); X return (p); X} X X#endif END-of-star-1.6/libschily/wcsrchr.c echo x - star-1.6/libschily/wcscat.c sed 's/^X//' >star-1.6/libschily/wcscat.c << 'END-of-star-1.6/libschily/wcscat.c' X/* @(#)wcscat.c 1.2 09/07/08 Copyright 2006-2009 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)wcscat.c 1.2 09/07/08 Copyright 2006-2009 J. Schilling"; X#endif X/* X * wcscat() to be used if missing in libc X * X * Copyright (c) 2006-2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X X#ifndef HAVE_WCSCAT X XEXPORT wchar_t * Xwcscat(s1, s2) X register wchar_t *s1; X register const wchar_t *s2; X{ X wchar_t *ret = s1; X X while (*s1++ != '\0') X ; X s1--; X while ((*s1++ = *s2++) != '\0') X ; X return (ret); X} X#endif /* HAVE_WCSCAT */ END-of-star-1.6/libschily/wcscat.c echo x - star-1.6/libschily/wcsncmp.c sed 's/^X//' >star-1.6/libschily/wcsncmp.c << 'END-of-star-1.6/libschily/wcsncmp.c' X/* @(#)wcsncmp.c 1.4 10/05/06 Copyright 2006-2010 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)wcsncmp.c 1.4 10/05/06 Copyright 2006-2010 J. Schilling"; X#endif X/* X * wcsncmp() to be used if missing in libc X * X * Copyright (c) 2006-2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X X#ifndef HAVE_WCSNCMP X XEXPORT int Xwcsncmp(s1, s2, len) X register const wchar_t *s1; X register const wchar_t *s2; X register size_t len; X{ X if (s1 == s2) X return (0); X X if (len == 0) X return (0); X X do { X if (*s1 == *s2++) { X if (*s1++ == '\0') X return (0); X } else { X break; X } X } while (--len > 0); X X return (len == 0 ? 0 : *s1 - *(--s2)); X} X#endif /* HAVE_WCSNCMP */ END-of-star-1.6/libschily/wcsncmp.c echo x - star-1.6/libschily/wcsdup.c sed 's/^X//' >star-1.6/libschily/wcsdup.c << 'END-of-star-1.6/libschily/wcsdup.c' X/* @(#)wcsdup.c 1.7 10/08/21 Copyright 2003-2010 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)wcsdup.c 1.7 10/08/21 Copyright 2003-2010 J. Schilling"; X#endif X/* X * wcsdup() to be used if missing in libc X * X * Copyright (c) 2003-2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X X#ifndef HAVE_WCSDUP X XEXPORT wchar_t * Xwcsdup(s) X const wchar_t *s; X{ X unsigned i = wcslen(s) + 1; X wchar_t *res = malloc(i * sizeof (wchar_t)); X X if (res == NULL) X return (NULL); X if (i > 16) { X movebytes(s, res, (int)(i * sizeof (wchar_t))); X } else { X wchar_t *s2 = res; X X while ((*s2++ = *s++) != '\0') X ; X } X return (res); X} X#endif /* HAVE_WCSDUP */ END-of-star-1.6/libschily/wcsdup.c echo x - star-1.6/libschily/strcat.c sed 's/^X//' >star-1.6/libschily/strcat.c << 'END-of-star-1.6/libschily/strcat.c' X/* @(#)strcat.c 1.2 09/07/08 Copyright 2006-2009 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)strcat.c 1.2 09/07/08 Copyright 2006-2009 J. Schilling"; X#endif X/* X * strcat() to be used if missing in libc X * X * Copyright (c) 2006-2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X X#ifndef HAVE_STRCAT X XEXPORT char * Xstrcat(s1, s2) X register char *s1; X register const char *s2; X{ X char *ret = s1; X X while (*s1++ != '\0') X ; X s1--; X while ((*s1++ = *s2++) != '\0') X ; X return (ret); X} X#endif /* HAVE_STRCAT */ END-of-star-1.6/libschily/strcat.c echo x - star-1.6/libschily/strchr.c sed 's/^X//' >star-1.6/libschily/strchr.c << 'END-of-star-1.6/libschily/strchr.c' X/* @(#)strchr.c 1.3 09/06/07 Copyright 1985,2009 J. Schilling */ X/* X * strchr() to be used if missing in libc X * X * Copyright (c) 1985,2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X X#ifndef HAVE_STRCHR X XEXPORT char * Xstrchr(s, c) X register const char *s; X register int c; X{ X do { X if (*s == (char)c) X return ((char *)s); X } while (*s++ != '\0'); X return (0); X} X X#endif END-of-star-1.6/libschily/strchr.c echo x - star-1.6/libschily/strcmp.c sed 's/^X//' >star-1.6/libschily/strcmp.c << 'END-of-star-1.6/libschily/strcmp.c' X/* @(#)strcmp.c 1.6 09/06/07 Copyright 1985,2009 J. Schilling */ X/* X * strcmp() to be used if missing in libc X * X * Copyright (c) 1985,2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X X#ifndef HAVE_STRCMP X XEXPORT int Xstrcmp(s1, s2) X register const char *s1; X register const char *s2; X{ X if (s1 == s2) X return (0); X X while (*s1 == *s2++) { X if (*s1++ == '\0') X return (0); X } X return (*(unsigned char *)s1 - *(unsigned char *)(--s2)); X} X X#endif END-of-star-1.6/libschily/strcmp.c echo x - star-1.6/libschily/strcpy.c sed 's/^X//' >star-1.6/libschily/strcpy.c << 'END-of-star-1.6/libschily/strcpy.c' X/* @(#)strcpy.c 1.2 09/07/08 Copyright 2006-2009 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)strcpy.c 1.2 09/07/08 Copyright 2006-2009 J. Schilling"; X#endif X/* X * strcpy() to be used if missing in libc X * X * Copyright (c) 2006-2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X X#ifndef HAVE_STRCPY X XEXPORT char * Xstrcpy(s1, s2) X register char *s1; X register const char *s2; X{ X char *ret = s1; X X while ((*s1++ = *s2++) != '\0') X ; X return (ret); X} X#endif /* HAVE_STRCPY */ END-of-star-1.6/libschily/strcpy.c echo x - star-1.6/libschily/strncmp.c sed 's/^X//' >star-1.6/libschily/strncmp.c << 'END-of-star-1.6/libschily/strncmp.c' X/* @(#)strncmp.c 1.4 10/05/06 Copyright 2006-2010 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)strncmp.c 1.4 10/05/06 Copyright 2006-2010 J. Schilling"; X#endif X/* X * strncmp() to be used if missing in libc X * X * Copyright (c) 2006-2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X X#ifndef HAVE_STRNCMP X XEXPORT int Xstrncmp(s1, s2, len) X register const char *s1; X register const char *s2; X register size_t len; X{ X if (s1 == s2) X return (0); X X if (len == 0) X return (0); X X do { X if (*s1 == *s2++) { X if (*s1++ == '\0') X return (0); X } else { X break; X } X } while (--len > 0); X X return (len == 0 ? 0 : *(unsigned char *)s1 - *(unsigned char *)(--s2)); X} X#endif /* HAVE_STRNCMP */ END-of-star-1.6/libschily/strncmp.c echo x - star-1.6/libschily/strlen.c sed 's/^X//' >star-1.6/libschily/strlen.c << 'END-of-star-1.6/libschily/strlen.c' X/* @(#)strlen.c 1.3 09/06/06 Copyright 1985,2009 J. Schilling */ X/* X * strlen() to be used if missing in libc X * X * Copyright (c) 1985,2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X X#ifndef HAVE_STRLEN X XEXPORT size_t Xstrlen(s) X register const char *s; X{ X register const char *rs = s; X X while (*rs++ != '\0') X ; X return (--rs - s); X} X X#endif END-of-star-1.6/libschily/strlen.c echo x - star-1.6/libschily/strncat.c sed 's/^X//' >star-1.6/libschily/strncat.c << 'END-of-star-1.6/libschily/strncat.c' X/* @(#)strncat.c 1.3 10/05/06 Copyright 2006-2010 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)strncat.c 1.3 10/05/06 Copyright 2006-2010 J. Schilling"; X#endif X/* X * strncat() to be used if missing in libc X * X * Copyright (c) 2006-2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X X#ifndef HAVE_STRNCAT X XEXPORT char * Xstrncat(s1, s2, len) X register char *s1; X register const char *s2; X register size_t len; X{ X char *ret = s1; X X if (len == 0) X return (ret); X X while (*s1++ != '\0') X ; X s1--; X do { X if ((*s1++ = *s2++) == '\0') X return (ret); X } while (--len > 0); X *s1 = '\0'; X return (ret); X} X#endif /* HAVE_STRNCAT */ END-of-star-1.6/libschily/strncat.c echo x - star-1.6/libschily/strrchr.c sed 's/^X//' >star-1.6/libschily/strrchr.c << 'END-of-star-1.6/libschily/strrchr.c' X/* @(#)strrchr.c 1.2 09/06/07 Copyright 1985,2009 J. Schilling */ X/* X * strrchr() to be used if missing in libc X * X * Copyright (c) 1985,2009 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X X#ifndef HAVE_STRRCHR X XEXPORT char * Xstrrchr(s, c) X register const char *s; X register int c; X{ X register char *p = NULL; X X do { X if (*s == (char)c) X p = (char *)s; X } while (*s++ != '\0'); X return (p); X} X X#endif END-of-star-1.6/libschily/strrchr.c echo x - star-1.6/libschily/strlcat.c sed 's/^X//' >star-1.6/libschily/strlcat.c << 'END-of-star-1.6/libschily/strlcat.c' X/* @(#)strlcat.c 1.1 10/04/26 Copyright 2010 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)strlcat.c 1.1 10/04/26 Copyright 2010 J. Schilling"; X#endif X/* X * strlcat() to be used if missing in libc X * X * Copyright (c) 2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X X#ifndef HAVE_STRLCAT X XEXPORT size_t Xstrlcat(s1, s2, len) X register char *s1; X register const char *s2; X register size_t len; X{ X const char *os1 = s1; X size_t olen = len; X X if (len > 0) { X while (--len > 0 && *s1++ != '\0') X ; X X if (len == 0) X return (olen + strlen(s2)); X X s1--; X len++; X while (--len > 0 && (*s1++ = *s2++) != '\0') X ; X if (len == 0) { X *s1 = '\0'; X return (s1 - os1 + strlen(s2)); X } X return (--s1 - os1); X } X return (strlen(s2)); X} X#endif /* HAVE_STRLCAT */ END-of-star-1.6/libschily/strlcat.c echo x - star-1.6/libschily/wcslcat.c sed 's/^X//' >star-1.6/libschily/wcslcat.c << 'END-of-star-1.6/libschily/wcslcat.c' X/* @(#)wcslcat.c 1.1 10/04/26 Copyright 2010 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)wcslcat.c 1.1 10/04/26 Copyright 2010 J. Schilling"; X#endif X/* X * wcslcat() to be used if missing in libc X * X * Copyright (c) 2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X X#ifndef HAVE_WCSLCAT X XEXPORT size_t Xwcslcat(s1, s2, len) X register wchar_t *s1; X register const wchar_t *s2; X register size_t len; X{ X const wchar_t *os1 = s1; X size_t olen = len; X X if (len > 0) { X while (--len > 0 && *s1++ != '\0') X ; X X if (len == 0) X return (olen + wcslen(s2)); X X s1--; X len++; X while (--len > 0 && (*s1++ = *s2++) != '\0') X ; X if (len == 0) { X *s1 = '\0'; X return (s1 - os1 + wcslen(s2)); X } X return (--s1 - os1); X } X return (wcslen(s2)); X} X#endif /* HAVE_WCSLCAT */ END-of-star-1.6/libschily/wcslcat.c echo x - star-1.6/libschily/strnlen.c sed 's/^X//' >star-1.6/libschily/strnlen.c << 'END-of-star-1.6/libschily/strnlen.c' X/* @(#)strnlen.c 1.3 10/05/07 Copyright 2010 J. Schilling */ X/* X * strnlen() to be used if missing in libc X * X * Copyright (c) 2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X X#ifndef HAVE_STRNLEN X XEXPORT size_t Xstrnlen(s, len) X register const char *s; X register size_t len; X{ X register const char *rs = s; X X if (len == 0) X return (0); X X while (*rs++ != '\0' && --len > 0) X ; X if (len == 0) X return (rs - s); X return (--rs - s); X} X X#endif END-of-star-1.6/libschily/strnlen.c echo x - star-1.6/libschily/wcsnlen.c sed 's/^X//' >star-1.6/libschily/wcsnlen.c << 'END-of-star-1.6/libschily/wcsnlen.c' X/* @(#)wcsnlen.c 1.3 10/05/07 Copyright 2010 J. Schilling */ X/* X * wcsnlen() to be used if missing in libc X * X * Copyright (c) 2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X X#ifndef HAVE_WCSNLEN X XEXPORT size_t Xwcsnlen(s, len) X register const wchar_t *s; X register size_t len; X{ X register const wchar_t *rs = s; X X if (len == 0) X return (0); X X while (*rs++ != '\0' && --len > 0) X ; X if (len == 0) X return (rs - s); X return (--rs - s); X} X X#endif END-of-star-1.6/libschily/wcsnlen.c echo x - star-1.6/libschily/basename.c sed 's/^X//' >star-1.6/libschily/basename.c << 'END-of-star-1.6/libschily/basename.c' X/* @(#)basename.c 1.1 10/05/08 Copyright 2010 J. Schilling */ X/* X * basename() to be used if missing in libc X * X * Copyright (c) 2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X X#ifndef HAVE_BASENAME X XEXPORT char * Xbasename(name) X char *name; X{ X char *n; X X if (name == 0 || *name == '\0') X return ("."); X X n = name + strlen(name); X while (n != name && *--n == '/') X *n = '\0'; X X if (n == name && *n == '\0') X return ("/"); X X while (n != name) { X if (*--n == '/') X return (++n); X } X return (n); X} X X#endif END-of-star-1.6/libschily/basename.c echo x - star-1.6/libschily/dirname.c sed 's/^X//' >star-1.6/libschily/dirname.c << 'END-of-star-1.6/libschily/dirname.c' X/* @(#)dirname.c 1.1 10/05/08 Copyright 2010 J. Schilling */ X/* X * dirname() to be used if missing in libc X * X * Copyright (c) 2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X X#ifndef HAVE_DIRNAME X XEXPORT char * Xdirname(name) X char *name; X{ X char *n; X X if (name == 0 || *name == '\0') X return ("."); X X n = name + strlen(name); X while (n != name && *--n == '/') X ; X X if (n == name && *n == '/') X return ("/"); X X while (n != name) { X if (*--n == '/') { X while (*n == '/' && n != name) X n--; X *++n = '\0'; X return (name); X } X } X return ("."); X} X X#endif END-of-star-1.6/libschily/dirname.c echo x - star-1.6/libschily/strndup.c sed 's/^X//' >star-1.6/libschily/strndup.c << 'END-of-star-1.6/libschily/strndup.c' X/* @(#)strndup.c 1.1 10/05/06 Copyright 2003-2010 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)strndup.c 1.1 10/05/06 Copyright 2003-2010 J. Schilling"; X#endif X/* X * strndup() to be used if missing in libc X * X * Copyright (c) 2003-2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X X#ifndef HAVE_STRNDUP X XEXPORT char * Xstrndup(s, len) X const char *s; X size_t len; X{ X size_t i = strnlen(s, len) + 1; X char *res = malloc(i); X X if (res == NULL) X return (NULL); X if (i > 16) { X movebytes(s, res, --i); X res[i] = '\0'; X } else { X char *s2 = res; X X while (--i > 0 && (*s2++ = *s++) != '\0') X ; X if (i == 0) X *s2 = '\0'; X } X return (res); X} X#endif /* HAVE_STRDUP */ END-of-star-1.6/libschily/strndup.c echo x - star-1.6/libschily/wcsndup.c sed 's/^X//' >star-1.6/libschily/wcsndup.c << 'END-of-star-1.6/libschily/wcsndup.c' X/* @(#)wcsndup.c 1.2 10/07/21 Copyright 2003-2010 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)wcsndup.c 1.2 10/07/21 Copyright 2003-2010 J. Schilling"; X#endif X/* X * wcsndup() to be used if missing in libc X * X * Copyright (c) 2003-2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X#include X X#ifndef HAVE_WCSNDUP X XEXPORT wchar_t * Xwcsndup(s, len) X const wchar_t *s; X size_t len; X{ X size_t i = wcsnlen(s, len) + 1; X wchar_t *res = malloc(i); X X if (res == NULL) X return (NULL); X if (i > 16) { X movebytes(s, res, --i); X res[i] = '\0'; X } else { X wchar_t *s2 = res; X X while (--i > 0 && (*s2++ = *s++) != '\0') X ; X if (i == 0) X *s2 = '\0'; X } X return (res); X} X#endif /* HAVE_STRDUP */ END-of-star-1.6/libschily/wcsndup.c echo x - star-1.6/libschily/searchinpath.c sed 's/^X//' >star-1.6/libschily/searchinpath.c << 'END-of-star-1.6/libschily/searchinpath.c' X/* @(#)searchinpath.c 1.6 18/02/04 Copyright 1999-2018 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)searchinpath.c 1.6 18/02/04 Copyright 1999-2018 J. Schilling"; X#endif X/* X * Search a file name in the PATH of the current exeecutable. X * Return the path to the file name in allocated space. X * X * Copyright (c) 1999-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include /* getexecname() */ X#include X#include X#include X#include X X X#define NAMEMAX 4096 X XEXPORT char *searchfileinpath __PR((char *name, int mode, X int file_mode, X char *path)); XLOCAL char *searchonefile __PR((char *name, int mode, X BOOL plain_file, X char *xn, X char *nbuf, X char *np, char *ep)); X#if defined(__DJGPP__) XLOCAL char *strbs2s __PR((char *s)); X#endif X X#ifdef JOS X#define enofile(t) ((t) == EMISSDIR || \ X (t) == ENOFILE || \ X (t) == EISADIR || \ X (t) == EIOERR) X#else X#define enofile(t) ((t) == ENOENT || \ X (t) == ENOTDIR || \ X (t) == EISDIR || \ X (t) == EIO) X#endif X X/* X * Search for the "name" file in the PATH of the user. X * Assume that the file is ... bin/../name. X */ XEXPORT char * Xsearchfileinpath(name, mode, file_mode, path) X char *name; /* Find /../name in PATH */ X int mode; /* Mode for access() e.g. X_OK */ X int file_mode; /* How to check files */ X char *path; /* PATH to use if not NULL */ X{ X char pbuf[NAMEMAX]; X char *nbuf = pbuf; X char *np; X char *ep; X char *xn; X int nlen = strlen(name); X int oerrno = geterrno(); X int err = 0; X#ifdef HAVE_GETEXECNAME X char *pn = (char *)getexecname(); /* pn is on the stack */ X#else X char *pn = getexecpath(); /* pn is from strdup() */ X char ebuf[NAMEMAX]; X X if (pn) { X strlcpy(ebuf, pn, sizeof (ebuf)); X free(pn); X pn = ebuf; X } X#endif X X if (pn == NULL) X xn = get_progname(); X else X xn = pn; X if ((np = strrchr(xn, '/')) != NULL) X xn = ++np; X X /* X * getexecname() is the best choice for our seach. getexecname() X * returns either "foo" (if called from the current directory) or X * an absolute path after symlinks have been resolved. X * If getexecname() returns a path with slashes, try to search X * first relatively to the known location of the current binary. X */ X if ((file_mode & SIP_ONLY_PATH) == 0 && X pn != NULL && strchr(pn, '/') != NULL) { X strlcpy(nbuf, pn, sizeof (pbuf)); X np = nbuf + strlen(nbuf); X X while (np > nbuf && np[-1] != '/') X *--np = '\0'; X pn = &nbuf[sizeof (pbuf) - 1]; X if ((np = searchonefile(name, mode, X file_mode & (SIP_PLAIN_FILE|SIP_NO_STRIPBIN), X xn, X nbuf, np, pn)) != NULL) { X seterrno(oerrno); X return (np); X } X } X X if (file_mode & SIP_NO_PATH) X return (NULL); X X if (path == NULL) X path = getenv("PATH"); X if (path == NULL) X return (NULL); X X X#ifdef __DJGPP__ X path = strdup(path); X if (path == NULL) X return (NULL); X strbs2s(path); /* PATH under DJGPP can contain both slashes */ X pn = path; /* Remember PATH to be able to free() it */ X#endif X X /* X * A PATH name search should lead us to the path under which we X * called the binary, but not necessarily to the install path as X * we may have been called thorugh a symlink or hardlink. In case X * of a symlink, we can follow the link. In case of a hardlink, we X * are lost. X */ X ep = &nbuf[sizeof (pbuf) - 1]; X for (;;) { X np = nbuf; X while (*path != PATH_ENV_DELIM && *path != '\0' && X np < &nbuf[sizeof (pbuf) - nlen]) X *np++ = *path++; X *np = '\0'; X if ((np = searchonefile(name, mode, X file_mode & (SIP_PLAIN_FILE|SIP_NO_STRIPBIN), X xn, X nbuf, np, ep)) != NULL) { X#ifdef __DJGPP__ X free(pn); X#endif X seterrno(oerrno); X return (np); X } X if (err == 0) { X err = geterrno(); X if (enofile(err)) X err = 0; X } X if (*path == '\0') X break; X path++; X } X#ifdef __DJGPP__ X free(pn); X#endif X if (err) X seterrno(err); X else X seterrno(oerrno); X return (NULL); X} X XLOCAL char * Xsearchonefile(name, mode, plain_file, xn, nbuf, np, ep) X register char *name; /* Find /../name in PATH */ X int mode; /* Mode for access() e.g. X_OK */ X BOOL plain_file; /* Whether to check only plain files */ X char *xn; /* The basename of the executable */ X register char *nbuf; /* Name buffer base */ X register char *np; /* Where to append name to path */ X register char *ep; /* Point to last valid char in nbuf */ X{ X struct stat sb; X X while (np > nbuf && np[-1] == '/') X *--np = '\0'; X if (xn) { X *np++ = '/'; X strlcpy(np, xn, ep - np); X if (stat(nbuf, &sb) < 0) X return (NULL); X if (!S_ISREG(sb.st_mode)) X return (NULL); X *--np = '\0'; X } X if ((plain_file & SIP_NO_STRIPBIN) == 0) { X if (np >= &nbuf[4] && streql(&np[-4], "/bin")) X np = &np[-4]; X } X plain_file &= SIP_PLAIN_FILE; X *np++ = '/'; X *np = '\0'; X strlcpy(np, name, ep - np); X X seterrno(0); X if (stat(nbuf, &sb) >= 0) { X if ((!plain_file || S_ISREG(sb.st_mode)) && X (eaccess(nbuf, mode) >= 0)) { X return (strdup(nbuf)); X } X if (geterrno() == 0) X seterrno(EACCES); X } X return (NULL); X} X X#ifdef __DJGPP__ XLOCAL char * Xstrbs2s(s) X char *s; X{ X char *tmp = s; X X if (tmp) { X while (*tmp) { X if (*tmp == '\\') X *tmp = '/'; X tmp++; X } X } X return (s); X} X#endif END-of-star-1.6/libschily/searchinpath.c echo x - star-1.6/libschily/getexecpath.c sed 's/^X//' >star-1.6/libschily/getexecpath.c << 'END-of-star-1.6/libschily/getexecpath.c' X/* @(#)getexecpath.c 1.1 10/11/18 Copyright 2006-2010 J. Schilling */ X/* X * Copyright (c) 2006.2010 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X X#if (defined(sun) || defined(__sun) || defined(__sun__)) && defined(__SVR4) X#define PATH_IMPL X#define METHOD_SYMLINK X#define SYMLINK_PATH "/proc/self/path/a.out" /* Solaris 10 -> ... */ X#endif X X#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) X#define PATH_IMPL X#define METHOD_SYMLINK X#define SYMLINK_PATH "/proc/curproc/file" /* /proc may nor be mounted */ X#endif X X#if defined(__linux__) || defined(__linux)|| defined(linux) X#define PATH_IMPL X#define METHOD_SYMLINK X#define SYMLINK_PATH "/proc/self/exe" X#endif X X#if defined(HAVE_PROC_PIDPATH) /* Mac OS X */ X#ifdef HAVE_LIBPROC_H X#include X#endif X#define PATH_IMPL X#endif X X/* X * TODO: AIX: /proc/$$/object/a.out -> plain file, match via st_dev/st_ino X */ X X XEXPORT char * Xgetexecpath() X{ X#ifdef PATH_IMPL X#ifdef METHOD_SYMLINK X char buf[1024]; X ssize_t len; X X len = readlink(SYMLINK_PATH, buf, sizeof (buf)-1); X if (len == -1) X return (NULL); X buf[len] = '\0'; X return (strdup(buf)); X#endif X#ifdef HAVE_PROC_PIDPATH /* Mac OS X */ X char buf[1024]; X int len; X X len = proc_pidpath(getpid(), buf, sizeof (buf)); X if (len == -1) X return (NULL); X return (strdup(buf)); X#endif X#else X return (NULL); X#endif X} END-of-star-1.6/libschily/getexecpath.c echo x - star-1.6/libschily/mkgmtime.c sed 's/^X//' >star-1.6/libschily/mkgmtime.c << 'END-of-star-1.6/libschily/mkgmtime.c' X/* @(#)mkgmtime.c 1.4 11/08/28 Copyright 2011 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)mkgmtime.c 1.4 11/08/28 Copyright 2011 J. Schilling"; X#endif X/* X * mkgmtime() is a complement to mktime() X * X * Copyright (c) 2011 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X XEXPORT Llong mklgmtime __PR((struct tm *tp)); XEXPORT time_t mkgmtime __PR((struct tm *tp)); X X/* X * The Gregorian leap year formula X */ X#define dysize(A) (((A)%4)? 365 : (((A)%100) == 0 && ((A)%400)) ? 365 : 366) X#define isleap(A) (((A)%4)? 0 : (((A)%100) == 0 && ((A)%400)) ? 0 : 1) X/* X * Return the number of leap years since 0 AD assuming that the Gregorian X * calendar applies to all years. X */ X#define LEAPS(Y) ((Y) / 4 - (Y) / 100 + (Y) / 400) X/* X * Return the number of days since 0 AD X */ X#define YRDAYS(Y) (((Y) * 365L) + LEAPS(Y)) X/* X * Return the number of days between Januar 1 1970 and the end of the year X * before the the year used as argument. X */ X#define DAYS_SINCE_70(Y) (YRDAYS((Y)-1) - YRDAYS(1970-1)) X XLOCAL int dmbeg[12] = {0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334}; X XEXPORT Llong Xmklgmtime(tp) X struct tm *tp; X{ X register Llong tim; X X if (tp->tm_mon >= 12) { X tp->tm_year += tp->tm_mon / 12; X tp->tm_mon %= 12; X } else if (tp->tm_mon < 0) { X int m = -tp->tm_mon; X X tp->tm_year -= m / 12; X m %= 12; X if (m) { X tp->tm_year -= 1; X tp->tm_mon = 12 - m; X } else { X tp->tm_mon = 0; X } X } X X { X register int y = tp->tm_year + 1900; X register int t = tp->tm_mon; X X tim = DAYS_SINCE_70(y); X X if (t >= 2 && isleap(y)) /* March or later */ X tim += 1; /* Add 29.2. */ X tim += dmbeg[t]; X } X X tim += tp->tm_mday - 1; X tim *= 24; X tim += tp->tm_hour; X tim *= 60; X tim += tp->tm_min; X tim *= 60; X tim += tp->tm_sec; X return (tim); X} X XEXPORT time_t Xmkgmtime(tp) X struct tm *tp; X{ X Llong tim; X time_t t; X X t = tim = mklgmtime(tp); X if (t != tim) { X#ifdef EOVERFLOW X seterrno(EOVERFLOW); X#else X seterrno(EINVAL); X#endif X return (-1); X } X return (t); X} END-of-star-1.6/libschily/mkgmtime.c echo x - star-1.6/libschily/timegm.c sed 's/^X//' >star-1.6/libschily/timegm.c << 'END-of-star-1.6/libschily/timegm.c' X/* @(#)timegm.c 1.1 11/06/04 Copyright 2011 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)timegm.c 1.1 11/06/04 Copyright 2011 J. Schilling"; X#endif X/* X * timegm() is a complement to timelocal() X * X * Copyright (c) 2011 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X XEXPORT time_t timegm __PR((struct tm *tp)); X X#ifndef HAVE_TIMEGM XEXPORT time_t Xtimegm(tp) X struct tm *tp; X{ X return (mkgmtime(tp)); X} X#endif END-of-star-1.6/libschily/timegm.c echo x - star-1.6/libschily/permtostr.c sed 's/^X//' >star-1.6/libschily/permtostr.c << 'END-of-star-1.6/libschily/permtostr.c' X/* @(#)permtostr.c 1.2 11/08/16 Copyright 2011 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)permtostr.c 1.2 11/08/16 Copyright 2011 J. Schilling"; X#endif X/* X * mkgmtime() is a complement to getperm() X * X * Copyright (c) 2011 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X XEXPORT void permtostr __PR((mode_t mode, char *s)); X XLOCAL mode_t modebits[9] = { X S_IXOTH, S_IWOTH, S_IROTH, X S_IXGRP, S_IWGRP, S_IRGRP, X S_IXUSR, S_IWUSR, S_IRUSR X}; X X/* X * The maximum length of the perm string (including the final null byte) is 24. X * If all permission related mode bits are set, the generated string will X * be: "u=srwx,g=srwx,o=rwx,a+t". X */ X#ifdef PROTOTYPES XEXPORT void Xpermtostr(register mode_t mode, char *s) X#else XEXPORT void Xpermtostr(mode, s) X register mode_t mode; X char *s; X#endif X{ X register char *mstr = "xwrxwrxwr"; X register char *str = s; X register int i; X X for (i = 9; --i >= 0; ) { X if (i % 3 == 2) { X if (str > s) X *str++ = ','; X *str++ = "ogu"[i/3]; X *str++ = '='; X if (i == 8 && mode & S_ISUID) X *str++ = 's'; X if (i == 5 && mode & S_ISGID) X *str++ = 's'; X } X if (mode & modebits[i]) X *str++ = mstr[i]; X } X if (mode & S_ISVTX) { X *str++ = ','; X *str++ = 'a'; X *str++ = '+'; X *str++ = 't'; X } X *str = '\0'; X} END-of-star-1.6/libschily/permtostr.c echo x - star-1.6/libschily/getgrent.c sed 's/^X//' >star-1.6/libschily/getgrent.c << 'END-of-star-1.6/libschily/getgrent.c' X/* @(#)getgrent.c 1.1 11/07/12 Copyright 2011 J. Schilling */ X/* X * Group functions for platforms (like MINGW) that do not have them. X * X * Copyright (c) 2011 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X X#if !defined(HAVE_GETGRNAM) && !defined(HAVE_GETGRENT) && \ X !defined(HAVE_GETGRGID) && !defined(HAVE_SETGRENT) && \ X !defined(HAVE_ENDGRENT) X XLOCAL FILE *grpf; XLOCAL char *list[16+1]; XLOCAL struct group grp; XLOCAL struct group rootgrp = { "root", "*", 0, list }; XLOCAL char grpbuf[128]; X XLOCAL struct group *mkgrp __PR((char *arr[])); XLOCAL struct group *findgrent __PR((const char *string, int field)); X X XEXPORT struct group * Xgetgrent() X{ X char *arr[7]; X X if (grpf == (FILE *)NULL) { X grpf = fileopen("/etc/group", "r"); X if (grpf == (FILE *)NULL) X return ((struct group *)0); X } X if (fgetline(grpf, grpbuf, sizeof (grpbuf)) == EOF) X return ((struct group *)0); X breakline(grpbuf, ':', arr, 7); X return (mkgrp(arr)); X} X XEXPORT void Xsetgrent() X{ X if (grpf == (FILE *)NULL) { X grpf = fileopen("/etc/group", "r"); X if (grpf == (FILE *)NULL) X return; X } X fileseek(grpf, (off_t)0); X} X XEXPORT void Xendgrent() X{ X if (grpf != (FILE *)NULL) { X fclose(grpf); X grpf = (FILE *)NULL; X } X} X XEXPORT struct group * Xgetgrnam(name) X const char *name; X{ X setgrent(); X if (grpf == (FILE *)NULL) { X list[0] = NULL; X if (streql(rootgrp.gr_name, name)) X return (&rootgrp); X return ((struct group *)0); X } X return (findgrent(name, 0)); X} X XEXPORT struct group * Xgetgrgid(gid) X gid_t gid; X{ X char sgid[32]; X X setgrent(); X if (grpf == (FILE *)NULL) { X list[0] = NULL; X if (gid == 0) X return (&rootgrp); X return ((struct group *)0); X } X js_snprintf(sgid, sizeof (sgid), "%lld", (Llong)gid); X return (findgrent(sgid, 2)); X} X XLOCAL struct group * Xmkgrp(arr) X char *arr[]; X{ X long l; X X grp.gr_name = arr[0]; X grp.gr_passwd = arr[1]; X (void) astolb(arr[2], &l, 10); X grp.gr_gid = l; X l = breakline(arr[3], ',', list, 16); X list[l] = NULL; X if (list[0][0] == '\0') X list[0] = NULL; X grp.gr_mem = list; X return (&grp); X} X XLOCAL struct group * Xfindgrent(string, field) X const char *string; X int field; X{ X char *arr[7]; X X for (;;) { X if (fgetline(grpf, grpbuf, sizeof (grpbuf)) == EOF) X return ((struct group *)0); X breakline(grpbuf, ':', arr, 7); X if (streql(string, arr[field])) X return (mkgrp(arr)); X } X} X X#endif END-of-star-1.6/libschily/getgrent.c echo x - star-1.6/libschily/uid.c sed 's/^X//' >star-1.6/libschily/uid.c << 'END-of-star-1.6/libschily/uid.c' X/* @(#)uid.c 1.1 11/07/11 Copyright 2011 J. Schilling */ X/* X * Dummy functions for uid handling, used e.g. on MINGW X * X * Copyright (c) 2011 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X X#ifndef HAVE_GETUID X XEXPORT uid_t Xgetuid() X{ X return (0); X} X X#endif X X#ifndef HAVE_GETEUID X XEXPORT uid_t Xgeteuid() X{ X return (0); X} X X#endif X X#ifndef HAVE_SETUID X XEXPORT int Xsetuid(uid) X uid_t uid; X{ X return (0); X} X X#endif X X#ifndef HAVE_SETEUID X XEXPORT int Xseteuid(uid) X uid_t uid; X{ X return (0); X} X X#endif END-of-star-1.6/libschily/uid.c echo x - star-1.6/libschily/gid.c sed 's/^X//' >star-1.6/libschily/gid.c << 'END-of-star-1.6/libschily/gid.c' X/* @(#)gid.c 1.1 11/07/11 Copyright 2011 J. Schilling */ X/* X * Dummy functions for gid handling, used e.g. on MINGW X * X * Copyright (c) 2011 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X X#ifndef HAVE_GETGID X XEXPORT gid_t Xgetgid() X{ X return (0); X} X X#endif X X#ifndef HAVE_GETEGID X XEXPORT gid_t Xgetegid() X{ X return (0); X} X X#endif X X#ifndef HAVE_SETGID X XEXPORT int Xsetgid(gid) X gid_t gid; X{ X return (0); X} X X#endif X X#ifndef HAVE_SETEGID X XEXPORT int Xsetegid(gid) X gid_t gid; X{ X return (0); X} X X#endif END-of-star-1.6/libschily/gid.c echo x - star-1.6/libschily/getpwent.c sed 's/^X//' >star-1.6/libschily/getpwent.c << 'END-of-star-1.6/libschily/getpwent.c' X/* @(#)getpwent.c 1.1 11/07/12 Copyright 2011 J. Schilling */ X/* X * Passwd functions for platforms (like MINGW) that do not have them. X * X * Copyright (c) 2011 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X X#if !defined(HAVE_GETPWNAM) && !defined(HAVE_GETPWENT) && \ X !defined(HAVE_GETPWUID) && !defined(HAVE_SETPWENT) && \ X !defined(HAVE_ENDPWENT) X X XLOCAL FILE *pwdf; XLOCAL struct passwd pwd; XLOCAL struct passwd rootpwd = { "root", "*", 0, 0, "", "/", "" }; XLOCAL char pwdbuf[128]; X XLOCAL struct passwd *mkpwd __PR((char *arr[])); XLOCAL struct passwd *findpwent __PR((const char *string, int field)); X XEXPORT struct passwd * Xgetpwent() X{ X char *arr[7]; X X if (pwdf == (FILE *)NULL) { X pwdf = fileopen("/etc/passwd", "r"); X if (pwdf == (FILE *)NULL) X return ((struct passwd *)0); X } X if (fgetline(pwdf, pwdbuf, sizeof (pwdbuf)) == EOF) X return ((struct passwd *)0); X breakline(pwdbuf, ':', arr, 7); X return (mkpwd(arr)); X} X XEXPORT void Xsetpwent() X{ X if (pwdf == (FILE *)NULL) { X pwdf = fileopen("/etc/passwd", "r"); X if (pwdf == (FILE *)NULL) X return; X } X fileseek(pwdf, (off_t)0); X} X XEXPORT void Xendpwent() X{ X if (pwdf != (FILE *)NULL) { X fclose(pwdf); X pwdf = (FILE *)NULL; X } X} X XEXPORT struct passwd * Xgetpwnam(name) X const char *name; X{ X setpwent(); X if (pwdf == (FILE *)NULL) { X if (streql(rootpwd.pw_name, name)) X return (&rootpwd); X return ((struct passwd *)0); X } X return (findpwent(name, 0)); X} X XEXPORT struct passwd * Xgetpwuid(uid) X uid_t uid; X{ X char suid[32]; X X setpwent(); X if (pwdf == (FILE *)NULL) { X if (uid == 0) X return (&rootpwd); X return ((struct passwd *)0); X } X js_snprintf(suid, sizeof (suid), "%lld", (Llong)uid); X return (findpwent(suid, 2)); X} X XLOCAL struct passwd * Xmkpwd(arr) X char *arr[]; X{ X long l; X X pwd.pw_name = arr[0]; X pwd.pw_passwd = arr[1]; X (void) astolb(arr[2], &l, 10); X pwd.pw_uid = l; X (void) astolb(arr[3], &l, 10); X pwd.pw_gid = l; X pwd.pw_gecos = arr[4]; X pwd.pw_dir = arr[5]; X pwd.pw_shell = arr[6]; X X return (&pwd); X} X XLOCAL struct passwd * Xfindpwent(string, field) X const char *string; X int field; X{ X char *arr[7]; X X for (;;) { X if (fgetline(pwdf, pwdbuf, sizeof (pwdbuf)) == EOF) X return ((struct passwd *)0); X breakline(pwdbuf, ':', arr, 7); X if (streql(string, arr[field])) X return (mkpwd(arr)); X } X} X X#endif END-of-star-1.6/libschily/getpwent.c echo x - star-1.6/libschily/zerobytes.c sed 's/^X//' >star-1.6/libschily/zerobytes.c << 'END-of-star-1.6/libschily/zerobytes.c' X/* @(#)zerobytes.c 1.2 11/07/30 Copyright Copyright 1987, 1995-2011 J. Schilling */ X/* X * fill memory with null bytes X * X * Copyright (c) 1987, 1995-2011 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X X#define DO8(a) a; a; a; a; a; a; a; a; X X/* X * zero(to, cnt) X */ XEXPORT char * Xzerobytes(tov, cnt) X void *tov; X ssize_t cnt; X{ X register char *to = (char *)tov; X register ssize_t n; X register long lval = 0L; X X /* X * If we change cnt to be unsigned, check for == instead of <= X */ X if ((n = cnt) <= 0) X return (to); X X if (n < 8 * sizeof (long)) { /* Simple may be faster... */ X do { /* n is always > 0 */ X *to++ = '\0'; X } while (--n > 0); X return (to); X } X X /* X * Assign byte-wise until properly aligned for a long pointer. X */ X while (--n >= 0 && !laligned(to)) { X *to++ = '\0'; X } X n++; X X if (n >= (ssize_t)(8 * sizeof (long))) { X register ssize_t rem = n % (8 * sizeof (long)); X X n /= (8 * sizeof (long)); X { X register long *tol = (long *)to; X X do { X DO8 (*tol++ = lval); X } while (--n > 0); X X to = (char *)tol; X } X n = rem; X X if (n >= 8) { X n -= 8; X do { X DO8 (*to++ = '\0'); X } while ((n -= 8) >= 0); X n += 8; X } X if (n > 0) do { X *to++ = '\0'; X } while (--n > 0); X return (to); X } X if (n > 0) do { X *to++ = '\0'; X } while (--n > 0); X return (to); X} END-of-star-1.6/libschily/zerobytes.c echo x - star-1.6/libschily/cmpmbytes.c sed 's/^X//' >star-1.6/libschily/cmpmbytes.c << 'END-of-star-1.6/libschily/cmpmbytes.c' X/* @(#)cmpmbytes.c 1.2 11/08/16 Copyright 1988, 1995-2011 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)cmpmbytes.c 1.2 11/08/16 Copyright 1988, 1995-2011 J. Schilling"; X#endif X/* X * compare data X * Return the difference from the first differing characters X * X * Copyright (c) 1988, 1995-2011 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X X#define DO8(a) a; a; a; a; a; a; a; a; X X/* X * Return the difference from the first differing characters X * This interface is compatible to memcmp() X */ XEXPORT int Xcmpmbytes(fromp, top, cnt) X const void *fromp; X const void *top; X ssize_t cnt; X{ X register const char *from = (char *)fromp; X register const char *to = (char *)top; X register ssize_t n; X register ssize_t i; X X /* X * If we change cnt to be unsigned, check for == instead of <= X */ X if ((n = cnt) <= 0) X return (0); X X /* X * Compare byte-wise until properly aligned for a long pointer. X */ X i = sizeof (long) - 1; X while (--n >= 0 && --i >= 0 && !l2aligned(from, to)) { X if (*to++ != *from++) X goto cdiff; X } X n++; X X if (n >= (ssize_t)(8 * sizeof (long))) { X if (l2aligned(from, to)) { X register const long *froml = (const long *)from; X register const long *tol = (const long *)to; X register ssize_t rem = n % (8 * sizeof (long)); X X n /= (8 * sizeof (long)); X do { X /* BEGIN CSTYLED */ X DO8( X if (*tol++ != *froml++) X break; X ); X /* END CSTYLED */ X } while (--n > 0); X X if (n > 0) { X --froml; X --tol; X to = (const char *)tol; X from = (const char *)froml; X goto ldiff; X } X to = (const char *)tol; X from = (const char *)froml; X n = rem; X } X X if (n >= 8) { X n -= 8; X do { X /* BEGIN CSTYLED */ X DO8( X if (*to++ != *from++) X goto cdiff; X ); X /* END CSTYLED */ X } while ((n -= 8) >= 0); X n += 8; X } X if (n > 0) do { X if (*to++ != *from++) X goto cdiff; X } while (--n > 0); X return (0); X } X if (n > 0) do { X if (*to++ != *from++) X goto cdiff; X } while (--n > 0); X return (0); Xldiff: X n = sizeof (long); X do { X if (*to++ != *from++) X goto cdiff; X } while (--n > 0); Xcdiff: X return (*((unsigned char *)--from) - *((unsigned char *)--to)); X} END-of-star-1.6/libschily/cmpmbytes.c echo x - star-1.6/libschily/uname.c sed 's/^X//' >star-1.6/libschily/uname.c << 'END-of-star-1.6/libschily/uname.c' X/* @(#)uname.c 1.2 11/08/16 Copyright 2011 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)uname.c 1.2 11/08/16 Copyright 2011 J. Schilling"; X#endif X/* X * uname() replacement in case it does not exist X * X * Copyright (c) 2011 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef HAVE_UNAME X X#include X#include X#include X#include X X#if defined(__MINGW32__) || defined(_MSC_VER) X#define gethostname __winsock_gethostname X#include X#undef gethostname X X/* X * cystyle believes BOOL is a function name and does not like: X * typedef BOOL (WINAPI *LPFN_ISWOW64PROCESS) (HANDLE, PBOOL); X */ Xtypedef BOOL(WINAPI *LPFN_ISWOW64PROCESS) (HANDLE, PBOOL); X XLOCAL BOOL Xiswow64() X{ X BOOL IsWow64 = FALSE; X LPFN_ISWOW64PROCESS IsWow64Processp; X X /* X * "IsWow64Process" is not supported on all platforms X */ X IsWow64Processp = (LPFN_ISWOW64PROCESS) X GetProcAddress(GetModuleHandle(TEXT("kernel32")), X "IsWow64Process"); X X if (IsWow64Processp) { X if (!IsWow64Processp(GetCurrentProcess(), &IsWow64)) X return (FALSE); X } X return (IsWow64 != 0); X} X XEXPORT int Xuname(ubuf) X struct utsname *ubuf; X{ X SYSTEM_INFO sysinfo; X uint32_t version; X uint32_t majversion; X uint32_t minversion; X uint32_t builtnum = 0; X char dbuf[16]; X char *p; X X strlcpy(ubuf->sysname, "Win32", sizeof (ubuf->sysname)); X if (iswow64()) X strlcat(ubuf->sysname, "-WOW64", sizeof (ubuf->sysname)); X X gethostname(ubuf->nodename, sizeof (ubuf->nodename)); X ubuf->nodename[sizeof (ubuf->nodename)-1] = '\0'; X X version = GetVersion(); X majversion = version & 0xFF; X minversion = (version >> 8) & 0xFF; X if (version < 0x80000000) X builtnum = (version >> 16) & 0xFFFF; X X strlcpy(ubuf->release, "NT-0.0", sizeof (ubuf->release)); X if (sizeof (ubuf->release) > 7) { X ubuf->release[3] = majversion + '0'; X ubuf->release[5] = minversion + '0'; X } X X p = &dbuf[sizeof (dbuf)-1]; X *p = '\0'; X do { X *--p = builtnum % 10 + '0'; X builtnum /= 10; X } while (builtnum > 0); X strlcpy(ubuf->version, p, sizeof (ubuf->version)); X X /* X * cpu, pagesize, numproc, ... X * See also IsWow64Process() X */ X GetSystemInfo(&sysinfo); X X switch (sysinfo.wProcessorArchitecture) { X#ifdef PROCESSOR_ARCHITECTURE_INTEL X case PROCESSOR_ARCHITECTURE_INTEL: X switch (sysinfo.dwProcessorType) { X X#ifdef PROCESSOR_INTEL_386 X case PROCESSOR_INTEL_386: X /* FALLTHRU */ X#endif X default: X strlcpy(ubuf->machine, "i386", sizeof (ubuf->machine)); X break; X#ifdef PROCESSOR_INTEL_486 X case PROCESSOR_INTEL_486: X strlcpy(ubuf->machine, "i486", sizeof (ubuf->machine)); X break; X#endif X#ifdef PROCESSOR_INTEL_PENTIUM X case PROCESSOR_INTEL_PENTIUM: { X int level = sysinfo.wProcessorLevel; X if (level > 9) X level = 6; X strlcpy(ubuf->machine, "i586", sizeof (ubuf->machine)); X if (level > 5) X ubuf->machine[1] = level + '0'; X } X break; X#endif X } X break; X#endif X#ifdef PROCESSOR_ARCHITECTURE_MIPS X case PROCESSOR_ARCHITECTURE_MIPS: X strlcpy(ubuf->machine, "mips", sizeof (ubuf->machine)); X break; X#endif X#ifdef PROCESSOR_ARCHITECTURE_ALPHA X case PROCESSOR_ARCHITECTURE_ALPHA: X strlcpy(ubuf->machine, "alpha", sizeof (ubuf->machine)); X break; X#endif X#ifdef PROCESSOR_ARCHITECTURE_PPC X case PROCESSOR_ARCHITECTURE_PPC: X strlcpy(ubuf->machine, "PPC", sizeof (ubuf->machine)); X break; X#endif X#ifdef PROCESSOR_ARCHITECTURE_SHX X case PROCESSOR_ARCHITECTURE_SHX: X strlcpy(ubuf->machine, "shx", sizeof (ubuf->machine)); X break; X#endif X#ifdef PROCESSOR_ARCHITECTURE_ARM X case PROCESSOR_ARCHITECTURE_ARM: X strlcpy(ubuf->machine, "arm", sizeof (ubuf->machine)); X break; X#endif X#ifdef PROCESSOR_ARCHITECTURE_IA64 X case PROCESSOR_ARCHITECTURE_IA64: X strlcpy(ubuf->machine, "ia64", sizeof (ubuf->machine)); X break; X#endif X#ifdef PROCESSOR_ARCHITECTURE_ALPHA64 X case PROCESSOR_ARCHITECTURE_ALPHA64: X strlcpy(ubuf->machine, "alpha64", sizeof (ubuf->machine)); X break; X#endif X#ifdef PROCESSOR_ARCHITECTURE_MSIL X case PROCESSOR_ARCHITECTURE_MSIL: X strlcpy(ubuf->machine, "msil", sizeof (ubuf->machine)); X break; X#endif X#ifdef PROCESSOR_ARCHITECTURE_AMD64 X case PROCESSOR_ARCHITECTURE_AMD64: X strlcpy(ubuf->machine, "amd64", sizeof (ubuf->machine)); X break; X#endif X#ifdef PROCESSOR_ARCHITECTURE_IA32_ON_WIN64 X case PROCESSOR_ARCHITECTURE_IA32_ON_WIN64: X strlcpy(ubuf->machine, "ia32_win64", sizeof (ubuf->machine)); X break; X#endif X default: X strlcpy(ubuf->machine, "unknown", sizeof (ubuf->machine)); X } X return (0); X} X X#else XEXPORT int Xuname(ubuf) X struct utsname *ubuf; X{ X strlcpy(ubuf->sysname, "unknown", sizeof (ubuf->sysname)); X strlcpy(ubuf->nodename, "unknown", sizeof (ubuf->nodename)); X strlcpy(ubuf->release, "unknown", sizeof (ubuf->release)); X strlcpy(ubuf->version, "unknown", sizeof (ubuf->version)); X X strlcpy(ubuf->machine, "unknown", sizeof (ubuf->machine)); X#ifdef mc68000 X#ifdef mc68020 X strlcpy(ubuf->machine, "mc68020", sizeof (ubuf->machine)); X#else X strlcpy(ubuf->machine, "mc68000", sizeof (ubuf->machine)); X#endif X#endif X#if defined(__sparc) || defined(sparc) X strlcpy(ubuf->machine, "sparc", sizeof (ubuf->machine)); X#endif X#if defined(__i386__) || defined(__i386) || defined(i386) X#if defined(__amd64__) || defined(__amd64) X strlcpy(ubuf->machine, "amd64", sizeof (ubuf->machine)); X#else X strlcpy(ubuf->machine, "i386", sizeof (ubuf->machine)); X#endif X#endif X return (0); X} X#endif X X#endif /* HAVE_UNAME */ END-of-star-1.6/libschily/uname.c echo x - star-1.6/libschily/dirent.c sed 's/^X//' >star-1.6/libschily/dirent.c << 'END-of-star-1.6/libschily/dirent.c' X/* @(#)dirent.c 1.4 17/02/02 Copyright 2011-2017 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)dirent.c 1.4 17/02/02 Copyright 2011-2017 J. Schilling"; X#endif X/* X * Copyright (c) 2011-2017 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X X#ifdef NEED_READDIR X X#if defined(__MINGW32__) || defined(_MSC_VER) X X#include X#include X#include X XEXPORT DIR *opendir __PR((const char *)); XEXPORT int closedir __PR((DIR *)); XEXPORT struct dirent *readdir __PR((DIR *)); X XEXPORT DIR * Xopendir(dname) X const char *dname; X{ X char path[PATH_MAX]; X size_t len; X uint32_t attr; X DIR *dp; X X if (dname == NULL) { X seterrno(EFAULT); X return ((DIR *)0); X } X len = strlen(dname); X if (len > PATH_MAX) { X seterrno(ENAMETOOLONG); X return ((DIR *)0); X } X if (len == 0) { X seterrno(ENOENT); X return ((DIR *)0); X } X X attr = GetFileAttributes(dname); X if (attr == INVALID_FILE_ATTRIBUTES || X (attr & FILE_ATTRIBUTE_DIRECTORY) == 0) { X seterrno(ENOTDIR); X return ((DIR *)0); X } X path[0] = '\0'; X _fullpath(path, dname, PATH_MAX); X len = strlen(path); X if (len == 0) { X seterrno(ENOENT); X return ((DIR *)0); X } X X dp = malloc(sizeof (*dp) + len + 2); /* Add 2 for "/ *" */ X if (dp == NULL) { X seterrno(ENOMEM); X return ((DIR *)0); X } X strcpy(dp->dd_dirname, path); X if (dp->dd_dirname[len-1] != '/' && X dp->dd_dirname[len-1] != '\\') { X dp->dd_dirname[len] = '\\'; X len++; X } X dp->dd_dirname[len++] = '*'; X dp->dd_dirname[len] = '\0'; X dp->dd_handle = -1; X dp->dd_state = 0; X X dp->dd_dir.d_ino = 0; X dp->dd_dir.d_reclen = 0; X dp->dd_dir.d_namlen = 0; X zerobytes(dp->dd_dir.d_name, sizeof (dp->dd_dir.d_name)); X X return (dp); X} X XEXPORT int Xclosedir(dp) X DIR *dp; X{ X int ret = 0; X X if (dp == NULL) { X seterrno(EFAULT); X return (-1); X } X if (dp->dd_handle != -1) { X ret = _findclose(dp->dd_handle); X } X free(dp); X X return (ret); X} X XEXPORT struct dirent * Xreaddir(dp) X DIR *dp; X{ X if (dp == NULL) { X seterrno(EFAULT); X return ((struct dirent *)0); X } X if (dp->dd_state == (char)-1) { X return ((struct dirent *)0); X } else if (dp->dd_state == (char)0) { X dp->dd_handle = _findfirst(dp->dd_dirname, &(dp->dd_data)); X if (dp->dd_handle != -1) X dp->dd_state = 1; X else X dp->dd_state = -1; X } else { X if (_findnext(dp->dd_handle, &(dp->dd_data))) { X uint32_t werrno = GetLastError(); X X if (werrno == ERROR_NO_MORE_FILES) X seterrno(0); X _findclose(dp->dd_handle); X dp->dd_handle = -1; X dp->dd_state = -1; X } else { X dp->dd_state = 1; /* state++ to support seekdir */ X } X } X if (dp->dd_state > 0) { X strlcpy(dp->dd_dir.d_name, dp->dd_data.name, X sizeof (dp->dd_dir.d_name)); X X return (&dp->dd_dir); X } X return ((struct dirent *)0); X} X X#endif /* defined(__MINGW32__) || defined(_MSC_VER) */ X X#endif /* NEED_READDIR */ END-of-star-1.6/libschily/dirent.c echo x - star-1.6/libschily/kill.c sed 's/^X//' >star-1.6/libschily/kill.c << 'END-of-star-1.6/libschily/kill.c' X/* @(#)kill.c 1.1 11/08/05 Copyright 2011 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)kill.c 1.1 11/08/05 Copyright 2011 J. Schilling"; X#endif X/* X * Copyright (c) 2011 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef HAVE_KILL X X#include X#include X#include X#include X XEXPORT int kill __PR((pid_t pid, int sig)); X X#if defined(__MINGW32__) || defined(_MSC_VER) X#include X#include X#include X X#pragma comment(lib, "Psapi.lib") X XLOCAL int have_pid __PR((pid_t pid)); X X#define MAX_PIDS 1024 X XLOCAL int Xhave_pid(pid) X pid_t pid; X{ X uint32_t procs[MAX_PIDS]; X uint32_t nents; X int i; X X if (pid == 0) X return (0); X X if (!EnumProcesses(procs, sizeof (procs), &nents)) { X seterrno(ESRCH); X return (-1); X } X nents /= sizeof (uint32_t); X X for (i = 0; i < nents; i++) { X if (pid == procs[i]) X return (0); X } X seterrno(ESRCH); X return (-1); X} X XEXPORT int Xkill(pid, sig) X pid_t pid; X int sig; X{ X if (sig != 0) { X seterrno(ENOSYS); X return (-1); X } X return (have_pid(pid)); X} X X#else /* defined(__MINGW32__) || defined(_MSC_VER) */ X XEXPORT int Xkill(pid, sig) X pid_t pid; X int sig; X{ X#ifdef ENOSYS X seterrno(ENOSYS); X#else X seterrno(EINVAL); X#endif X return (-1); X} X X#endif /* defined(__MINGW32__) || defined(_MSC_VER) */ X X#endif /* HAVE_KILL */ END-of-star-1.6/libschily/kill.c echo x - star-1.6/libschily/chown.c sed 's/^X//' >star-1.6/libschily/chown.c << 'END-of-star-1.6/libschily/chown.c' X/* @(#)chown.c 1.1 11/08/14 Copyright 2011 J. Schilling */ X/* X * Copyright (c) 2011 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X X#ifndef HAVE_CHOWN XEXPORT int Xchown(path, owner, group) X const char *path; X uid_t owner; X gid_t group; X{ X return (0); /* Fake success */ X} X#endif END-of-star-1.6/libschily/chown.c echo x - star-1.6/libschily/getdtablesize.c sed 's/^X//' >star-1.6/libschily/getdtablesize.c << 'END-of-star-1.6/libschily/getdtablesize.c' X/* @(#)getdtablesize.c 1.2 13/12/26 Copyright 2011-2013 J. Schilling */ X/* X * Copyright (c) 2011-2013 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X X#ifndef HAVE_GETDTABLESIZE XEXPORT int Xgetdtablesize() X{ X#ifdef RLIMIT_NOFILE X struct rlimit rlim; X X getrlimit(RLIMIT_NOFILE, &rlim); X return (rlim.rlim_cur); X#else /* RLIMIT_NOFILE */ X#if defined(_MSC_VER) || defined(__MINGW32__) X return (2048); X#else X#ifdef OPEN_MAX X return (OPEN_MAX); X#else X return (20); X#endif X#endif X#endif /* RLIMIT_NOFILE */ X} X#endif END-of-star-1.6/libschily/getdtablesize.c echo x - star-1.6/libschily/getlogin.c sed 's/^X//' >star-1.6/libschily/getlogin.c << 'END-of-star-1.6/libschily/getlogin.c' X/* @(#)getlogin.c 1.1 11/08/14 Copyright 2011 J. Schilling */ X/* X * Copyright (c) 2011 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X X#ifndef HAVE_GETLOGIN XEXPORT char * Xgetlogin() X{ X return ("root"); X} X#endif END-of-star-1.6/libschily/getlogin.c echo x - star-1.6/libschily/mkstemp.c sed 's/^X//' >star-1.6/libschily/mkstemp.c << 'END-of-star-1.6/libschily/mkstemp.c' X/* @(#)mkstemp.c 1.2 14/05/15 Copyright 2011-2014 J. Schilling */ X/* X * Copyright (c) 2011-2014 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X#include X X#ifndef HAVE_MKSTEMP XEXPORT int Xmkstemp(path) X char *path; X{ X#ifdef HAVE_MKTEMP X mktemp(path); X return (open(path, O_CREAT|O_EXCL|O_RDWR, S_IRUSR|S_IWUSR)); X#else X#ifdef ENOSYS X seterrno(ENOSYS); X#else X seterrno(EINVAL); X#endif X return (-1); X#endif X} X#endif END-of-star-1.6/libschily/mkstemp.c echo x - star-1.6/libschily/strstr.c sed 's/^X//' >star-1.6/libschily/strstr.c << 'END-of-star-1.6/libschily/strstr.c' X/* @(#)strstr.c 1.3 13/11/11 Copyright 1985-2013 J. Schilling */ X/* X * find string s2 in string s1 X * return NULL if s2 is not found X * otherwise return pointer of first occurrence of s2 in s1 X * X * Copyright (c) 1985-2013 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X#include X#include X X#ifndef HAVE_STRSTR X XEXPORT char * Xstrstr(s1, s2) X register const char *s1; X const char *s2; X{ X register const char *a; X register const char *b; X X if (*s2 == '\0') X return ((char *)s1); X X for (; *s1 != '\0'; s1++) { X for (a = s2, b = s1; *a == *b++; ) { X if (*a++ == '\0') X return ((char *)s1); X } X if (*a == '\0') X return ((char *)s1); X } X return ((char *)NULL); X} X X#endif END-of-star-1.6/libschily/strstr.c echo x - star-1.6/libschily/wcsstr.c sed 's/^X//' >star-1.6/libschily/wcsstr.c << 'END-of-star-1.6/libschily/wcsstr.c' X/* @(#)wcsstr.c 1.3 13/11/11 Copyright 1985-2013 J. Schilling */ X/* X * find string s2 in string s1 X * return NULL if s2 is not found X * otherwise return pointer of first occurrence of s2 in s1 X * X * Copyright (c) 1985-2013 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X#include X#include X#include X X#ifndef HAVE_WCSSTR X XEXPORT wchar_t * Xwcsstr(s1, s2) X register const wchar_t *s1; X const wchar_t *s2; X{ X register const wchar_t *a; X register const wchar_t *b; X X if (*s2 == '\0') X return ((wchar_t *)s1); X X for (; *s1 != '\0'; s1++) { X for (a = s2, b = s1; *a == *b++; ) { X if (*a++ == '\0') X return ((wchar_t *)s1); X } X if (*a == '\0') X return ((wchar_t *)s1); X } X return ((wchar_t *)NULL); X} X X#endif END-of-star-1.6/libschily/wcsstr.c echo x - star-1.6/libschily/abspath.c sed 's/^X//' >star-1.6/libschily/abspath.c << 'END-of-star-1.6/libschily/abspath.c' X/* @(#)abspath.c 1.5 13/10/30 Copyright 2011-2013 J. Schilling */ X/* X * Compute the absolute path for a relative path name X * X * Copyright (c) 2011-2013 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X#include X XEXPORT char *abspath __PR((const char *relp, char *absp, size_t asize)); XEXPORT char *absnpath __PR((const char *relp, char *absp, size_t asize)); XLOCAL char *pathabs __PR((const char *relp, char *absp, size_t asize, int flags)); XLOCAL void ashorten __PR((char *name)); X X/* X * Expands a relative pathname to a full (absolute) pathname. X */ XEXPORT char * Xabspath(relp, absp, asize) X const char *relp; X char *absp; X size_t asize; X{ X return (pathabs(relp, absp, asize, RSPF_EXIST)); X} X X/* X * Expands a relative pathname to a full (absolute) pathname. X * Not all path elements need to exist. X */ XEXPORT char * Xabsnpath(relp, absp, asize) X const char *relp; X char *absp; X size_t asize; X{ X return (pathabs(relp, absp, asize, 0)); X} X X/* X * Expands a relative pathname to a full (absolute) pathname. X * The behavior may be controlled via flags. X */ XEXPORT char * Xabsfpath(relp, absp, asize, flags) X const char *relp; X char *absp; X size_t asize; X int flags; X{ X return (pathabs(relp, absp, asize, flags)); X} X X/* X * Expands a relative pathname to a full (absolute) pathname. X */ XLOCAL char * Xpathabs(relp, absp, asize, flags) X const char *relp; X char *absp; X size_t asize; X int flags; X{ X register char *rel; X register char *full; X int ret; X X ret = resolvefpath(relp, absp, asize, flags); X if (ret < 0) X return (NULL); /* errno set by resolvepath() */ X if (ret >= asize) { X seterrno(ERANGE); X return (NULL); X } X if (absp[0] == '/') X return (absp); X X if (absp[0] == '.' && absp[1] == '\0') X return (getcwd(absp, asize)); /* Working directory. */ X X { int len = strlen(absp)+1; X#ifdef HAVE_DYN_ARRAYS X char tbuf[len]; X#else X char *tbuf = malloc(len); X if (tbuf == NULL) X return (NULL); X#endif X strcpy(tbuf, absp); X absp[0] = '\0'; X full = getcwd(absp, asize); /* Working directory. */ X X if (full && strlcat(full, "/", asize) >= asize) { X seterrno(ERANGE); X full = NULL; X } X if (full && strlcat(full, tbuf, asize) >= asize) { X seterrno(ERANGE); X full = NULL; X } X X#ifndef HAVE_DYN_ARRAYS X free(tbuf); X#endif X if (full == NULL) X return (full); X } X rel = full; X for (;;) { X for (;;) { X rel = strchr(++rel, '/'); X if (rel == NULL) X break; X if (rel[1] == '/' || rel[1] == '\0') { X *rel++ = '\0'; X /* CSTYLED */ X /* /foo//bar = /foo/bar */ X while (rel[0] == '/') X rel++; X break; X } X if (rel[1] == '.') { X /* /foo/./bar = /foo/bar */ X if (rel[2] == '/') { X *rel = '\0'; X rel += 3; X break; X } X /* /foo/. = /foo */ X if (rel[2] == '\0') { X *rel = '\0'; X rel += 2; X break; X } X if (rel[2] == '.') { X /* /foo/../bar = /bar */ X if (rel[3] == '/') { X *rel = '\0'; X rel += 4; X ashorten(full); X break; X } X /* /foo/bar/.. = /foo */ X if (rel[3] == '\0') { X *rel = '\0'; X ashorten(full); X break; X } X } X } X } X if (rel == NULL || rel[0] == '\0') X break; X X#ifdef DEBUG X printf("%s / %s\n", full, rel); X#endif X if (strlcat(full, "/", asize) >= asize) { X seterrno(ERANGE); X return (NULL); X } X if (strlcat(full, rel, asize) >= asize) { X seterrno(ERANGE); X return (NULL); X } X rel = full; X } X if (full[1] == '.' && full[2] == '\0') /* /. = / */ X full[1] = '\0'; X return (full); X} X X/* X * Removes last path name component in absolute path name. X */ XLOCAL void Xashorten(name) X register char *name; X{ X register char *p; X X for (p = name++; *p++ != '\0'; ); X while (p > name) X if (*--p == '/') X break; X *p = '\0'; X} END-of-star-1.6/libschily/abspath.c echo x - star-1.6/libschily/at-defs.h sed 's/^X//' >star-1.6/libschily/at-defs.h << 'END-of-star-1.6/libschily/at-defs.h' X/* @(#)at-defs.h 1.3 18/07/23 Copyright 2011-2018 J. Schilling */ X/* X * Libschily internal definitions for openat() emulation X * and related functions. X * X * Copyright (c) 2011-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X#ifndef _AT_DEFS_H X X/* X * This is a list of errors that are expected to be not a result of X * a /proc fs problem. If such an error is encountered, then we return X * after the open() or other call without trying to emulate the *at() X * interface via savewd()/fchdir()/doit()/restorewd(). X */ X#ifdef ENOSYS X#define __ENOSYS ENOSYS X#else X#define __ENOSYS EPERM X#endif X#ifdef EOPNOTSUPP X#define __EOPNOTSUPP EOPNOTSUPP X#else X#define __EOPNOTSUPP EPERM X#endif X X/* X * XXX: Should we include ENOENT here as our emulation needs X * XXX: to be able to emulate openat(fd, name, O_CREAT, 666) or X * XXX: mknodat(fd, name, mode, dev). X * XXX: Since /proc uses symlinks, it should be safe. X */ X#define NON_PROCFS_ERRNO(e) \ X ((e) == ENOENT || (e) == ENOTDIR || \ X (e) == EACCES || (e) == EPERM || \ X (e) == __ENOSYS /* Solaris */ || \ X (e) == __EOPNOTSUPP /* FreeBSD */) X X/* X * n refers to an absolute path name. X */ X#define ABS_NAME(n) ((n)[0] == '/') X X#ifdef min X#undef min X#endif X#define min(a, b) ((a) < (b) ? (a):(b)) X X#ifdef max X#undef max X#endif X#define max(a, b) ((a) < (b) ? (b):(a)) X X/* X * From procnameat.c X */ Xextern char *proc_fd2name __PR((char *buf, int fd, const char *name)); X X/* X * From wdabort.c X */ Xextern void savewd_abort __PR((int err)); Xextern void fchdir_abort __PR((int err)); Xextern void restorewd_abort __PR((int err)); X X#ifdef HAVE_LARGEFILES X#define fstatat fstatat64 X#define openat openat64 X#endif X X#endif /* _AT_DEFS_H */ END-of-star-1.6/libschily/at-defs.h echo x - star-1.6/libschily/fchdir.c sed 's/^X//' >star-1.6/libschily/fchdir.c << 'END-of-star-1.6/libschily/fchdir.c' X/* @(#)fchdir.c 1.2 11/10/21 Copyright 2011 J. Schilling */ X/* X * Emulate the behavior of fchdir(fd) X * X * Copyright (c) 2011 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X#include X#include X#include "at-defs.h" X X#ifndef HAVE_FCHDIR X X#define DN_SIZE 256 XLOCAL char *dnames[DN_SIZE]; X XEXPORT int Xfchdir(fd) X int fd; X{ X if (fd < 0) { X seterrno(EBADF); X return (-1); X } X if (fd >= DN_SIZE) { X seterrno(ENOTDIR); X return (-1); X } X if (dnames[fd] == NULL) { X seterrno(ENOTDIR); X return (-1); X } X return (lxchdir(dnames[fd])); X} X XEXPORT int Xfdsetname(fd, name) X int fd; X const char *name; X{ X if (fd < 0) { X seterrno(EBADF); X return (-1); X } X if (fd >= DN_SIZE) X return (-1); X X { X char buf[max(8192, PATH_MAX+1)]; X X if (abspath(name, buf, sizeof (buf)) == NULL) { X return (-1); X } X if (dnames[fd] != NULL) X free(dnames[fd]); X dnames[fd] = strdup(buf); X if (dnames[fd] == NULL) X return (-1); X } X X return (0); X} X XEXPORT int Xfdclosename(fd) X int fd; X{ X if (fd < 0) { X seterrno(EBADF); X return (-1); X } X if (fd >= DN_SIZE) X return (-1); X X if (dnames[fd] != NULL) X free(dnames[fd]); X dnames[fd] = NULL; X return (0); X} X X#else /* HAVE_FCHDIR */ X X#undef fdsetname X#undef fdclosename X Xextern int fdsetname __PR((int fd, const char *name)); Xextern int fdclosename __PR((int fd)); X X/* ARGSUSED */ XEXPORT int Xfdsetname(fd, name) X int fd; X const char *name; X{ X return (0); X} X X/* ARGSUSED */ XEXPORT int Xfdclosename(fd) X int fd; X{ X return (0); X} X#endif /* HAVE_FCHDIR */ END-of-star-1.6/libschily/fchdir.c echo x - star-1.6/libschily/wdabort.c sed 's/^X//' >star-1.6/libschily/wdabort.c << 'END-of-star-1.6/libschily/wdabort.c' X/* @(#)wdabort.c 1.1 11/10/21 Copyright 2011 J. Schilling */ X/* X * Functions to abort after problems in directory handling. X * X * Copyright (c) 2011 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include "at-defs.h" X Xvoid Xsavewd_abort(err) X int err; X{ X comerrno(err, "Cannot save current working directory.\n"); X} X Xvoid Xfchdir_abort(err) X int err; X{ X comerrno(err, "Cannot completely chdir() to new directory.\n"); X} X Xvoid Xrestorewd_abort(err) X int err; X{ X comerrno(err, "Cannot restore current working directory.\n"); X} END-of-star-1.6/libschily/wdabort.c echo x - star-1.6/libschily/savewd.c sed 's/^X//' >star-1.6/libschily/savewd.c << 'END-of-star-1.6/libschily/savewd.c' X/* @(#)savewd.c 1.3 18/05/30 Copyright 2004-2018 J. Schilling */ X/* X * Save and restore working directory. X * X * The code has been adopted from libfind. X * X * Copyright (c) 2004-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X#include X#include X#include "at-defs.h" X XEXPORT int savewd __PR((struct save_wd *sp)); XEXPORT void closewd __PR((struct save_wd *sp)); XEXPORT int restorewd __PR((struct save_wd *sp)); X X XEXPORT int Xsavewd(sp) X struct save_wd *sp; X{ X sp->fd = -1; X sp->name = NULL; X#ifdef HAVE_FCHDIR X /* X * Note that we do not need O_RDONLY as we do not like to X * run readdir() on that directory but just fchdir(). X */ X if ((sp->fd = open(".", O_SEARCH|O_DIRECTORY|O_NDELAY)) >= 0) { X#ifdef F_SETFD X (void) fcntl(sp->fd, F_SETFD, FD_CLOEXEC); X#endif X return (0); X } X#endif X { X char buf[max(8192, PATH_MAX+1)]; X X if (getcwd(buf, sizeof (buf)) == NULL) { X return (-1); X } X sp->name = strdup(buf); X if (sp->name == NULL) X return (-1); X } X return (0); X} X XEXPORT void Xclosewd(sp) X struct save_wd *sp; X{ X if (sp->fd >= 0) X close(sp->fd); X if (sp->name != NULL) X free(sp->name); X sp->fd = -1; X sp->name = NULL; X} X XEXPORT int Xrestorewd(sp) X struct save_wd *sp; X{ X#ifdef HAVE_FCHDIR X if (sp->fd >= 0) X return (fchdir(sp->fd)); X#endif X if (sp->name != NULL) X return (lxchdir(sp->name)); X X seterrno(EINVAL); X return (-1); X} END-of-star-1.6/libschily/savewd.c echo x - star-1.6/libschily/openat.c sed 's/^X//' >star-1.6/libschily/openat.c << 'END-of-star-1.6/libschily/openat.c' X/* @(#)openat.c 1.3 18/07/16 Copyright 2011-2018 J. Schilling */ X/* X * Emulate the behavior of openat(fd, name, flag, mode) X * X * Note that emulation methods that do not use the /proc filesystem are X * not MT safe. In the non-MT-safe case, we do: X * X * savewd()/fchdir()/open(name)/restorewd() X * X * Since the /proc method may fail with ENAMETOOLONG, we need to fall back X * to the fchdir() method in case of long path names and as a result are X * not MT-safe with long path names. X * X * Errors may force us to abort the program as our caller is not expected X * to know that we do more than a simple open() here and that the X * working directory may be changed by us. X * X * Copyright (c) 2011-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X#include X#include X#include "at-defs.h" X X#ifndef HAVE_OPENAT X X#ifndef ENAMETOOLONG X#define ENAMETOOLONG EINVAL X#endif X X/* VARARGS3 */ X#ifdef PROTOTYPES XEXPORT int Xopenat(int fd, const char *name, int oflag, ...) X#else XEXPORT int Xopenat(fd, name, oflag, va_alist) X int fd; X const char *name; X int oflag; X va_dcl X#endif X{ X va_list args; X mode_t omode = 0; X int n; X int ret; X char buf[PATH_MAX]; X char *proc_name; X struct save_wd save_wd; X X if (oflag & O_CREAT) { X#ifdef PROTOTYPES X va_start(args, oflag); X#else X va_start(args); X#endif X /* X * If sizeof (mode_t) is < sizeof (int) and used with va_arg(), X * GCC4 will abort the code. So we need to use the promoted X * size. X */ X omode = va_arg(args, PROMOTED_MODE_T); X va_end(args); X } X if (fd == AT_FDCWD || ABS_NAME(name)) X return (open(name, oflag, omode)); X X if ((proc_name = proc_fd2name(buf, fd, name)) != NULL) { X /* X * The next open() frequently results in ENAMETOOLONG X */ X ret = open(proc_name, oflag, omode); X if (ret >= 0 || NON_PROCFS_ERRNO(errno)) X return (ret); X } X X /* X * /proc open failed or /proc not available on this platform. X * Give it a chance using fchdir(). But the following code is X * not MT-safe! X */ X X if (savewd(&save_wd) < 0) { X /* X * We abort here as the caller may not know that we are forced X * to savewd/fchdir/restorewd here and misinterpret errno. X */ X savewd_abort(geterrno()); X /* NOTREACHED */ X return (-1); X } X if (fd >= 0 && save_wd.fd == fd) { X /* X * If we just opened "fd" with the same number in savewd(), fd X * must have been illegal when calling openat(); X */ X closewd(&save_wd); X seterrno(EBADF); X return (-1); X } X if ((n = fchdir(fd)) < 0) { X int err = geterrno(); X /* X * In case that fchdir() is emulated via chdir() and we use a X * multi hop chdir(), we may be on an undefined intermediate X * directory. Try to return to last working directory and if X * this fails, abort for security. X */ X if (n == -2 && restorewd(&save_wd) < 0) { X restorewd_abort(geterrno()); X } X closewd(&save_wd); X seterrno(err); X return (-1); X } X X ret = open(name, oflag, omode); /* The actual open() */ X X if (restorewd(&save_wd) < 0) { X int err = geterrno(); X X close(ret); X closewd(&save_wd); X restorewd_abort(err); X seterrno(err); X return (-1); X } X closewd(&save_wd); X X return (ret); X} X X#endif /* HAVE_OPENAT */ END-of-star-1.6/libschily/openat.c echo x - star-1.6/libschily/lxchdir.c sed 's/^X//' >star-1.6/libschily/lxchdir.c << 'END-of-star-1.6/libschily/lxchdir.c' X/* @(#)lxchdir.c 1.1 11/10/21 Copyright 2004-2011 J. Schilling */ X/* X * Long path name aware chdir(). X * X * The code has been adopted from libfind. X * X * Copyright (c) 2004-2011 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X#include X#include X#include "at-defs.h" X X#ifndef ENAMETOOLONG X#define ENAMETOOLONG EINVAL X#endif X XEXPORT int lxchdir __PR((char *p)); XLOCAL int xchdir __PR((char *p)); X XEXPORT int Xlxchdir(p) X char *p; X{ X if (chdir(p) < 0) { X if (geterrno() != ENAMETOOLONG) X return (-1); X X return (xchdir(p)); X } X return (0); X} X XLOCAL int Xxchdir(p) X char *p; X{ X char *p2; X BOOL first = TRUE; X X while (*p) { X if ((p2 = strchr(p, '/')) != NULL) X *p2 = '\0'; X X if (first && p2 && p[0] == '\0') { X if (chdir("/") < 0) X return (-1); X } else { X /* X * If this is not the first chdir() and we are doing a X * multi hop chdir(), we may be on an undefined X * intermediate directory. Mark this case by returning X * -2 instead of -1. X */ X if (chdir(p) < 0) X return (first?-1:-2); X } X if (p2 == NULL) X break; X *p2 = '/'; X p = &p2[1]; X first = FALSE; X } X return (0); X} END-of-star-1.6/libschily/lxchdir.c echo x - star-1.6/libschily/procnameat.c sed 's/^X//' >star-1.6/libschily/procnameat.c << 'END-of-star-1.6/libschily/procnameat.c' X/* @(#)procnameat.c 1.3 18/07/16 Copyright 2011-2018 J. Schilling */ X/* X * Return a path name for a /proc related access to fd/name if possible. X * X * We need to test this at runtime in order to avoid incorrect behavior X * from running a program on a newer OS that it has been compiled for. X * There are also platforms like FreeBSD where mounting /proc is optioonal. X * X ************** X * NOTE: The entries /proc/self/{fd|path}/%d are symlinks and thus do X * not allow to access paths of unlimited length as possible X * with a real openat(fd, name, flags) call. X ************** X * X * If our caller falls back to the fchdir() method, e.g. because we X * did not detect /proc, or because /proc/self/{fd|path}/%d results X * in ENAMETOOLONG, the resulting code is no longer MT-safe. X * X * Copyright (c) 2011-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X#include X#include "at-defs.h" X X#ifndef ENAMETOOLONG X#define ENAMETOOLONG EINVAL X#endif X X#define PROC_SELF_PATH_FORMAT "/proc/self/path/%d/%s" /* Newer procfs */ X#define PROC_SELF_FD_FORMAT "/proc/self/fd/%d/%s" /* Older procfs */ X#define PROC_PID_FD_FORMAT "/proc/%ld/fd/%d/%s" /* AIX has no self */ X X#define PT_SELF_PATH 1 X#define PT_SELF_FD 2 X#define PT_PID_FD 3 X Xchar * Xproc_fd2name(buf, fd, name) X char *buf; X int fd; X const char *name; X{ Xstatic int proc_type; X X if (proc_type == 0) { X int proc_fd; X X /* X * First test the newer feature as the older /proc/self/fd/%d X * feature is still available on newer systems. X */ X proc_fd = open("/proc/self/path", O_SEARCH); X if (proc_fd >= 0) { X proc_type = PT_SELF_PATH; X close(proc_fd); X } else { X proc_fd = open("/proc/self/fd", O_SEARCH); X if (proc_fd >= 0) { X proc_type = PT_SELF_FD; X close(proc_fd); X } else { X js_snprintf(buf, PATH_MAX, X "/proc/%ld/fd", (long)getpid()); X proc_fd = open(buf, O_SEARCH); X if (proc_fd >= 0) { X proc_type = PT_PID_FD; X close(proc_fd); X } else { X /* X * No /proc fs found X */ X proc_type = -1; X seterrno(0); X return ((char *)0); X } X } X } X } else if (proc_type < 0) { X /* X * No /proc fs found X */ X seterrno(0); X return ((char *)0); X } X if (proc_type == PT_PID_FD) { X if (js_snprintf(buf, PATH_MAX, X PROC_PID_FD_FORMAT, X (long)getpid(), fd, name) >= PATH_MAX) { X seterrno(ENAMETOOLONG); X return (NULL); X } X } else if (js_snprintf(buf, PATH_MAX, X proc_type == PT_SELF_PATH ? X PROC_SELF_PATH_FORMAT : X PROC_SELF_FD_FORMAT, X fd, name) >= PATH_MAX) { X seterrno(ENAMETOOLONG); X return (NULL); X } X return (buf); X} END-of-star-1.6/libschily/procnameat.c echo x - star-1.6/libschily/resolvepath.c sed 's/^X//' >star-1.6/libschily/resolvepath.c << 'END-of-star-1.6/libschily/resolvepath.c' X/* @(#)resolvepath.c 1.8 18/12/02 Copyright 2011-2018 J. Schilling */ X/* X * resolvepath() removes "./" and non-leading "/.." path components. X * It tries to do the same as the Solaris syscall with the same name. X * X * Copyright (c) 2011-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X#include X X#ifndef HAVE_LSTAT X#define lstat stat X#endif X X#ifndef HAVE_RESOLVEPATH XEXPORT int resolvepath __PR((const char *path, char *buf, X size_t bufsiz)); X#endif XEXPORT int resolvenpath __PR((const char *path, char *buf, X size_t bufsiz)); XLOCAL int pathresolve __PR((const char *path, const char *p, X char *buf, char *b, X size_t bufsiz, int flags)); XLOCAL int shorten __PR((char *path)); X X#ifndef HAVE_RESOLVEPATH X/* X * Warning: The Solaris system call "resolvepath()" does not null-terminate X * the result in "buf". Code that used resolvepath() should manually X * null-terminate the buffer. X * X * Warning: The Solaris system call "resolvepath()" works when "path" and "buf" X * are the same buffer but our implementation does not. X * X * Note: Path needs to exist. X */ XEXPORT int Xresolvepath(path, buf, bufsiz) X register const char *path; X char *buf; X size_t bufsiz; X{ X return (pathresolve(path, path, buf, buf, bufsiz, RSPF_EXIST)); X} X#endif X X/* X * Path may not exist. X */ XEXPORT int Xresolvenpath(path, buf, bufsiz) X register const char *path; X char *buf; X size_t bufsiz; X{ X return (pathresolve(path, path, buf, buf, bufsiz, 0)); X} X X/* X * The behavior may be controlled via flags: X * X * RSPF_EXIST All path components must exist X * RSPF_NOFOLLOW_LAST Do not follow link in last path component X */ XEXPORT int Xresolvefpath(path, buf, bufsiz, flags) X register const char *path; X char *buf; X size_t bufsiz; X int flags; X{ X return (pathresolve(path, path, buf, buf, bufsiz, flags)); X} X X XLOCAL int Xpathresolve(path, p, buf, b, bufsiz, flags) X register const char *path; X register const char *p; X char *buf; X register char *b; X size_t bufsiz; X int flags; X{ Xregister char *e; X int len = 0; X struct stat rsb; X struct stat sb; X X if (path == NULL || buf == NULL) { X seterrno(EFAULT); X return (-1); X } X if (*path == '\0') { X seterrno(EINVAL); X return (-1); X } X X if (bufsiz <= 0) X return (0); X if (p == path && p[0] == '/') X *b++ = *p++; X X rsb.st_ino = 0; X rsb.st_nlink = 0; X X while (*p) { X if ((b - buf) >= bufsiz) { X buf[bufsiz-1] = '\0'; /* bufziz > 0 tested before */ X return (bufsiz); X } X *b = '\0'; X X if (p[0] == '/') { X p += 1; X continue; X } X if (p[0] == '.' && X (p[1] == '/' || p[1] == '\0')) { X if (p == path && p[1] == '\0') X return (strlcpy(buf, ".", bufsiz)); X if (p[1] == '\0') X p += 1; X else X p += 2; X continue; X } X X if (p[0] == '.' && p[1] == '.' && X (p[2] == '/' || p[2] == '\0')) { X if (p[2] == '\0') X p += 2; X else X p += 3; X if (!shorten(buf)) { X if (strlcat(buf, X buf[0]?"/..":"..", bufsiz) >= bufsiz) { X return (bufsiz); X } X } X b = buf + strlen(buf); X if (stat(buf, &sb) < 0) { X /* X * If it does not exist, it cannot be identical X * to "/", so let us continue. X */ X if (flags & RSPF_EXIST) X return (-1); X else X sb.st_ino = 0; X } X if (rsb.st_ino == 0 || rsb.st_nlink == 0) { X if (stat("/", &rsb) < 0) X return (-1); X } X if (sb.st_dev == rsb.st_dev && X sb.st_ino == rsb.st_ino) { X if (strlcpy(buf, "/", bufsiz) >= bufsiz) { X return (bufsiz); X } X } X continue; X } X X if (b > &buf[1] || (b == &buf[1] && buf[0] != '/')) X *b++ = '/'; X if ((b - buf) >= bufsiz) { X buf[bufsiz-1] = '\0'; /* bufziz > 0 tested before */ X return (bufsiz); X } X e = strchr(p, '/'); X if (e) X len = e - p; X else X len = strlen(p); X if (++len > (bufsiz - (b - buf))) { /* Add one for strlcpy() */ X len = bufsiz - (b - buf); X strlcpy(b, p, len); X return (bufsiz); X } X X strlcpy(b, p, len); X p += len - 1; X if (lstat(buf, &sb) < 0) { X if (flags & RSPF_EXIST) X return (-1); X sb.st_mode = S_IFREG; X } X if (e == NULL && (flags & RSPF_NOFOLLOW_LAST) && X S_ISLNK(sb.st_mode)) { X b += len - 1; X break; X } else if (S_ISLNK(sb.st_mode)) { X char lname[PATH_MAX+1]; X X len = readlink(buf, lname, sizeof (lname)); X if (len < 0) { X return (-1); X } X if (len < sizeof (lname)) X lname[len] = '\0'; X else X lname[sizeof (lname)-1] = '\0'; X *b = '\0'; X len += strlen(buf) + 1; X { X#ifdef HAVE_DYN_ARRAYS X char bx[len]; X#else X char *bx = malloc(len); X if (bx == NULL) X return (-1); X#endif X strcatl(bx, buf, lname, (char *)0); X if (b > &buf[1] && b[-1] == '/') X --b; X len = pathresolve(bx, bx + (b - buf), buf, b, X bufsiz, flags); X#ifndef HAVE_DYN_ARRAYS X free(bx); X#endif X } X if (len < 0) { X return (-1); X } X b = buf + len; X } else { X b += len - 1; X } X if (e == NULL) X break; X } X X if ((b - buf) >= bufsiz) { X buf[bufsiz-1] = '\0'; /* bufziz > 0 tested before */ X return (bufsiz); X } X buf[(b - buf)] = '\0'; X return (b - buf); X} X X/* X * Removes last path name component. X * Returns FALSE if path could not be shortened. X * Does not remove path components if already at root direcory. X */ XLOCAL int Xshorten(path) X register char *path; X{ X register char *p = path; X X X if (p[0] == '\0') /* Cannot shorten empty path */ X return (FALSE); /* Leave empty to add ".." */ X if (p[0] == '.' && p[1] == '\0') { /* Path is just "." */ X *p = '\0'; /* Prepare to add ".." */ X return (FALSE); X } X X for (p = path; *p++ != '\0'; ); X while (p > path) { X if (*--p == '/') X break; X } X X if (p[0] == '.' && p[1] == '.' && p[2] == '\0') { X return (FALSE); X } X if (p[0] == '/' && p[1] == '.' && p[2] == '.' && p[3] == '\0') { X return (FALSE); X } X X if (p == path && p[0] == '/') X p++; X else if (p == path) X *p++ = '.'; X *p = '\0'; X return (TRUE); X} END-of-star-1.6/libschily/resolvepath.c echo x - star-1.6/libschily/mkdirs.c sed 's/^X//' >star-1.6/libschily/mkdirs.c << 'END-of-star-1.6/libschily/mkdirs.c' X/* @(#)mkdirs.c 1.4 14/01/02 Copyright 2011-2014 J. Schilling */ X/* X * mkdirs() is the equivalent to "mkdir -p path" X * makedirs() allows to create missing direcories before a final X * path element if called makedirs(path, mode, TRUE). X * X * "name" must be a modifyable string. X * X * Copyright (c) 2011-2014 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X X#if defined(ENOTEMPTY) && ENOTEMPTY != EEXIST X#define is_eexist(err) ((err) == EEXIST || (err) == ENOTEMPTY) X#else X#define is_eexist(err) ((err) == EEXIST) X#endif X#if defined(EMISSDIR) X#define is_enoent(err) ((err) == ENOENT || (err) == EMISSDIR) X#else X#define is_enoent(err) ((err) == ENOENT) X#endif X X#ifdef __MINGW32__ X#define mkdir(a, b) mkdir(a) X#endif X XEXPORT BOOL makedirs __PR((char *name, mode_t mode, int striplast)); X X#ifdef PROTOTYPES XEXPORT int Xmkdirs(register char *name, mode_t mode) X#else XEXPORT int Xmkdirs(name, mode) X register char *name; X mode_t mode; X#endif X{ X return (makedirs(name, mode, FALSE)); X} X X#ifdef PROTOTYPES XEXPORT int Xmakedirs(register char *name, mode_t mode, int striplast) X#else XEXPORT int Xmakedirs(name, mode, striplast) X register char *name; X mode_t mode; X int striplast; X#endif X{ X register char *p; X char *ls = NULL; X int ret = 0; X int err = 0; X mode_t mask; X struct stat sb; X X if (name == NULL) { X seterrno(EFAULT); X return (-1); X } X if (*name == '\0') { X seterrno(EINVAL); X return (-1); X } X mask = umask(S_IRWXU|S_IRWXG|S_IRWXO); X (void) umask(mask); X X for (p = &name[1]; *p; p++) { X if (*p != '/') X continue; X X *p = '\0'; X if (stat(name, &sb) < 0) { X if (mkdir(name, mode | S_IRWXU) < 0) { X err = geterrno(); X X if (!is_eexist(err)) { X ret = -1; X goto errout; X } X } else { X if (ls && (mode & S_IRWXU) != S_IRWXU) { X *ls = '\0'; X chmod(name, mode & ~mask); X *ls = '/'; X } X ls = p; X } X } X *p = '/'; X } X err = 0; X if (!striplast) X ret = mkdir(name, mode); Xerrout: X if (ls && (mode & S_IRWXU) != S_IRWXU) { X *ls = '\0'; X chmod(name, mode & ~mask); X *ls = '/'; X if (err) X seterrno(err); X } X return (ret); X} END-of-star-1.6/libschily/mkdirs.c echo x - star-1.6/libschily/strcasecmp.c sed 's/^X//' >star-1.6/libschily/strcasecmp.c << 'END-of-star-1.6/libschily/strcasecmp.c' X/* @(#)strcasecmp.c 1.1 11/11/24 Copyright 2011 J. Schilling */ X/* X * strcasecmp() to be used if missing in libc X * X * Copyright (c) 2011 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X X#ifndef HAVE_STRCASECMP X XEXPORT int strcasecmp __PR((const char *s1, const char *s2)); X XEXPORT int Xstrcasecmp(s1, s2) X register const char *s1; X register const char *s2; X{ Xextern const char js_strcase_charmap[]; X register const char *chm = js_strcase_charmap; X X if (s1 == s2) X return (0); X X while (chm[* (const unsigned char *)s1] == X chm[* (const unsigned char *)s2++]) { X if (*s1++ == '\0') X return (0); X } X return (chm[*(unsigned char *)s1] - chm[*(unsigned char *)(--s2)]); X} X X#endif END-of-star-1.6/libschily/strcasecmp.c echo x - star-1.6/libschily/strcasemap.c sed 's/^X//' >star-1.6/libschily/strcasemap.c << 'END-of-star-1.6/libschily/strcasemap.c' X/* @(#)strcasemap.c 1.1 11/11/24 Copyright 2011 J. Schilling */ X/* X * Character map for strcasecmp()/strncasecmp() X * X * This only maps 7-Bit ASCII upper case chars to lower case chars. X * X * Copyright (c) 2011 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X X#if !defined(HAVE_STRCASECMP) || !defined(HAVE_STRNCASECMP) X Xconst char js_strcase_charmap[] = { X '\000', '\001', '\002', '\003', '\004', '\005', '\006', '\007', X '\010', '\011', '\012', '\013', '\014', '\015', '\016', '\017', X '\020', '\021', '\022', '\023', '\024', '\025', '\026', '\027', X '\030', '\031', '\032', '\033', '\034', '\035', '\036', '\037', X '\040', '\041', '\042', '\043', '\044', '\045', '\046', '\047', X '\050', '\051', '\052', '\053', '\054', '\055', '\056', '\057', X '\060', '\061', '\062', '\063', '\064', '\065', '\066', '\067', X '\070', '\071', '\072', '\073', '\074', '\075', '\076', '\077', X '\100', '\141', '\142', '\143', '\144', '\145', '\146', '\147', X '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', X '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', X '\170', '\171', '\172', '\133', '\134', '\135', '\136', '\137', X '\140', '\141', '\142', '\143', '\144', '\145', '\146', '\147', X '\150', '\151', '\152', '\153', '\154', '\155', '\156', '\157', X '\160', '\161', '\162', '\163', '\164', '\165', '\166', '\167', X '\170', '\171', '\172', '\173', '\174', '\175', '\176', '\177', X '\200', '\201', '\202', '\203', '\204', '\205', '\206', '\207', X '\210', '\211', '\212', '\213', '\214', '\215', '\216', '\217', X '\220', '\221', '\222', '\223', '\224', '\225', '\226', '\227', X '\230', '\231', '\232', '\233', '\234', '\235', '\236', '\237', X '\240', '\241', '\242', '\243', '\244', '\245', '\246', '\247', X '\250', '\251', '\252', '\253', '\254', '\255', '\256', '\257', X '\260', '\261', '\262', '\263', '\264', '\265', '\266', '\267', X '\270', '\271', '\272', '\273', '\274', '\275', '\276', '\277', X '\300', '\301', '\302', '\303', '\304', '\305', '\306', '\307', X '\310', '\311', '\312', '\313', '\314', '\315', '\316', '\317', X '\320', '\321', '\322', '\323', '\324', '\325', '\326', '\327', X '\330', '\331', '\332', '\333', '\334', '\335', '\336', '\337', X '\340', '\341', '\342', '\343', '\344', '\345', '\346', '\347', X '\350', '\351', '\352', '\353', '\354', '\355', '\356', '\357', X '\360', '\361', '\362', '\363', '\364', '\365', '\366', '\367', X '\370', '\371', '\372', '\373', '\374', '\375', '\376', '\377', X}; X X#endif END-of-star-1.6/libschily/strcasemap.c echo x - star-1.6/libschily/strncasecmp.c sed 's/^X//' >star-1.6/libschily/strncasecmp.c << 'END-of-star-1.6/libschily/strncasecmp.c' X/* @(#)strncasecmp.c 1.1 11/11/24 Copyright 2011 J. Schilling */ X/* X * strcasecmp() to be used if missing in libc X * X * Copyright (c) 2011 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include /* For strncasecmp size_t */ X#include X X#ifndef HAVE_STRNCASECMP X XEXPORT int strncasecmp __PR((const char *s1, const char *s2, X size_t len)); X XEXPORT int Xstrncasecmp(s1, s2, len) X register const char *s1; X register const char *s2; X register size_t len; X{ Xextern const char js_strcase_charmap[]; X register const char *chm = js_strcase_charmap; X X if (s1 == s2) X return (0); X X if (len == 0) X return (0); X X do { X if (chm[* (const unsigned char *)s1] == X chm[* (const unsigned char *)s2++]) { X if (*s1++ == '\0') X return (0); X } else { X break; X } X } while (--len > 0); X X return (len == 0 ? 0 : chm[*(unsigned char *)s1] - X chm[*(unsigned char *)(--s2)]); X} X#endif END-of-star-1.6/libschily/strncasecmp.c echo x - star-1.6/libschily/diropen.c sed 's/^X//' >star-1.6/libschily/diropen.c << 'END-of-star-1.6/libschily/diropen.c' X/* @(#)diropen.c 1.2 12/12/02 Copyright 2011-2012 J. Schilling */ X/* X * open a directory and call fdsetname() if needed X * X * Copyright (c) 2011-2012 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X XLOCAL int __diropen __PR((const char *name, int oflag)); X XLOCAL int X__diropen(name, oflag) X const char *name; X int oflag; X{ X int f = open(name, oflag); X#if O_DIRECTORY == 0 X struct stat sb; X#endif X if (f < 0) X return (f); X X#if O_DIRECTORY == 0 X fstat(f, &sb); X if (!S_ISDIR(sb.st_mode)) { X close(f); X seterrno(ENOTDIR); X return (-1); X } X#endif X#ifndef HAVE_FCHDIR X if (fdsetname(f, name) < 0) { X close(f); X f = -1; X } X#endif X return (f); X} X X/* X * Open for search only, which is sufficient for fchdir() and fstat(). X * This avoids permission errors when trying to open a non-readable dir. X */ XEXPORT int Xdiropen(name) X const char *name; X{ X return (__diropen(name, O_SEARCH|O_DIRECTORY|O_NDELAY)); X} X X/* X * Open for reading (e.g. needed for readdir()) X */ XEXPORT int Xdirrdopen(name) X const char *name; X{ X return (__diropen(name, O_RDONLY|O_DIRECTORY|O_NDELAY)); X} X XEXPORT int Xdirclose(f) X int f; X{ X#ifndef HAVE_FCHDIR X fdclosename(f); X#endif X return (close(f)); X} END-of-star-1.6/libschily/diropen.c echo x - star-1.6/libschily/getnstimeofday.c sed 's/^X//' >star-1.6/libschily/getnstimeofday.c << 'END-of-star-1.6/libschily/getnstimeofday.c' X/* @(#)getnstimeofday.c 1.2 13/09/30 Copyright 2007-2013 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)getnstimeofday.c 1.2 13/09/30 Copyright 2007-2013 J. Schilling"; X#endif X/* X * getnstimeofday() a nanosecond enabled version of gettimeofday() X * X * Copyright (c) 2007-2013 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#if (defined(_MSC_VER) || defined(__MINGW32__)) X#include X#include X#include X#include X X#ifdef _MSC_VER Xconst __int64 MS_FTIME_ADD = 0x2b6109100i64; Xconst __int64 MS_FTIME_SECS = 10000000i64; X#else Xconst Int64_t MS_FTIME_ADD = 0x2b6109100LL; Xconst Int64_t MS_FTIME_SECS = 10000000LL; X#endif X XEXPORT int Xgetnstimeofday(tp) X struct timespec *tp; X{ X FILETIME ft; X Int64_t T; X X if (tp == 0) X return (0); X X GetSystemTimeAsFileTime(&ft); /* 100ns time since 1601 */ X T = ft.dwHighDateTime; X T <<= 32; X T += ft.dwLowDateTime; X X /* X * Cast to avoid a loss of data warning X * MSVC uses long instead of time_t for tv_sec X */ X tp->tv_sec = (long) (T / MS_FTIME_SECS - MS_FTIME_ADD); X tp->tv_nsec = (long) (T % MS_FTIME_SECS) * 100; X X return (0); X} X#else /* (defined(_MSC_VER) || defined(__MINGW32__)) */ X X#include X#include X#include X XEXPORT int Xgetnstimeofday(tp) X struct timespec *tp; X{ X struct timeval tv; X int ret; X X#if defined(HAVE_CLOCK_GETTIME) && defined(HAVE_CLOCK_GETTIME_IN_LIBC) X#ifdef __CLOCK_REALTIME0 X /* X * Use fasttrap on Solaris X */ X if (clock_gettime(__CLOCK_REALTIME0, tp) == 0) X return (0); X#else X if (clock_gettime(CLOCK_REALTIME, tp) == 0) X return (0); X#endif X#endif X X ret = gettimeofday(&tv, (void *)0); X tp->tv_sec = tv.tv_sec; X tp->tv_nsec = tv.tv_usec * 1000; X return (ret); X} X X#endif /* (defined(_MSC_VER) || defined(__MINGW32__)) */ END-of-star-1.6/libschily/getnstimeofday.c echo x - star-1.6/libschily/setnstimeofday.c sed 's/^X//' >star-1.6/libschily/setnstimeofday.c << 'END-of-star-1.6/libschily/setnstimeofday.c' X/* @(#)setnstimeofday.c 1.1 13/09/30 Copyright 2007-2013 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)setnstimeofday.c 1.1 13/09/30 Copyright 2007-2013 J. Schilling"; X#endif X/* X * setnstimeofday() a nanosecond enabled version of settimeofday() X * X * Copyright (c) 2007-2013 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#if (defined(_MSC_VER) || defined(__MINGW32__)) X#include X#include X#include X#include X X#ifdef _MSC_VER Xconst __int64 MS_FTIME_ADD = 0x2b6109100i64; Xconst __int64 MS_FTIME_SECS = 10000000i64; X#else Xconst Int64_t MS_FTIME_ADD = 0x2b6109100LL; Xconst Int64_t MS_FTIME_SECS = 10000000LL; X#endif X XEXPORT int Xsetnstimeofday(tp) X struct timespec *tp; X{ X FILETIME ft; X SYSTEMTIME st; X Int64_t T; X X if (tp == 0) X return (0); X X /* 100ns time since 1601 */ X X T = (tp->tv_sec + MS_FTIME_ADD) * MS_FTIME_SECS; X T += tp->tv_nsec / 100; /* T Granularity is 100ns */ X ft.dwLowDateTime = T & 0xFFFFFFFFUL; X T >>= 32; X ft.dwHighDateTime = T; X X if (FileTimeToSystemTime(&ft, &st) == 0) X return (-1); X X if (SetSystemTime(&st) == 0) X return (-1); X X return (0); X} X#else /* (defined(_MSC_VER) || defined(__MINGW32__)) */ X X#include X#include X#include X XEXPORT int Xsetnstimeofday(tp) X struct timespec *tp; X{ X struct timeval tv; X X#if defined(HAVE_CLOCK_SETTIME) && defined(HAVE_CLOCK_GETTIME_IN_LIBC) X if (clock_settime(CLOCK_REALTIME, tp) == 0) X return (0); X#endif X X tv.tv_sec = tp->tv_sec; X tv.tv_usec = tp->tv_nsec / 1000; X return (settimeofday(&tv, (void *)0)); X} X X#endif /* (defined(_MSC_VER) || defined(__MINGW32__)) */ END-of-star-1.6/libschily/setnstimeofday.c echo x - star-1.6/libschily/fchownat.c sed 's/^X//' >star-1.6/libschily/fchownat.c << 'END-of-star-1.6/libschily/fchownat.c' X/* @(#)fchownat.c 1.2 13/10/30 Copyright 2013 J. Schilling */ X/* X * Emulate the behavior of fchownat(int fd, const char *name, X * uid_t owner, gid_t group, int flag) X * X * Note that emulation methods that do not use the /proc filesystem are X * not MT safe. In the non-MT-safe case, we do: X * X * savewd()/fchdir()/open(name)/restorewd() X * X * Errors may force us to abort the program as our caller is not expected X * to know that we do more than a simple open() here and that the X * working directory may be changed by us. X * X * Copyright (c) 2013 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X#include X#include "at-defs.h" X X#ifndef HAVE_FCHOWNAT X X#ifndef HAVE_LCHOWN X#define lchown chown X#endif X X/* CSTYLED */ X#define PROTO_DECL , uid_t owner, gid_t group, int flag X#define KR_DECL uid_t owner; gid_t group; int flag; X/* CSTYLED */ X#define KR_ARGS , owner, group, flag X#define FUNC_CALL(n) (flag & AT_SYMLINK_NOFOLLOW ? \ X lchown(n, owner, group) : chown(n, owner, group)) X#define FLAG_CHECK() if (flag & ~(AT_SYMLINK_NOFOLLOW)) { \ X seterrno(EINVAL); \ X return (-1); \ X } X#define FUNC_NAME fchownat X#define FUNC_RESULT int X X#include "at-base.c" X X#endif /* HAVE_FCHOWNAT */ END-of-star-1.6/libschily/fchownat.c echo x - star-1.6/libschily/fstatat.c sed 's/^X//' >star-1.6/libschily/fstatat.c << 'END-of-star-1.6/libschily/fstatat.c' X/* @(#)fstatat.c 1.2 13/10/30 Copyright 2013 J. Schilling */ X/* X * Emulate the behavior of fstatat(int fd, const char *name, X * struct stat *sbuf, int flag) X * X * Note that emulation methods that do not use the /proc filesystem are X * not MT safe. In the non-MT-safe case, we do: X * X * savewd()/fchdir()/open(name)/restorewd() X * X * Errors may force us to abort the program as our caller is not expected X * to know that we do more than a simple open() here and that the X * working directory may be changed by us. X * X * Copyright (c) 2013 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X#include X#include X#include "at-defs.h" X X#ifndef HAVE_FSTATAT X X#ifndef HAVE_LSTAT X#define lstat stat X#endif X X/* CSTYLED */ X#define PROTO_DECL , struct stat *sbuf, int flag X#define KR_DECL struct stat *sbuf; int flag; X/* CSTYLED */ X#define KR_ARGS , sbuf, flag X#define FUNC_CALL(n) (flag & AT_SYMLINK_NOFOLLOW ? \ X lstat(n, sbuf) : stat(n, sbuf)) X#define FLAG_CHECK() if (flag & ~(AT_SYMLINK_NOFOLLOW|_AT_TRIGGER)) { \ X seterrno(EINVAL); \ X return (-1); \ X } X#define FUNC_NAME fstatat X#define FUNC_RESULT int X X#include "at-base.c" X X#endif /* HAVE_FSTATAT */ END-of-star-1.6/libschily/fstatat.c echo x - star-1.6/libschily/futimesat.c sed 's/^X//' >star-1.6/libschily/futimesat.c << 'END-of-star-1.6/libschily/futimesat.c' X/* @(#)futimesat.c 1.2 13/10/30 Copyright 2013 J. Schilling */ X/* X * Emulate the behavior of futimesat(int fd, const char *name, X * const struct timeval times[2]) X * X * Note that emulation methods that do not use the /proc filesystem are X * not MT safe. In the non-MT-safe case, we do: X * X * savewd()/fchdir()/open(name)/restorewd() X * X * Errors may force us to abort the program as our caller is not expected X * to know that we do more than a simple open() here and that the X * working directory may be changed by us. X * X * Copyright (c) 2013 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X#include X#include X#include "at-defs.h" X X#ifndef HAVE_FUTIMESAT X X/* CSTYLED */ X#define PROTO_DECL , const struct timeval times[2] X#define KR_DECL const struct timeval times[2]; X/* CSTYLED */ X#define KR_ARGS , times X#define FUNC_CALL(n) utimes(n, times) X#define FLAG_CHECK() X#define FUNC_NAME futimesat X#define FUNC_RESULT int X X#include "at-base.c" X X#endif /* HAVE_FUTIMESAT */ END-of-star-1.6/libschily/futimesat.c echo x - star-1.6/libschily/linkat.c sed 's/^X//' >star-1.6/libschily/linkat.c << 'END-of-star-1.6/libschily/linkat.c' X/* @(#)linkat.c 1.4 16/08/10 Copyright 2011-2016 J. Schilling */ X/* X * Emulate the behavior of linkat(int fd1, const char *name1, int fd2, X * const char *name2, int flag) X * X * Note that emulation methods that do not use the /proc filesystem are X * not MT safe. In the non-MT-safe case, we do: X * X * savewd()/fchdir()/open(name)/restorewd() X * X * Errors may force us to abort the program as our caller is not expected X * to know that we do more than a simple open() here and that the X * working directory may be changed by us. X * X * Copyright (c) 2011-2016 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X#include X#include "at-defs.h" X X#ifndef HAVE_LINKAT X X#ifndef ENAMETOOLONG X#define ENAMETOOLONG EINVAL X#endif X XEXPORT int linkfollow __PR((const char *old, const char *new)); XEXPORT int Xlinkfollow(old, new) X const char *old; X const char *new; X{ X char buf[max(8192, PATH_MAX+1)]; X int blen; X X buf[0] = '\0'; X if ((blen = resolvepath(old, buf, sizeof (buf))) < 0) { X return (-1); X } else if (blen >= sizeof (buf)) { X seterrno(ENAMETOOLONG); X return (-1); /* Path too long */ X } else { X buf[blen] = '\0'; /* Solaris syscall does not null-terminate */ X } X return (link(buf, new)); X} X X#define KR_DECL int flag; X/* CSTYLED */ X#define KR_ARGS , flag X#define FUNC_CALL(n1, n2) (flag & AT_SYMLINK_FOLLOW ? \ X linkfollow(n1, n2) : link(n1, n2)) X#define FLAG_CHECK() if (flag & ~(AT_SYMLINK_FOLLOW)) { \ X seterrno(EINVAL); \ X return (-1); \ X } X#define FUNC_NAME linkat X#define FUNC_RESULT int X X#include "at-base2.c" X X#endif /* HAVE_LINKAT */ END-of-star-1.6/libschily/linkat.c echo x - star-1.6/libschily/mkdirat.c sed 's/^X//' >star-1.6/libschily/mkdirat.c << 'END-of-star-1.6/libschily/mkdirat.c' X/* @(#)mkdirat.c 1.3 13/12/26 Copyright 2013 J. Schilling */ X/* X * Emulate the behavior of mkdirat(int fd, const char *name, mode_t mode) X * X * Note that emulation methods that do not use the /proc filesystem are X * not MT safe. In the non-MT-safe case, we do: X * X * savewd()/fchdir()/open(name)/restorewd() X * X * Errors may force us to abort the program as our caller is not expected X * to know that we do more than a simple open() here and that the X * working directory may be changed by us. X * X * Copyright (c) 2013 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X#include X#include "at-defs.h" X X#ifndef HAVE_MKDIRAT X X/* CSTYLED */ X#define PROTO_DECL , mode_t mode X#define KR_DECL mode_t mode; X/* CSTYLED */ X#define KR_ARGS , mode X#if defined(_MSC_VER) || defined(__MINGW32__) X#define FUNC_CALL(n) mkdir(n) X#else X#define FUNC_CALL(n) mkdir(n, mode) X#endif X#define FLAG_CHECK() X#define FUNC_NAME mkdirat X#define FUNC_RESULT int X X#include "at-base.c" X X#endif /* HAVE_MKDIRAT */ END-of-star-1.6/libschily/mkdirat.c echo x - star-1.6/libschily/mkfifoat.c sed 's/^X//' >star-1.6/libschily/mkfifoat.c << 'END-of-star-1.6/libschily/mkfifoat.c' X/* @(#)mkfifoat.c 1.3 13/12/26 Copyright 2013 J. Schilling */ X/* X * Emulate the behavior of mkfifoat(int fd, const char *name, mode_t mode) X * X * Note that emulation methods that do not use the /proc filesystem are X * not MT safe. In the non-MT-safe case, we do: X * X * savewd()/fchdir()/open(name)/restorewd() X * X * Errors may force us to abort the program as our caller is not expected X * to know that we do more than a simple open() here and that the X * working directory may be changed by us. X * X * Copyright (c) 2013 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X#include X#include "at-defs.h" X X#ifndef HAVE_MKFIFOAT X X/* CSTYLED */ X#define PROTO_DECL , mode_t mode X#define KR_DECL mode_t mode; X/* CSTYLED */ X#define KR_ARGS , mode X#define FUNC_CALL(n) mkfifo(n, mode) X#define FLAG_CHECK() X#define FUNC_NAME mkfifoat X#define FUNC_RESULT int X X#include "at-base.c" X X#endif /* HAVE_FIFOAT */ END-of-star-1.6/libschily/mkfifoat.c echo x - star-1.6/libschily/mknodat.c sed 's/^X//' >star-1.6/libschily/mknodat.c << 'END-of-star-1.6/libschily/mknodat.c' X/* @(#)mknodat.c 1.4 14/05/01 Copyright 2013-2014 J. Schilling */ X/* X * Emulate the behavior of mknodat(int fd, const char *name, mode_t mode, dev_t dev) X * X * Note that emulation methods that do not use the /proc filesystem are X * not MT safe. In the non-MT-safe case, we do: X * X * savewd()/fchdir()/open(name)/restorewd() X * X * Errors may force us to abort the program as our caller is not expected X * to know that we do more than a simple open() here and that the X * working directory may be changed by us. X * X * Copyright (c) 2013-2014 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X#include X#include "at-defs.h" X X#ifndef HAVE_MKNODAT X#ifndef HAVE_MKNOD X/* ARGSUSED */ X#ifdef PROTOTYPES XEXPORT int Xmknodat(int fd, const char *name, mode_t mode, dev_t dev) X#else XEXPORT int Xmknodat(fd, name, mode, dev) X int fd; X const char *name; X mode_t mode; X dev_t dev; X#endif X{ X#ifdef ENOSYS X seterrno(ENOSYS); X#else X seterrno(EINVAL); X#endif X return (-1); X} X#else /* HAVE_MKNOD */ X X/* CSTYLED */ X#define PROTO_DECL , mode_t mode, dev_t dev X#define KR_DECL mode_t mode; dev_t dev; X/* CSTYLED */ X#define KR_ARGS , mode, dev X#define FUNC_CALL(n) mknod(n, mode, dev) X#define FLAG_CHECK() X#define FUNC_NAME mknodat X#define FUNC_RESULT int X X#include "at-base.c" X X#endif /* HAVE_MKNOD */ X#endif /* HAVE_MKNODAT */ END-of-star-1.6/libschily/mknodat.c echo x - star-1.6/libschily/readlinkat.c sed 's/^X//' >star-1.6/libschily/readlinkat.c << 'END-of-star-1.6/libschily/readlinkat.c' X/* @(#)readlinkat.c 1.2 13/10/30 Copyright 2013 J. Schilling */ X/* X * Emulate the behavior of readlinkat(int fd, const char *name, char *lbuf, size_t lbufsize) X * X * Note that emulation methods that do not use the /proc filesystem are X * not MT safe. In the non-MT-safe case, we do: X * X * savewd()/fchdir()/open(name)/restorewd() X * X * Errors may force us to abort the program as our caller is not expected X * to know that we do more than a simple open() here and that the X * working directory may be changed by us. X * X * Copyright (c) 2013 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X#include X#include "at-defs.h" X X#ifndef HAVE_READLINKAT X#ifndef HAVE_READLINK X/* ARGSUSED */ XEXPORT ssize_t Xreadlinkat(fd, name, lbuf, lbufsize) X int fd; X const char *name; X char *lbuf; X size_t lbufsize; X{ X#ifdef ENOSYS X seterrno(ENOSYS); X#else X seterrno(EINVAL); X#endif X return (-1); X} X#else X X/* CSTYLED */ X#define PROTO_DECL , char *lbuf, size_t lbufsize X#define KR_DECL char *lbuf; size_t lbufsize; X/* CSTYLED */ X#define KR_ARGS , lbuf, lbufsize X#define FUNC_CALL(n) readlink(n, lbuf, lbufsize) X#define FLAG_CHECK() X#define FUNC_NAME readlinkat X#define FUNC_RESULT ssize_t X X#include "at-base.c" X X#endif /* HAVE_READLINK */ X#endif /* HAVE_READLINKAT */ END-of-star-1.6/libschily/readlinkat.c echo x - star-1.6/libschily/renameat.c sed 's/^X//' >star-1.6/libschily/renameat.c << 'END-of-star-1.6/libschily/renameat.c' X/* @(#)renameat.c 1.2 15/11/17 Copyright 2011-2015 J. Schilling */ X/* X * Emulate the behavior of renameat(int fd1, const char *name1, X * int fd2, const char *name2) X * X * Note that emulation methods that do not use the /proc filesystem are X * not MT safe. In the non-MT-safe case, we do: X * X * savewd()/fchdir()/open(name)/restorewd() X * X * Errors may force us to abort the program as our caller is not expected X * to know that we do more than a simple open() here and that the X * working directory may be changed by us. X * X * Copyright (c) 2015 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include /* POSIX requires stdio.h for rename */ X#include X#include X#include X#include X#include X#include X#include X#include "at-defs.h" X X#ifndef HAVE_RENAMEAT X X#define KR_DECL X#define KR_ARGS X#define FUNC_CALL(n1, n2) rename(n2, n2) X#define FLAG_CHECK() X#define FUNC_NAME renameat X#define FUNC_RESULT int X X#include "at-base2.c" X X#endif /* HAVE_RENAMEAT */ END-of-star-1.6/libschily/renameat.c echo x - star-1.6/libschily/symlinkat.c sed 's/^X//' >star-1.6/libschily/symlinkat.c << 'END-of-star-1.6/libschily/symlinkat.c' X/* @(#)symlinkat.c 1.3 13/10/30 Copyright 2013 J. Schilling */ X/* X * Emulate the behavior of symlinkat(const char *content, int fd, const char *name) X * X * Note that emulation methods that do not use the /proc filesystem are X * not MT safe. In the non-MT-safe case, we do: X * X * savewd()/fchdir()/open(name)/restorewd() X * X * Errors may force us to abort the program as our caller is not expected X * to know that we do more than a simple open() here and that the X * working directory may be changed by us. X * X * Copyright (c) 2013 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X#include X#include "at-defs.h" X X#ifndef HAVE_SYMLINKAT X#ifndef HAVE_SYMLINK X/* ARGSUSED */ XEXPORT int Xsymlinkat(content, fd, name) X const char *content; X int fd; X const char *name; X{ X#ifdef ENOSYS X seterrno(ENOSYS); X#else X seterrno(EINVAL); X#endif X return (-1); X} X#else X XEXPORT int rev_symlink __PR((const char *name, const char *content)); XEXPORT int rev_symlinkat __PR((int fd, const char *name, const char *content)); X XEXPORT int Xrev_symlink(name, content) X const char *name; X const char *content; X{ X return (symlink(content, name)); X} X X/* CSTYLED */ X#define PROTO_DECL , const char *content X#define KR_DECL const char *content; X/* CSTYLED */ X#define KR_ARGS , content X#define FUNC_CALL(n) rev_symlink(n, content) X#define FLAG_CHECK() X#define FUNC_NAME rev_symlinkat X#define FUNC_RESULT int X X#include "at-base.c" X XEXPORT int Xsymlinkat(content, fd, name) X const char *content; X int fd; X const char *name; X{ X return (rev_symlinkat(fd, name, content)); X} X X#endif /* HAVE_SYMLINK */ X#endif /* HAVE_SYMLINKAT */ END-of-star-1.6/libschily/symlinkat.c echo x - star-1.6/libschily/unlinkat.c sed 's/^X//' >star-1.6/libschily/unlinkat.c << 'END-of-star-1.6/libschily/unlinkat.c' X/* @(#)unlinkat.c 1.2 13/10/30 Copyright 2013 J. Schilling */ X/* X * Emulate the behavior of unlinkat(int fd, const char *name, int flag) X * X * Note that emulation methods that do not use the /proc filesystem are X * not MT safe. In the non-MT-safe case, we do: X * X * savewd()/fchdir()/open(name)/restorewd() X * X * Errors may force us to abort the program as our caller is not expected X * to know that we do more than a simple open() here and that the X * working directory may be changed by us. X * X * Copyright (c) 2013 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X#include X#include "at-defs.h" X X#ifndef HAVE_UNLINKAT X X/* CSTYLED */ X#define PROTO_DECL , int flag X#define KR_DECL int flag; X/* CSTYLED */ X#define KR_ARGS , flag X#define FUNC_CALL(n) (flag & AT_REMOVEDIR ? \ X rmdir(n) : unlink(n)) X#define FLAG_CHECK() if (flag & ~(AT_REMOVEDIR)) { \ X seterrno(EINVAL); \ X return (-1); \ X } X#define FUNC_NAME unlinkat X#define FUNC_RESULT int X X#include "at-base.c" X X#endif /* HAVE_UNLINKAT */ END-of-star-1.6/libschily/unlinkat.c echo x - star-1.6/libschily/utimensat.c sed 's/^X//' >star-1.6/libschily/utimensat.c << 'END-of-star-1.6/libschily/utimensat.c' X/* @(#)utimensat.c 1.2 13/10/30 Copyright 2013 J. Schilling */ X/* X * Emulate the behavior of utimensat(int fd, const char *name, X * const struct timespec times[2], int flag) X * X * Note that emulation methods that do not use the /proc filesystem are X * not MT safe. In the non-MT-safe case, we do: X * X * savewd()/fchdir()/open(name)/restorewd() X * X * Errors may force us to abort the program as our caller is not expected X * to know that we do more than a simple open() here and that the X * working directory may be changed by us. X * X * Copyright (c) 2013 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X#include X#include X#include "at-defs.h" X X#ifndef HAVE_UTIMENSAT X X/* CSTYLED */ X#define PROTO_DECL , const struct timespec times[2], int flag X#define KR_DECL const struct timespec times[2]; int flag; X/* CSTYLED */ X#define KR_ARGS , times, flag X#define FUNC_CALL(n) (flag & AT_SYMLINK_NOFOLLOW ? \ X lutimens(n, times) : utimens(n, times)) X#define FLAG_CHECK() if (flag & ~(AT_SYMLINK_NOFOLLOW)) { \ X seterrno(EINVAL); \ X return (-1); \ X } X#define FUNC_NAME utimensat X#define FUNC_RESULT int X X#include "at-base.c" X X#endif /* HAVE_UTIMENSAT */ END-of-star-1.6/libschily/utimensat.c echo x - star-1.6/libschily/at-base.c sed 's/^X//' >star-1.6/libschily/at-base.c << 'END-of-star-1.6/libschily/at-base.c' X/* @(#)at-base.c 1.2 18/07/16 Copyright 2011-2018 J. Schilling */ X/* X * Emulate the behavior of openat(fd, name, flag, mode) X * Replace "openat" by "FUNC_CALL". X * X * Note that emulation methods that do not use the /proc filesystem are X * not MT safe. In the non-MT-safe case, we do: X * X * savewd()/fchdir()/open(name)/restorewd() X * X * Since the /proc method may fail with ENAMETOOLONG, we need to fall back X * to the fchdir() method in case of long path names and as a result are X * not MT-safe with long path names. X * X * Errors may force us to abort the program as our caller is not expected X * to know that we do more than a simple open() here and that the X * working directory may be changed by us. X * X * Copyright (c) 2011-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef ENAMETOOLONG X#define ENAMETOOLONG EINVAL X#endif X X#ifndef _AT_TRIGGER X#define _AT_TRIGGER 0 X#endif X X#ifdef PROTOTYPES XEXPORT FUNC_RESULT XFUNC_NAME(int fd, const char *name PROTO_DECL) X#else XEXPORT FUNC_RESULT XFUNC_NAME(fd, name KR_ARGS) X int fd; X const char *name; X KR_DECL X#endif X{ X int n; X FUNC_RESULT ret = 0; X char buf[PATH_MAX]; X char *proc_name; X struct save_wd save_wd; X X FLAG_CHECK(); X if (fd == AT_FDCWD || ABS_NAME(name)) X return (FUNC_CALL(name)); X X if ((proc_name = proc_fd2name(buf, fd, name)) != NULL) { X /* X * The next FUNC_CALL() frequently results in ENAMETOOLONG X */ X ret = FUNC_CALL(proc_name); X if (ret >= 0 || NON_PROCFS_ERRNO(errno)) X return (ret); X } X X /* X * /proc open failed or /proc not available on this platform. X * Give it a chance using fchdir(). But the following code is X * not MT-safe! X */ X X if (savewd(&save_wd) < 0) { X /* X * We abort here as the caller may not know that we are forced X * to savewd/fchdir/restorewd here and misinterpret errno. X */ X savewd_abort(geterrno()); X /* NOTREACHED */ X return (-1); X } X if (fd >= 0 && save_wd.fd == fd) { X /* X * If we just opened "fd" with the same number in savewd(), fd X * must have been illegal when calling openat(); X */ X closewd(&save_wd); X seterrno(EBADF); X return (-1); X } X if ((n = fchdir(fd)) < 0) { X int err = geterrno(); X /* X * In case that fchdir() is emulated via chdir() and we use a X * multi hop chdir(), we may be on an undefined intermediate X * directory. Try to return to last working directory and if X * this fails, abort for security. X */ X if (n == -2 && restorewd(&save_wd) < 0) { X restorewd_abort(geterrno()); X /* NOTREACHED */ X } X closewd(&save_wd); X seterrno(err); X return (-1); X } X X ret = FUNC_CALL(name); /* The actual call() */ X X if (restorewd(&save_wd) < 0) { X int err = geterrno(); X X closewd(&save_wd); X restorewd_abort(err); X /* NOTREACHED */ X seterrno(err); X return (-1); X } X closewd(&save_wd); X X return (ret); X} END-of-star-1.6/libschily/at-base.c echo x - star-1.6/libschily/at-base2.c sed 's/^X//' >star-1.6/libschily/at-base2.c << 'END-of-star-1.6/libschily/at-base2.c' X/* @(#)at-base2.c 1.2 18/07/16 Copyright 2011-2018 J. Schilling */ X/* X * Emulate the behavior of FUNC_NAME(fd1, name1, fd2, name2, flag) X * X * Note that emulation methods that do not use the /proc filesystem are X * not MT safe. In the non-MT-safe case, we do: X * X * savewd()/fchdir()/open(name)/restorewd() X * X * Since the /proc method may fail with ENAMETOOLONG, we need to fall back X * to the fchdir() method in case of long path names and as a result are X * not MT-safe with long path names. X * X * Errors may force us to abort the program as our caller is not expected X * to know that we do more than a simple open() here and that the X * working directory may be changed by us. X * X * Copyright (c) 2011-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef ENAMETOOLONG X#define ENAMETOOLONG EINVAL X#endif X XEXPORT FUNC_RESULT XFUNC_NAME(fd1, name1, fd2, name2 KR_ARGS) X int fd1; X const char *name1; X int fd2; X const char *name2; X KR_DECL X{ X int n; X BOOL same_fd = FALSE; X FUNC_RESULT ret = 0; X char buf1[PATH_MAX]; X char buf2[PATH_MAX]; X char *proc_name1; X char *proc_name2; X struct save_wd save_wd; X X FLAG_CHECK(); X X/* X * There are 17 cases to implement: X * X * case fd1 name1 fd2 name2 X * 1 AT_CWD absolute AT_CWD absolute call xxx(name1, name2) X * 2 AT_CWD absolute AT_CWD relative call xxx(name1, name2) X * 3 AT_CWD relative AT_CWD absolute call xxx(name1, name2) X * 4 AT_CWD relative AT_CWD relative call xxx(name1, name2) X * 5 AT_CWD absolute fd absolute call xxx(name1, name2) X * 6 AT_CWD relative fd absolute call xxx(name1, name2) X * 7 fd absolute AT_CWD absolute call xxx(name1, name2) X * 8 fd absolute AT_CWD relative call xxx(name1, name2) X * 9 fd absolute fd absolute call xxx(name1, name2) X * X * 10 AT_CWD absolute fd relative chdir to fd2; call xxx(name1, name2) X * 11 AT_CWD relative fd relative convert name1 to abs; case 10 X * 12 fd relative AT_CWD absolute chdir to fd1; call xxx(name1, name2) X * 13 fd relative AT_CWD relative convert name2 to abs; case 12 X * X * 14 fd absolute fd relative chdir to fd2; call xxx(name1, name2) X * 15 fd relative fd absolute chdir to fd1; call xxx(name1, name2) X * X * 16 fd1 relative fd1 relative chdir to fd1; call xxx(name1, name2) X * 17 fd relative fd relative chdir to fd1; case 11 X */ X X /* X * Case 1..9 X */ X if ((fd1 == AT_FDCWD || ABS_NAME(name1)) && X (fd2 == AT_FDCWD || ABS_NAME(name2))) X return (FUNC_CALL(name1, name2)); X X /* X * If the procfs interface works, we can catch all other cases here: X */ X if ((proc_name1 = proc_fd2name(buf1, fd1, name1)) != NULL && X (proc_name2 = proc_fd2name(buf2, fd2, name2)) != NULL) { X /* X * The next FUNC_CALL() frequently results in ENAMETOOLONG X */ X ret = FUNC_CALL(proc_name1, proc_name2); X if (ret >= 0 || NON_PROCFS_ERRNO(errno)) X return (ret); X } X X /* X * /proc open failed or /proc not available on this platform. X * Give it a chance using fchdir(). But the following code is X * not MT-safe! X */ X X if (savewd(&save_wd) < 0) { X /* X * We abort here as the caller may not know that we are forced X * to savewd/fchdir/restorewd here and misinterpret errno. X */ X savewd_abort(geterrno()); X /* NOTREACHED */ X return (-1); X } X if ((fd1 >= 0 && save_wd.fd == fd1) || X (fd2 >= 0 && save_wd.fd == fd2)) { X /* X * If we just opened "fd" with the same number in savewd(), X * fd1/fd2 must have been illegal when calling us(); X */ X closewd(&save_wd); X seterrno(EBADF); X return (-1); X } X if (!ABS_NAME(name1) && !ABS_NAME(name2)) { X /* X * Check for case 16 X */ X if (fd1 == fd2) { X same_fd = TRUE; X } X#ifndef _MSC_VER X /* X * Are there other non-cooperative platforms where stat() X * does not allow to compare files? X */ X else { X struct stat sb1; X struct stat sb2; X X if (fstat(fd1, &sb1) >= 0 && X fstat(fd2, &sb2) >= 0) { X if (sb1.st_dev == sb2.st_dev && X sb1.st_ino == sb2.st_ino) X same_fd = TRUE; X } X } X#endif X } Xcase_10_12: X if (ABS_NAME(name1) || ABS_NAME(name2) || same_fd) { X /* X * Handle case 10, 12, 14, 15, 16 X */ X int fd; X X if (ABS_NAME(name1)) X fd = fd2; X else X fd = fd1; X if ((n = fchdir(fd)) < 0) { X int err = geterrno(); X /* X * In case that fchdir() is emulated via chdir() X * and we use a multi hop chdir(), we may be on X * an undefined intermediate directory. Try to X * return to last working directory and if this X * fails, abort for security. X */ X if (n == -2 && restorewd(&save_wd) < 0) { X restorewd_abort(geterrno()); X /* NOTREACHED */ X } X closewd(&save_wd); X seterrno(err); X return (-1); X } X } else { X /* X * Handle case 11, 13, 17 X */ X if (fd1 == AT_FDCWD) { Xcase_11: X /* X * Existing file: follow all but last component, abort X * if the file does not exist. X */ X if (absfpath(name1, buf1, sizeof (buf1), X RSPF_EXIST | RSPF_NOFOLLOW_LAST) == NULL) { X ret = -1; X goto fail; X } X name1 = buf1; X goto case_10_12; X } else if (fd2 == AT_FDCWD) { X /* X * New file: may not exist, X * use absnpath() -> absfpath(... 0) X */ X if (absnpath(name2, buf2, sizeof (buf2)) == NULL) { X ret = -1; X goto fail; X } X name2 = buf2; X goto case_10_12; X } else { X if ((n = fchdir(fd1)) < 0) { X int err = geterrno(); X /* X * In case that fchdir() is emulated via chdir() X * and we use a multi hop chdir(), we may be on X * an undefined intermediate directory. Try to X * return to last working directory and if this X * fails, abort for security. X */ X if (n == -2 && restorewd(&save_wd) < 0) { X restorewd_abort(geterrno()); X /* NOTREACHED */ X } X closewd(&save_wd); X seterrno(err); X return (-1); X } X goto case_11; X } X } X X ret = FUNC_CALL(name1, name2); /* The actual call() */ X Xfail: X if (restorewd(&save_wd) < 0) { X int err = geterrno(); X X closewd(&save_wd); X restorewd_abort(err); X /* NOTREACHED */ X seterrno(err); X return (-1); X } X closewd(&save_wd); X X return (ret); X} END-of-star-1.6/libschily/at-base2.c echo x - star-1.6/libschily/fdopendir.c sed 's/^X//' >star-1.6/libschily/fdopendir.c << 'END-of-star-1.6/libschily/fdopendir.c' X/* @(#)fdopendir.c 1.2 18/07/16 Copyright 2011-2018 J. Schilling */ X/* X * Emulate the behavior of fdopendir(fd) X * X * Note that emulation methods that do not use the /proc filesystem are X * not MT safe. In the non-MT-safe case, we do: X * X * savewd()/fchdir()/opendir(".")/restorewd() X * X * Since the /proc method may fail with ENAMETOOLONG, we need to fall back X * to the fchdir() method in case of long path names and as a result are X * not MT-safe with long path names. X * X * Errors may force us to abort the program as our caller is not expected X * to know that we do more than a simple open() here and that the X * working directory may be changed by us. X * X * Copyright (c) 2011-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X#include X#include X#include "at-defs.h" X X#ifndef HAVE_FDOPENDIR X X#ifndef ENAMETOOLONG X#define ENAMETOOLONG EINVAL X#endif X XEXPORT DIR * Xfdopendir(fd) X int fd; X{ X int n; X DIR *ret = 0; X char buf[PATH_MAX]; X char *proc_name; X struct save_wd save_wd; X X if ((proc_name = proc_fd2name(buf, fd, ".")) != NULL) { X /* X * The next opendir() frequently results in ENAMETOOLONG X */ X ret = opendir(proc_name); X if (ret != (DIR *)NULL) { X close(fd); X return (ret); X } X if (NON_PROCFS_ERRNO(errno)) X return (ret); X } X X /* X * /proc open failed or /proc not available on this platform. X * Give it a chance using fchdir(). But the following code is X * not MT-safe! X */ X X if (savewd(&save_wd) < 0) { X /* X * We abort here as the caller may not know that we are forced X * to savewd/fchdir/restorewd here and misinterpret errno. X */ X savewd_abort(geterrno()); X /* NOTREACHED */ X return ((DIR *)NULL); X } X if (fd >= 0 && save_wd.fd == fd) { X /* X * If we just opened "fd" with the same number in savewd(), fd X * must have been illegal when calling openat(); X */ X closewd(&save_wd); X seterrno(EBADF); X return ((DIR *)NULL); X } X if ((n = fchdir(fd)) < 0) { X int err = geterrno(); X /* X * In case that fchdir() is emulated via chdir() and we use a X * multi hop chdir(), we may be on an undefined intermediate X * directory. Try to return to last working directory and if X * this fails, abort for security. X */ X if (n == -2 && restorewd(&save_wd) < 0) { X restorewd_abort(geterrno()); X /* NOTREACHED */ X } X closewd(&save_wd); X seterrno(err); X return ((DIR *)NULL); X } X X ret = opendir("."); /* The actual call() */ X if (ret != (DIR *)NULL) X close(fd); X X if (restorewd(&save_wd) < 0) { X int err = geterrno(); X X closedir(ret); X closewd(&save_wd); X restorewd_abort(err); X /* NOTREACHED */ X seterrno(err); X return ((DIR *)NULL); X } X closewd(&save_wd); X X return (ret); X} X X#endif /* HAVE_FDOPENDIR */ END-of-star-1.6/libschily/fdopendir.c echo x - star-1.6/libschily/utimens.c sed 's/^X//' >star-1.6/libschily/utimens.c << 'END-of-star-1.6/libschily/utimens.c' X/* @(#)utimens.c 1.2 13/10/30 Copyright 2013 J. Schilling */ X/* X * Emulate the behavior of utimens(const char *name, X * const struct timespec times[2]) X * X * Copyright (c) 2013 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X#include X#include X X#ifndef HAVE_UTIMENS X XEXPORT int Xutimens(name, times) X const char *name; X const struct timespec times[2]; X{ X#ifdef HAVE_UTIMENSAT X return (utimensat(AT_FDCWD, name, times, 0)); X#else X#ifdef HAVE_UTIMES X struct timeval tv[2]; X X if (times == NULL) X return (utimes(name, NULL)); X tv[0].tv_sec = times[0].tv_sec; X tv[0].tv_usec = times[0].tv_nsec/1000; X tv[1].tv_sec = times[1].tv_sec; X tv[1].tv_usec = times[1].tv_nsec/1000; X return (utimes(name, tv)); X X#else X#ifdef HAVE_UTIME X struct utimbuf ut; X X if (times == NULL) X return (utime(name, NULL)); X ut.actime = times[0].tv_sec; X ut.modtime = times[1].tv_sec; X X return (utime(name, &ut)); X#else X#ifdef ENOSYS X seterrno(ENOSYS); X#else X seterrno(EINVAL); X#endif X return (-1); X#endif X#endif X#endif X} X X#endif /* HAVE_UTIMENS */ END-of-star-1.6/libschily/utimens.c echo x - star-1.6/libschily/mkfifo.c sed 's/^X//' >star-1.6/libschily/mkfifo.c << 'END-of-star-1.6/libschily/mkfifo.c' X/* @(#)mkfifo.c 1.1 13/10/27 Copyright 2013 J. Schilling */ X/* X * Emulate the behavior of mkfifo(const char *name, mode_t mode) X * X * Copyright (c) 2013 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X#include X#include X X#ifndef HAVE_MKFIFO X X#define S_ALLPERM (S_IRWXU|S_IRWXG|S_IRWXO) X#define S_ALLFLAGS (S_ISUID|S_ISGID|S_ISVTX) X#define S_ALLMODES (S_ALLFLAGS | S_ALLPERM) X X#ifdef PROTOTYPES XEXPORT int Xmkfifo(const char *name, mode_t mode) X#else XEXPORT int Xmkfifo(name, mode) X const char *name; X mode_t mode; X#endif X{ X#ifdef HAVE_MKNOD X return (mknod(name, S_IFIFO | (mode & S_ALLMODES), 0)); X#else X#ifdef ENOSYS X seterrno(ENOSYS); X#else X seterrno(EINVAL); X#endif X return (-1); X#endif X} X X#endif /* HAVE_MKFIFO */ END-of-star-1.6/libschily/mkfifo.c echo x - star-1.6/libschily/futimens.c sed 's/^X//' >star-1.6/libschily/futimens.c << 'END-of-star-1.6/libschily/futimens.c' X/* @(#)futimens.c 1.3 14/05/01 Copyright 2013-2014 J. Schilling */ X/* X * Emulate the behavior of futimens(int fd, X * const struct timespec times[2]) X * X * Copyright (c) 2013-2014 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X#include X#include X X#ifndef HAVE_FUTIMENS X XEXPORT int Xfutimens(fd, times) X int fd; X const struct timespec times[2]; X{ X#if defined(HAVE_UTIMENSAT) && defined(sun) X /* X * The support for path == NULL is Sun specific. X */ X return (utimensat(fd, NULL, times, 0)); X#else X#ifdef HAVE_FUTIMESAT /* Sun specific */ X struct timeval tv[2]; X X if (times == NULL) X return (futimesat(fd, NULL, NULL)); X tv[0].tv_sec = times[0].tv_sec; X tv[0].tv_usec = times[0].tv_nsec/1000; X tv[1].tv_sec = times[1].tv_sec; X tv[1].tv_usec = times[1].tv_nsec/1000; X return (futimesat(fd, NULL, tv)); X#else X#ifdef HAVE_FUTIMES /* BSD specific */ X struct timeval tv[2]; X X if (times == NULL) X return (futimes(fd, NULL)); X tv[0].tv_sec = times[0].tv_sec; X tv[0].tv_usec = times[0].tv_nsec/1000; X tv[1].tv_sec = times[1].tv_sec; X tv[1].tv_usec = times[1].tv_nsec/1000; X return (futimes(fd, tv)); X X#else X#ifdef ENOSYS X seterrno(ENOSYS); X#else X seterrno(EINVAL); X#endif X return (-1); X#endif X#endif X#endif X} X X#endif /* HAVE_FUTIMENS */ END-of-star-1.6/libschily/futimens.c echo x - star-1.6/libschily/lutimens.c sed 's/^X//' >star-1.6/libschily/lutimens.c << 'END-of-star-1.6/libschily/lutimens.c' X/* @(#)lutimens.c 1.3 19/03/26 Copyright 2013-2019 J. Schilling */ X/* X * Emulate the behavior of lutimens(const char *name, X * const struct timespec times[2]) X * X * Copyright (c) 2013-2019 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X#include X#include X#include X X#ifndef HAVE_LUTIMENS X X#ifndef HAVE_LSTAT X#define lstat stat X#endif X XEXPORT int Xlutimens(name, times) X const char *name; X const struct timespec times[2]; X{ X#ifdef HAVE_UTIMENSAT X return (utimensat(AT_FDCWD, name, times, AT_SYMLINK_NOFOLLOW)); X#else X#ifdef HAVE_LUTIMES X struct timeval tv[2]; X X if (times == NULL) X return (lutimes(name, NULL)); X tv[0].tv_sec = times[0].tv_sec; X tv[0].tv_usec = times[0].tv_nsec/1000; X tv[1].tv_sec = times[1].tv_sec; X tv[1].tv_usec = times[1].tv_nsec/1000; X return (lutimes(name, tv)); X X#else X#ifdef HAVE_LUTIME X struct utimbuf ut; X X if (times == NULL) X return (lutime(name, NULL)); X ut.actime = times[0].tv_sec; X ut.modtime = times[1].tv_sec; X X return (lutime(name, &ut)); X#else X /* X * Without lstat(), we expect that there are no symlinks either. X */ X struct stat sb; X X if (lstat(name, &sb) >= 0) { X if (!S_ISLNK(sb.st_mode)) X return (utimens(name, times)); X } else { X /* X * Keep errno (e.g. ENAMETOOLONG) X */ X return (-1); X } X#ifdef ENOSYS X seterrno(ENOSYS); X#else X seterrno(EINVAL); X#endif X return (-1); X#endif X#endif X#endif X} X X#endif /* HAVE_UTIMENS */ END-of-star-1.6/libschily/lutimens.c echo x - star-1.6/libschily/fprformat.c sed 's/^X//' >star-1.6/libschily/fprformat.c << 'END-of-star-1.6/libschily/fprformat.c' X/* @(#)fprformat.c 1.4 16/01/18 Copyright 2013-2016 J. Schilling */ X/* X * fprformat X * common code for printf fprintf & sprintf X * This is the variant that uses stdio und directly calls putc. X * If putc() is a FILE * derived macro, then a printf() based on this X * variant is faster than a format() based printf that needs to call a X * function for every character in the output. X * X * allows recursive printf with "%r", used in: X * error, comerr, comerrno, errmsg, errmsgno and the like X * X * Copyright (c) 2013-2016 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#ifdef DEBUG X#include X#endif X#include X#include X#define __EXTENSIONS__ /* Enable putc_unlocked() macro on Solaris */ X#define FAST_GETC_PUTC /* Enable stdio extensions in schily/stdio.h */ X#include X#include /* Must be past stdio.h */ X X#define FORMAT_FUNC_NAME fprformat X#define FORMAT_FUNC_PROTO_DECL X#define FORMAT_FUNC_KR_DECL X#define FORMAT_FUNC_KR_ARGS X#undef FORMAT_FUNC_PARM X#ifdef HAVE_PUTC_UNLOCKED X#define ofun(c, fp) putc_unlocked(c, (FILE *)fp) X#else X#define ofun(c, fp) putc(c, (FILE *)fp) X#endif X X/* X * If enabled, an internally buffered version of fprformat() is implemented X * that avoids completely unbuffered printing on onubuffered FILE pointers. X * This is 15% slower than the version that directly calls putc_unlocked() X * but it works on any OS. X */ X#define FORMAT_BUFFER X X#include "format.c" END-of-star-1.6/libschily/fprformat.c echo x - star-1.6/libschily/strspn.c sed 's/^X//' >star-1.6/libschily/strspn.c << 'END-of-star-1.6/libschily/strspn.c' X/* @(#)strspn.c 1.1 14/01/06 Copyright 2014 J. Schilling */ X/* X * find maximum number of chars in s1 that consists solely of chars X * from s2 X * X * Copyright (c) 2014 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X#include X#include X#include X X#ifndef HAVE_STRSPN X XEXPORT size_t Xstrspn(s1, s2) X register const char *s1; /* The string to search */ X const char *s2; /* The charset used to search */ X{ X register const char *a; X register const char *b; X X if (*s2 == '\0') X return (0); X X for (a = s1; *a != '\0'; a++) { X for (b = s2; *b != '\0' && *a != *b; b++) X ; X if (*b == '\0') X break; X } X return (a - s1); X} X X#endif END-of-star-1.6/libschily/strspn.c echo x - star-1.6/libschily/wcsspn.c sed 's/^X//' >star-1.6/libschily/wcsspn.c << 'END-of-star-1.6/libschily/wcsspn.c' X/* @(#)wcsspn.c 1.1 14/01/06 Copyright 2014 J. Schilling */ X/* X * find maximum number of chars in s1 that consists solely of chars X * from s2 X * X * Copyright (c) 2014 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X#include X#include X#include X#include X X#ifndef HAVE_WCSSPN X XEXPORT size_t Xwcsspn(s1, s2) X register const wchar_t *s1; /* The string to search */ X const wchar_t *s2; /* The charset used to search */ X{ X register const wchar_t *a; X register const wchar_t *b; X X if (*s2 == '\0') X return (0); X X for (a = s1; *a != '\0'; a++) { X for (b = s2; *b != '\0' && *a != *b; b++) X ; X if (*b == '\0') X break; X } X return (a - s1); X} X X#endif END-of-star-1.6/libschily/wcsspn.c echo x - star-1.6/libschily/strcspn.c sed 's/^X//' >star-1.6/libschily/strcspn.c << 'END-of-star-1.6/libschily/strcspn.c' X/* @(#)strcspn.c 1.1 14/01/06 Copyright 2014 J. Schilling */ X/* X * find maximum number of chars in s1 that consists solely of chars X * NOT in s2 X * X * Copyright (c) 2014 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X#include X#include X#include X X#ifndef HAVE_STRCSPN X XEXPORT size_t Xstrcspn(s1, s2) X register const char *s1; /* The string to search */ X const char *s2; /* The charset used to search */ X{ X register const char *a; X register const char *b; X X if (*s2 == '\0') X return (strlen(s1)); X X for (a = s1; *a != '\0'; a++) { X for (b = s2; *b != '\0' && *a != *b; b++) X ; X if (*b != '\0') X break; X } X return (a - s1); X} X X#endif END-of-star-1.6/libschily/strcspn.c echo x - star-1.6/libschily/wcscspn.c sed 's/^X//' >star-1.6/libschily/wcscspn.c << 'END-of-star-1.6/libschily/wcscspn.c' X/* @(#)wcscspn.c 1.1 14/01/06 Copyright 2014 J. Schilling */ X/* X * find maximum number of chars in s1 that consists solely of chars X * NOT in s2 X * X * Copyright (c) 2014 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X#include X#include X#include X#include X X#ifndef HAVE_WCSCSPN X XEXPORT size_t Xwcscspn(s1, s2) X register const wchar_t *s1; /* The string to search */ X const wchar_t *s2; /* The charset used to search */ X{ X register const wchar_t *a; X register const wchar_t *b; X X if (*s2 == '\0') X return (wcslen(s1)); X X for (a = s1; *a != '\0'; a++) { X for (b = s2; *b != '\0' && *a != *b; b++) X ; X if (*b != '\0') X break; X } X return (a - s1); X} X X#endif END-of-star-1.6/libschily/wcscspn.c echo x - star-1.6/libschily/fchmodat.c sed 's/^X//' >star-1.6/libschily/fchmodat.c << 'END-of-star-1.6/libschily/fchmodat.c' X/* @(#)fchmodat.c 1.2 14/06/03 Copyright 2014 J. Schilling */ X/* X * Emulate the behavior of fchmodat(int fd, const char *name, mode_t mode, int flag) X * X * Note that emulation methods that do not use the /proc filesystem are X * not MT safe. In the non-MT-safe case, we do: X * X * savewd()/fchdir()/open(name)/restorewd() X * X * Errors may force us to abort the program as our caller is not expected X * to know that we do more than a simple open() here and that the X * working directory may be changed by us. X * X * Copyright (c) 2014 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X#include X#include X#include "at-defs.h" X X#ifndef HAVE_FCHMODAT X#ifndef HAVE_CHMOD X/* ARGSUSED */ X#ifdef PROTOTYPES XEXPORT int Xfchmodat(int fd, const char *name, mode_t mode) X#else XEXPORT int Xfchmodat(fd, name, mode) X int fd; X const char *name; X mode_t mode; X#endif X{ X#ifdef ENOSYS X seterrno(ENOSYS); X#else X seterrno(EINVAL); X#endif X return (-1); X} X#else /* HAVE_CHMOD */ X X/* CSTYLED */ X#define PROTO_DECL , mode_t mode, int flag X#define KR_DECL mode_t mode; int flag; X/* CSTYLED */ X#define KR_ARGS , mode, flag X#define FUNC_CALL(n) (flag & AT_SYMLINK_NOFOLLOW ? \ X lchmod(n, mode) : chmod(n, mode)) X#define FLAG_CHECK() if (flag & ~(AT_SYMLINK_NOFOLLOW)) { \ X seterrno(EINVAL); \ X return (-1); \ X } X X#define FUNC_NAME fchmodat X#define FUNC_RESULT int X X#include "at-base.c" X X#endif /* HAVE_CHMOD */ X#endif /* HAVE_FCHMODDAT */ END-of-star-1.6/libschily/fchmodat.c echo x - star-1.6/libschily/faccessat.c sed 's/^X//' >star-1.6/libschily/faccessat.c << 'END-of-star-1.6/libschily/faccessat.c' X/* @(#)faccessat.c 1.1 14/05/11 Copyright 2013-2014 J. Schilling */ X/* X * Emulate the behavior of faccessat(int fd, const char *name, X * int amode, int flag) X * X * Note that emulation methods that do not use the /proc filesystem are X * not MT safe. In the non-MT-safe case, we do: X * X * savewd()/fchdir()/open(name)/restorewd() X * X * Errors may force us to abort the program as our caller is not expected X * to know that we do more than a simple open() here and that the X * working directory may be changed by us. X * X * Copyright (c) 2013-2014 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X#include X#include "at-defs.h" X X#ifndef HAVE_FACCESSAT X X/* CSTYLED */ X#define PROTO_DECL , int amode, int flag X#define KR_DECL int amode; int flag; X/* CSTYLED */ X#define KR_ARGS , amode, flag X#define FUNC_CALL(n) (flag & AT_EACCESS ? \ X eaccess(n, amode) : access(n, amode)) X#define FLAG_CHECK() if (flag & ~(AT_EACCESS)) { \ X seterrno(EINVAL); \ X return (-1); \ X } X#define FUNC_NAME faccessat X#define FUNC_RESULT int X X#include "at-base.c" X X#endif /* HAVE_FCHOWNAT */ END-of-star-1.6/libschily/faccessat.c echo x - star-1.6/libschily/dlfcn.c sed 's/^X//' >star-1.6/libschily/dlfcn.c << 'END-of-star-1.6/libschily/dlfcn.c' X/* @(#)dlfcn.c 1.3 18/03/21 Copyright 2014-2018 J. Schilling */ X/* X * Functions to support POSIX shared library handling X * X * Copyright (c) 2014-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X X#ifndef HAVE_DLOPEN X X#if !defined(DID_DLOPEN) && defined(HAVE_LOADLIBRARY) /* Win-DOS */ X#define DID_DLOPEN X X#include X XLOCAL int _dl_lasterror; X XEXPORT void * Xdlopen(pathname, mode) X const char *pathname; X int mode; X{ X void *ret = NULL; X X /* X * Nur eine Directory, kein PATH: X * X * BOOL SetDllDirectory(char *pathname) X * DWORD GetDllDirectory(DWORD nBufferLength, LPTSTR lpBuffer) -> len X */ X ret = LoadLibrary(pathname); X if (ret == NULL) X _dl_lasterror = GetLastError(); X X return (ret); X} X XEXPORT int Xdlclose(handle) X void *handle; X{ X int ret = 0; X X if (!FreeLibrary(handle)) { X _dl_lasterror = GetLastError(); X ret = -1; X } X X return (ret); X} X XEXPORT void * Xdlsym(handle, name) X void *handle; X const char *name; X{ X void *ret = NULL; X X ret = GetProcAddress(handle, name); X if (ret == NULL) X _dl_lasterror = GetLastError(); X X return (ret); X} X X#define ERROR_BUFFER_SIZE 1024 XEXPORT char * Xdlerror() X{ X char *ret = NULL; X DWORD dwMsgLen; Xstatic char buff[ERROR_BUFFER_SIZE + 1]; X X if (_dl_lasterror == 0) X return (ret); X X buff[0] = 0; X dwMsgLen = FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM X |FORMAT_MESSAGE_IGNORE_INSERTS X |FORMAT_MESSAGE_MAX_WIDTH_MASK, X NULL, X _dl_lasterror, X MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), X (LPSTR)buff, X ERROR_BUFFER_SIZE, X NULL); X _dl_lasterror = 0; X ret = buff; X X return (ret); X} X X#endif /* HAVE_LOADLOBRARY */ X X#if !defined(DID_DLOPEN) && defined(HAVE_SHL_LOAD) /* HP-UX */ X#define DID_DLOPEN X X#include /* for sterror() */ X XLOCAL int _dl_lasterror; X XEXPORT void * Xdlopen(pathname, mode) X const char *pathname; X int mode; X{ X void *ret; X int flags = BIND_IMMEDIATE; X X if (mode == RTLD_LAZY) X flags = BIND_DEFERRED; X X ret = shl_load(pathname, flags, 0L); X if (ret == NULL) X _dl_lasterror = errno; X X return (ret); X} X XEXPORT int Xdlclose(handle) X void *handle; X{ X return (shl_unload(handle)); X} X XEXPORT void * Xdlsym(handle, name) X void *handle; X const char *name; X{ X void *ret = NULL; X X if (shl_findsym(handle, name, TYPE_UNDEFINED, &ret) != 0) X _dl_lasterror = errno; X X return (ret); X} X XEXPORT char * Xdlerror() X{ X char *ret = NULL; X X if (_dl_lasterror == 0) X return (ret); X ret = strerror(_dl_lasterror); X _dl_lasterror = 0; X X return (ret); X} X X#endif /* HAVE_SHL_LOAD */ X X#if !defined(DID_DLOPEN) /* unknown OS */ X#define DID_DLOPEN X X/* X * If we do not have dlopen(), we at least need to define a X * dummy function of that name. X */ X XEXPORT void * Xdlopen(pathname, mode) X const char *pathname; X int mode; X{ X void *ret = NULL; X X return (ret); X} X XEXPORT int Xdlclose(handle) X void *handle; X{ X int ret = 0; X X return (ret); X} X XEXPORT void * Xdlsym(handle, name) X void *handle; X const char *name; X{ X void *ret = NULL; X X return (ret); X} X XEXPORT char * Xdlerror() X{ X char *ret = NULL; X X return (ret); X} X X#endif /* HAVE_SHL_LOAD */ X X X#else /* HAVE_DLOPEN */ X#endif /* HAVE_DLOPEN */ END-of-star-1.6/libschily/dlfcn.c echo x - star-1.6/libschily/lchmod.c sed 's/^X//' >star-1.6/libschily/lchmod.c << 'END-of-star-1.6/libschily/lchmod.c' X/* @(#)lchmod.c 1.1 14/06/03 Copyright 2014 J. Schilling */ X/* X * Emulate the behavior of lchmod(const char *name, mode_t mode) X * X * Copyright (c) 2014 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X#include X#include X X#ifndef HAVE_LCHMOD X#ifdef PROTOTYPES XEXPORT int Xlchmod(const char *name, mode_t mode) X#else XEXPORT int Xlchmod(name, mode) X const char *name; X mode_t mode; X#endif X{ X struct stat statbuf; X X statbuf.st_mode = 0; X fstatat(AT_FDCWD, name, &statbuf, AT_SYMLINK_NOFOLLOW); X X#ifdef HAVE_CHMOD X if (!S_ISLNK(statbuf.st_mode)) X return (chmod(name, mode)); X X#else /* !HAVE_CHMOD */ X if (!S_ISLNK(statbuf.st_mode)) { X#ifdef ENOSYS X seterrno(ENOSYS); X#else X seterrno(EINVAL); X#endif X return (-1); X } X#endif /* !HAVE_CHMOD */ X X#ifdef EOPNOTSUPP X seterrno(EOPNOTSUPP); X#else X seterrno(EINVAL); X#endif X return (-1); X} X#endif /* HAVE_LCHMOD */ END-of-star-1.6/libschily/lchmod.c echo x - star-1.6/libschily/strlcatl.c sed 's/^X//' >star-1.6/libschily/strlcatl.c << 'END-of-star-1.6/libschily/strlcatl.c' X/* @(#)strlcatl.c 1.1 15/03/03 Copyright 2015 J. Schilling */ X/* X * list version of strlcat() X * X * concatenates all past first parameter until a NULL pointer is reached X * X * WARNING: a NULL constant is not a NULL pointer, so a caller must X * cast a NULL constant to a pointer: (char *)NULL X * X * returns number of bytes needed to fit all X * X * Copyright (c) 2015 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X X/* VARARGS3 */ X#ifdef PROTOTYPES XEXPORT size_t Xstrlcatl(char *to, size_t len, ...) X#else XEXPORT size_t Xstrlcatl(to, len, va_alist) X char *to; X size_t len; X va_dcl X#endif X{ X va_list args; X register char *p; X register char *tor = to; X size_t olen = len; X X#ifdef PROTOTYPES X va_start(args, len); X#else X va_start(args); X#endif X if (len > 0) { X while (--len > 0 && *tor++ != '\0') X ; X X if (len == 0) X goto toolong; X X while ((p = va_arg(args, char *)) != NULL) { X tor--; X len++; X while (--len > 0 && (*tor++ = *p++) != '\0') X ; X if (len == 0) { X *tor = '\0'; X olen = tor - to + strlen(p); X goto toolong; X } X } X olen = --tor - to; X } X va_end(args); X return (olen); Xtoolong: X while ((p = va_arg(args, char *)) != NULL) { X olen += strlen(p); X } X va_end(args); X return (olen); X} END-of-star-1.6/libschily/strlcatl.c echo x - star-1.6/libschily/wcslcatl.c sed 's/^X//' >star-1.6/libschily/wcslcatl.c << 'END-of-star-1.6/libschily/wcslcatl.c' X/* @(#)wcslcatl.c 1.1 15/03/03 Copyright 2015 J. Schilling */ X/* X * list version of strlcat() X * X * concatenates all past first parameter until a NULL pointer is reached X * X * WARNING: a NULL constant is not a NULL pointer, so a caller must X * cast a NULL constant to a pointer: (wchar_t *)NULL X * X * returns number of bytes needed to fit all X * X * Copyright (c) 2015 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X X/* VARARGS3 */ X#ifdef PROTOTYPES XEXPORT size_t Xwcslcatl(wchar_t *to, size_t len, ...) X#else XEXPORT size_t Xwcslcatl(to, len, va_alist) X wchar_t *to; X size_t len; X va_dcl X#endif X{ X va_list args; X register wchar_t *p; X register wchar_t *tor = to; X size_t olen = len; X X#ifdef PROTOTYPES X va_start(args, len); X#else X va_start(args); X#endif X if (len > 0) { X while (--len > 0 && *tor++ != '\0') X ; X X if (len == 0) X goto toolong; X X while ((p = va_arg(args, wchar_t *)) != NULL) { X tor--; X len++; X while (--len > 0 && (*tor++ = *p++) != '\0') X ; X if (len == 0) { X *tor = '\0'; X olen = tor - to + wcslen(p); X goto toolong; X } X } X olen = --tor - to; X } X va_end(args); X return (olen); Xtoolong: X while ((p = va_arg(args, wchar_t *)) != NULL) { X olen += wcslen(p); X } X va_end(args); X return (olen); X} END-of-star-1.6/libschily/wcslcatl.c echo x - star-1.6/libschily/Makefile.man sed 's/^X//' >star-1.6/libschily/Makefile.man << 'END-of-star-1.6/libschily/Makefile.man' X#ident "@(#)Makefile.man 1.2 15/04/27 " X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X Xinclude Targets.man XMK_FILES= $(MAN_MK_FILES) X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.mks X########################################################################### END-of-star-1.6/libschily/Makefile.man echo x - star-1.6/libschily/absfpath.3 sed 's/^X//' >star-1.6/libschily/absfpath.3 << 'END-of-star-1.6/libschily/absfpath.3' X.so man3/abspath.3 X.\" @(#)absfpath.3 1.1 15/04/27 joerg END-of-star-1.6/libschily/absfpath.3 echo x - star-1.6/libschily/absnpath.3 sed 's/^X//' >star-1.6/libschily/absnpath.3 << 'END-of-star-1.6/libschily/absnpath.3' X.so man3/abspath.3 X.\" @(#)absnpath.3 1.1 15/04/27 joerg END-of-star-1.6/libschily/absnpath.3 echo x - star-1.6/libschily/abspath.3 sed 's/^X//' >star-1.6/libschily/abspath.3 << 'END-of-star-1.6/libschily/abspath.3' X. \" Manual Seite fuer abspath X. \" @(#)abspath.3 1.1 15/04/27 Copyright 2015 J. Schilling X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH ABSPATH 3 "2015/04/27" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xabspath(), absnpath(), absfpath() \- Expands a relative pathname to a full (absolute) pathname X.SH SYNOPSIS X.nf X#include X.sp X.B char * X.B abspath(relp, absp, asize) X.B " const char *relp; X.B " char *absp; X.B " size_t asize; X.sp X.B char * X.B absnpath(relp, absp, asize) X.B " const char *relp; X.B " char *absp; X.B " size_t asize; X.sp X.B char * X.B absfpath(relp, absp, asize, flags) X.B " const char *relp; X.B " char *absp; X.B " size_t asize; X.B " int flags; X.fi X.SH DESCRIPTION X.LP X.BR abspath () Xtakes a relative path name and converts it into an absolute path name. X.I relp Xis relative path name that is used as the input. X.I absp Xis the buffer used for the result of the conversion. X.I asize Xis the size of the result buffer. X.LP X.BR absnpath () Xbehaves like X.BR abspath () Xexept that the file does not need to exist. X.LP X.BR absfpath () Xtakes an additional X.I flags Xparameter from the set of flags from X.BR resolvefpath () Xto control the behavior. X X.SH RETURN VALUE X.LP XOn successful completion, X.BR abspath(), X.BR absnpath() Xand X.BR absfpath() Xreturn a pointer to the resolved name X.BR absp . XOtherwise, a null pointer is returned and errno is set to indicate Xthe error, and the contents of the buffer pointed to by X.B absp Xis left in an indeterminate state. X.SH ERRORS X.LP X.TP 10 X.B ERANGE XThe path does not fit into the suplied buffer. X.TP X.B EFAULT XA null pointer was suplied as pathname. X.TP X.B EINVAL XAn empty relative path was supplied. X.SH EXAMPLES X.LP X.SH "SEE ALSO" X.LP X.BR resolvepath (3), X.BR resolvenpath (3), X.BR resolvefpath (3) X.SH NOTES Xnone END-of-star-1.6/libschily/abspath.3 echo x - star-1.6/libschily/astoi.3 sed 's/^X//' >star-1.6/libschily/astoi.3 << 'END-of-star-1.6/libschily/astoi.3' X. \" Manual Seite fuer astoi X. \" @(#)astoi.3 1.3 15/04/26 Copyright 2015 J. Schilling X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH ASTOI 3 "15. Juli 1988" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xastoi() \- converts ASCII to integer X.SH SYNOPSIS X.nf X#include X.sp X.B char *astoi(string,result) X.B X char *string; /* the string to convert */ X.B X int *result; /* where to store the result */ X.fi X.SH DESCRIPTION Xastoi() converts the characters pointed to by string to an integer Xstored at X.IR result . XIt returns a pointer to the first character in the Xstring that was not used for the conversion. If the entire Xstring is to be used, it should point to a NULL character X('\\0'). XLeading spaces and tabs are skipped. X.LP XThe ASCII string accepts a leading `+' or `\-'. A leading zero in Xthe string makes the number octal, while a leading 0x makes the Xnumber hexadecimal. XLeading spaces and tabs are skipped. X.SH RETURNS XReturns a pointer to the first unused character. X.SH EXAMPLES X.nf Xif (*astoi(string, &i) != '\\0') X error("Not a number %s\\n", string); X.fi X.SH "SEE ALSO" X.BR astol (3) X.SH NOTES XRange errors are not checked. Conversion stops (and a pointer Xis returned) at the first non-numeric character other than the Xleading sign or 0x, as described above. END-of-star-1.6/libschily/astoi.3 echo x - star-1.6/libschily/astol.3 sed 's/^X//' >star-1.6/libschily/astol.3 << 'END-of-star-1.6/libschily/astol.3' X. \" Manual Seite fuer astol X. \" @(#)astol.3 1.1 X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH ASTOL 3 "15. Juli 1988" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xastol() \- converts ASCII to long X.SH SYNOPSIS X.nf X.B astol(string,l) X.B char *string; X.B int *l; X.fi X.SH DESCRIPTION Xastol() converts the characters pointed to by string to a long Xstored at l. It returns a pointer to the first character in the Xstring that was not used for the conversion. If the entire Xstring is to be used, it should point to a NULL character X('\\0'). XLeading spaces and tabs are skipped. X.SH RETURN VALUES X.SH ERRORS X.SH EXAMPLES X.nf Xextern char *astol(); Xif (*astod(string, &l) != '\\0') X error("Not a number %s\\n", string); X.fi X.SH "SEE ALSO" Xastod(3), astof(3), astoi(3) X.SH RETURNS XReturns a pointer to first unused character. X.SH NOTES Xnone END-of-star-1.6/libschily/astol.3 echo x - star-1.6/libschily/breakline.3 sed 's/^X//' >star-1.6/libschily/breakline.3 << 'END-of-star-1.6/libschily/breakline.3' X. \" Manual Seite fuer breakline X. \" @(#)breakline.3 1.1 X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH BREAKLINE 3 "15. Juli 1988" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xbreakline() \- breaks a buffer into fields X.SH SYNOPSIS X.nf X.B int breakline(buf, delim, array, max) X.B char *buf; X.B char delim; X.B char *array[]; X.B int max; X.fi X.SH DESCRIPTION Xbreakline() breaks the buffer buf into fields delimited by the Xcharacter delim, replacing the occurrences of delim in buf with Xthe NULL character ('\\0'). It fills in the array with pointers Xto the beginning of each field in the buffer. max defines how Xmany entries to fill in the array. If there are not enough Xfields in buf, the extra entries in the array will point to a XNULL string. X.SH RETURNS XReturns the number of fields actually in the buffer, but not Xmore than max. X.SH EXAMPLES X.nf Xchar *buf = "a:bc:d:efg"; Xchar *array[10]; X Xbreakline(buf, ':', array, 10); X Xnow the `:' are replaced by '\\0' and: X X array[0] = "a"; X array[1] = "bc"; X array[2] = "d" X array[3] = "efg"; X array[4] .\|.\|. array[9] = ""; X X.fi X.SH "SEE ALSO" Xfindline(3) X.SH NOTES Xnone END-of-star-1.6/libschily/breakline.3 echo x - star-1.6/libschily/comerr.3 sed 's/^X//' >star-1.6/libschily/comerr.3 << 'END-of-star-1.6/libschily/comerr.3' X. \" Manual Seite fuer comerr X. \" @(#)comerr.3 1.1 X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH COMERR 3 "15. Juli 1988" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xcomerr() \- prints error message and exits X.SH SYNOPSIS X.nf X.B Xcomerr(format,arg1,\|.\|.\|.,argn) X.B char *format; X.fi X.SH DESCRIPTION Xcomerr() formats and prints a message on the error output Xstream. Part of the message is the last error encountered by Xthe system while executing the process. Xcomerr() begins its output with the current program name (as Xpassed to it by exec() ) followed by a colon ":" and the Xdetailed system error message. It then formats the user Xsupplied format string and arguments in the form printf() would. X.SH RETURNS Xnone X.br XRather than return, comerr() terminates the current process and Xexits with the system error number as the exit code. X.SH EXAMPLES X.nf Xif (( f = fileopen("file", "r")) == NULL) X comerr("Cannot open file.\\n"); X.fi X.PP XOn X.I stderr Xit appears as: X.PP X.B Xprog_name: No such file or directory. Cannot open file. X.SH "SEE ALSO" Xcomerrno(3), error(3), errmsg(3), error(3) geterrno(3), printf(3), format(3) X.SH NOTES Xcomerr() attempts to find a line in the message file that Xcorresponds to the system error number. If none can be found, or Xit has trouble finding or reading the file, it simply says: Xerror #. END-of-star-1.6/libschily/comerr.3 echo x - star-1.6/libschily/comerrno.3 sed 's/^X//' >star-1.6/libschily/comerrno.3 << 'END-of-star-1.6/libschily/comerrno.3' X. \" Manual Seite fuer comerrno X. \" @(#)comerrno.3 1.1 X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH COMERRNO 3 "15. Juli 1988" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xcomerrno() \- prints error message, given error code, and Xexits X.SH SYNOPSIS X.nf X.B Xcomerrno(error,format,args); X.B int error; X.B char *format; X.fi X.SH DESCRIPTION Xcomerrno() is like comerr(), except that the caller supplies the Xerror number. Positive numbers are turned into system error Xmessages. Negative numbers cause the system error portion of Xthe output to be omitted. Xcomerrno() is a convenient way to print the name of the program, Xand an error message, and exit the process in a single call. X.SH RETURNS Xnone X.br XRather than return, comerrno() exits the current process with a Xvalue equal to the error number supplied by the user. X.SH EXAMPLES X.nf Xif (argc < 2) X comerrno(-1, "Usage: name arg.\\n"); X.fi X.SH "SEE ALSO" Xcomerr(3), error(3), errmsg(3), error(3) geterrno(3), printf(3), format(3) X.SH NOTES Xcomerrno() attempts to find a line in the message file that Xcorresponds to the system error number. If none can be found, Xor if it has trouble finding or reading the file, it simply Xsays: error #. END-of-star-1.6/libschily/comerrno.3 echo x - star-1.6/libschily/errmsg.3 sed 's/^X//' >star-1.6/libschily/errmsg.3 << 'END-of-star-1.6/libschily/errmsg.3' X. \" Manual Seite fuer errmsg X. \" @(#)errmsg.3 1.1 X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH ERRMSG 3 "15. Juli 1988" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xerrmsg() \- prints error message X.SH SYNOPSIS X.nf X.B Xerrmsg (format, arg1\|.\|.\|.argn) X.B char *format; X.fi X.SH DESCRIPTION Xerrmsg() prints on the error output stream, a message Xcorresponding to the last error encountered by the system on Xbehalf of the process. errmsg() begins its output with the Xcurrent program name (as passed to it by exec ). The message Xcan be expanded with additional arguments, in the same form Xprintf() would. X.SH RETURNS Xnone X.SH EXAMPLES X.nf Xwhile (more_args) { X if (( f = fileopen(arg, "r")) == NULL) { X errmsg("Skipping file %s.\\n", arg); X continue; X } X doit(f) X} X.fi X.SH "SEE ALSO" Xcomerr(3), comerrno(3), error(3), geterrno(3), printf(3), format(3) X.SH NOTES Xerrmsg() is identical to comerr() except that instead of Xexiting, errmsg() prints the error message and returns to the Xcaller. END-of-star-1.6/libschily/errmsg.3 echo x - star-1.6/libschily/errmsgno.3 sed 's/^X//' >star-1.6/libschily/errmsgno.3 << 'END-of-star-1.6/libschily/errmsgno.3' X. \" Manual Seite fuer errmsgno X. \" @(#)errmsgno.3 1.1 X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH ERRMSGNO 3 "15. Juli 1988" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xerrmsgno() \- prints error message, given error code X.SH SYNOPSIS X.nf X.B Xerrmsgno (errcode, format, arg1\|.\|.\|.argn) X.B int errcode; X.B char *format; X.fi X.SH DESCRIPTION Xerrmsgno() prints an error output message corresponding to Xerrcode, which is a standard system error. Xerrmsgno() begins its output with the current program name (as Xpassed to it by exec ). The message can be expanded with Xadditional arguments in the same form printf() would. X.SH RETURNS Xnone X.SH "SEE ALSO" Xcomerr(3), comerrno(3), error(3), errmsg(3), error(3) geterrno(3), Xprintf(3), format(3) X.SH NOTES Xerrmsgno() is identical to comerrno() except instead of exiting, Xit prints the error message and returns to the caller. XIf the errcode argument is positive, errmsgno() ignores it and Xjust prints the program name and the result of expanding Xformat(). END-of-star-1.6/libschily/errmsgno.3 echo x - star-1.6/libschily/error.3 sed 's/^X//' >star-1.6/libschily/error.3 << 'END-of-star-1.6/libschily/error.3' X. \" Manual Seite fuer error X. \" @(#)error.3 1.1 X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH ERROR 3 "15. Juli 1988" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xerror() \- formats and prints on the standard error Xstream X.SH SYNOPSIS X.nf X.B Xerror(format,arg1\|.\|.\|.argn); X.B char *format X.fi X.SH DESCRIPTION Xerror is the equivalent of: Xfprintf(stderr, format, arg1\|.\|.\|.argn). X.SH RETURNS Xnone X.SH "SEE ALSO" Xcomerr(3), comerrno(3), error(3), errmsg(3), error(3) geterrno(3), Xprintf(3), format(3) X.SH NOTES XNormally stderr is unbuffered. Using error() allows a simple Xmessage to be immediately written to the user via the standard Xerror stream (stderr). END-of-star-1.6/libschily/error.3 echo x - star-1.6/libschily/fdown.3 sed 's/^X//' >star-1.6/libschily/fdown.3 << 'END-of-star-1.6/libschily/fdown.3' X. \" Manual Seite fuer fdown X. \" @(#)fdown.3 1.1 X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH FDOWN 3 "15. Juli 1988" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xfdown() \- returns a logical unit number X.SH SYNOPSIS X.nf X.B Xint fdown(f) X.B FILE *f; X.fi X.SH DESCRIPTION Xfdown(), given a standard I/O FILE *f, returns the file Xnumber. A file number is usually a small number like 2 Xwhich is not a unique number system-wide but is peculiar to the Xspecified process. Xfdown() can be used to implement additional functions not Xprovided for in the standard I/O library. It verifies that the Xfile was opened via fileopen(). X.SH RETURNS XReturns the actual system file number. X.SH NOTES XSince this call is system dependent, it should be used Xcarefully. END-of-star-1.6/libschily/fdown.3 echo x - star-1.6/libschily/fdup.3 sed 's/^X//' >star-1.6/libschily/fdup.3 << 'END-of-star-1.6/libschily/fdup.3' X. \" Manual Seite fuer fdup X. \" @(#)fdup.3 1.1 X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH FDUP 3 "15. Juli 1988" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xfdup() \- returns new file identical to the given file X.SH SYNOPSIS X.nf X.B XFILE fdup(f) X.B FILE *f; X.fi X.SH DESCRIPTION Xfdup() creates a new file stream which accesses the same file as Xf. The new file will have the same read/write/buffered Xattributes as the old file. Xfdup() can be used to simultaneously read from two different Xpositions in a file. X.SH RETURNS XReturns the duplicate file, if successful. XReturns NULL, if it could not create the new stream. X.SH NOTES XThis call should be used carefully on buffered files open for Xwriting. Changes made on one stream might be superseded by Xchanges made on the other. END-of-star-1.6/libschily/fdup.3 echo x - star-1.6/libschily/fexecl.3 sed 's/^X//' >star-1.6/libschily/fexecl.3 << 'END-of-star-1.6/libschily/fexecl.3' X. \" Manual Seite fuer fexecl X. \" @(#)fexecl.3 1.1 X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH FEXECL 3 "15. Juli 1988" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xfexecl() \- executes a program X.SH SYNOPSIS X.nf X.B Xfexecl(name, in, out, err, arg0, arg1, \|.\|.\|. argn, NULL) X.B char *name; X.B FILE *in, *out, *err; X.B char *arg0\|.\|.\|.*argn; X.fi X.SH DESCRIPTION Xfexecl() is a variation of fexecve(). The description of Xfexecve() applies to fexecl(), with two exceptions. XFirst, fexecl() does not permit the environment list to be Xspecified; it causes the new program to have the same Xenvironment as the current program, using the global environment Xpointer environ. XSecond, the argument list for the new program is constructed as Xpart of the call to fexecl(). This is a lot easier to write Xthan the code to construct a vector of strings, but is limited Xto cases with a fixed number of arguments. The argument list Xwill consist of the strings a0, a1, and so on. By convention, Xa0 is the name of the new program. X.SH RETURNS XReturns system error code; doesn't return if successful. X.SH NOTES Xnone END-of-star-1.6/libschily/fexecl.3 echo x - star-1.6/libschily/fexecle.3 sed 's/^X//' >star-1.6/libschily/fexecle.3 << 'END-of-star-1.6/libschily/fexecle.3' X. \" Manual Seite fuer fexecle X. \" @(#)fexecle.3 1.1 X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH FEXECLE 3 "15. Juli 1988" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xfexecle() \- executes a program X.SH SYNOPSIS X.nf X.B Xfexecle(name, in, out, err, a0, a1, a2, \|.\|.\|. NULL, envptr) X.B char *name; X.B FILE *in, *out, *err; X.B char *a0, *a1, *a2\|.\|.\|.; X.B char **envptr; X.fi X.SH DESCRIPTION Xfexecle() is a variation of fexecve(). XThe description for fexecve() also applies to fexecle() except Xfor the argument list. fexecle() permits the argument list, Xwhich is a vector of pointers with a NULL at the end, to be Xconstructed as part of the call to fexecle(), rather than as a C Xvector. Thus, in the new program, av[0] will be the same as a0 Xin this program, etc. X.SH RETURNS XReturns a system error code; fexecle() does not return if it Xsucceeds. X.SH NOTES Xnone END-of-star-1.6/libschily/fexecle.3 echo x - star-1.6/libschily/fexecv.3 sed 's/^X//' >star-1.6/libschily/fexecv.3 << 'END-of-star-1.6/libschily/fexecv.3' X. \" Manual Seite fuer fexecv X. \" @(#)fexecv.3 1.1 X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH FEXECV 3 "15. Juli 1988" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xfexecv() \- executes a program X.SH SYNOPSIS X.nf X.B Xfexecv(name, in, out, err, ac, av) X.B char *name; X.B FILE *in, *out, *err; X.B int ac; X.B char **av; X.fi X.SH DESCRIPTION Xfexecv() functions identically to fexecve() except that fexecv() Xpasses the current environment list ( environ ) to the new Xprogram, where fexecve() passes the environment list specified Xas one of its arguments. X.SH RETURNS XReturns a system error code; fexecv() does not normally return. X.SH NOTES Xnone END-of-star-1.6/libschily/fexecv.3 echo x - star-1.6/libschily/fexecve.3 sed 's/^X//' >star-1.6/libschily/fexecve.3 << 'END-of-star-1.6/libschily/fexecve.3' X. \" Manual Seite fuer fexecve X. \" @(#)fexecve.3 1.1 X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH FEXECVE 3 "15. Juli 1988" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xfexecve() \- executes a program X.SH SYNOPSIS X.nf X.B Xfexecve (name, in, out, err, argptr, envptr) X.B char *name; X.B FILE *in, *out, *err; X.B char **argptr, **envptr; X.fi X.SH DESCRIPTION Xfexecve() causes the current process to execute a new program. XThe text, data, and stack segments of the process are discarded Xand replaced with the text and data sections of the new object Xfile and a new stack. The argument list and environment list Xare copied into the new address space where they become the Xarguments to the entry point of the new program. X.PP Xname is a string containing the name of the object file to be Xexecuted. If the name contains a slash (/), it is assumed to be Xa pathname to the file. If there is no slash, fexecve() Xsearches for the file in a list of directories contained in the Xenvironment variable PATH, or if there is no such variable, it Xsearches the working directory first, then /bin. The PATH Xvariable (which is taken from the new environment list envptr ) Xhas a value which is a series of directory names separated by Xcolons. The working directory is represented in this list by Xomitting a name (before the first colon, between two colons, or Xafter the last colon). Thus the default search rules may be Xexpressed as X.PP X.B "PATH=:/bin" X.PP Xin, out, and err are files which are to be substituted for Xstdin, stdout, and stderr, respectively, when the new program is Xexecuted. X.PP Xargptr and envptr are pointers to arrays of pointers to strings, Xwith a NULL pointer as the last element of the array. By Xconvention, argptr[0] is the name of the program. X.SH RETURNS XReturns a standard system error code; fexecve() does not return Xif it succeeds, as the program that calls it is no longer in Xthis process's memory. X.SH NOTES XIf a program needs to run another program without destroying Xitself, it can use fork(), some variation of fexecve(), and Xcwait(). These three functions are combined in spawnl() and Xspawnv(). END-of-star-1.6/libschily/fexecve.3 echo x - star-1.6/libschily/fgetline.3 sed 's/^X//' >star-1.6/libschily/fgetline.3 << 'END-of-star-1.6/libschily/fgetline.3' X. \" Manual Seite fuer fgetline X. \" @(#)fgetline.3 1.1 X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH FGETLINE 3 "15. Juli 1988" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xfgetline() \- gets a line from a file X.SH SYNOPSIS X.nf X.B Xint fgetline(f,buf,length) X.B FILE *f; X.B char *buf; X.B int length; X.fi X.SH DESCRIPTION Xfgetline() reads up to length characters from the input file Xusing getc() (q.v.). The transfer is also terminated by a Xnewline, end of file, or read error. The newline character is Xstripped and the string is NULL ('\\0') terminated. X.SH RETURNS X.TP X.B >=0 Xthe number of bytes read. X.TP X.B < 0 Xif an error occurred. X.SH NOTES Xnone END-of-star-1.6/libschily/fgetline.3 echo x - star-1.6/libschily/file_raise.3 sed 's/^X//' >star-1.6/libschily/file_raise.3 << 'END-of-star-1.6/libschily/file_raise.3' X. \" Manual Seite fuer file_raise X. \" @(#)file_raise.3 1.1 X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH FILE_RAISE 3 "15. Juli 1988" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xfile_raise() \- controls raising of file_read_err and Xfile_write_err X.SH SYNOPSIS X.nf X.B Xfile_raise(f,flag) X.B FILE *f; X.B BOOL flag; X.fi X.SH DESCRIPTION Xfile_raise() can be used to control whether the conditions X"file_read_err" and "file_write_err" are raised when an error Xoccurs during an I/O function ( fileread(), filewrite() , etc) Xon FILE f. Calling file_raise() with the flag TRUE enables Xraising, calling it with flag FALSE disables raising. If raising Xis disabled and an error occurs the function will return an Xappropriate error code, this is equivalent to handling the Xcondition and ignoring it. The default is to raise the Xconditions. X.SH RETURNS Xnone X.SH NOTES Xnone END-of-star-1.6/libschily/file_raise.3 echo x - star-1.6/libschily/fileclose.3 sed 's/^X//' >star-1.6/libschily/fileclose.3 << 'END-of-star-1.6/libschily/fileclose.3' X. \" Manual Seite fuer fclose X. \" @(#)fclose.3 1.1 X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH FILECLOSE 3 "15. Juli 1988" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xfileclose() \- closes a file X.SH SYNOPSIS X.nf X.B Xfileclose(f) X.B FILE *f; X.fi X.SH DESCRIPTION Xfileclose() closes the file f and flushes all buffers. X.SH RETURNS X.TP X.B 0 Xon success X.TP X.B EOF Xon error Xnone X.SH NOTES Xnone END-of-star-1.6/libschily/fileclose.3 echo x - star-1.6/libschily/fileluopen.3 sed 's/^X//' >star-1.6/libschily/fileluopen.3 << 'END-of-star-1.6/libschily/fileluopen.3' X. \" Manual Seite fuer fileluopen X. \" @(#)fileluopen.3 1.1 X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH FILELUOPEN 3 "15. Juli 1988" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xfileluopen() \- opens a file given a logical unit number X.SH SYNOPSIS X.nf X.B XFILE *fileluopen(lu, modes) X.B int lu; X.B char *modes; X.fi X.SH DESCRIPTION Xfileluopen() makes an object of type FILE, suitable for use with Xfileread(), putc(), etc. X.PP XThe lu argument is a logical unit number assigned by the kernel Xwhen it opens a file. Logical unit numbers are not usually Xvisible, although several routines reguire LUs as Xarguments and fdown() may be used to map a FILE object to a Xcorresponding LU number. X.PP XThe modes argument is a string encoding the modes of the file, Xjust as for fileopen(), except that the 'c' and 't' options are Xnot allowed. X.SH RETURNS XReturns the FILE value. X.SH NOTES Xnone END-of-star-1.6/libschily/fileluopen.3 echo x - star-1.6/libschily/fileopen.3 sed 's/^X//' >star-1.6/libschily/fileopen.3 << 'END-of-star-1.6/libschily/fileopen.3' X. \" Manual Seite fuer fileopen X. \" @(#)fileopen.3 1.1 X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH FILEOPEN 3 "15. Juli 1988" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xfileopen() \- opens or creates files X.SH SYNOPSIS X.nf X.B XFILE *fileopen(filename,modes) X.B char *filename; X.B char *modes; X.fi X.SH DESCRIPTION Xfileopen() opens filename. The mode is specified by the Xcharacters from the following set: X.TP X.B a Xseek to end-of-file after opening X.TP X.B c Xcreate file if necessary X.TP X.B r Xallow read access X.TP X.B t Xtruncate file after opening if it already exists X.TP X.B u Xunbuffered all read/writes directly to system X.TP X.B w Xallow write access X.SH RETURNS XNULL open failed. Xother value should be used in other I/O calls and is of the Xtype FILE. X.SH NOTES XThe file is opened with rw rw access. XIf there is not enough room to allocate a buffer, the file is Xopened in an unbuffered mode. There is a limit to the number of Xopen files. END-of-star-1.6/libschily/fileopen.3 echo x - star-1.6/libschily/filepos.3 sed 's/^X//' >star-1.6/libschily/filepos.3 << 'END-of-star-1.6/libschily/filepos.3' X. \" Manual Seite fuer filepos X. \" @(#)filepos.3 1.1 X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH FILEPOS 3 "15. Juli 1988" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xfilepos() \- returns the logical position in a file X.SH SYNOPSIS X.nf X.B Xlong filepos(f) X.B FILE *f; X.fi X.SH DESCRIPTION Xfilepos() returns the current file position as an offset in bytes Xfrom the beginning of the file. This is the position of the next Xbyte to be read or written. X.SH RETURNS XReturns the current offset into file f. X.SH NOTES XThe numbering of bytes in a file starts at 0. For byte Xsequential devices, such as a terminal, the value returned will Xbe the number of bytes read or written from the current file, Xunless a seek call is issued which changes the logical position Xbut does not affect the device. X.PP XFile positions may be set to arbitrary values (via fileseek() ) Xand are only used by the file system when actual reading or Xwriting occur. X.PP XNormally, the file position is incremented by the amount of data Xtransferred for each sequential read or write. END-of-star-1.6/libschily/filepos.3 echo x - star-1.6/libschily/fileread.3 sed 's/^X//' >star-1.6/libschily/fileread.3 << 'END-of-star-1.6/libschily/fileread.3' X. \" Manual Seite fuer fileread X. \" @(#)fileread.3 1.1 X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH FILEREAD 3 "15. Juli 1988" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xfileread() \- reads file into buffer X.SH SYNOPSIS X.nf X.B Xint fileread(f,buf,size) X.B FILE *f; X.B char *buf; X.B int size; X.fi X.SH DESCRIPTION Xfileread() reads up to size bytes from the file into buf. The Xnumber actually read may be smaller if end-of-file is reached. XThe file pointer (implied) is left pointing to one past the last Xcharacter read. X.SH RETURNS X.TP X.B > 0 Xthe number of bytes actually read. X.TP X.B = 0 Xfile was at end-of-file. X.TP X.B < 0 Xerror code. X.PP XIt returns the number of bytes actually read or an error Xcode. X.SH NOTES XThe buffer must be at least size long. If reading from a "raw" Xdevice, size must be a multiple of 512. END-of-star-1.6/libschily/fileread.3 echo x - star-1.6/libschily/filereopen.3 sed 's/^X//' >star-1.6/libschily/filereopen.3 << 'END-of-star-1.6/libschily/filereopen.3' X. \" Manual Seite fuer filereopen X. \" @(#)filereopen.3 1.1 X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH FILEREOPEN 3 "15. Juli 1988" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xfilereopen() \- opens a new file on an open stream X.SH SYNOPSIS X.nf X.B XFILE *filereopen(filename,modes,f) X.B char *name; X.B char *modes; X.B FILE *f; X.fi X.SH DESCRIPTION Xfilereopen() opens the file filename with modes modes on stream Xf. modes has the same format as for fileopen(). The stream f Xmust be open. X.SH RETURNS X.TP X.B NULL Xreopen failed. X.TP X.B other Xold stream. X.SH NOTES Xnone END-of-star-1.6/libschily/filereopen.3 echo x - star-1.6/libschily/fileseek.3 sed 's/^X//' >star-1.6/libschily/fileseek.3 << 'END-of-star-1.6/libschily/fileseek.3' X. \" Manual Seite fuer fileseek X. \" @(#)fileseek.3 1.1 X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH FILESEEK 3 "15. Juli 1988" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xfileseek() \- sets file position X.SH SYNOPSIS X.nf X.B Xfileseek(f,offset) X.B FILE *f; X.B long offset; X.fi X.SH DESCRIPTION Xfileseek() sets the logical position in the file f to offset. XThe next read or write operation begins with the byte at the new Xoffset. X.SH RETURNS Xnone X.SH NOTES XFile positions begin with 0 for the first byte. When writing, Xit is legal to seek beyond the end of file. END-of-star-1.6/libschily/fileseek.3 echo x - star-1.6/libschily/filesize.3 sed 's/^X//' >star-1.6/libschily/filesize.3 << 'END-of-star-1.6/libschily/filesize.3' X. \" Manual Seite fuer filesize X. \" @(#)filesize.3 1.1 X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH FILESIZE 3 "15. Juli 1988" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xfilesize() \- returns size of file X.SH SYNOPSIS X.nf X.B Xlong filesize(f) X.B FILE *f; X.fi X.SH DESCRIPTION Xfilesize() returns the file size in bytes. X.SH RETURNS X.TP X.B >= 0 Xfilesize. X.TP X.B < 0 Xan error code. X.SH NOTES XIf the file was written in the current process and was buffered, Xdo a fflush() before using filesize() X..PP XNOTE: The call does not work on terminals or other devices. END-of-star-1.6/libschily/filesize.3 echo x - star-1.6/libschily/filestat.3 sed 's/^X//' >star-1.6/libschily/filestat.3 << 'END-of-star-1.6/libschily/filestat.3' X. \" Manual Seite fuer filestat X. \" @(#)filestat.3 1.1 X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH FILESTAT 3 "15. Juli 1988" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xfilestat() \- copies file descriptor information to buffer X.SH SYNOPSIS X.nf X.B Xint filestat(f,buf) X.B FILE *f; X.B FILEDESC *buf; X.fi X.SH DESCRIPTION Xfilestat() places system dependent information about the file f Xinto the buffer buf. X.SH RETURNS XReturns a value equal to or greater than zero when successful. XOtherwise, returns the standard error code. X.SH NOTES XThe size and the interpretation of the buffer is system Xdependent. To use filestat() include . END-of-star-1.6/libschily/filestat.3 echo x - star-1.6/libschily/filewrite.3 sed 's/^X//' >star-1.6/libschily/filewrite.3 << 'END-of-star-1.6/libschily/filewrite.3' X. \" Manual Seite fuer filewrite X. \" @(#)filewrite.3 1.1 X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH FILEWRITE 3 "15. Juli 1988" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xfilewrite() \- writes into file X.SH SYNOPSIS X.nf X.B Xint filewrite(f,buf,size) X.B FILE *f; X.B char *buf; X.B int size; X.fi X.SH DESCRIPTION Xfilewrite() writes the size bytes starting at buf into the file. XThe file must be open for writing. X.SH RETURNS X.TP X.B >= 0 Xthe number of bytes written. X.TP X.B < 0 Xerror code. X.SH NOTES XThe process suspends if any of the error conditions are not Xhandled. X.PP XWriting anywhere in the file is allowed. When writing to "raw" Xdevices the size must be multiples of 512. END-of-star-1.6/libschily/filewrite.3 echo x - star-1.6/libschily/findline.3 sed 's/^X//' >star-1.6/libschily/findline.3 << 'END-of-star-1.6/libschily/findline.3' X. \" Manual Seite fuer findline X. \" @(#)findline.3 1.1 X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH FINDLINE 3 "15. Juli 1988" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xfindline() \- finds a line that has a matching field X.SH SYNOPSIS X.nf X.B Xint findline(fname,delim,string,field,array,arraysize) X.B X char *fname; /* file name */ X.B X char delim; /* field delimiter */ X.B X char *string; /* string to match */ X.B X int field; /* field number to match, 0-n */ X.B X char *array[]; /* array to fill pointers in */ X.B X int arraysize; /* number of entries in the arrays */ X.fi X.SH DESCRIPTION Xfindline() retrieves specific fields from the first line of the Xfile fname. X.PP Xfindline() fills in array with pointers to strings that make up Xthe fields on the line. The strings are allocated new storage. XThe field delimiter, delim, is used to break up each line of the Xfile into fields. string is the string to match. fieldno is Xthe field number to match. Fields are numbered 0..n. array is Xan array of pointers to fill in. arraysize is the number of Xelements in the array. X.SH RETURNS X.TP X.B +1 Xmatch. X.TP X.B \-1 Xno match. X.TP X.B \-2 Xarg error. X.TP X.B \-3 Xcannot open file. X.TP X.B \-4 Xnot enough memory to allocate space for fields. X.SH NOTES XEach line of the file must be less than 512 characters long. END-of-star-1.6/libschily/findline.3 echo x - star-1.6/libschily/flush.3 sed 's/^X//' >star-1.6/libschily/flush.3 << 'END-of-star-1.6/libschily/flush.3' X. \" Manual Seite fuer flush X. \" @(#)flush.3 1.1 X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH FLUSH 3 "15. Juli 1988" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xflush() \- flushes the buffer for standard output X.SH SYNOPSIS X.B Xflush() X.SH DESCRIPTION Xflush() prompts to standard output. It is used because the Xoutput is not visible to the user until a flush(), close() or Xexit() is done. X.SH RETURNS Xnone X.SH NOTES Xflush() is defined in the standard header file, stdio.h, as Xfflush(stdout). END-of-star-1.6/libschily/flush.3 echo x - star-1.6/libschily/fnmatch.3 sed 's/^X//' >star-1.6/libschily/fnmatch.3 << 'END-of-star-1.6/libschily/fnmatch.3' X.\" Copyright (c) 1989, 1991, 1993 X.\" The Regents of the University of California. All rights reserved. X.\" X.\" This code is derived from software contributed to Berkeley by X.\" Guido van Rossum. X.\" Redistribution and use in source and binary forms, with or without X.\" modification, are permitted provided that the following conditions X.\" are met: X.\" 1. Redistributions of source code must retain the above copyright X.\" notice, this list of conditions and the following disclaimer. X.\" 2. Redistributions in binary form must reproduce the above copyright X.\" notice, this list of conditions and the following disclaimer in the X.\" documentation and/or other materials provided with the distribution. X.\" 3. All advertising materials mentioning features or use of this software X.\" must display the following acknowledgement: X.\" This product includes software developed by the University of X.\" California, Berkeley and its contributors. X.\" 4. Neither the name of the University nor the names of its contributors X.\" may be used to endorse or promote products derived from this software X.\" without specific prior written permission. X.\" X.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND X.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE X.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE X.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE X.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL X.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS X.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) X.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT X.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY X.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF X.\" SUCH DAMAGE. X.\" X.\" @(#)fnmatch.3 8.3 (Berkeley) 4/28/95 X.\" X.Dd April 28, 1995 X.Dt FNMATCH 3 X.Os X.Sh NAME X.Nm fnmatch X.Nd match filename or pathname X.Sh SYNOPSIS X.Fd #include X.Ft int X.Fn fnmatch "const char *pattern" "const char *string" "int flags" X.Sh DESCRIPTION XThe X.Fn fnmatch Xfunction Xmatches patterns according to the rules used by the shell. XIt checks the string specified by the X.Fa string Xargument to see if it matches the pattern specified by the X.Fa pattern Xargument. X.Pp XThe X.Fa flags Xargument modifies the interpretation of X.Fa pattern Xand X.Fa string . XThe value of X.Fa flags Xis the bitwise inclusive X.Tn OR Xof any of the following Xconstants, which are defined in the include file X.Pa fnmatch.h . X.Bl -tag -width FNM_PATHNAME X.It Dv FNM_NOESCAPE XNormally, every occurrence of a backslash X.Pq Ql \e Xfollowed by a character in X.Fa pattern Xis replaced by that character. XThis is done to negate any special meaning for the character. XIf the X.Dv FNM_NOESCAPE Xflag is set, a backslash character is treated as an ordinary character. X.It Dv FNM_PATHNAME XSlash characters in X.Fa string Xmust be explicitly matched by slashes in X.Fa pattern . XIf this flag is not set, then slashes are treated as regular characters. X.It Dv FNM_PERIOD XLeading periods in strings match periods in patterns. XThe definition of ``leading'' is related to the specification of X.Dv FNM_PATHNAME. XA period is always ``leading'' if it is the first character in X.Ar string . XAdditionally, if X.Dv FNM_PATHNAME Xis set, Xa period is ``leading'' if it immediately follows a slash. X.El X.Sh RETURN VALUES XThe X.Fn fnmatch Xfunction returns zero if X.Fa string Xmatches the pattern specified by X.Fa pattern , Xotherwise, it returns the value X.Dv FNM_NOMATCH . X.Sh SEE ALSO X.Xr sh 1 , X.Xr glob 3 , X.Xr regex 3 X.Sh STANDARDS XThe X.Fn fnmatch Xfunction conforms to X.St -p1003.2 . X.Sh HISTORY XThe X.Fn fnmatch Xfunction first appeared in X.Bx 4.4 . X.Sh BUGS XThe pattern X.Ql * Xmatches the empty string, even if X.Dv FNM_PATHNAME Xis specified. END-of-star-1.6/libschily/fnmatch.3 echo x - star-1.6/libschily/format.3 sed 's/^X//' >star-1.6/libschily/format.3 << 'END-of-star-1.6/libschily/format.3' X'\" t X. \" Manual Seite fuer format X. \" @(#)format.3 1.4 17/12/08 Copyright 1985-2017 J. Schilling X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH FORMAT 3 "2017/12/08" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xformat() \- generates formatted output as in printf X.SH SYNOPSIS X.nf X.B Xint format(cfun, farg, formatstr, formatargs) X.B int (*cfun)(); X.B void *farg; X.B char *formatstr; X.B va_list formatargs; X.fi X.SH DESCRIPTION Xformat() generates ASCII data, based on a specified input Xstring. format() knows how to create ASCII representations of Xall C data types. X.PP XThis subroutine takes four arguments: X.TP X.B cfun Xis the address of a function declared in C as X.RS X.PP X.nf X.B int cfun(ch, farg) X.B char ch; X.B void *farg; X.fi X.PP Xcfun is called with each character generated by format(). Xfarg is an arbitrary value passed as the second argument to Xcfun. X.RE X.TP X.B formatstr Xis a format string that controls the output, as Xdescribed below. X.TP X.B formatargs Xpoints to a list of arguments that are to be Xformatted. X.PP X.B Formatting Options X.PP XThe formatting, although complicated, has a great deal of Xflexibility. The format string contains a string to be Xprocessed and places where other strings can be inserted. These Xplaces are denoted by a % followed by characters which specify Xhow the next argument from formatargs is to be placed in the Xstring. For example, %c inserts a character. The format string X"I am printing the letter %c." with the character 'f' results in Xthe string, "I am printing the letter f." X.PP XThe simplest formatting options are as follows: X.TP X.B %c Xoutputs byte as a character X.TP X.B %d Xoutputs integer as a decimal number X.TP X.B %i Xoutputs integer as a decimal number X.TP X.B %D Xoutputs long as a decimal number X.TP X.B %o Xoutputs integer as an octal number X.TP X.B %O Xoutputs long as an octal number X.TP X.B %u Xoutputs unsigned integer as a decimal number X.TP X.B %x Xoutputs integer as a hexadecimal number X.TP X.B %X Xoutputs long as a hexadecimal number X.TP X.B %l Xoutputs long decimal X.TP X.B %ld Xoutputs long decimal X.TP X.B %li Xoutputs long decimal X.TP X.B %lo Xoutputs long octal X.TP X.B %lu Xoutputs unsigned long as a decimal number X.TP X.B %lx Xoutputs long hexadecimal X.PP XFor more specialized formatting, use the portable set. The Xsyntax for the portable set is: X.PP X.I % X.PP X.I , , Xand X.I Xare one character options, Xas follows: X.PP X.TS Xcenter; Xcb cb lb Xci c l. XOption Character Means X.sp .5 X U unsigned X none signed X.sp .5 X C char X I int X S short X L long X.sp .5 X O octal X X hexadecimal X D decimal X.TE X.PP X.I Xindicates the type of argument, while X.I Xindicates the type of format you want X.I Xprinted in. X.PP XFor example, use %CO to output a character in octal or %US to Xoutput an unsigned short in decimal. X.PP XNote that in X.I The C Programming Language, XKernighan and Ritchie Xdocument %x and %d; in the portable set, %IX performs the same Xfunction as %x, while %ID performs the same function as %d. X.PP XUsing U for the X.I Xoption is only useful when D is used as the X.I Xoption because octal and hexadecimal numbers are never signed. X.PP X.B Specifying Field Width X.PP XAny type of formatting option can also have a number which Xfurther specifies the formatting. The number appears after the Xpercent sign and before any characters. The number is of the Xform X.I y.z Xand can be negative. X.PP X.I y Xspecifies the minimum number of characters that the formatted Xargument will fill. If the number is positive, the result will Xbe right justified. If it is negative, the result will be left Xjustified. This only specifies a minimum, so if there are more Xcharacters than can fit into X.I y Xcharacters, the rest will be Xprinted. Thus, "%6c" with the character 'f' results in the Xfollowing: X.PP X.TS Xcenter; Xl l. X.B X"%6c" "\ \ \ \ \ f" X.B X"%-6c" "f\ \ \ \ \ " X.TE X.PP XA leading 0 in the X.I y Xspecification causes zero filling for the Xright justification, so 3 printed in %06d yields "000003". The Xzero does not mean octal. X.PP X.I z Xspecifies a maximum number of characters or significant digits Xand is not used for the above types because they are all fixed Xlength. The X.I z Xis, however, used in %s, %b, %e, %f, and %g formats. X.LP XA field width or the significant digits or both may be Xindicated by an asterisk X.RB ( \(** ) Xinstead of a digit string. XIn this case, an integer X.I arg Xsupplies Xthe field width or the significant digits. The X.I arg Xthat is actually converted is not fetched until Xthe conversion letter is seen, so the X.IR arg s Xspecifying field width or the significant digits must appear X.I before Xthe X.I arg X(if any) to be converted. XA negative field width argument is taken as a X.RB ` \- ' Xflag followed by a positive field width. XIf the significant digits argument is negative, Xit will be changed to zero. X.TP X.B %s XInserts a string. X.RS X.PP XUseful for printing strings that have no null terminator. XThe minimum width of the string is X.I y Xand the maximum width Xof the string is X.I z. X.PP XNOTE: When string formatting reaches a null, the Xformatting stops. If the X.I y Xfield has specified more Xcharacters, the result is padded with blanks. Thus, Xformatting "test" results in the following: X.PP X.TS Xcenter; Xl l. X.B X"%6s" "\ \ test" X.B X"%-6s" "test\ \ " X.B X"%.2" "te" X.B X"%6.2" "\ \ \ \ te" X.TE X.RE X.TP X.B %b XInserts a string bounded by a length. X.RS X.PP XThis actually uses TWO arguments: the first is a string, Xand the second is a number. For instance: X.PP X.B X"%b", x, 3 Xis the same as X.B X"%.3s", x X.PP XThe number argument is used as the maximum number of Xcharacters in the string. %b is used when the number of Xcharacters used might change with different calls. X.RE X.TP X.B %e XInserts a floating number in 'e format'. X.br XThis is of the form "~.####e*&&": X.RS X.TP X.B ~ Xeither a minus sign or nothing X.TP X.B #'s Xthe digits of the mantissa X.TP X.B * Xeither plus or minus X.TP X.B &'s Xthe digits of the exponent X.PP XThus, 43.5 is formatted as .435e+02 and \-.00435 is Xformatted as \-.435e-02. There are always two digits of Xexponent. The X.I y Xfield gives a minimum width for the entire number, and the X.I z Xfield gives the maximum number of digits in the mantissa. X.I z Xdefaults to 6. Thus, formatting 43.5 results in the following: X.PP X.TS Xcenter; Xl l. X.B X"%10e" "\ \ .435e+02" X.B X"%-10e" ".435e+02\ \ " X.B X"%5e" ".435e+02" X.B X"%10.1e" "\ \ \ \ .4e+02" X.TE X.RE X.TP X.B %E XInserts a floating number in 'E format'. X.br XThis is of the form "~.####E*&&", and identical Xto the X.B %e Xformat except that X.B E Xis used instead of X.B e Xin the exponent. X.TP X.B %f XInserts a floating number in 'f format'. X.br XThis is of the form "~####.&&": X.RS X.TP X.B ~ Xeither a minus sign or nothing X.TP X.B #'s Xthe digits before the decimal point X.TP X.B &'s Xthe digits after the decimal point X.PP XThe number of #'s is always the number needed. Again, the X.I y Xfield gives a minimum on the size of the entire number, Xwhile the X.I z Xfield is the number of significant digits to Xkeep after the decimal point. X.I z Xdefaults to 6. Thus, Xformatting 1.23456 results in the following: X.PP X.TS Xcenter; Xl l. X.B X"%10f" "\ \ 1.234560" X.B X"%-10f" "1.234560\ \ " X.B X"%.2f" "1.23" X.B X"%5.2f" "\ 1.23" X.TE X.RE X.TP X.B %F XInserts a floating number in 'F format'. X.br XThis is mainly the same as the X.B %f Xformat. X.TP X.B %g XInserts a floating number in optional format. X.RS X.PP XPrints in either %e or %f format, whichever is shorter, Xwith the minimum number of digits needed to the right of Xthe decimal. Whole numbers will have no digits to the Xright of the decimal because trailing zeroes are Xsuppressed. X.I z Xgives the maximum number of significant Xdigits including digits before the decimal point. X.I z Xdefaults to 6. For example, the format string "%10.4g" Xresults in the following: X.PP X.TS Xcenter; Xl l. X.B X435.0 "\ \ \ \ \ \ 435." X.B X4.35 "\ \ \ \ \ \ 4.35" X.B X\&.0435 "\ \ .435e-01" X.B X\&.000435 "\ \ .435e-03" X.TE X.RE X.TP X.B %G XInserts a floating number in 'G format'. X.br XThis outputs the form "~.####E*&&" in case that the exponent Xvariant is used. X.TP X.B %r XRecursive or remote format. X.RS X.PP XThis takes two arguments: the first is a format string, Xand the second is a pointer to the argument list. The new Xformat string is formatted and put out in place of the %r. X.PP XThe field width and significant digit specification is ignored Xwithin the %r format. The recursive format makes it possible to write Xvariable arg printing routines without using format(3) directly. X.RE X.TP X.B %% XInserts %. X.RS X.PP XA double percent sign in the format string becomes a Xsingle percent sign in the output. This does not use an Xargument. X.RE X.TP X.B % XInserts spaces. X.RS X.PP XA space character as a format control causes a field of X.I y Xspaces to be output. This does not use an argument. XNote that an actual space should appear where appears Xabove. X.SH RETURNS Xthe number of characters transmitted exluding the trailing null byte. X.SH EXAMPLES X.TP X.B 1. X.B fprintf() X(formatted print to a file) could be implemented this way: X.RS X.PP X.nf X#include X#include X/* VARARGS2 */ Xfprintf(f, fmt, va_alist) X FILE *f; X char *fmt; X va_dcl X{ X va_list args; X extern int fputc(); X X va_start(args); X format(&fputc, (long)f, fmt, args); X va_end(args); X} X.RE X.fi X.TP X.B 2. X.B comerr() Xcould be implemented this way: X.RS X.PP X.nf X#include X#include X/* VARARGS1 */ Xcomerr(fmt, va_alist) X char *fmt; X va_dcl X{ X va_list args; X int err; X char errbuf[20]; X char *errnam; X extern int errno; X extern int sys_nerr; X extern char *sys_errlist[]; X X err = errno; X va_start(args); X if (err < 0) { X fprintf(stderr, "Progname: %r", fmt, args); X } else { X if (err >= sys_nerr) { X sprintf(errbuf, "Error %d", err); X errnam = errbuf; X } else { X errnam = sys_errlist[err]; X } X fprintf(stderr, "Progname: %s. %r", X errnam, fmt, args); X } X va_end(args); X exit(err); X} X.RE X.fi X.SH "SEE ALSO" Xcomerr(3), error(3), fprintf(3), printf(3), sprintf(3) X.SH NOTES XIf there are no floating point operations anywhere in the Xprogram, the floating point package is not loaded and therefore Xfloating point printing commands will possibly not work correctly. X.PP XTo just print a string without any formatting, use the %s format Xto ensure that the string is correctly interpreted. This is Xespecially important if the string itself contains % characters, Xbecause format() will attempt to interpret them, which causes Xunwanted additions in the output string. The number of Xcharacters inserted for either %s or %b should be less than 512. END-of-star-1.6/libschily/format.3 echo x - star-1.6/libschily/fpipe.3 sed 's/^X//' >star-1.6/libschily/fpipe.3 << 'END-of-star-1.6/libschily/fpipe.3' X. \" Manual Seite fuer fpipe X. \" @(#)fpipe.3 1.1 X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH FPIPE 3 "15. Juli 1988" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xfpipe() \- sets up a two ended pipe X.SH SYNOPSIS X.nf X.B Xint fpipe(pp) X.B FILE *pp[2]; X.fi X.SH DESCRIPTION Xfpipe() sets up a two ended pipe: X.TP X.B pp[0] Xis set to a FILE open for reading. X.TP X.B pp[1] Xis open for writing. X.SH RETURNS XNULL a pipe could not be created. Xother completed successfully. X.SH NOTES Xnone END-of-star-1.6/libschily/fpipe.3 echo x - star-1.6/libschily/fprintf.3 sed 's/^X//' >star-1.6/libschily/fprintf.3 << 'END-of-star-1.6/libschily/fprintf.3' X. \" Manual Seite fuer fprintf X. \" @(#)fprintf.3 1.1 X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH FPRINTF 3 "15. Juli 1988" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xfprintf() \- formats and prints to a file X.SH SYNOPSIS X.nf X.B Xfprintf(file, format, arg1, \|.\|.\|., argn) X.B FILE *file; X.B char *format; X.fi X.SH DESCRIPTION Xfprintf formats its arguments using the format() routine, and Xwrites the result on the given file. X.PP XSee format() for information about the available formatting Xoptions. X.SH RETURNS Xnone X.SH "SEE ALSO" Xformat(3), printf(3) X.SH NOTES Xnone END-of-star-1.6/libschily/fprintf.3 echo x - star-1.6/libschily/getallargs.3 sed 's/^X//' >star-1.6/libschily/getallargs.3 << 'END-of-star-1.6/libschily/getallargs.3' X. \" Manual Seite fuer getallargs X. \" @(#)getallargs.3 1.5 18/05/22 Copyright 1985-2018 J. Schilling X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH GETALLARGS 3 "2018/05/22" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xgetallargs() \- parses all the flag-type arguments X.SH SYNOPSIS X.nf X#include X X.B Xint getallargs(pac, pav, fmt, a1, \|.\|.\|., an) X.B X int *pac; /* pointer to arg count */ X.B X char *(*pav)[]; /* pointer to address of arg vector */ X.B X char *fmt; /* format string */ X.B X type *a1; /* pointer to result 1 */ X.B X /* (corresponding to the */ X.B X /* first descriptor in fmt) */ X.B X type *an; /* pointer to result n */ X.B X /* (corresponding to the */ X.B X /* nth descriptor in fmt) */ X.fi X.SH DESCRIPTION X.BR getallargs () Xparses all flag (option) arguments (anywhere on the command line). XIt does not return until all the arguments have been parsed Xcorrectly (returning 0), or an error has occurred (returning < X0). X.PP XSee X.BR getargs () Xfor a more detailed description of the parameter Xmatching. X.SH RETURNS X.TP 14 X.B NOARGS\ \ \ \ 0 XAll arguments have been successfully examined. X.TP X.B BADFLAG\ \ \-1 XA bad flag (option) argument was supplied to the program. XThe argument X.B *pav Xcontains the offending command line argument. X.TP X.B BADFMT\ \ \-2 XA bad format descriptor string has been detected. XThe calling program, rather than the user, was in error. X.LP XGeneral rules for the return code: X.TP 14 X.B >\ 0 XA file type argument was found. X.TP X.B \ \ 0 XAll arguments have been parsed. X.TP X.B <\ 0 XAn error occured or not a file type argument. X.LP XFlag and file arg processing should be terminated after getting a Xreturn code <= 0. X X.SH EXAMPLES X X.SH "SEE ALSO" X.nh X.sp X.LP X.BR getargs (3), X.BR getargerror (3), X.BR getfiles (3). X X.SH NOTES X.BR getallargs () Xmust be called with the address of a count of items Xin the vector and the address of a pointer to the vector. Both Xaddresses must already have been properly treated in order to Xskip over the first parameter which is the name of the program. X[e.g. X.BR "\-\-ac; ++av" ]. X.PP XSince X.BR getallargs () Xwill destroy these values, copies should be Xmade for later use in the program. If an error occurs, X.B av[0] Xpoints to the unmatched argument. X.PP XThe special argument, X.B X"\-\-"\fP, Xis ignored, but the following Xargument in the command line is treated as a literal filename Xargument. This way, filenames beginning with X.RB ' \- ', X.RB ' + ', Xor containing X.RB ' = ' Xcan be passed to the routine. X X.SH BUGS Xnone X X.SH AUTHOR X.nf XJ\*org Schilling XSeestr. 110 XD\-13353 Berlin XGermany X.fi X.PP XMail bugs and suggestions to: X.PP X.B Xjoerg.schilling@fokus.fraunhofer.de Xor X.B Xjoerg@schily.net END-of-star-1.6/libschily/getallargs.3 echo x - star-1.6/libschily/getargs.3 sed 's/^X//' >star-1.6/libschily/getargs.3 << 'END-of-star-1.6/libschily/getargs.3' X. \" Manual Seite fuer getargs X. \" @(#)getargs.3 1.6 16/10/13 Copyright 1985 J. Schilling X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH GETARGS 3 "15. Juli 1988" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xgetargs() \- parses arguments until a non-flag is reached X.SH SYNOPSIS X.nf X#include X X.B Xint getargs(pac, pav, fmt, a1, \|.\|.\|., an) X.B X int *pac; /* pointer to arg count */ X.B X char *(*pav)[]; /* pointer to address of arg vector */ X.B X char *fmt; /* format string */ X.B X type *a1; /* pointer to result 1 (corresponding */ X.B X /* to the first descriptor in fmt) */ X.B X type *an; /* pointer to result n (corresponding */ X.B X /* to the nth descriptor in fmt) */ X.B X Xint getlargs(pac, pav, props, fmt, a1, \|.\|.\|., an) X.B X int *pac; /* pointer to arg count */ X.B X char *(*pav)[]; /* pointer to address of arg vector */ X.B X struct ga_props *props; /* control properties */ X.B X char *fmt; /* format string */ X.B X type *a1; /* pointer to result 1 (corresponding */ X.B X /* to the first descriptor in fmt) */ X.B X type *an; /* pointer to result n (corresponding */ X.B X /* to the nth descriptor in fmt) */ X.fi X.SH DESCRIPTION X.BR getargs () Xlooks at each argument that begins with X.RB ' \- ', X.RB ' + ', Xor has an X.RB ' = ' Xin it and trys to find a matching description in X.BR fmt . XIf a match is found, the corresponding value pointed at by X.B a1 Xto X.B an Xis set to the value according to the conversion specification. X.PP X.BR getlargs () Xis similar to X.BR getargs () Xbut it implements an additional X.B ga_props Xparameter that must be initialized with X.BR getarginit () Xbefore it is passed. X.LP XEach normal format takes one address argument from X.B a1 Xto X.B an Xand each function type format takes two address arguments from X.B a1 Xto X.BR an . X.PP XIf a match is not found, X.BR getargs () Xreturns the error code X.BR "\-1 " ( BADFLAG ), Xwith X.B *pav[0] Xpointing to the bad argument. If an argument that does Xnot begin with X.RB ' \- ' Xor X.RB ' + ' Xor contain an X.RB ' = ' Xis found, X.BR getargs () Xreturns X.BR "+1 " ( NOTAFLAG ), Xagain with X.B pav[0] Xpointing to the non-flag argument. XIf the argument "\c X.B \-\-\c X" is found, X.BR getargs () Xreturns X.BR "+2 " ( FLAGDELIM ) Xand X.B pav[0] Xpoints to the argument after the argument "\c X.B \-\-\c X". X.PP XIn the description, it is assumed that X.B pac=&ac Xand X.BR pav=&av , Xwhere X.B ac Xand X.B av Xare the two arguments passed to X.BR main (). XThe pointers are necessary so that X.BR getargs () Xcan update X.B ac Xand X.B av Xas it verifies each argument and reflects the X.I current Xposition back to the user. X.PP XThe format string is a series of one or more option descriptors. XEach option descriptor starts with the X.B option-name Xwhich is composed of X.BR characters , X.BR numbers , Xthe X.BR "underscore character `-'" , X.BR minus Xor X.BR plus , Xwhich must match the option parameter on the command line. XIt is followed by the optional X.B format descriptor Xand an optional X.BR "size modifier" . X.PP XLegal conversions and their meanings are: X.TP X.BR #c " or " #C X.B Char integer X.RS X.PP XThe remainder of the current argument, or if it is Xempty, the next existing argument is converted to a Xcharacter sized integer value. An error in conversion results Xin a X.B BADFLAG Xsituation. X.RE X.TP X.BR #s " or " #S X.B Short integer X.RS X.PP XThe remainder of the current argument, or if it is Xempty, the next existing argument is converted to a Xshort integer value. An error in conversion results Xin a X.B BADFLAG Xsituation. X.RE X.TP X.BR # " or " #i " or " #I X.B Integer X.RS X.PP XThe remainder of the current argument, or, if it is Xempty, the next existing argument is converted to an Xint value. An error in conversion results in a X.B BADFLAG Xsituation. X.RE X.TP X.BR #l " or " #L X.B Long integer X.RS X.PP XThe remainder of the current argument, or if it is Xempty, the next existing argument is converted to a Xlong integer value. An error in conversion results Xin a X.B BADFLAG Xsituation. X.RE X.TP X.BR #ll " or " #LL X.B Long long integer X.RS X.PP XThe remainder of the current argument, or if it is Xempty, the next existing argument is converted to a Xlong long integer value. An error in conversion results Xin a X.B BADFLAG Xsituation. X.RE X.TP X.B + X.BI Increment " sized " integer X.RS X.PP XThe value of the related argument pointer is incremented, assuming a X.I size Xthat depends on the optional X.B size modifier Xafter the X.BR + . XSee the integer conversions above for a list of valid X.BR "size modifiers" . X.RE X.TP X.I empty X.BR BOOL "ean " TRUE X.RS X.PP XIf the X.B option-name Xis not followed by a format descriptor, Xthe value of the related argument pointer is interpreted as an integer Xand set to X.BR TRUE " (" +1 ). X.RE X.TP X.BR %0 " or " %1 X.BI Set " sized " BOOL X.RS X.PP XThe value of the related argument pointer is either set to X.B 0 X(when using the format X.BR %0 ), Xor set to X.B 1 X(when using the format X.BR %1 ), Xassuming a X.I size Xthat depends on the optional X.B size modifier Xafter the X.BR %0 " or " %1 . XSee the integer conversions above for a list of valid X.BR "size modifiers" . X.RE X.TP X.B ? X.B Character X.RS X.PP XThe next character in the current argument is the Xresult. If there is no next char, the result is X.RB ' \e0 '. X.RE X.TP X.B * X.B String X.RS X.PP XA pointer to the remainder of the current argument Xis returned in the related argument pinter. XIf there are no more data in the Xargument the next argument is used, and if there is Xno next argument, a X.B BADFLAG Xsituation is returned. X.RE X.TP X.B & X.B Function X.RS X.PP XThis format takes two parameters in the argument list of X.BR getargs (). XThe first argument is a pointer to a function to call. XThe second argument is a pointer to a variable that is passed to the Xfunction as second argument. X.PP XBecause the argument just after the function address argument is passed Xas a second argument to the function, common routines can have Xtheir results in different places depending on which switch is Xinvoked. X.LP XThe function is called with five arguments: X.TP X.BR 1 ) XA pointer to the option argument, taken from the matching element Xfrom the command line from X.BR *pav . X.TP X.BR 2 ) XA pointer to the variable that should be set by the function. X.TP X.BR 3 ) XThe current value of X.BR pac . X.TP X.BR 4 ) XThe current value of X.BR pav . X.TP X.BR 5 ) XA pointer to the matching part of the format string. X.LP XThe function must return one of these values: X.TP 18 X.BR FLAGDELIM "\ =\ " +2 XPretend that "\c X.B \-\-\c X" stopped flag processing. X.TP X.BR FLAGPARSED "\ =\ " +1 XOption processing was successful. X.TP X.BR NOARGS "\ =\ " 0 XPretend that all arguments have been examined. X.TP X.BR BADFLAG "\ =\ " \-1 XThe current flag argument or parameter is not understood. X.TP X.BR BADFMT "\ =\ " \-2 XAn unspecified error occurred. X.TP X.BR NOTAFILE "\ =\ " \-3 XProbably another flag type argument. XTell the calling function X.RB ( getargs ()) Xto continue to check for other flag type arguments in the Xformat string for a possible match. X.PP XNote: If a flag is found multiple times, the function is called Xeach time. X.RE X.TP X.B ~ X.BR Function " for " BOOL "ean flag X.RS X.PP XThis is a variant of the X.BR & -format, Xbut as a boolean flag is assumed, no option argument is assumed and Xif the related option is a single char option, it may be combined with Xother single char options. The called function permits to reset other Xoptions at the same time. X.PP XAs boolean flags take no arguments, Xthe first argument of the called function points to an empty string. X.RE X.PP XDescriptors are separated by a X.RB ' , ' X(without whitespace) in the Xformat string. They correspond in order to the resultant pointers, X.BR a1\|.\|.\|.an . XNote that function type formats take two arguments from resultant pointers, X.BR a1\|.\|.\|.an . X.PP XIt is an error to expect more than one conversion from a single Xmatch (e.g., X.B X"x#*" Xto attempt to get both the numerical value Xand the actual string for the X.B x Xflag); a X.BR "\-2 " ( BADFMT ) Xerror will result if this is attempted. X.PP XAlthough flags must appear exactly as they do in the Xformat string, the format string does not contain the leading X.RB ' \- '. XIf the flag should start with a X.RB ' \+ ', Xthe X.RB ' \+ ' Xneeds to be in the format string. XIf the flag should start with a X.RB ' \-\- ', Xa single X.RB ' \- ' Xneeds to be in the format string. X.PP X.ne 3 XFlags, where conversion is to take place, may appear Xeither as: X.TP X.BI \-f value X.PD 0 X.TP X.BI f= value X.TP X.BI f= " value" X.TP X.BI \-f= value X.TP X.BI \-f= " value" X.PD X.PP Xwhere X.B f Xis the matching flag string. No additional effort is Xrequired to get these different ways of specifying values. X.PP X.ne 3 XLong flags, where conversion is to take place, may appear Xeither as: X.TP X.BI \-flag value X.PD 0 X.TP X.BI \-\-flag value X.TP X.BI flag= value X.TP X.BI flag= " value" X.TP X.BI \-flag= value X.TP X.BI \-\-flag= value X.TP X.BI \-flag= " value" X.TP X.BI \-\-flag= " value" X.PD X.PP Xwhere X.B flag Xis the matching flag string. No additional effort is Xrequired to get these different ways of specifying values. X.LP XFor flags or type: X.BR * , X.BR ? , X.B & Xand X.BR # , Xwhen the format character is immediately followed by a space Xor underscore character, the permitted option calling variants Xare limited: X.TP X.B - XThe underscore character enforces that X.B option-name Xand X.B option-argument Xneed to be written as a single argument. XThis permits to implement options with optional arguments. X.TP X.B - XThe space character enforces that X.B option-name Xand X.B option-argument Xneed to be written as separate arguments. X.SH RETURNS X.TP 14 X.B FLAGDELIM\ 2 XThe command line argument "\c X.B \-\-\c X" Xstopped flag processing. X.TP X.B NOTAFLAG\ \ 1 XThe argument X.B *pav Xdoes not appear to be a flag. X.TP X.B NOARGS\ \ \ \ 0 XAll arguments have been successfully examined. X.TP X.B BADFLAG\ \ \-1 XA bad flag (option) argument was supplied to the program. XThe argument X.B *pav Xcontains the offending command line argument. X.TP X.B BADFMT\ \ \-2 XA bad format descriptor string has been detected. XThe calling program, rather than the user, was in error. X.LP XGeneral rules for the return code: X.TP 14 X.B >\ 0 XA file type argument was found. X.TP X.B \ \ 0 XAll arguments have been parsed. X.TP X.B <\ 0 XAn error occurred or not a file type argument. X.LP XFlag and file arg processing should be terminated after getting a Xreturn code <= 0. X X.SH EXAMPLES X X.SH "SEE ALSO" X.nh X.sp X.LP X.BR getarginit (3), X.BR getallargs (3), X.BR getargerror (3), X.BR getfiles (3), X.BR getlallargs (3), X.BR getlargs (3), X.BR getlfiles (3), X.BR getvallargs (3), X.BR getvargs (3), X.BR getvfiles (3). X X.SH NOTES X.BR getargs () Xassumes the first argument is at X.BR av[0] . XCommands are invoked by the system with the command name in X.B av[0] Xand the first argument in X.BR av[1] , Xso they must increment X.B av Xand decrement X.B ac Xbefore calling X.BR getargs (). X.PP X.BR getargs () Xshould only be used when the position of the switches Xinfluences how an argument is processed (e.g., format and pr Xcommands), or when all switches must be before all the arguments X(e.g, write command). In other cases, use X.BR getallargs (). X X.SH BUGS Xnone X X.SH AUTHOR X.nf XJ\*org Schilling XD\-13353 Berlin XGermany X.fi X.PP END-of-star-1.6/libschily/getargs.3 echo x - star-1.6/libschily/geterrno.3 sed 's/^X//' >star-1.6/libschily/geterrno.3 << 'END-of-star-1.6/libschily/geterrno.3' X. \" Manual Seite fuer geterrno X. \" @(#)geterrno.3 1.1 X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH GETERRNO 3 "15. Juli 1988" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xgeterrno() \- gets system error number X.SH SYNOPSIS X.B Xint geterrno() X.SH DESCRIPTION Xgeterrno() enables the programmer to find out exactly what the Xlast failure was. This is often necessary since some Xsubroutines just indicate success or failure, rather than Xdirectly return definitive error codes. X.PP XFor example, comerr() uses geterrno() to learn the error so that Xan appropriate message can be printed. X.SH RETURNS XReturns the error code for the last system error that occurred Xin the current process, e.g., after a call to fileopen() failed. X.SH "SEE ALSO" Xcomerr(3), comerrno(3), error(3), errmsg(3) X.SH NOTES XThe value returned by geterrno() is only valid after the Ximmediately preceding system call failed. END-of-star-1.6/libschily/geterrno.3 echo x - star-1.6/libschily/getfiles.3 sed 's/^X//' >star-1.6/libschily/getfiles.3 << 'END-of-star-1.6/libschily/getfiles.3' X. \" Manual Seite fuer getfiles X. \" @(#)getfiles.3 1.5 18/05/22 Copyright 1985-2018 J. Schilling X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH GETFILES 3 "2018/05/22" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xgetfiles() \- gets next non flag-type argument X.SH SYNOPSIS X.nf X#include X X.B Xint getfiles(pac, pav, fmt) X.B X int *pac; /* pointer to arg count */ X.B X char *(*pav)[]; /* pointer to address of arg vector */ X.B X char *fmt; /* format string */ X.fi X.SH DESCRIPTION X.BR getfiles () Xreturns, with a value of X.BR "+1 " ( NOTAFLAG ) Xor X.BR "+2 " ( FLAGDELIM ), Xwhenever a non-flag type argument is encountered. XFlag-type (option) arguments, along with their Xvalues, are ignored. The filename is at X.BR *pav[0] . XThe caller must increment X.B *pav Xand decrement X.B *pac Xbefore calling X.BR getfiles () Xagain. X.SH RETURNS X.TP 14 X.B FLAGDELIM\ 2 XThe command line argument "\c X.B \-\-\c X" Xstopped flag processing. X.TP X.B NOTAFLAG\ \ 1 XThe argument X.B *pav Xdoes not appear to be a flag. X.TP X.B NOARGS\ \ \ \ 0 XAll arguments have been successfully examined. X.TP X.B BADFLAG\ \ \-1 XA bad flag (option) argument was supplied to the program. XThe argument X.B *pav Xcontains the offending command line argument. X.TP X.B BADFMT\ \ \-2 XA bad format descriptor string has been detected. XThe calling program, rather than the user, was in error. X.de .. X.TP X.B NOTAFILE\ \-3 XA flag type argument rather than a file type argument has been detected. X.. X.LP XGeneral rules for the return code: X.TP 14 X.B >\ 0 XA file type argument was found. X.TP X.B \ \ 0 XAll arguments have been parsed. X.TP X.B <\ 0 XAn error occured or not a file type argument. X.LP XFlag and file arg processing should be terminated after getting a Xreturn code <= 0. X X.SH EXAMPLES X X.SH "SEE ALSO" X.nh X.sp X.LP X.BR getallargs (3), X.BR getargerror (3), X.BR getargs (3). X X.SH NOTES XInitially, X.B *pav Xmust point to the first argument (not the Xprogram name) and X.B *pac Xmust not count the program name. Before calling X.BR getfiles () Xagain, decrement X.B *pac Xand increment X.BR *pav , Xor the same name will be pointed to by X.BR *pav . X X.SH BUGS Xnone X X.SH AUTHOR X.nf XJ\*org Schilling XSeestr. 110 XD\-13353 Berlin XGermany X.fi X.PP XMail bugs and suggestions to: X.PP X.B Xjoerg.schilling@fokus.fraunhofer.de Xor X.B Xjoerg@schily.net END-of-star-1.6/libschily/getfiles.3 echo x - star-1.6/libschily/getline.3 sed 's/^X//' >star-1.6/libschily/getline.3 << 'END-of-star-1.6/libschily/getline.3' X. \" Manual Seite fuer getline X. \" @(#)getline.3 1.1 X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH GETLINE 3 "15. Juli 1988" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xgetline() \- reads a line from standard input X.SH SYNOPSIS X.nf X.B Xint getline(buffer,length) X.B char *buffer; X.B int length; X.fi X.SH DESCRIPTION Xgetline() reads up to length characters from the standard input Xusing getc() (q.v.). The transfer is also terminated by a Xnewline, end of file, or read error. The buffer is NULL ('\\0') Xterminated with the new line removed. X.SH RETURNS XReturns either the number of bytes in the buffer or a standard Xsystem error code (including EOF). X.SH NOTES Xgetline() always reads to the end of the input line, even if the Xline is longer than the buffer. END-of-star-1.6/libschily/getline.3 echo x - star-1.6/libschily/handlecond.3 sed 's/^X//' >star-1.6/libschily/handlecond.3 << 'END-of-star-1.6/libschily/handlecond.3' X. \" Manual Seite fuer handle X. \" @(#)handle.3 1.1 X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH HANDLE 3 "15. Juli 1988" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xhandle() \- sets a function to handle a condition X.SH SYNOPSIS X.nf X.B X#include X.B Xhandle(signame, sp, func, arg1) X.B char *signame; X.B SIGBLK *sp; X.B int (*func)(); X.B long arg1; X.fi X.SH DESCRIPTION Xhandle() sets up a handler for a condition. The user must Xexplicitly allocate the condition block and pass it to the Xfunction. X.PP Xhandle() establishes function func as the condition handler for Xthe condition signame. arg1 is passed to func at the time of Xcondition signalling. signame "any_other", catches all Xconditions. X.PP XThe specified function is called with the actual condition being Xsignalled, with arguments from the latest handle() call for that Xfunction in the given frame and from the call to raise(). For Xinstance: X.PP X.nf X.B Xint func (signame, arg1, arg2) X.B X char *signame; /* the actual condition being X.B X /* signalled */ X.B X int arg1; /* arg1 comes from the handle X.B X /* call that set up the handler */ X.B X int arg2; /* arg2 comes from the raise call */ X.fi X.PP XIf the function returns TRUE (non-zero), it is assumed that the Xcondition has been successfully handled; otherwise, the Xcondition is signalled farther down the stack. X.SH RETURNS Xnone X.SH NOTES XBe careful when declaring args to func if they are not long; Xboth args will occupy sizeof(long) bytes in the arglist. XIf FALSE is returned by a condition handler, and there is an Xany_other handler in the same block, the any_other handler will Xbe invoked (only once, since it too may return FALSE). X.PP XTo revert a condition handler simply use NULL as func. X.PP XSIGBLK, defined in , must be included. Xhandle() is frequently used with longjmp() and setjmp(). X.PP XEah function which calls X.I handle() Xmust call X.I unhandle() Xbefore it returns. Otherwise the return will fail. X.SH BUGS X.I Handle() Xmakes the framepointer odd, to mark the current stack frame. X.PP XThis confuses programs like X.B adb(1) Xand X.B dbx(1). END-of-star-1.6/libschily/handlecond.3 echo x - star-1.6/libschily/movebytes.3 sed 's/^X//' >star-1.6/libschily/movebytes.3 << 'END-of-star-1.6/libschily/movebytes.3' X. \" Manual Seite fuer movebytes X. \" @(#)movebytes.3 1.3 17/02/08 Copyright 1988-2017 J. Schilling X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH MOVEBYTES 3 "2017/02/08" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xmovebytes() \- moves data X.SH SYNOPSIS X.nf X.B Xchar *movebytes(from, to, size) X.B const void *from; X.B void *to; X.B ssize_t size; X.fi X.SH DESCRIPTION X.B movebytes() Xcopies X.I size Xbytes from X.I from Xto X.IR to . X.SH RETURN VALUE XA pointer just after the last transferred byte in the X.I to Xstring. X.SH ERRORS X.LP XNo errors are defined X.SH EXAMPLES X.SH "SEE ALSO" X.LP X.BR cmpbytes (3), X.BR cmpmbytes (3), X.BR cmpnullbytes (3), X.BR fillbytes (3), X.BR findbytes (3), X.BR movecbytes (3), X.BR swapbytes (3), X.BR zerobytes (3) X.SH NOTES XThis routine correctly handles overlapping buffers. END-of-star-1.6/libschily/movebytes.3 echo x - star-1.6/libschily/ofindline.3 sed 's/^X//' >star-1.6/libschily/ofindline.3 << 'END-of-star-1.6/libschily/ofindline.3' X. \" Manual Seite fuer ofindline X. \" @(#)ofindline.3 1.1 X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH OFINDLINE 3 "15. Juli 1988" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xofindline() \- finds a line with a matching field X.SH SYNOPSIS X.nf X.B Xint ofindline(f,delim,string,field,array,arraysize) X.B FILE *f; X.B char delim; X.B char *string; X.B int field; X.B char *array[]; X.B int arraysize; X.fi X.SH DESCRIPTION Xofindline() retrieves a line from an open file that has a Xmatching character string in the given field. X.PP Xofindline() fills in array with pointers to strings that make up Xeach field on the line. The strings are allocated new storage. XThe field delimiter, delim, is used to break up each line of the Xfile into fields. string is the string to match. fieldno is Xthe field number to match. Fields are numbered 0..n. array is Xan array of pointers to fill in. arraysize is the size of Xarray. X.SH RETURNS X.TP X.B +1 Xmatch. X.TP X.B \-1 Xno match. X.TP X.B \-2 Xarg error. Returned only if the condition Xfindline_arg_err is handled and the handler returns. X.TP X.B \-4 Xnot enough memory to allocate space for files. XReturned only if the condition findline_storage is Xhandled and the handler returns. X.SH NOTES Xnone END-of-star-1.6/libschily/ofindline.3 echo x - star-1.6/libschily/patcompile.3 sed 's/^X//' >star-1.6/libschily/patcompile.3 << 'END-of-star-1.6/libschily/patcompile.3' X. \" @(#)patcompile.3 1.3 16/01/27 Copyright 1985,1995-2016 J. Schilling X. \" Manual Seite fuer patcompile X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds A Ae X.if n .ds O Oe X.if n .ds U Ue X.if n .ds s sz X.TH PATCOMPILE 3 "15. Juli 1988" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xpatcompile() \- compiles a matching pattern X.SH SYNOPSIS X.nf X.B Xint patcompile(pattern, length, aux) X.B char *pattern; X.B int length; X.B int aux[]; X.fi X.SH DESCRIPTION X.B patcompile() Xcompiles a pattern into an internal form which X.BR patmatch (3) Xcan use. X.PP XThe string at X.I pattern Xwith size X.I length Xis scanned. The array X.B aux Xis filled in with state information for X.BR patmatch (3). X.B aux Xshould have at least X.I length Xelements. X.SH RETURNS XReturns 0 if the pattern contains an error. X.PP XOther values should be passed to X.BR patmatch (3) Xas the X.B alt Xargument. X.SH "SEE ALSO X.BR match (1) X.PP XFor a description ot the regular expressions. X.SH NOTES XThe pattern matching functions are based on ones presented by XMartin Richards in "A Compact Function for Regular Expression XPattern Matching", Software-Practice and Experience vol 9, X527-534 (1979). END-of-star-1.6/libschily/patcompile.3 echo x - star-1.6/libschily/patmatch.3 sed 's/^X//' >star-1.6/libschily/patmatch.3 << 'END-of-star-1.6/libschily/patmatch.3' X. \" @(#)patmatch.3 1.2 00/11/12 Copyright 1985,1995-2000 J. Schilling X. \" Manual Seite fuer patmatch X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.75n'U X.if t .ds s \\(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds A Ae X.if n .ds O Oe X.if n .ds U Ue X.if n .ds s sz X.TH PATMATCH 3 "12. Nov 2000" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xpatmatch() \- checks string for matches X.SH SYNOPSIS X.nf X.B Xchar *patmatch(pattern, aux, string, soff, slen, alt, state) X.B char *pattern; X.B int *aux; X.B char *string; X.B int soff; X.B int slen; X.B int alt; X.B int state[]; X.fi X.SH DESCRIPTION X.B patmatch() Xuses the pattern matching information X.IR pattern Xand in addition X.IR aux " and " alt X(previously set up by a call to X.BR patcompile (3)) Xto check string for a match. The length of the string is X.I slen Xand the starting index used for matching is X.IR soff . XThe string can also be terminated by a null byte. X.PP XThe X.I state Xarray is set up and used internally by X.B patmatch Xand should have at least X.BI "strlen(" pattern ") + 1" Xelements. X.SH RETURNS XReturns a NULL pointer if the X.I string Xstarting at the specified offset did not match the X.IR pattern . X.PP XAny non-NULL return is a pointer to the first character of X.I string Xafter the part that matches. X.SH "SEE ALSO X.BR patcompile (3) Xfor information on X.I aux Xand X.IR alt . X.PP XAnd X.BR match (1) Xfor a description ot the regular expressions. X.SH NOTES XThe pattern matching functions are based on ones presented by XMartin Richards in "A Compact Function for Regular Expression XPattern Matching", Software-Practice and Experience vol 9, X527-534 (1979). END-of-star-1.6/libschily/patmatch.3 echo x - star-1.6/libschily/peekc.3 sed 's/^X//' >star-1.6/libschily/peekc.3 << 'END-of-star-1.6/libschily/peekc.3' X. \" Manual Seite fuer peekc X. \" @(#)peekc.3 1.1 X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH PEEKC 3 "15. Juli 1988" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xpeekc() \- shows the next character in the file X.SH SYNOPSIS X.nf X.B Xint peekc(f) X.B FILE *f; X.fi X.SH DESCRIPTION Xpeekc() shows the next character in the file. It does not Xremove the character. The next call to peekc() or getc() will Xreturn the same character. X.SH RETURNS XReturns the next character in the file or EOF if the file is at Xthe end of data. X.SH NOTES XThis call may be used only on buffered files. X.PP XNotice that peekc() is not declared as type char, since EOF is Xnot a valid value for a char object. END-of-star-1.6/libschily/peekc.3 echo x - star-1.6/libschily/printf.3 sed 's/^X//' >star-1.6/libschily/printf.3 << 'END-of-star-1.6/libschily/printf.3' X. \" Manual Seite fuer printf X. \" @(#)printf.3 1.1 X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH PRINTF 3 "15. Juli 1988" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xprintf() \- formats and prints to standard output X.SH SYNOPSIS X.nf X.B Xprintf(format, arg1, \|.\|.\|., argn) X.B char *format; X.fi X.SH DESCRIPTION Xprintf() formats its arguments using the routine format(). XSee format() for information about the options for formatting. X.SH RETURNS Xnone X.SH "SEE ALSO" Xformat(3), fprintf(3) X.SH NOTES Xprintf() buffers its output internally until it is finished then Xthe buffer is flushed. END-of-star-1.6/libschily/printf.3 echo x - star-1.6/libschily/raisecond.3 sed 's/^X//' >star-1.6/libschily/raisecond.3 << 'END-of-star-1.6/libschily/raisecond.3' X. \" Manual Seite fuer raise X. \" @(#)raise.3 1.1 X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH RAISE 3 "15. Juli 1988" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xraise() \- raises a condition X.SH SYNOPSIS X.nf X.B Xraise(signame, arg2) X.B char *signame; X.B long arg2; X.fi X.SH DESCRIPTION Xraise causes the condition signame to be signalled on the stack, Xin each frame in order from the most recent (top of stack) to Xthe oldest. Each frame is checked for a condition handler for Xsigname or, if one is not found in the frame, for any_other. If Xa handler is found, it is called with signame and with arg1, Xestablished in the call to handle(), and arg2, from this call. XIf a handler is not found, the process is repeated in the next Xolder stack frame. If raise() reaches the end of the stack Xwithout finding a handler, it prints "Condition not caught: Xcondition_name" on stderr and the process is suspended via Xabort(). X.PP XIf the handler returns TRUE, raise() returns. Otherwise it Xcontinues just as if it had not found the handler. X.SH RETURNS Xnone X.SH NOTES Xhandle() and raise() are frequently used with the subroutines Xlongjmp() and setjmp(). X.PP XRoutines that call raise() can choose to ignore the result; Xhowever, they should anticipate the condition in order to ensure Xa reasonable outcome to the program. END-of-star-1.6/libschily/raisecond.3 echo x - star-1.6/libschily/resolvefpath.3 sed 's/^X//' >star-1.6/libschily/resolvefpath.3 << 'END-of-star-1.6/libschily/resolvefpath.3' X.so man3/resolvepath.3 X.\" @(#)resolvefpath.3 1.1 15/04/27 joerg END-of-star-1.6/libschily/resolvefpath.3 echo x - star-1.6/libschily/resolvenpath.3 sed 's/^X//' >star-1.6/libschily/resolvenpath.3 << 'END-of-star-1.6/libschily/resolvenpath.3' X.so man3/resolvepath.3 X.\" @(#)resolvenpath.3 1.1 15/04/27 joerg END-of-star-1.6/libschily/resolvenpath.3 echo x - star-1.6/libschily/resolvepath.3 sed 's/^X//' >star-1.6/libschily/resolvepath.3 << 'END-of-star-1.6/libschily/resolvepath.3' X. \" Manual Seite fuer resolvepath X. \" @(#)resolvepath.3 1.2 18/09/03 Copyright 2015 J. Schilling X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH RESOLVEPATH 3 "2018/09/03" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xresolvepath(), resolvenpath(), resolvefpath() \- resolve all symbolic links of a path name X.SH SYNOPSIS X.nf X#include X.sp X.B int X.B resolvepath(path, buf, bufsiz) X.B " const char *path; X.B " char *buf; X.B " size_t bufsiz; X.sp X.B int X.B resolvenpath(path, buf, bufsiz) X.B " const char *path; X.B " char *buf; X.B " size_t bufsiz; X.sp X.B int X.B resolvefpath(path, buf, bufsiz, flags) X.B " const char *path; X.B " char *buf; X.B " size_t bufsiz; X.B " int flags; X.fi X.SH DESCRIPTION X.LP X.BR resolvepath () Xtakes a relative path name and resolves all smbolic links in the path name. XThe result is a path name that is free of symbolic links. X.I path Xis relative path name that is used as the input. X.I buf Xis the buffer used for the result of the conversion. X.I bufsiz Xis the size of the result buffer. X.LP XAll ``.'' components are eliminated and every non-leading X``..'' component is eliminated together with its preceding Xdirectory component. If leading ``..'' components reach to Xthe root directory, they are replaced by ``/''. X.LP X.BR resolvenpath () Xbehaves like X.BR resolvepath () Xexcept that the file does not need to exist. X.LP X.BR resolvefpath () Xtakes an additional X.I flags Xparameter from the set of flags from the following set: X.TP 20 X.B RSPF_EXIST XAll path components must exist. X.TP X.B RSPF_NOFOLLOW_LAST XDon't follow symbolic links in the last path component. X X.SH RETURN VALUE X.LP XUpon successful completion, X.BR resolvepath (), X.BR resolvenpath () Xand X.BR resolvefpath () Xreturn the number of bytes placed in the buffer XOtherwise, -1 is returned and errno is set to indicate the error. XIn case of an error, the contents of result buffer is left Xin an intermediate state. X.SH ERRORS X.LP X.TP 10 X.B ERANGE XThe path does not fit into the suplied buffer. X.TP X.B EFAULT XA null pointer was suplied as pathname. X.TP X.B EINVAL XAn empty relative path was supplied. X.TP Xother XAny other value that may be a result of an underlying filesystem Xoperation. X.SH USAGE XApplications should not assume that the returned contents of Xthe buffer are null-terminated. This is because the function X.BR resolvepath (3) Xmay be the Solaris version of the rogram is compiled on Solaris. X.SH EXAMPLES X.LP X.SH "SEE ALSO" X.LP X.BR resolvepath (3), X.BR resolvenpath (3), X.BR resolvefpath (3) X.SH NOTES Xnone END-of-star-1.6/libschily/resolvepath.3 echo x - star-1.6/libschily/spawnl.3 sed 's/^X//' >star-1.6/libschily/spawnl.3 << 'END-of-star-1.6/libschily/spawnl.3' X. \" Manual Seite fuer spawnl X. \" @(#)spawnl.3 1.1 X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH SPAWNL 3 "15. Juli 1988" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xspawnl() \- calls a command with specified arguments X.SH SYNOPSIS X.nf X.B Xint spawnl(Sin,Sout,Serr,Command_Name,arg1\|.\|.\|.argn,NULL) X.B FILE *Sin, *Sout, *Serr; X.B char *Command_Name, *arg1\|.\|.\|.*argn; X.SH DESCRIPTION Xspawnl() causes the named command to be called in a subsidiary Xprocess with the given arguments. The last argument to spawnl() Xmust be NULL to indicate the end of the list. The streams Sin, XSout and Serr become stdin, stout, and stderr for the command. XThe Command_Name may be an absolute or a relative pathname. To Xlocate the command, the working directory is searched first, Xthen /bin. This is a property of fexecv(), which spawnl() Xcalls. X.PP XWhen the command finishes, spawnl() returns to the caller. X.SH RETURNS XReturns 0 when successful. Otherwise, returns a non-zero value Xwhich could be: X.PP Xan error code from fork() or fexecl(). Xthe argument to exit() in the Command_name. X.TP X.B 1, Xif stopped by a control C (^C). X.TP X.B 2, Xif killed by another process. X.TP X.B 4, Xif suspended by any fault, raise, control Y ^Y or by Xanother process. (In this case, spawnl() kills the Xsuspended process.) X.SH NOTES Xspawnl() just calls spawnv() with the address and length of the Xargument list. END-of-star-1.6/libschily/spawnl.3 echo x - star-1.6/libschily/spawnv.3 sed 's/^X//' >star-1.6/libschily/spawnv.3 << 'END-of-star-1.6/libschily/spawnv.3' X. \" Manual Seite fuer spawnv X. \" @(#)spawnv.3 1.1 X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH SPAWNV 3 "15. Juli 1988" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xspawnv() \- calls a command with specified arguments X.SH SYNOPSIS X.nf X.B Xint spawnv(Sin,Sout,Serr,ArgC,ArgV) X.B FILE *Sin, *Sout, *Serr; X.B int ArgC; X.B char *ArgV[]; X.fi X.SH DESCRIPTION Xspawnv() causes the command, named in ArgV[0], to be called with Xthe given arguments. Functionally this subroutine is the same Xas spawnl(), differing only in the form of the argument. X.SH RETURNS XReturns 0 when successful. Otherwise, returns a non-zero value Xwhich could be: X.PP Xan error code from fork() or fexecl(). Xthe argument to exit() in the Command_name. X.TP X.B 1, Xif stopped by a control C (^C). X.TP X.B 2, Xif killed by another process. X.TP X.B 4, Xif suspended by any fault, raise, control Y ^Y or by Xanother process. (In this case, spawnv() kills the Xsuspended process.) X.SH NOTES Xnone END-of-star-1.6/libschily/spawnv.3 echo x - star-1.6/libschily/sprintf.3 sed 's/^X//' >star-1.6/libschily/sprintf.3 << 'END-of-star-1.6/libschily/sprintf.3' X. \" Manual Seite fuer sprintf X. \" @(#)sprintf.3 1.1 X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH SPRINTF 3 "15. Juli 1988" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xsprintf() \- formats and places output in buffer X.SH SYNOPSIS X.nf X.B Xsprintf(buf,form,arg1\|.\|.\|.argn) X.B char *buf; X.B char *form; X.fi X.SH DESCRIPTION Xsprintf() is similar to fprintf() except the formatted output is Xplaced into buf. X.SH RETURNS Xnone X.SH "SEE ALSO" Xformat(3), printf(3) X.SH NOTES XA NULL ('\\0') is appended to the end of the formatted output. XThere is no check for overflowing the buffer. END-of-star-1.6/libschily/sprintf.3 echo x - star-1.6/libschily/strcatl.3 sed 's/^X//' >star-1.6/libschily/strcatl.3 << 'END-of-star-1.6/libschily/strcatl.3' X. \" Manual Seite fuer strcatl X. \" @(#)strcatl.3 1.1 X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH STRCATL 3 "15. Juli 1988" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xstrcatl() \- concatenates strings X.SH SYNOPSIS X.nf X.B Xchar *strcatl(outbuf,s1\|.\|.\|.sn,NULL) X.B char *outbuf,*s1\|.\|.\|.*sn; X.fi X.SH DESCRIPTION Xstrcatl() concatenates the "to" strings (s1\|.\|.\|.sn) into outbuf. XThe end of the list is signalled by NULL. X.SH RETURNS XReturns a pointer to the end of the concatenated output, in Xoutbuf. X.SH NOTES XNo check for buffer overflow is made. X.PP XA strcatl() of the form: strcatl(foo,bar,foo,NULL) does not work Xcorrectly, although a strcatl() of the form X"strcatl(foo,foo,bar,NULL)" will. The destination string can Xonly be a source string if it is the first string in the list. END-of-star-1.6/libschily/strcatl.3 echo x - star-1.6/libschily/streql.3 sed 's/^X//' >star-1.6/libschily/streql.3 << 'END-of-star-1.6/libschily/streql.3' X. \" Manual Seite fuer streql X. \" @(#)streql.3 1.1 X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH STREQL 3 "15. Juli 1988" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xstreql() \- compares two strings for equality X.SH SYNOPSIS X.nf X.B XBOOL streql(s1,s2) X.B char *s1, *s2; X.fi X.SH DESCRIPTION Xstreql() checks two strings for equality. X.SH RETURNS XReturns TRUE if the string s1 is the same length and has the Xsame characters as s2. Otherwise, returns FALSE. X.SH NOTES XWhen comparing two strings, the strings are not considered equal Xif one has padding (extra spaces). END-of-star-1.6/libschily/streql.3 echo x - star-1.6/libschily/strlen.3 sed 's/^X//' >star-1.6/libschily/strlen.3 << 'END-of-star-1.6/libschily/strlen.3' X. \" Manual Seite fuer strlen X. \" @(#)strlen.3 1.1 X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-.75n'U X.if t .ds s \(*b X.if t .ds S SS X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds s sz X.TH STRLEN 3 "15. Juli 1988" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xstrlen() \- returns string length X.SH SYNOPSIS X.nf X.B Xint strlen(string) X.B char *string; X.fi X.SH DESCRIPTION Xstrlen() returns the length of string in characters. The Xtrailing '\\0' byte is NOT counted. X.SH RETURNS XReturns length of string. X.SH NOTES XFor allocating space, remember to add one for the NULL. END-of-star-1.6/libschily/strlen.3 echo x - star-1.6/libschily/absfpath.mk3 sed 's/^X//' >star-1.6/libschily/absfpath.mk3 << 'END-of-star-1.6/libschily/absfpath.mk3' X#ident @(#)absfpath.mk3 1.1 15/04/27 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= absfpath XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= absfpath.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/absfpath.mk3 echo x - star-1.6/libschily/absnpath.mk3 sed 's/^X//' >star-1.6/libschily/absnpath.mk3 << 'END-of-star-1.6/libschily/absnpath.mk3' X#ident @(#)absnpath.mk3 1.1 15/04/27 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= absnpath XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= absnpath.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/absnpath.mk3 echo x - star-1.6/libschily/abspath.mk3 sed 's/^X//' >star-1.6/libschily/abspath.mk3 << 'END-of-star-1.6/libschily/abspath.mk3' X#ident @(#)abspath.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= abspath XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= abspath.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/abspath.mk3 echo x - star-1.6/libschily/astoi.mk3 sed 's/^X//' >star-1.6/libschily/astoi.mk3 << 'END-of-star-1.6/libschily/astoi.mk3' X#ident @(#)astoi.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= astoi XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= astoi.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/astoi.mk3 echo x - star-1.6/libschily/astol.mk3 sed 's/^X//' >star-1.6/libschily/astol.mk3 << 'END-of-star-1.6/libschily/astol.mk3' X#ident @(#)astol.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= astol XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= astol.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/astol.mk3 echo x - star-1.6/libschily/breakline.mk3 sed 's/^X//' >star-1.6/libschily/breakline.mk3 << 'END-of-star-1.6/libschily/breakline.mk3' X#ident @(#)breakline.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= breakline XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= breakline.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/breakline.mk3 echo x - star-1.6/libschily/comerr.mk3 sed 's/^X//' >star-1.6/libschily/comerr.mk3 << 'END-of-star-1.6/libschily/comerr.mk3' X#ident @(#)comerr.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= comerr XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= comerr.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/comerr.mk3 echo x - star-1.6/libschily/comerrno.mk3 sed 's/^X//' >star-1.6/libschily/comerrno.mk3 << 'END-of-star-1.6/libschily/comerrno.mk3' X#ident @(#)comerrno.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= comerrno XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= comerrno.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/comerrno.mk3 echo x - star-1.6/libschily/errmsg.mk3 sed 's/^X//' >star-1.6/libschily/errmsg.mk3 << 'END-of-star-1.6/libschily/errmsg.mk3' X#ident @(#)errmsg.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= errmsg XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= errmsg.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/errmsg.mk3 echo x - star-1.6/libschily/errmsgno.mk3 sed 's/^X//' >star-1.6/libschily/errmsgno.mk3 << 'END-of-star-1.6/libschily/errmsgno.mk3' X#ident @(#)errmsgno.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= errmsgno XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= errmsgno.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/errmsgno.mk3 echo x - star-1.6/libschily/error.mk3 sed 's/^X//' >star-1.6/libschily/error.mk3 << 'END-of-star-1.6/libschily/error.mk3' X#ident @(#)error.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= error XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= error.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/error.mk3 echo x - star-1.6/libschily/fdown.mk3 sed 's/^X//' >star-1.6/libschily/fdown.mk3 << 'END-of-star-1.6/libschily/fdown.mk3' X#ident @(#)fdown.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= fdown XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= fdown.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/fdown.mk3 echo x - star-1.6/libschily/fdup.mk3 sed 's/^X//' >star-1.6/libschily/fdup.mk3 << 'END-of-star-1.6/libschily/fdup.mk3' X#ident @(#)fdup.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= fdup XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= fdup.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/fdup.mk3 echo x - star-1.6/libschily/fexecl.mk3 sed 's/^X//' >star-1.6/libschily/fexecl.mk3 << 'END-of-star-1.6/libschily/fexecl.mk3' X#ident @(#)fexecl.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= fexecl XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= fexecl.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/fexecl.mk3 echo x - star-1.6/libschily/fexecle.mk3 sed 's/^X//' >star-1.6/libschily/fexecle.mk3 << 'END-of-star-1.6/libschily/fexecle.mk3' X#ident @(#)fexecle.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= fexecle XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= fexecle.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/fexecle.mk3 echo x - star-1.6/libschily/fexecv.mk3 sed 's/^X//' >star-1.6/libschily/fexecv.mk3 << 'END-of-star-1.6/libschily/fexecv.mk3' X#ident @(#)fexecv.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= fexecv XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= fexecv.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/fexecv.mk3 echo x - star-1.6/libschily/fexecve.mk3 sed 's/^X//' >star-1.6/libschily/fexecve.mk3 << 'END-of-star-1.6/libschily/fexecve.mk3' X#ident @(#)fexecve.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= fexecve XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= fexecve.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/fexecve.mk3 echo x - star-1.6/libschily/fgetline.mk3 sed 's/^X//' >star-1.6/libschily/fgetline.mk3 << 'END-of-star-1.6/libschily/fgetline.mk3' X#ident @(#)fgetline.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= fgetline XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= fgetline.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/fgetline.mk3 echo x - star-1.6/libschily/file_raise.mk3 sed 's/^X//' >star-1.6/libschily/file_raise.mk3 << 'END-of-star-1.6/libschily/file_raise.mk3' X#ident @(#)file_raise.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= file_raise XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= file_raise.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/file_raise.mk3 echo x - star-1.6/libschily/fileclose.mk3 sed 's/^X//' >star-1.6/libschily/fileclose.mk3 << 'END-of-star-1.6/libschily/fileclose.mk3' X#ident @(#)fileclose.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= fileclose XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= fileclose.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/fileclose.mk3 echo x - star-1.6/libschily/filepos.mk3 sed 's/^X//' >star-1.6/libschily/filepos.mk3 << 'END-of-star-1.6/libschily/filepos.mk3' X#ident @(#)filepos.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= filepos XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= filepos.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/filepos.mk3 echo x - star-1.6/libschily/fileluopen.mk3 sed 's/^X//' >star-1.6/libschily/fileluopen.mk3 << 'END-of-star-1.6/libschily/fileluopen.mk3' X#ident @(#)fileluopen.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= fileluopen XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= fileluopen.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/fileluopen.mk3 echo x - star-1.6/libschily/fileopen.mk3 sed 's/^X//' >star-1.6/libschily/fileopen.mk3 << 'END-of-star-1.6/libschily/fileopen.mk3' X#ident @(#)fileopen.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= fileopen XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= fileopen.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/fileopen.mk3 echo x - star-1.6/libschily/fileread.mk3 sed 's/^X//' >star-1.6/libschily/fileread.mk3 << 'END-of-star-1.6/libschily/fileread.mk3' X#ident @(#)fileread.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= fileread XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= fileread.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/fileread.mk3 echo x - star-1.6/libschily/filereopen.mk3 sed 's/^X//' >star-1.6/libschily/filereopen.mk3 << 'END-of-star-1.6/libschily/filereopen.mk3' X#ident @(#)filereopen.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= filereopen XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= filereopen.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/filereopen.mk3 echo x - star-1.6/libschily/fileseek.mk3 sed 's/^X//' >star-1.6/libschily/fileseek.mk3 << 'END-of-star-1.6/libschily/fileseek.mk3' X#ident @(#)fileseek.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= fileseek XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= fileseek.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/fileseek.mk3 echo x - star-1.6/libschily/filesize.mk3 sed 's/^X//' >star-1.6/libschily/filesize.mk3 << 'END-of-star-1.6/libschily/filesize.mk3' X#ident @(#)filesize.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= filesize XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= filesize.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/filesize.mk3 echo x - star-1.6/libschily/filestat.mk3 sed 's/^X//' >star-1.6/libschily/filestat.mk3 << 'END-of-star-1.6/libschily/filestat.mk3' X#ident @(#)filestat.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= filestat XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= filestat.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/filestat.mk3 echo x - star-1.6/libschily/filewrite.mk3 sed 's/^X//' >star-1.6/libschily/filewrite.mk3 << 'END-of-star-1.6/libschily/filewrite.mk3' X#ident @(#)filewrite.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= filewrite XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= filewrite.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/filewrite.mk3 echo x - star-1.6/libschily/findline.mk3 sed 's/^X//' >star-1.6/libschily/findline.mk3 << 'END-of-star-1.6/libschily/findline.mk3' X#ident @(#)findline.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= findline XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= findline.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/findline.mk3 echo x - star-1.6/libschily/flush.mk3 sed 's/^X//' >star-1.6/libschily/flush.mk3 << 'END-of-star-1.6/libschily/flush.mk3' X#ident @(#)flush.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= flush XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= flush.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/flush.mk3 echo x - star-1.6/libschily/fnmatch.mk3 sed 's/^X//' >star-1.6/libschily/fnmatch.mk3 << 'END-of-star-1.6/libschily/fnmatch.mk3' X#ident @(#)fnmatch.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= fnmatch XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= fnmatch.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/fnmatch.mk3 echo x - star-1.6/libschily/format.mk3 sed 's/^X//' >star-1.6/libschily/format.mk3 << 'END-of-star-1.6/libschily/format.mk3' X#ident @(#)format.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= format XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= format.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/format.mk3 echo x - star-1.6/libschily/fpipe.mk3 sed 's/^X//' >star-1.6/libschily/fpipe.mk3 << 'END-of-star-1.6/libschily/fpipe.mk3' X#ident @(#)fpipe.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= fpipe XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= fpipe.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/fpipe.mk3 echo x - star-1.6/libschily/fprintf.mk3 sed 's/^X//' >star-1.6/libschily/fprintf.mk3 << 'END-of-star-1.6/libschily/fprintf.mk3' X#ident @(#)fprintf.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= fprintf XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= fprintf.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/fprintf.mk3 echo x - star-1.6/libschily/getallargs.mk3 sed 's/^X//' >star-1.6/libschily/getallargs.mk3 << 'END-of-star-1.6/libschily/getallargs.mk3' X#ident @(#)getallargs.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= getallargs XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= getallargs.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/getallargs.mk3 echo x - star-1.6/libschily/getargs.mk3 sed 's/^X//' >star-1.6/libschily/getargs.mk3 << 'END-of-star-1.6/libschily/getargs.mk3' X#ident @(#)getargs.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= getargs XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= getargs.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/getargs.mk3 echo x - star-1.6/libschily/geterrno.mk3 sed 's/^X//' >star-1.6/libschily/geterrno.mk3 << 'END-of-star-1.6/libschily/geterrno.mk3' X#ident @(#)geterrno.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= geterrno XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= geterrno.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/geterrno.mk3 echo x - star-1.6/libschily/getfiles.mk3 sed 's/^X//' >star-1.6/libschily/getfiles.mk3 << 'END-of-star-1.6/libschily/getfiles.mk3' X#ident @(#)getfiles.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= getfiles XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= getfiles.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/getfiles.mk3 echo x - star-1.6/libschily/getline.mk3 sed 's/^X//' >star-1.6/libschily/getline.mk3 << 'END-of-star-1.6/libschily/getline.mk3' X#ident @(#)getline.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= getline XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= getline.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/getline.mk3 echo x - star-1.6/libschily/handlecond.mk3 sed 's/^X//' >star-1.6/libschily/handlecond.mk3 << 'END-of-star-1.6/libschily/handlecond.mk3' X#ident @(#)handlecond.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= handlecond XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= handlecond.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/handlecond.mk3 echo x - star-1.6/libschily/movebytes.mk3 sed 's/^X//' >star-1.6/libschily/movebytes.mk3 << 'END-of-star-1.6/libschily/movebytes.mk3' X#ident @(#)movebytes.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= movebytes XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= movebytes.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/movebytes.mk3 echo x - star-1.6/libschily/ofindline.mk3 sed 's/^X//' >star-1.6/libschily/ofindline.mk3 << 'END-of-star-1.6/libschily/ofindline.mk3' X#ident @(#)ofindline.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= ofindline XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= ofindline.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/ofindline.mk3 echo x - star-1.6/libschily/patcompile.mk3 sed 's/^X//' >star-1.6/libschily/patcompile.mk3 << 'END-of-star-1.6/libschily/patcompile.mk3' X#ident @(#)patcompile.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= patcompile XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= patcompile.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/patcompile.mk3 echo x - star-1.6/libschily/patmatch.mk3 sed 's/^X//' >star-1.6/libschily/patmatch.mk3 << 'END-of-star-1.6/libschily/patmatch.mk3' X#ident @(#)patmatch.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= patmatch XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= patmatch.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/patmatch.mk3 echo x - star-1.6/libschily/peekc.mk3 sed 's/^X//' >star-1.6/libschily/peekc.mk3 << 'END-of-star-1.6/libschily/peekc.mk3' X#ident @(#)peekc.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= peekc XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= peekc.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/peekc.mk3 echo x - star-1.6/libschily/printf.mk3 sed 's/^X//' >star-1.6/libschily/printf.mk3 << 'END-of-star-1.6/libschily/printf.mk3' X#ident @(#)printf.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= printf XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= printf.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/printf.mk3 echo x - star-1.6/libschily/raisecond.mk3 sed 's/^X//' >star-1.6/libschily/raisecond.mk3 << 'END-of-star-1.6/libschily/raisecond.mk3' X#ident @(#)raisecond.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= raisecond XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= raisecond.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/raisecond.mk3 echo x - star-1.6/libschily/resolvefpath.mk3 sed 's/^X//' >star-1.6/libschily/resolvefpath.mk3 << 'END-of-star-1.6/libschily/resolvefpath.mk3' X#ident @(#)resolvefpath.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= resolvefpath XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= resolvefpath.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/resolvefpath.mk3 echo x - star-1.6/libschily/resolvenpath.mk3 sed 's/^X//' >star-1.6/libschily/resolvenpath.mk3 << 'END-of-star-1.6/libschily/resolvenpath.mk3' X#ident @(#)resolvenpath.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= resolvenpath XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= resolvenpath.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/resolvenpath.mk3 echo x - star-1.6/libschily/resolvepath.mk3 sed 's/^X//' >star-1.6/libschily/resolvepath.mk3 << 'END-of-star-1.6/libschily/resolvepath.mk3' X#ident @(#)resolvepath.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= resolvepath XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= resolvepath.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/resolvepath.mk3 echo x - star-1.6/libschily/spawnl.mk3 sed 's/^X//' >star-1.6/libschily/spawnl.mk3 << 'END-of-star-1.6/libschily/spawnl.mk3' X#ident @(#)spawnl.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= spawnl XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= spawnl.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/spawnl.mk3 echo x - star-1.6/libschily/spawnv.mk3 sed 's/^X//' >star-1.6/libschily/spawnv.mk3 << 'END-of-star-1.6/libschily/spawnv.mk3' X#ident @(#)spawnv.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= spawnv XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= spawnv.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/spawnv.mk3 echo x - star-1.6/libschily/sprintf.mk3 sed 's/^X//' >star-1.6/libschily/sprintf.mk3 << 'END-of-star-1.6/libschily/sprintf.mk3' X#ident @(#)sprintf.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= sprintf XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= sprintf.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/sprintf.mk3 echo x - star-1.6/libschily/strcatl.mk3 sed 's/^X//' >star-1.6/libschily/strcatl.mk3 << 'END-of-star-1.6/libschily/strcatl.mk3' X#ident @(#)strcatl.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= strcatl XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= strcatl.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/strcatl.mk3 echo x - star-1.6/libschily/streql.mk3 sed 's/^X//' >star-1.6/libschily/streql.mk3 << 'END-of-star-1.6/libschily/streql.mk3' X#ident @(#)streql.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= streql XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= streql.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/streql.mk3 echo x - star-1.6/libschily/strlen.mk3 sed 's/^X//' >star-1.6/libschily/strlen.mk3 << 'END-of-star-1.6/libschily/strlen.mk3' X#ident @(#)strlen.mk3 1.1 15/04/26 X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= strlen XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= strlen.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/strlen.mk3 echo x - star-1.6/libschily/Targets.man sed 's/^X//' >star-1.6/libschily/Targets.man << 'END-of-star-1.6/libschily/Targets.man' X# @(#)Targets.man 1.3 17/02/15 Copyright 2015 J. Schilling X XMAN_MK_FILES= \ X absfpath.mk3 \ X absnpath.mk3 \ X abspath.mk3 \ X astoi.mk3 \ X astol.mk3 \ X breakline.mk3 \ X cmpbytes.mk3 \ X comerr.mk3 \ X comerrno.mk3 \ X errmsg.mk3 \ X errmsgno.mk3 \ X error.mk3 \ X fdown.mk3 \ X fdup.mk3 \ X fexecl.mk3 \ X fexecle.mk3 \ X fexecv.mk3 \ X fexecve.mk3 \ X fgetline.mk3 \ X file_raise.mk3 \ X fileclose.mk3 \ X fileluopen.mk3 \ X fileopen.mk3 \ X filepos.mk3 \ X fileread.mk3 \ X filereopen.mk3 \ X fileseek.mk3 \ X filesize.mk3 \ X filestat.mk3 \ X filewrite.mk3 \ X findline.mk3 \ X flush.mk3 \ X fnmatch.mk3 \ X format.mk3 \ X fpipe.mk3 \ X fprintf.mk3 \ X getallargs.mk3 \ X getargs.mk3 \ X geterrno.mk3 \ X getfiles.mk3 \ X getline.mk3 \ X handlecond.mk3 \ X movebytes.mk3 \ X ofindline.mk3 \ X patcompile.mk3 \ X patmatch.mk3 \ X peekc.mk3 \ X printf.mk3 \ X raisecond.mk3 \ X resolvefpath.mk3 \ X resolvepath.mk3 \ X resolvenpath.mk3 \ X spawnl.mk3 \ X spawnv.mk3 \ X sprintf.mk3 \ X strcatl.mk3 \ X streql.mk3 \ X strlen.mk3 \ X END-of-star-1.6/libschily/Targets.man echo x - star-1.6/libschily/astoul.c sed 's/^X//' >star-1.6/libschily/astoul.c << 'END-of-star-1.6/libschily/astoul.c' X/* @(#)astoul.c 1.2 18/08/31 Copyright 1985, 2000-2018 J. Schilling */ X/* X * astoul() converts a string to unsigned long X * X * Leading tabs and spaces are ignored. X * Both return pointer to the first char that has not been used. X * Caller must check if this means a bad conversion. X * X * leading "+" is ignored X * leading "0" makes conversion octal (base 8) X * leading "0x" makes conversion hex (base 16) X * X * Copyright (c) 1985, 2000-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X X#ifndef NO_SIGNED_ULONG X#define DO_SIGNED X#endif X X#define is_space(c) ((c) == ' ' || (c) == '\t') X#define is_digit(c) ((c) >= '0' && (c) <= '9') X#define is_hex(c) (\ X ((c) >= 'a' && (c) <= 'f') || \ X ((c) >= 'A' && (c) <= 'F')) X X#define is_lower(c) ((c) >= 'a' && (c) <= 'z') X#define is_upper(c) ((c) >= 'A' && (c) <= 'Z') X#define to_lower(c) (((c) >= 'A' && (c) <= 'Z') ? (c) - 'A'+'a' : (c)) X X#if ('i' + 1) < 'j' X#define BASE_MAX ('i' - 'a' + 10 + 1) /* This is EBCDIC */ X#else X#define BASE_MAX ('z' - 'a' + 10 + 1) /* This is ASCII */ X#endif X X X XEXPORT char *astoul __PR((const char *s, unsigned long *l)); XEXPORT char *astoulb __PR((const char *s, unsigned long *l, int base)); X XEXPORT char * Xastoul(s, l) X register const char *s; X unsigned long *l; X{ X return (astoulb(s, l, 0)); X} X XEXPORT char * Xastoulb(s, l, base) X register const char *s; X unsigned long *l; X register int base; X{ X#ifdef DO_SIGNED X int neg = 0; X#endif X register unsigned long ret = (unsigned long)0; X unsigned long maxmult; X register int digit; X register char c; X X if (base > BASE_MAX || base == 1 || base < 0) { X seterrno(EINVAL); X return ((char *)s); X } X X while (is_space(*s)) X s++; X X if (*s == '+') { X s++; X } else if (*s == '-') { X#ifndef DO_SIGNED X seterrno(EINVAL); X return ((char *)s); X#else X s++; X neg++; X#endif X } X X if (base == 0) { X if (*s == '0') { X base = 8; X s++; X if (*s == 'x' || *s == 'X') { X s++; X base = 16; X } X } else { X base = 10; X } X } X maxmult = TYPE_MAXVAL(unsigned long) / base; X for (; (c = *s) != 0; s++) { X X if (is_digit(c)) { X digit = c - '0'; X } else if (is_lower(c)) { X digit = c - 'a' + 10; X } else if (is_upper(c)) { X digit = c - 'A' + 10; X } else { X break; X } X X if (digit < base) { X if (ret > maxmult) X goto overflow; X ret *= base; X if (TYPE_MAXVAL(unsigned long) - ret < digit) X goto overflow; X ret += digit; X } else { X break; X } X } X#ifdef DO_SIGNED X if (neg) X ret = -ret; X#endif X *l = ret; X return ((char *)s); Xoverflow: X for (; (c = *s) != 0; s++) { X X if (is_digit(c)) { X digit = c - '0'; X } else if (is_lower(c)) { X digit = c - 'a' + 10; X } else if (is_upper(c)) { X digit = c - 'A' + 10; X } else { X break; X } X if (digit >= base) X break; X } X *l = TYPE_MAXVAL(unsigned long); X seterrno(ERANGE); X return ((char *)s); X} END-of-star-1.6/libschily/astoul.c echo x - star-1.6/libschily/jsdprintf.c sed 's/^X//' >star-1.6/libschily/jsdprintf.c << 'END-of-star-1.6/libschily/jsdprintf.c' X/* @(#)jsdprintf.c 1.2 17/08/03 Copyright 1985, 1989, 1995-2017 J. Schilling */ X/* X * Copyright (c) 1985, 1989, 1995-2017 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X X#define BFSIZ 256 X Xtypedef struct { X short cnt; X char *ptr; X char buf[BFSIZ]; X int count; X int fd; X} *BUF, _BUF; X XLOCAL void _bflush __PR((BUF)); XLOCAL void _bput __PR((char, void *)); XEXPORT int js_dprintf __PR((int, const char *, ...)) __printflike__(2, 3); X XLOCAL void X_bflush(bp) X register BUF bp; X{ X bp->count += bp->ptr - bp->buf; X if (write(bp->fd, bp->buf, bp->ptr - bp->buf) < 0) X bp->count = EOF; X bp->ptr = bp->buf; X bp->cnt = BFSIZ; X} X X#ifdef PROTOTYPES XLOCAL void X_bput(char c, void *l) X#else XLOCAL void X_bput(c, l) X char c; X void *l; X#endif X{ X register BUF bp = (BUF)l; X X *bp->ptr++ = c; X if (--bp->cnt <= 0) X _bflush(bp); X} X X/* VARARGS2 */ X#ifdef PROTOTYPES XEXPORT int Xjs_dprintf(int fd, const char *form, ...) X#else XEXPORT int Xjs_dprintf(fd, form, va_alist) X int fd; X char *form; X va_dcl X#endif X{ X va_list args; X _BUF bb; X X bb.ptr = bb.buf; X bb.cnt = BFSIZ; X bb.count = 0; X bb.fd = fd; X#ifdef PROTOTYPES X va_start(args, form); X#else X va_start(args); X#endif X format(_bput, &bb, form, args); X va_end(args); X if (bb.cnt < BFSIZ) X _bflush(&bb); X return (bb.count); X} END-of-star-1.6/libschily/jsdprintf.c echo x - star-1.6/libschily/movecbytes.c sed 's/^X//' >star-1.6/libschily/movecbytes.c << 'END-of-star-1.6/libschily/movecbytes.c' X/* @(#)movecbytes.c 1.2 16/11/05 Copyright 2016 J. Schilling */ X/* X * move data, stop if character c is copied X * X * Copyright (c) 2016 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X X#define DO8(a) a; a; a; a; a; a; a; a; X X/* X * movecbytes(from, to, c, cnt) is the same as memccpy(to, from, c, cnt) X */ XEXPORT char * Xmovecbytes(fromv, tov, c, cnt) X const void *fromv; X void *tov; X register int c; X size_t cnt; X{ X register const char *from = fromv; X register char *to = tov; X register size_t n; X X if ((n = cnt) == 0) X return (NULL); X X#define separate_code X#ifdef separate_code X while (n >= 8) { X /* BEGIN CSTYLED */ X DO8( X if ((*to++ = *from++) == (char)c) X return (to); X ); X /* END CSTYLED */ X n -= 8; X } X X switch (n) { X X case 7: if ((*to++ = *from++) == (char)c) X return (to); X case 6: if ((*to++ = *from++) == (char)c) X return (to); X case 5: if ((*to++ = *from++) == (char)c) X return (to); X case 4: if ((*to++ = *from++) == (char)c) X return (to); X case 3: if ((*to++ = *from++) == (char)c) X return (to); X case 2: if ((*to++ = *from++) == (char)c) X return (to); X case 1: if ((*to++ = *from++) == (char)c) X return (to); X } X#else X /* X * This variant should be as fast as the code above but X * half the size. Unfortunately, most compilers do not optmize X * it correctly. X */ X int rest = n % 8; X X n -= rest; X X switch (rest) { X X case 0: while (n != 0) { X n -= 8; X if ((*to++ = *from++) == (char)c) X return (to); X case 7: if ((*to++ = *from++) == (char)c) X return (to); X case 6: if ((*to++ = *from++) == (char)c) X return (to); X case 5: if ((*to++ = *from++) == (char)c) X return (to); X case 4: if ((*to++ = *from++) == (char)c) X return (to); X case 3: if ((*to++ = *from++) == (char)c) X return (to); X case 2: if ((*to++ = *from++) == (char)c) X return (to); X case 1: if ((*to++ = *from++) == (char)c) X return (to); X } X } X#endif X return (NULL); X} END-of-star-1.6/libschily/movecbytes.c echo x - star-1.6/libschily/cmpbytes.3 sed 's/^X//' >star-1.6/libschily/cmpbytes.3 << 'END-of-star-1.6/libschily/cmpbytes.3' X. \" Manual Seite fuer cmpbytes X. \" @(#)cmpbytes.3 1.1 17/02/15 Copyright 1988-2017 J. Schilling X. \" X.if t .ds a \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'a X.if t .ds o \v'-0.55m'\h'0.00n'\z.\h'0.45n'\z.\v'0.55m'\h'-0.45n'o X.if t .ds u \v'-0.55m'\h'0.00n'\z.\h'0.40n'\z.\v'0.55m'\h'-0.40n'u X.if t .ds A \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'A X.if t .ds O \v'-0.77m'\h'0.25n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.70n'O X.if t .ds U \v'-0.77m'\h'0.30n'\z.\h'0.45n'\z.\v'0.77m'\h'-0.75n'U X.if t .ds s \(*b X.if n .ds a ae X.if n .ds o oe X.if n .ds u ue X.if n .ds A Ae X.if n .ds O Oe X.if n .ds U Ue X.if n .ds s sz X.ds S SS X.TH CMPBYTES 3 "2017/02/15" "J\*org Schilling" "Schily\'s LIBRARY FUNCTIONS" X.SH NAME Xcmpbytes() \- compare data X.SH SYNOPSIS X.nf X.B Xssize_t cmpbytes(from, to, cnt) X.B const void *from; X.B const void *to; X.B ssize_t cnt; X.fi X.SH DESCRIPTION Xcmpbytes() compares size bytes from from to to. X.SH RETURN VALUE XThe the offset of the first differing character in the strings. X.I to Xstring. X.SH ERRORS X.LP XNo errors are defined X.SH EXAMPLES X.SH "SEE ALSO" X.LP X.BR cmpmbytes (3), X.BR cmpnullbytes (3), X.BR fillbytes (3), X.BR findbytes (3), X.BR movebytes (3), X.BR movecbytes (3), X.BR swapbytes (3), X.BR zerobytes (3) X.SH NOTES XThis routine correctly handles overlapping buffers. END-of-star-1.6/libschily/cmpbytes.3 echo x - star-1.6/libschily/cmpbytes.mk3 sed 's/^X//' >star-1.6/libschily/cmpbytes.mk3 << 'END-of-star-1.6/libschily/cmpbytes.mk3' X#ident "@(#)cmpbytes.mk3 1.1 17/02/15 " X########################################################################### X# Sample makefile for installing manual pages X########################################################################### XSRCROOT= .. XRULESDIR= RULES Xinclude $(SRCROOT)/$(RULESDIR)/rules.top X########################################################################### X XMANDIR= man XTARGETMAN= cmpbytes XMANSECT= $(MANSECT_LIB) XMANSUFFIX= $(MANSUFF_LIB) XMANFILE= cmpbytes.3 X X########################################################################### Xinclude $(SRCROOT)/$(RULESDIR)/rules.man X########################################################################### END-of-star-1.6/libschily/cmpbytes.mk3 echo x - star-1.6/libschily/matchmb.c sed 's/^X//' >star-1.6/libschily/matchmb.c << 'END-of-star-1.6/libschily/matchmb.c' X/* @(#)matchmb.c 1.1 17/07/02 Copyright 2017 J. Schilling */ X/* X * Pattern matching function for multi byte match. X * X * Copyright (c) 2017 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#define USE_WCHAR X#include X X#define __MB_CHAR X#include "match.c" END-of-star-1.6/libschily/matchmb.c echo x - star-1.6/libschily/matchmbl.c sed 's/^X//' >star-1.6/libschily/matchmbl.c << 'END-of-star-1.6/libschily/matchmbl.c' X/* @(#)matchmbl.c 1.1 17/07/02 Copyright 2017 J. Schilling */ X/* X * Pattern matching function for multi byte line match (grep like). X * X * Copyright (c) 2017 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#define USE_WCHAR X#include X X#define __MB_CHAR X#define __LINE_MATCH X#include "match.c" END-of-star-1.6/libschily/matchmbl.c echo x - star-1.6/libschily/wctype.c sed 's/^X//' >star-1.6/libschily/wctype.c << 'END-of-star-1.6/libschily/wctype.c' X/* @(#)wctype.c 1.3 17/08/13 Copyright 2017 J. Schilling */ X/* X * Emulate the behavior of wctype() and iswctype() X * X * Copyright (c) 2017 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X X#ifndef HAVE_WCTYPE XLOCAL struct wct { X char *name; X wctype_t val; X} wct[] = { X {"alnum", 1}, X {"alpha", 2}, X {"blank", 3}, X {"cntrl", 4}, X {"digit", 5}, X {"graph", 6}, X {"lower", 7}, X {"print", 8}, X {"punct", 9}, X {"space", 10}, X {"upper", 11}, X {"xdigit", 12}, X { NULL, 0} X}; X Xwctype_t Xwctype(n) X const char *n; X{ X register struct wct *wp = wct; X X for (; wp->name; wp++) { X if (*n != *wp->name) X continue; X if (strcmp(n, wp->name) == 0) X return (wp->val); X } X return (0); X} X Xint Xiswctype(wc, t) X wint_t wc; X wctype_t t; X{ X switch (t) { X X case 1: return (iswalnum(wc)); X case 2: return (iswalpha(wc)); X#if defined(HAVE_ISWBLANK) || ((MB_LEN_MAX == 1) && defined(HAVE_ISBLANK)) X case 3: return (iswblank(wc)); X#else X case 3: return (isspace(wc)); X#endif X case 4: return (iswcntrl(wc)); X case 5: return (iswdigit(wc)); X case 6: return (iswgraph(wc)); X case 7: return (iswlower(wc)); X case 8: return (iswprint(wc)); X case 9: return (iswpunct(wc)); X case 10: return (iswspace(wc)); X case 11: return (iswupper(wc)); X case 12: return (iswxdigit(wc)); X X default: X return (0); X } X} X#endif /* HAVE_WCTYPE */ END-of-star-1.6/libschily/wctype.c echo x - star-1.6/libschily/putenv.c sed 's/^X//' >star-1.6/libschily/putenv.c << 'END-of-star-1.6/libschily/putenv.c' X/* @(#)putenv.c 1.1 18/01/17 Copyright 1999-2018 J. Schilling */ X/* X * Our putenv implementation for systems that don't have it. X * Note that this implementation may not work correctly on platforms X * that support multi threading. X * X * Copyright (c) 1999-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X X#ifndef HAVE_PUTENV X XEXPORT int putenv __PR((char *new)); XLOCAL int ev_find __PR((const char *s)); X XLOCAL BOOL ealloc = FALSE; /* TRUE if environ is already allocated */ X XEXPORT int Xputenv(new) X char *new; X{ X char **newenv; X register int idx; X X if ((idx = ev_find(new)) >= 0) { X /* X * An old entry with the same name exists, replace it. X */ X environ[idx] = (char *)new; X } else { X /* X * If idx is < 0, we need to expand environ for the new entry. X * In this case -idx is the inverted size of the old environ. X */ X idx = -idx + 1; /* Add space for new entry */ X if (ealloc) { X /* X * environ is allocated, expand with realloc X */ X newenv = (char **)realloc(environ, idx*sizeof (char *)); X if (newenv == NULL) X return (-1); X } else { X /* X * environ is orig space, copy to malloc'ed space X */ X ealloc = TRUE; X newenv = (char **)malloc(idx*sizeof (char *)); X if (newenv == NULL) X return (-1); X (void) movebytes((char *)environ, (char *)newenv, X (int)(idx*sizeof (char *))); X } X environ = newenv; X environ[idx-2] = (char *)new; X environ[idx-1] = NULL; X } X return (0); X} X X/* X * Check if arg of form name=value is part of environ. X * Return index on success and -environ_size if not. X */ XLOCAL int Xev_find(s) X register const char *s; X{ X register int i = 0; X register const char *ep; X register const char *s2; X X for (i = 0; environ[i] != NULL; i++) { X /* X * Find string in environment entry. X */ X for (ep = environ[i], s2 = s; *ep == *s2++; ep++) { X if (*ep == '=') X return (i); X } X } X return (-(++i)); X} X#endif /* HAVE_PUTENV */ END-of-star-1.6/libschily/putenv.c echo x - star-1.6/libschily/unsetenv.c sed 's/^X//' >star-1.6/libschily/unsetenv.c << 'END-of-star-1.6/libschily/unsetenv.c' X/* @(#)unsetenv.c 1.1 18/01/17 Copyright 2009-2018 J. Schilling */ X/* X * Our unsetenv implementation for systems that don't have it. X * Note that this implementation may not work correctly on platforms X * that support multi threading. X * X * Copyright (c) 2009-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X X#ifndef HAVE_UNSETENV X XEXPORT int unsetenv __PR((const char *name)); X XEXPORT int Xunsetenv(name) X const char *name; X{ X register int i = 0; X register const char *ep; X register const char *s2; X X if (name == NULL || name[0] == '\0') X return (0); X X for (i = 0; environ[i] != NULL; i++) { X /* X * Find string in environment entry. X */ X for (ep = environ[i], s2 = name; *ep++ == *s2++; ) X ; X if (*--ep == '=' && *--s2 == '\0') X goto found; X } X return (0); Xfound: X for (; environ[i] != NULL; i++) X environ[i] = environ[i+1]; X return (0); X} X#endif /* HAVE_UNSETENV */ END-of-star-1.6/libschily/unsetenv.c echo x - star-1.6/libschily/fpoff.c sed 's/^X//' >star-1.6/libschily/fpoff.c << 'END-of-star-1.6/libschily/fpoff.c' X/* @(#)fpoff.c 1.20 18/04/09 Copyright 1988-2018 J. Schilling */ X/* X * Get frame pointer offset X * X * Copyright (c) 1988-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X X#if defined(sparc) && defined(__GNUC__) X# define FP_OFF 0x10 /* some strange things on sparc gcc */ X#else X# define FP_OFF 0 X#endif X XEXPORT void **___fpoff __PR((char *cp)); X X/* X * Don't make it static to avoid inline optimization. X * X * We need this function to fool GCCs check for returning addresses X * from outside the functions local address space. X */ XEXPORT void ** X___fpoff(cp) X char *cp; X{ X long ***lp; X X lp = (long ***)(cp + FP_OFF); X lp++; X return ((void **)lp); X} END-of-star-1.6/libschily/fpoff.c echo x - star-1.6/libschily/waitid.c sed 's/^X//' >star-1.6/libschily/waitid.c << 'END-of-star-1.6/libschily/waitid.c' X/* @(#)waitid.c 1.2 18/06/10 Copyright 2015-2018 J. Schilling */ X/* X * Emulate the waitid() syscall in case it is missing or disfunctional X * X * Copyright (c) 2015-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X X#ifndef HAVE_WAITID XEXPORT int Xwaitid(idtype, id, infop, opts) X idtype_t idtype; X id_t id; X siginfo_t *infop; /* Must be != NULL */ X int opts; X{ X int exstat; X pid_t pid; X#ifdef __needed__ X struct tms tms; X#endif X X opts &= ~(WEXITED|WTRAPPED); /* waitpid() doesn't understand them */ X#if WSTOPPED != WUNTRACED X if (opts & WSTOPPED) { X opts &= ~WSTOPPED; X opts |= WUNTRACED; X } X#endif X X if (idtype == P_PID) X pid = id; X else if (idtype == P_PGID) X pid = -id; X else if (idtype == P_ALL) X pid = -1; X else X pid = 0; X X#ifdef __needed__ X /* X * We cannot clear infop->si_utime and infop->si_stime as they are X * missing on HP-UX-10.x. X */ X infop->si_utime = 0; X infop->si_stime = 0; X if (WNOWAIT == 0 || (opts & WNOWAIT) == 0) { X times(&tms); X } X#endif X pid = waitpid(pid, &exstat, opts); X infop->si_pid = pid; X infop->si_code = 0; X infop->si_status = 0; X X if (pid == (pid_t)-1) X return (-1); X X#ifdef __needed__ X if (WNOWAIT == 0 || (opts & WNOWAIT) == 0) { X infop->si_utime = tms.tms_cutime; X infop->si_stime = tms.tms_cstime; X times(&tms); X infop->si_utime = tms.tms_cutime - infop->si_utime; X infop->si_stime = tms.tms_cstime - infop->si_stime; X } X#endif X X if (WIFEXITED(exstat)) { X infop->si_code = CLD_EXITED; X infop->si_status = WEXITSTATUS(exstat); X } else if (WIFSIGNALED(exstat)) { X if (WCOREDUMP(exstat)) X infop->si_code = CLD_DUMPED; X else X infop->si_code = CLD_KILLED; X infop->si_status = WTERMSIG(exstat); X } else if (WIFSTOPPED(exstat)) { X#ifdef SIGTRAP X if (WSTOPSIG(exstat) == SIGTRAP) X infop->si_code = CLD_TRAPPED; X else X#endif X infop->si_code = CLD_STOPPED; X infop->si_status = WSTOPSIG(exstat); X } else if (WIFCONTINUED(exstat)) { X infop->si_code = CLD_CONTINUED; X infop->si_status = 0; X } X X return (0); X} X#endif END-of-star-1.6/libschily/waitid.c echo x - star-1.6/libschily/fgtcomerr.c sed 's/^X//' >star-1.6/libschily/fgtcomerr.c << 'END-of-star-1.6/libschily/fgtcomerr.c' X/* @(#)fgtcomerr.c 1.1 18/06/16 Copyright 1985-1989, 1995-2018 J. Schilling */ X/* X * Routines for printing command errors on a specified FILE * X * These routines call gettext() on the message first. X * X * Copyright (c) 1985-1989, 1995-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include /* include try to get size_t */ X#include /* Try again for size_t */ X#include /* Try again for size_t */ X#include X#include X#include X#include X#include X#include X XEXPORT void fgtcomerr __PR((FILE *, const char *, ...)); XEXPORT void fgtxcomerr __PR((FILE *, int, const char *, ...)); XEXPORT void fgtcomerrno __PR((FILE *, int, const char *, ...)); XEXPORT void fgtxcomerrno __PR((FILE *, int, int, const char *, ...)); XEXPORT int fgterrmsg __PR((FILE *, const char *, ...)); XEXPORT int fgterrmsgno __PR((FILE *, int, const char *, ...)); X X/* X * Fetch current errno, print a related message and exit(errno). X */ X/* VARARGS1 */ X#ifdef PROTOTYPES XEXPORT void Xfgtcomerr(FILE *f, const char *msg, ...) X#else XEXPORT void Xfgtcomerr(f, msg, va_alist) X FILE *f; X char *msg; X va_dcl X#endif X{ X va_list args; X X#ifdef PROTOTYPES X va_start(args, msg); X#else X va_start(args); X#endif X (void) _comerr(f, COMERR_EXIT, 0, geterrno(), _(msg), args); X /* NOTREACHED */ X va_end(args); X} X X/* X * Fetch current errno, print a related message and exit(exc). X */ X/* VARARGS2 */ X#ifdef PROTOTYPES XEXPORT void Xfgtxcomerr(FILE *f, int exc, const char *msg, ...) X#else XEXPORT void Xfgtxcomerr(f, exc, msg, va_alist) X int exc; X FILE *f; X char *msg; X va_dcl X#endif X{ X va_list args; X X#ifdef PROTOTYPES X va_start(args, msg); X#else X va_start(args); X#endif X (void) _comerr(f, COMERR_EXCODE, exc, geterrno(), _(msg), args); X /* NOTREACHED */ X va_end(args); X} X X/* X * Print a message related to err and exit(err). X */ X/* VARARGS2 */ X#ifdef PROTOTYPES XEXPORT void Xfgtcomerrno(FILE *f, int err, const char *msg, ...) X#else XEXPORT void Xfgtcomerrno(f, err, msg, va_alist) X FILE *f; X int err; X char *msg; X va_dcl X#endif X{ X va_list args; X X#ifdef PROTOTYPES X va_start(args, msg); X#else X va_start(args); X#endif X (void) _comerr(f, COMERR_EXIT, 0, err, _(msg), args); X /* NOTREACHED */ X va_end(args); X} X X/* X * Print a message related to err and exit(exc). X */ X/* VARARGS3 */ X#ifdef PROTOTYPES XEXPORT void Xfgtxcomerrno(FILE *f, int exc, int err, const char *msg, ...) X#else XEXPORT void Xfgtxcomerrno(f, exc, err, msg, va_alist) X FILE *f; X int exc; X int err; X char *msg; X va_dcl X#endif X{ X va_list args; X X#ifdef PROTOTYPES X va_start(args, msg); X#else X va_start(args); X#endif X (void) _comerr(f, COMERR_EXCODE, exc, err, _(msg), args); X /* NOTREACHED */ X va_end(args); X} X X/* X * Fetch current errno, print a related message and return(errno). X */ X/* VARARGS1 */ X#ifdef PROTOTYPES XEXPORT int Xfgterrmsg(FILE *f, const char *msg, ...) X#else XEXPORT int Xfgterrmsg(f, msg, va_alist) X FILE *f; X char *msg; X va_dcl X#endif X{ X va_list args; X int ret; X X#ifdef PROTOTYPES X va_start(args, msg); X#else X va_start(args); X#endif X ret = _comerr(f, COMERR_RETURN, 0, geterrno(), _(msg), args); X va_end(args); X return (ret); X} X X/* X * Print a message related to err and return(err). X */ X/* VARARGS2 */ X#ifdef PROTOTYPES XEXPORT int Xfgterrmsgno(FILE *f, int err, const char *msg, ...) X#else XEXPORT int Xfgterrmsgno(f, err, msg, va_alist) X FILE *f; X int err; X char *msg; X va_dcl X#endif X{ X va_list args; X int ret; X X#ifdef PROTOTYPES X va_start(args, msg); X#else X va_start(args); X#endif X ret = _comerr(f, COMERR_RETURN, 0, err, _(msg), args); X va_end(args); X return (ret); X} END-of-star-1.6/libschily/fgtcomerr.c echo x - star-1.6/libschily/gtprintf.c sed 's/^X//' >star-1.6/libschily/gtprintf.c << 'END-of-star-1.6/libschily/gtprintf.c' X/* @(#)gtprintf.c 1.1 18/06/16 Copyright 1985, 1995-2018 J. Schilling */ X/* X * Copyright (c) 1985, 1995-2018 J. Schilling X * These routines call gettext() on the format first. X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X#include X X#ifdef NO_FPRFORMAT X#undef USE_FPRFORMAT X#else X#define USE_FPRFORMAT X#endif X X#ifdef USE_FPRFORMAT X/* X * This is the speed-optimized version that currently only has been tested X * on Solaris. X * It is based on fprformat() instead of format() and is faster than the X * the format() based standard implementation, in case that putc() or X * putc_unlocked() is a macro. X */ X X/* VARARGS1 */ X#ifdef PROTOTYPES XEXPORT int Xgtprintf(const char *form, ...) X#else XEXPORT int Xgtprintf(form, va_alist) X char *form; X va_dcl X#endif X{ X va_list args; X int ret; X X#ifdef PROTOTYPES X va_start(args, form); X#else X va_start(args); X#endif X ret = fprformat(stdout, _(form), args); X va_end(args); X return (ret); X} X X/* VARARGS2 */ X#ifdef PROTOTYPES XEXPORT int Xfgtprintf(FILE *file, const char *form, ...) X#else XEXPORT int Xfgtprintf(file, form, va_alist) X FILE *file; X char *form; X va_dcl X#endif X{ X va_list args; X int ret; X X#ifdef PROTOTYPES X va_start(args, form); X#else X va_start(args); X#endif X ret = fprformat(file, _(form), args); X va_end(args); X return (ret); X} X X#else /* !USE_FPRFORMAT */ X/* X * This is the portable standard implementation that works anywhere. X */ X X#define BFSIZ 256 X Xtypedef struct { X short cnt; X char *ptr; X char buf[BFSIZ]; X int count; X FILE *f; X} *BUF, _BUF; X XLOCAL void _bflush __PR((BUF)); XLOCAL void _bput __PR((char, void *)); XEXPORT int fgtprintf __PR((FILE *, const char *, ...)); XEXPORT int gtprintf __PR((const char *, ...)); X XLOCAL void X_bflush(bp) X register BUF bp; X{ X bp->count += bp->ptr - bp->buf; X if (filewrite(bp->f, bp->buf, bp->ptr - bp->buf) < 0) X bp->count = EOF; X bp->ptr = bp->buf; X bp->cnt = BFSIZ; X} X X#ifdef PROTOTYPES XLOCAL void X_bput(char c, void *l) X#else XLOCAL void X_bput(c, l) X char c; X void *l; X#endif X{ X register BUF bp = (BUF)l; X X *bp->ptr++ = c; X if (--bp->cnt <= 0) X _bflush(bp); X} X X/* VARARGS1 */ X#ifdef PROTOTYPES XEXPORT int Xgtprintf(const char *form, ...) X#else XEXPORT int Xgtprintf(form, va_alist) X char *form; X va_dcl X#endif X{ X va_list args; X _BUF bb; X X bb.ptr = bb.buf; X bb.cnt = BFSIZ; X bb.count = 0; X bb.f = stdout; X#ifdef PROTOTYPES X va_start(args, form); X#else X va_start(args); X#endif X format(_bput, &bb, _(form), args); X va_end(args); X if (bb.cnt < BFSIZ) X _bflush(&bb); X return (bb.count); X} X X/* VARARGS2 */ X#ifdef PROTOTYPES XEXPORT int Xfgtprintf(FILE *file, const char *form, ...) X#else XEXPORT int Xfgtprintf(file, form, va_alist) X FILE *file; X char *form; X va_dcl X#endif X{ X va_list args; X _BUF bb; X X bb.ptr = bb.buf; X bb.cnt = BFSIZ; X bb.count = 0; X bb.f = file; X#ifdef PROTOTYPES X va_start(args, form); X#else X va_start(args); X#endif X format(_bput, &bb, _(form), args); X va_end(args); X if (bb.cnt < BFSIZ) X _bflush(&bb); X return (bb.count); X} X#endif END-of-star-1.6/libschily/gtprintf.c echo x - star-1.6/libschily/gtcomerr.c sed 's/^X//' >star-1.6/libschily/gtcomerr.c << 'END-of-star-1.6/libschily/gtcomerr.c' X/* @(#)gtcomerr.c 1.1 18/06/16 Copyright 1985-1989, 1995-2018 J. Schilling */ X/* X * Routines for printing command errors X * These routines call gettext() on the message first. X * X * Copyright (c) 1985-1989, 1995-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include /* include try to get size_t */ X#include /* Try again for size_t */ X#include /* Try again for size_t */ X#include X#include X#include X#include X#include X#include X XEXPORT void gtcomerr __PR((const char *, ...)); XEXPORT void gtxcomerr __PR((int, const char *, ...)); XEXPORT void gtcomerrno __PR((int, const char *, ...)); XEXPORT void gtxcomerrno __PR((int, int, const char *, ...)); XEXPORT int gterrmsg __PR((const char *, ...)); XEXPORT int gterrmsgno __PR((int, const char *, ...)); X X/* X * Fetch current errno, print a related message and exit(errno). X */ X/* VARARGS1 */ X#ifdef PROTOTYPES XEXPORT void Xgtcomerr(const char *msg, ...) X#else XEXPORT void Xgtcomerr(msg, va_alist) X char *msg; X va_dcl X#endif X{ X va_list args; X X#ifdef PROTOTYPES X va_start(args, msg); X#else X va_start(args); X#endif X (void) _comerr(stderr, COMERR_EXIT, 0, geterrno(), _(msg), args); X /* NOTREACHED */ X va_end(args); X} X X/* X * Fetch current errno, print a related message and exit(exc). X */ X/* VARARGS2 */ X#ifdef PROTOTYPES XEXPORT void Xgtxcomerr(int exc, const char *msg, ...) X#else XEXPORT void Xgtxcomerr(exc, msg, va_alist) X int exc; X char *msg; X va_dcl X#endif X{ X va_list args; X X#ifdef PROTOTYPES X va_start(args, msg); X#else X va_start(args); X#endif X (void) _comerr(stderr, COMERR_EXCODE, exc, geterrno(), _(msg), args); X /* NOTREACHED */ X va_end(args); X} X X/* X * Print a message related to err and exit(err). X */ X/* VARARGS2 */ X#ifdef PROTOTYPES XEXPORT void Xgtcomerrno(int err, const char *msg, ...) X#else XEXPORT void Xgtcomerrno(err, msg, va_alist) X int err; X char *msg; X va_dcl X#endif X{ X va_list args; X X#ifdef PROTOTYPES X va_start(args, msg); X#else X va_start(args); X#endif X (void) _comerr(stderr, COMERR_EXIT, 0, err, _(msg), args); X /* NOTREACHED */ X va_end(args); X} X X/* X * Print a message related to err and exit(exc). X */ X/* VARARGS3 */ X#ifdef PROTOTYPES XEXPORT void Xgtxcomerrno(int exc, int err, const char *msg, ...) X#else XEXPORT void Xgtxcomerrno(exc, err, msg, va_alist) X int exc; X int err; X char *msg; X va_dcl X#endif X{ X va_list args; X X#ifdef PROTOTYPES X va_start(args, msg); X#else X va_start(args); X#endif X (void) _comerr(stderr, COMERR_EXCODE, exc, err, _(msg), args); X /* NOTREACHED */ X va_end(args); X} X X/* X * Fetch current errno, print a related message and return(errno). X */ X/* VARARGS1 */ X#ifdef PROTOTYPES XEXPORT int Xgterrmsg(const char *msg, ...) X#else XEXPORT int Xgterrmsg(msg, va_alist) X char *msg; X va_dcl X#endif X{ X va_list args; X int ret; X X#ifdef PROTOTYPES X va_start(args, msg); X#else X va_start(args); X#endif X ret = _comerr(stderr, COMERR_RETURN, 0, geterrno(), _(msg), args); X va_end(args); X return (ret); X} X X/* X * Print a message related to err and return(err). X */ X/* VARARGS2 */ X#ifdef PROTOTYPES XEXPORT int Xgterrmsgno(int err, const char *msg, ...) X#else XEXPORT int Xgterrmsgno(err, msg, va_alist) X int err; X char *msg; X va_dcl X#endif X{ X va_list args; X int ret; X X#ifdef PROTOTYPES X va_start(args, msg); X#else X va_start(args); X#endif X ret = _comerr(stderr, COMERR_RETURN, 0, err, _(msg), args); X va_end(args); X return (ret); X} END-of-star-1.6/libschily/gtcomerr.c echo x - star-1.6/libschily/gterror.c sed 's/^X//' >star-1.6/libschily/gterror.c << 'END-of-star-1.6/libschily/gterror.c' X/* @(#)gterror.c 1.1 18/06/16 Copyright 1985, 1989, 1995-2018 J. Schilling */ X/* X * fprintf() on standard error stdio stream X * X * Copyright (c) 1985, 1989, 1995-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X#include X#include X#include X#include X X/* VARARGS1 */ X#ifdef PROTOTYPES XEXPORT int Xgterror(const char *fmt, ...) X#else XEXPORT int Xgterror(fmt, va_alist) X char *fmt; X va_dcl X#endif X{ X va_list args; X int ret; X X#ifdef PROTOTYPES X va_start(args, fmt); X#else X va_start(args); X#endif X ret = js_fprintf(stderr, "%r", _(fmt), args); X va_end(args); X return (ret); X} END-of-star-1.6/libschily/gterror.c echo x - star-1.6/libschily/openat64.c sed 's/^X//' >star-1.6/libschily/openat64.c << 'END-of-star-1.6/libschily/openat64.c' X/* @(#)openat64.c 1.1 18/07/23 Copyright 2018 J. Schilling */ X/* X * Copyright (c) 2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#define USE_LARGEFILES X X#include X X#ifdef HAVE_LARGEFILES X X#include "openat.c" X X#endif END-of-star-1.6/libschily/openat64.c echo x - star-1.6/libschily/fstatat64.c sed 's/^X//' >star-1.6/libschily/fstatat64.c << 'END-of-star-1.6/libschily/fstatat64.c' X/* @(#)fstatat64.c 1.1 18/07/23 Copyright 2018 J. Schilling */ X/* X * Copyright (c) 2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#define USE_LARGEFILES X X#include X X#ifdef HAVE_LARGEFILES X X#include "fstatat.c" X X#endif END-of-star-1.6/libschily/fstatat64.c echo x - star-1.6/libschily/format.h sed 's/^X//' >star-1.6/libschily/format.h << 'END-of-star-1.6/libschily/format.h' X/* @(#)format.h 1.4 18/09/10 Copyright 2018 J. Schilling */ X/* X * Definitions used in common by format.c and fconf.c X * X * Copyright (c) 2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#ifndef _FORMAT_H X#define _FORMAT_H X X/* X * printf() modifier flags X */ X#define MINUSFLG 1 /* '-' flag */ X#define PLUSFLG 2 /* '+' flag */ X#define SPACEFLG 4 /* ' ' flag */ X#define HASHFLG 8 /* '#' flag */ X#define APOFLG 16 /* '\'' flag */ X#define GOTDOT 32 /* '.' found */ X#define GOTSTAR 64 /* '*' found */ X#define UPPERFLG 128 /* %E/%F/%G */ X#define PADZERO 256 /* '0' pad */ X#define STRIPZERO 512 /* %g like trailing '0' removal */ X X#define SIGNFLG 0x10000 /* sign flag from *cvt() */ X Xextern int _ftoes __PR((char *, double, int, int, int)); Xextern int _ftofs __PR((char *, double, int, int, int)); Xextern int _ftogs __PR((char *, double, int, int, int)); X#ifdef HAVE_LONGDOUBLE Xextern int _qftoes __PR((char *, long double, int, int, int)); Xextern int _qftofs __PR((char *, long double, int, int, int)); Xextern int _qftogs __PR((char *, long double, int, int, int)); X#endif X X#endif /* _FORMAT_H */ END-of-star-1.6/libschily/format.h echo x - star-1.6/libschily/ovstrcpy.c sed 's/^X//' >star-1.6/libschily/ovstrcpy.c << 'END-of-star-1.6/libschily/ovstrcpy.c' X/* @(#)ovstrcpy.c 1.1 18/10/14 Copyright 2009-2018 J. Schilling */ X#include X#ifndef lint Xstatic UConst char sccsid[] = X "@(#)ovstrcpy.c 1.1 18/10/14 Copyright 2009-2018 J. Schilling"; X#endif X/* X * A strcpy() that works with overlapping buffers X * X * Copyright (c) 2009-2018 J. Schilling X */ X/* X * The contents of this file are subject to the terms of the X * Common Development and Distribution License, Version 1.0 only X * (the "License"). You may not use this file except in compliance X * with the License. X * X * See the file CDDL.Schily.txt in this distribution for details. X * A copy of the CDDL is also available via the Internet at X * http://www.opensource.org/licenses/cddl1.txt X * X * When distributing Covered Code, include this CDDL HEADER in each X * file and include the License file CDDL.Schily.txt from this distribution. X */ X X#include X#include X XEXPORT char *ovstrcpy __PR((char *s1, const char *s2)); X XEXPORT char * Xovstrcpy(s1, s2) X register char *s1; X register const char *s2; X{ X char *ret = s1; X X while ((*s1++ = *s2++) != '\0') X ; X X return (ret); X} END-of-star-1.6/libschily/ovstrcpy.c echo c - star-1.6/tests mkdir -p star-1.6/tests > /dev/null 2>&1 echo c - star-1.6/tests/bin mkdir -p star-1.6/tests/bin > /dev/null 2>&1 echo x - star-1.6/tests/bin/base sed 's/^X//' >star-1.6/tests/bin/base << 'END-of-star-1.6/tests/bin/base' X#!/bin/sh X########################################################################### X# @(#)base 1.3 16/06/23 Written 2011-2016 by J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X# X# Include all base definitions if not done already X# X########################################################################### Xif test ."$x_echo" = . Xthen X . ${SRCROOT}/tests/bin/echo_nonl X . ${SRCROOT}/tests/bin/misc X . ${SRCROOT}/tests/bin/docommand X . ${SRCROOT}/tests/bin/seq X . ${SRCROOT}/tests/bin/xtest Xfi END-of-star-1.6/tests/bin/base echo x - star-1.6/tests/bin/docommand sed 's/^X//' >star-1.6/tests/bin/docommand << 'END-of-star-1.6/tests/bin/docommand' X#!/bin/sh X########################################################################### X# @(#)docommand 1.13 18/09/20 Written 2011-2016 by J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X# X# docommand() the base test function X# X# Call: docommand [options] parameters X# X# Options: X# -silent do not print command label nor "passed" X# -esilent be silent for errors to permit hidden tests X# -noremove do not remove exp.*, got.* and cmd.last X# -wo call diff -w to compare the stdout X# -we call diff -w to compare the stderr X# -bo call diff -b to compare the stdout X# -be call diff -b to compare the stderr X# X# Parameters: X# $1 a command label to be printed X# $2 a command to be executed X# $3 the expected exit code or IGNORE or "!=0" X# $4 the expected stdout or IGNORE or NONEMPTY X# $5 the expected stderr or IGNORE or NONEMPTY X# X# Example: X# docommand T1 "echo test" 0 "test\n" "" X# X########################################################################### Xdocommand() { X fail_init X do_remove X silent=false X esilent=false X diffout="" X wo="" X we="" X bo="" X be="" X noremove=false X cmd_label="$1" X while true X do X case "$1" in X -silent | --silent) X silent=true X shift X ;; X -esilent | --esilent) X esilent=true X diffout=">/dev/null" X shift X ;; X -noremove | --noremove) X noremove=true X shift X ;; X -wo | --wo) X wo=-w X shift X ;; X -we | --we) X we=-w X shift X ;; X -bo | --bo) X bo=-b X shift X ;; X -be | --be) X be=-b X shift X ;; X *) X break X ;; X esac X done X cmd_label="$1" X X $silent || echo_nonl "$cmd_label"... X X echo "$2" > cmd.last # Remember last command X echo "$2" >> cmd.log # Add last command to history X eval "$2" > got.stdout 2> got.stderr # run current command X cmd_exit=$? # Save exit code X X if test "$3" != "IGNORE" # Verify exit code? X then X if test "$3" = "!=0" -a "$cmd_exit" -ne 0 X then X : X # $3 may be text, so always use a string compare X elif test "$3" != "!=0" -a "$3" = "$cmd_exit" X then X : X else X if test -s got.stderr X then X stderr=`cat got.stderr` X msg="Error message: $stderr" X else X msg="No error message was printed on stderr" X fi X fail "$cmd_label: \"$2\" Expected exit code $3, got $cmd_exit X$msg" X fi X fi X if test "$4" = "NONEMPTY" # Need stdout msg? X then X if test ! -s got.stdout X then X fail "$cmd_label: \"$2\" No error message was printed on stdout" X fi X elif test "$4" != "IGNORE" # Verify stdout? X then X echo_nonl "$4" > exp.stdout # Save stdout sample to file X echo >> exp.stdout # Make sample end in newline X echo >> got.stdout # Make output end in newline X eval diff $wo $bo exp.stdout got.stdout $diffout || \ X fail "$cmd_label: stdout format error with $2" X fi X if test "$5" = "NONEMPTY" # Need stderr msg? X then X if test ! -s got.stderr X then X fail "$cmd_label: \"$2\" No error message was printed on stderr" X fi X elif test "$5" != "IGNORE" # Verify stderr? X then X echo_nonl "$5" > exp.stderr # Save stderr sample to file X echo >> exp.stderr # Make sample end in newline X echo >> got.stderr # Make output end in newline X eval diff $we $be exp.stderr got.stderr $diffout || \ X fail "$cmd_label: stderr format error with $2" X fi X X $noremove || do_remove X $silent || echo "passed" X true X} X X########################################################################### X# X# do_output() alternate test function with "stdout" reference in a file X# X# Call: do_output [options] parameters X# X# Options: X# -silent do not print command label nor "passed" X# -esilent be silent for errors to permit hidden tests X# -noremove do not remove exp.*, got.* and cmd.last X# -wo call diff -w to compare the stdout X# -we call diff -w to compare the stderr X# -bo call diff -b to compare the stdout X# -be call diff -b to compare the stderr X# X# Parameters: X# $1 a command label to be printed X# $2 a command to be executed X# $3 the expected exit code or IGNORE or "!=0" X# $4 the expected stdout contained in a file or IGNORE or NONEMPTY X# $5 the expected stderr or IGNORE or NONEMPTY X# X# Example: X# echo test > out_file X# do_output T1 "echo test" 0 out_file "" X# X########################################################################### Xdo_output() { X fail_init X do_remove X silent=false X esilent=false X diffout="" X wo="" X we="" X bo="" X be="" X noremove=false X cmd_label="$1" X while true X do X case "$1" in X -silent | --silent) X silent=true X shift X ;; X -esilent | --esilent) X esilent=true X diffout=">/dev/null" X shift X ;; X -noremove | --noremove) X noremove=true X shift X ;; X -wo | --wo) X wo=-w X shift X ;; X -we | --we) X we=-w X shift X ;; X -bo | --bo) X bo=-b X shift X ;; X -be | --be) X be=-b X shift X ;; X *) X break X ;; X esac X done X cmd_label="$1" X X $silent || echo_nonl "$cmd_label"... X X echo "$2" > cmd.last # Remember last command X echo "$2" >> cmd.log # Add last command to history X eval "$2" > got.stdout 2> got.stderr # run current command X cmd_exit=$? # Save exit code X X if test "$3" != "IGNORE" # Verify exit code? X then X if test "$3" = "!=0" -a "$cmd_exit" -ne 0 X then X : X # $3 may be text, so always use a string compare X elif test "$3" != "!=0" -a "$3" = "$cmd_exit" X then X : X else X if test -s got.stderr X then X stderr=`cat got.stderr` X msg="Error message: $stderr" X else X msg="No error message was printed on stderr" X fi X fail "$cmd_label: \"$2\" Expected exit code $3, got $cmd_exit X$msg" X fi X fi X if test "$4" = "NONEMPTY" # Need stdout msg? X then X if test ! -s got.stdout X then X fail "$cmd_label: \"$2\" No error message was printed on stdout" X fi X elif test "$4" != "IGNORE" # Verify stdout? X then X eval diff $wo $bo "$4" got.stdout $diffout || \ X fail "$cmd_label: stdout format error with $2" X fi X if test "$5" = "NONEMPTY" # Need stderr msg? X then X if test ! -s got.stderr X then X fail "$cmd_label: \"$2\" No error message was printed on stderr" X fi X elif test "$5" != "IGNORE" # Verify stderr? X then X echo_nonl "$5" > exp.stderr # Save stderr sample to file X echo >> exp.stderr # Make sample end in newline X echo >> got.stderr # Make output end in newline X eval diff $we $be exp.stderr got.stderr $diffout || \ X fail "$cmd_label: stderr format error with $2" X fi X X $noremove || do_remove X $silent || echo "passed" X true X} X X########################################################################### X# X# do_error() alternate test function with "stderr" reference in a file X# X# Call: do_error [options] parameters X# X# Options: X# -silent do not print command label nor "passed" X# -esilent be silent for errors to permit hidden tests X# -noremove do not remove exp.*, got.* and cmd.last X# -wo call diff -w to compare the stdout X# -we call diff -w to compare the stderr X# -bo call diff -b to compare the stdout X# -be call diff -b to compare the stderr X# X# Parameters: X# $1 a command label to be printed X# $2 a command to be executed X# $3 the expected exit code or IGNORE or "!=0" X# $4 the expected stdout or IGNORE or NONEMPTY X# $5 the expected stderr contained in a file or IGNORE or NONEMPTY X# X# Example: X# :> err_file X# do_error T1 "echo test" 0 "test\n" err_file X# X########################################################################### Xdo_error() { X fail_init X do_remove X silent=false X esilent=false X diffout="" X wo="" X we="" X bo="" X be="" X noremove=false X cmd_label="$1" X while true X do X case "$1" in X -silent | --silent) X silent=true X shift X ;; X -esilent | --esilent) X esilent=true X diffout=">/dev/null" X shift X ;; X -noremove | --noremove) X noremove=true X shift X ;; X -wo | --wo) X wo=-w X shift X ;; X -we | --we) X we=-w X shift X ;; X -bo | --bo) X bo=-b X shift X ;; X -be | --be) X be=-b X shift X ;; X *) X break X ;; X esac X done X cmd_label="$1" X X $silent || echo_nonl "$cmd_label"... X X echo "$2" > cmd.last # Remember last command X echo "$2" >> cmd.log # Add last command to history X eval "$2" > got.stdout 2> got.stderr # run current command X cmd_exit=$? # Save exit code X X if test "$3" != "IGNORE" # Verify exit code? X then X if test "$3" = "!=0" -a "$cmd_exit" -ne 0 X then X : X # $3 may be text, so always use a string compare X elif test "$3" != "!=0" -a "$3" = "$cmd_exit" X then X : X else X if test -s got.stderr X then X stderr=`cat got.stderr` X msg="Error message: $stderr" X else X msg="No error message was printed on stderr" X fi X fail "$cmd_label: \"$2\" Expected exit code $3, got $cmd_exit X$msg" X fi X fi X if test "$4" = "NONEMPTY" # Need stdout msg? X then X if test ! -s got.stdout X then X fail "$cmd_label: \"$2\" No error message was printed on stdout" X fi X elif test "$4" != "IGNORE" # Verify stdout? X then X echo_nonl "$4" > exp.stdout # Save stdout sample to file X echo >> exp.stdout # Make sample end in newline X echo >> got.stdout # Make output end in newline X eval diff $wo $bo exp.stdout got.stdout $diffout || \ X fail "$cmd_label: stdout format error with $2" X fi X if test "$5" = "NONEMPTY" # Need stderr msg? X then X if test ! -s got.stderr X then X fail "$cmd_label: \"$2\" No error message was printed on stderr" X fi X elif test "$5" != "IGNORE" # Verify stderr? X then X eval diff $we $be "$5" got.stderr $diffout || \ X fail "$cmd_label: stderr format error with $2" X fi X X $noremove || do_remove X $silent || echo "passed" X true X} X X########################################################################### X# X# do_outerr() alternate test function with "stdout/err" reference in a file X# X# Call: do_outerr [options] parameters X# X# Options: X# -silent do not print command label nor "passed" X# -esilent be silent for errors to permit hidden tests X# -noremove do not remove exp.*, got.* and cmd.last X# -wo call diff -w to compare the stdout X# -we call diff -w to compare the stderr X# -bo call diff -b to compare the stdout X# -be call diff -b to compare the stderr X# X# Parameters: X# $1 a command label to be printed X# $2 a command to be executed X# $3 the expected exit code or IGNORE or "!=0" X# $4 the expected stdout contained in a file or IGNORE or NONEMPTY X# $5 the expected stderr contained in a file or IGNORE or NONEMPTY X# X# Example: X# echo test > out_file X# :> err_file X# do_outerr T1 "echo test" 0 out_file err_file X# X########################################################################### Xdo_outerr() { X fail_init X do_remove X silent=false X esilent=false X diffout="" X wo="" X we="" X bo="" X be="" X noremove=false X cmd_label="$1" X while true X do X case "$1" in X -silent | --silent) X silent=true X shift X ;; X -esilent | --esilent) X esilent=true X diffout=">/dev/null" X shift X ;; X -noremove | --noremove) X noremove=true X shift X ;; X -wo | --wo) X wo=-w X shift X ;; X -we | --we) X we=-w X shift X ;; X -bo | --bo) X bo=-b X shift X ;; X -be | --be) X be=-b X shift X ;; X *) X break X ;; X esac X done X cmd_label="$1" X X $silent || echo_nonl "$cmd_label"... X X echo "$2" > cmd.last # Remember last command X echo "$2" >> cmd.log # Add last command to history X eval "$2" > got.stdout 2> got.stderr # run current command X cmd_exit=$? # Save exit code X X if test "$3" != "IGNORE" # Verify exit code? X then X if test "$3" = "!=0" -a "$cmd_exit" -ne 0 X then X : X # $3 may be text, so always use a string compare X elif test "$3" != "!=0" -a "$3" = "$cmd_exit" X then X : X else X if test -s got.stderr X then X stderr=`cat got.stderr` X msg="Error message: $stderr" X else X msg="No error message was printed on stderr" X fi X fail "$cmd_label: \"$2\" Expected exit code $3, got $cmd_exit X$msg" X fi X fi X if test "$4" = "NONEMPTY" # Need stdout msg? X then X if test ! -s got.stdout X then X fail "$cmd_label: \"$2\" No error message was printed on stdout" X fi X elif test "$4" != "IGNORE" # Verify stdout? X then X eval diff $wo $bo "$4" got.stdout $diffout || \ X fail "$cmd_label: stdout format error with $2" X fi X if test "$5" = "NONEMPTY" # Need stderr msg? X then X if test ! -s got.stderr X then X fail "$cmd_label: \"$2\" No error message was printed on stderr" X fi X elif test "$5" != "IGNORE" # Verify stderr? X then X eval diff $we $be "$5" got.stderr $diffout || \ X fail "$cmd_label: stderr format error with $2" X fi X X $noremove || do_remove X $silent || echo "passed" X true X} X Xdo_remove() { X remove exp.stdout exp.stderr got.stdout got.stderr cmd.last X} END-of-star-1.6/tests/bin/docommand echo x - star-1.6/tests/bin/echo_nonl sed 's/^X//' >star-1.6/tests/bin/echo_nonl << 'END-of-star-1.6/tests/bin/echo_nonl' X#!/bin/sh X########################################################################### X# @(#)echo_nonl 1.4 16/06/22 Written 2011-2014 by J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X# X# echo_nnl() is a echo function that does not echo a new line and that X# expands POSIX ecape sequences. X# If no suitable echo function is found on the system, the X# script is aborted. X# X########################################################################### X# X# echo -n is the BSD variant for echo with no newline X# echo -e switches on POSIX echo features in bash X# echo "foo\c" is the POSIX variant of telling echo not to write a new line X# echo "\0nnn" with "nnn" being one to three octal digits is the POSIX escape X# X########################################################################### Xfound_echo_nnl=false Xfor x_echo in echo /bin/echo /usr/bin/echo /usr/5bin/echo /usr/xpg*/bin/echo Xdo X if test \( $x_echo != "echo" -a ! -f $x_echo \) X then X continue X fi X ac_n= ac_e= ac_c= X if ($x_echo "test\c" ; echo bla) | grep c > /dev/null X then X if ( $x_echo -e "test\c" ; echo bla ) | grep c > /dev/null X then X if ( $x_echo -n "test" | sed 's/-n/nn/' ; echo bla ) | grep nn > /dev/null X then X ac_n=-n X fi X else X ac_e=-e X ac_c='\c' X fi X else X ac_c='\c' X fi X if ($x_echo $ac_n $ac_e "test\0122$ac_c" ; echo bla ) | grep 122 > /dev/null X then X : X else X # X # "dash" comes with a builtin "echo" that stops at null bytes, so we X # need to check whether it prints 4 or 7 bytes. X # X if ($x_echo $ac_n $ac_e "test\000\000Z$ac_c") | wc -c | grep 7 > /dev/null X then X found_echo_nnl=true X break X fi X fi Xdone Xif test "$found_echo_nnl" = false Xthen X echo "No suitable echo command found" X exit 255 Xfi X Xecho_nonl() { X # X # bash is broken here and will cause junk to be written in case that X # the parameter is an empty string. X # X if test -z "$*" X then X : X else X $x_echo $ac_n $ac_e "$@$ac_c" X fi X} X X#echo $x_echo X#set END-of-star-1.6/tests/bin/echo_nonl echo x - star-1.6/tests/bin/misc sed 's/^X//' >star-1.6/tests/bin/misc << 'END-of-star-1.6/tests/bin/misc' X#!/bin/sh X########################################################################### X# @(#)misc 1.4 16/07/10 Written 2011-2016 by J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X# X# Miscellaneous test functions X# X########################################################################### X# X# xfail() is used internally to handle failed commands X# X########################################################################### Xxfail() { X echo "$0 could not be completed:" "$@" X exit 1 X} X X########################################################################### X# X# remove() is used internally to remove files created by the test X# X########################################################################### Xremove() { X if test -z "$*" X then X : X else X rm -rf "$@" || xfail "Could not remove $@" X fi X} X X########################################################################### X# X# rename() rename files and check for success X# X########################################################################### Xrename() { X mv "$1" "$2" || xfail "Could not rename $1 to $2" X} X X########################################################################### X# X# success() is the clear up code called at the end of a test script X# X########################################################################### Xsuccess() { X remove exp.stdout exp.stderr got.stdout got.stderr cmd.last cmd.log X X echo X echo "All tests in $0 have completed" X if ${expect_fail-false} X then X echo XPASS "$0" "$@" X exit 0 X else X echo PASS "$0" "$@" X exit 0 X fi X} X X########################################################################### X# X# expect_fail is used to tell docommand() and do_output() not to abort a X# test script completely in case of a failure. X# X# Make sure to set it back to "false" after relelated tests X# Allow a global overwrite to "true" from $EXPECT_FAIL X# X########################################################################### Xexpect_fail=false Xif test .$EXPECT_FAIL = .true Xthen X expect_fail=true Xfi X X########################################################################### X# X# fail() is called by docommand() and do_output() in case of a X# miscompare. If "expect_fail=true", the whole test script X# is aborted. X# X########################################################################### Xfail() { X if ${expect_fail-false} X then X if ${esilent-false} X then X : X else X echo XFAIL "$0" "$@" X fi X failed=true X false X else X echo FAIL "$0" "$@" X exit 2 X fi X} X Xfail_init() { X failed=false X} END-of-star-1.6/tests/bin/misc echo x - star-1.6/tests/bin/xtest sed 's/^X//' >star-1.6/tests/bin/xtest << 'END-of-star-1.6/tests/bin/xtest' X#!/bin/sh X########################################################################### X# @(#)xtest 1.1 15/04/25 Written 2015 by J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X# X# Extended "test" commands. X# X########################################################################### X# X# wtest: function to implement "test -w file" if we are root X# X########################################################################### Xwtest() { X test "$1" "$2" X if [ $? -ne 0 ]; then X return 1 X fi X if [ "$1" != "-w" ]; then X return 0 X fi X ls -l "$2" | grep '^-r--r--r--' >/dev/null 2>/dev/null X if [ $? -eq 0 ]; then X return 1 X fi X return 0 X} END-of-star-1.6/tests/bin/xtest echo x - star-1.6/tests/bin/seq sed 's/^X//' >star-1.6/tests/bin/seq << 'END-of-star-1.6/tests/bin/seq' X#!/bin/sh X########################################################################### X# @(#)seq 1.1 16/06/23 Written 2016 by J. Schilling X########################################################################### X# The contents of this file are subject to the terms of the X# Common Development and Distribution License, Version 1.0 only X# (the "License"). You may not use this file except in compliance X# with the License. X# X# See the file CDDL.Schily.txt in this distribution for details. X# A copy of the CDDL is also available via the Internet at X# http://www.opensource.org/licenses/cddl1.txt X# X# When distributing Covered Code, include this CDDL HEADER in each X# file and include the License file CDDL.Schily.txt from this distribution. X########################################################################### X# X# Define a simple seq if the command is missing X# X########################################################################### Xif type seq > /dev/null; then X : Xelse X seq() { X cnt_seq=$1 X while [ $cnt_seq -le $2 ]; do X echo $cnt_seq X cnt_seq=`expr $cnt_seq + 1` X done X } Xfi END-of-star-1.6/tests/bin/seq echo c - star-1.6/tests/testutils mkdir -p star-1.6/tests/testutils > /dev/null 2>&1 echo x - star-1.6/tests/testutils/realpwd sed 's/^X//' >star-1.6/tests/testutils/realpwd << 'END-of-star-1.6/tests/testutils/realpwd' X#!/bin/sh X/bin/pwd END-of-star-1.6/tests/testutils/realpwd echo x - star-1.6/tests/testutils/user sed 's/^X//' >star-1.6/tests/testutils/user << 'END-of-star-1.6/tests/testutils/user' X#!/bin/sh X Xif [ $# -lt 1 ]; then X echo bla Xfi Xif [ "$1" = "name" ]; then X n=`id | sed -e 's/).*//' -e 's/.*(//' ` X echo $n Xfi Xif [ "$1" = "group" ]; then X n=`id | sed -e 's/.*id=//' -e 's/[ (].*//'` X echo $n Xfi Xif [ "$1" = "foreigngroup" ]; then X echo 4711 Xfi END-of-star-1.6/tests/testutils/user echo x - star-1.6/tests/testutils/decompress_stdin.sh sed 's/^X//' >star-1.6/tests/testutils/decompress_stdin.sh << 'END-of-star-1.6/tests/testutils/decompress_stdin.sh' X#!/bin/sh Xtype uncompress > /dev/null && exec uncompress Xtype gzip > /dev/null && exec gzip -df Xexit 1 END-of-star-1.6/tests/testutils/decompress_stdin.sh echo x - star-1.6/tests/testutils/yes sed 's/^X//' >star-1.6/tests/testutils/yes << 'END-of-star-1.6/tests/testutils/yes' X#!/bin/sh X Xif test $# -lt 1 Xthen Xarg="y" Xelse Xarg="$1" Xfi X Xwhile echo "$arg" Xdo X : Xdone END-of-star-1.6/tests/testutils/yes echo x - star-1.6/tests/testutils/README sed 's/^X//' >star-1.6/tests/testutils/README << 'END-of-star-1.6/tests/testutils/README' XThe scripts in this directory have been written to permit the tests in X../cssctests/* to work without a need for having binary programs. END-of-star-1.6/tests/testutils/README echo x - star-1.6/tests/testutils/yammer sed 's/^X//' >star-1.6/tests/testutils/yammer << 'END-of-star-1.6/tests/testutils/yammer' X#!/bin/sh X Xif test $# -lt 2 Xthen X echo "Usage yammer count string" Xfi X XI=1 Xwhile true Xdo X if test $I -gt $1 X then X break X fi X echo $I "$2" X I=`expr $I + 1` Xdone END-of-star-1.6/tests/testutils/yammer echo x - star-1.6/tests/testutils/uu_decode sed 's/^X//' >star-1.6/tests/testutils/uu_decode << 'END-of-star-1.6/tests/testutils/uu_decode' X#!/bin/sh Xuudecode END-of-star-1.6/tests/testutils/uu_decode echo x - star-1.6/tests/testutils/ekko sed 's/^X//' >star-1.6/tests/testutils/ekko << 'END-of-star-1.6/tests/testutils/ekko' X#!/bin/sh X X. ${SRCROOT}/tests/bin/echo_nonl X Xcase "$1" in X-n | -ne) shift;; Xesac X Xecho_nonl "$@" X END-of-star-1.6/tests/testutils/ekko exit